/* ============================================
   ГЛОБАЛЬНЫЕ СТИЛИ
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
}

/* ============================================
   NAVIGATION - MOBILE OPTIMIZED (Phase 16)
   ============================================ */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 45px;
    width: auto;
}
.logo-image {
    height: 32px;
    width: auto;
    display: none; /* Phase 59: hidden on desktop */
}


/* Phase 59: Burger menu logo */
.burger-logo {
    height: 35px;
    width: auto;
    display: block;
}

/* Phase 59: Main logo */
.main-logo {
    height: 45px;
    width: auto;
}

.menu-toggle-checkbox {
    display: none !important;
}

.menu-toggle-label {
    display: block;
    cursor: pointer;
    font-size: 28px;
    color: #e2e8f0;
    padding: 8px 10px; /* Phase 78: increased from 4px 8px */
    user-select: none;
    margin-left: auto;
    min-width: 44px; /* Phase 78: iOS HIG minimum touch target */
    min-height: 44px; /* Phase 78: iOS HIG minimum touch target */
    display: flex; /* Phase 78: for centering */
    align-items: center; /* Phase 78: vertical center */
    justify-content: center; /* Phase 78: horizontal center */
}

/* ========================================
   NAVIGATION STYLES - PERPLEXITY INSPIRED (PHASE 61)
   Dark theme with clean, minimal design
   ======================================== */

.nav-links-wrapper {
    display: none;
    position: absolute;
    top: 57px;
    left: 0;
    right: 0;
    background: #1e293b;
    flex-direction: column;
    gap: 6px; /* Phase 78: increased from 4px */
    padding: 10px; /* Phase 78: increased from 8px */
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
}

.menu-toggle-checkbox:checked ~ .nav-links-wrapper {
    display: flex;
}

/* Navigation Links - Perplexity Style */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px; /* Phase 78: increased from 10px 18px */
    font-size: 17px; /* Phase 78: increased from 15px (+13%) */
    font-weight: 500;
    line-height: 1.5; /* Phase 78: improved from 1.4 */
    text-decoration: none;
    letter-spacing: -0.01em;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: 44px; /* Phase 78: iOS HIG minimum touch target */
}

/* Hover State */
.nav-link:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Active State */
.nav-link.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

.nav-link.active:hover {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.35);
}

/* Focus State (accessibility) */
.nav-link:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Logout button */
.nav-link.logout {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
}

.nav-link.logout:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
    color: #fecaca;
}

.user-info {
    color: #94a3b8;
    font-size: 13px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

@media (min-width: 769px) {
    .menu-toggle-label {
        display: none !important;
    }

    .burger-logo {
        display: none;
    }

    .nav-links-wrapper {
        display: flex;
        position: static;
        flex-direction: row;
        gap: 8px;
        padding: 0;
        border: none;
        background: transparent;
    }

    .nav-link {
        padding: 8px 16px;
        border-radius: 10px;
        font-size: 14px;
    }

    .user-info {
        padding: 8px 16px;
        border: none;
    }
}




/* ========================================
   PAGE TITLE STYLES (PHASE 61)
   Consistent heading size across pages
   ======================================== */

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary, #f9fafb);
    margin: 0 0 24px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}


/* ========================================
   Phase 71: Typography - Inter + Manrope
   ======================================== */

/* Headings - Manrope */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin: 0 0 1rem 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

h5 {
    font-size: 1.1rem;
    font-weight: 600;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
}

/* Paragraphs - Inter */
p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    margin-bottom: 1rem;
}

/* Links */
a {
    font-family: inherit;
    font-weight: 500;
}

/* Buttons - Inter */
button, .btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Tables - Inter */
table {
    font-family: 'Inter', sans-serif;
}

th {
    font-weight: 600;
}

td {
    font-weight: 400;
}

/* Forms - Inter */
input, textarea, select {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* Code - Monospace */
code, pre {
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Font weight utilities */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Page title - Manrope */
.page-title {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 'Helvetica Neue', Arial, sans-serif;
}

/* Responsive typography */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }
    h4 { font-size: 1.15rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    body {
        font-size: 12px;
    }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
}

/* ============================================
   НАВИГАЦИЯ
   ============================================ */


/* ============================================
   КОНТЕЙНЕР
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 15px;
}

/* ============================================
   АЛЕРТЫ
   ============================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

/* ============================================
   СТРАНИЦА ВХОДА
   ============================================ */

.login-container {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-block {
    width: 100%;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.login-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.8;
}

.login-hint code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--accent-blue);
    font-family: monospace;
}

/* ============================================
   ДАШБОРД
   ============================================ */

.dashboard-header, .page-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h2, .page-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p, .page-header p {
    color: var(--text-muted);
}

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-blue);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   ФИНАНСОВАЯ СВОДКА
   ============================================ */

.finance-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.finance-summary h3 {
    margin-bottom: 1.5rem;
}

.finance-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.finance-item {
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.finance-item.income {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-green);
}

.finance-item.expense {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-red);
}

.finance-item.balance.positive {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-green);
}

.finance-item.balance.negative {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-red);
}

.finance-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.finance-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ============================================
   БЫСТРЫЕ ДЕЙСТВИЯ
   ============================================ */

.quick-actions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
}

.quick-actions h3 {
    margin-bottom: 1.5rem;
}

.actions-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 2rem;
}

.action-text {
    font-weight: 500;
}

/* ============================================
   ГРАФИКИ
   ============================================ */

.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.chart-container h3 {
    margin-bottom: 1.5rem;
}

.chart-container canvas {
    max-height: 400px;
}

/* ============================================
   ТАБЛИЦЫ
   ============================================ */

.reports-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    overflow-x: auto;
}

.reports-table h3 {
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table .number {
    text-align: right;
    font-family: monospace;
}

.data-table .income {
    color: var(--accent-green);
}

.data-table .expense {
    color: var(--accent-red);
}

.data-table .no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    

    

    .stats-grid,
    .finance-grid,
    .actions-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }
}

/* ===== STAT-BOXES ===== */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-box h3 {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.stat-box .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #e2e8f0;
}

/* ===== FINANCE CARDS ===== */
.finance-summary {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    overflow: hidden;
    box-sizing: border-box;
}

.finance-summary h3 {
    font-size: 16px;
    color: #e2e8f0;
    margin-bottom: 16px;
}

.finance-cards {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    margin-bottom: 2rem;
    box-sizing: border-box;
    max-width: 100%;
}
/* Two cards layout (Income + Expense) */
.finance-cards-two {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.finance-card {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.finance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.finance-card.income {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(22, 163, 74, 0.35) 100%) !important;
    border: none !important;
}

.finance-card.terminal {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.35) 100%) !important;
    border: none !important;
}

.finance-card.balance {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid #3b82f6;
}

/* Блок Бухгалтер - светло-серый */
.finance-card.accounting {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.25) 0%, rgba(71, 85, 105, 0.35) 100%) !important;
    border: none !important;
}
/* Блок Наличные - светло-оранжевый */
.finance-card.cash {
    background: linear-gradient(135deg, rgba(248, 215, 160, 0.25) 0%, rgba(244, 197, 131, 0.35) 100%) !important;
    color: #1f2937 !important;
    border: none !important;
}


.finance-card span {
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finance-card .amount {
    font-size: 24px;
    font-weight: 700;
    color: #e2e8f0;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-box {
        padding: 10px;
    }
    
    .stat-box h3 {
        font-size: 11px;
    }
    
    .stat-box .stat-value {
        font-size: 20px;
    }
    
    .finance-summary {
        padding: 12px;
        overflow: hidden;
    }
    .finance-cards {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0.5rem;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    .finance-card {
        padding: 0.6rem 0.4rem;
        min-width: 0;
        overflow: hidden;
    }
    .finance-card span {
        font-size: 11px;
    }
    .finance-card .amount {
        font-size: 1rem;
        margin-top: 4px;
    }
    .finance-cards-two {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .finance-cards-three {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .finance-card .amount {
        font-size: 1.5rem;
    }
}

/* ============================================
   LOGO CONTAINER STYLES - Phase 0.5
   ============================================ */


/* Mobile optimization */
@media (max-width: 768px) {
    
    
    
    
    
}


/* ============================================
   ACTION BUTTONS - Phase 6
   ============================================ */

td.actions {
    text-align: center;
    white-space: nowrap;
}

.btn-download {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #2563eb;
}

.btn-download:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-delete {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #dc2626;
    margin-left: 4px;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    td.actions {
        padding: 4px 2px;
    }
    .btn-download, .btn-delete {
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .btn-download {
        padding: 6px;
        font-size: 16px;
    }
    .btn-download::after {
        content: '';
    }
}


/* ============================================
   DATE FILTERS - COMPACT LAYOUT
   ============================================ */

.date-filter {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 24px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover {
    background: rgba(220, 220, 220, 0.2);
    border-color: #DCDCDC;
}

.filter-btn.active {
    background: #DCDCDC;
    color: var(--text-primary); /* Phase 79 fix */
    font-weight: 600;
}

.custom-date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-input-group label {
    font-size: 13px;
    color: #94a3b8;
}

.date-input-group input[type="date"] {
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
}

/* Mobile - 2 lines */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .custom-date-inputs {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        align-items: start;
    }

    /* Date input groups in 2 columns */
    .custom-date-inputs .date-input-group:first-of-type {
        grid-column: 1;
        grid-row: 1;
    }

    .custom-date-inputs .date-input-group:last-of-type {
        grid-column: 2;
        grid-row: 1;
    }

    /* Hidden inputs should not affect grid */
    .custom-date-inputs input[type="hidden"] {
        display: none;
    }

    /* Button spans full width */
    .custom-date-inputs .btn-apply-old {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        margin-top: 4px;
    }

    /* Compact date inputs */
    .date-input-group input[type="date"] {
        font-size: 14px;
        padding: 6px 8px;
        width: 100%;
    }

    /* Compact labels */
    .date-input-group label {
        font-size: 12px;
        margin-bottom: 2px;
    }

    /* Stack label above input on mobile */
    .date-input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

/* For very small screens (iPhone SE) */
@media (max-width: 375px) {
    .date-input-group input[type="date"] {
        font-size: 13px;
        padding: 5px 6px;
    }
}

/* ========================================
   СТРАНИЦА БУХГАЛТЕРИЯ
   ======================================== */

.text-right {
    text-align: right;
}

.accounting-table {
    width: 100%;
    border-collapse: collapse;
}

.accounting-table .company-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accounting-table .amount-cell {
    font-weight: 600;
    color: #22c55e;
}

/* Статистика */
.stats-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary); /* Phase 79 fix */
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary); /* Phase 79 fix */
}

/* Фильтры */
.filters-section {
    margin-bottom: 30px;
}

.filters-form {
    display: flex;
    align-items: center;
}

.date-filters {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #64748b;
}

.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: white;
}

.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Таблица - контейнер */
.table-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state p {
    font-size: 18px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .accounting-table .company-cell {
        max-width: 150px;
    }

    .date-filters {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================ */
/* SEARCH PAGE STYLES */
/* ============================================ */
/* ========================================
   SEARCH FILTERS STYLES (PHASE 56A)
   ======================================== */

/* Контейнер фильтров */
.search-filters {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Группа фильтра */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input с иконкой */
.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-search {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.input-search:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-search::placeholder {
    color: var(--text-muted);
}

/* Select фильтры */
.select-filter {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2712%27%20height%3D%2712%27%20viewBox%3D%270%200%2012%2012%27%3E%3Cpath%20fill%3D%27%2394a3b8%27%20d%3D%27M6%208L1%203h10z%27%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.select-filter:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.select-filter option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Ряд фильтров */
.filter-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Кнопки действий */
.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

/* Кнопка Применить */
.search-filters .btn-primary {
    background: var(--accent-blue);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.search-filters .btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Кнопка Сбросить */
.btn-reset {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-reset:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Кнопка очистки поиска */
.input-with-icon .clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    line-height: 1;
    transition: color 0.2s;
}

.input-with-icon .clear-btn:hover {
    color: var(--accent-red);
}

/* Search stats обновленные */
.search-stats {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .search-filters {
        padding: 15px;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions .btn-primary,
    .filter-actions .btn-reset {
        width: 100%;
    }
}

/* Search stats */
.search-stats {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: center;
}

.search-stats p {
    margin: 0;
    color: #475569;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1f2937;
    border: 1px solid #e2e8f0;
}

.search-tag button {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.search-tag button:hover {
    color: #1f2937;
}

/* Empty state */
.empty-state {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0 0 1.5rem 0;
    color: var(--text-muted);
}

.search-tips {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.search-tips li {
    padding: 0.5rem 0;
    color: #475569;
    font-size: 0.95rem;
}

.search-tips li::before {
    content: "-> ";
    margin-right: 0.5rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .search-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .search-tips {
        font-size: 0.9rem;
    }
}

/* FULLSCREEN CHART STYLES */
.btn-fullscreen{padding:8px 16px;background:#007bff;color:white;border:none;border-radius:4px;cursor:pointer;font-size:14px;transition:background .3s}
.btn-fullscreen:hover{background:#0056b3}
#fullscreenModal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.9);z-index:9999;padding:20px;box-sizing:border-box}
.btn-close-fullscreen{padding:10px 20px;background:#dc3545;color:white;border:none;border-radius:4px;cursor:pointer;font-size:16px;transition:background .3s}
.btn-close-fullscreen:hover{background:#c82333}
.fullscreen-canvas-container{background:white;padding:20px;border-radius:8px;height:calc(100% - 80px);display:flex;align-items:center;justify-content:center}
@media(max-width:768px){#fullscreenModal{padding:10px}.fullscreen-canvas-container{padding:10px;height:calc(100% - 60px)}}

/* ========================================
   UNIFIED APPLY BUTTON (PHASE 57A)
   ======================================== */

/* Единая кнопка "Применить" для всех страниц */
.btn-apply {
    /* Размеры и отступы */
    padding: 10px 20px;
    min-width: 120px;
    
    /* Цвета */
    background: #007bff;
    color: white;
    
    /* Границы и скругления */
    border: none;
    border-radius: 6px;
    
    /* Типографика */
    font-size: 15px;
    font-weight: 500;
    
    /* Интерактивность */
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* Flexbox для иконок */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Hover состояние */
.btn-apply:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

/* Active состояние (при клике) */
.btn-apply:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* Focus состояние (для accessibility) */
.btn-apply:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

/* Disabled состояние */
.btn-apply:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-apply:disabled:hover {
    background: #ccc;
    box-shadow: none;
}

/* Вариант с иконкой */
.btn-apply-icon {
    padding-left: 16px;
    padding-right: 16px;
}

/* Grid позиционирование в custom-date-inputs */
.custom-date-inputs .btn-apply {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .btn-apply {
        width: 100%;
        padding: 12px 20px;
    }
}

/* Phase 48A: UI improvements - main content spacing */
.main-content {
    margin-top: 15px;
}

.main-content > *:first-child {
    margin-top: 0;
}

/* ========================================
   PHASE 62: Very small screens (<400px)
   ======================================== */
@media (max-width: 400px) {
    .finance-summary {
        padding: 8px;
    }
    .finance-cards {
        gap: 0.4rem;
    }
    .finance-card {
        padding: 0.5rem 0.3rem;
        border-radius: 8px;
    }
    .finance-card span {
        font-size: 10px;
    }
    .finance-card .amount {
        font-size: clamp(0.8rem, 3.2vw, 0.95rem);
        margin-top: 3px;
    }
}


/* Phase 67: Gallery redesign (no header/filters) */
.gallery-wrap { padding: 10px 0; }

.gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px;
}

@media (max-width: 1200px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

.gallery-card {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.gallery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96,165,250,0.45);
  background: rgba(255,255,255,0.06);
}

.gallery-thumb-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: block;
}

.gallery-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.gallery-meta { padding: 10px 12px 12px; }
.gallery-title { font-weight: 600; font-size: 14px; color: rgba(255,255,255,0.92); }
.gallery-date { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,0.6); }

/* Empty state */
.gallery-empty { padding: 24px 0; }
.gallery-empty-card {
  padding: 24px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.gallery-empty-icon { color: rgba(255,255,255,0.4); margin-bottom: 12px; }
.gallery-empty-title { font-weight: 700; font-size: 16px; color: rgba(255,255,255,0.92); }
.gallery-empty-text { margin-top: 6px; color: rgba(255,255,255,0.7); }

/* Lightbox */
/* ========================================
   Phase 75: Enhanced Lightbox for Gallery
   iPhone + Desktop + Touch support
   ======================================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.lightbox[aria-hidden="false"] {
    display: flex;
}
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}
.lightbox-body {
    position: relative;
    z-index: 2;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}
.lightbox-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.lightbox-close:active {
    transform: scale(0.92);
}
.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox-content img {
    max-width: 90vw;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    display: block;
}
.lightbox-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-align: center;
}
.lightbox-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.lightbox-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
    touch-action: manipulation;
}
.lightbox-btn-download {
    background: #3b82f6;
}
.lightbox-btn-download:hover {
    background: #2563eb;
}
.lightbox-btn:active {
    transform: scale(0.95);
}

/* Thumbnail cursor hint */
.gallery-thumb-btn {
    cursor: pointer;
}
.gallery-thumb-btn:hover .gallery-thumb {
    opacity: 0.85;
    transform: scale(1.03);
}
.gallery-thumb {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .lightbox-body {
        padding: 10px;
        gap: 10px;
    }
    .lightbox-content img {
        max-height: 70vh;
        border-radius: 6px;
    }
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }
    .lightbox-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .lightbox-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .lightbox-content img {
        max-height: 65vh;
        border-radius: 4px;
    }
}

/* Touch-friendly for iPhone/iPad */
@media (hover: none) and (pointer: coarse) {
    .lightbox-close {
        width: 48px;
        height: 48px;
    }
    .lightbox-btn {
        min-height: 48px;
        padding: 12px 18px;
    }
    .gallery-thumb-btn:hover .gallery-thumb {
        transform: none;
        opacity: 1;
    }
    .gallery-thumb-btn:active .gallery-thumb {
        opacity: 0.8;
    }
}

/* Inline filters - one row */
.custom-date-form {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* Force one row layout */
.filter-controls .custom-date-form {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.date-filter .filter-controls {
  flex-wrap: nowrap !important;
}

/* Inline date filter styles */
.filter-separator {
  color: #556;
  margin: 0 4px;
}
.date-label {
  color: #e2e8f0;
  font-size: 14px;
}
.date-input {
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 14px;
}

/* Phase 69: Blueprint Grid Logo Animation */
/* Phase 74: Fix - axes must stay within logo bounds */
.logo-container { position: relative; }
.logo-container.bp-animating .main-logo { opacity: 0; animation: bp-logoReveal 0.6s ease-out 1.2s forwards; }
.bp-grid { position: absolute; inset: 0; background-image: linear-gradient(to right, rgba(59,130,246,0.4) 1px, transparent 1px), linear-gradient(to bottom, rgba(59,130,246,0.4) 1px, transparent 1px); background-size: 10px 10px; opacity: 0; animation: bp-gridFade 2s ease-in-out forwards; pointer-events: none; z-index: 10; border-radius: 4px; }
.bp-axis { position: absolute; background: rgba(59,130,246,0.7); box-shadow: 0 0 6px rgba(59,130,246,0.5); z-index: 10; pointer-events: none; }
.bp-axis-h { height: 1px; width: 0; top: 50%; left: 50%; transform: translateX(-50%); animation: bp-axisH 0.8s ease-out 0.3s forwards; }
.bp-axis-v { width: 1px; height: 0; left: 50%; top: 50%; transform: translateY(-50%); animation: bp-axisV 0.8s ease-out 0.3s forwards; }
@keyframes bp-gridFade { 0% { opacity: 0; transform: scale(0.8); } 30% { opacity: 0.8; } 70% { opacity: 0.5; } 100% { opacity: 0; transform: scale(1.2); } }
@keyframes bp-axisH { 0% { width: 0; left: 50%; transform: translateX(-50%); } 100% { width: 100%; left: 0; transform: translateX(0); } }
@keyframes bp-axisV { 0% { height: 0; top: 50%; transform: translateY(-50%); } 100% { height: 100%; top: 0; transform: translateY(0); } }
@keyframes bp-logoReveal { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ========================================
   Phase 70: Compact mobile filters (v2)
   ======================================== */

@media (max-width: 768px) {
  .date-filter {
    padding: 6px 8px !important;
    margin-bottom: 8px !important;
  }
  .filter-controls {
    gap: 4px !important;
  }
  .filter-buttons {
    gap: 4px !important;
    margin-bottom: 0 !important;
  }
  .filter-btn {
    padding: 4px 10px !important;
    font-size: 12px !important;
    min-height: 28px !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
  }
  .custom-date-inputs {
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .date-input-group {
    gap: 2px !important;
  }
  .date-input-group label {
    font-size: 11px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .date-input-group input[type="date"] {
    padding: 3px 5px !important;
    font-size: 12px !important;
    min-height: 28px !important;
    height: 28px !important;
  }
  .btn-apply {
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    margin-top: 2px !important;
  }
  .custom-date-inputs .btn-apply {
    margin-top: 2px !important;
    padding: 6px 12px !important;
  }
  .period-filter {
    gap: 4px !important;
    margin-bottom: 6px !important;
    flex-wrap: wrap !important;
  }
  .period-btn {
    padding: 4px 10px !important;
    font-size: 12px !important;
    min-height: 28px !important;
  }
  .search-filters,
  .filters-section {
    padding: 6px !important;
    margin-bottom: 8px !important;
  }
  .filter-row {
    gap: 4px !important;
  }
  .filter-group {
    margin-bottom: 2px !important;
  }
  .filter-group label {
    font-size: 11px !important;
    margin-bottom: 1px !important;
  }
  .select-filter {
    padding: 3px 5px !important;
    font-size: 12px !important;
    min-height: 28px !important;
  }
  .filter-actions {
    gap: 4px !important;
    margin-top: 2px !important;
  }
  .filter-actions .btn-primary,
  .filter-actions .btn-reset {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  .date-filter {
    padding: 4px 6px !important;
    margin-bottom: 6px !important;
  }
  .filter-controls {
    gap: 2px !important;
  }
  .filter-buttons {
    gap: 2px !important;
  }
  .filter-btn {
    padding: 3px 6px !important;
    font-size: 11px !important;
    min-height: 26px !important;
  }
  .custom-date-inputs {
    gap: 2px !important;
  }
  .date-input-group input[type="date"] {
    padding: 2px 4px !important;
    font-size: 11px !important;
    min-height: 26px !important;
    height: 26px !important;
  }
  .date-input-group label {
    font-size: 10px !important;
  }
  .btn-apply {
    padding: 5px 10px !important;
    font-size: 11px !important;
    min-height: 28px !important;
  }
  .period-btn {
    padding: 3px 6px !important;
    font-size: 11px !important;
  }
  .period-filter {
    gap: 2px !important;
    margin-bottom: 4px !important;
  }
  .select-filter {
    padding: 2px 4px !important;
    font-size: 11px !important;
    min-height: 26px !important;
  }
}


/* Phase 70c: Hide date labels + stretch filter buttons on mobile */
@media (max-width: 768px) {
  .date-input-group label {
    display: none !important;
  }
  .filter-buttons {
    display: flex !important;
    width: 100% !important;
  }
  .filter-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 8px 6px !important;
    font-size: 13px !important;
    min-height: 34px !important;
  }
}


/* Phase 70d: Fix gallery (Отчеты КЦ) filters on mobile */
@media (max-width: 768px) {
  .date-filter .date-label {
    display: none !important;
  }
  .date-filter .filter-separator {
    display: none !important;
  }
  .date-filter .filter-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
  }
  .date-filter .filter-controls > a.filter-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 8px 6px !important;
    font-size: 13px !important;
    min-height: 34px !important;
  }
  .date-filter .date-input {
    padding: 2px 4px !important;
    font-size: 11px !important;
    min-height: 26px !important;
    height: 26px !important;
  }
  .date-filter .btn-apply {
    padding: 5px 10px !important;
    font-size: 11px !important;
    min-height: 28px !important;
  }
}


/* Phase 70e: Gallery buttons in single row, evenly stretched */
@media (max-width: 768px) {
  .date-filter .filter-controls {
    flex-wrap: wrap !important;
  }
  .date-filter .filter-controls > a.filter-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  .date-filter .filter-controls > a.filter-btn:first-child,
  .date-filter .filter-controls > a.filter-btn:nth-child(2),
  .date-filter .filter-controls > a.filter-btn:nth-child(3) {
    flex: 1 1 30% !important;
  }
}

/* Phase 73: DEV Table Styles */
.page-container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 2rem; font-weight: 600; color: var(--text-primary); margin: 0 0 8px 0; }
.page-subtitle { font-size: 1rem; color: var(--text-secondary); margin: 0; }
.search-container { margin-bottom: 20px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-input { width: 100%; padding: 12px 40px 12px 16px; font-size: 15px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-surface); }
.search-clear { position: absolute; right: 12px; width: 28px; height: 28px; background: var(--bg-secondary); border: none; border-radius: 50%; cursor: pointer; }
.filters-container { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filter-buttons { display: flex; gap: 8px; }
.filter-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); cursor: pointer; transition: all 0.2s; }
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.date-range { display: flex; gap: 8px; align-items: center; }
.date-range input[type="date"] { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); }
.btn-apply { padding: 8px 20px; background: var(--primary); color: white; border: none; border-radius: 8px; cursor: pointer; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--bg-surface); border-radius: 10px; padding: 16px; border: 1px solid var(--border-color); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 600; color: var(--text-primary); }
.table-container { background: var(--bg-surface); border-radius: 12px; border: 1px solid var(--border-color); overflow-x: auto; overflow-y: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-secondary); }
.data-table th { padding: 14px 16px; text-align: left; font-size: 13px; font-weight: 600; border-bottom: 2px solid var(--border-color); }
.data-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border-color); }
.data-table tbody tr:hover { background: var(--bg-secondary); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-excel { background: rgba(34,197,94,0.1); color: #16a34a; }
.badge-text { background: rgba(59,130,246,0.1); color: #2563eb; }
.badge-screenshot { background: rgba(168,85,247,0.1); color: #9333ea; }
.status-active { color: #16a34a; }
.status-deleted { color: #dc2626; }
.loading-indicator { display: flex; flex-direction: column; align-items: center; padding: 40px; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.no-data-message { display: flex; flex-direction: column; align-items: center; padding: 60px 20px; text-align: center; color: var(--text-secondary); }
@media (max-width: 768px) { .stats-row { grid-template-columns: 1fr; } .filters-container { flex-direction: column; align-items: stretch; } }

/* ===== Phase 75: Lazy Loading + Infinite Scroll Styles ===== */

/* Gallery card fade-in animation */
.gallery-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy loading image styles */
.gallery-thumb.lazy {
    background: linear-gradient(135deg, #1a1d23 0%, #2d3139 100%);
    transition: opacity 0.3s ease;
}

.gallery-thumb.lazy:not(.loaded) {
    opacity: 0.6;
}

.gallery-thumb.loaded {
    opacity: 1;
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fade-in animation for new images */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton loading placeholder */
.gallery-card.skeleton .gallery-thumb-btn {
    background: linear-gradient(90deg, #1a1d23 25%, #2d3139 50%, #1a1d23 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


/* ========================================
   Phase 78: Mobile Menu Button Improvements
   Increase button sizes by ~20% for better touch targets
   iOS HIG compliance: minimum 44x44px touch targets
   ======================================== */

/* Small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .nav-link {
        font-size: 16px; /* Phase 78: slightly smaller for narrow screens */
        padding: 11px 16px; /* Phase 78: adjusted for narrow screens */
        min-height: 44px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-link {
        min-height: 44px; /* Phase 78: ensure minimum touch target on touch devices */
    }
    
    .nav-link:active {
        transform: scale(0.98); /* Phase 78: subtle press feedback */
    }
    
    .menu-toggle-label {
        min-width: 44px; /* Phase 78: minimum touch target */
        min-height: 44px;
    }
}

/* ========================================
   Phase 76: DEV Table Action Buttons
   ======================================== */
.actions-col { width: 100px; text-align: center; }
.action-buttons { display: flex; gap: 8px; justify-content: center; align-items: center; }
.btn-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; background: transparent; }
.btn-action:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.btn-action:active { transform: translateY(0); }
.btn-download { color: #3b82f6; background: rgba(59,130,246,0.1); }
.btn-download:hover { background: rgba(59,130,246,0.2); }
.btn-delete { color: #ef4444; background: rgba(239,68,68,0.1); }
.btn-delete:hover { background: rgba(239,68,68,0.2); }
.btn-disabled { opacity: 0.4; cursor: not-allowed; }
.btn-disabled:hover { transform: none; box-shadow: none; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
.modal-content { background: #1e293b; border-radius: 12px; max-width: 500px; width: 90%; box-shadow: 0 20px 40px rgba(0,0,0,0.3); animation: modalSlideIn 0.3s ease; }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.modal-header h3 { margin: 0; font-size: 1.25rem; font-weight: 600; color: #f1f5f9; }
.modal-close { background: none; border: none; font-size: 28px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { color: #f1f5f9; }
.modal-body { padding: 24px; }
.modal-body p { margin: 0 0 16px 0; color: #f1f5f9; }
.warning-text { font-size: 0.875rem; color: #f59e0b; font-style: italic; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 24px; border-top: 1px solid rgba(255,255,255,0.1); }
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.btn-secondary { background: #334155; color: #f1f5f9; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

/* Notifications */
.notification { position: fixed; top: 20px; right: 20px; z-index: 2000; padding: 16px 24px; border-radius: 8px; box-shadow: 0 10px 20px rgba(0,0,0,0.2); animation: notifSlideIn 0.3s ease; max-width: 400px; }
@keyframes notifSlideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
.notification-success { background: #10b981; color: white; }
.notification-error { background: #ef4444; color: white; }
.notification-info { background: #3b82f6; color: white; }

/* Row animation */
tr[data-report-id] { transition: all 0.3s ease; }

/* Mobile */
@media (max-width: 768px) {
  .action-buttons { flex-direction: column; gap: 6px; }
  .btn-action { width: 32px; height: 32px; }
  .modal-content { width: 95%; }
  .notification { top: 10px; right: 10px; left: 10px; max-width: none; }
}

/* ========================================
   Phase 77: Deletion Logs
   ======================================== */

.logs-section {
  margin-top: 32px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface, #ffffff);
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--color-bg-muted, #f9fafb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.logs-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

.logs-header h3 svg {
  color: var(--color-warning, #f59e0b);
}

.btn-toggle-logs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-primary, #3b82f6);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-logs:hover {
  background: var(--color-primary-hover, #2563eb);
}

.btn-toggle-logs svg {
  transition: transform 0.3s ease;
}

.logs-container {
  max-height: 500px;
  overflow-y: auto;
  padding: 12px;
}

.logs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-bg-elevated, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s ease;
}

.log-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.log-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  color: #ef4444;
}

.log-info {
  flex: 1;
  min-width: 0;
}

.log-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.9375rem;
  color: var(--color-text, #1f2937);
}

.log-filename {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--color-text-secondary, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.log-meta {
  font-size: 0.8125rem;
  color: var(--color-text-secondary, #6b7280);
}

.log-actions {
  flex-shrink: 0;
}

.btn-restore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-restore:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.log-restored {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.logs-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--color-text-secondary, #6b7280);
}

.logs-section .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border, #e5e7eb);
  border-top-color: var(--color-primary, #3b82f6);
  border-radius: 50%;
  animation: spin77 0.8s linear infinite;
}

@keyframes spin77 {
  to { transform: rotate(360deg); }
}

.logs-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-secondary, #6b7280);
}

.logs-empty p {
  margin: 0;
  font-size: 0.9375rem;
}

@media (max-width: 768px) {
  .logs-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .btn-toggle-logs {
    justify-content: center;
  }
  
  .log-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .log-actions {
    width: 100%;
  }
  
  .btn-restore {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   Phase 94: FINANCE PAGE - RESPONSIVE TABLE
   ======================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    position: relative;
}

.table-responsive table {
    min-width: 800px;
    width: 100%;
    margin-bottom: 0;
}

.table-responsive .data-table {
    white-space: nowrap;
}

.table-responsive .data-table th,
.table-responsive .data-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Mobile devices */
@media (max-width: 768px) {
    .table-responsive {
        border: 1px solid var(--border-color, #333);
        border-radius: 4px;
    }
    
    .table-responsive table {
        min-width: 900px;
    }
    
    .table-responsive .data-table th,
    .table-responsive .data-table td {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* iPhone and small screens */
@media (max-width: 480px) {
    .table-responsive table {
        min-width: 1000px;
    }
    
    .table-responsive .data-table th,
    .table-responsive .data-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ========================================
   Phase 94 FIX: iOS Safari horizontal scroll
   ======================================== */

/* Force horizontal scroll on iOS */
.table-container {
    -webkit-overflow-scrolling: touch !important;
    overflow-x: scroll !important;
    overflow-y: visible !important;
}

.table-responsive {
    display: block !important;
    width: 100% !important;
    overflow-x: scroll !important;
    -webkit-overflow-scrolling: touch !important;
}

/* iOS specific - prevent content clipping */
@supports (-webkit-touch-callout: none) {
    .table-container,
    .table-responsive {
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .table-container table,
    .table-responsive table,
    .data-table {
        display: table !important;
        min-width: 900px !important;
    }
}

/* Mobile fix */
@media screen and (max-width: 768px) {
    .table-container {
        overflow-x: scroll !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100vw;
    }
    
    .table-responsive {
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .data-table {
        min-width: 900px !important;
        width: max-content !important;
    }
}

/* iOS Safari mobile scroll fix */
@supports (-webkit-touch-callout: none) {
  .table-container,
  .table-responsive {
    overflow-x: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100vw !important;
  }
  
  .data-table {
    min-width: 900px !important;
    width: max-content !important;
  }
}

/* Force scroll on small screens */
@media screen and (max-width: 768px) {
  .table-container,
  .table-responsive {
    overflow-x: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .data-table {
    min-width: 900px !important;
    table-layout: auto !important;
  }
}

/* Override conflicting overflow:hidden for table scroll on mobile */
#financeTableContainer,
#financeTableContainer .table-responsive,
#financeTableContainer .data-table {
  overflow-x: scroll !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
}

#financeTableContainer {
  max-width: calc(100vw - 20px) !important;
}

#financeTableContainer .data-table {
  min-width: 900px !important;
}

/* Desktop: Full width table, hide scrollbar */
@media screen and (min-width: 769px) {
  #financeTableContainer {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  #financeTableContainer .table-responsive {
    overflow-x: hidden !important;
    width: 100% !important;
  }
  
  #financeTableContainer .data-table {
    width: 100% !important;
    min-width: unset !important;
    table-layout: fixed !important;
  }
  
  /* Hide scrollbar for webkit browsers */
  #financeTableContainer::-webkit-scrollbar,
  #financeTableContainer .table-responsive::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
  }
  
  /* Hide scrollbar for Firefox */
  #financeTableContainer,
  #financeTableContainer .table-responsive {
    scrollbar-width: none !important;
  }
}

/* ============================================
   REPORTS PAGE - Phase 92 Refactoring
   ============================================ */

/* Filter Bar Container */
.filter-bar {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Input Fields for Reports */
.input-field {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Stat Cards Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Sync Button */
.btn-sync {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-sync:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Icon Button */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 18px;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Report Row Actions */
.report-actions {
    display: flex;
    gap: 8px;
}

/* Reports Table Container */
.reports-table-container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

/* Stat Value & Trend */
.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.stat-trend {
    margin-top: 8px;
    font-size: 14px;
}

.stat-trend.positive {
    color: var(--accent-green);
}

.stat-trend.negative {
    color: var(--accent-red);
}

/* Reports page title row */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile for reports */
@media (max-width: 768px) {
    .filter-bar {
        padding: 16px;
    }
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .reports-table-container {
        padding: 16px;
    }
    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* Phase 92 Fix - Force styles */
.stat-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 24px !important;
}

.filter-bar {
    background: var(--bg-secondary) !important;
    padding: 20px !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
}

.filter-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

.filter-group {
    flex: 1 !important;
    min-width: 180px !important;
}

.input-field {
    width: 100% !important;
    padding: 10px 14px !important;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
}

.filter-actions {
    display: flex !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

.reports-table-container {
    background: var(--bg-secondary) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    overflow-x: auto !important;
}

.reports-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.reports-table th,
.reports-table td {
    padding: 12px !important;
    text-align: left !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.btn-sync {
    background: linear-gradient(135deg, var(--accent-green), #059669) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.page-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
}

/* ===== Sync Button Styles (Reports Page) ===== */
.btn-sync {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1e88e5 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-sync:hover {
    background: linear-gradient(135deg, #1e88e5 0%, var(--accent-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-sync:active {
    transform: translateY(0);
}

.btn-sync:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-sync i {
    font-size: 14px;
}

/* ===== Select/Dropdown Styles (Reports Page) ===== */
.filter-bar select,
#employeeFilter {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-bar select:hover,
#employeeFilter:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-bar select:focus,
#employeeFilter:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.filter-bar select option,
#employeeFilter option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 10px;
}

/* ========================================
   BITRIX CONTENT FORMATTING (PHASE 95)
   ======================================== */

/* User mentions */
.user-mention {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.2s;
}

.user-mention:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Timestamps */
.timestamp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.timestamp i {
    font-size: 11px;
}

/* Auto-generated links */
.auto-link {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-blue);
    transition: all 0.2s;
}

.auto-link:hover {
    border-bottom-style: solid;
    color: #2563eb;
}

/* Formatted content container */
.formatted-content {
    line-height: 1.7;
    word-wrap: break-word;
}

.formatted-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.formatted-content em {
    font-style: italic;
    color: var(--text-secondary);
}

.formatted-content a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.formatted-content a:hover {
    border-bottom-color: var(--accent-blue);
}

/* ============================================== */
/* Стили для форматирования отчётов Bitrix24 */
/* ============================================== */

/* Упоминания пользователей */
.user-mention {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9em;
    display: inline-block;
    margin: 1px 2px;
}

.user-mention:hover {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    cursor: pointer;
}

/* Timestamps */
.timestamp {
    color: #9CA3AF;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
    background-color: rgba(156, 163, 175, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Внешние ссылки */
.external-link {
    color: #60A5FA;
    text-decoration: none;
    border-bottom: 1px dashed #60A5FA;
    transition: all 0.2s ease;
}

.external-link:hover {
    color: #93C5FD;
    border-bottom-color: #93C5FD;
}

/* Карточка записи отчёта */
.report-entry {
    background: rgba(30, 41, 59, 0.8);
    border-left: 3px solid #4F46E5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.report-entry:hover {
    background: rgba(30, 41, 59, 0.95);
    transform: translateX(4px);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.entry-author {
    font-weight: 600;
    color: #F1F5F9;
    font-size: 1.05em;
}

.entry-datetime {
    color: #94A3B8;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', monospace;
}

.entry-content {
    color: #CBD5E1;
    line-height: 1.6;
}

.report-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.report-modal.show {
    display: flex;
}
/* Модальное окно отчёта */
.report-modal-content {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.report-modal-content::-webkit-scrollbar {
    width: 6px;
}

.report-modal-content::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 3px;
}

.report-modal-content::-webkit-scrollbar-thumb {
    background: #4F46E5;
    border-radius: 3px;
}

/* Разделитель записей */
.entry-separator {
    text-align: center;
    margin: 20px 0;
    color: #64748B;
}

.entry-separator::before,
.entry-separator::after {
    content: '';
    display: inline-block;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #64748B, transparent);
    vertical-align: middle;
    margin: 0 10px;
}

/* === REPORTS GRID === */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* === REPORT CARD === */
.report-card {
    background: linear-gradient(145deg, rgba(30,33,48,0.95), rgba(22,25,38,0.98));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.report-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    border-color: rgba(99,102,241,0.3);
}
.report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
    opacity: 0;
    transition: opacity 0.3s;
}
.report-card:hover::before {
    opacity: 1;
}

/* Report card header */
.report-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.employee-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.report-meta {
    flex: 1;
    min-width: 0;
}
.employee-name {
    font-weight: 600;
    font-size: 15px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-date {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.report-date i {
    margin-right: 4px;
}

/* Report card body */
.report-title {
    font-weight: 600;
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-preview {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}

/* Report card footer */
.report-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.report-stats {
    display: flex;
    gap: 14px;
}
.stat-item {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}
.stat-item i {
    font-size: 13px;
}
.btn-view-report {
    background: rgba(99,102,241,0.15);
    border: none;
    color: #818cf8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-view-report:hover {
    background: rgba(99,102,241,0.3);
}
