:root {
    --bg: #070b18;
    --bg-soft: #0a1020;
    --sidebar: #080d1a;
    --panel: rgba(14, 22, 42, .84);
    --panel-solid: #0f172b;
    --panel-2: #141d35;
    --panel-3: #192440;
    --border: rgba(148, 163, 184, .14);
    --border-strong: rgba(139, 92, 246, .30);
    --muted: #8f9bb8;
    --muted-2: #63708e;
    --text: #f7f9ff;
    --primary: #7c3aed;
    --primary-2: #9b6cff;
    --primary-3: #4f46e5;
    --success: #39d98a;
    --danger: #ff6b7a;
    --warning: #ffba42;
    --info: #4aa7ff;
    --cyan: #31d8d0;
    --orange: #ff7f50;
    --pink: #ff6fa9;
    --shadow-sm: 0 12px 32px rgba(0, 0, 0, .22);
    --shadow: 0 24px 70px rgba(0, 0, 0, .34);
    --glow: 0 0 0 1px rgba(139, 92, 246, .08), 0 22px 80px rgba(67, 56, 202, .14);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;
    --sidebar-width: 292px;
}

* { box-sizing: border-box; }
html { min-height: 100%; color-scheme: dark; background: var(--bg); scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 80% -10%, rgba(67, 56, 202, .23), transparent 31%),
        radial-gradient(circle at 55% 35%, rgba(124, 58, 237, .09), transparent 30%),
        linear-gradient(145deg, #070b18 0%, #09101f 45%, #07101d 100%);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;
    opacity: .45;
    background-image:
        linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

::selection { background: rgba(139, 92, 246, .42); color: white; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }

.ambient {
    position: fixed;
    pointer-events: none;
    z-index: -2;
    border-radius: 999px;
    filter: blur(120px);
    opacity: .18;
}
.ambient-one { width: 440px; height: 440px; right: 4%; top: 12%; background: #4f46e5; }
.ambient-two { width: 360px; height: 360px; left: 26%; bottom: -10%; background: #7c3aed; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 70;
    padding: 10px;
    border-right: 1px solid rgba(148, 163, 184, .12);
    background: rgba(5, 10, 22, .94);
    backdrop-filter: blur(24px);
}
.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, .10);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(13, 20, 39, .95), rgba(7, 12, 25, .96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 22px 60px rgba(0,0,0,.24);
    overflow: hidden;
}
.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 92px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .09);
}
.brand-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, .28);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(124, 58, 237, .25), rgba(59, 130, 246, .13));
    box-shadow: 0 12px 34px rgba(124, 58, 237, .24), inset 0 1px 0 rgba(255,255,255,.14);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo i { font-size: 22px; color: #d7c9ff; }
.brand-copy { min-width: 0; }
.brand-copy strong {
    display: block;
    overflow: hidden;
    color: white;
    font-family: Manrope, Inter, sans-serif;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.brand-copy small {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.side-nav {
    flex: 1;
    overflow-y: auto;
    padding: 13px 10px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,.30) transparent;
}
.nav-label {
    margin: 18px 11px 8px;
    color: #68748f;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.nav-link {
    position: relative;
    min-height: 44px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #a9b2c9;
    font-size: 12px;
    font-weight: 650;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.nav-link::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: transparent;
}
.nav-icon {
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #7f8aa6;
    transition: .18s ease;
}
.nav-icon i { font-size: 14px; }
.nav-link:hover {
    color: white;
    background: rgba(255,255,255,.035);
    border-color: rgba(255,255,255,.045);
    transform: translateX(2px);
}
.nav-link:hover .nav-icon { color: #c4b5fd; background: rgba(124,58,237,.10); }
.nav-link.active {
    color: white;
    border-color: rgba(139, 92, 246, .26);
    background: linear-gradient(90deg, rgba(124, 58, 237, .25), rgba(79, 70, 229, .08));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 12px 34px rgba(55, 48, 163, .12);
}
.nav-link.active::before { background: linear-gradient(#a78bfa, #6d5dfc); box-shadow: 0 0 14px rgba(139,92,246,.75); }
.nav-link.active .nav-icon { color: white; background: rgba(124,58,237,.24); box-shadow: 0 7px 18px rgba(124,58,237,.16); }
.sidebar-user {
    margin: 0 10px 10px;
    padding: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(21, 31, 56, .88), rgba(12, 19, 36, .90));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.sidebar-user .avatar {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #d8ccff;
    font-size: 13px;
    font-weight: 800;
    background: linear-gradient(145deg, rgba(124,58,237,.34), rgba(79,70,229,.18));
    border: 1px solid rgba(167,139,250,.22);
}
.online-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border: 2px solid #0c1324;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 10px rgba(57,217,138,.75);
}
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user strong,
.sidebar-user small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-user strong { font-size: 11px; }
.sidebar-user small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.sidebar-logout {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #8290ad;
    transition: .18s ease;
}
.sidebar-logout:hover { color: #ff9aa6; background: rgba(255,107,122,.10); }

/* Main shell */
.main-area { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 88px;
    padding: 14px clamp(20px, 2.6vw, 40px);
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
    background: rgba(7, 11, 24, .74);
    backdrop-filter: blur(24px) saturate(140%);
}
.topbar-title { flex: 1; min-width: 180px; }
.topbar-title h1 {
    margin: 0;
    font-family: Manrope, Inter, sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.topbar-title p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.topbar-search {
    width: min(330px, 28vw);
    min-height: 42px;
    padding: 0 11px 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #8793ad;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 12px;
    background: rgba(12, 19, 36, .72);
    cursor: pointer;
    transition: .18s ease;
}
.topbar-search:hover { border-color: rgba(139,92,246,.35); background: rgba(16,24,45,.88); }
.topbar-search span { display: inline-flex; align-items: center; gap: 9px; font-size: 10px; }
kbd {
    padding: 3px 6px;
    border: 1px solid rgba(148,163,184,.18);
    border-bottom-color: rgba(148,163,184,.28);
    border-radius: 6px;
    color: #75809a;
    background: rgba(255,255,255,.035);
    font: 700 9px/1.2 Inter, sans-serif;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn,
.logout-btn,
.profile-pill {
    border: 1px solid rgba(148, 163, 184, .13);
    background: rgba(13, 21, 40, .78);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
    transition: border-color .18s ease, background .18s ease, transform .18s ease, color .18s ease;
}
.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    cursor: pointer;
}
.icon-btn i { font-size: 15px; }
.icon-btn:hover,
.logout-btn:hover,
.profile-pill:hover { transform: translateY(-1px); border-color: rgba(139,92,246,.32); background: rgba(18,27,50,.94); }
.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border: 2px solid #090e1d;
    border-radius: 999px;
    color: white;
    background: linear-gradient(145deg, #7c3aed, #4f46e5);
    font-size: 8px;
    font-weight: 800;
    box-shadow: 0 0 14px rgba(124,58,237,.58);
}
.profile-pill {
    height: 42px;
    max-width: 230px;
    padding: 0 11px 0 7px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 12px;
}
.profile-pill-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #d7ceff;
    background: linear-gradient(145deg, rgba(124,58,237,.35), rgba(79,70,229,.20));
    border: 1px solid rgba(167,139,250,.22);
    font-size: 9px;
    font-weight: 800;
}
.profile-pill-copy { min-width: 0; }
.profile-pill-copy strong,
.profile-pill-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-pill-copy strong { max-width: 125px; font-size: 10px; }
.profile-pill-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.profile-pill > i { color: #75809a; font-size: 10px; }
.logout-btn { height: 40px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; color: #ff9aa6; font-size: 10px; font-weight: 750; }
.mobile-menu { display: none; }

.content {
    width: 100%;
    max-width: 1760px;
    flex: 1;
    margin: 0 auto;
    padding: 26px clamp(20px, 2.6vw, 40px) 42px;
}
.footer {
    min-height: 56px;
    padding: 0 clamp(20px, 2.6vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(148,163,184,.08);
    color: #5c6884;
    font-size: 9px;
}

/* Alerts */
.alert {
    position: relative;
    margin-bottom: 18px;
    min-height: 46px;
    padding: 11px 42px 11px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(14, 22, 42, .92);
    box-shadow: var(--shadow-sm);
    font-size: 11px;
}
.alert.success { color: #8ff0bd; border-color: rgba(57,217,138,.26); background: rgba(57,217,138,.07); }
.alert.error { color: #ff9ca8; border-color: rgba(255,107,122,.26); background: rgba(255,107,122,.07); }
.alert.warning { color: #ffd37d; border-color: rgba(255,186,66,.28); background: rgba(255,186,66,.07); }
.alert-close { position: absolute; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: currentColor; cursor: pointer; opacity: .7; }
.alert-close:hover { background: rgba(255,255,255,.06); opacity: 1; }

/* Generic page intro */
.page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.page-intro-copy { min-width: 0; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #b9a3ff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: #9b6cff; box-shadow: 0 0 12px #8b5cf6; }
.page-intro h2 {
    margin: 8px 0 6px;
    font-family: Manrope, Inter, sans-serif;
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.08;
    letter-spacing: -.035em;
}
.page-intro p { margin: 0; max-width: 720px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

/* Buttons */
.btn {
    min-height: 40px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 11px;
    color: white;
    background: linear-gradient(145deg, rgba(24,35,63,.96), rgba(15,24,45,.96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 8px 24px rgba(0,0,0,.15);
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); border-color: rgba(139,92,246,.35); }
.btn:active { transform: translateY(0) scale(.99); }
.btn-primary {
    border-color: rgba(167,139,250,.42);
    background: linear-gradient(135deg, #7c3aed, #5b5ce2);
    box-shadow: 0 12px 28px rgba(92,64,219,.24), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-danger { color: #ff9ca8; border-color: rgba(255,107,122,.26); background: rgba(255,107,122,.09); }
.btn-success { color: #8ff0bd; border-color: rgba(57,217,138,.25); background: rgba(57,217,138,.09); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-sm { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 9px; }

/* Cards */
.card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(18, 28, 52, .92), rgba(10, 17, 34, .88));
    box-shadow: var(--glow);
    backdrop-filter: blur(16px);
}
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.card-header {
    position: relative;
    z-index: 1;
    min-height: 64px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
}
.card-header h3 { margin: 0; font-family: Manrope, Inter, sans-serif; font-size: 13px; letter-spacing: -.01em; }
.card-header p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.card-body { position: relative; z-index: 1; padding: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.64fr) minmax(320px, .78fr); gap: 18px; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* KPI cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 126px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(18,28,52,.94), rgba(11,18,35,.90));
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.025);
}
.stat-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: -50px;
    bottom: -60px;
    border-radius: 999px;
    background: rgba(124,58,237,.13);
    filter: blur(6px);
}
.stat-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #d8ccff;
    background: rgba(124,58,237,.15);
    border: 1px solid rgba(167,139,250,.12);
}
.stat-card .value { margin-top: 16px; font-family: Manrope, Inter, sans-serif; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.stat-card .label { margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.analytics-stats .stat-card.positive { border-color: rgba(57,217,138,.22); }
.analytics-stats .stat-card.positive .stat-icon { color: #8ff0bd; background: rgba(57,217,138,.11); }
.analytics-stats .stat-card.positive .value { color: #8ff0bd; }
.analytics-stats .stat-card.negative { border-color: rgba(255,186,66,.20); }
.analytics-stats .stat-card.negative .stat-icon { color: #ffd37d; background: rgba(255,186,66,.10); }
.analytics-stats .stat-card.negative .value { color: #ffd37d; }

/* Premium dashboard */
.dashboard-intro { margin-bottom: 20px; }
.dashboard-intro h2 { font-size: clamp(28px, 3.2vw, 42px); }
.dashboard-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.period-pill {
    min-height: 38px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: #cad1e4;
    background: rgba(13,21,40,.78);
    font-size: 9px;
    font-weight: 700;
}
.premium-stats { grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 12px; }
.premium-stat {
    min-height: 118px;
    padding: 14px;
    display: grid;
    grid-template-columns: 34px minmax(0,1fr);
    grid-template-rows: auto auto 1fr;
    gap: 0 10px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(18,29,55,.94), rgba(10,17,34,.92));
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.025);
}
.premium-stat:hover { border-color: rgba(139,92,246,.24); transform: translateY(-1px); }
.premium-stat .premium-stat-icon {
    grid-row: 1 / 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #d8ccff;
    background: rgba(124,58,237,.15);
    border: 1px solid rgba(167,139,250,.12);
}
.premium-stat.green .premium-stat-icon { color: #8ff0bd; background: rgba(57,217,138,.11); border-color: rgba(57,217,138,.16); }
.premium-stat.orange .premium-stat-icon { color: #ffb083; background: rgba(255,127,80,.11); border-color: rgba(255,127,80,.16); }
.premium-stat.blue .premium-stat-icon { color: #8bc1ff; background: rgba(74,167,255,.11); border-color: rgba(74,167,255,.16); }
.premium-stat.yellow .premium-stat-icon { color: #ffd37d; background: rgba(255,186,66,.11); border-color: rgba(255,186,66,.16); }
.premium-stat.cyan .premium-stat-icon { color: #78ece7; background: rgba(49,216,208,.11); border-color: rgba(49,216,208,.16); }
.premium-stat-label { color: #aeb8cf; font-size: 9px; font-weight: 650; }
.premium-stat-value { margin-top: 4px; font-family: Manrope, Inter, sans-serif; font-size: clamp(18px, 1.55vw, 24px); font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.premium-stat-bottom {
    grid-column: 1 / -1;
    align-self: end;
    margin-top: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}
.premium-stat-change { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.premium-stat-change.up { color: #57e19c; }
.premium-stat-change.down { color: #ff8c98; }
.mini-sparkline { width: 64px; height: 22px; overflow: visible; }
.mini-sparkline path.line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px currentColor); }
.mini-sparkline path.area { opacity: .12; }
.dashboard-chart-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(310px, .84fr); gap: 16px; }
.dashboard-lower-grid { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.dashboard-card { min-height: 100%; }
.chart-card .card-body { padding-top: 10px; }
.chart-wrap { position: relative; height: 290px; }
.chart-wrap.chart-large { height: 330px; }
.dashboard-chart { height: 270px; }
.card-heading-icon {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #d5c8ff;
    background: rgba(124,58,237,.14);
    border: 1px solid rgba(167,139,250,.12);
}
.card-title-row { display: flex; align-items: center; gap: 10px; }
.card-select {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #c3cbe0;
    background: rgba(9,15,30,.78);
    font-size: 9px;
}
.expense-donut-wrap { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(210px,1fr); align-items: center; gap: 12px; min-height: 270px; }
.expense-donut-chart { height: 230px; }
.expense-legend { display: grid; gap: 10px; }
.expense-legend-row { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 9px; align-items: center; font-size: 9px; color: #aeb7cd; }
.expense-legend-row .dot { width: 8px; height: 8px; border-radius: 3px; }
.expense-legend-row strong { color: #edf2ff; font-size: 9px; }
.product-performance-list { display: grid; gap: 12px; }
.product-performance-item { display: grid; grid-template-columns: 38px minmax(120px,.9fr) minmax(120px,1.4fr) auto; gap: 11px; align-items: center; }
.product-performance-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #cfc3ff; background: rgba(124,58,237,.14); border: 1px solid rgba(167,139,250,.12); }
.product-performance-copy strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.product-performance-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.performance-bar { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.055); }
.performance-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d5dfc, #a977ff); box-shadow: 0 0 12px rgba(124,58,237,.35); }
.product-performance-value { min-width: 82px; text-align: right; }
.product-performance-value strong { display: block; font-size: 9px; }
.product-performance-value small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.recent-sales-list { display: grid; }
.recent-sale-row { min-height: 53px; display: grid; grid-template-columns: minmax(130px,1fr) minmax(90px,.8fr) 84px 68px; gap: 12px; align-items: center; border-bottom: 1px solid rgba(148,163,184,.08); font-size: 9px; }
.recent-sale-row:last-child { border-bottom: 0; }
.recent-sale-invoice { color: #bca8ff; font-weight: 700; }
.recent-sale-customer { color: #b3bdd2; }
.recent-sale-amount { font-weight: 750; }
.status-pill { justify-self: end; display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; color: #83efb7; background: rgba(57,217,138,.10); border: 1px solid rgba(57,217,138,.18); font-size: 8px; font-weight: 750; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.dashboard-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; margin-top: 16px; }
.quick-actions-card .card-body { display: grid; grid-template-columns: repeat(6, minmax(100px,1fr)); gap: 9px; }
.quick-action {
    min-height: 66px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148,163,184,.10);
    border-radius: 12px;
    background: rgba(255,255,255,.024);
    transition: .18s ease;
}
.quick-action:hover { transform: translateY(-2px); border-color: rgba(139,92,246,.28); background: rgba(124,58,237,.08); }
.quick-action-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #d7ccff; background: rgba(124,58,237,.15); }
.quick-action:nth-child(2) .quick-action-icon { color: #91c5ff; background: rgba(74,167,255,.12); }
.quick-action:nth-child(3) .quick-action-icon { color: #86ebc7; background: rgba(57,217,138,.12); }
.quick-action:nth-child(4) .quick-action-icon { color: #ffc07d; background: rgba(255,186,66,.12); }
.quick-action:nth-child(5) .quick-action-icon { color: #ff9dbf; background: rgba(255,111,169,.12); }
.quick-action:nth-child(6) .quick-action-icon { color: #cfbdff; background: rgba(139,92,246,.15); }
.quick-action strong { display: block; font-size: 9px; }
.quick-action small { display: block; margin-top: 3px; color: var(--muted); font-size: 7px; }
.assistant-card {
    padding: 16px;
    display: grid;
    grid-template-columns: 64px minmax(0,1fr);
    gap: 13px;
    align-items: center;
    background:
        radial-gradient(circle at 90% 120%, rgba(124,58,237,.36), transparent 48%),
        linear-gradient(145deg, rgba(28,32,70,.94), rgba(15,20,45,.94));
}
.assistant-logo { width: 62px; height: 62px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid rgba(167,139,250,.18); }
.assistant-logo img { width: 100%; height: 100%; object-fit: cover; }
.assistant-logo i { font-size: 28px; color: #d7ccff; }
.assistant-copy h3 { margin: 0; font-size: 12px; }
.assistant-copy p { margin: 5px 0 10px; color: #9ba6c0; font-size: 8px; line-height: 1.5; }

/* Tables */
.table-wrap { position: relative; z-index: 1; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    padding: 12px 14px;
    text-align: left;
    color: #71809e;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    border-bottom: 1px solid rgba(148,163,184,.11);
    background: rgba(8,14,28,.20);
}
td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(148,163,184,.075);
    color: #cbd3e7;
    font-size: 10px;
    vertical-align: middle;
}
tbody tr { transition: .16s ease; }
tbody tr:hover { background: rgba(124,58,237,.035); }
tbody tr:last-child td { border-bottom: 0; }
.table-title { color: #f4f6ff; font-weight: 700; }
.table-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 800; }
.badge-success { color: #8ff0bd; background: rgba(57,217,138,.10); border: 1px solid rgba(57,217,138,.16); }
.badge-danger { color: #ff9ca8; background: rgba(255,107,122,.10); border: 1px solid rgba(255,107,122,.16); }
.badge-warning { color: #ffd37d; background: rgba(255,186,66,.10); border: 1px solid rgba(255,186,66,.16); }
.badge-purple { color: #d3c5ff; background: rgba(124,58,237,.12); border: 1px solid rgba(139,92,246,.17); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pagination { display: flex; gap: 6px; justify-content: center; padding: 17px; border-top: 1px solid var(--border); }
.pagination a,
.pagination span { min-width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: #aeb7ca; font-size: 9px; }
.pagination a:hover { border-color: rgba(139,92,246,.35); color: white; }
.pagination .active { color: white; background: linear-gradient(145deg,#7c3aed,#5b5ce2); border-color: rgba(167,139,250,.3); }

/* Forms */
.search-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.search-bar .form-control { flex: 1 1 260px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
label {
    display: block;
    margin-bottom: 7px;
    color: #b9c2d7;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.form-control,
.form-select {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid rgba(148,163,184,.14);
    border-radius: 11px;
    color: #eef2ff;
    background: rgba(7,13,27,.78);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.012);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control:hover,
.form-select:hover { border-color: rgba(148,163,184,.22); }
.form-control:focus,
.form-select:focus { border-color: rgba(139,92,246,.70); background: rgba(9,15,31,.92); box-shadow: 0 0 0 3px rgba(124,58,237,.12), 0 10px 28px rgba(0,0,0,.12); }
.form-control::placeholder { color: #4e5a74; }
textarea.form-control { min-height: 118px; resize: vertical; line-height: 1.55; }
.help-text { margin-top: 6px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.form-error { margin-top: 6px; color: #ff9ca8; font-size: 9px; }
.form-actions { grid-column: 1 / -1; padding-top: 7px; display: flex; justify-content: flex-end; gap: 9px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; color: #c4cde1; font-size: 10px; }
.checkbox-row input { margin-top: 2px; accent-color: var(--primary); }

/* Empty states */
.empty-state {
    position: relative;
    overflow: hidden;
    padding: 62px 24px;
    text-align: center;
    border: 1px dashed rgba(139,92,246,.30);
    border-radius: 20px;
    background: radial-gradient(circle at 50% 10%, rgba(124,58,237,.13), transparent 42%), rgba(14,22,42,.55);
}
.empty-icon { width: 58px; height: 58px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 17px; color: #cfc0ff; background: rgba(124,58,237,.14); border: 1px solid rgba(167,139,250,.14); font-size: 23px; }
.empty-state h2 { margin: 0 0 8px; font-family: Manrope, Inter, sans-serif; font-size: 18px; }
.empty-state p { max-width: 520px; margin: 0 auto 18px; color: var(--muted); font-size: 10px; line-height: 1.65; }

/* Sale creation */
.page-sales-create .page-intro { margin-bottom: 18px; }
.page-sales-create form > .grid-2 { align-items: start; }
.product-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 105px 125px 40px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    margin-bottom: 9px;
    border: 1px solid rgba(148,163,184,.12);
    border-radius: 13px;
    background: rgba(255,255,255,.018);
    transition: .18s ease;
}
.product-row:hover { border-color: rgba(139,92,246,.24); background: rgba(124,58,237,.035); }
.sale-summary { position: sticky; top: 106px; }
.summary-line { padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); border-bottom: 1px solid rgba(148,163,184,.075); font-size: 10px; }
.summary-line strong { color: white; }
.summary-line.total { margin-top: 5px; padding-top: 15px; border-bottom: 0; font-size: 12px; }
.summary-line.total strong { color: #cfc2ff; font-family: Manrope, Inter, sans-serif; font-size: 20px; }

/* Invoice */
.invoice-page { max-width: 980px; margin: 0 auto; }
.invoice-sheet { color: #182033; background: white; border-radius: 20px; padding: 38px; box-shadow: 0 28px 80px rgba(0,0,0,.38); }
.invoice-header { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 23px; border-bottom: 2px solid #ede9fe; }
.invoice-brand { display: flex; gap: 14px; align-items: center; }
.invoice-brand-logo { width: 62px; height: 62px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 15px; }
.invoice-brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.invoice-brand h2 { margin: 0; font-size: 22px; }
.invoice-brand p { margin: 6px 0 0; color: #6b7280; font-size: 10px; }
.invoice-meta { text-align: right; }
.invoice-meta h1 { margin: 0 0 8px; color: #7c3aed; font-size: 26px; }
.invoice-meta div { margin: 4px 0; color: #6b7280; font-size: 10px; }
.invoice-note { margin: 21px 0; padding: 14px 16px; border-radius: 11px; color: #4b5563; background: #f7f5ff; font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.invoice-customer { margin: 21px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.invoice-customer h4 { margin: 0 0 8px; color: #7c3aed; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.invoice-customer p { margin: 3px 0; color: #4b5563; font-size: 10px; }
.invoice-sheet table th { color: #6b7280; border-color: #e5e7eb; background: #f9fafb; }
.invoice-sheet table td { color: #374151; border-color: #e5e7eb; }
.invoice-totals { width: min(360px, 100%); margin: 18px 0 0 auto; }
.invoice-totals .summary-line { color: #6b7280; border-color: #e5e7eb; }
.invoice-totals .summary-line strong { color: #111827; }
.invoice-totals .summary-line.total strong { color: #7c3aed; }
.invoice-footer { margin-top: 28px; text-align: center; color: #9ca3af; font-size: 8px; }

/* Settings / code / utility */
.settings-preview { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.018); }
.settings-preview img { width: 58px; height: 58px; object-fit: cover; border-radius: 14px; background: white; }
.settings-preview strong,
.settings-preview span { display: block; }
.settings-preview span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.code-box { padding: 14px; overflow-x: auto; border: 1px solid rgba(148,163,184,.12); border-radius: 12px; color: #cfc4ff; background: #060b17; font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.danger-box { padding: 16px; border: 1px solid rgba(255,107,122,.24); border-radius: 14px; background: rgba(255,107,122,.055); }
.form-card-narrow { max-width: 760px; }

/* Analytics and expenses */
.analytics-filter-card { margin-bottom: 18px; }
.analytics-filter { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)) auto; gap: 11px; align-items: end; }
.expense-filter { grid-template-columns: repeat(5, minmax(140px, 1fr)) auto; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.filter-summary { margin-top: 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.is-hidden { display: none !important; }
.analytics-chart-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(300px, .80fr); gap: 17px; }
.share-cell { min-width: 130px; display: flex; align-items: center; gap: 9px; }
.share-cell small { min-width: 45px; text-align: right; color: var(--muted); font-size: 8px; }
.progress-track { flex: 1; height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.06); }
.progress-track span { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d5dfc, #4aa7ff); box-shadow: 0 0 12px rgba(124,58,237,.28); }
.expense-amount { color: #ff9ca8; white-space: nowrap; }
.expense-stats { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(124,58,237,.24), transparent 31%),
        radial-gradient(circle at 82% 78%, rgba(59,130,246,.16), transparent 29%),
        #070b18;
}
.login-card {
    width: min(1040px, 100%);
    min-height: 610px;
    display: grid;
    grid-template-columns: 1.12fr .88fr;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 28px;
    background: rgba(13,21,40,.94);
    box-shadow: 0 40px 120px rgba(0,0,0,.50), 0 0 0 1px rgba(124,58,237,.06);
}
.login-visual {
    position: relative;
    overflow: hidden;
    padding: 54px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at 10% 10%, rgba(139,92,246,.32), transparent 34%),
        radial-gradient(circle at 85% 85%, rgba(59,130,246,.18), transparent 30%),
        linear-gradient(145deg, #101933, #0a1020);
}
.login-visual::after { content: ""; position: absolute; width: 360px; height: 360px; right: -120px; bottom: -160px; border-radius: 999px; border: 70px solid rgba(124,58,237,.08); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.login-brand .brand-logo { width: 58px; height: 58px; }
.login-visual h1 { position: relative; z-index: 1; max-width: 460px; margin: 0; font-family: Manrope, Inter, sans-serif; font-size: clamp(38px, 5vw, 62px); line-height: .98; letter-spacing: -.05em; }
.login-visual p { position: relative; z-index: 1; max-width: 440px; color: var(--muted); font-size: 11px; line-height: 1.72; }
.login-form { padding: 54px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 8px; font-family: Manrope, Inter, sans-serif; font-size: 28px; }
.login-form > p { margin: 0 0 28px; color: var(--muted); font-size: 10px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form .btn { width: 100%; min-height: 47px; margin-top: 6px; }

/* Command palette */
.command-palette { position: fixed; inset: 0; z-index: 140; display: none; }
.command-palette.open { display: block; }
.command-backdrop { position: absolute; inset: 0; background: rgba(2,6,16,.72); backdrop-filter: blur(12px); }
.command-dialog {
    position: relative;
    width: min(680px, calc(100% - 28px));
    max-height: min(680px, calc(100vh - 60px));
    margin: 9vh auto 0;
    overflow: hidden;
    border: 1px solid rgba(139,92,246,.28);
    border-radius: 20px;
    background: rgba(10,17,34,.97);
    box-shadow: 0 40px 120px rgba(0,0,0,.58), 0 0 50px rgba(79,70,229,.13);
}
.command-head { min-height: 62px; padding: 0 17px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.command-head > i { color: #a993ff; }
.command-head input { min-width: 0; flex: 1; border: 0; outline: 0; color: white; background: transparent; font-size: 12px; }
.command-head input::placeholder { color: #66728d; }
.command-body { max-height: 520px; overflow-y: auto; padding: 16px; }
.command-body > p { margin: 0 0 10px; color: #68748e; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.command-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.command-grid a { min-height: 68px; padding: 10px; display: flex; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 12px; background: rgba(255,255,255,.018); transition: .16s ease; }
.command-grid a:hover,
.command-grid a.focused { border-color: rgba(139,92,246,.25); background: rgba(124,58,237,.08); }
.command-grid a > span { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #d3c6ff; background: rgba(124,58,237,.13); }
.command-grid strong,
.command-grid small { display: block; }
.command-grid strong { font-size: 10px; }
.command-grid small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.command-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 10px; }

.sidebar-backdrop { display: none; }
.mobile-bottom-nav { display: none; }

/* Responsive */
@media (max-width: 1480px) {
    .premium-stats { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
    .quick-actions-card .card-body { grid-template-columns: repeat(3, minmax(120px,1fr)); }
}
@media (max-width: 1280px) {
    :root { --sidebar-width: 264px; }
    .premium-stats { grid-template-columns: repeat(3, minmax(150px,1fr)); }
    .topbar-search { width: 240px; }
    .profile-pill-copy { display: none; }
    .profile-pill { padding-right: 8px; }
    .dashboard-bottom-grid { grid-template-columns: 1fr; }
    .assistant-card { grid-template-columns: 58px minmax(0,1fr); }
    .stats-grid { grid-template-columns: repeat(4, minmax(145px,1fr)); }
}
@media (max-width: 1080px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(86vw, 310px);
        padding: 8px;
        transform: translateX(-104%);
        transition: transform .24s cubic-bezier(.2,.8,.2,1);
        box-shadow: 30px 0 80px rgba(0,0,0,.45);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.open { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(2,6,16,.62); backdrop-filter: blur(5px); }
    .mobile-menu { display: inline-flex; }
    .topbar-search { margin-left: auto; width: 230px; }
    .topbar-title { flex: 0 1 auto; }
    .dashboard-chart-grid,
    .dashboard-lower-grid,
    .grid-2,
    .grid-equal,
    .analytics-chart-grid { grid-template-columns: 1fr; }
    .sale-summary { position: static; }
    .expense-donut-wrap { grid-template-columns: 1fr 1fr; }
    .analytics-filter,
    .expense-filter { grid-template-columns: repeat(3, minmax(145px,1fr)); }
    .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
    .topbar { min-height: 72px; padding: 10px 16px; }
    .topbar-title p { display: none; }
    .topbar-title h1 { font-size: 17px; }
    .topbar-search { display: none; }
    .profile-pill,
    .desktop-help { display: none; }
    .content { padding: 20px 16px 98px; }
    .footer { display: none; }
    .mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 60;
        height: 66px;
        padding: 7px 10px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        border: 1px solid rgba(148,163,184,.17);
        border-radius: 20px;
        background: rgba(8,14,28,.92);
        backdrop-filter: blur(24px);
        box-shadow: 0 20px 60px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.035);
    }
    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        height: 48px;
        padding: 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border: 0;
        border-radius: 13px;
        color: #71809d;
        background: transparent;
        font-size: 8px;
        cursor: pointer;
    }
    .mobile-bottom-nav i { font-size: 16px; }
    .mobile-bottom-nav .active { color: #c8b9ff; background: rgba(124,58,237,.11); }
    .mobile-bottom-nav .mobile-new-sale {
        width: 54px;
        height: 54px;
        margin: -22px auto 0;
        border: 1px solid rgba(196,181,253,.48);
        border-radius: 999px;
        color: white;
        background: linear-gradient(145deg,#8b5cf6,#5b5ce2);
        box-shadow: 0 0 0 6px rgba(9,14,28,.94), 0 12px 34px rgba(124,58,237,.42), inset 0 1px 0 rgba(255,255,255,.25);
    }
    .mobile-bottom-nav .mobile-new-sale i { font-size: 23px; }
    .page-intro { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
    .page-actions { width: 100%; justify-content: flex-start; }
    .page-actions .btn { flex: 1 1 auto; }
    .premium-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .expense-donut-wrap { grid-template-columns: 1fr; }
    .expense-donut-chart { height: 220px; }
    .product-performance-item { grid-template-columns: 36px minmax(0,1fr) auto; }
    .product-performance-item .performance-bar { grid-column: 2 / 4; }
    .recent-sale-row { grid-template-columns: minmax(120px,1fr) 80px 65px; }
    .recent-sale-row .recent-sale-customer { display: none; }
    .quick-actions-card .card-body { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .product-row { grid-template-columns: 1fr 88px 38px; }
    .product-row .price-field { display: none; }
    .product-row .remove-row { align-self: end; }
    .analytics-filter,
    .expense-filter { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .invoice-sheet { padding: 24px 18px; }
    .invoice-header { flex-direction: column; }
    .invoice-meta { text-align: left; }
    .invoice-customer { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .topbar { gap: 9px; }
    .topbar-title { min-width: 0; }
    .topbar-title h1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
    .topbar-actions { gap: 6px; }
    .topbar-actions .icon-btn { width: 36px; height: 36px; }
    .content { padding: 17px 13px 96px; }
    .page-intro h2 { font-size: 28px; }
    .premium-stats { gap: 9px; }
    .premium-stat { min-height: 112px; padding: 12px; grid-template-columns: 30px minmax(0,1fr); gap: 0 8px; }
    .premium-stat .premium-stat-icon { width: 30px; height: 30px; }
    .premium-stat-value { font-size: 18px; }
    .premium-stat-change { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
    .mini-sparkline { width: 54px; }
    .card-header { padding: 13px 14px; }
    .card-body { padding: 14px; }
    .chart-wrap,
    .dashboard-chart { height: 245px; }
    .chart-wrap.chart-large { height: 280px; }
    .quick-actions-card .card-body { grid-template-columns: 1fr 1fr; gap: 8px; }
    .quick-action { min-height: 58px; padding: 8px; }
    .assistant-card { grid-template-columns: 50px minmax(0,1fr); padding: 13px; }
    .assistant-logo { width: 50px; height: 50px; }
    .analytics-filter,
    .expense-filter { grid-template-columns: 1fr; }
    .filter-actions { flex-wrap: wrap; }
    .filter-actions .btn { flex: 1; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .command-dialog { margin-top: 4vh; }
    .command-grid { grid-template-columns: 1fr; }
    .login-page { padding: 14px; }
    .login-card { min-height: auto; grid-template-columns: 1fr; border-radius: 22px; }
    .login-visual { display: none; }
    .login-form { padding: 38px 24px; }
    th { padding: 11px 12px; }
    td { padding: 12px; }
}

@media print {
    @page { size: A4 portrait; margin: 5mm; }
    html, body { width: 210mm; min-height: 297mm; background: white !important; }
    body::before,
    .ambient,
    .sidebar,
    .topbar,
    .footer,
    .mobile-bottom-nav,
    .no-print,
    .sidebar-backdrop,
    .command-palette { display: none !important; }
    .app-shell,
    .main-area,
    .content { display: block !important; width: 100% !important; max-width: none !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; }
    .invoice-page { max-width: none; width: 100%; margin: 0; }
    .invoice-sheet { width: 100%; padding: 7mm; border-radius: 0; box-shadow: none; transform-origin: top left; }
    .invoice-note { white-space: pre-wrap; overflow-wrap: anywhere; }
    .invoice-sheet table,
    .invoice-sheet tr { page-break-inside: avoid; }
}

.sale-progress {
    max-width: 760px;
    margin: -4px 0 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
}
.sale-progress span {
    position: relative;
    min-height: 48px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(148,163,184,.11);
    border-radius: 12px;
    color: #697691;
    background: rgba(12,19,36,.62);
}
.sale-progress span::after {
    content: "";
    position: absolute;
    left: calc(100% + 1px);
    top: 50%;
    width: 8px;
    height: 1px;
    background: rgba(148,163,184,.14);
}
.sale-progress span:last-child::after { display: none; }
.sale-progress b {
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255,255,255,.035);
    font-size: 9px;
}
.sale-progress em { font-style: normal; font-size: 9px; font-weight: 700; }
.sale-progress .active { color: #d7ceff; border-color: rgba(139,92,246,.22); background: rgba(124,58,237,.075); }
.sale-progress .active b { color: white; background: linear-gradient(145deg,#7c3aed,#5b5ce2); box-shadow: 0 7px 18px rgba(124,58,237,.22); }
@media (max-width: 560px) {
    .sale-progress { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .sale-progress span { min-height: 42px; padding: 7px; justify-content: center; }
    .sale-progress em { display: none; }
    .sale-progress span::after { width: 6px; }
}
