/* ============================================================
   TRENDING STYLO ERP - Stylesheet v2.2
   Nunito sans-serif + Hot Red + Cream
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink: #0A0A0A;
    --ink-soft: #1a1614;
    --paper: #F4EFE6;
    --cream: #EAE2D2;
    --cream-light: #F8F4EC;
    --bg-app: #F7F3EA;
    --hot: #FF3B1F;
    --hot-dark: #E02E15;
    --hot-soft: #FFE8E3;
    --gold: #C9A24C;
    --gold-soft: #F5EBD3;
    --mute: #7A7066;
    --mute-soft: #B5AC9F;
    --line: #D9D2C2;
    --line-soft: #E8E2D4;
    --success: #0a8a3c;
    --success-soft: #E6F7EC;
    --warning: #856404;
    --warning-soft: #FFF3CD;
    --danger: #FF3B1F;
    --danger-soft: #FADCD9;

    --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --radius: 16px;
    --radius-sm: 12px;
    --radius-pill: 22px;
    --sidebar-width: 230px;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 14px;
    font-weight: 500;
    overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--hot); }

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 900;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; letter-spacing: -0.01em; }
h4 { font-size: 15px; letter-spacing: -0.01em; }

em, .accent {
    font-style: normal;
    color: var(--hot);
}

.label-mono {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mute);
    font-weight: 500;
}

/* LOGIN PAGE */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--hot) 0%, var(--hot-dark) 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: "";
    position: absolute;
    top: -100px; right: -100px;
    width: 300px; height: 300px;
    border: 1px dashed rgba(244, 239, 230, 0.2);
    border-radius: 50%;
}
.login-page::after {
    content: "";
    position: absolute;
    bottom: -150px; left: -100px;
    width: 400px; height: 400px;
    border: 1px dashed rgba(244, 239, 230, 0.15);
    border-radius: 50%;
}

.login-card {
    background: var(--paper);
    border-radius: 20px;
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.3);
    padding: 36px 30px;
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 2;
}

.login-card .login-logo {
    width: 72px; height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--hot), var(--hot-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 12px 24px -6px rgba(255,59,31,0.4);
    position: relative;
}
.login-card .login-logo::before {
    content: "";
    position: absolute;
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 1.5px solid var(--paper);
    opacity: 0.95;
}
.login-card .login-logo .ts {
    font-family: var(--font-sans);
    font-weight: 900;
    color: var(--paper);
    font-size: 26px;
    letter-spacing: -0.03em;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.login-card h1 {
    text-align: center;
    font-size: 26px;
    margin-bottom: 4px;
    font-weight: 900;
    letter-spacing: -0.02em;
}
.login-card h1 em { color: var(--hot); font-style: normal; }

.login-card .subtitle {
    text-align: center;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--mute);
    margin-bottom: 28px;
    font-weight: 600;
}

/* APP LAYOUT */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar { display: none; }
.desktop-topbar { display: none; }

.mobile-topbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.mobile-topbar .brand { display: flex; align-items: center; gap: 10px; }
.mobile-topbar .logo {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--hot), var(--hot-dark));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--paper);
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -0.03em;
    line-height: 1;
    box-shadow: 0 4px 10px -3px rgba(255,59,31,0.5);
}
.mobile-topbar .brand-text {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 17px;
    line-height: 1;
    letter-spacing: -0.02em;
}
.mobile-topbar .brand-text em { color: var(--hot); font-style: normal; }
.mobile-topbar .store-sub {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--mute);
    font-weight: 600;
    margin-top: 3px;
    max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* User Dropdown (mobile + desktop fallback) */
.user-dropdown {
    position: relative;
}
.user-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: transform 0.15s;
}
.user-trigger:active { transform: scale(0.95); }
.user-trigger .user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ink), #1a1614);
    color: var(--paper);
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--paper);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2), 0 0 0 1px var(--line);
    min-width: 240px;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-header {
    padding: 14px 16px;
    background: var(--cream-light);
    border-bottom: 1px solid var(--line);
}
.dropdown-header .dd-name {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 14px;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.dropdown-header .dd-role {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--mute);
    margin-top: 3px;
    font-weight: 600;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--line-soft);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover {
    background: var(--cream);
    color: var(--ink);
}
.dropdown-item svg { color: var(--mute); flex-shrink: 0; }
.dropdown-item:hover svg { color: var(--ink); }
.dropdown-logout {
    color: var(--hot) !important;
    background: var(--hot-soft);
}
.dropdown-logout svg { color: var(--hot) !important; }
.dropdown-logout:hover {
    background: var(--hot);
    color: var(--paper) !important;
}
.dropdown-logout:hover svg { color: var(--paper) !important; }

/* Desktop pill trigger */
.user-pill-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.user-pill-trigger:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.user-pill-trigger:hover .avatar {
    background: var(--hot);
    color: var(--paper);
}
.user-pill-trigger .avatar {
    width: 30px; height: 30px;
    background: var(--ink);
    color: var(--paper);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 13px;
}
.user-pill-trigger .name {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
}
.user-pill-trigger .chev-down {
    transform: rotate(90deg);
    opacity: 0.5;
    transition: transform 0.2s;
}
.user-pill-trigger.open .chev-down {
    transform: rotate(-90deg);
}

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    z-index: 50;
}
.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    color: var(--mute);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.bottom-nav a:hover { color: var(--ink); }
.bottom-nav a.active { color: var(--hot); }
.bottom-nav a svg { width: 22px; height: 22px; }

body.has-bottom-nav .container { padding-bottom: 90px; }

.main-content { flex: 1; width: 100%; min-width: 0; }
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 18px;
}

@media (min-width: 1024px) {
    .mobile-topbar { display: none !important; }
    .bottom-nav { display: none !important; }

    .sidebar {
        display: flex !important;
        width: var(--sidebar-width);
        background: var(--ink);
        color: var(--cream);
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 40;
        flex-direction: column;
    }

    .desktop-topbar {
        display: flex !important;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: 18px 30px;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 30;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        max-width: calc(100% - var(--sidebar-width));
        background: var(--bg-app);
    }
    .container {
        padding: 24px 28px 50px;
        max-width: 1400px;
    }
    body.has-bottom-nav .container { padding-bottom: 50px !important; }
}

.sidebar-header {
    padding: 18px 14px;
    border-bottom: 1px solid rgba(244, 239, 230, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-header .logo {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--hot), var(--hot-dark));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--paper);
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -0.03em;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -3px rgba(255,59,31,0.5);
    position: relative;
}
.sidebar-header .logo::before {
    content: "";
    position: absolute;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--paper);
    opacity: 0.95;
}
.sidebar-header .logo span { position: relative; z-index: 2; }

.sidebar-header .brand-name {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 16px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--paper);
}
.sidebar-header .brand-name em { color: var(--hot); font-style: normal; }
.sidebar-header .brand-sub {
    font-family: var(--font-mono);
    font-size: 7px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cream);
    opacity: 0.55;
    margin-top: 4px;
    font-weight: 500;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav .nav-section {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cream);
    opacity: 0.45;
    padding: 14px 8px 6px;
    font-weight: 500;
}

.sidebar-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    color: var(--cream);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    transition: all 0.15s;
}
.sidebar-nav a:hover { background: rgba(244, 239, 230, 0.06); color: var(--paper); }
.sidebar-nav a.active {
    background: var(--hot);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 10px -3px rgba(255,59,31,0.5);
}
.sidebar-nav a.active svg { color: #fff; opacity: 1; }
.sidebar-nav a svg { color: var(--cream); opacity: 0.5; flex-shrink: 0; }
.sidebar-nav a:hover svg { color: var(--paper); opacity: 1; }
.sidebar-nav a.disabled-link { opacity: 0.55; }
.sidebar-nav a.disabled-link::after {
    content: 'SOON';
    margin-left: auto;
    font-family: var(--font-sans);
    font-size: 9px;
    background: rgba(201, 162, 76, 0.18);
    color: var(--gold);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.sidebar-footer { padding: 14px 12px; border-top: 1px solid rgba(244, 239, 230, 0.1); }
.sidebar-footer .user-card { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.sidebar-footer .user-card .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-footer .user-card .name {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 12px;
    color: var(--paper);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-footer .user-card .role {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--cream);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 2px;
    font-weight: 500;
}

.desktop-topbar .page-title h1 {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 26px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.desktop-topbar .page-title h1 em { color: var(--hot); font-style: normal; }
.desktop-topbar .page-title .crumb {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--mute);
    margin-top: 6px;
    font-weight: 600;
}
.desktop-topbar .page-title .crumb b { color: var(--ink); font-weight: 700; }

.desktop-topbar .user-menu { display: flex; align-items: center; gap: 14px; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    background: white;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-weight: 500;
}
.form-control:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}
.form-control:disabled {
    background: var(--cream-light);
    color: var(--mute);
    cursor: not-allowed;
}
.form-help {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--mute);
    margin-top: 6px;
    display: flex; align-items: center; gap: 5px;
    font-weight: 500;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--hot); color: #fff; box-shadow: 0 4px 10px -3px rgba(255,59,31,0.5); }
.btn-primary:hover { background: var(--hot-dark); color: #fff; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--ink-soft); color: var(--paper); }
.btn-success { background: var(--success); color: white; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--mute); }
.btn-ghost:hover { background: var(--cream); color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 22px; font-size: 14px; }
.btn-sm { padding: 7px 12px; font-size: 11px; }

/* ALERTS */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13.5px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-family: var(--font-sans);
    font-weight: 500;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--danger-soft); border-color: var(--hot); color: #991b1b; }
.alert-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: var(--gold); color: var(--warning); }
.alert-info { background: var(--cream); border-color: var(--ink); color: var(--ink); }

/* CARDS */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    width: 100%;
    max-width: 100%;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header h3 {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 16px;
    display: flex; align-items: center; gap: 10px;
}
.card-header h3 em { color: var(--hot); font-style: normal; }
.card-header h3 svg { color: var(--ink); }
.card-header .filter {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--mute);
    display: flex;
    gap: 12px;
    font-weight: 600;
}
.card-header .filter a { color: var(--mute); }
.card-header .filter b { color: var(--ink); border-bottom: 2px solid var(--hot); padding-bottom: 3px; font-weight: 700; }

.page-header { margin-bottom: 22px; }
.page-header h1 {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 26px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.page-header h1 em { color: var(--hot); font-style: normal; }
.page-header .subtitle {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--mute);
    margin-top: 6px;
    font-weight: 600;
}
.page-header .subtitle b { color: var(--ink); font-weight: 700; }

/* WELCOME CARD */
.welcome-card {
    background: linear-gradient(135deg, var(--ink) 0%, #1a1614 100%);
    color: var(--paper);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}
.welcome-card::before {
    content: "";
    position: absolute;
    right: -30px; bottom: -30px;
    width: 140px; height: 140px;
    border: 1px dashed rgba(244, 239, 230, 0.15);
    border-radius: 50%;
}
.welcome-card::after {
    content: "";
    position: absolute;
    right: 30px; top: 20px;
    width: 60px; height: 60px;
    background: var(--hot);
    opacity: 0.18;
    border-radius: 50%;
    filter: blur(14px);
}
.welcome-card .greet-tag {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--gold);
    margin-bottom: 8px;
    font-weight: 700;
    display: flex; align-items: center; gap: 6px;
}
.welcome-card .greet-tag::before {
    content: "";
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
}
.welcome-card h2 {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 28px;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--paper);
}
.welcome-card h2 em { color: var(--hot); font-style: normal; }
.welcome-card p {
    font-family: var(--font-sans);
    color: var(--cream);
    opacity: 0.8;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

/* KPI STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    width: 100%;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    overflow: hidden;
}
.stat-card.dark {
    background: linear-gradient(135deg, var(--ink) 0%, #1a1614 100%);
    color: var(--paper);
    border-color: var(--ink);
}
.stat-card .label {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--mute);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
    font-weight: 600;
}
.stat-card .label::before {
    content: "";
    width: 6px; height: 6px;
    background: var(--hot);
    border-radius: 50%;
    flex-shrink: 0;
}
.stat-card.dark .label { color: var(--cream); opacity: 0.75; }

.stat-card .value {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 26px;
    letter-spacing: -0.02em;
    line-height: 1;
}
.stat-card .value em { color: var(--hot); font-style: normal; }
.stat-card.dark .value em { color: var(--gold); }
.stat-card .value small {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--mute);
    margin-left: 3px;
}
.stat-card.dark .value small { color: var(--cream); opacity: 0.65; }

.stat-card .change {
    font-family: var(--font-sans);
    font-size: 11px;
    margin-top: 8px;
    font-weight: 700;
    color: var(--success);
}
.stat-card .change.dn { color: var(--hot); }
.stat-card .change.warn { color: var(--warning); }
.stat-card.dark .change { color: var(--gold); }

.stat-card .spark {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 26px;
}
.stat-card .spark span {
    width: 4px;
    background: var(--hot);
    opacity: 0.4;
    border-radius: 1px;
}
.stat-card.dark .spark span { background: var(--gold); opacity: 0.6; }
.stat-card.success .spark span { background: var(--success); opacity: 0.5; }

/* TABLES */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--mute);
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}
.tbl td {
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 12px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink);
    font-weight: 500;
}
.tbl td.id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--mute);
    font-weight: 500;
}
.tbl td b { font-weight: 700; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg-app); }

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--hot); }
.badge-info { background: var(--cream); color: var(--ink); }
.badge-gray { background: var(--cream); color: var(--mute); }

/* COMING SOON */
.coming-soon {
    text-align: center;
    padding: 60px 24px;
    max-width: 480px;
    margin: 30px auto;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.coming-soon::before {
    content: "";
    position: absolute;
    top: -50px; right: -50px;
    width: 150px; height: 150px;
    border: 1px dashed var(--ink);
    border-radius: 50%;
    opacity: 0.1;
}
.coming-soon .cs-icon {
    width: 84px; height: 84px;
    background: linear-gradient(135deg, var(--hot), var(--hot-dark));
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    color: var(--paper);
    margin: 0 auto 20px;
    box-shadow: 0 14px 30px -10px rgba(255, 59, 31, 0.4);
    position: relative;
    z-index: 2;
}
.coming-soon .cs-step {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--hot);
    margin-bottom: 14px;
    font-weight: 700;
    background: var(--hot-soft);
    padding: 5px 12px;
    border-radius: 12px;
}
.coming-soon h2 {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 28px;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.coming-soon h2 em { color: var(--hot); font-style: normal; }
.coming-soon p {
    font-family: var(--font-sans);
    color: var(--mute);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 28px;
    font-weight: 500;
}
.coming-soon .cs-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* UPDATE BANNER (new version available) */
.update-banner {
    position: fixed;
    bottom: 20px; left: 20px; right: 20px;
    max-width: 420px;
    margin: 0 auto;
    background: var(--ink);
    color: var(--paper);
    padding: 14px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 100;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.4);
    animation: slide-up 0.3s ease-out;
}
@keyframes slide-up { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.update-banner svg { color: var(--hot); flex-shrink: 0; }
.update-banner .update-text {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--cream);
    font-weight: 500;
}
.update-banner .update-text strong {
    display: block;
    font-weight: 900;
    color: var(--paper);
    font-size: 14px;
    margin-bottom: 2px;
}
.update-banner button {
    background: var(--hot);
    color: var(--paper);
    border: none;
    padding: 9px 16px;
    border-radius: 18px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

/* INSTALL BANNER */
.install-banner {
    background: linear-gradient(135deg, var(--ink) 0%, #1a1614 100%);
    color: var(--paper);
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.install-banner::before {
    content: "";
    position: absolute;
    right: -30px; bottom: -30px;
    width: 100px; height: 100px;
    border: 1px dashed rgba(244, 239, 230, 0.2);
    border-radius: 50%;
}
.install-banner svg { flex-shrink: 0; color: var(--hot); position: relative; z-index: 2; }
.install-banner .install-text {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--cream);
    position: relative; z-index: 2;
    font-weight: 500;
}
.install-banner .install-text strong {
    display: block;
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 15px;
    color: var(--paper);
    margin-bottom: 2px;
}
.install-banner .install-text strong em { color: var(--hot); font-style: normal; }
.install-banner button {
    background: var(--hot);
    color: var(--paper);
    border: none;
    padding: 9px 16px;
    border-radius: 18px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative; z-index: 2;
}
.install-banner .close-btn {
    background: rgba(244, 239, 230, 0.15);
    color: var(--paper);
    width: 26px; height: 26px;
    padding: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* QUICK ACTIONS */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.action-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}
.action-btn:hover {
    text-decoration: none;
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}
.action-btn:hover svg { color: var(--paper); }
.action-btn svg { color: var(--hot); flex-shrink: 0; }

/* UTILITY */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-light { color: var(--mute); }
.text-muted { color: var(--mute-soft); }
.text-success { color: var(--success); }
.text-danger { color: var(--hot); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--ink); }
.text-hot { color: var(--hot); }
.text-gold { color: var(--gold); }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.font-black { font-weight: 900; }
.font-mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }

.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.w-full { width: 100%; }
.flex-wrap { flex-wrap: wrap; }

.loader {
    border: 2px solid var(--line);
    border-top-color: var(--hot);
    border-radius: 50%;
    width: 20px; height: 20px;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
    .container { padding: 14px; }
    .login-card { padding: 28px 22px; }
    .stat-card .value { font-size: 22px; }
    .page-header h1 { font-size: 22px; }
    .welcome-card h2 { font-size: 22px; }
}