/**
 * EmuBase Admin — Premium SaaS Dashboard
 * Ultra-modern, enterprise-grade design system.
 */

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

:root {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-dark: #c2410c;
    --primary-soft: #fff7ed;
    --primary-border: #fed7aa;
    --primary-glow: rgba(249, 115, 22, 0.15);

    --bg: #f1f5f9;
    --bg-subtle: #e8edf3;
    --bg-wash: #f8fafc;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --panel-muted: #f8fafc;

    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --line-light: #f1f5f9;

    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #64748b;
    --muted-strong: #475569;
    --muted-light: #94a3b8;

    --blue: #3b82f6;
    --blue-soft: #eff6ff;
    --blue-border: #bfdbfe;

    --green: #10b981;
    --green-soft: #ecfdf5;
    --green-border: #a7f3d0;

    --orange: #f97316;
    --orange-soft: #fff7ed;
    --orange-border: #fed7aa;

    --coral: #f43f5e;
    --coral-soft: #fff1f2;
    --coral-border: #fecdd3;

    --purple: #8b5cf6;
    --purple-soft: #f5f3ff;
    --purple-border: #ddd6fe;

    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --danger-border: #fecaca;

    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 48px -8px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 24px rgba(249, 115, 22, 0.12);

    --badge-icon-game: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='4'/%3E%3Cpath d='M6 12h4m-2-2v4m7-2h.01m3 0h.01'/%3E%3C/svg%3E");
    --badge-icon-device: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='3'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E");
    --badge-icon-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
    --badge-icon-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --badge-icon-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m-4-4 4 4 4-4'/%3E%3Cpath d='M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2'/%3E%3C/svg%3E");
    --badge-icon-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
    --badge-icon-conversion: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M17 7 7 17'/%3E%3C/svg%3E");
    --badge-icon-globe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3.6 9h16.8M3.6 15h16.8'/%3E%3C/svg%3E");
    --badge-icon-inbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-7Z'/%3E%3C/svg%3E");
    --badge-icon-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.5 5.5L20 11l-5.5 2.5L12 19l-2.5-5.5L4 11l5.5-2.5L12 3Z'/%3E%3C/svg%3E");
    --badge-icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E");
    --badge-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.006em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

code {
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--primary-border);
}

/* ==========================================================================
   Shell & Layout
   ========================================================================== */

.admin-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    z-index: 40;
    overflow: hidden;
}

.sidebar-header {
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-img {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sidebar-nav-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 14px;
}

.sidebar-nav-wrap::-webkit-scrollbar { width: 3px; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.nav {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-label {
    margin: 0 0 8px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.6);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    color: rgba(203, 213, 225, 0.8);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.08) 100%);
    color: #fb923c;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.2s;
}

.nav-item.active .nav-icon { opacity: 1; color: #fb923c; }
.nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: pulseDot 2s infinite;
    flex-shrink: 0;
}

.mini-card strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.mini-card small {
    display: block;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(239, 68, 68, 0.15);
    transition: all 0.2s ease;
}

.logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.logout svg { width: 16px; height: 16px; }

.sidebar-backdrop { display: none; }

/* ── Main Area ── */
.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

/* ── Topbar ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 72px;
    padding: 0 32px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.mobile-menu {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 7px;
    color: var(--text-secondary);
    cursor: pointer;
}

.mobile-menu svg { width: 20px; height: 20px; }

.topbar-heading h1 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.crumb-home {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}

.crumb-home:hover { color: var(--primary); }
.crumb-home svg { width: 13px; height: 13px; }
.crumb-sep { color: var(--line-strong); font-size: 11px; }
.crumb-current { color: var(--text); font-weight: 600; }

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.top-search {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin: 0 !important;
    width: 260px;
    height: 40px;
    padding: 0 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.top-search:focus-within {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-glow);
    width: 320px;
}

.top-search .search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--muted);
}

.top-search .search-icon svg { width: 16px; height: 16px; }

.top-search input {
    border: none !important;
    background: transparent !important;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    width: 100%;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 8px !important;
    height: 100% !important;
    margin: 0 !important;
}

.top-search input::placeholder { color: var(--muted-light); }

.kbd-shortcut {
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-family: inherit;
    flex-shrink: 0;
    line-height: 1.3;
}

.search-icon svg { width: 16px; height: 16px; color: var(--muted); }

.status-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--green-soft);
    border: 1px solid var(--green-border);
    color: #047857;
    font-size: 11.5px;
    font-weight: 700;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulseDot 2s infinite;
}

.tool-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--muted-strong);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-icon:hover {
    border-color: var(--line-strong);
    color: var(--text);
    background: #ffffff;
    transform: scale(1.05);
}

.tool-icon svg { width: 17px; height: 17px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    border-radius: var(--radius-full);
    background: #ffffff;
    border: 1px solid var(--line);
    transition: box-shadow 0.2s;
}

.user-chip:hover { box-shadow: var(--shadow-md); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.user-chip strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.user-chip small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1;
}

/* ==========================================================================
   Content Area & Panels
   ========================================================================== */

.content {
    padding: 28px 32px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 26px;
    min-width: 0;
    transition: box-shadow 0.3s ease;
}

.panel:hover { box-shadow: var(--shadow-md); }

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.panel-head h2 {
    margin: 0 0 3px;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
}

.panel-head p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
}

/* ==========================================================================
   Metric Stat Cards
   ========================================================================== */

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    min-width: 0;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-border);
}

.stat:hover::after { opacity: 1; }

.stat-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    font-size: 0;
    line-height: 0;
    position: relative;
}

.stat-badge::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: var(--badge-icon-grid) center / contain no-repeat;
    mask: var(--badge-icon-grid) center / contain no-repeat;
}

.stat-badge.coral { background: var(--coral-soft); color: var(--coral); border: 1px solid var(--coral-border); }
.stat-badge.blue { background: var(--blue-soft); color: var(--blue); border: 1px solid var(--blue-border); }
.stat-badge.orange { background: var(--orange-soft); color: var(--orange); border: 1px solid var(--orange-border); }
.stat-badge.green { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }

/* Contextual icons for stat cards */
body.page-dashboard .cards > .stat:nth-child(1) .stat-badge::before { -webkit-mask-image: var(--badge-icon-game); mask-image: var(--badge-icon-game); }
body.page-dashboard .cards > .stat:nth-child(2) .stat-badge::before { -webkit-mask-image: var(--badge-icon-device); mask-image: var(--badge-icon-device); }
body.page-dashboard .cards > .stat:nth-child(3) .stat-badge::before { -webkit-mask-image: var(--badge-icon-grid); mask-image: var(--badge-icon-grid); }
body.page-dashboard .cards > .stat:nth-child(4) .stat-badge::before { -webkit-mask-image: var(--badge-icon-download); mask-image: var(--badge-icon-download); }

body.page-analytics .analytics-cards > .stat:nth-child(1) .stat-badge::before { -webkit-mask-image: var(--badge-icon-eye); mask-image: var(--badge-icon-eye); }
body.page-analytics .analytics-cards > .stat:nth-child(2) .stat-badge::before { -webkit-mask-image: var(--badge-icon-download); mask-image: var(--badge-icon-download); }
body.page-analytics .analytics-cards > .stat:nth-child(3) .stat-badge::before { -webkit-mask-image: var(--badge-icon-users); mask-image: var(--badge-icon-users); }
body.page-analytics .analytics-cards > .stat:nth-child(4) .stat-badge::before { -webkit-mask-image: var(--badge-icon-conversion); mask-image: var(--badge-icon-conversion); }

body.page-website_analytics .analytics-cards > .stat:nth-child(1) .stat-badge::before { -webkit-mask-image: var(--badge-icon-globe); mask-image: var(--badge-icon-globe); }
body.page-website_analytics .analytics-cards > .stat:nth-child(2) .stat-badge::before { -webkit-mask-image: var(--badge-icon-users); mask-image: var(--badge-icon-users); }
body.page-website_analytics .analytics-cards > .stat:nth-child(3) .stat-badge::before { -webkit-mask-image: var(--badge-icon-download); mask-image: var(--badge-icon-download); }
body.page-website_analytics .analytics-cards > .stat:nth-child(4) .stat-badge::before { -webkit-mask-image: var(--badge-icon-conversion); mask-image: var(--badge-icon-conversion); }

body.page-problem_reports .support-stats > .stat:nth-child(1) .stat-badge::before,
body.page-game_requests .support-stats > .stat:nth-child(1) .stat-badge::before { -webkit-mask-image: var(--badge-icon-inbox); mask-image: var(--badge-icon-inbox); }
body.page-problem_reports .support-stats > .stat:nth-child(2) .stat-badge::before,
body.page-game_requests .support-stats > .stat:nth-child(2) .stat-badge::before { -webkit-mask-image: var(--badge-icon-spark); mask-image: var(--badge-icon-spark); }
body.page-problem_reports .support-stats > .stat:nth-child(3) .stat-badge::before,
body.page-game_requests .support-stats > .stat:nth-child(3) .stat-badge::before { -webkit-mask-image: var(--badge-icon-clock); mask-image: var(--badge-icon-clock); }
body.page-problem_reports .support-stats > .stat:nth-child(4) .stat-badge::before,
body.page-game_requests .support-stats > .stat:nth-child(4) .stat-badge::before { -webkit-mask-image: var(--badge-icon-check); mask-image: var(--badge-icon-check); }

.stat strong {
    font-family: 'Outfit', sans-serif;
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.035em;
    line-height: 1;
    margin-bottom: 6px;
    display: block;
}

.stat strong.coral { color: var(--coral); }
.stat strong.blue { color: var(--blue); }
.stat strong.orange { color: var(--orange); }
.stat strong.green { color: var(--green); }

.stat span {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.stat-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted-strong);
    margin-top: 12px;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
    width: fit-content;
}

/* ==========================================================================
   Dashboard Grids & Charts
   ========================================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    min-width: 0;
}

.sales-panel {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    padding: 26px;
}

.sales-legend {
    display: flex;
    flex-direction: column;
    gap: 18px;
    border-right: 1px solid var(--line);
    padding-right: 24px;
    justify-content: center;
}

.legend-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.legend-item:hover { background: var(--bg); }

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-dot.blue { background: var(--blue); box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }
.legend-dot.green { background: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.legend-dot.coral { background: var(--coral); box-shadow: 0 0 6px rgba(244, 63, 94, 0.4); }
.legend-dot.orange { background: var(--orange); box-shadow: 0 0 6px rgba(249, 115, 22, 0.4); }

.legend-value {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
}

.legend-note {
    font-size: 11px;
    color: var(--muted-light);
}

.view-link { margin-top: 10px; }

.sales-chart {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.range-pills {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
}

.range-pill {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-pill.active {
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

.range-pill:not(.active):hover { color: var(--text); }

.chart-shell {
    width: 100%;
    height: 220px;
    position: relative;
    margin: 18px 0 12px;
}

.chart-shell svg { width: 100%; height: 100%; display: block; }

.chart-months {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted-light);
    font-weight: 600;
    padding: 0 4px;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 16px;
    justify-content: flex-end;
}

.sales-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mini-chart {
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mini-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 150px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    margin: 12px 0;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 36px;
}

.bar {
    width: 100%;
    border-radius: 8px 8px 2px 2px;
    background: linear-gradient(180deg, var(--primary) 0%, #fdba74 100%);
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.bar-col:hover .bar {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
}

.bar-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.mini-score {
    font-family: 'Outfit', sans-serif;
    font-size: 34px;
    font-weight: 800;
    color: var(--text);
    margin-top: 12px;
    line-height: 1;
    letter-spacing: -0.03em;
}

.mini-sub {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    margin-top: 4px;
}

/* Dual Panels (Operations Snapshot & Quick Actions) */
.dual-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-width: 0;
}

.stats-list,
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-card,
.quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-wash);
    border: 1px solid var(--line);
    transition: all 0.25s ease;
}

.list-card:hover,
.quick-link:hover {
    background: #ffffff;
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.quick-link:hover {
    border-color: var(--primary-border);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.list-card strong,
.quick-link strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.list-card span,
.quick-link small {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.list-chip {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--primary-border);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ==========================================================================
   Data Tables
   ========================================================================== */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

th {
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    background: var(--bg-wash);
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr {
    transition: background 0.15s ease;
}

tr:hover td { background: var(--bg-wash); }

.game-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 240px;
}

.game-cell img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--line);
    flex-shrink: 0;
    background: var(--bg-subtle);
    box-shadow: var(--shadow-xs);
}

.game-cell span {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--line);
}

.actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--bg);
    border-color: var(--line-strong);
    color: var(--text);
    transform: translateY(-1px);
}

.btn.primary,
.btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
    font-weight: 700;
}

.btn.primary:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn.danger,
.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.btn.danger:hover,
.btn-danger:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: translateY(-1px);
}

.btn.small,
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
}

.span-2 { grid-column: span 2; }

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

input,
select,
textarea {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--line);
    background: var(--bg-wash);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--line-strong);
    background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.hint {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    background: var(--bg-wash);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.filters input,
.filters select { min-width: 160px; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a.active {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
    font-weight: 700;
}

.pagination a:hover:not(.active) {
    background: var(--bg);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    font-size: 13.5px;
    font-weight: 600;
}

.alert.success {
    background: var(--green-soft);
    color: #047857;
    border: 1px solid var(--green-border);
}

.alert.warning {
    background: var(--orange-soft);
    color: var(--primary-dark);
    border: 1px solid var(--orange-border);
}

.alert.danger,
.alert.error {
    background: var(--danger-soft);
    color: #b91c1c;
    border: 1px solid var(--danger-border);
}

.alert-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   Analytics Pages
   ========================================================================== */

.analytics-filter-bar { padding: 18px 22px; }

.analytics-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.analytics-filter-form label { flex: 1 1 180px; }

.analytics-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-cards { margin-top: 4px; }

/* Support & Inbox */
.support-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.support-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.support-hero h2 {
    margin: 8px 0 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.support-hero p {
    margin: 0;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
}

.status-new { background: var(--orange-soft); color: var(--orange); border: 1px solid var(--orange-border); }
.status-in_progress { background: var(--blue-soft); color: var(--blue); border: 1px solid var(--blue-border); }
.status-resolved { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }
.status-closed { background: var(--bg-subtle); color: var(--muted); border: 1px solid var(--line); }

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat { animation: fadeInUp 0.4s ease backwards; }
.stat:nth-child(1) { animation-delay: 0ms; }
.stat:nth-child(2) { animation-delay: 60ms; }
.stat:nth-child(3) { animation-delay: 120ms; }
.stat:nth-child(4) { animation-delay: 180ms; }

.panel { animation: fadeInUp 0.35s ease backwards; animation-delay: 100ms; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(6px);
        z-index: 35;
        border: none;
    }
    .mobile-menu { display: inline-flex; }
    .dual-panels { grid-template-columns: 1fr; }
    .sales-panel { grid-template-columns: 1fr; }
    .sales-legend {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding-right: 0;
        padding-bottom: 20px;
    }
    .topbar { padding: 0 16px; height: 64px; }
    .content { padding: 16px; gap: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
}

@media (max-width: 600px) {
    .cards { grid-template-columns: 1fr; }
    .top-search { display: none !important; }
    .status-chip { display: none; }
    .user-chip div { display: none; }
}
