/* ================================================================
   INVOICER — Enhanced UI
   Design: Refined Slate — Premium SaaS Dashboard
   ================================================================ */

/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
    /* Brand */
    --primary:          #1A56DB;
    --primary-hover:    #1E429F;
    --primary-light:    #EBF5FF;
    --primary-ring:     rgba(26, 86, 219, 0.18);

    /* Sidebar */
    --sidebar-bg:             #0F172A;
    --sidebar-border:         rgba(255, 255, 255, 0.06);
    --sidebar-text:           rgba(203, 213, 225, 0.6);
    --sidebar-text-hover:     rgba(226, 232, 240, 0.9);
    --sidebar-text-active:    #F8FAFC;
    --sidebar-active-bg:      rgba(129, 140, 248, 0.12);
    --sidebar-active-accent:  #818CF8;

    /* Layout */
    --sidebar-width:            260px;
    --sidebar-collapsed-width:  80px;
    --topbar-height:            64px;

    /* Surfaces */
    --bg-page:   #F1F5F9;
    --bg-white:  #FFFFFF;

    /* Text */
    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #94A3B8;

    /* Borders */
    --border:        #E2E8F0;
    --border-strong: #CBD5E1;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.09), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.13), 0 8px 16px rgba(0, 0, 0, 0.06);

    /* Radii */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --t-fast: 0.12s ease;
    --t:      0.2s ease;
    --t-slow: 0.3s ease;

    /* Stat accent palette */
    --accent-blue:   #3B82F6;
    --accent-indigo: #6366F1;
    --accent-violet: #8B5CF6;
    --accent-green:  #10B981;
    --accent-teal:   #14B8A6;
    --accent-amber:  #F59E0B;
    --accent-red:    #EF4444;
    --accent-slate:  #64748B;
    --accent-sky:    #0EA5E9;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    transition: transform var(--t-slow);
    overflow: hidden;
}

/* Subtle top glow */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse 160% 100% at 50% -10%, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar-header {
    padding: 1.25rem 1.125rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #F8FAFC;
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: -0.3px;
    gap: 0.625rem;
}

.sidebar-brand:hover { color: #F8FAFC; }
.brand-text { font-weight: 700; letter-spacing: -0.4px; color: #F8FAFC; }

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: color var(--t-fast), background var(--t-fast);
}

.sidebar-toggle:hover {
    color: #F8FAFC;
    background: rgba(255, 255, 255, 0.07);
}

/* Nav section labels */
.nav-section-label {
    padding: 1.125rem 1.125rem 0.3rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.4);
    user-select: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item { margin: 1px 0.75rem; }

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5625rem 0.875rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), color var(--t-fast);
    font-weight: 500;
    font-size: 0.875rem;
    gap: 0.6875rem;
    position: relative;
}

.nav-link i {
    font-size: 0.9375rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--t-fast), color var(--t-fast);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-hover);
}

.nav-link:hover i { opacity: 0.9; }

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.nav-link.active i {
    opacity: 1;
    color: var(--sidebar-active-accent);
}

/* Left accent bar on active item */
.nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--sidebar-active-accent);
    border-radius: 0 2px 2px 0;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.125rem;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.3);
}

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

.user-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #F8FAFC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--sidebar-text);
    letter-spacing: 0.01em;
}

.logout-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
}

/* ── Main Wrapper ───────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--t-slow);
    display: flex;
    flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
}

.sidebar-toggle-mobile {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    display: none;
    cursor: pointer;
    transition: color var(--t-fast);
    line-height: 1;
}

.sidebar-toggle-mobile:hover { color: var(--text-primary); }

.topbar-title { flex: 1; min-width: 0; }

.page-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.35px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Main Content ───────────────────────────────────────────────── */
.main-content {
    padding: 1.625rem;
    flex: 1;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--bg-white);
    transition: box-shadow var(--t), transform var(--t);
    margin-bottom: 1.25rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 1rem 1.375rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.9375rem;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
}

.card-header i {
    margin-right: 0.5rem;
    opacity: 0.6;
    font-size: 1rem;
}

.card-body { padding: 1.375rem; }

/* ── Stat Cards (new design) ────────────────────────────────────── */
.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t), transform var(--t);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Colored left border accent */
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--stat-color, var(--accent-slate));
    border-radius: 3px 0 0 3px;
}

/* Subtle background glow from accent */
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 96px;
    height: 96px;
    background: radial-gradient(circle, var(--stat-bg, rgba(241,245,249,0.8)) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.stat-card-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    line-height: 1.4;
}

.stat-card-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    flex-shrink: 0;
    background: var(--stat-bg, #F1F5F9);
    color: var(--stat-color, var(--text-secondary));
    position: relative;
    z-index: 1;
}

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.05em;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.stat-card-value.is-money {
    font-size: 1.375rem;
    letter-spacing: -0.04em;
}

.stat-card-value .currency-symbol {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    vertical-align: super;
    margin-right: 1px;
    letter-spacing: 0;
}

.stat-card-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

/* Stat color variants */
.stat-card--blue   { --stat-color: var(--accent-blue);   --stat-bg: #EFF6FF; }
.stat-card--indigo { --stat-color: var(--accent-indigo); --stat-bg: #EEF2FF; }
.stat-card--violet { --stat-color: var(--accent-violet); --stat-bg: #F5F3FF; }
.stat-card--green  { --stat-color: var(--accent-green);  --stat-bg: #ECFDF5; }
.stat-card--teal   { --stat-color: var(--accent-teal);   --stat-bg: #F0FDFA; }
.stat-card--amber  { --stat-color: var(--accent-amber);  --stat-bg: #FFFBEB; }
.stat-card--red    { --stat-color: var(--accent-red);    --stat-bg: #FEF2F2; }
.stat-card--slate  { --stat-color: var(--accent-slate);  --stat-bg: #F8FAFC; }
.stat-card--sky    { --stat-color: var(--accent-sky);    --stat-bg: #F0F9FF; }

/* Legacy Bootstrap colored cards (override to look more refined) */
.card.text-white {
    border-radius: var(--radius-md);
    border: none;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card.text-white::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.card.text-white .card-body { position: relative; z-index: 1; }

.card.text-white h6 {
    font-weight: 500;
    opacity: 0.85;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card.text-white h2 {
    font-weight: 700;
    font-size: 1.875rem;
    margin: 0.375rem 0 0;
    letter-spacing: -0.05em;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    letter-spacing: -0.1px;
    cursor: pointer;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(26, 86, 219, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    box-shadow: 0 3px 8px rgba(26, 86, 219, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(26, 86, 219, 0.3);
}

.btn-secondary {
    background: var(--bg-white);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: #F8FAFC;
    border-color: var(--border-strong);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-hover);
}

.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(26, 86, 219, 0.3);
}

.btn-outline-secondary {
    border: 1.5px solid var(--border-strong);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: #F8FAFC;
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-success { background: #059669; border-color: #059669; color: #fff; }
.btn-success:hover { background: #047857; border-color: #047857; color: #fff; transform: translateY(-1px); }

.btn-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; transform: translateY(-1px); }

.btn-warning { background: #D97706; border-color: #D97706; color: #fff; }
.btn-warning:hover { background: #B45309; border-color: #B45309; color: #fff; }

.btn-info { background: #0284C7; border-color: #0284C7; color: #fff; }
.btn-info:hover { background: #0369A1; border-color: #0369A1; color: #fff; }

.btn-sm {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    line-height: 1.45;
}

.btn-lg {
    padding: 0.6875rem 1.5rem;
    font-size: 0.9375rem;
    border-radius: var(--radius);
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    padding: 0;
    font-weight: 500;
    background: none;
    border: none;
    box-shadow: none;
}

.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.5625rem 0.875rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    line-height: 1.5;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ── Tables ─────────────────────────────────────────────────────── */
.table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    background: #F8FAFC;
    border-bottom: 1px solid var(--border);
    border-top: none;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.07em;
    padding: 0.625rem 0.875rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-secondary);
}

.table tbody td strong { color: var(--text-primary); font-weight: 600; }

.table-sm thead th {
    padding: 0.5rem 0.75rem;
    font-size: 0.65rem;
}

.table-sm tbody td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.table-condensed thead th {
    padding: 0.375rem 0.625rem;
    font-size: 0.625rem;
}

.table-condensed tbody td {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
}

.table tbody tr:hover { background: #F8FAFC; }
.table tbody tr:last-child td { border-bottom: none; }

.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: 28px;
    min-height: 28px;
}

.table .btn-sm i { font-size: 0.8125rem; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
    padding: 0.3em 0.65em;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
}

.badge.bg-success   { background-color: #D1FAE5 !important; color: #065F46 !important; }
.badge.bg-danger    { background-color: #FEE2E2 !important; color: #991B1B !important; }
.badge.bg-warning   { background-color: #FEF3C7 !important; color: #78350F !important; }
.badge.bg-info      { background-color: #DBEAFE !important; color: #1E40AF !important; }
.badge.bg-primary   { background-color: #DBEAFE !important; color: #1E40AF !important; }
.badge.bg-secondary { background-color: #F1F5F9 !important; color: #475569 !important; }
.badge.bg-dark      { background-color: #1E293B !important; color: #E2E8F0 !important; }

/* ── Autocomplete ───────────────────────────────────────────────── */
/* Above Bootstrap modal (1055) so dropdown is usable in dialogs */
.modal .autocomplete-items {
    z-index: 2000;
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 99;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
}

.autocomplete-items div {
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background var(--t-fast);
}

.autocomplete-items div:last-child { border-bottom: none; }
.autocomplete-items div:hover { background: #F8FAFC; }

.autocomplete-active {
    background: var(--primary-light) !important;
    color: var(--primary-hover) !important;
    font-weight: 500;
}

/* ── Invoice Item Rows ──────────────────────────────────────────── */
.invoice-item-row {
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 0;
}

.invoice-item-row:last-child { border-bottom: none; }

/* ── Dashboard Date Filter ──────────────────────────────────────── */
.dash-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.625rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.dash-filter-bar .filter-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ── Login Page ─────────────────────────────────────────────────── */
body.login-body {
    background: #080E1A;
    min-height: 100vh;
}

body.login-body .main-content {
    padding: 0;
    flex: 1;
    display: flex;
    align-items: stretch;
}

body.login-body .container-fluid {
    padding: 0 !important;
    flex: 1;
    display: flex;
}

.login-page-wrapper {
    min-height: calc(100vh - 0px);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 100% 60% at 15% 0%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 100%, rgba(14, 165, 233, 0.18) 0%, transparent 55%),
        #0B1120;
}

/* Dot grid */
.login-page-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Decorative blur orbs */
.login-page-wrapper::after {
    content: '';
    position: absolute;
    top: -120px;
    left: -80px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 65%);
    pointer-events: none;
}

.login-card-wrap {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 2;
    animation: loginIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loginIn {
    from { opacity: 0; transform: translateY(20px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.login-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.login-logo img {
    filter: brightness(1.1);
}

.login-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #F1F5F9;
    letter-spacing: -0.4px;
    margin: 0 0 0.25rem;
}

.login-sub {
    font-size: 0.875rem;
    color: rgba(148, 163, 184, 0.75);
    margin: 0 0 1.75rem;
}

.login-card .form-label {
    color: rgba(203, 213, 225, 0.75);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #F1F5F9;
    border-radius: var(--radius-sm);
    padding: 0.5625rem 0.875rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.login-card .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #818CF8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
    color: #F1F5F9;
    outline: none;
}

.login-card .form-control::placeholder { color: rgba(148, 163, 184, 0.45); }

.login-submit {
    background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
    border: none;
    color: #fff;
    width: 100%;
    padding: 0.6875rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: -0.1px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    cursor: pointer;
}

.login-submit:hover {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    color: #fff;
}

.login-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius);
    font-size: 0.875rem;
    border-width: 1px;
}

.alert-warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #78350F;
}

/* ── Mobile Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle-mobile { display: block; }
    .topbar { padding: 0 1rem; }
    .main-content { padding: 1rem; }

    body.sidebar-open { overflow: hidden; }
    body.sidebar-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        z-index: 999;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}

@media (max-width: 768px) {
    .page-title { font-size: 1rem; }
    .card-body { padding: 1rem; }
    .main-content { padding: 0.875rem; }
    .stat-card-value { font-size: 1.5rem; }
    .stat-card-value.is-money { font-size: 1.125rem; }
    .stat-card { padding: 1rem; }
}

/* ── Print ──────────────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    .main-content { padding: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ── Utilities ──────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Spinner ────────────────────────────────────────────────────── */
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.15em; }
