/* ==========================================================================
   DiscoPay — app.css (pure CSS, no build step)
   Fonts: <link href="https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap" rel="stylesheet">
   Icons: <script src="https://unpkg.com/lucide@latest/dist/umd/lucide.min.js"></script> + lucide.createIcons()
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Brand — sampled from the logo gradient */
    --cyan-300: #9adffc;
    --cyan-400: #5ac8fa;
    --blue-400: #7b94ff;
    --blue-500: #4a6cf7;
    --blue-600: #3f5de6;
    --royal-600: #4752c4;
    --grad-brand: linear-gradient(135deg, #5ac8fa 0%, #4a6cf7 58%, #4752c4 100%);
    --grad-brand-soft: linear-gradient(135deg, rgba(90, 200, 250, .16), rgba(74, 108, 247, .16));
    --accent: var(--blue-500);
    --accent-hover: #5a7bff;
    --accent-press: var(--blue-600);
    --accent-ring: rgba(74, 108, 247, .35);
    --link: #8fb4ff;

    /* Surfaces — navy tinted toward the brand hue */
    --bg: #070a14;
    --bg-2: #0b1020;
    --panel: #10162a;
    --panel-2: #151c33;
    --panel-3: #1b2341;
    --input-bg: rgba(5, 8, 18, .65);
    --border: rgba(143, 170, 255, .10);
    --border-strong: rgba(143, 170, 255, .18);
    --border-focus: var(--blue-500);

    /* Text */
    --text: #e9edf8;
    --text-2: #b7c0da;
    --muted: #8a95b4;
    --faint: #5f6a8c;

    /* Semantic */
    --success: #34d399;  --success-bg: rgba(52, 211, 153, .12);  --success-bd: rgba(52, 211, 153, .28);
    --warning: #fbbf24;  --warning-bg: rgba(251, 191, 36, .12);  --warning-bd: rgba(251, 191, 36, .28);
    --danger:  #f87171;  --danger-bg:  rgba(248, 113, 113, .12); --danger-bd:  rgba(248, 113, 113, .30);
    --info:    var(--cyan-400); --info-bg: rgba(90, 200, 250, .12); --info-bd: rgba(90, 200, 250, .28);
    --neutral: #a3adc8;  --neutral-bg: rgba(163, 173, 200, .10); --neutral-bd: rgba(163, 173, 200, .22);

    /* Type */
    --font-heading: 'Sora', 'Manrope', system-ui, sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

    /* Spacing (4px base) */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

    /* Radius */
    --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -20px rgba(0, 0, 0, .75);
    --glow-brand: 0 8px 24px -8px rgba(74, 108, 247, .55);

    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 520px at 12% -12%, rgba(74, 108, 247, .16), transparent 60%),
        radial-gradient(800px 420px at 100% -6%, rgba(90, 200, 250, .08), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text); letter-spacing: -.02em; line-height: 1.2; margin: 0 0 var(--s-3); text-wrap: balance; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 var(--s-3); text-wrap: pretty; }
a { color: var(--link); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--cyan-300); }
strong { font-weight: 700; }
code, pre { font-family: var(--font-mono); font-size: .9em; }
::selection { background: rgba(74, 108, 247, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 2px; border-radius: 6px; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: var(--s-2);
    padding: 10px max(20px, calc((100vw - 1120px) / 2));
    background: rgba(9, 13, 26, .72);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.topbar strong, .brand strong {
    font-family: var(--font-heading); font-size: 17px; font-weight: 700; letter-spacing: -.02em;
    background: linear-gradient(90deg, #fff 30%, var(--cyan-300));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .logo, .brand .logo { height: 32px; width: 32px; object-fit: contain; vertical-align: middle; margin-right: 10px; filter: drop-shadow(0 4px 12px rgba(74, 108, 247, .45)); }
.brand { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.topbar span { margin-left: auto; margin-right: var(--s-2); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar a:not(.brand) {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: var(--r-sm);
    color: var(--text-2); font-weight: 600;
    border: 1px solid transparent;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.topbar a:not(.brand):hover { background: var(--panel-2); border-color: var(--border); color: var(--text); }
.topbar a.is-active { background: var(--grad-brand-soft); color: var(--text); border-color: var(--info-bd); }

/* ---------- Layout ---------- */
.dashboard { max-width: 1120px; margin: 0 auto; padding: var(--s-8) 20px var(--s-12); }
.dashboard > h1 { margin-bottom: var(--s-5); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); }
.page-head-actions { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back-link { margin: 0 0 var(--s-3); font-size: 14px; }
.back-link a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.back-link a:hover { color: var(--text); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s-5); align-items: start; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); margin: var(--s-8) 0 var(--s-3); }

/* ---------- Modal (native <dialog>, styled with .panel inside) ---------- */
.dp-dialog, .dp-dialog:focus, .dp-dialog:focus-visible {
    border: none; outline: none; box-shadow: none;
    background: transparent; color: inherit;
    padding: 0; max-width: 440px; width: 92vw;
}
.dp-dialog::backdrop { background: rgba(4, 6, 15, .65); backdrop-filter: blur(2px); }
.dp-dialog .panel { margin: 0; }

/* ---------- Cards (.panel family) ---------- */
.panel, .recovery-authorization {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, .022), rgba(255, 255, 255, 0) 40%), var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    margin-bottom: var(--s-5);
    box-shadow: var(--shadow-md);
}
.panel > h2:first-child, .recovery-authorization > h2:first-child { margin-bottom: var(--s-4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.panel-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 10px; }
.panel-head .hint { margin: 0; }
.panel-icon {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
    background: var(--grad-brand-soft); border: 1px solid var(--info-bd); color: var(--cyan-300);
}
.panel-icon svg.lucide { width: 16px; height: 16px; }
.panel.is-featured {
    background: radial-gradient(600px 200px at 0% 0%, rgba(90, 200, 250, .14), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0) 40%), var(--panel);
    border-color: rgba(90, 200, 250, .22);
}
.panel.is-flush { padding: 0; overflow: hidden; }
.panel.is-flush > .panel-head { padding: var(--s-5) var(--s-6) 0; }
.recovery-authorization { margin-top: var(--s-8); scroll-margin-top: calc(var(--s-8) + 70px); transition: box-shadow .3s var(--ease), border-color .3s var(--ease); }
.recovery-authorization.is-highlighted { border-color: var(--info-bd); box-shadow: 0 0 0 3px rgba(90, 200, 250, .25); }

/* KPI / metric cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s-4); margin-bottom: var(--s-5); }
.kpi-card {
    background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.panel .kpi-card { background: rgba(255, 255, 255, .025); }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-label svg.lucide { width: 15px; height: 15px; color: var(--cyan-400); }
.kpi-value { font-family: var(--font-heading); font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi-meta { font-size: 13px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; min-height: 40px;
    border-radius: var(--r-sm);
    background: var(--panel-3); color: var(--text);
    border: 1px solid var(--border-strong);
    font: 600 14px/1.2 var(--font-body);
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease), color .15s var(--ease);
}
.btn:hover { background: #222b4d; border-color: rgba(143, 170, 255, .28); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn svg.lucide { width: 16px; height: 16px; }

.btn-discord, .btn-primary {
    background: var(--grad-brand); border-color: transparent; color: #fff;
    box-shadow: var(--glow-brand), 0 1px 0 rgba(255, 255, 255, .18) inset;
}
.btn-discord:hover, .btn-primary:hover { background: var(--grad-brand); color: #fff; filter: brightness(1.1); border-color: transparent; }
.btn-discord:active, .btn-primary:active { filter: brightness(.95); }

.btn-secondary { background: var(--panel-3); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--border); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-bd); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .5); color: #fecaca; }
.btn-success { background: var(--success-bg); border-color: var(--success-bd); color: #6ee7b7; }
.btn-success:hover { background: rgba(52, 211, 153, .2); color: #a7f3d0; border-color: rgba(52,211,153,.5); }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--link); }
.btn-link:hover { background: none; color: var(--cyan-300); }
.btn-sm { padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; min-height: 48px; font-size: 15px; border-radius: var(--r-md); }
.btn-icon { padding: 0; width: 36px; min-height: 36px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
.panel form { display: flex; flex-direction: column; gap: var(--s-4); max-width: 520px; }
.panel form.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-5); max-width: none; }
.form-grid .span-2 { grid-column: 1 / -1; }
.panel form.form-grid label { justify-content: flex-end; }
.form-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.form-grid .form-actions { grid-column: 1 / -1; padding-top: var(--s-2); }
.panel label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.panel label .hint { font-weight: 500; }

.panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.panel select, .panel textarea {
    width: 100%;
    background: var(--input-bg); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 10px 12px; min-height: 42px;
    font: 500 14px/1.4 var(--font-body);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.panel textarea { resize: vertical; min-height: 72px; }
.panel input::placeholder, .panel textarea::placeholder { color: var(--faint); }
.panel input:hover, .panel select:hover, .panel textarea:hover { border-color: rgba(143, 170, 255, .28); }
.panel input:focus, .panel select:focus, .panel textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 4px var(--accent-ring); background: rgba(5, 8, 18, .9); }
.panel input:user-invalid, .panel select:user-invalid, .panel textarea:user-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, .18); }
.panel select {
    appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a95b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.panel select option { background: var(--panel); color: var(--text); }
.panel input[type="checkbox"], .panel input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.panel fieldset { border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: var(--s-3) var(--s-4) var(--s-4); margin: 0; }
.panel legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.panel button { align-self: flex-start; cursor: pointer; margin-top: 0; }

/* Status line under forms (ids *-status) */
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.hint:empty { display: none; }
.hint.is-success { color: var(--success); }
.hint.is-error { color: var(--danger); }
.hint.is-warning { color: var(--warning); }

/* ---------- Badges (replace 🟢🔴🟡⚪✅❌⏳) ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px 3px 8px; border-radius: var(--r-pill);
    font: 700 12px/1.5 var(--font-body); letter-spacing: .01em; white-space: nowrap;
    background: var(--neutral-bg); color: var(--neutral); border: 1px solid var(--neutral-bd);
}
.badge svg.lucide { width: 13px; height: 13px; stroke-width: 2.4; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.no-dot::before, .badge:has(svg)::before { display: none; }
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-bd); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-bd); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-bd); }
.badge-brand   { background: var(--grad-brand); color: #fff; border-color: transparent; }
.badge-success.is-live::before { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: dp-pulse 2s infinite; }
@keyframes dp-pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.role { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Chips (Discord roles, channels) ---------- */
.chip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--r-pill);
    padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.chip-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color, var(--neutral)); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 calc(var(--s-6) * -1); padding: 0 var(--s-6); }
.product-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.product-table th {
    text-align: left; padding: 10px 14px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
    background: rgba(255, 255, 255, .025);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.product-table th:first-child { border-left: 1px solid var(--border); border-radius: 10px 0 0 10px; }
.product-table th:last-child { border-right: 1px solid var(--border); border-radius: 0 10px 10px 0; }
.product-table td { text-align: left; padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.product-table td:first-child { color: var(--text); font-weight: 600; }
.product-table tbody tr { transition: background .15s var(--ease); }
.product-table tbody tr:hover td { background: rgba(143, 170, 255, .04); }
.product-table tbody tr:last-child td { border-bottom: 0; }
.product-table tr.is-current td { background: rgba(74, 108, 247, .07); }
.product-table td:last-child:not(:first-child) { text-align: right; white-space: nowrap; }
.product-table td:last-child .btn + .btn { margin-left: 6px; }
.product-table .btn { padding: 6px 10px; min-height: 32px; font-size: 13px; }
.product-table .num, .product-table .price { font-weight: 700; color: var(--text); white-space: nowrap; }
.product-table td { white-space: nowrap; }
.product-table input.f-name { width: 130px; min-width: 120px; max-width: none; }
.product-table .muted { color: var(--muted); }
.cell-title { display: flex; flex-direction: column; gap: 2px; }
.cell-title small { color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* ---------- Server list (dashboard/index.php) ---------- */
.server-list { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-3); }
.server-list li {
    display: flex; align-items: center; gap: var(--s-4);
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: var(--s-4) var(--s-5);
    box-shadow: var(--shadow-md);
    transition: border-color .15s var(--ease), transform .15s var(--ease), background .15s var(--ease);
}
.server-list li:hover { border-color: rgba(90, 200, 250, .28); background: var(--panel-2); transform: translateY(-1px); }
.server-list li > a { color: var(--text); font-size: 16px; }
.server-list li > a::after { content: ""; position: absolute; inset: 0; }
.server-list li { position: relative; }
.server-avatar {
    width: 44px; height: 44px; border-radius: 14px; flex: none; overflow: hidden;
    display: grid; place-items: center;
    background: var(--grad-brand); color: #fff; font: 700 17px/1 var(--font-heading);
}
.server-avatar img { width: 100%; height: 100%; object-fit: cover; }
.server-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.server-info a { color: var(--text); font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-info a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.server-chevron { color: var(--faint); }
.server-list li:hover .server-chevron { color: var(--cyan-400); }

/* ---------- Progress (restore.php, plan usage) ---------- */
.progress { position: relative; height: 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .06); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: var(--grad-brand); box-shadow: 0 0 12px rgba(90, 200, 250, .45); transition: width .6s var(--ease); }
.progress-bar.is-warning { background: linear-gradient(90deg, #f59e0b, var(--warning)); box-shadow: 0 0 12px rgba(251, 191, 36, .35); }
.progress-bar.is-danger { background: linear-gradient(90deg, #ef4444, var(--danger)); box-shadow: none; }
.progress.is-running .progress-bar { background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.25) 50%, rgba(255,255,255,0) 100%), var(--grad-brand); background-size: 200% 100%, 100% 100%; animation: dp-shimmer 1.6s linear infinite; }
@keyframes dp-shimmer { from { background-position: 200% 0, 0 0; } to { background-position: -200% 0, 0 0; } }
.progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); font-size: 13px; margin-bottom: 8px; }
.progress-row strong { font-variant-numeric: tabular-nums; color: var(--text); }
.progress-row span { color: var(--text-2); font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }

/* ---------- Wallet ---------- */
.wallet-balance .balance-amount {
    font-family: var(--font-heading); font-size: 40px; font-weight: 700; letter-spacing: -.03em; margin: 4px 0 0;
    background: linear-gradient(90deg, #6ee7b7, var(--cyan-400)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.payout-details { background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; padding: var(--s-3); font-size: 13px; overflow-x: auto; }

details { border-top: 1px solid var(--border); margin-top: var(--s-4); padding-top: var(--s-3); }
details summary { cursor: pointer; color: var(--text-2); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s var(--ease); }
details[open] summary::before { transform: rotate(45deg); }
details summary:hover { color: var(--text); }
details form { margin-top: var(--s-4); }

/* ---------- Toast (top-right, auto-dismiss) ---------- */
.toast-notice {
    position: fixed; top: 20px; right: 20px; z-index: 200;
    display: flex; align-items: center; gap: 12px;
    background: rgba(16, 22, 42, .95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--border-strong); border-radius: 14px;
    padding: 14px 18px; box-shadow: var(--shadow-lg);
    max-width: min(360px, calc(100vw - 40px));
    animation: toast-in .3s var(--ease);
}
.toast-notice.is-leaving { animation: toast-out .25s var(--ease) forwards; }
.toast-notice .toast-icon {
    width: 36px; height: 36px; border-radius: 10px; flex: none;
    display: grid; place-items: center; background: var(--info-bg); color: var(--cyan-400);
}
.toast-notice.is-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-notice.is-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast-notice strong { display: block; font-size: 14px; color: var(--text); }
.toast-notice span { font-size: 13px; color: var(--muted); }
@keyframes toast-in { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateY(-16px); opacity: 0; } }
@media (max-width: 720px) {
    .toast-notice { top: 12px; right: 12px; left: 12px; max-width: none; }
}

/* ---------- Landing / checkout status ---------- */
.landing { max-width: 640px; margin: 14vh auto; text-align: center; padding: 0 20px; }
.landing h1 { font-size: clamp(34px, 6vw, 52px); letter-spacing: -.035em; }
.landing p { color: var(--text-2); font-size: 17px; }
.landing .logo { width: 88px; height: 88px; filter: drop-shadow(0 12px 32px rgba(74, 108, 247, .55)); }
.status-screen { max-width: 460px; margin: 12vh auto; padding: 0 20px; text-align: center; }
.status-screen .status-icon { width: 64px; height: 64px; border-radius: 20px; display: inline-grid; place-items: center; margin-bottom: var(--s-4); }
.status-screen .status-icon svg.lucide { width: 30px; height: 30px; }
.status-icon.is-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bd); }
.status-icon.is-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-bd); }
.status-icon.is-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-bd); }
.status-icon.is-neutral { background: var(--neutral-bg); color: var(--neutral); border: 1px solid var(--neutral-bd); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: var(--s-8) var(--s-4); color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r-md); }

/* ---------- Server hub tiles (server.php: <p class="nav-tiles"> around the .btn links) ---------- */
.nav-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--s-3); margin: var(--s-5) 0 var(--s-6); }
.nav-tiles .btn {
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px;
    min-height: 92px; padding: var(--s-4); border-radius: var(--r-md);
    background: var(--panel); border-color: var(--border); box-shadow: var(--shadow-md); white-space: normal; text-align: left;
}
.nav-tiles .btn svg.lucide { width: 20px; height: 20px; padding: 7px; box-sizing: content-box; border-radius: 10px; background: var(--grad-brand-soft); color: var(--cyan-300); border: 1px solid var(--info-bd); }
.nav-tiles .btn:hover { background: var(--panel-2); border-color: rgba(90, 200, 250, .3); transform: translateY(-1px); }

/* Title row with status badge (server.php h1) */
.title-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: 6px; }
.title-row h1 { margin: 0; }

/* Definition-style stats inside panels (sync info, payout meta) */
.meta-list { list-style: none; padding: 0; margin: 0 0 var(--s-4); display: grid; gap: var(--s-2); }
.meta-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.meta-list li svg.lucide { width: 16px; height: 16px; color: var(--cyan-400); }
.meta-list strong { color: var(--text); }
.meta-list .hint { margin: 0; }

/* Inline checkbox label */
.panel label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }

/* Chip variants */
.chip-list li.is-default { border-color: var(--info-bd); background: var(--grad-brand-soft); color: var(--text); }
.chip-list li.is-default::before { background: var(--cyan-400); }
.chip-list li .role { font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 500; }

/* Admin sub-navigation (<p class="admin-nav"> with links separated by " · ") */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s-6); font-size: 0; padding: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); }
.admin-nav a { font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 8px 12px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; }
.admin-nav a:hover { background: var(--panel-3); color: var(--text); }
.admin-nav a.is-active { background: var(--grad-brand); color: #fff; box-shadow: var(--glow-brand); }
.admin-nav a svg.lucide { width: 15px; height: 15px; }

/* Generic in-page tabs (<div class="tab-nav">) - same pill look as
   admin-nav but made of <button>s that toggle <section data-tab-panel> via
   JS instead of navigating to another page. */
.tab-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s-6); padding: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); }
.tab-btn {
    font: 600 13.5px/1.2 var(--font-body); color: var(--text-2); padding: 8px 14px; border-radius: 9px;
    display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.tab-btn:hover { background: var(--panel-3); color: var(--text); }
.tab-btn.is-active { background: var(--grad-brand); color: #fff; box-shadow: var(--glow-brand); }
.tab-btn svg.lucide { width: 15px; height: 15px; }
.tab-panel[hidden] { display: none; }
@media (max-width: 720px) {
    .tab-nav { flex-wrap: nowrap; overflow-x: auto; }
    .tab-btn { white-space: nowrap; }
}

/* Filter/search forms outside panels (users.php, audit-logs.php): <form class="toolbar"> */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin: 0 0 var(--s-5); }
.toolbar label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.toolbar input, .toolbar select, .product-table input:not([type="checkbox"]), .product-table select {
    background: var(--input-bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 9px 12px; min-height: 40px; font: 500 14px/1.4 var(--font-body);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.toolbar input { min-width: min(100%, 300px); }
.product-table input:not([type="checkbox"]), .product-table select { min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 8px; max-width: 120px; }
.product-table select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a95b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.product-table input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.toolbar input:focus, .toolbar select:focus, .product-table input:focus, .product-table select:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 4px var(--accent-ring); }
.toolbar input::placeholder, .product-table input::placeholder { color: var(--faint); }
.inline-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

/* Row actions combo (<div class="dropdown"><button class="dropdown-toggle">…
   <div class="dropdown-menu">…</div></div>) - groups several row actions
   (message/remove/ban, etc.) behind one button instead of a row of buttons. */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle svg.lucide { width: 14px; height: 14px; transition: transform .15s var(--ease); }
.dropdown.is-open .dropdown-toggle svg.lucide.chevron { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
    min-width: 180px; padding: 6px; margin: 0;
    background: var(--panel-3); border: 1px solid var(--border-strong); border-radius: var(--r-md);
    box-shadow: var(--shadow-lg); display: none;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu button, .dropdown-menu a {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 10px; border-radius: 8px; border: none; background: none;
    font: 600 13px/1.3 var(--font-body); color: var(--text-2); text-align: left; cursor: pointer;
    text-decoration: none; box-sizing: border-box;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--panel-2); color: var(--text); }
.dropdown-menu button.is-danger { color: #fca5a5; }
.dropdown-menu button.is-danger:hover { background: rgba(248, 113, 113, .12); color: #fecaca; }
.dropdown-menu button svg.lucide, .dropdown-menu a svg.lucide { width: 15px; height: 15px; }
.dropdown-menu .dropdown-divider { height: 1px; margin: 6px 4px; background: var(--border); }
.product-table select.f-plan { width: 110px; min-width: 110px; max-width: none; }
.product-table input.f-days { width: 90px; min-width: 90px; max-width: none; }

/* Monospace IDs */
.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.product-table td.mono { color: var(--muted); font-weight: 400; }
.product-table details { border: 0; margin: 0; padding: 0; }
.product-table details pre { white-space: pre-wrap; max-width: 360px; margin: 8px 0 0; padding: 10px; border-radius: 8px; background: var(--input-bg); border: 1px solid var(--border); font-size: 12px; }

/* Pagination (audit-logs.php): <p class="hint pagination"> */
.pagination { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; font-size: 0; }
.pagination > * , .pagination { font-size: 13px; }
.pagination a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel-3); color: var(--text); font-weight: 600; }
.pagination a:hover { background: #222b4d; color: var(--text); }

/* Payout review card (admin/payouts.php) */
.amount-lg { font-family: var(--font-heading); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    body { font-size: 14.5px; }
    h1 { font-size: 24px; }
    .topbar { padding: 10px 14px; gap: 4px; }
    .topbar span { display: none; }
    .topbar strong { margin-right: auto; }
    .topbar a:not(.brand) { padding: 8px 10px; }
    .topbar .brand { margin-right: auto; }
    .dashboard { padding: var(--s-5) 14px var(--s-10); }
    .panel, .recovery-authorization { padding: var(--s-5) var(--s-4); border-radius: 14px; }
    .table-wrap { margin: 0 calc(var(--s-4) * -1); padding: 0 var(--s-4); }
    .panel form.form-grid { grid-template-columns: minmax(0, 1fr); }
    .panel form { max-width: none; }
    .panel form > .btn, .form-actions .btn { width: 100%; }
    .panel button { align-self: stretch; }
    .product-table td:last-child .btn { width: auto; }
    .product-table:not(.table-wrap .product-table) { display: block; overflow-x: auto; white-space: nowrap; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
    .kpi-value { font-size: 22px; }
    .server-list li { padding: var(--s-3) var(--s-4); gap: var(--s-3); }
    .server-list .badge { padding: 3px 8px 3px 6px; font-size: 11px; }
    .page-head .btn { width: 100%; }
    .nav-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-tiles .btn { width: auto; min-height: 84px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar input { min-width: 0; width: 100%; }
    .admin-nav { flex-wrap: nowrap; overflow-x: auto; }
    .admin-nav a { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
