/* ============================================================
   ThirtyOne — Style v4
   Apple-inspired premium, frosted glass, dark + light modes
   ============================================================ */

:root, [data-theme="dark"] {
    /* Surfaces — Apple dark Sonoma-style */
    --bg:          #000000;
    --bg-soft:     #0a0a0c;
    --bg-card:     rgba(255,255,255,0.045);
    --bg-elev:     rgba(255,255,255,0.07);
    --bg-hover:    rgba(255,255,255,0.09);
    --bg-input:    rgba(255,255,255,0.04);

    /* Borders */
    --border:      rgba(255,255,255,0.09);
    --border-soft: rgba(255,255,255,0.05);
    --border-strong:rgba(255,255,255,0.18);

    /* Text */
    --text:        #f5f5f7;
    --text-dim:    #a1a1aa;
    --text-faint:  #71717a;
}

[data-theme="light"] {
    --bg:          #f5f5f7;
    --bg-soft:     #ffffff;
    --bg-card:     rgba(0,0,0,0.025);
    --bg-elev:     rgba(255,255,255,0.85);
    --bg-hover:    rgba(0,0,0,0.05);
    --bg-input:    rgba(0,0,0,0.03);

    --border:      rgba(0,0,0,0.08);
    --border-soft: rgba(0,0,0,0.04);
    --border-strong:rgba(0,0,0,0.15);

    --text:        #1d1d1f;
    --text-dim:    #6e6e73;
    --text-faint:  #86868b;
}

:root, [data-theme="dark"], [data-theme="light"] {

    /* Accents — Apple-like vibrant */
    --accent:      #30d158;
    --accent-dim:  #28bd4d;
    --accent-soft: rgba(48,209,88,0.15);

    --error:       #f87171;
    --error-dim:   #ef4444;
    --error-soft:  rgba(248,113,113,0.12);

    --info:        #60a5fa;
    --info-dim:    #3b82f6;
    --info-soft:   rgba(96,165,250,0.12);

    --warning:     #fbbf24;
    --warning-soft:rgba(251,191,36,0.12);

    --purple:      #a78bfa;
    --pink:        #f472b6;

    /* Radii — iOS likes larger corners */
    --radius:      14px;
    --radius-sm:   10px;
    --radius-xs:   8px;
    --radius-lg:   20px;

    /* Shadows — offset only, no glow */
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.2);
    --shadow:      0 6px 20px rgba(0,0,0,0.32);
    --shadow-lg:   0 20px 60px rgba(0,0,0,0.5);

    /* Motion */
    --transition:  200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 320ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-w:   256px;
    --topbar-h:    60px;
}

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

html, body {
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

/* iOS-style mesh background — sits behind frosted sidebar */
body {
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 1100px 800px at 0% 0%,   rgba(96,165,250,0.18), transparent 55%),
        radial-gradient(ellipse 900px 700px at 100% 30%, rgba(167,139,250,0.16), transparent 55%),
        radial-gradient(ellipse 1000px 700px at 50% 100%,rgba(52,211,153,0.14), transparent 55%),
        radial-gradient(ellipse 700px 500px at 80% 80%,  rgba(244,114,182,0.10), transparent 55%);
    background-attachment: fixed;
    position: relative;
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.025) 1px, transparent 0);
    background-size: 24px 24px;
}

a { color: var(--info); text-decoration: none; transition: color var(--transition); }
a:hover { color: #93c5fd; }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 18px 0; }

::selection { background: var(--accent-soft); color: var(--text); }

/* Modern scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); background-clip: padding-box; }

/* Icon base */
.icon { display: inline-block; line-height: 1; vertical-align: -0.1em; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---- Frosted iOS-style sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: rgba(13,17,23,0.55);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 60;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 22px 18px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    letter-spacing: -0.01em;
}
.logo-icon {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, #34d399 0%, #60a5fa 100%);
    color: #0d1117;
}
.logo-text {
    background: linear-gradient(135deg, #34d399 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav { padding: 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: all var(--transition);
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
}
.nav-item .icon { width: 18px; text-align: center; flex-shrink: 0; }
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.nav-item.active {
    background: var(--bg-elev);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border);
}
.nav-item.active .icon { color: var(--accent); }

.sidebar-footer {
    border-top: 1px solid var(--border-soft);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, #34d399 0%, #60a5fa 100%);
    display: grid;
    place-items: center;
    color: #0d1117;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logout-link {
    color: var(--text-dim);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: grid;
    place-items: center;
}
.logout-link:hover { background: var(--error-soft); color: var(--error); }

/* ---- Main area ---- */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border-soft);
    background: rgba(13,17,23,0.55);
    backdrop-filter: blur(30px) saturate(1.6);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.page-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.content { padding: 28px; }

.hamburger {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 70;
    background: rgba(13,17,23,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px; height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.hamburger:hover { background: var(--bg-hover); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(3px);
    z-index: 55;
}
.sidebar-backdrop.show { display: block; }

/* Mobile */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .hamburger { display: flex; }
    .topbar { padding-left: 64px; }
    .content { padding: 20px 16px; }
}

/* ============================================================
   CARDS & GRID — frosted glass
   ============================================================ */
.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.card:hover {
    background: var(--bg-elev);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.card h3 {
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.card .sub {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-dim);
}

.status-dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-right: 8px;
    background: var(--text-faint);
    vertical-align: middle;
}
.status-dot.on  { background: var(--accent); }
.status-dot.off { background: var(--error); }

/* ============================================================
   PANELS
   ============================================================ */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 22px;
    overflow: visible;
}
.panel > .table-wrap { border-radius: 0 0 var(--radius) var(--radius); overflow: auto; }
.panel > .filters    { border-radius: var(--radius) var(--radius) 0 0; }
.panel > .filters:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.panel-title {
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: -0.005em;
}

/* ============================================================
   PROFILE CARD — Eldorado seller info
   ============================================================ */
.profile-card {
    position: relative;
    margin-bottom: 22px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
.profile-card-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 200px at 0% 0%,   rgba(52,211,153,0.18), transparent 60%),
        radial-gradient(ellipse 600px 200px at 100% 0%, rgba(96,165,250,0.18), transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.profile-main {
    position: relative;
    z-index: 1;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.profile-avatar {
    position: relative;
    width: 72px; height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, #34d399, #60a5fa);
    color: #0d1117;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 700;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.profile-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
/* .profile-verified — kaldırıldı, kullanılmıyor */

/* Bot durum kutusu (idToken'ı VPS bot otomatik gönderiyor — manuel giriş kaldırıldı) */
.bot-status-box {
    background: rgba(74, 222, 128, 0.04);
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: var(--radius-sm);
    padding: 14px;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.profile-name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.profile-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-dim);
    font-size: 13px;
}
.profile-meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-refresh { margin-left: auto; }

.profile-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border-soft);
    border-top: 1px solid var(--border-soft);
}
.profile-stat {
    background: rgba(0,0,0,0.15);
    padding: 14px 20px;
}
.profile-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.profile-stat-value {
    margin-top: 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

@media (max-width: 720px) {
    .profile-main { flex-direction: column; align-items: flex-start; }
    .profile-refresh { margin-left: 0; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 500;
    font-size: 13.5px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #0d1117;
    border-color: transparent;
    font-weight: 600;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}
.btn-danger:hover { background: linear-gradient(135deg, #fb7e7e 0%, #f44949 100%); }

.btn-ghost { background: transparent; border-color: transparent; backdrop-filter: none; }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon { padding: 8px; }
.btn-icon .icon { display: block; }
.btn-block { width: 100%; justify-content: center; padding-top: 11px; padding-bottom: 11px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}
.form-row label {
    font-size: 12.5px;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.01em;
}
.form-row .hint {
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.55;
}
.input, .textarea {
    width: 100%;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font: inherit;
    font-size: 13.5px;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.06);
}
.input.inline-edit {
    padding: 5px 10px;
    width: 100px;
    font-size: 13px;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ============================================================
   CUSTOM SELECT — animated dropdown
   ============================================================ */
.select-wrap {
    position: relative;
    width: 100%;
    min-width: 140px;
}
.select-wrap .select {
    width: 100%;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 38px 10px 14px;
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    user-select: none;
}
.select-wrap .select:hover { border-color: var(--border-strong); }
.select-wrap.open .select {
    border-color: var(--accent);
    background: rgba(255,255,255,0.06);
}
.select-wrap .select-chevron {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
    transition: transform var(--transition);
    font-size: 11px;
}
.select-wrap.open .select-chevron { transform: translateY(-50%) rotate(180deg); }

.select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: rgba(20,26,38,0.9);
    backdrop-filter: blur(30px) saturate(1.6);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    pointer-events: none;
    transform-origin: top center;
    transition: opacity var(--transition), transform var(--transition);
}
.select-wrap.open { z-index: 200; }
.select-wrap.open .select-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.select-option {
    padding: 9px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-dim);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.select-option:hover { background: var(--bg-hover); color: var(--text); }
.select-option.selected {
    color: var(--text);
    background: var(--accent-soft);
}
.select-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent);
    font-size: 11px;
}

/* Hide the original <select> while keeping it in the form */
.select-wrap select.select-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

/* Filter bar: selects shrink to content */
.filters .select-wrap { width: auto; flex: 0 0 auto; }
.filters .select-wrap.grow { flex: 1; min-width: 180px; }

/* ============================================================
   SWITCH
   ============================================================ */
.switch {
    --w: 42px;
    --h: 24px;
    position: relative;
    display: inline-block;
    width: var(--w);
    height: var(--h);
    flex-shrink: 0;
}
.switch input { display: none; }
.switch .slider {
    position: absolute; inset: 0;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition);
}
.switch .slider::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: calc(var(--h) - 6px);
    height: calc(var(--h) - 6px);
    background: var(--text-dim);
    border-radius: 50%;
    transition: all var(--transition);
}
.switch input:checked + .slider {
    background: linear-gradient(135deg, #34d399, #10b981);
    border-color: transparent;
}
.switch input:checked + .slider::before {
    background: #fff;
    transform: translateX(calc(var(--w) - var(--h)));
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table th, .table td {
    padding: 13px 18px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-soft);
}
.table thead th {
    background: rgba(255,255,255,0.02);
    position: sticky;
    top: 0;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    z-index: 5;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .text-right { text-align: right; }
.table .text-center { text-align: center; }
.table .nowrap { white-space: nowrap; }

@media (max-width: 720px) {
    .table-responsive thead { display: none; }
    .table-responsive tbody tr {
        display: block;
        padding: 14px;
        border-bottom: 1px solid var(--border-soft);
    }
    .table-responsive tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 5px 0;
        border: 0;
    }
    .table-responsive tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-dim);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.07em;
    }
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
}
.filters .input { width: auto; min-width: 140px; }
.filters .grow { flex: 1; min-width: 180px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--bg-elev);
    color: var(--text-dim);
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.badge-success { background: var(--accent-soft); color: var(--accent); border-color: rgba(52,211,153,0.18); }
.badge-error   { background: var(--error-soft); color: var(--error); border-color: rgba(248,113,113,0.18); }
.badge-info    { background: var(--info-soft); color: var(--info); border-color: rgba(96,165,250,0.18); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(251,191,36,0.18); }
.badge-muted   { background: var(--bg-elev); color: var(--text-dim); }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: rgba(20,26,38,0.85);
    border: 1px solid var(--border);
    border-left: 3px solid var(--info);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    color: var(--text);
    box-shadow: var(--shadow);
    min-width: 260px;
    max-width: 380px;
    pointer-events: auto;
    animation: toastIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-size: 13.5px;
}
.toast-success { border-left-color: var(--accent); }
.toast-error   { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }
.toast.hide { opacity: 0; transform: translateX(8px); transition: all 0.25s; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5,8,14,0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.22s ease;
}
.modal-backdrop.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: rgba(20,26,38,0.85);
    backdrop-filter: blur(30px) saturate(1.6);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-weight: 600; font-size: 15px; }
.modal-body  { padding: 20px; overflow-y: auto; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 4px;
    display: inline-block;
    height: 14px;
    width: 100%;
    min-width: 40px;
}
@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ============================================================
   AUTH (LOGIN / INSTALL) — iOS-style frosted card
   ============================================================ */
.auth-body {
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.auth-bg span {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    animation: blobFloat 22s ease-in-out infinite;
}
.auth-bg span:nth-child(1) {
    width: 520px; height: 520px;
    background: #34d399;
    top: -140px; left: -140px;
    animation-delay: 0s;
}
.auth-bg span:nth-child(2) {
    width: 580px; height: 580px;
    background: #60a5fa;
    bottom: -200px; right: -140px;
    animation-delay: -8s;
}
.auth-bg span:nth-child(3) {
    width: 380px; height: 380px;
    background: #a78bfa;
    top: 35%; left: 50%;
    animation-delay: -14s;
}
@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(50px, -40px) scale(1.08); }
    66%      { transform: translate(-40px, 50px) scale(0.92); }
}

.login-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-box {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 22px;
    padding: 36px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(40px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    animation: authIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes authIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    margin-bottom: 22px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
}
.auth-brand-icon {
    width: 28px; height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #34d399 0%, #60a5fa 100%);
    color: #0d1117;
    display: grid;
    place-items: center;
}
.auth-brand-text {
    background: linear-gradient(135deg, #34d399 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.01em;
}

.login-box h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.login-box p.muted {
    color: var(--text-dim);
    font-size: 13.5px;
    margin: 0 0 22px;
}

.banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid;
    animation: fadeIn 0.25s ease;
}
.banner-error {
    background: var(--error-soft);
    border-color: rgba(248,113,113,0.3);
    color: var(--error);
}
.banner-success {
    background: var(--accent-soft);
    border-color: rgba(52,211,153,0.3);
    color: var(--accent);
}
.banner .icon { flex-shrink: 0; }

.error-banner {
    background: var(--error-soft);
    border: 1px solid rgba(248,113,113,0.3);
    color: var(--error);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }  .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.muted { color: var(--text-dim); }
.text-success { color: var(--accent); }
.text-error   { color: var(--error); }
.text-info    { color: var(--info); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 12.5px; }
.mono {
    font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
    font-size: 12.5px;
    font-variant-ligatures: none;
}
.hidden { display: none !important; }

/* ============================================================
   THEME TOGGLE (Apple-style sun/moon)
   ============================================================ */
.theme-toggle {
    margin-left: auto;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: background var(--transition), transform var(--transition);
}
.theme-toggle:hover { background: var(--bg-hover); transform: scale(1.05); }
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle-icon {
    position: absolute;
    inset: 0;
    display: grid; place-items: center;
    font-size: 15px;
    transition: opacity var(--transition), transform var(--transition);
}
[data-theme="dark"] .theme-icon-dark { opacity: 0; transform: rotate(-90deg); }
[data-theme="dark"] .theme-icon-light { opacity: 1; transform: rotate(0); }
[data-theme="light"] .theme-icon-dark { opacity: 1; transform: rotate(0); }
[data-theme="light"] .theme-icon-light { opacity: 0; transform: rotate(90deg); }

.topbar { display: flex; align-items: center; }

/* ============================================================
   MANUAL COOKIE SECTION (Settings)
   ============================================================ */
.manual-cookie-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    padding: 12px 14px;
}
.manual-cookie-section summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dim);
    font-size: 13.5px;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.manual-cookie-section summary::before {
    content: '▸';
    transition: transform var(--transition);
    color: var(--text-faint);
    font-size: 11px;
}
.manual-cookie-section[open] summary::before {
    transform: rotate(90deg);
}
.manual-cookie-section[open] summary {
    color: var(--text);
    margin-bottom: 12px;
}
.manual-cookie-body { padding-top: 4px; }
.textarea-mono {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11.5px !important;
    line-height: 1.45;
    resize: vertical;
    min-height: 70px;
    word-break: break-all;
}

/* ============================================================
   IMPROVED CHECKBOX (Apple-style)
   ============================================================ */
input[type="checkbox"]:not(.switch input) {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
    flex-shrink: 0;
    vertical-align: middle;
}
input[type="checkbox"]:not(.switch input):hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
input[type="checkbox"]:not(.switch input):checked {
    background: var(--accent);
    border-color: var(--accent);
}
input[type="checkbox"]:not(.switch input):checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
input[type="checkbox"]:not(.switch input):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Game category color badges (better visual distinction) */
.cat-mm2 { background: rgba(244, 114, 182, 0.15); color: #f472b6; }
.cat-adopt { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.cat-limited { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.cat-roblox { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.cat-cs2 { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.cat-fortnite { background: rgba(52, 211, 153, 0.15); color: var(--accent); }
.cat-default { background: var(--bg-elev); color: var(--text-dim); }
.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.cat-badge .icon { font-size: 10px; }

/* ============================================================
   LIGHT THEME ADJUSTMENTS (specific overrides)
   ============================================================ */
[data-theme="light"] body {
    background:
        radial-gradient(circle at 20% 20%, rgba(48,209,88,0.04), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(96,165,250,0.04), transparent 50%),
        var(--bg);
}
[data-theme="light"] .sidebar { background: rgba(255,255,255,0.7); backdrop-filter: blur(30px); }
[data-theme="light"] .topbar { background: rgba(255,255,255,0.7); backdrop-filter: blur(20px); }
[data-theme="light"] .panel,
[data-theme="light"] .card,
[data-theme="light"] .profile-card { background: rgba(255,255,255,0.9); }
[data-theme="light"] .nav-item.active { background: var(--accent-soft); color: var(--accent); }
[data-theme="light"] .toast { background: rgba(255,255,255,0.95); color: var(--text); }
[data-theme="light"] .modal { background: rgba(255,255,255,0.98); }
[data-theme="light"] .select-menu { background: rgba(255,255,255,0.95); }
[data-theme="light"] code { background: rgba(0,0,0,0.05); color: var(--text); padding: 1px 5px; border-radius: 4px; }
[data-theme="dark"] code  { background: rgba(255,255,255,0.06); color: var(--text); padding: 1px 5px; border-radius: 4px; }
