:root {
    --bg: #0c0d11;
    --bg-soft: #12141a;
    --surface: #171920;
    --surface-2: #1d2028;
    --surface-3: #252832;
    --line: #2d303a;
    --text: #f2eee6;
    --muted: #9698a2;
    --gold: #d7a94a;
    --gold-bright: #f0c66a;
    --wine: #6f2737;
    --success: #63c791;
    --warning: #e2b65d;
    --danger: #e57979;
    --info: #75a9d8;
    --radius: 16px;
    --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }

.auth-body { overflow: hidden; }
.auth-layout { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; isolation: isolate; background: radial-gradient(circle at 50% -20%, rgba(215,169,74,.10), transparent 42%), var(--bg); }
.ambient { position: absolute; border-radius: 999px; filter: blur(100px); opacity: .18; z-index: -1; }
.ambient.a { width: 360px; height: 360px; background: var(--wine); left: 8%; top: 15%; }
.ambient.b { width: 300px; height: 300px; background: var(--gold); right: 10%; bottom: 10%; opacity: .08; }
.auth-card { width: min(460px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: rgba(23,25,32,.94); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card h1 { margin: 14px 0 8px; font-size: clamp(1.8rem, 4vw, 2.35rem); letter-spacing: -.04em; }
.brand-mark { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; letter-spacing: -.05em; color: #15120c; background: linear-gradient(145deg, var(--gold-bright), #aa7c2a); box-shadow: 0 12px 30px rgba(215,169,74,.18); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; font-size: .9rem; flex: 0 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; font-weight: 800; color: var(--gold); }
.muted { color: var(--muted); line-height: 1.65; }
.micro { margin: 16px 0 0; color: #737680; font-size: .78rem; line-height: 1.5; }

.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: .82rem; color: #c7c3bb; font-weight: 650; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #101218; color: var(--text); padding: 12px 13px; outline: none; transition: border-color .16s, box-shadow .16s; }
.field input:focus, .field select:focus { border-color: #8f753e; box-shadow: 0 0 0 3px rgba(215,169,74,.09); }

.button { border: 1px solid var(--line); background: var(--surface-3); border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 720; font-size: .86rem; transition: transform .12s, border-color .12s, background .12s; }
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: #494d59; }
.button.primary { border-color: #b38735; background: linear-gradient(180deg, #e2b85e, #bd8d34); color: #19140b; }
.button.ghost { background: transparent; }
.button.full { width: 100%; padding: 12px 16px; }
.button.small { padding: 7px 10px; font-size: .76rem; }
.button.disabled, .button:disabled { opacity: .42; cursor: not-allowed; }
.inline { display: inline; }

.notice { border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; margin: 16px 0; line-height: 1.5; background: var(--surface-2); font-size: .88rem; }
.notice.success { border-color: rgba(99,199,145,.35); background: rgba(99,199,145,.08); }
.notice.error { border-color: rgba(229,121,121,.4); background: rgba(229,121,121,.08); }
.notice.warning { border-color: rgba(226,182,93,.4); background: rgba(226,182,93,.08); }
.notice.info { border-color: rgba(117,169,216,.38); background: rgba(117,169,216,.07); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 20px 14px 16px; border-right: 1px solid #22242c; background: #101116; z-index: 20; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.sidebar-brand strong { display: block; font-size: .95rem; }
.sidebar-brand span { display: block; margin-top: 2px; color: #747680; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 4px; min-height: 0; flex: 1; }
.nav-spacer { flex: 1; min-height: 20px; }
.nav-label { padding: 22px 12px 7px; color: #5f626c; font-size: .62rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 11px; color: #a5a6ae; border: 1px solid transparent; border-radius: 10px; font-size: .85rem; font-weight: 650; }
.nav-item:hover { color: #e9e5dd; background: rgba(255,255,255,.025); }
.nav-item.active { color: #f2e8d3; border-color: rgba(215,169,74,.18); background: linear-gradient(90deg, rgba(215,169,74,.12), rgba(215,169,74,.03)); }
.nav-icon { width: 22px; color: #7f818b; text-align: center; }
.nav-item.active .nav-icon { color: var(--gold); }
.sidebar-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid #23252d; padding: 15px 6px 0; margin-top: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #272a33; color: var(--gold-bright); font-weight: 800; font-size: .8rem; }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.sidebar-user-copy span { display: block; color: #656872; font-size: .62rem; letter-spacing: .1em; margin-top: 2px; }
.logout-form { margin: 0; }
.logout-button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: #747680; cursor: pointer; font-size: 1rem; }
.logout-button:hover { background: #22242b; color: var(--text); }

.main { min-width: 0; }
.topbar { height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid #20222a; background: rgba(12,13,17,.84); backdrop-filter: blur(15px); position: sticky; top: 0; z-index: 10; }
.crumb { color: #aaa9a5; font-size: .82rem; font-weight: 650; }
.topbar-right { margin-left: auto; }
.secure { font-size: .69rem; color: #70737d; letter-spacing: .07em; }
.secure::first-letter { color: var(--success); }
.mobile-nav { display: none; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 36px 38px 70px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.page-head h1 { margin: 5px 0 4px; font-size: clamp(1.85rem, 3vw, 2.65rem); letter-spacing: -.045em; }
.page-head p { margin: 0; max-width: 720px; }
.status-pill { display: inline-flex; gap: 8px; align-items: center; padding: 8px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: #a9a9a5; font-size: .72rem; white-space: nowrap; }
.dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 14px rgba(99,199,145,.6); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, #181a21, #14161c); transition: transform .14s, border-color .14s; }
.stat-card:hover { transform: translateY(-2px); border-color: #3b3e48; }
.stat-label { color: #8b8d96; font-size: .76rem; font-weight: 700; }
.stat-value { margin: 12px 0 13px; font-size: 2.2rem; line-height: 1; font-weight: 850; letter-spacing: -.05em; }
.stat-sub { display: flex; justify-content: space-between; gap: 8px; color: #70727b; font-size: .72rem; }
.stat-sub span { color: var(--gold); }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-top: 18px; }
.panel.narrow { max-width: 680px; padding-bottom: 22px; }
.panel.narrow form { padding: 0 22px; max-width: 520px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-title h2 { margin: 0; font-size: 1rem; }
.panel-title p { margin: 4px 0 0; color: #7f818a; font-size: .76rem; }
.roadmap { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.roadmap-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roadmap-item:nth-child(2n) { border-right: 0; }
.roadmap-number { color: #545762; font-size: .7rem; font-weight: 800; }
.roadmap-title { font-weight: 800; font-size: .9rem; }
.roadmap-item p { margin: 7px 0 0; color: #777983; line-height: 1.55; font-size: .76rem; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 18px; border-bottom: 1px solid #292b34; text-align: left; vertical-align: middle; }
th { color: #696c76; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; background: #15171d; }
td { color: #c7c5c0; font-size: .79rem; }
tbody tr:hover { background: rgba(255,255,255,.014); }
.sub { color: #70727b; font-size: .68rem; margin-top: 4px; }
.actions { text-align: right; white-space: nowrap; }
.actions .button { margin-left: 5px; }
.empty-cell { padding: 44px; text-align: center; color: #747680; }
.badge { display: inline-flex; align-items: center; border: 1px solid #3b3e47; border-radius: 999px; padding: 4px 8px; font-size: .62rem; font-weight: 800; letter-spacing: .04em; color: #a8a9af; }
.badge.success { border-color: rgba(99,199,145,.3); background: rgba(99,199,145,.08); color: #87d8aa; }
.badge.warning { border-color: rgba(226,182,93,.3); background: rgba(226,182,93,.08); color: #e5c477; }
.badge.danger { border-color: rgba(229,121,121,.3); background: rgba(229,121,121,.08); color: #e99393; }

.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.detail-card { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 18px; }
.detail-card span { color: #72747d; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.detail-card strong { font-size: 1.2rem; }
.detail-card small { color: #737680; }
.empty-state { min-height: 360px; display: grid; place-items: center; align-content: center; text-align: center; padding: 44px; }
.empty-state h2 { margin: 12px 0 2px; }
.empty-state p { max-width: 540px; color: #777983; line-height: 1.6; }
.empty-orb { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid #3a3d47; border-radius: 50%; background: #20232b; color: var(--gold); font-size: 1.5rem; }

.modal { width: min(520px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 18px; padding: 0; background: #181a20; color: var(--text); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.modal form { padding: 0 22px 22px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px; }
.modal-head h2 { margin: 4px 0 0; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: transparent; font-size: 1.25rem; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px; }

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

@media (max-width: 780px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: -272px; width: 256px; transition: left .18s ease; box-shadow: var(--shadow); }
    .sidebar-open .sidebar { left: 0; }
    .mobile-nav { display: inline-grid; place-items: center; }
    .content { padding: 26px 18px 56px; }
    .topbar { padding: 0 18px; }
    .page-head { flex-direction: column; }
    .stats-grid, .detail-grid, .roadmap { grid-template-columns: 1fr; }
    .roadmap-item, .roadmap-item:nth-child(2n) { border-right: 0; }
    .auth-card { padding: 28px 22px; }
}


.status-pill.status-error { border-color: rgba(229,121,121,.35); color: #e99393; }
.file-field input[type="file"] { padding: 10px; background: #12141a; }
.file-field small { color: #737680; font-size: .72rem; }
.system-checks { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; }
.system-check { display: flex; justify-content: space-between; gap: 18px; padding: 15px 22px; border-bottom: 1px solid var(--line); }
.system-check:nth-child(odd) { border-right: 1px solid var(--line); }
.system-check span { color: #999ba3; font-size: .8rem; }
.system-check strong { font-size: .75rem; }
.check-ok { color: #87d8aa; }
.check-bad { color: #e99393; }
@media (max-width: 780px) {
    .system-checks { grid-template-columns: 1fr; }
    .system-check:nth-child(odd) { border-right: 0; }
}
