/* ══════════════════════════════════════════════════════════════
   style.css — Gemini-Style Light Theme Design System
   Web POS Game Platform
   Adapted from: slyuuponstore.web.app reference
   ══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Google+Sans:wght@400;500;700&display=swap');

/* ═══════════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Primary palette */
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #d3e3fd;
    --primary-bg: #e8f0fe;

    /* Surfaces */
    --bg-page: #f0f4f9;
    --bg-sidebar: #f0f4f9;
    --bg-card: #ffffff;
    --bg-input: #f1f3f4;
    --bg-input-hover: #e8eaed;
    --bg-hover: #e8eaed;
    --bg-overlay: rgba(0, 0, 0, 0.4);

    /* Text */
    --text-primary: #1f1f1f;
    --text-secondary: #444746;
    --text-muted: #5f6368;
    --text-on-primary: #ffffff;
    --text-link: #1a73e8;

    /* Borders */
    --border: #dadce0;
    --border-light: #e8eaed;

    /* Semantic */
    --success: #188038;
    --success-bg: #ceead6;
    --danger: #c5221f;
    --danger-bg: #fce8e6;
    --warning: #e37400;
    --warning-bg: #fef7e0;
    --info: #1a73e8;
    --info-bg: #e8f0fe;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Layout */
    --sidebar-width: 260px;
    --mobile-topbar-height: 56px;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-pill: 28px;

    /* Typography */
    --font-family: 'Inter', 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 0.95rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.7rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.35s ease;

    /* Z-Index */
    --z-sidebar: 100;
    --z-sidebar-open: 150;
    --z-topbar: 200;
    --z-overlay: 90;
    --z-modal-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-splash: 9999;

    /* ═══ Backward-Compatible Aliases (for landing.css, pos.css, etc.) ═══ */
    --color-primary: var(--primary);
    --color-primary-dark: var(--primary-dark);
    --color-primary-light: var(--primary-light);
    --color-danger: var(--danger);
    --color-success: var(--success);
    --color-warning: var(--warning);
    --color-info: var(--info);
    --bg-primary: #ffffff;
    --bg-secondary: var(--bg-page);
    --surface-1: var(--bg-card);
    --surface-2: var(--bg-input);
    --border-color: var(--border);
    --border-radius: var(--radius-xs);
    --border-radius-sm: var(--radius-xs);
    --border-radius-lg: var(--radius-sm);
    --border-radius-full: var(--radius-pill);
    --transition-base: var(--transition);
    --transition-fast: 0.15s ease;
    --header-height: 64px;
    --max-width: 1200px;
    --font-size-4xl: 2.25rem;
}

/* ═══════════════════════════════════════════════════════════════
   1b. DARK THEME
   ═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    /* Primary palette */
    --primary: #8ab4f8;
    --primary-dark: #aecbfa;
    --primary-light: #1a3a5c;
    --primary-bg: #1a2744;

    /* Surfaces */
    --bg-page: #111827;
    --bg-sidebar: #1f2937;
    --bg-card: #1f2937;
    --bg-input: #374151;
    --bg-input-hover: #4b5563;
    --bg-hover: #374151;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    /* Text */
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --text-on-primary: #111827;
    --text-link: #8ab4f8;

    /* Borders */
    --border: #374151;
    --border-light: #4b5563;

    /* Semantic */
    --success: #34d399;
    --success-bg: #064e3b;
    --danger: #f87171;
    --danger-bg: #7f1d1d;
    --warning: #fbbf24;
    --warning-bg: #78350f;
    --info: #8ab4f8;
    --info-bg: #1a2744;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);

    /* Backward-Compatible Aliases */
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --surface-1: #1f2937;
    --surface-2: #374151;
    --border-color: #374151;
}

/* ─── Theme Toggle Button ─── */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    font-size: 1.25rem;
}
.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .theme-toggle__icon--light { display: inline; }
[data-theme="dark"] .theme-toggle__icon--dark { display: none; }
.theme-toggle__icon--light { display: none; }
.theme-toggle__icon--dark { display: inline; }

/* ═══════════════════════════════════════════════════════════════
   2. BASE RESET
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: var(--font-size-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════════════════
   3. APP LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: var(--z-sidebar);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    overflow-y: auto;
    transition: transform var(--transition);
}

.sidebar__header {
    padding: 8px 12px 24px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar__logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar__logo {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
}

.sidebar__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.sidebar__subtitle {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 2px;
}

.sidebar__collapse-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: transparent; color: var(--text-muted); cursor: pointer;
    transition: all var(--transition-fast);
}
.sidebar__collapse-btn:hover {
    background: var(--bg-hover); color: var(--text-primary);
}

/* ─── Sidebar Navigation ─── */
.sidebar__nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    min-height: 0;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    text-align: left;
}

.sidebar__link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar__link--active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar__icon {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: inherit;
}
.sidebar__icon svg {
    width: 20px; height: 20px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.sidebar__label {
    white-space: nowrap;
}

.sidebar__section-label {
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    border-top: 1px solid var(--border-light);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ─── Sidebar Footer ─── */
.sidebar__footer {
    padding: 16px 12px 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 16px;
}

.sidebar__plan {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--space-2);
}

.sidebar__user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: var(--font-size-sm);
}

.sidebar__user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar__logout {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 10px 18px;
    border: 1px dashed var(--danger-bg);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--danger);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}
.sidebar__logout:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}

/* ─── Sidebar Open Button (desktop collapsed) ─── */
.sidebar-open-btn {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: var(--z-sidebar-open);
    width: 44px; height: 44px;
    border: 1px solid var(--border); border-radius: 50%;
    background: var(--bg-card); color: var(--text-secondary);
    cursor: pointer;
    align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}
.sidebar-open-btn:hover { background: var(--bg-hover); box-shadow: var(--shadow-lg); }

body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-content { margin-left: 0; }
body.sidebar-collapsed .sidebar-open-btn { display: flex; }

/* ─── Sidebar Overlay (mobile) ─── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: var(--bg-overlay);
    z-index: var(--z-overlay);
    opacity: 0;
    transition: opacity var(--transition);
}
.sidebar-overlay.visible,
.sidebar-overlay.active { display: block; opacity: 1; }

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
    transition: margin-left var(--transition);
}

/* ─── Mobile Top Bar ─── */
.mobile-topbar, .mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--mobile-topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: var(--z-topbar);
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    box-shadow: var(--shadow-xs);
}

.hamburger {
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; gap: 5px;
    width: 40px; height: 40px;
    border: none; border-radius: 50%;
    background: transparent; cursor: pointer;
    font-size: 1.2rem; color: var(--text-secondary);
    transition: background var(--transition-fast);
}
.hamburger:hover { background: var(--bg-hover); }

/* ═══════════════════════════════════════════════════════════════
   4. PAGE HEADER
   ═══════════════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════
   5. CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }

/* ─── Stat Cards ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card__icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: var(--space-3);
}
.stat-card__icon svg { width: 20px; height: 20px; stroke-width: 2; stroke: currentColor; fill: none; }

.stat-card--primary .stat-card__icon { background: var(--primary-bg); color: var(--primary); }
.stat-card--warning .stat-card__icon { background: var(--warning-bg); color: var(--warning); }
.stat-card--danger .stat-card__icon { background: var(--danger-bg); color: var(--danger); }
.stat-card--success .stat-card__icon { background: var(--success-bg); color: var(--success); }
.stat-card--info .stat-card__icon { background: var(--info-bg); color: var(--info); }

.stat-card__value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-card__label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   6. BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 24px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--primary); color: var(--text-on-primary); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }

.btn--outline { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.btn--outline:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn--danger { background: transparent; color: var(--danger); border: 1px solid var(--danger-bg); }
.btn--danger:hover { background: var(--danger-bg); }

.btn--success { background: var(--success); color: var(--text-on-primary); }
.btn--success:hover { background: var(--success); opacity: 0.9; }

.btn--sm { padding: 8px 16px; font-size: var(--font-size-xs); }
.btn--xs { padding: 4px 10px; font-size: var(--font-size-xs); }
.btn--lg { padding: 14px 28px; font-size: var(--font-size-base); }
.btn--full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   7. FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: var(--space-4);
}
.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:hover, .form-textarea:hover, .form-select:hover {
    border-color: var(--text-muted);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-error {
    color: var(--danger);
    font-size: var(--font-size-xs);
    margin-top: 4px;
}

.form-helper {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   8. TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

thead th {
    background: var(--primary);
    color: var(--text-on-primary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════════════════════════
   9. MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: var(--bg-overlay);
    z-index: var(--z-modal-overlay);
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
    overflow-y: auto;
}
.modal-overlay.active,
.modal-overlay--active { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}
.modal__title { font-size: var(--font-size-lg); font-weight: 600; }
.modal__close {
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: transparent; color: var(--text-muted);
    font-size: 1.4rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.modal__close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal__body { padding: 24px; }
.modal__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════
   10. BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--neutral { background: var(--bg-input); color: var(--text-muted); }
.badge--primary { background: var(--primary-bg); color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   11. TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-primary);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: var(--z-toast);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--transition);
    max-width: 400px;
    white-space: nowrap;
}
.toast--visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
.toast--warning { background: var(--warning); }
.toast--info { background: var(--info); }
.toast__icon { font-size: 1.1rem; flex-shrink: 0; }
.toast__message { flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   12. CHART SECTION
   ═══════════════════════════════════════════════════════════════ */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: var(--space-6);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.chart-period-tab {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.chart-period-tab:hover { background: var(--bg-hover); }
.chart-period-tab--active {
    background: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════
   13. EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state__icon {
    width: 64px; height: 64px;
    margin: 0 auto var(--space-4);
    background: var(--bg-input);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.empty-state__icon svg { width: 28px; height: 28px; }
.empty-state__text { font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-2); }
.empty-state__sub { font-size: var(--font-size-sm); color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   14. SKELETON LOADING
   ═══════════════════════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-light) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}
.skeleton--card { border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════════════════════════════════════════════════════
   15. SPLASH SCREEN
   ═══════════════════════════════════════════════════════════════ */
.splash-screen {
    position: fixed; inset: 0;
    background: var(--bg-card);
    z-index: var(--z-splash);
    display: flex; align-items: center; justify-content: center;
    transition: opacity var(--transition-slow);
}
.splash-screen.hidden { opacity: 0; pointer-events: none; }
.splash-content { text-align: center; }
.splash-icon { font-size: 3rem; margin-bottom: var(--space-3); }
.splash-name { font-size: var(--font-size-xl); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-4); }
.splash-bar { width: 120px; height: 3px; background: var(--border-light); border-radius: 2px; margin: 0 auto; overflow: hidden; }
.splash-bar-fill { width: 40%; height: 100%; background: var(--primary); border-radius: 2px; animation: splashProgress 1.2s ease forwards; }
@keyframes splashProgress { to { width: 100%; } }

/* ═══════════════════════════════════════════════════════════════
   16. SCHEDULE BANNER & ALERTS
   ═══════════════════════════════════════════════════════════════ */
.schedule-banner {
    background: var(--info-bg);
    color: var(--info);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 1px solid rgba(26, 115, 232, 0.2);
    transition: background var(--transition-fast);
}
.schedule-banner:hover { background: var(--primary-light); }
.schedule-banner__text { font-weight: 600; font-size: var(--font-size-sm); }
.schedule-banner__count {
    background: var(--primary); color: white;
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--font-size-xs);
}

/* ═══════════════════════════════════════════════════════════════
   17. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.w-full { width: 100%; }

/* ═══════════════════════════════════════════════════════════════
   18. ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-loaded { animation: fadeIn 0.35s ease-out; }

/* ═══════════════════════════════════════════════════════════════
   19. RESPONSIVE — MOBILE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .mobile-topbar, .mobile-header { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        z-index: calc(var(--z-topbar) + 10);
        background: var(--bg-card);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar__collapse-btn { display: none; }
    .sidebar-open-btn { display: none; }

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: calc(var(--mobile-topbar-height) + 24px);
    }

    .page-header h1 { font-size: var(--font-size-xl); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .modal { margin: 16px; max-width: none; }
    .chart-container { padding: 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .main-content { padding: 16px 12px; padding-top: calc(var(--mobile-topbar-height) + 16px); }
    .toast { left: 16px; right: 16px; max-width: none; transform: translateX(0) translateY(-100px); }
    .toast--visible { transform: translateX(0) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   20. PRODUCT CARDS
   ═══════════════════════════════════════════════════════════════ */
.product-card {
    padding: 0;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ═══════════════════════════════════════════════════════════════
   21. CONFIRM DIALOG
   ═══════════════════════════════════════════════════════════════ */
.confirm-modal { max-width: 400px; }

/* ═══════════════════════════════════════════════════════════════
   22. AUTH PAGES (Login/Register)
   ═══════════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: var(--space-4);
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo { font-size: 2.5rem; margin-bottom: var(--space-3); }
.auth-title { font-size: var(--font-size-2xl); font-weight: 700; }
.auth-subtitle { color: var(--text-muted); font-size: var(--font-size-sm); margin-top: var(--space-2); }

.auth-divider {
    text-align: center;
    margin: var(--space-6) 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    position: relative;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: var(--space-3);
    border-radius: var(--radius-xs);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
    display: none;
}
.auth-error.visible { display: block; }

.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.google-btn:hover { background: var(--bg-hover); box-shadow: var(--shadow-sm); }

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════
   23. BACK LINK
   ═══════════════════════════════════════════════════════════════ */
.back-link {
    position: fixed;
    top: 16px; left: 16px;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    text-decoration: none;
    z-index: 10;
    transition: color var(--transition-fast);
}
.back-link:hover { color: var(--text-primary); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   24. CHECKBOX
   ═══════════════════════════════════════════════════════════════ */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════
   FREEMIUM — Sidebar Lock & Plan Badge
   ═══════════════════════════════════════════════════════════════ */
.sidebar__link--locked {
    opacity: 0.55;
    cursor: pointer !important;
    position: relative;
}
.sidebar__link--locked:hover {
    opacity: 0.75;
    background: var(--bg-hover);
}
.sidebar__lock {
    display: flex;
    align-items: center;
    margin-left: auto;
    width: 16px;
    height: 16px;
    opacity: 0.6;
}
.sidebar__lock svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar__plan-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 500;
}
.sidebar__plan-badge.plan-free {
    background: #f1f3f4;
    color: #5f6368;
    border: 1px dashed #dadce0;
}
.sidebar__plan-badge.plan-basic {
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #d3e3fd;
}
.sidebar__plan-badge.plan-premium {
    background: linear-gradient(135deg, #fef7cd, #fde68a);
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* ═══════════════════════════════════════════════════════════════
   UPGRADE MODAL — 2 Plan Cards
   ═══════════════════════════════════════════════════════════════ */
.upgrade-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.upgrade-overlay--visible {
    opacity: 1;
    visibility: visible;
}
.upgrade-modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 36px;
    max-width: 680px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.upgrade-overlay--visible .upgrade-modal {
    transform: scale(1) translateY(0);
}
.upgrade-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.upgrade-close:hover { color: var(--text-primary); }

.upgrade-header {
    text-align: center;
    margin-bottom: 28px;
}
.upgrade-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}
.upgrade-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}
.upgrade-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.upgrade-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.upgrade-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.upgrade-plan-skeleton {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ─── Rotating Glow Animation ─── */
@keyframes rotate-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.upgrade-card {
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
}
.upgrade-card__inner {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border-radius: 14px;
}
.upgrade-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 8px 24px rgba(26, 115, 232, 0.12);
    transform: translateY(-2px);
}

/* Premium card — rotating conic glow border */
.upgrade-card--popular {
    border: none;
    padding: 3px;
    background: var(--bg-card);
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.15);
}
.upgrade-card--popular .upgrade-card__glow {
    position: absolute;
    inset: -40%;
    background: conic-gradient(
        from 0deg,
        #f59e0b, #f97316, #ef4444, #ec4899,
        #8b5cf6, #3b82f6, #06b6d4, #22c55e,
        #f59e0b
    );
    animation: rotate-glow 3s linear infinite;
    z-index: 0;
    border-radius: 16px;
}
.upgrade-card--popular .upgrade-card__inner {
    background: var(--bg-card);
    border-radius: 13px;
}
.upgrade-card--popular:hover {
    box-shadow: 0 8px 36px rgba(245, 158, 11, 0.3);
    transform: translateY(-3px);
}

.upgrade-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 18px;
    border-radius: 0 0 12px 12px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.upgrade-plan-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 8px 0 16px;
    text-align: center;
    letter-spacing: -0.02em;
}
.upgrade-price {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}
.upgrade-currency {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.upgrade-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
.upgrade-period {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.upgrade-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}
.upgrade-features li {
    padding: 7px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.upgrade-features li::before {
    content: '';
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #22c55e;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.upgrade-cta {
    display: block;
    text-align: center;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
    letter-spacing: 0.01em;
}
.upgrade-cta:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}
.upgrade-cta--primary {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}
.upgrade-cta--primary:hover {
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .upgrade-modal { padding: 24px 16px; }
    .upgrade-plans { grid-template-columns: 1fr; }
    .upgrade-card--popular { order: -1; }
}
