:root {
    --bg-main: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.75);
    --border-card: rgba(255, 255, 255, 0.08);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-emerald: #10b981;
    --accent-indigo: #6366f1;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    --bg-main: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-card: rgba(0, 0, 0, 0.08);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --shadow-glass: 0 8px 30px 0 rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    padding: 0 0.25rem;
}

.brand-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-sidebar-collapse {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-sidebar-collapse:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.brand-img-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(136, 19, 55, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.header-img-logo {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(136, 19, 55, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.brand-text h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.brand-text span {
    font-size: 0.65rem;
    color: var(--accent-emerald);
    font-weight: 700;
    letter-spacing: 1.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.nav-item:hover {
    background: rgba(51, 65, 85, 0.85);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
    transform: translateX(3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border-color: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.nav-item i {
    font-size: 1.05rem;
    min-width: 22px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-item:hover i {
    transform: scale(1.15);
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
}

.store-info code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 280px);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed Sidebar Mode (Desktop) */
.sidebar.collapsed {
    width: 78px;
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed + .main-content,
body.sidebar-is-collapsed .main-content {
    margin-left: 78px;
    max-width: calc(100vw - 78px);
}

.sidebar.collapsed .brand {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span {
    display: none !important;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .nav-item i {
    min-width: unset;
    font-size: 1.15rem;
}

.sidebar.collapsed .sidebar-footer .api-status span,
.sidebar.collapsed .sidebar-footer .store-info span,
.sidebar.collapsed .sidebar-footer .store-info code {
    display: none !important;
}

.sidebar.collapsed .sidebar-footer {
    align-items: center;
    padding-top: 0.75rem;
}

/* Header Toolbar */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons & Controls */
.period-buttons {
    display: flex;
    background-color: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-card);
}

.period-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.period-btn.active, .period-btn:hover {
    background-color: var(--accent-indigo);
    color: #ffffff;
}

/* Custom Date Range Picker */
.custom-date-picker {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-card);
    gap: 6px;
}

.custom-date-picker .date-icon {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.date-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

.date-input:focus, .date-input.active {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
}

.date-sep {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
}

#store-select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-card);
    padding: 0.55rem 1rem 0.55rem 2.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-blue));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
}

/* Glassmorphism Cards */
.glass {
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.3);
}

.kpi-card.border-rose { border-left: 4px solid var(--accent-rose); }
.kpi-card.border-amber { border-left: 4px solid var(--accent-amber); }
.kpi-card.border-indigo { border-left: 4px solid var(--accent-indigo); }

/* Card Specific Shadows, Neon Glows & Colored Left Border Accents */
.kpi-card-green {
    border-left: 5px solid #10b981 !important;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.25), 0 4px 12px rgba(16, 185, 129, 0.12), inset 0 0 0 1px rgba(16, 185, 129, 0.25) !important;
}
.kpi-card-green:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 14px 32px -4px rgba(16, 185, 129, 0.45), 0 6px 16px rgba(16, 185, 129, 0.3), inset 0 0 0 1px rgba(16, 185, 129, 0.5) !important;
}

.kpi-card-purple {
    border-left: 5px solid #a855f7 !important;
    box-shadow: 0 10px 25px -5px rgba(168, 85, 247, 0.25), 0 4px 12px rgba(168, 85, 247, 0.12), inset 0 0 0 1px rgba(168, 85, 247, 0.25) !important;
}
.kpi-card-purple:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 14px 32px -4px rgba(168, 85, 247, 0.45), 0 6px 16px rgba(168, 85, 247, 0.3), inset 0 0 0 1px rgba(168, 85, 247, 0.5) !important;
}

.kpi-card-blue {
    border-left: 5px solid #3b82f6 !important;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(59, 130, 246, 0.12), inset 0 0 0 1px rgba(59, 130, 246, 0.25) !important;
}
.kpi-card-blue:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 14px 32px -4px rgba(59, 130, 246, 0.45), 0 6px 16px rgba(59, 130, 246, 0.3), inset 0 0 0 1px rgba(59, 130, 246, 0.5) !important;
}

.kpi-card-amber {
    border-left: 5px solid #f59e0b !important;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.25), 0 4px 12px rgba(245, 158, 11, 0.12), inset 0 0 0 1px rgba(245, 158, 11, 0.25) !important;
}
.kpi-card-amber:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 14px 32px -4px rgba(245, 158, 11, 0.45), 0 6px 16px rgba(245, 158, 11, 0.3), inset 0 0 0 1px rgba(245, 158, 11, 0.5) !important;
}

.kpi-card-rose {
    border-left: 5px solid #f43f5e !important;
    box-shadow: 0 10px 25px -5px rgba(244, 63, 94, 0.25), 0 4px 12px rgba(244, 63, 94, 0.12), inset 0 0 0 1px rgba(244, 63, 94, 0.25) !important;
}
.kpi-card-rose:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 14px 32px -4px rgba(244, 63, 94, 0.45), 0 6px 16px rgba(244, 63, 94, 0.3), inset 0 0 0 1px rgba(244, 63, 94, 0.5) !important;
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.kpi-icon.revenue { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.kpi-icon.receipt { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.kpi-icon.ticket { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.kpi-icon.cash { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.kpi-icon.stock { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.kpi-icon.expense-icon { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

.kpi-details {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.kpi-details h3 {
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 700;
    margin: 0.2rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Safes Cards Grid Layout & No-Truncate Styling */
#safes-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.1rem;
}

#safes-cards-grid .kpi-card {
    padding: 1.1rem 1rem;
    min-width: 0;
}

#safes-cards-grid .kpi-details {
    min-width: 0;
    overflow: visible;
}

#safes-cards-grid .kpi-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: normal;
    word-break: break-word;
    display: block;
    line-height: 1.25;
}

#safes-cards-grid .kpi-details h3 {
    font-size: clamp(0.92rem, 1.25vw, 1.15rem);
    font-weight: 700;
    margin: 0.3rem 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    letter-spacing: -0.2px;
}

#safes-cards-grid .kpi-details .txt-amber {
    font-size: 0.88rem;
    display: inline-block;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.positive {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.chart-card.full-width {
    grid-column: span 2;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

/* Tables & Grid */
.data-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th {
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-card);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-card);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Tab Management */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.txt-success { color: var(--accent-emerald); }
.txt-danger { color: var(--accent-rose); }
.txt-amber { color: var(--accent-amber); }

/* Form Group */
.gsheets-form-group .input-group {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.gsheets-form-group input {
    flex: 1;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
    background: var(--accent-indigo);
    color: #ffffff;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar-toggle-btn {
        display: inline-flex;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.7);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem;
    }
    .top-header {
        gap: 0.85rem;
    }
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    .period-buttons {
        width: 100%;
        justify-content: space-between;
    }
    .period-btn {
        flex: 1;
        text-align: center;
        padding: 0.45rem 0.25rem;
        font-size: 0.78rem;
    }
    .custom-date-picker {
        width: 100%;
        justify-content: space-between;
    }
    .charts-grid, .grid-2-col {
        grid-template-columns: 1fr;
    }
    .chart-card.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .header-title h1 {
        font-size: 1.25rem;
    }
    .subtitle {
        font-size: 0.8rem;
    }
    .kpi-details h3 {
        font-size: 1.15rem;
    }
}

/* Expandable Expenses Styles */
.category-parent-row {
    transition: background-color 0.2s ease;
}
.category-parent-row:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
}
.category-parent-row.expanded {
    background-color: rgba(99, 102, 241, 0.12) !important;
    border-bottom: none !important;
}
.btn-exp-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-exp-toggle:hover {
    background: var(--accent-indigo);
    color: #ffffff;
    border-color: var(--accent-indigo);
    transform: scale(1.1);
}
.sub-data-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Nav & Icon Accent Utility Classes */
.nav-accent-indigo { border-left-color: #6366F1 !important; }
.nav-accent-blue { border-left-color: #3B82F6 !important; }
.nav-accent-red { border-left-color: #EF4444 !important; }
.nav-accent-amber { border-left-color: #F59E0B !important; }
.nav-accent-emerald { border-left-color: #10B981 !important; }
.nav-accent-teal { border-left-color: #14B8A6 !important; }
.nav-accent-purple { border-left-color: #8B5CF6 !important; }
.nav-accent-pink { border-left-color: #EC4899 !important; }
.nav-accent-cyan { border-left-color: #06B6D4 !important; }

.icon-indigo { color: #6366F1 !important; }
.icon-blue { color: #3B82F6 !important; }
.icon-red { color: #EF4444 !important; }
.icon-amber { color: #F59E0B !important; }
.icon-emerald { color: #10B981 !important; }
.icon-teal { color: #14B8A6 !important; }
.icon-purple { color: #8B5CF6 !important; }
.icon-pink { color: #EC4899 !important; }
.icon-cyan { color: #06B6D4 !important; }
.border-cyan { border-color: rgba(6, 182, 212, 0.3) !important; }
.no-underline { text-decoration: none !important; }

/* Dashboard Component & Layout Utility Classes */
.btn-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
}
.col-w-36 { width: 36px !important; }
.col-w-40 { width: 40px !important; }
.col-w-110 { width: 110px !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.flex-space-between-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.recon-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.btn-recon-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 10px;
    cursor: pointer;
}
.recon-cp-name { margin: 0; font-size: 1.3rem; }
.opacity-60 { opacity: 0.6 !important; }
.grid-3-col { grid-template-columns: repeat(3, 1fr) !important; }
.tfoot-highlight {
    background: rgba(99, 102, 241, 0.15);
    font-weight: bold;
    font-size: 15px;
    border-top: 2px solid var(--border-color);
}
.display-none { display: none; }

/* City Breakdown Grid & Cards */
.city-debts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
.border-cyan {
    border: 1px solid rgba(6, 182, 212, 0.35) !important;
}
.border-cyan:hover {
    border-color: rgba(6, 182, 212, 0.6) !important;
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}
.border-amber {
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.border-amber:hover {
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}
.txt-cyan {
    color: #06b6d4 !important;
}
.txt-amber {
    color: #f59e0b !important;
}
.city-card {
    padding: 1.25rem 1.5rem;
    transition: var(--transition);
}
.city-card.active-city {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(99, 102, 241, 0.7) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}
.city-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.city-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
}
.badge-city-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
}
.btn-city-filter {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-city-filter:hover, .btn-city-filter.active {
    background: var(--accent-indigo);
    color: #ffffff;
    border-color: var(--accent-indigo);
}
.city-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.city-stat-item {
    display: flex;
    flex-direction: column;
}
.city-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.city-stat-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
}
.city-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.city-pills-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-card);
}
.city-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}
.city-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}
.city-pill.active {
    background: var(--accent-indigo);
    color: #ffffff;
    font-weight: 600;
}

@media (max-width: 992px) {
    .city-debts-grid {
        grid-template-columns: 1fr;
    }
    .bank-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .bank-live-banner {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .bank-live-banner .badge-bank-live {
        align-self: flex-start !important;
    }
    .bank-kpi-grid {
        grid-template-columns: 1fr !important;
    }
    .kpi-card {
        padding: 0.8rem 1rem !important;
    }
}

.icon-empty-notice {
    display: block;
    margin: 15px auto;
}

/* Extracted inline styles for clean HTML */
.brand-img-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.brand-text h2 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0;
}

.brand-text span {
    color: #fda4af;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-img-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.payment-calendar-placeholder {
    padding: 3rem 1rem;
}

.payment-calendar-placeholder .calendar-icon-lg {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.8;
}

.payment-calendar-placeholder h4 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.payment-calendar-placeholder p {
    color: var(--text-muted);
}

.bank-live-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.bank-live-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bank-live-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.bank-live-icon .fa-vault {
    font-size: 1.1rem;
}

.bank-live-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 600;
}

.bank-live-amount {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    margin: 2px 0 0 0;
}

.bank-live-subtext {
    color: #10b981;
    font-weight: 500;
    font-size: 0.78rem;
}

.badge-bank-live {
    text-align: right;
}

.badge-bank-account-live {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 16px;
}

.icon-mr-4 {
    margin-right: 4px;
}

.icon-mr-5 {
    margin-right: 5px;
}

.bank-kpi-grid .kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.bank-kpi-grid .kpi-icon.sales {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.bank-kpi-grid .kpi-icon.revenue {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.bank-kpi-grid .kpi-icon.expense {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.bank-kpi-grid .kpi-icon.cash {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

#bank-type-pills {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
}

/* ========================================================
   EXPENSE TYPES 8-CARD GRID & INTERACTIVE PILLS
   ======================================================== */
.expense-types-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 1400px) {
    .expense-types-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .expense-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .expense-types-grid {
        grid-template-columns: 1fr;
    }
}

.expense-type-card {
    padding: 0.85rem 1rem !important;
    gap: 0.85rem !important;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    border: 1px solid var(--border-card);
}

.expense-type-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.expense-type-card.active {
    background: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35) !important;
    border-color: var(--accent-indigo) !important;
    transform: translateY(-2px);
}

.exp-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.exp-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.exp-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exp-pct {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: auto;
}

.exp-sum {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin: 2px 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.exp-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.exp-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exp-count {
    font-weight: 600;
}

/* 8 Distinct Themes */
/* OX - Indigo (OPEX) */
.border-ox { border-left: 4px solid #6366f1 !important; }
.exp-icon-ox { background: rgba(99, 102, 241, 0.15) !important; color: #818cf8 !important; }
.badge-ox { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }

/* CX - Amber (CAPEX) */
.border-cx { border-left: 4px solid #f59e0b !important; }
.exp-icon-cx { background: rgba(245, 158, 11, 0.15) !important; color: #fbbf24 !important; }
.badge-cx { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

/* CG - Emerald (COGS) */
.border-cg { border-left: 4px solid #10b981 !important; }
.exp-icon-cg { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; }
.badge-cg { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

/* NX - Purple (Неоперационные) */
.border-nx { border-left: 4px solid #a855f7 !important; }
.exp-icon-nx { background: rgba(168, 85, 247, 0.15) !important; color: #c084fc !important; }
.badge-nx { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

/* TX - Rose (Налоги) */
.border-tx { border-left: 4px solid #f43f5e !important; }
.exp-icon-tx { background: rgba(244, 63, 94, 0.15) !important; color: #fb7185 !important; }
.badge-tx { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }

/* FN - Sky (Финансовые) */
.border-fn { border-left: 4px solid #0ea5e9 !important; }
.exp-icon-fn { background: rgba(14, 165, 233, 0.15) !important; color: #38bdf8 !important; }
.badge-fn { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }

/* TR - Teal (Перемещения) */
.border-tr { border-left: 4px solid #14b8a6 !important; }
.exp-icon-tr { background: rgba(20, 184, 166, 0.15) !important; color: #2dd4bf !important; }
.badge-tr { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.4); }

/* AD - Yellow (Корректировки) */
.border-ad { border-left: 4px solid #eab308 !important; }
.exp-icon-ad { background: rgba(234, 179, 8, 0.15) !important; color: #fde047 !important; }
.badge-ad { background: rgba(234, 179, 8, 0.2); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.4); }






