/* DESTRY Finance — Financial Command Center */
@import url('google-fonts.css');
@import url('tabler-icons.min.css');

/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
    --font: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'Chivo', var(--font);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Light Mode */
    --bg: #F9F9F9;
    --bg-subtle: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F7F8FA;
    --bg-card-border: #E5E7EB;
    --text: #1A1E1E;
    --text-muted: #767676;
    --primary: #D63447;
    --primary-hover: #B5293B;
    --primary-soft: rgba(214,52,71,0.09);
    --accent: #F59E0B;
    --accent-soft: rgba(245,158,11,0.10);
    --success: #10B981;
    --success-soft: rgba(16,185,129,0.10);
    --danger: #E5242B;
    --danger-soft: rgba(229,36,43,0.10);
    --info: #3B82F6;
    --info-soft: rgba(59,130,246,0.10);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.07);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 0.18s ease;
    --sidebar-width: 258px;
    --sidebar-bg: #0F1419;
    --sidebar-text: #8A9BB5;
    --sidebar-active-text: #FFFFFF;
    --sidebar-active-bg: rgba(214,52,71,0.15);
    --sidebar-border: #1A2230;
    --sidebar-logo-text: #FFFFFF;
}

[data-theme="dark"] {
    --bg: #0F1419;
    --bg-subtle: #1A2233;
    --bg-card: #1E2836;
    --bg-card-hover: #2A3447;
    --bg-card-border: #3D4859;
    --text: #F0F4FA;
    --text-muted: #A5B4CB;
    --primary: #D63447;
    --primary-hover: #B5293B;
    --primary-soft: rgba(214,52,71,0.14);
    --accent: #F59E0B;
    --accent-soft: rgba(245,158,11,0.12);
    --success: #10B981;
    --success-soft: rgba(16,185,129,0.12);
    --danger: #E5242B;
    --danger-soft: rgba(229,36,43,0.12);
    --info: #3B82F6;
    --info-soft: rgba(59,130,246,0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
    --shadow: 0 2px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.50);
    --sidebar-bg: #090D12;
    --sidebar-border: #151F2E;
}

/* =============================================
   BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
h1,h2,h3,h4,h5 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
}

/* =============================================
   APP SHELL
   ============================================= */
.app { display: flex; min-height: 100vh; }

/* =============================================
   SIDEBAR — always dark, matches DESTRY
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: #1E2836 transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: #1E2836; border-radius: 3px; }

/* Logo */
.sidebar .logo-wrap {
    padding: 1.3rem 1.2rem 1.1rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar .logo-wrap a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #FFFFFF;
    text-decoration: none;
}
.sidebar .logo-wrap a:hover { opacity: 0.88; color: #FFFFFF; }
.logo-mark {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(214,52,71,0.40);
}
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1; }
.logo-name { font-size: 1.05rem; font-weight: 900; color: #FFFFFF; letter-spacing: -0.03em; }
.logo-sub {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4A5F7A;
    margin-top: 2px;
}

/* Nav items */
.sidebar-nav {
    flex: 1;
    padding: 0.65rem 0.7rem;
    display: flex;
    flex-direction: column;
}
.sidebar a,
.sidebar button.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.52rem 0.7rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    line-height: 1.4;
}
.sidebar a .ti,
.sidebar button.nav-link .ti {
    font-size: 1.05rem;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition);
    width: 18px;
}
.sidebar a:hover,
.sidebar button.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #FFFFFF;
    text-decoration: none;
}
.sidebar a:hover .ti,
.sidebar button.nav-link:hover .ti { opacity: 1; }
.sidebar a.active {
    background: var(--sidebar-active-bg);
    color: #FFFFFF;
    font-weight: 600;
}
.sidebar a.active .ti { opacity: 1; color: var(--primary); }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #364558;
    padding: 1rem 0.7rem 0.3rem;
    display: block;
}
.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 0.4rem 0.7rem;
}

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 0.65rem 0.7rem;
    flex-shrink: 0;
}
.sidebar .theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.52rem 0.7rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    width: 100%;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}
.sidebar .theme-toggle:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar .theme-toggle .ti { font-size: 1.05rem; opacity: 0.6; width: 18px; }

/* =============================================
   MOBILE HEADER
   ============================================= */
.header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 60;
    height: 56px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
}
.header .logo {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    display: flex; align-items: center; gap: 0.5rem;
}
.header .logo a { color: #fff; display: flex; align-items: center; gap: 0.5rem; }
.header .logo .logo-mark { width: 28px; height: 28px; font-size: 0.85rem; border-radius: 7px; }
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.3rem;
    font-size: 1.1rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
}
.header .nav { display: none; }
.header-spacer { flex: 1; }

/* =============================================
   MAIN CONTENT
   ============================================= */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.25rem;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .header { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .menu-toggle { display: flex; }
    .main {
        margin-left: 0;
        max-width: 100vw;
        padding: 1.25rem;
        padding-top: calc(56px + 1.25rem);
    }
}
.app-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 49;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s;
}
@media (max-width: 900px) {
    .app-overlay { display: block; pointer-events: none; }
    .app-overlay.visible { opacity: 1; pointer-events: auto; }
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
}
.page-header .quick-actions { display: flex; gap: 0.5rem; margin-left: auto; }

/* =============================================
   CARDS
   ============================================= */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.glass-card:hover { box-shadow: var(--shadow-lg); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font);
    background: var(--bg-subtle);
    color: var(--text);
    transition: all var(--transition);
    line-height: 1.4;
    text-decoration: none;
}
.btn .ti { font-size: 1rem; }
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 1; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); opacity: 1; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #059669; opacity: 1; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #C71F26; opacity: 1; }
.btn-outline { background: transparent; border-color: var(--bg-card-border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); opacity: 1; transform: none; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-link {
    background: none; border: none; cursor: pointer;
    font-size: inherit; color: inherit; font-family: inherit; padding: 0;
}

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block; margin-bottom: 0.4rem;
    font-weight: 600; font-size: 0.82rem;
    color: var(--text); letter-spacing: 0.01em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; max-width: 420px;
    padding: 0.6rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
    background: var(--bg-subtle);
    color: var(--text);
    font-family: var(--font); font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea { background: #0A0E15; }
.errors {
    color: var(--danger); list-style: none; padding: 0;
    margin: 0 0 1rem; font-size: 0.875rem;
}

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-body {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    padding: 2rem; background: #090D12;
}
.auth-container { width: 100%; max-width: 400px; }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { max-width: 400px; margin: 0 auto; padding: 2.25rem 2.5rem; }
.auth-card h2, .auth-form-title {
    margin: 0 0 1.5rem;
    font-family: var(--font-display); font-size: 1.35rem;
    font-weight: 700; letter-spacing: -0.025em;
}
.auth-link { margin-top: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-brand-icon {
    width: 56px; height: 56px; background: var(--primary);
    border-radius: 14px; display: flex; align-items: center;
    justify-content: center; margin: 0 auto 1.1rem;
    font-size: 1.5rem; color: #fff;
    box-shadow: 0 6px 24px rgba(214,52,71,0.40);
}
.auth-brand-name {
    font-family: var(--font-display); font-size: 1.65rem;
    font-weight: 900; letter-spacing: -0.035em;
    margin: 0 0 0.35rem; color: #FFFFFF;
}
.auth-brand-tagline { font-size: 0.875rem; color: #4A5F7A; margin: 0; }

/* =============================================
   TABLES
   ============================================= */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th,
.data-table td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--bg-card-border); }
.data-table th {
    font-weight: 600; color: var(--text-muted);
    font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.08em; background: var(--bg-subtle);
    white-space: nowrap;
}
.data-table th:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
.data-table th:last-child { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.data-table tbody tr { transition: background var(--transition); cursor: pointer; }
.data-table tbody tr:hover { background: var(--primary-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }
.positive { color: var(--success); font-weight: 700; font-family: var(--font-mono); }
.negative { color: var(--danger); font-weight: 700; font-family: var(--font-mono); }

/* =============================================
   METRICS / KPI CARDS
   ============================================= */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.1rem; margin-bottom: 1.5rem;
}
.metric-card {
    padding: 1.35rem 1.5rem; position: relative; overflow: hidden;
    animation: fadeUp 0.36s ease backwards;
    border-left: 3px solid var(--primary);
}
.metric-card:nth-child(1) { animation-delay: 0.04s; border-left-color: var(--primary); }
.metric-card:nth-child(2) { animation-delay: 0.08s; border-left-color: var(--success); }
.metric-card:nth-child(3) { animation-delay: 0.12s; border-left-color: var(--accent); }
.metric-card:nth-child(4) { animation-delay: 0.16s; border-left-color: var(--info); }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.metric-card h3 {
    margin: 0 0 0.55rem; font-family: var(--font);
    font-size: 0.72rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.metric-value {
    margin: 0; font-family: var(--font-mono);
    font-size: 1.65rem; font-weight: 700;
    letter-spacing: -0.02em; color: var(--text);
}

/* Chart */
.chart-card { padding: 1.5rem; }
.chart-card h3 {
    margin: 0 0 1.1rem; font-family: var(--font);
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.chart-card canvas { max-height: 280px; }

/* =============================================
   TOASTS
   ============================================= */
.toast {
    padding: 0.8rem 1.1rem; border-radius: var(--radius-sm);
    margin-bottom: 1rem; font-weight: 500; font-size: 0.875rem;
    display: flex; align-items: center; gap: 0.6rem;
    animation: slideIn 0.26s ease;
    border-left: 3px solid currentColor;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.toast-success { background: var(--success-soft); color: var(--success); }
.toast-error   { background: var(--danger-soft);  color: var(--danger);  }

/* =============================================
   FILTERS
   ============================================= */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filters input,
.filters select {
    padding: 0.45rem 0.85rem; border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border); background: var(--bg-card);
    color: var(--text); font-family: var(--font); font-size: 0.875rem;
    transition: border-color var(--transition);
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--primary); }
[data-theme="dark"] .filters input,
[data-theme="dark"] .filters select { background: #0A0E15; }

/* =============================================
   TRANSACTION FORMS
   ============================================= */
.transaction-forms { display: flex; flex-direction: column; gap: 1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.split-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.split-row select, .split-row input {
    padding: 0.45rem 0.85rem; border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
    background: var(--bg-subtle); color: var(--text);
    font-family: var(--font); font-size: 0.875rem;
}
.split-row select { min-width: 160px; }
.split-row input[type="number"] { width: 100px; font-family: var(--font-mono); }
.split-row input[type="text"] { flex: 1; min-width: 120px; }
.split-summary { margin: 0.6rem 0; font-weight: 700; font-family: var(--font-mono); font-size: 0.95rem; }
.split-summary.valid { color: var(--success); }
.split-summary.invalid { color: var(--danger); }
.hint { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }

/* =============================================
   PROGRESS BARS
   ============================================= */
.progress-bar { height: 6px; background: var(--bg-card-border); border-radius: 99px; overflow: hidden; }
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: 99px; transition: width 0.4s ease;
}

/* =============================================
   BADGES & TAGS
   ============================================= */
.tag-badge {
    display: inline-block; padding: 0.18rem 0.6rem;
    border-radius: 99px; font-size: 0.7rem;
    font-weight: 600; letter-spacing: 0.02em; margin-right: 0.25rem;
}
.badge {
    display: inline-block; padding: 0.18rem 0.55rem;
    border-radius: var(--radius-xs); font-size: 0.72rem; font-weight: 700;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  }
.badge-info    { background: var(--info-soft);    color: var(--info);    }
.badge-accent  { background: var(--accent-soft);  color: var(--accent);  }

/* =============================================
   GOALS
   ============================================= */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.goal-card h3 { margin: 0 0 0.45rem; font-size: 1rem; font-weight: 700; }
.goal-progress { margin: 0.8rem 0; }
.goal-amounts { margin: 0.25rem 0; font-weight: 700; font-size: 0.95rem; font-family: var(--font-mono); }
.goal-date { margin: 0.2rem 0; font-size: 0.82rem; color: var(--text-muted); }
.goal-contribute { display: flex; gap: 0.5rem; margin: 0.7rem 0; }
.goal-contribute input { flex: 1; max-width: 130px; font-family: var(--font-mono); }
.goal-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.goal-completed { opacity: 0.85; border-left: 3px solid var(--success); }
.goal-complete-badge { color: var(--success); font-weight: 700; margin: 0.4rem 0; font-size: 0.82rem; }

/* =============================================
   RECURRING
   ============================================= */
.recurring-form .form-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.75rem; }
.recurring-form .form-row select,
.recurring-form .form-row input { flex: 1; min-width: 110px; }
.row-muted { opacity: 0.55; }

/* =============================================
   REPORTS & INSIGHTS
   ============================================= */
.reports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.report-card { text-decoration: none; color: inherit; transition: transform var(--transition); }
.report-card:hover { transform: translateY(-2px); color: inherit; }
.report-card .report-icon { font-size: 1.65rem; display: block; margin-bottom: 0.4rem; }
.report-card h3 { margin: 0 0 0.2rem; font-size: 0.95rem; }
.report-card p { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.report-filters { margin-bottom: 1rem; }
.chart-container { position: relative; height: 300px; margin: 1rem 0; }
.insights-card .insight {
    margin: 0.4rem 0; padding: 0.6rem 0.75rem;
    border-radius: var(--radius-xs); font-size: 0.875rem;
}
.insight-warning  { background: var(--danger-soft); color: var(--danger);  border-left: 3px solid var(--danger);  }
.insight-positive { background: var(--success-soft); color: var(--success); border-left: 3px solid var(--success); }
.insight-info     { background: var(--info-soft);   color: var(--info);    border-left: 3px solid var(--info);    }

/* Health Score */
.health-score-badge { font-size: 2.5rem; font-weight: 900; font-family: var(--font-mono); color: var(--primary); margin: 0.4rem 0; }
.health-breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; margin-top: 1rem; }
.health-component {
    display: flex; justify-content: space-between;
    padding: 0.5rem 0.75rem; background: var(--bg-subtle);
    border-radius: var(--radius-xs); font-size: 0.875rem;
}
.health-component-score { font-weight: 700; font-family: var(--font-mono); color: var(--primary); }

/* =============================================
   DASHBOARD INTELLIGENCE
   ============================================= */
.dashboard-period-filter { margin-bottom: 1rem; }
.dashboard-period-filter .filters { margin-bottom: 0; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card h3 {
    margin: 0 0 0.4rem; font-family: var(--font); font-size: 0.7rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.kpi-card .metric-value { margin: 0; font-family: var(--font-mono); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.kpi-card .metric-delta { margin: 0.2rem 0 0; font-size: 0.78rem; }
.kpi-card .metric-sub   { margin: 0.2rem 0 0; font-size: 0.75rem; color: var(--text-muted); }
.kpi-card .kpi-label    { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.2rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-card .kpi-value    { display: block; font-size: 1.25rem; font-weight: 700; font-family: var(--font-mono); }
.sparkline { height: 28px; margin-top: 0.35rem; }

.dashboard-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dashboard-row.three-col { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.health-score-card .health-badge { font-family: var(--font-mono); font-size: 2rem; font-weight: 900; margin: 0.4rem 0; }
.health-green  { color: var(--success); }
.health-yellow { color: var(--accent);  }
.health-red    { color: var(--danger);  }
.health-suggestions { margin: 0.4rem 0; padding-left: 1.2rem; font-size: 0.875rem; }

.alerts-list { list-style: none; padding: 0; margin: 0; }
.alert-item { margin-bottom: 0.35rem; }
.alert-item a {
    display: block; padding: 0.5rem 0.65rem;
    border-radius: var(--radius-xs); text-decoration: none;
    color: inherit; font-size: 0.875rem; transition: background var(--transition);
}
.alert-item a:hover { background: var(--bg-subtle); }
.alert-critical a { border-left: 3px solid var(--danger); }
.alert-warning  a { border-left: 3px solid var(--accent); }
.alert-info     a { border-left: 3px solid var(--info);   }

.dashboard-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.upcoming-list { list-style: none; padding: 0; margin: 0; }
.upcoming-list li {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    padding: 0.4rem 0; border-bottom: 1px solid var(--bg-card-border); font-size: 0.875rem;
}
.upcoming-date   { font-weight: 600; min-width: 88px; }
.upcoming-amount { font-weight: 700; font-family: var(--font-mono); }

.goals-mini-list { list-style: none; padding: 0; margin: 0; }
.goals-mini-list li { margin-bottom: 0.6rem; font-size: 0.875rem; }
.goals-mini-list .progress-bar { margin: 0.2rem 0; }
.goal-amounts { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-mono); }
.goal-days { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.35rem; }

.heatmap-preview-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 0.5rem; }
.heatmap-preview-cell {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; border-radius: 3px; text-decoration: none; color: inherit;
    background: rgba(214,52,71, var(--intensity, 0.12)); min-height: 22px;
}
.heatmap-preview-cell.empty { background: var(--bg-subtle); pointer-events: none; }

.mini-charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.mini-chart-wrap { position: relative; height: 100px; }
.mini-chart-label {
    font-size: 0.7rem; color: var(--text-muted);
    display: block; margin-top: 0.2rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
}

/* =============================================
   INVESTMENTS
   ============================================= */
.text-success { color: var(--success); font-family: var(--font-mono); font-weight: 700; }
.text-danger  { color: var(--danger);  font-family: var(--font-mono); font-weight: 700; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }

/* =============================================
   MISC FORMS
   ============================================= */
.disclaimer { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }
.form-stack .form-group { margin-bottom: 1rem; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.form-inline input, .form-inline select { min-width: 100px; }
.form-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.form-row .form-group { flex: 1; min-width: 120px; }
.inline-edit { display: inline-flex; gap: 0.25rem; align-items: center; }
.kpi { font-size: 1rem; margin-bottom: 1rem; font-family: var(--font-mono); font-weight: 700; }
.text-muted { color: var(--text-muted); }
.metric-sub { font-size: 0.82rem; color: var(--text-muted); margin: 0.2rem 0 0; }
.saved-reports-list { list-style: none; padding: 0; margin: 0; }
.saved-reports-list li { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.report-builder-form .form-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.report-builder-form .form-row .form-group { flex: 1; min-width: 150px; }
.budget-alert h3 { margin-bottom: 0.6rem; }
.alerts-card .toast { margin-bottom: 0.4rem; }
.alerts-card .toast:last-child { margin-bottom: 0; }

/* =============================================
   GLOBAL SEARCH
   ============================================= */
.global-search-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.65);
    z-index: 9999; display: flex; align-items: flex-start; justify-content: center;
    padding-top: 14vh; backdrop-filter: blur(6px);
}
.global-search-box {
    background: var(--bg-card); border: 1px solid var(--bg-card-border);
    border-radius: var(--radius); padding: 1rem;
    box-shadow: var(--shadow-lg); min-width: 440px; max-width: 90vw;
}
.global-search-box input {
    width: 100%; padding: 0.9rem 1.15rem; font-size: 1rem;
    border: 1px solid var(--bg-card-border); border-radius: var(--radius-sm);
    font-family: var(--font); background: var(--bg-subtle); color: var(--text);
    transition: border-color var(--transition);
}
.global-search-box input:focus { outline: none; border-color: var(--primary); }

/* =============================================
   QUICK ADD FAB
   ============================================= */
.quick-add-fab {
    position: fixed; bottom: 1.75rem; right: 1.75rem;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; text-decoration: none;
    box-shadow: 0 4px 20px rgba(214,52,71,0.42);
    z-index: 100; transition: transform 0.2s, box-shadow 0.2s;
}
.quick-add-fab:hover {
    transform: scale(1.08); color: #fff;
    box-shadow: 0 6px 28px rgba(214,52,71,0.58);
}

/* =============================================
   UTILITY
   ============================================= */
.font-mono    { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

/* =============================================
   AUTH — SPLIT LAYOUT (redesign)
   ============================================= */
.auth-body {
    min-height: 100vh;
    background: #080D13;
    overflow-x: hidden;
    position: relative;
    display: block;
    padding: 0;
    align-items: unset;
    justify-content: unset;
}

/* decorative blobs */
.auth-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(120px);
}
.auth-blob-1 {
    width: 500px; height: 500px;
    top: -120px; left: -120px;
    background: rgba(214,52,71,.12);
}
.auth-blob-2 {
    width: 420px; height: 420px;
    bottom: -100px; right: -100px;
    background: rgba(59,130,246,.07);
}
.auth-grid-overlay {
    position: absolute; inset: 0; pointer-events: none;
    opacity: .035;
    background-image:
        linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* shell = full-viewport split */
.auth-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    position: relative;
    z-index: 1;
}

/* ── LEFT PANEL ── */
.auth-panel-left {
    width: 460px;
    flex-shrink: 0;
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-right: 1px solid rgba(255,255,255,.07);
    background: linear-gradient(165deg, rgba(214,52,71,.05) 0%, transparent 50%);
}
.auth-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; margin-bottom: 3.5rem;
}
.auth-logo-mark {
    width: 36px; height: 36px; background: var(--primary);
    border-radius: 9px; display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 18px; flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(214,52,71,.4);
}
.auth-logo-name {
    font-family: var(--font-display); font-weight: 800;
    font-size: 16px; letter-spacing: -.03em; color: #fff;
}
.auth-panel-body { flex: 1; }
.auth-panel-headline {
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(28px, 2.8vw, 38px); line-height: 1.1;
    letter-spacing: -.04em; color: #F0F4FA; margin-bottom: 1rem;
}
.auth-panel-headline em {
    font-style: normal;
    background: linear-gradient(135deg, #D63447 10%, #ff6b6b 90%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-panel-sub {
    font-size: 14.5px; color: rgba(165,180,203,.8); line-height: 1.7;
    margin-bottom: 2rem;
}
.auth-feature-list {
    list-style: none; display: flex; flex-direction: column; gap: 12px;
    margin-bottom: 2.5rem;
}
.auth-feature-list li {
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; color: rgba(165,180,203,.75);
}
.auth-feature-list li i {
    font-size: 16px; color: var(--primary); flex-shrink: 0;
}
.auth-panel-foot {
    display: flex; gap: 0; border-top: 1px solid rgba(255,255,255,.07);
    padding-top: 1.5rem; margin-top: auto;
}
.auth-stat {
    flex: 1; text-align: center;
    border-right: 1px solid rgba(255,255,255,.07);
    padding: 0 1rem;
}
.auth-stat:last-child { border-right: none; }
.auth-stat-n {
    display: block; font-family: var(--font-mono);
    font-size: 22px; font-weight: 800; color: var(--primary);
    letter-spacing: -.04em; line-height: 1;
}
.auth-stat-l {
    display: block; font-size: 11px; color: rgba(165,180,203,.55);
    font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    margin-top: 4px;
}

/* ── RIGHT PANEL ── */
.auth-panel-right {
    flex: 1; display: flex;
    align-items: center; justify-content: center;
    padding: 3rem 2.5rem;
    background: radial-gradient(ellipse at 50% 30%, rgba(214,52,71,.04) 0%, transparent 65%);
}
.auth-form-wrap {
    width: 100%; max-width: 420px;
}

/* card header */
.auth-card-header { margin-bottom: 2rem; }
.auth-card-title {
    font-family: var(--font-display); font-weight: 800;
    font-size: 1.75rem; letter-spacing: -.035em; color: #F0F4FA;
    margin: 0 0 .4rem;
}
.auth-card-sub {
    font-size: 14px; color: rgba(165,180,203,.7);
}

/* alert */
.auth-alert {
    display: flex; align-items: center; gap: 10px;
    background: rgba(229,36,43,.1); border: 1px solid rgba(229,36,43,.25);
    color: #ff6b6b; padding: 12px 16px; border-radius: 10px;
    font-size: 13.5px; font-weight: 500; margin-bottom: 1.25rem;
}
.auth-alert i { font-size: 16px; flex-shrink: 0; }

/* field errors list */
.auth-field-errors {
    background: rgba(229,36,43,.07); border: 1px solid rgba(229,36,43,.2);
    border-radius: 10px; padding: 12px 14px;
    margin-bottom: 1.25rem;
    display: flex; flex-direction: column; gap: 5px;
}
.auth-field-error {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; color: #ff6b6b;
}
.auth-field-error i { font-size: 10px; flex-shrink: 0; }

/* form */
.auth-form { display: flex; flex-direction: column; gap: 0; }

/* field */
.auth-field { margin-bottom: 1.1rem; }
.auth-label-row { display: flex; justify-content: space-between; align-items: center; }
.auth-label {
    display: block; font-size: 13px; font-weight: 600;
    color: rgba(165,180,203,.9); margin-bottom: 6px; letter-spacing: -.01em;
}

/* input wrap */
.auth-input-wrap {
    position: relative; display: flex; align-items: center;
}
.auth-input-icon {
    position: absolute; left: 13px; font-size: 15px;
    color: rgba(138,155,181,.5); pointer-events: none;
    transition: color .15s;
}
.auth-input {
    width: 100%; padding: 11px 40px 11px 38px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    font-size: 14px; font-family: var(--font); color: #F0F4FA;
    transition: border-color .2s, box-shadow .2s, background .2s;
    outline: none;
}
.auth-input::placeholder { color: rgba(138,155,181,.4); }
.auth-input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,.06);
    box-shadow: 0 0 0 3px rgba(214,52,71,.15);
}
.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon { color: var(--primary); }
.auth-input-error {
    border-color: rgba(229,36,43,.5) !important;
}
.auth-eye-btn {
    position: absolute; right: 10px;
    background: transparent; border: none; cursor: pointer;
    color: rgba(138,155,181,.45); font-size: 15px; padding: 4px;
    transition: color .15s;
}
.auth-eye-btn:hover { color: rgba(165,180,203,.8); }

/* input hint */
.auth-input-hint {
    display: block; font-size: 11.5px; color: rgba(138,155,181,.55);
    margin-top: 5px; padding-left: 2px;
}
.auth-input-hint-err { color: #ff6b6b !important; }

/* password strength bar */
.auth-pw-strength {
    height: 3px; background: rgba(255,255,255,.07);
    border-radius: 2px; margin-top: 7px; overflow: hidden;
}
.auth-pw-bar {
    height: 100%; width: 0; border-radius: 2px;
    transition: width .3s ease, background .3s ease;
}

/* submit */
.auth-submit-btn {
    width: 100%; padding: 12px 20px; margin-top: .5rem;
    background: var(--primary); color: #fff; border: none;
    border-radius: 10px; font-size: 15px; font-weight: 600;
    font-family: var(--font); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 20px rgba(214,52,71,.35);
    position: relative; overflow: hidden;
}
.auth-submit-btn::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.2) 50%, transparent 60%);
    transform: translateX(-100%); transition: transform .55s;
}
.auth-submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(214,52,71,.5);
}
.auth-submit-btn:hover::after { transform: translateX(100%); }
.auth-submit-btn:active { transform: translateY(0); }

/* footer text */
.auth-foot-text {
    text-align: center; margin-top: 1.4rem;
    font-size: 13.5px; color: rgba(138,155,181,.6);
}
.auth-foot-link {
    color: var(--primary); font-weight: 600; text-decoration: none;
    transition: color .15s;
}
.auth-foot-link:hover { color: var(--primary-hover); }

/* terms */
.auth-terms {
    font-size: 11.5px; color: rgba(138,155,181,.4);
    text-align: center; margin-top: .75rem; line-height: 1.5;
}

/* ── responsive ── */
@media (max-width: 900px) {
    .auth-panel-left { display: none; }
    .auth-panel-right { padding: 2rem 1.5rem; }
    .auth-body { background: #080D13; }
    .auth-shell { justify-content: center; }
    .auth-form-wrap { max-width: 400px; }
}
@media (max-width: 480px) {
    .auth-panel-right { padding: 1.5rem 1.25rem; }
    .auth-card-title { font-size: 1.5rem; }
    .auth-form-card { padding: 1.75rem 1.25rem; }
}

/* ── GLASS FORM CARD ── */
.auth-form-card {
    background: rgba(20,29,43,.9);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 2.25rem 2rem;
    box-shadow:
        0 32px 80px rgba(0,0,0,.45),
        inset 0 1px 0 rgba(255,255,255,.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ── MOBILE LOGO (hidden on desktop, visible on ≤900px) ── */
.auth-mobile-logo {
    display: none;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 1.75rem;
}
.auth-mobile-logo-mark {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px; flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(214,52,71,.45);
}
.auth-mobile-logo-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.03em;
    color: #F0F4FA;
}
@media (max-width: 900px) {
    .auth-mobile-logo { display: flex; }
    .auth-panel-right { padding: 2.5rem 2rem; }
}
@media (max-width: 480px) {
    .auth-panel-right { padding: 2rem 1.25rem; }
    .auth-mobile-logo { margin-bottom: 1.25rem; }
}

/* ── PASSWORD STRENGTH LABEL ── */
.auth-pw-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    min-height: 17px;
    margin-top: 4px;
    padding-left: 2px;
    transition: color .35s;
    letter-spacing: .02em;
}

/* ── INPUT FOCUS RING UPGRADE ── */
.auth-input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,.07);
    box-shadow: 0 0 0 3px rgba(214,52,71,.18), 0 1px 4px rgba(0,0,0,.3);
}
.auth-input-wrap:focus-within .auth-input-icon { color: var(--primary); }

/* ── SUBMIT BUTTON UPGRADE ── */
.auth-submit-btn {
    padding: 13px 20px;
    font-size: 15.5px;
    border-radius: 12px;
    letter-spacing: -.01em;
}
.auth-submit-btn:disabled {
    opacity: .75;
    cursor: not-allowed;
    transform: none !important;
}
.auth-btn-loader { align-items: center; gap: 8px; }

/* ── CARD ICON ── */
.auth-card-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, rgba(214,52,71,.18) 0%, rgba(214,52,71,.06) 100%);
    border: 1px solid rgba(214,52,71,.25);
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--primary);
    margin-bottom: 1.1rem;
    box-shadow: 0 4px 16px rgba(214,52,71,.15);
}

/* ── SPIN ANIMATION ── */
@keyframes auth-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.auth-spin { animation: auth-spin .75s linear infinite; display: inline-block; }

/* =============================================
   RTL SUPPORT (Arabic, Urdu, etc.)
   ============================================= */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--sidebar-border);
}
[dir="rtl"] .main {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}
[dir="rtl"] .sidebar a,
[dir="rtl"] .sidebar button.nav-link,
[dir="rtl"] .sidebar .theme-toggle {
    text-align: right;
}
[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td { text-align: right; }
[dir="rtl"] .data-table th:first-child { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
[dir="rtl"] .data-table th:last-child  { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
[dir="rtl"] .toast { border-left: none; border-right: 3px solid currentColor; }
[dir="rtl"] .metric-card { border-left: none; border-right: 3px solid var(--primary); }
[dir="rtl"] .metric-card:nth-child(1) { border-right-color: var(--primary); }
[dir="rtl"] .metric-card:nth-child(2) { border-right-color: var(--success); }
[dir="rtl"] .metric-card:nth-child(3) { border-right-color: var(--accent); }
[dir="rtl"] .metric-card:nth-child(4) { border-right-color: var(--info); }
[dir="rtl"] .insight-warning  { border-left: none; border-right: 3px solid var(--danger); }
[dir="rtl"] .insight-positive { border-left: none; border-right: 3px solid var(--success); }
[dir="rtl"] .insight-info     { border-left: none; border-right: 3px solid var(--info); }
[dir="rtl"] .alert-critical a { border-left: none; border-right: 3px solid var(--danger); }
[dir="rtl"] .alert-warning  a { border-left: none; border-right: 3px solid var(--accent); }
[dir="rtl"] .alert-info     a { border-left: none; border-right: 3px solid var(--info); }
[dir="rtl"] .goal-completed { border-left: none; border-right: 3px solid var(--success); }
[dir="rtl"] .page-header .quick-actions { margin-left: 0; margin-right: auto; }
[dir="rtl"] .tag-badge { margin-right: 0; margin-left: 0.25rem; }
[dir="rtl"] .goal-days { margin-left: 0; margin-right: 0.35rem; }
[dir="rtl"] .health-suggestions { padding-left: 0; padding-right: 1.2rem; }
[dir="rtl"] .quick-add-fab { right: auto; left: 1.75rem; }
[dir="rtl"] .auth-panel-left { border-right: none; border-left: 1px solid rgba(255,255,255,.07); }
[dir="rtl"] .auth-input-icon { left: auto; right: 13px; }
[dir="rtl"] .auth-eye-btn { right: auto; left: 10px; }
[dir="rtl"] .auth-input { padding: 11px 38px 11px 40px; }

/* =============================================
   SETTINGS
   ============================================= */
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 1.25rem;
    align-items: start;
}
.settings-panel { margin-bottom: 0; }
.settings-panel-profile { grid-row: span 2; }
.settings-panel-head {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    margin-bottom: 1.1rem;
}
.settings-panel-head h3 { margin: 0 0 .2rem; }
.settings-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: rgba(214,52,71,.12);
    border: 1px solid rgba(214,52,71,.22);
    flex: 0 0 auto;
}
.settings-section-title {
    margin: 1.15rem 0 .75rem;
    font-weight: 800;
    color: var(--text);
}
.feature-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 0;
    border-top: 1px solid var(--bg-card-border);
}
.feature-toggle-row small {
    display: block;
    margin-top: .2rem;
}
.settings-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}
.settings-feature-card {
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(255,255,255,.03);
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-height: 220px;
}
.settings-feature-card.disabled {
    opacity: .72;
}
.feature-card-top,
.feature-card-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.feature-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: rgba(214,52,71,.12);
    border: 1px solid rgba(214,52,71,.2);
}
.feature-status {
    border: 1px solid var(--bg-card-border);
    border-radius: 999px;
    padding: .22rem .55rem;
    font-size: .78rem;
    font-weight: 800;
    color: var(--text-muted);
    background: rgba(255,255,255,.04);
}
.feature-status.enabled {
    color: var(--success);
    border-color: rgba(5,150,105,.35);
    background: rgba(5,150,105,.1);
}
.feature-card-body strong,
.feature-card-body small {
    display: block;
}
.feature-card-body small {
    margin-top: .3rem;
}
.feature-card-switch {
    border-top: 1px solid var(--bg-card-border);
    padding-top: .85rem;
    margin-top: auto;
    font-weight: 700;
}
.feature-card-field {
    margin: 0;
}
.switch {
    position: relative;
    display: inline-flex;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch span {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 999px;
    background: var(--bg-card-border);
    transition: background .18s ease;
}
.switch span::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
    transition: transform .18s ease;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(20px); }
[dir="rtl"] .switch span::before {
    left: auto;
    right: 3px;
}
[dir="rtl"] .switch input:checked + span::before { transform: translateX(-20px); }

/* =============================================
   MODALS
   ============================================= */
.app-modal-backdrop[hidden],
.app-modal[hidden],
.transaction-modal-form[hidden] {
    display: none !important;
}
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2,6,23,.68);
    backdrop-filter: blur(5px);
}
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.app-modal-panel {
    width: min(760px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 1px solid var(--bg-card-border);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.app-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.2rem .75rem;
    border-bottom: 1px solid var(--bg-card-border);
}
.app-modal-header h3 {
    margin: 0 .2rem 0 0;
}
.app-modal-header p {
    margin: .25rem 0 0;
}
.app-modal-body {
    padding: 1rem 1.2rem 1.2rem;
}
.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.icon-btn:hover {
    background: rgba(255,255,255,.06);
}
.segmented-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
    padding: .75rem 1.2rem 0;
}
.segmented-control button {
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    color: var(--text-muted);
    padding: .65rem .75rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.segmented-control button.active {
    color: var(--primary);
    border-color: rgba(214,52,71,.38);
    background: rgba(214,52,71,.12);
}
.transaction-modal-form {
    display: grid;
    gap: .95rem;
}
.form-grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    border-top: 1px solid var(--bg-card-border);
    padding-top: 1rem;
}
.empty-state.compact {
    text-align: center;
    border: 1px dashed var(--bg-card-border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.empty-state.compact i {
    font-size: 1.6rem;
    color: var(--primary);
}
.empty-state.compact h4 {
    margin: .35rem 0 .2rem;
}
@media (max-width: 900px) {
    .settings-feature-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }
    .segmented-control {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   REPORTS CENTER
   ============================================= */
.reports-titlebar .text-muted {
    margin: .25rem 0 0;
}
.reports-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    align-items: center;
    gap: 1rem;
}
.reports-hero h3 {
    margin: .65rem 0 .35rem;
}
.reports-search {
    position: relative;
}
.reports-search i {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.reports-search input {
    width: 100%;
    padding-left: 2.4rem;
}
.reports-tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .25rem 0 .9rem;
}
.reports-tabs button {
    border: 1px solid var(--bg-card-border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-muted);
    padding: .55rem .9rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}
.reports-tabs button.active {
    color: var(--primary);
    border-color: rgba(214,52,71,.4);
    background: var(--primary-soft);
}
.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.report-card {
    min-height: 210px;
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    padding: 1.1rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.report-card:hover {
    transform: translateY(-2px);
    border-color: rgba(214,52,71,.4);
    box-shadow: var(--shadow);
}
.report-card[hidden] {
    display: none;
}
.report-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.report-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-soft);
}
.report-card h3 {
    margin: .1rem 0 0;
}
.report-card p {
    margin: 0;
}
.report-open {
    margin-top: auto;
    color: var(--primary);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.reports-saved-section {
    margin-top: 1.5rem;
}
@media (max-width: 1100px) {
    .reports-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .reports-hero,
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   PRICING / PACKAGES
   ============================================= */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.pricing-card {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.pricing-card-pro {
    border-color: rgba(214,52,71,.45);
    box-shadow: 0 18px 55px rgba(214,52,71,.12);
}
.pricing-label {
    display: inline-flex;
    width: fit-content;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: rgba(214,52,71,.12);
    color: var(--primary);
    font-weight: 800;
    font-size: .85rem;
}
.pricing-price {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 900;
    letter-spacing: -.03em;
}
.pricing-price span {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 700;
}
.pricing-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text);
    line-height: 1.8;
}
.package-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    background: rgba(214,52,71,.12);
    color: var(--primary);
    font-weight: 800;
    font-size: .85rem;
}

.package-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.limit-list {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.limit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    background: var(--bg-card-hover);
}

.admin-hero {
    align-items: flex-start;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-kpi {
    display: grid;
    gap: 0.35rem;
}

.admin-kpi-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-kpi strong {
    font-size: 2rem;
    line-height: 1;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.admin-panel {
    min-width: 0;
}

.admin-control-form {
    display: grid;
    gap: 0.9rem;
}

.admin-price-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.admin-stat-list {
    display: grid;
    gap: 0.55rem;
}

.admin-stat-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--bg-card-border);
}

.admin-stat-list > div:last-child {
    border-bottom: 0;
}

.admin-action-card {
    display: grid;
    gap: 0.55rem;
    color: var(--text);
    text-decoration: none;
    min-height: 145px;
}

.admin-action-card i {
    color: var(--primary);
    font-size: 1.45rem;
}

.admin-action-card span {
    color: var(--text-muted);
    line-height: 1.45;
}

.admin-audit-json {
    max-width: 520px;
    max-height: 260px;
    overflow: auto;
    padding: 0.85rem;
    border-radius: 8px;
    background: var(--bg-subtle);
    color: var(--text);
    font-size: 0.82rem;
}

.admin-create-user-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) repeat(4, minmax(130px, 0.75fr));
    gap: 1rem;
    align-items: end;
}

.admin-create-user-submit {
    display: flex;
    align-items: end;
}

@media (max-width: 900px) {
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
        left: auto;
        right: 0;
    }
    [dir="rtl"] .sidebar.open { transform: translateX(0); }
    [dir="rtl"] .main { margin-right: 0; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-panel-profile { grid-row: auto; }
    .pricing-grid { grid-template-columns: 1fr; }
    .admin-kpi-grid,
    .admin-grid,
    .admin-grid-compact,
    .admin-price-row,
    .admin-create-user-form {
        grid-template-columns: 1fr;
    }
}
