@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ══════════════════════════════════════════════════════════
   VINCENT ERP – Enterprise Design System
   Developed by Vincent Wu | 0394065505
══════════════════════════════════════════════════════════ */

:root {
    /* Brand Colors */
    --primary:        #1d4ed8;
    --primary-hover:  #1e40af;
    --primary-light:  #eff6ff;
    --primary-glow:   rgba(29, 78, 216, 0.18);

    /* Semantic Colors */
    --success:        #059669;
    --success-light:  #d1fae5;
    --warning:        #d97706;
    --warning-light:  #fef3c7;
    --danger:         #dc2626;
    --danger-light:   #fee2e2;
    --info:           #0284c7;
    --info-light:     #e0f2fe;

    /* Neutrals */
    --bg-app:         #f0f4f8;
    --bg-card:        #ffffff;
    --bg-sidebar:     #0d1b2a;
    --bg-sidebar-2:   #112240;
    --text-main:      #0f172a;
    --text-sub:       #334155;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;
    --border:         #e2e8f0;
    --border-light:   #f1f5f9;

    /* Radius */
    --radius-xs:  4px;
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:  0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
    --shadow-xl:  0 32px 64px rgba(0,0,0,0.18);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 256px;
    --header-height: 72px;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── APP LAYOUT ────────────────────────────────────────── */
.app-container { display: flex; min-height: 100vh; }

/* ══════════════════════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════════════════════ */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    z-index: 9999; flex-direction: column; gap: 16px;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
.loading-text { font-size: 13px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   SIDEBAR – Enterprise Dark Nav
══════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #cbd5e1;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255,255,255,0.04);
}

/* Sidebar Logo / Brand */
.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
    text-decoration: none;
    color: white;
}
.sidebar .logo .logo-icon {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(29,78,216,0.4);
}
.sidebar .logo .logo-icon i { width: 17px; height: 17px; color: white; }
.sidebar .logo span {
    font-size: 15px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
}

/* Sidebar Section Headers */
.sidebar h3 {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #475569;
    padding: 16px 20px 6px;
    margin: 0;
}

/* Nav Menu */
.nav-menu { list-style: none; padding: 0 10px; margin-bottom: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: #94a3b8;
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
    user-select: none;
}
.nav-item i { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}
.nav-item.active {
    background: rgba(29,78,216,0.25);
    color: #93c5fd;
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 12px 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.user-info {
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.user-info p { font-weight: 700; color: #e2e8f0; font-size: 13px; }
.user-info small { color: #64748b; font-size: 11px; }

/* Developer Credit in Sidebar */
.sidebar-credit {
    padding: 8px 12px;
    font-size: 10px;
    color: #334155;
    text-align: center;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── HEADER ────────────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(240,244,248,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.header-left h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
}
.header-left p {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 1px;
    font-weight: 500;
}
.header-right { display: flex; align-items: center; gap: 10px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box input {
    padding: 8px 14px 8px 38px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    width: 240px;
    font-size: 13px;
    transition: var(--transition);
    background: white;
    color: var(--text-main);
}
.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
    width: 280px;
}
.search-box i { position: absolute; left: 12px; color: var(--text-muted); width: 15px; height: 15px; }

#languageSwitcher {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: white;
    cursor: pointer;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}
#languageSwitcher:focus { border-color: var(--primary); }

/* ── PAGE CONTENT AREA ─────────────────────────────────── */
.page-content { padding: 28px 32px; flex: 1; }

/* ── PAGE SECTIONS ─────────────────────────────────────── */
.page-section { display: none; animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

/* ══════════════════════════════════════════════════════════
   STATS CARDS
══════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { opacity: 1; }

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon i { width: 20px; height: 20px; }
.stat-icon.revenue  { background: #dcfce7; color: #16a34a; }
.stat-icon.orders   { background: #dbeafe; color: #2563eb; }
.stat-icon.products { background: #fef3c7; color: #d97706; }
.stat-icon.customers{ background: #fce7f3; color: #db2777; }
.stat-icon.samples  { background: #f3e8ff; color: #9333ea; }

.stat-content h3 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}
.stat-content p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ══════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════ */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar select,
.filter-bar input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    background: white;
    font-size: 13px;
    color: var(--text-main);
    transition: var(--transition);
    height: 36px;
}
.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.filter-bar input { flex: 1; min-width: 180px; }

/* ══════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════ */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: #f8fafc; }
.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    border-top: 1px solid #f8fafc;
    font-size: 13px;
    vertical-align: middle;
    color: var(--text-sub);
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover td { background: #f8fafc; }
.data-table tbody tr:first-child td { border-top: none; }

.table-actions { display: flex; gap: 5px; align-items: center; }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    white-space: nowrap;
    line-height: 1;
}
.btn i { width: 15px; height: 15px; }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(29,78,216,0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(29,78,216,0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: white;
    border: 1.5px solid var(--border);
    color: var(--text-sub);
}
.btn-secondary:hover {
    background: var(--bg-app);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

.btn-icon {
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.btn-icon i { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════ */
.badge {
    padding: 2px 9px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-gray   { background: #f1f5f9; color: #475569; border: 1px solid var(--border); }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-teal         { background: #ccfbf1; color: #0f766e; }
.badge-info         { background: #dbeafe; color: #1e3a8a; }
.badge-danger-light { background: #ffe4e6; color: #9f1239; }

/* ══════════════════════════════════════════════════════════
   CHART CONTAINERS
══════════════════════════════════════════════════════════ */
.chart-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.chart-container h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════
   STATUS ROWS
══════════════════════════════════════════════════════════ */
.stock-low td  { background: #fffbeb !important; }
.stock-out td  { background: #fff1f2 !important; color: #9ca3af; }
.stock-out td b { color: #9ca3af !important; }
.stock-out td code { opacity: 0.6; }
.profit-positive { color: var(--success); font-weight: 700; }
.profit-negative { color: var(--danger); font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════ */
.modal {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center;
    z-index: 2000; padding: 20px;
}
.modal-content {
    background: white;
    width: 100%; max-width: 520px;
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.22s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 800; color: var(--text-main); }
.modal-close {
    background: #f1f5f9; border: none;
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    cursor: pointer; font-size: 16px;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

/* Form Groups */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 13.5px;
    transition: var(--transition);
    color: var(--text-main);
    background: white;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group textarea { resize: vertical; min-height: 72px; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.input-with-button { display: flex; gap: 8px; }
.input-with-button select,
.input-with-button input { flex: 1; }
.scan-btn { padding: 0 12px; height: 38px; flex-shrink: 0; border-radius: var(--radius-sm) !important; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9998;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    min-width: 260px; max-width: 340px;
    border-left: 3px solid var(--info);
    transform: translateX(110%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 13px; font-weight: 500;
    pointer-events: auto;
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast i { width: 16px; height: 16px; flex-shrink: 0; color: var(--info); }
.toast.success i { color: var(--success); }
.toast.error i   { color: var(--danger); }
.toast.warning i { color: var(--warning); }

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE – Enterprise Style
══════════════════════════════════════════════════════════ */
.login-overlay-full {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #0d1b2a 0%, #112240 40%, #0d1b2a 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 5000; overflow: hidden;
}

/* Background grid pattern */
.login-overlay-full::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(29,78,216,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(29,78,216,0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 32px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-header { text-align: center; margin-bottom: 28px; }
.login-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(29,78,216,0.4);
}
.login-logo i { width: 26px; height: 26px; color: white; }
.login-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}
.login-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

/* Login Tabs */
.login-tabs {
    display: flex;
    gap: 3px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 24px;
}
.login-tab {
    flex: 1;
    padding: 9px 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
}
.login-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.login-tab:hover:not(.active) { color: var(--text-main); }

/* Login Form Inputs */
#loginForm .form-group label,
#registerForm .form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
#loginForm input,
#registerForm input,
#registerForm select {
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 14px;
    width: 100%;
    transition: var(--transition);
    color: var(--text-main);
    background: #fafafa;
}
#loginForm input:focus,
#registerForm input:focus,
#registerForm select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: white;
}

.login-error {
    color: var(--danger);
    text-align: center;
    font-size: 12.5px;
    margin-top: 12px;
    display: none;
    font-weight: 500;
    line-height: 1.5;
}

/* Developer Credit below login card */
.login-credit {
    text-align: center;
    color: rgba(255,255,255,0.25);
    font-size: 11px;
    line-height: 1.7;
    font-weight: 500;
}
.login-credit strong { color: rgba(255,255,255,0.4); }

/* ══════════════════════════════════════════════════════════
   CASHFLOW
══════════════════════════════════════════════════════════ */
.balance-display {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 24px rgba(29,78,216,0.3);
}
.balance-display h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.75;
    margin-bottom: 6px;
    font-weight: 700;
}
.balance-display h2 {
    font-size: 32px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -1px;
}
.balance-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.15);
}
.balance-icon i { width: 26px; height: 26px; }

/* ══════════════════════════════════════════════════════════
   SUMMARY CARDS (Samples)
══════════════════════════════════════════════════════════ */
.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.summary-card {
    background: white;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}
.summary-card .sc-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.summary-card .sc-icon i { width: 20px; height: 20px; }
.summary-card h3 {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}
.summary-card h2 {
    font-size: 26px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

/* ══════════════════════════════════════════════════════════
   PRINT / INVOICE
══════════════════════════════════════════════════════════ */
.print-only { display: none; }
@media print {
    body * { visibility: hidden; }
    #printableInvoice, #printableInvoice * { visibility: visible; }
    #printableInvoice {
        position: absolute; left: 0; top: 0;
        width: 80mm; padding: 5mm;
        background: white;
        font-family: 'Courier New', monospace;
    }
    .print-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
    .print-table th, .print-table td { text-align: left; font-size: 11px; padding: 3px 0; }
    .invoice-header { text-align: center; }
    hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
}

/* ══════════════════════════════════════════════════════════
   SKELETON LOADING
══════════════════════════════════════════════════════════ */
.skeleton-line {
    height: 13px;
    background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – Tablet & Mobile Optimized
══════════════════════════════════════════════════════════ */

/* ── 1280px: slight padding trim ───────────────────────── */
@media (max-width: 1280px) {
    .page-content { padding: 24px; }
}

/* ══════════════════════════════════════════════════════════
   TABLET  (769px – 1024px)
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    :root { --sidebar-width: 64px; }

    /* Sidebar collapse to icon-only */
    .sidebar { padding: 0; overflow: visible; }
    .sidebar .logo { padding: 14px; justify-content: center; }
    .sidebar .logo .logo-icon { width: 32px; height: 32px; }
    .sidebar .logo span,
    .sidebar h3,
    .nav-item span,
    .user-info p,
    .user-info small,
    .sidebar-credit { display: none; }
    .nav-menu { padding: 0 8px; }
    .nav-item {
        justify-content: center;
        padding: 10px;
        border-radius: var(--radius-md);
        position: relative;
    }
    /* Tooltip on hover for icon-only nav */
    .nav-item::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-sidebar-2);
        color: #e2e8f0;
        padding: 5px 10px;
        border-radius: var(--radius-sm);
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.15s;
        z-index: 300;
        border: 1px solid rgba(255,255,255,0.08);
    }
    .nav-item:hover::after { opacity: 1; }
    .nav-item.active::before { display: none; }
    .nav-item i { width: 18px; height: 18px; }
    .sidebar-footer { padding: 8px; }
    .user-info { padding: 8px; text-align: center; border-radius: var(--radius-sm); }
    #logoutBtn span { display: none; }
    #logoutBtn { justify-content: center; padding: 8px; }

    /* Header tweaks */
    .search-box input { width: 180px; }
    .page-content { padding: 20px; }

    /* Stats: 2 columns */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

    /* Balance display compact */
    .balance-display h2 { font-size: 24px; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE  (≤ 768px)
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Layout ─────────────────────────────────────── */
    .app-container { flex-direction: column; }
    .main-content  { margin-left: 0; padding-bottom: 70px; /* space for bottom nav */ }

    /* ── Hide desktop sidebar ───────────────────────── */
    .sidebar { display: none; }

    /* ── Mobile Top Header ──────────────────────────── */
    .header {
        padding: 0 14px;
        height: 58px;
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 300;
        gap: 10px;
    }
    .header-left h1 { font-size: 16px; letter-spacing: -0.2px; }
    .header-left p  { display: none; }
    .search-box { display: none; }        /* hide desktop search */
    #languageSwitcher { font-size: 11px; padding: 6px 8px; }

    /* Refresh button compact */
    #refreshBtn { padding: 7px 10px; font-size: 12px; }
    #refreshBtn span { display: none; }

    /* ── Page content shifts below fixed header ─────── */
    .page-content {
        padding: 14px;
        padding-top: calc(58px + 14px);
    }

    /* ── Stats Grid: 2 cols ─────────────────────────── */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card { padding: 14px 12px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; }
    .stat-icon i { width: 17px; height: 17px; }
    .stat-content h3 { font-size: 17px; }
    .stat-content p  { font-size: 10px; }

    /* ── Page Header ────────────────────────────────── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 14px;
    }
    .page-header h2 { font-size: 17px; }
    .page-header .btn { width: 100%; justify-content: center; }

    /* ── Filter Bar ─────────────────────────────────── */
    .filter-bar {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    .filter-bar select,
    .filter-bar input {
        width: 100%;
        font-size: 14px;
        height: 40px;
        padding: 8px 12px;
    }

    /* ── Tables: horizontal scroll ──────────────────── */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }
    .data-table { min-width: 560px; }
    .data-table th { font-size: 10px; padding: 9px 10px; }
    .data-table td { font-size: 12px; padding: 10px 10px; }
    .table-actions { gap: 4px; }
    .btn-icon { padding: 5px 6px; }

    /* ── Balance Display ────────────────────────────── */
    .balance-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 18px 20px;
    }
    .balance-display h2 { font-size: 26px; }
    .balance-icon { align-self: flex-end; position: absolute; right: 20px; top: 18px; }

    /* ── Summary Cards: 2 col side-by-side ─────────── */
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }
    .summary-card { padding: 14px 12px; gap: 10px; }
    .summary-card .sc-icon { width: 36px; height: 36px; }
    .summary-card h2 { font-size: 20px; }
    .summary-card h3 { font-size: 10px; }

    /* ── Charts ─────────────────────────────────────── */
    .chart-container { padding: 14px; }
    .chart-container canvas { max-height: 200px; }

    /* ── Modals: full-screen on mobile ──────────────── */
    .modal { padding: 0; align-items: flex-end; }
    .modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        padding: 20px 16px 24px;
        max-height: 92vh;
        animation: slideUp 0.28s ease-out;
    }
    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0.8; }
        to   { transform: translateY(0);   opacity: 1; }
    }
    .modal-header { margin-bottom: 16px; padding-bottom: 12px; }
    .modal-header h3 { font-size: 15px; }
    .modal-actions { gap: 8px; }
    .modal-actions .btn { flex: 1; justify-content: center; }

    /* ── Login Page ─────────────────────────────────── */
    .login-wrapper { padding: 16px; }
    .login-card { padding: 28px 20px; }
    .login-header h1 { font-size: 20px; }
    .login-logo { width: 48px; height: 48px; }
    .login-logo i { width: 22px; height: 22px; }

    /* ── Bottom Navigation Bar (mobile only) ────────── */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--bg-sidebar);
        border-top: 1px solid rgba(255,255,255,0.08);
        z-index: 300;
        height: 62px;
        align-items: stretch;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
    }
    .mobile-bottom-nav .nav-item {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        padding: 6px 4px;
        color: #64748b;
        font-size: 9px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        border-radius: 0;
        cursor: pointer;
        transition: var(--transition);
        text-align: center;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-bottom-nav .nav-item i { width: 20px; height: 20px; }
    .mobile-bottom-nav .nav-item.active {
        color: #93c5fd;
        background: rgba(29,78,216,0.18);
    }
    .mobile-bottom-nav .nav-item.active::before { display: none; }
    .mobile-bottom-nav .nav-item:active { opacity: 0.7; }

    /* ── Toast: smaller on mobile ───────────────────── */
    .toast-container { top: 66px; right: 12px; left: 12px; }
    .toast { min-width: auto; max-width: 100%; font-size: 12px; padding: 10px 14px; }

    /* ── Analytics page: stack charts ──────────────── */
    .analytics-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
}

/* ══════════════════════════════════════════════════════════
   SMALL PHONE  (≤ 480px)
══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px 10px; gap: 8px; }
    .stat-content h3 { font-size: 15px; }

    .summary-cards { grid-template-columns: 1fr 1fr; gap: 8px; }

    .login-card { padding: 24px 16px; border-radius: 14px; }
    .login-header h1 { font-size: 18px; }

    .balance-display h2 { font-size: 22px; }
    .balance-display { padding: 16px; }

    .page-content { padding: 10px; padding-top: calc(58px + 10px); }
    .data-table th { padding: 8px 8px; }
    .data-table td { padding: 9px 8px; }

    /* Hide some columns on very small screens */
    .hide-xs { display: none !important; }
}

/* ── Desktop: hide mobile-only elements ─────────────────── */
.mobile-bottom-nav { display: none; }

/* ══════════════════════════════════════════════════════════
   UTILITY CLASSES
══════════════════════════════════════════════════════════ */
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-primary{ color: var(--primary); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

/* ══════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    gap: 12px;
    flex-wrap: wrap;
}
.pg-info {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.pg-info b { color: var(--text-sub); font-weight: 700; }
.pg-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pg-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    line-height: 1.2;
    min-width: 32px;
    text-align: center;
}
.pg-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.pg-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pg-btn.pg-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pg-btn.pg-prev,
.pg-btn.pg-next {
    padding: 5px 12px;
    font-weight: 700;
}
.pg-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 12px;
    user-select: none;
}
.pg-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.pg-size label { font-weight: 600; }
.pg-size select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: white;
    color: var(--text-main);
    cursor: pointer;
    font-family: inherit;
}
.pg-size select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-glow);
}
@media (max-width: 768px) {
    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
    .pg-info { text-align: center; }
    .pg-controls { justify-content: center; flex-wrap: wrap; }
    .pg-size { justify-content: center; }
}
@media (max-width: 480px) {
    .pg-btn { min-width: 28px; padding: 4px 6px; font-size: 11px; }
    .pg-btn.pg-prev,
    .pg-btn.pg-next { padding: 4px 8px; }
}
