:root {
    --bg: #080808;
    --bg-soft: #101010;
    --panel: rgba(18, 18, 18, 0.78);
    --panel-strong: rgba(22, 22, 22, 0.94);
    --gold: #c9a962;
    --gold-light: #ead8aa;
    --gold-dim: rgba(201, 169, 98, 0.14);
    --green: #3d9b5f;
    --red: #e05252;
    --blue: #4f83ff;
    --text: #f6f1e7;
    --muted: #8c867a;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
    --radius: 22px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }

body.premium-body,
body.admin-body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: 'Inter', 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(ellipse 70% 45% at 15% -10%, rgba(201, 169, 98, 0.16), transparent 55%),
        radial-gradient(ellipse 55% 38% at 100% 100%, rgba(61, 155, 95, 0.10), transparent 55%),
        var(--bg);
}

.premium-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.auth-card,
.admin-card {
    width: min(100%, 430px);
    padding: 38px;
    border: 1px solid rgba(201, 169, 98, 0.18);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(26px);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: riseIn 0.55s ease both;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 20px;
    border-radius: 18px;
    color: #1a160d;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: 0 12px 36px rgba(201,169,98,0.24);
}

.auth-title,
.admin-title {
    margin: 0;
    font-size: clamp(28px, 5vw, 38px);
    letter-spacing: -0.04em;
    line-height: 1;
}

.gradient-text {
    background: linear-gradient(135deg, #fff, var(--gold-light) 45%, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle,
.admin-subtitle {
    margin: 12px 0 30px;
    color: var(--muted);
    line-height: 1.55;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.premium-input,
.premium-select {
    width: 100%;
    min-height: 48px;
    padding: 13px 15px;
    color: var(--text);
    font: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    background: rgba(0,0,0,0.34);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.premium-input:focus,
.premium-select:focus {
    border-color: rgba(201,169,98,0.48);
    box-shadow: 0 0 0 4px rgba(201,169,98,0.12);
}

.premium-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 13px 18px;
    border: 0;
    border-radius: var(--radius-sm);
    color: #16110a;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: 0 12px 32px rgba(201,169,98,0.18);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.premium-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(201,169,98,0.24); }
.premium-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.premium-btn.secondary { color: var(--text); background: rgba(255,255,255,0.07); box-shadow: none; border: 1px solid var(--border); }
.premium-btn.danger { color: #fff; background: linear-gradient(135deg, #e05252, #a92f2f); }

.full-width { width: 100%; }
.stack { display: grid; gap: 16px; }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form > * { flex: 1 1 180px; }

.alert {
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.45;
    animation: riseIn .25s ease both;
}
.alert.error { color: #ffd5d5; background: rgba(224,82,82,0.13); border: 1px solid rgba(224,82,82,0.32); }
.alert.success { color: #d8ffe4; background: rgba(61,155,95,0.13); border: 1px solid rgba(61,155,95,0.32); }

.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0; }
.admin-card { width: 100%; padding: 26px; margin-bottom: 18px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.admin-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; }
.premium-table { width: 100%; border-collapse: collapse; min-width: 760px; background: rgba(0,0,0,0.22); }
.premium-table th,
.premium-table td { padding: 15px 16px; border-bottom: 1px solid var(--border); text-align: left; }
.premium-table th { color: var(--gold); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; background: rgba(201,169,98,0.07); }
.premium-table tr:hover td { background: rgba(255,255,255,0.025); }
.mono { font-family: 'JetBrains Mono', 'Consolas', monospace; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.status-pill.active { color: #d8ffe4; background: rgba(61,155,95,0.12); }
.status-pill.expired { color: #ffd5d5; background: rgba(224,82,82,0.12); }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pagination a,
.pagination span {
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
}
.pagination .current { color: #15110a; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }

.loading-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,.22);
    border-top-color: rgba(0,0,0,.8);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.is-loading .loading-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
    .auth-card, .admin-card { padding: 24px; border-radius: 18px; }
    .admin-grid { grid-template-columns: 1fr; }
    .admin-shell { width: min(100% - 20px, 1180px); padding: 18px 0; }
    .inline-form { display: grid; }
}
