/* =========================================================================
   MonarchRP Admin — sleek modern dark glassmorphism.
   Calm near-black field, frosted glass surfaces, gold accents, no loud
   colour gradients. Matches the sign-in screen.
   ========================================================================= */
:root {
    --bg:         #05070f;
    --gold:       #d9b768;
    --gold-bright:#f4dca0;

    --ink:        #eef2ff;
    --ink-dim:    rgba(223, 230, 250, 0.60);
    --ink-faint:  rgba(223, 230, 250, 0.34);

    /* glass surfaces */
    --glass-1:    rgba(255, 255, 255, 0.045);   /* primary card */
    --glass-2:    rgba(255, 255, 255, 0.035);   /* nested / hover */
    --glass-3:    rgba(0, 0, 0, 0.28);          /* inputs / wells */
    --line:       rgba(255, 255, 255, 0.08);
    --line-soft:  rgba(255, 255, 255, 0.05);
    --gold-line:  rgba(244, 220, 160, 0.22);

    --ok:   #66e29a;
    --warn: #f5c451;
    --bad:  #f06464;
    --idle: #8390b8;

    --radius:    18px;
    --radius-sm: 13px;
    --blur: 34px;
    --sidebar-w: 250px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: rgba(244, 220, 160, 0.25); }

/* ----- Deep dark backdrop (flat, no gradient) ----- */
.bg-shader {
    position: fixed; inset: 0; z-index: -2;
    background: var(--bg);
}
.bg-vignette {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

/* ----- Layout ----- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; align-self: flex-start;
    width: var(--sidebar-w); height: 100vh;
    flex: 0 0 var(--sidebar-w);
    display: flex; flex-direction: column;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.028);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(var(--blur)) saturate(135%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
}
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 12px 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line-soft);
}
.brand-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--gold-bright);
    box-shadow: 0 0 14px rgba(244, 220, 160, 0.7);
    flex: 0 0 auto;
}
.brand-text { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.brand-text b { color: var(--gold-bright); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    color: var(--ink-dim); text-decoration: none;
    font-size: 14px; font-weight: 500;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: var(--glass-2); color: var(--ink); }
.nav-item.is-active {
    background: rgba(244, 220, 160, 0.07);
    border-color: var(--gold-line);
    color: #fff;
}
.nav-item.is-active::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 3px;
    background: var(--gold-bright); box-shadow: 0 0 10px rgba(244, 220, 160, 0.6);
}
.nav-ico {
    width: 8px; height: 8px; border-radius: 2.5px; flex: 0 0 auto;
    background: var(--idle); transition: background .15s;
}
.nav-item:hover .nav-ico { background: var(--ink-dim); }
.nav-item.is-active .nav-ico { background: var(--gold-bright); }

.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.who { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.who-avatar {
    width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center; font-weight: 700; font-size: 16px;
    color: var(--gold-bright);
    background: rgba(244, 220, 160, 0.10);
    border: 1px solid var(--gold-line);
}
.who-meta { display: flex; flex-direction: column; line-height: 1.25; }
.who-name { font-weight: 600; font-size: 14px; }
.who-role { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1.2px; }

/* ----- Main / topbar ----- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 22px 32px;
    border-bottom: 1px solid var(--line-soft);
}
.hamburger {
    display: none; font-size: 22px; background: none; border: none;
    color: var(--ink); cursor: pointer;
}
.topbar-title h1 { font-size: 23px; font-weight: 800; letter-spacing: 0.2px; }
.topbar-title .crumb { font-size: 11px; color: var(--ink-faint); letter-spacing: 2.5px; text-transform: uppercase; }
.topbar-right { margin-left: auto; }
.clock {
    font-variant-numeric: tabular-nums; color: var(--ink-dim);
    font-size: 13px; padding: 8px 15px; border-radius: 30px;
    background: var(--glass-1); border: 1px solid var(--line);
}

.content { padding: 30px 32px; flex: 1; }
.pagefoot {
    display: flex; justify-content: space-between;
    padding: 18px 32px; font-size: 12px; color: var(--ink-faint);
    border-top: 1px solid var(--line-soft);
}
.pagefoot b { color: var(--ink-dim); }

/* ----- Glass card ----- */
.card {
    position: relative;
    background: var(--glass-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(var(--blur)) saturate(135%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 24px 26px;
    transition: border-color .18s;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; gap: 12px;
}
.card-head h2 { font-size: 15.5px; font-weight: 700; letter-spacing: 0.2px; }
.card-head .sub { font-size: 12px; color: var(--ink-faint); }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ----- Stat tiles ----- */
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat .stat-k { font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink-faint); }
.stat .stat-v { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.stat .stat-v.gold { color: var(--gold-bright); }
.stat .stat-sub { font-size: 12px; color: var(--ink-dim); }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
    text-align: left; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--ink-faint); font-weight: 600; padding: 12px 14px;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-dim); }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover td { background: rgba(255, 255, 255, 0.022); color: var(--ink); }
table.tbl tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-faint); }
.empty .big { font-size: 15px; color: var(--ink-dim); margin-bottom: 6px; }

/* ----- Pills ----- */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
    padding: 4px 11px; border-radius: 30px; text-transform: capitalize;
    border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok   { color: var(--ok);   background: rgba(102, 226, 154, 0.10); border-color: rgba(102, 226, 154, 0.22); }
.pill.warn { color: var(--warn); background: rgba(245, 196, 81, 0.10);  border-color: rgba(245, 196, 81, 0.22); }
.pill.bad  { color: var(--bad);  background: rgba(240, 100, 100, 0.10); border-color: rgba(240, 100, 100, 0.22); }
.pill.idle { color: var(--idle); background: rgba(131, 144, 184, 0.10); border-color: rgba(131, 144, 184, 0.22); }

.tag-soon {
    font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--gold-bright); background: rgba(244, 220, 160, 0.10);
    border: 1px solid var(--gold-line); padding: 3px 9px; border-radius: 20px;
}

/* ----- Buttons (gradient-free) ----- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    padding: 10px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); color: var(--ink);
    background: var(--glass-1); text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--glass-2); border-color: rgba(255, 255, 255, 0.16); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-primary {
    color: #f6efdc; background: rgba(244, 220, 160, 0.11);
    border-color: rgba(244, 220, 160, 0.42);
}
.btn-primary:hover { background: rgba(244, 220, 160, 0.18); border-color: rgba(244, 220, 160, 0.65); }
.btn-gold {
    color: #100a02; font-weight: 700;
    background: var(--gold-bright); border-color: transparent;
}
.btn-gold:hover { background: #fff0cf; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--glass-2); }
.btn-danger { color: var(--bad); border-color: rgba(240, 100, 100, 0.28); background: rgba(240, 100, 100, 0.06); }
.btn-danger:hover { background: rgba(240, 100, 100, 0.14); border-color: rgba(240, 100, 100, 0.5); }

/* ----- Forms ----- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11.5px; color: var(--ink-dim); margin-bottom: 8px; letter-spacing: 0.6px; }
.input, textarea.input, select.input {
    width: 100%; font-size: 14px; color: var(--ink);
    background: var(--glass-3); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 12px 14px; outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s; font-family: inherit;
}
.input::placeholder, textarea.input::placeholder { color: var(--ink-faint); }
.input:focus, textarea.input:focus, select.input:focus {
    border-color: rgba(244, 220, 160, 0.55);
    background: rgba(0, 0, 0, 0.36);
    box-shadow: 0 0 0 3px rgba(217, 183, 104, 0.14);
}
textarea.input { resize: vertical; min-height: 90px; }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }
.help { font-size: 12px; color: var(--ink-faint); margin-top: 6px; line-height: 1.5; }

/* ----- Flash ----- */
.flash {
    padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
    font-size: 14px; border: 1px solid var(--line); background: var(--glass-1);
}
.flash-success { border-color: rgba(102, 226, 154, 0.3); background: rgba(102, 226, 154, 0.07); }
.flash-error   { border-color: rgba(240, 100, 100, 0.3); background: rgba(240, 100, 100, 0.07); }
.flash-info    { border-color: var(--gold-line); background: rgba(244, 220, 160, 0.07); }

/* ----- Mini progress ----- */
.mini-bar { height: 7px; border-radius: 8px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.mini-bar > span {
    display: block; height: 100%; border-radius: 8px;
    background: var(--gold); box-shadow: 0 0 12px rgba(217, 183, 104, 0.45);
}

/* ----- Legacy auth card (change-password / setup-2fa / install) ----- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
    width: min(420px, 94vw);
    background: var(--glass-1);
    border: 1px solid var(--line); border-radius: 22px;
    backdrop-filter: blur(40px) saturate(135%);
    -webkit-backdrop-filter: blur(40px) saturate(135%);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    padding: 40px 36px; position: relative; overflow: hidden;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.auth-brand .brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 14px rgba(244,220,160,0.7); }
.auth-brand h1 { font-size: 22px; font-weight: 800; }
.auth-brand h1 b { color: var(--gold-bright); }
.auth-sub { color: var(--ink-faint); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 26px; }
.qr-box { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: var(--radius-sm); width: max-content; margin: 0 auto 16px; }
.secret-code {
    font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: 2px;
    text-align: center; padding: 12px; border-radius: var(--radius-sm);
    background: var(--glass-3); border: 1px dashed var(--line); color: var(--gold-bright);
    word-break: break-all; margin-bottom: 18px;
}
.otp-input { text-align: center; font-size: 24px; letter-spacing: 12px; font-family: ui-monospace, Consolas, monospace; }

/* ----- Utilities ----- */
.mb-0 { margin-bottom: 0; }
.mt-18 { margin-top: 18px; }
.muted { color: var(--ink-faint); }
.gold { color: var(--gold-bright); }
.right { text-align: right; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.list-actions { display: flex; gap: 8px; align-items: center; }

/* ----- Terminal-style console (server / chat logs) ----- */
.console-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.console-bar .live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-dim); }
.console-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 9px var(--ok); animation: cpulse 1.4s ease-in-out infinite; }
@keyframes cpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.console {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 12.5px; line-height: 1.7;
    background: #03060f;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px; height: 560px; overflow-y: auto;
    box-shadow: inset 0 2px 14px rgba(0,0,0,0.6);
}
.console::-webkit-scrollbar { width: 10px; }
.console::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 8px; }
.cl-line { display: block; padding: 1px 2px; color: var(--ink-dim); border-radius: 3px; }
.cl-line:hover { background: rgba(255,255,255,0.035); }
.cl-time { color: var(--ink-faint); margin-right: 10px; }
.cl-cat  { margin-right: 8px; font-weight: 700; }
.cl-msg  { color: var(--ink); }
.cl-who  { color: var(--ink-faint); margin-left: 8px; }
.cl-name { color: var(--gold-bright); margin-right: 4px; font-weight: 600; }
.cl-name.team { color: var(--ok); }
.cat-connect    { color: var(--ok); }
.cat-disconnect { color: #f5a35a; }
.cat-death      { color: var(--bad); }
.cat-system,
.cat-manual     { color: var(--gold-bright); }
.cat-test       { color: var(--idle); }
.cat-economy,
.cat-chat       { color: #7db0ff; }
.cat-general    { color: var(--idle); }

/* ----- Player cards + tools (Server Connection) ----- */
.pl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pl-card { background: var(--glass-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.pl-card.is-online { border-color: rgba(102, 226, 154, 0.28); }
.pl-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pl-name { font-size: 16px; font-weight: 700; }
.pl-sid { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--ink-faint); }
.pl-job { font-size: 13px; color: var(--gold-bright); font-weight: 600; }
.pl-money { font-size: 12.5px; color: var(--ink-dim); }
.pl-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pl-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--ink-dim);
    background: var(--glass-3); border: 1px solid var(--line);
    border-radius: 9px; padding: 6px 10px;
}
.pl-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-chip .hpbar { width: 46px; height: 5px; border-radius: 5px; background: rgba(0,0,0,0.4); overflow: hidden; }
.pl-chip .hpbar > span { display: block; height: 100%; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pl-actions .btn { padding: 6px 11px; font-size: 12px; }
.pl-weapons { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; word-break: break-word; }

/* toast */
#toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 80;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
#toast .t {
    padding: 11px 16px; border-radius: 12px; font-size: 13.5px;
    background: rgba(16,22,42,0.95); border: 1px solid var(--gold-line);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5); color: var(--ink);
    animation: tin .2s ease both;
}
#toast .t.ok  { border-color: rgba(102,226,154,0.5); }
#toast .t.bad { border-color: rgba(240,100,100,0.5); }
@keyframes tin { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

@media (max-width: 900px) { .pl-grid { grid-template-columns: 1fr; } }

/* ----- Responsive ----- */
@media (max-width: 1024px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 880px) {
    .sidebar {
        position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.open { transform: none; }
    .hamburger { display: block; }
    .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .grid.cols-4 { grid-template-columns: 1fr; }
    .content, .topbar { padding-left: 18px; padding-right: 18px; }
}
