/* ============================================================
   MODERN DASHBOARD - KEY MANAGEMENT PANEL
   Clean Modern Dark Theme | Mobile-First Responsive
   ============================================================ */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    /* Modern Dark Theme */
    --bg-base: #0a0a0f;
    --bg-primary: #0e0e14;
    --bg-secondary: #13131a;
    --bg-secondary-raw: 19,19,26;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161f;
    --bg-input: #1a1a24;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-modifier-hover: rgba(255, 255, 255, 0.05);
    --bg-modifier-active: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f1f5;
    --text-secondary: #c4c4d0;
    --text-muted: #6b6b7e;
    --text-link: #818cf8;

    --accent-primary: #6366f1;
    --accent-secondary: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --brand-experiment: #6366f1;

    --glass-bg: #16161f;
    --glass-border: rgba(255, 255, 255, 0.07);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --premium: #a78bfa;

    --border-color: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow: 0 4px 16px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-elevation-high: 0 12px 32px rgba(0,0,0,0.5);

    --sidebar-width: 248px;
    --header-height: 52px;
    --bottom-nav-height: 72px;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 14px;
    --transition: all 0.15s ease;

    --channel-icon: #6b6b7e;
    --interactive-normal: #9191a4;
    --interactive-hover: #f1f1f5;
    --interactive-active: #f1f1f5;
    --interactive-muted: #2a2a38;
    --scrollbar-thin-track: transparent;
    --scrollbar-thin-thumb: rgba(255,255,255,0.08);
    --scrollbar-auto-thumb: rgba(255,255,255,0.08);
    --scrollbar-auto-track: transparent;
}

/* Light Theme */
[data-theme="light"] {
    --bg-base: #f0f0f5;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8fc;
    --bg-tertiary: #ededf2;
    --bg-card: #ffffff;
    --bg-input: #f4f4f8;
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-modifier-hover: rgba(0, 0, 0, 0.04);
    --bg-modifier-active: rgba(0, 0, 0, 0.07);

    --text-primary: #111118;
    --text-secondary: #3a3a4c;
    --text-muted: #6b6b80;
    --text-link: #6366f1;

    --accent-primary: #6366f1;
    --accent-secondary: #4f46e5;

    --glass-bg: #ffffff;
    --glass-border: rgba(0, 0, 0, 0.07);

    --border-color: rgba(0, 0, 0, 0.07);
    --border-strong: rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);

    --channel-icon: #6b6b80;
    --interactive-normal: #6b6b80;
    --interactive-hover: #111118;
    --interactive-active: #111118;
    --interactive-muted: #d4d4e0;
    --scrollbar-thin-track: transparent;
    --scrollbar-thin-thumb: rgba(0,0,0,0.12);
    --scrollbar-auto-thumb: rgba(0,0,0,0.12);
    --scrollbar-auto-track: transparent;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    font-size: 14px;
}

body.sidebar-open {
    overflow: hidden;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.1s ease;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   DISCORD BACKGROUND (replaces Aurora)
   ============================================================ */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background: var(--bg-primary);
}

[data-theme="light"] .aurora-bg {
    background: var(--bg-primary);
}

/* ============================================================
   GLASSMORPHISM OVERRIDE -> Discord solid style
   ============================================================ */
.glassmorphism {
    background: var(--bg-secondary);
    border: none;
    border-bottom: 1px solid var(--bg-tertiary);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    background: var(--bg-base);
}

/* ============================================================
   SIDEBAR - Discord Channel List Style
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-secondary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 1000;
    transition: transform 0.2s ease;
    border-right: none;
    display: flex;
    flex-direction: column;
}

.server-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 8px;
}

.server-icon:hover {
    border-radius: 16px;
    background: var(--accent-primary);
    color: white;
}

.server-icon.active {
    border-radius: 16px;
    background: var(--accent-primary);
    color: white;
}

.server-icon::before {
    content: '';
    position: absolute;
    left: -16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: all 0.2s ease;
}

.server-icon:hover::before {
    opacity: 1;
    height: 20px;
    border-radius: 4px;
}

.server-icon.active::before {
    opacity: 1;
    height: 40px;
    border-radius: 4px;
}

.sidebar-header {
    padding: 0 14px;
    height: var(--header-height);
    min-height: var(--header-height);
    flex: 0 0 var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-logo {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #5865f2, #4752c4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(88,101,242,0.35);
}

.sidebar-logo-icon .material-symbols-outlined {
    font-size: 1.2rem;
    color: #fff;
    -webkit-text-fill-color: #fff;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sidebar-logo-title {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.sidebar-logo-sub {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 1px;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-close:hover {
    background: var(--bg-modifier-hover);
    color: var(--interactive-hover);
}

.sidebar-nav {
    padding: 10px 10px 16px;
    margin-top: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.nav-section {
    padding: 0;
    margin-bottom: 4px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--channel-icon);
    padding: 16px 10px 6px;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    color: var(--interactive-normal);
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
    margin-bottom: 1px;
    font-size: 0.8rem;
    font-weight: 500;
    position: relative;
    text-decoration: none;
    line-height: 1.4;
}

.nav-icon {
    font-size: 18px;
    flex-shrink: 0;
    color: var(--channel-icon);
    transition: color 0.12s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-link:hover .nav-icon {
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    font-weight: 600;
}

.nav-link.active .nav-icon {
    color: #818cf8;
}

[data-theme="light"] .nav-link:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

[data-theme="light"] .nav-link.active {
    background: rgba(99,102,241,0.1);
    color: #4f46e5;
}

[data-theme="light"] .nav-link.active .nav-icon {
    color: #6366f1;
}

.nav-link-logout {
    margin-top: 10px;
    color: #ffb4b7;
    background: linear-gradient(135deg, rgba(218, 55, 60, 0.16), rgba(218, 55, 60, 0.08));
    border: 1px solid rgba(218, 55, 60, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.nav-link-logout .nav-icon {
    color: #ff8e93;
}

.nav-link-logout:hover {
    background: linear-gradient(135deg, rgba(218, 55, 60, 0.24), rgba(218, 55, 60, 0.12));
    color: #ffffff;
}

.nav-link-logout:hover .nav-icon {
    color: #ffffff;
}

.toast-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast-pro {
    --toast-accent: #10B981;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 320px;
    padding: 16px;
    border-radius: 6px;
    overflow: hidden;
    pointer-events: auto;
    background: #1a1b1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    color: #ffffff;
    opacity: 0;
    transform: translateX(30px);
    animation: toast-slide-in-right 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-pro::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--toast-accent);
}

.toast-pro-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--toast-accent);
}

.toast-pro-content {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.toast-pro-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.toast-pro-message {
    color: #a1a7b0;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
}

.toast-pro-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: #6d6f78;
    cursor: pointer;
    transition: color 0.15s ease;
}

.toast-pro-close:hover {
    color: #ffffff;
}

.toast-pro-close svg {
    width: 14px;
    height: 14px;
}

.toast-pro.hide {
    animation: toast-slide-out-right 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.product-order-intro {
    border-style: dashed;
}

.product-order-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(88, 101, 242, 0.2);
    font-size: 0.85rem;
    font-weight: 600;
}

.product-order-chip .material-symbols-outlined {
    font-size: 18px;
    color: var(--accent-primary);
}

.product-sort-list {
    display: flex;
    flex-direction: column;
}

.product-sort-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.product-sort-card.is-dragging {
    opacity: 0.78;
    transform: scale(0.995);
    border-color: rgba(88, 101, 242, 0.45);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.28);
}

.product-card-header-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.product-drag-handle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    flex-shrink: 0;
    transition: transform 0.14s ease, background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.product-drag-handle:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-primary);
    border-color: rgba(88, 101, 242, 0.3);
}

.product-drag-handle:active {
    cursor: grabbing;
    transform: scale(0.96);
}

.product-drag-handle .material-symbols-outlined {
    font-size: 20px;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
}

/* ── Sidebar user panel ── */
.sidebar-user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 0 8px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s ease;
    cursor: default;
    flex-shrink: 0;
}
.sidebar-user-panel:hover {
    background: rgba(255,255,255,0.06);
}
[data-theme="light"] .sidebar-user-panel {
    background: rgba(0,0,0,0.03);
    border-color: var(--border-color);
}
[data-theme="light"] .sidebar-user-panel:hover {
    background: rgba(0,0,0,0.05);
}
.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}
.sidebar-user-info {
    flex: 1;
    min-width: 0;
}
.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.sidebar-user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}
.sidebar-user-action {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.sidebar-user-action:hover {
    background: rgba(218,55,60,0.12);
    color: #da373c;
}
.sidebar-user-action .material-symbols-outlined {
    font-size: 17px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ============================================================
   BOTTOM NAVIGATION (Mobile Only) — Modern floating pill
   ============================================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    z-index: 900;
    background: rgba(22,22,32,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    height: 66px;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

[data-theme="light"] .bottom-nav {
    background: rgba(255,255,255,0.92);
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
}

.bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    gap: 2px;
    color: #5b5d64;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease;
    border-radius: 18px;
}

/* Chip bg that appears on active */
.bottom-nav-item::before {
    content: '';
    position: absolute;
    inset: 6px 6px;
    background: rgba(88, 101, 242, 0.14);
    border-radius: 14px;
    transform: scale(0.5);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s ease;
    pointer-events: none;
}
.bottom-nav-item.active::before {
    transform: scale(1);
    opacity: 1;
}

/* No dot indicator — label replaces it */
.bottom-nav-item::after { display: none; }

.bottom-nav-item .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 0, 'wght' 350;
    transition: font-variation-settings 0.15s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1), color 0.18s ease;
    position: relative;
    z-index: 1;
    line-height: 1;
}

.bottom-nav-item.active {
    color: #818cf8;
}
.bottom-nav-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 600;
    transform: scale(1.06);
}

[data-theme="light"] .bottom-nav-item {
    color: #8a8e99;
}
[data-theme="light"] .bottom-nav-item.active {
    color: #5865f2;
}
[data-theme="light"] .bottom-nav-item::before {
    background: rgba(88,101,242,0.1);
}

/* Labels hidden by default, shown only on active item */
.bottom-nav-label {
    display: none;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
}

.bottom-nav-item.active .bottom-nav-label {
    display: block;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ── Scrollable content area ── */
.page-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scroll-behavior: smooth;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="light"] .header {
    background: rgba(255,255,255,0.92);
    border-bottom-color: var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--interactive-normal);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    touch-action: manipulation;
}

.menu-toggle .material-symbols-outlined {
    font-size: 22px;
}

.menu-toggle:hover,
.menu-toggle:active {
    background: var(--bg-modifier-hover);
    color: var(--interactive-hover);
}

.page-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--text-primary);
    background-clip: unset;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--interactive-normal);
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    touch-action: manipulation;
}

.theme-toggle .material-symbols-outlined {
    font-size: 20px;
}

.theme-toggle:hover {
    background: var(--bg-modifier-hover);
    color: var(--interactive-hover);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--bg-modifier-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.user-avatar .material-symbols-outlined {
    font-size: 18px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    padding: 20px 24px;
    max-width: 100%;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 18px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.12); color: var(--accent-primary); }
.stat-icon.success { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.stat-icon.info { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.stat-icon.secondary { background: rgba(99, 102, 241, 0.08); color: #a78bfa; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: 'gg sans', sans-serif;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    text-decoration: none;
    white-space: nowrap;
    touch-action: manipulation;
    min-width: 64px;
    min-height: 34px;
    line-height: 1;
    letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}
.btn-primary:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.btn-secondary {
    background: rgba(255,255,255,0.07);
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #16a34a; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }

.btn-warning { background: var(--warning); color: #000; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }

.btn-outline-danger {
    background: transparent; color: var(--danger);
    border-color: rgba(239,68,68,0.4);
}
.btn-outline-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); }

.btn-outline-warning {
    background: transparent; color: var(--warning);
    border-color: rgba(245,158,11,0.4);
}
.btn-outline-warning:hover { background: rgba(245,158,11,0.1); border-color: var(--warning); }

.btn-sm {
    padding: 0 10px;
    font-size: 0.75rem;
    min-height: 28px;
    border-radius: 6px;
}

.btn-sm .btn-icon,
.btn-sm .material-symbols-outlined {
    font-size: 15px;
}

.btn-lg {
    padding: 0 20px;
    font-size: 0.875rem;
    min-height: 40px;
    border-radius: 10px;
}

.btn-block { width: 100%; }

.btn-link {
    background: transparent;
    color: var(--text-link);
    padding: 0 6px;
    border: none;
    min-width: auto;
}
.btn-link:hover {
    text-decoration: underline;
    background: transparent;
}

[data-theme="light"] .btn-secondary {
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary);
    border-color: var(--border-color);
}
[data-theme="light"] .btn-secondary:hover {
    background: rgba(0,0,0,0.07);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
    min-width: 0;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0 12px;
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    color: var(--text-primary) !important;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    height: 38px;
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b6b7e'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 18px !important;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 96px;
    resize: vertical;
    height: auto;
    padding: 10px 12px;
}

.form-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.form-error {
    color: var(--danger);
    font-size: 0.72rem;
    margin-top: 5px;
}

/* Global form overrides */
.form-control,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
textarea,
select {
    color: var(--text-primary) !important;
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.table th,
.table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-tertiary);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.table tbody tr {
    transition: background 0.1s ease;
}

.table tbody tr:hover {
    background: rgba(255,255,255,0.025);
}

[data-theme="light"] .table tbody tr:hover {
    background: rgba(0,0,0,0.025);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    height: 22px;
    letter-spacing: 0.02em;
}

.badge-success { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-warning { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-info    { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-primary { background: rgba(99,102,241,0.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }

[data-theme="light"] .badge-success { background: rgba(34,197,94,0.1); color: #16a34a; }
[data-theme="light"] .badge-warning { background: rgba(245,158,11,0.1); color: #d97706; }
[data-theme="light"] .badge-danger  { background: rgba(239,68,68,0.1);  color: #dc2626; }
[data-theme="light"] .badge-info    { background: rgba(59,130,246,0.1);  color: #2563eb; }
[data-theme="light"] .badge-primary { background: rgba(99,102,241,0.1); color: #4f46e5; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    border: 1px solid;
}

.alert-success { background: rgba(34,197,94,0.07); border-color: rgba(34,197,94,0.2); color: var(--text-primary); }
.alert-warning { background: rgba(245,158,11,0.07); border-color: rgba(245,158,11,0.2); color: var(--text-primary); }
.alert-danger  { background: rgba(239,68,68,0.07);  border-color: rgba(239,68,68,0.2);  color: var(--text-primary); }
.alert-info    { background: rgba(59,130,246,0.07);  border-color: rgba(59,130,246,0.2);  color: var(--text-primary); }

.alert-icon { font-size: 1.1rem; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }

/* View More Button */
.btn-view-more {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-view-more:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-primary);
}

.alert-extra-item { margin-top: 4px; }
tr.extra-row { display: none; }

/* ============================================================
   MODAL - Discord Modal Style
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--shadow-elevation-high);
    border-radius: var(--border-radius-sm);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 10;
    border-top-left-radius: var(--border-radius-sm);
    border-top-right-radius: var(--border-radius-sm);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--interactive-normal);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--interactive-hover);
}

.modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.modal-body {
    padding: 0 16px 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px;
    background: var(--bg-secondary);
    z-index: 10;
    flex-shrink: 0;
    border-bottom-left-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
}

.modal-footer .btn-secondary {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 2px 16px;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    min-height: 38px;
}

.modal-footer .btn-secondary:hover {
    text-decoration: underline;
}

/* ============================================================
   KEY DISPLAY - Discord Code Block Style
   ============================================================ */
.key-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    margin: 12px 0;
}

.key-value {
    font-family: 'Consolas', 'Andale Mono WT', 'Andale Mono', 'Lucida Console', monospace;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-primary);
    word-break: break-all;
    margin-bottom: 12px;
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    display: inline-block;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 16px;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    min-height: 32px;
    transition: background-color 0.17s ease;
}

.copy-btn:hover { background: var(--accent-secondary); }
.copy-btn.copied { background: var(--success); }

/* Balance Display - Discord Blurple Style */
.balance-display {
    background: var(--accent-primary);
    border-radius: var(--border-radius);
    padding: 16px;
    color: #fff;
    text-align: center;
}

.balance-label { font-size: 0.75rem; opacity: 0.9; margin-bottom: 4px; text-transform: uppercase; font-weight: 700; }
.balance-value { font-size: 1.75rem; font-weight: 700; }
.balance-alert { font-size: 0.75rem; opacity: 0.8; margin-top: 8px; }

/* Product Cards - Discord Style */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 16px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.product-card:hover {
    background: var(--bg-modifier-hover);
    border-color: var(--border-color);
    transform: none;
}

.product-card.selected {
    border-color: var(--accent-primary);
    background: rgba(88, 101, 242, 0.08);
}

.product-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.product-duration { color: var(--text-muted); font-size: 0.8125rem; margin-bottom: 12px; }
.product-price { font-size: 1.25rem; font-weight: 700; color: var(--accent-primary); }
.product-stock { font-size: 0.75rem; margin-top: 8px; color: var(--text-muted); }
.product-stock.low { color: var(--warning); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.pagination ul {
    display: flex;
    list-style: none;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination li a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--interactive-normal);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: var(--transition);
}

.pagination li a:hover {
    background: var(--bg-modifier-hover);
    color: var(--interactive-hover);
    text-decoration: none;
}

.pagination li.active a {
    background: var(--accent-primary);
    color: #fff;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-tertiary);
}

.login-box {
    width: 100%;
    max-width: 480px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-elevation-high);
}

.login-header { text-align: center; margin-bottom: 20px; }

.login-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--text-primary);
    background-clip: unset;
    margin-bottom: 8px;
}

.login-subtitle { color: var(--text-muted); font-size: 0.9375rem; }

.login-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.login-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--interactive-normal);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.login-tab:hover { background: var(--bg-modifier-hover); }

.login-tab.active {
    background: var(--accent-primary);
    color: #fff;
}

/* ============================================================
   KEY BLUR (Screen Share Protection)
   ============================================================ */
/* ── Frosted Glass Key Reveal ───────────────────────────── */
.key-blur {
    filter: blur(12px);
    transition: filter 0.25s ease;
    user-select: none;
    cursor: pointer;
}

.key-blur.revealed {
    filter: blur(0);
    user-select: auto;
}

.key-blur-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
    vertical-align: middle;
}

.key-blur-wrapper::after {
    content: '🔓  CLICK TO REVEAL';
    position: absolute;
    inset: 0;
    background: rgba(88, 101, 242, 0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-primary);
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 5;
    white-space: nowrap;
}

.key-blur-wrapper.revealed::after {
    opacity: 0;
    visibility: hidden;
}

/* suppress copy tooltip while key is hidden */
code.key-code.key-blur:not(.revealed)::after { opacity: 0 !important; }
code.key-code.key-blur:not(.revealed):hover { background: var(--bg-tertiary) !important; color: inherit !important; }

/* Clickable Key Code */
code.key-code {
    cursor: pointer;
    position: relative;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.875rem;
}

code.key-code:hover {
    background: var(--accent-primary) !important;
    color: #fff;
}

code.key-code::after {
    content: 'Click to copy';
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

code.key-code:hover::after { opacity: 1; }

/* ============================================================
   RESPONSIVE GRID HELPERS
   ============================================================ */
.responsive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.responsive-grid-auto {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.responsive-grid-wide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }
.hidden { display: none !important; }

/* Discord Scrollbar - Dark */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-auto-track); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-auto-thumb); border-radius: 4px; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background: #27282c; }
::-webkit-scrollbar-corner { background: var(--scrollbar-auto-track); }

/* Discord Scrollbar - Light */
[data-theme="light"] ::-webkit-scrollbar-track { background: #f2f3f5; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c4c9ce; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #a8adb3; }
html[data-theme="light"]::-webkit-scrollbar-track { background: #f2f3f5; }
html[data-theme="light"]::-webkit-scrollbar-thumb { background: #c4c9ce; }
html[data-theme="light"]::-webkit-scrollbar-thumb:hover { background: #a8adb3; }

/* Firefox scrollbar */
html { scrollbar-width: thin; scrollbar-color: var(--scrollbar-auto-thumb) var(--scrollbar-auto-track); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.2s ease; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s infinite; }

/* ============================================================
   LIGHT MODE SPECIFIC OVERRIDES - Discord Light Theme
   ============================================================ */

/* --- Base --- */
[data-theme="light"] body {
    background: #ffffff;
    color: #313338;
}

[data-theme="light"] .aurora-bg {
    background: #ffffff;
}

/* --- Layout --- */
[data-theme="light"] .main-content {
    background: #ffffff;
}

[data-theme="light"] .page-content {
    color: #313338;
}

/* --- Header --- */
[data-theme="light"] .header {
    background: #ffffff;
    border-bottom: 1px solid #e3e5e8;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .glassmorphism {
    background: #ffffff;
    border-bottom: 1px solid #e3e5e8;
}

[data-theme="light"] .page-title {
    color: #060607;
    -webkit-text-fill-color: #060607;
}

[data-theme="light"] .header-right .theme-toggle {
    color: #4e5058;
}

[data-theme="light"] .header-right .theme-toggle:hover {
    color: #060607;
    background: rgba(116, 127, 141, 0.08);
}

[data-theme="light"] .menu-toggle {
    color: #4e5058;
}

[data-theme="light"] .menu-toggle:hover {
    color: #060607;
    background: rgba(116, 127, 141, 0.08);
}

/* --- Cards --- */
[data-theme="light"] .card {
    background: #f2f3f5;
    border: 1px solid #e3e5e8;
    box-shadow: none;
}

[data-theme="light"] .card:hover {
    background: #f2f3f5;
}

[data-theme="light"] .card-header {
    border-bottom-color: #e3e5e8;
}

[data-theme="light"] .card-title {
    color: #060607;
}

/* --- Stat Cards --- */
[data-theme="light"] .stat-card {
    background: #f2f3f5;
    border: 1px solid #e3e5e8;
}

[data-theme="light"] .stat-card:hover {
    background: #ebedef;
    border-color: #d3d6db;
}

[data-theme="light"] .stat-value {
    color: #060607;
}

[data-theme="light"] .stat-label {
    color: #5c5e66;
}

[data-theme="light"] .stat-icon.primary { background: rgba(88, 101, 242, 0.12); }
[data-theme="light"] .stat-icon.success { background: rgba(35, 165, 89, 0.12); }
[data-theme="light"] .stat-icon.warning { background: rgba(240, 178, 50, 0.15); }
[data-theme="light"] .stat-icon.info { background: rgba(0, 168, 252, 0.12); }
[data-theme="light"] .stat-icon.secondary { background: rgba(88, 101, 242, 0.08); }

/* --- Bottom Nav (light) --- */
[data-theme="light"] .bottom-nav-item {
    color: #72767d;
}

[data-theme="light"] .bottom-nav-item.active {
    color: #5865f2;
}

[data-theme="light"] .bottom-nav-item::before {
    opacity: 0;
}

[data-theme="light"] .bottom-nav-item.active::before {
    opacity: 0.12;
}

/* --- Sidebar (stays dark like Discord) --- */
[data-theme="light"] .sidebar {
    background: #f8f8fc;
    border-right: 1px solid rgba(0,0,0,0.07);
}

[data-theme="light"] .nav-link {
    color: #52525b;
}

[data-theme="light"] .nav-section-title {
    color: #a1a1aa;
}

[data-theme="light"] .sidebar-logo {
    color: #111118;
    -webkit-text-fill-color: #111118;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

[data-theme="light"] .sidebar-logo-title { color: #111118; }
[data-theme="light"] .sidebar-logo-sub { color: #71717a; }

[data-theme="light"] .sidebar-header {
    background: #ffffff;
    border-bottom-color: rgba(0,0,0,0.07);
}

[data-theme="light"] .sidebar-overlay.active {
    background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 767px) {
    [data-theme="light"] .sidebar .sidebar-user-panel {
        background: #f8f8fc;
    }
    [data-theme="light"] .sidebar .sidebar-header {
        background: #ffffff;
    }
}

/* --- Tables --- */
[data-theme="light"] .table th {
    background: #f4f4f8;
    color: #71717a;
}

[data-theme="light"] .table td {
    color: #3a3a4c;
    border-bottom-color: rgba(0,0,0,0.06);
}

[data-theme="light"] .table-container {
    border-color: rgba(0,0,0,0.07);
}

/* --- Buttons --- */
[data-theme="light"] .btn-primary {
    background: #6366f1;
    color: #fff;
}

[data-theme="light"] .btn-primary:hover {
    background: #4f46e5;
}

[data-theme="light"] .btn-secondary {
    background: #ededf2;
    color: #52525b;
    border-color: rgba(0,0,0,0.1);
}

[data-theme="light"] .btn-secondary:hover {
    background: #d1d3d7;
    color: #060607;
}

[data-theme="light"] .btn-link {
    color: #006ce7;
}

[data-theme="light"] .btn-view-more {
    border-color: #e3e5e8;
    color: #4e5058;
}

[data-theme="light"] .btn-view-more:hover {
    background: rgba(116, 127, 141, 0.08);
    color: #313338;
}

/* --- Forms --- */
[data-theme="light"] .form-label {
    color: #4e5058;
}

[data-theme="light"] .form-control,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="email"],
[data-theme="light"] textarea,
[data-theme="light"] select {
    background-color: #e3e5e8 !important;
    color: #313338 !important;
    border: none !important;
}

[data-theme="light"] .form-control::placeholder {
    color: #80848e;
}

[data-theme="light"] .form-text {
    color: #5c5e66;
}

/* --- Badges --- */
[data-theme="light"] .badge-success { background: rgba(35, 165, 89, 0.12); color: #1a6334; }
[data-theme="light"] .badge-warning { background: rgba(240, 178, 50, 0.15); color: #9a6700; }
[data-theme="light"] .badge-danger { background: rgba(218, 55, 60, 0.12); color: #a12d31; }
[data-theme="light"] .badge-info { background: rgba(0, 168, 252, 0.12); color: #006ce7; }
[data-theme="light"] .badge-primary { background: rgba(88, 101, 242, 0.12); color: #4752c4; }

/* --- Alerts --- */
[data-theme="light"] .alert { color: #313338; }
[data-theme="light"] .alert-success { background: rgba(35, 165, 89, 0.08); }
[data-theme="light"] .alert-warning { background: rgba(240, 178, 50, 0.08); }
[data-theme="light"] .alert-danger { background: rgba(218, 55, 60, 0.08); }
[data-theme="light"] .alert-info { background: rgba(0, 168, 252, 0.08); }

/* --- Modal --- */
[data-theme="light"] .modal {
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-overlay.active {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .modal-title {
    color: #060607;
}

[data-theme="light"] .modal-close {
    color: #4e5058;
}

[data-theme="light"] .modal-close:hover {
    color: #060607;
}

[data-theme="light"] .modal-footer {
    background: #f2f3f5;
}

[data-theme="light"] .modal-footer .btn-secondary {
    color: #313338;
}

/* --- Pagination --- */
[data-theme="light"] .pagination li a {
    color: #4e5058;
}

[data-theme="light"] .pagination li a:hover {
    background: rgba(116, 127, 141, 0.08);
    color: #060607;
}

[data-theme="light"] .pagination li.active a {
    background: #5865f2;
    color: #fff;
}

/* --- Login Page --- */
[data-theme="light"] .login-container {
    background: #f2f3f5;
}

[data-theme="light"] .login-box {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .login-logo {
    color: #060607;
    -webkit-text-fill-color: #060607;
}

[data-theme="light"] .login-subtitle {
    color: #5c5e66;
}

[data-theme="light"] .login-tab {
    color: #4e5058;
}

[data-theme="light"] .login-tab:hover {
    background: rgba(116, 127, 141, 0.08);
}

[data-theme="light"] .login-tab.active {
    background: #5865f2;
    color: #fff;
}

/* --- Product Cards --- */
[data-theme="light"] .product-card {
    background: #f2f3f5;
    border-color: #e3e5e8;
}

[data-theme="light"] .product-card:hover {
    background: #ebedef;
    border-color: #d3d6db;
}

[data-theme="light"] .product-card.selected {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.06);
}

[data-theme="light"] .product-name {
    color: #060607;
}

/* --- Key Display --- */
[data-theme="light"] .key-display {
    background: #f2f3f5;
    border-color: #e3e5e8;
}

[data-theme="light"] .key-value {
    background: #e3e5e8;
    color: #313338;
}

[data-theme="light"] code.key-code {
    background: #f2f3f5;
    color: #313338;
}

[data-theme="light"] code.key-code:hover {
    background: #5865f2 !important;
    color: #fff;
}

[data-theme="light"] code.key-code.key-blur:not(.revealed):hover {
    background: #f2f3f5 !important;
    color: #313338 !important;
}

[data-theme="light"] code.key-code::after {
    background: #ffffff;
    color: #313338;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .key-blur-wrapper::after {
    background: rgba(88, 101, 242, 0.08);
}

/* --- Balance Display --- */
[data-theme="light"] .balance-display {
    background: #5865f2;
    color: #fff;
}

/* --- Utilities text --- */
[data-theme="light"] .text-muted {
    color: #5c5e66;
}

/* --- Sidebar footer btn in light mode --- */
[data-theme="light"] .sidebar .btn-secondary {
    background: #313338;
    color: #ffffff;
}
[data-theme="light"] .sidebar .btn-secondary:hover {
    background: #4e5058;
}
[data-theme="light"] .sidebar .btn-warning {
    color: #060607;
}

/* --- Nav badge --- */
[data-theme="light"] .nav-badge {
    background: #da373c;
    color: #fff;
}

/* ============================================================
   MOBILE-FIRST RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 767px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        z-index: 1050;
        transform: translateX(-100%);
        box-shadow: none;
        /* flex column — only nav scrolls, user panel always pinned at bottom */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .sidebar .sidebar-nav {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    /* User panel: flex child, always visible at bottom — no sticky needed */
    .sidebar .sidebar-user-panel {
        flex-shrink: 0;
        position: static;
        background: var(--bg-secondary);
        border-radius: 0;
        margin: 0;
        border-top: 1px solid var(--border-color);
        padding: 12px 14px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar-close {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .bottom-nav {
        display: flex;
    }

    .header {
        padding: 0 14px;
    }

    .page-title {
        font-size: 0.9375rem;
    }

    /* Extra bottom padding so content isn't hidden behind floating nav */
    .page-content {
        padding: 16px 16px calc(var(--bottom-nav-height) + 24px);
    }

    /* Tap feedback on bottom nav */
    .bottom-nav-item:active {
        opacity: 0.7;
        transform: scale(0.94);
        transition: transform 0.1s ease, opacity 0.1s ease;
    }

    /* Header: slightly taller on mobile for thumb comfort */
    .header {
        height: 52px;
        min-height: 52px;
    }
    
    .user-info {
        display: none;
    }
    
    .card {
        padding: 12px;
        overflow: hidden;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    code {
        word-break: break-all;
    }

    .form-control, textarea.form-control {
        max-width: 100%;
        box-sizing: border-box;
    }

    .card table {
        table-layout: fixed;
        width: 100%;
    }

    .card table td,
    .card table th {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .responsive-grid {
        grid-template-columns: 1fr;
    }

    .responsive-grid-auto {
        grid-template-columns: 1fr;
    }

    .responsive-grid-wide {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        max-width: 100%;
        margin: 8px;
        max-height: calc(100vh - 16px);
    }

    .balance-display {
        padding: 12px;
    }

    .balance-value {
        font-size: 1.375rem;
    }

    .table-container {
        margin: 0 -12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        width: calc(100% + 24px);
    }
}

/* ============================================================
   TABLET: >=768px
   ============================================================ */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: none;
    }
    
    .main-content {
        /* Flexbox handles the positioning automatically, no margin needed */
        margin-left: 0;
        max-width: 100%;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .responsive-grid-auto {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .responsive-grid-wide {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* ============================================================
   DESKTOP: >=1024px
   ============================================================ */
@media (min-width: 1024px) {
    .responsive-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .responsive-grid-wide {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   LARGE DESKTOP: >=1200px
   ============================================================ */
@media (min-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .page-content {
        padding: 24px 32px;
    }

    .responsive-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================================
   FORCE GRID CONSTRAINTS
   ============================================================ */
.grid,
[style*="display: grid"],
[style*="display:grid"] {
    max-width: 100%;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* (Sidebar follows theme - light in light mode, dark in dark mode - like real Discord) */

/* ============================================================
   MOBILE TABLE -> CARD LAYOUT
   ============================================================ */
@media (max-width: 767px) {
    /* Mobile Tables -> Card Layout */
    .table-container {
        border: none;
        overflow: visible;
        background: transparent;
        padding-inline: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }
    
    .table tbody tr {
        background: var(--bg-secondary);
        border: 1px solid var(--bg-tertiary);
        border-radius: var(--border-radius);
        margin-bottom: 8px;
        padding: 0;
        overflow: hidden;
    }
    
    .table tbody tr:hover {
        transform: none;
        background: var(--bg-secondary);
    }
    
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 10px;
        border-bottom: 1px solid var(--bg-tertiary);
        text-align: right;
        font-size: 0.8125rem;
        min-width: 0;
    }
    
    .table td:last-child {
        border-bottom: none;
    }
    
    .table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.6875rem;
        color: var(--text-muted);
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        margin-right: 0;
        width: 92px;
        min-width: 92px;
        max-width: 92px;
        flex-shrink: 0;
    }

    .table td > * {
        min-width: 0;
        max-width: calc(100% - 100px);
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .table td strong,
    .table td span,
    .table td small,
    .table td a,
    .table td div,
    .table td form {
        min-width: 0;
        max-width: 100%;
    }

    .table td[data-label="Actions"] {
        align-items: center;
    }

    .table td[data-label="Actions"] > * {
        max-width: calc(100% - 100px);
        width: auto;
    }

    .table td[data-label="Actions"] .d-flex {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px !important;
        width: 100%;
    }

    .table td[data-label="Actions"] .btn-sm {
        padding: 2px 10px;
        min-height: 26px;
    }

    .table td[data-label="Actions"] form {
        display: inline-flex;
        max-width: none;
    }
    
    [style*="grid-template-columns"][style*="350px"],
    [style*="grid-template-columns: 1fr 350px"] {
        display: block !important;
    }
    
    [style*="grid-template-columns"] > * {
        width: 100% !important;
        margin-bottom: 8px;
    }
    
    .hide-mobile {
        display: none !important;
    }

    /* Override .card table restrictions for .table card layout */
    .card .table {
        table-layout: auto;
    }

    .card .table td,
    .card .table th {
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }
}

/* ============================================================
   ENHANCED DISCORD POLISH
   ============================================================ */

/* Code inside tables — prevent overflow */
table code {
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
}

/* Card hover lift */
.card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Card header subtle gradient line */
.card-header {
    position: relative;
}
.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

/* Chart cards - no lift on hover (keep steady) */
.card:has(canvas) {
    transition: none;
}
.card:has(canvas):hover {
    transform: none;
    box-shadow: none;
}

/* Growth banner glow */
.stat-card[style*="accent-gradient"] {
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.15);
}

/* Alert banners enhanced */
.alert {
    border-radius: var(--border-radius);
    border-left: 3px solid;
}
.alert-warning {
    border-left-color: var(--warning);
}
.alert-success {
    border-left-color: var(--success);
}
.alert-danger {
    border-left-color: var(--danger);
}

/* Stat value subtle text-shadow */
.stat-value {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Better button transitions */
.btn {
    transition: all 0.15s ease;
}
.btn:active {
    transform: scale(0.97);
}

/* Quick Action cards in dashboard */
a.stat-card {
    border: 1px solid transparent;
}
a.stat-card:hover {
    border-color: var(--accent-primary);
}

/* Responsive grid auto enhancement */
.responsive-grid-auto .card {
    margin-bottom: 0;
}

.push-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.push-form-main,
.push-form-side {
    min-width: 0;
}

.push-help-card {
    overflow: hidden;
}

@media (max-width: 767px) {
    .push-form-layout {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .push-form-main,
    .push-form-side {
        width: 100%;
    }

    .push-form-layout .form-group {
        margin-bottom: 14px;
    }

    .push-form-layout .form-label {
        font-size: 0.72rem;
        letter-spacing: 0.05em;
        white-space: normal;
    }

    .push-help-card {
        margin-bottom: 14px !important;
    }

    .nav-link-logout {
        justify-content: center;
        gap: 10px;
        padding: 10px 12px;
        font-weight: 700;
    }

    .toast-container {
        right: 50%;
        bottom: 24px;
        width: calc(100% - 32px);
        max-width: 400px;
        transform: translateX(50%);
    }

    .toast-pro {
        width: 100%;
        transform: translateY(20px);
        animation: toast-slide-in-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .toast-pro.hide {
        animation: toast-slide-out-down 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
    }

    .product-card-header-main {
        /* flex:1 sets flex-basis:0%, which overrides `width`. Force the title
           block onto its own full-width row so the action buttons wrap below
           instead of squeezing the product name into a sliver. */
        flex: 1 1 100%;
        min-width: 0;
    }

    .product-order-chip {
        width: 100%;
        justify-content: center;
    }
}

[data-theme="light"] .nav-link-logout {
    color: #b4232d;
    background: linear-gradient(135deg, rgba(218, 55, 60, 0.08), rgba(218, 55, 60, 0.04));
    border-color: rgba(218, 55, 60, 0.16);
}

[data-theme="light"] .product-order-chip {
    background: rgba(88, 101, 242, 0.08);
    border-color: rgba(88, 101, 242, 0.16);
}

[data-theme="light"] .toast-pro {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

/* ============================================================
   ONESIGNAL - keep bell above bottom nav on mobile
   ============================================================ */
@media (max-width: 767px) {
    #onesignal-bell-container,
    .onesignal-bell-container {
        bottom: calc(var(--bottom-nav-height) + 18px) !important;
        right: 14px !important;
    }
}

[data-theme="light"] .toast-pro-title {
    color: #0f172a;
}

[data-theme="light"] .toast-pro-message {
    color: #475569;
}

[data-theme="light"] .toast-pro-close {
    color: #64748b;
}

[data-theme="light"] .toast-pro-close:hover {
    color: #0f172a;
}

@keyframes toast-slide-in-right {
    0% { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes toast-slide-out-right {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(30px); }
}

@keyframes toast-slide-in-up {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes toast-slide-out-down {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

[data-theme="light"] .nav-link-logout .nav-icon {
    color: #c83b45;
}

[data-theme="light"] .nav-link-logout:hover {
    color: #8f1f28;
    background: linear-gradient(135deg, rgba(218, 55, 60, 0.12), rgba(218, 55, 60, 0.07));
}

/* ============================================================
   PHASE 1 — LAYOUT & MANAGEMENT UTILITIES
   Max content width, toolbar/filter bars, compact stats,
   reusable decorative + interaction helpers.
   ============================================================ */

/* Constrain content on wide monitors so tables/cards don't
   stretch edge-to-edge on ultrawide displays. */
.page-content-inner {
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
}

/* Reusable page header: title + actions on one responsive row.
   Replaces ad-hoc inline flex headers across pages. */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.page-head__titles { min-width: 0; }
.page-head__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.25;
}
.page-head__subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.page-head__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Toolbar / filter bar — a consistent control row for search +
   selects + buttons. Works with existing .form-control / .btn. */
.toolbar,
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.toolbar > .toolbar-grow,
.filter-bar > .filter-grow {
    flex: 1 1 auto;
    min-width: 0;
}

/* Search field with a leading icon. Wrap an input in .search-field. */
.search-field {
    position: relative;
    flex: 1 1 240px;
    max-width: 360px;
    min-width: 0;
}
.search-field > .material-symbols-outlined {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-field > .form-control {
    width: 100%;
    padding-left: 36px;
}

/* Filters can collapse on small screens behind a toggle button.
   JS adds .is-open; the toggle itself only shows on mobile. */
.filter-toggle { display: none; }

/* Compact stat cards for dense pages (e.g. 6-stat grids).
   Trims padding / icon size to cut vertical height without
   changing the icon/value/label markup. */
.stats-grid.is-compact { gap: 10px; }
.stat-card.is-compact { padding: 14px; }
.stat-card.is-compact .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    margin-bottom: 8px;
}
.stat-card.is-compact .stat-value { font-size: 1.25rem; }

/* Decorative soft corner glow used on stat cards — replaces the
   repeated inline absolutely-positioned circle markup. */
.u-corner-glow { position: relative; overflow: hidden; }
.u-corner-glow::after {
    content: "";
    position: absolute;
    top: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.08;
    pointer-events: none;
}

/* Interaction helper: subtle lift on hover (cards, tiles, links).
   Replaces inline onmouseover/onmouseout transform handlers. */
.u-hover-lift { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.u-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Misc helpers */
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-info { color: var(--info); }
.text-primary { color: var(--accent-primary); }
.gap-05 { gap: 6px; }
.ml-auto { margin-left: auto; }

@media (max-width: 767px) {
    /* Collapsible filters: hide controls until toggled open. */
    .filter-bar.is-collapsible .filter-body {
        display: none;
        width: 100%;
    }
    .filter-bar.is-collapsible.is-open .filter-body {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }
    .filter-bar.is-collapsible .filter-body .form-control,
    .filter-bar.is-collapsible .filter-body .search-field,
    .filter-bar.is-collapsible .filter-body .btn {
        width: 100%;
        max-width: none;
    }
    .filter-toggle {
        display: inline-flex;
        width: 100%;
        justify-content: space-between;
    }
    /* Compact stats default to a tidy 2-up on phones. */
    .stats-grid.is-compact { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    /* On desktop the collapsible filter body is always visible. */
    .filter-bar.is-collapsible .filter-body {
        display: flex !important;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
}

/* ============================================================
   PHASE 2 — ENHANCED DATA TABLES (datatable.js)
   Sticky headers, sortable columns, row "⋯" actions menu.
   ============================================================ */

/* Sortable header affordance */
.table th.dt-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.12s ease;
}
.table th.dt-sortable:hover { color: var(--text-secondary); }
.dt-sort-icon {
    font-size: 15px;
    vertical-align: -3px;
    opacity: 0.35;
}
.table th.dt-asc .dt-sort-icon,
.table th.dt-desc .dt-sort-icon {
    opacity: 1;
    color: var(--accent-primary);
}

/* Sticky header — only on desktop, where the table scrolls inside its
   container. On mobile the table becomes a card list (header hidden). */
@media (min-width: 768px) {
    .table-container.dt-scroll {
        max-height: calc(100dvh - 230px);
        overflow: auto;
    }
    .table-container.dt-scroll .table thead th {
        position: sticky;
        top: 0;
        z-index: 3;
    }
}

/* Row actions "⋯" menu */
.row-actions { position: relative; display: inline-flex; }
.row-actions__toggle { min-width: 34px; padding: 0 8px; }
.row-actions__menu {
    display: none;
    z-index: 1000;
    min-width: 180px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}
.row-actions__menu.is-open {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
/* Stack the moved action buttons full-width, left-aligned. */
.row-actions__menu .btn,
.row-actions__menu form,
.row-actions__menu form .btn {
    width: 100%;
}
.row-actions__menu .btn {
    justify-content: flex-start;
    min-height: 36px;
}
.row-actions__menu form { margin: 0; }

/* On mobile (table->card) keep the compact "⋯" dropdown instead of spilling
   every action button inline — a row with 4-5 actions (balance, edit, suspend,
   verify, delete) otherwise overflows the card and breaks the layout. The JS
   positions the menu with fixed coordinates, so it works the same on phones. */
@media (max-width: 767px) {
    .row-actions { display: inline-flex; width: auto; }
    .row-actions__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        min-width: 40px;
    }
    /* The data-label cell may right-align actions in card view; nudge the
       floating menu to stay comfortably inside the viewport. */
    .row-actions__menu { min-width: 200px; }
}

/* ============================================================
   ADMIN PRODUCTS — collapsible product cards
   Collapsed by default so the list is easy to scan and reorder
   on both phone and desktop; expand to manage media/durations.
   ============================================================ */
.product-sort-card.is-collapsed .product-collapse { display: none; }
.product-sort-card.is-collapsed .card-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.product-head-titles {
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: background 0.12s ease;
}
.product-head-titles:hover { background: var(--bg-hover); }
.product-head-titles:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.product-toggle-btn .material-symbols-outlined {
    transition: transform 0.2s ease;
}
.product-sort-card:not(.is-collapsed) .product-toggle-btn .material-symbols-outlined,
.collapse-card:not(.is-collapsed) .product-toggle-btn .material-symbols-outlined {
    transform: rotate(180deg);
}

/* Generic collapsible card (e.g. "Add New Product" panel) */
.collapse-card.is-collapsed .collapse-body { display: none; }
.collapse-card__head { cursor: pointer; }
.collapse-card.is-collapsed .card-header { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.collapse-body { padding-top: 4px; }

/* Subreseller pricing grids — hide the empty product-spacer cell when the
   table collapses into mobile cards (the product name is shown in the group row). */
@media (max-width: 767px) {
    .table td.pricing-blank { display: none; }
}

/* Reseller generated-keys panel — mobile copy ergonomics */
@media (max-width: 767px) {
    /* Bigger tap targets for per-key copy buttons */
    .gen-copy-btn {
        min-height: 36px;
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
    }
    /* Keep the Copy All / Reveal All bar reachable without scrolling a long list */
    .gen-copyall-bar {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        z-index: 5;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.12);
    }
    .gen-copyall-bar .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}
