:root {
    color-scheme: dark;
    --bg: #070b10;
    --surface: rgba(15, 21, 29, .94);
    --surface-solid: #111821;
    --surface-2: #18212c;
    --line: rgba(160, 180, 194, .18);
    --line-strong: rgba(173, 202, 216, .3);
    --text: #f4f7f8;
    --muted: #98a6af;
    --cyan: #51c4e6;
    --cyan-soft: #a4e8f7;
    --grass: #69b657;
    --grass-soft: #a4dc8d;
    --stone: #65727d;
    --red: #f0747d;
    --shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background-color: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body.layout-auth { background-image: linear-gradient(180deg, rgba(3, 7, 12, .2) 0, rgba(3, 7, 12, .76) 340px, #070b10 760px), url("/assets/images/voxel-panorama.png"); background-position: center top, center top; background-size: cover, max(1380px, 100vw) auto; background-repeat: no-repeat; background-attachment: fixed; }
body.layout-panel { background-image: linear-gradient(rgba(5, 9, 14, .9), rgba(5, 9, 14, .96)), url("/assets/images/voxel-panorama.png"); background-position: center; background-size: cover; background-attachment: fixed; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(115, 207, 232, .42); border-radius: 11px; background: linear-gradient(145deg, rgba(56, 112, 132, .8), rgba(13, 26, 36, .94)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 9px 24px rgba(0, 0, 0, .28); }
.pixel-cloud { position: relative; display: block; width: 6px; height: 6px; margin: 6px 12px 0 0; background: var(--cyan-soft); box-shadow: 6px -6px 0 var(--cyan-soft), 12px -6px 0 #d1f6ff, 6px 0 0 var(--cyan-soft), 12px 0 0 var(--cyan-soft), 18px 0 0 var(--cyan), 0 6px 0 var(--cyan), 6px 6px 0 var(--cyan), 12px 6px 0 var(--cyan), 18px 6px 0 #3299b8; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .55)); }
.pixel-cloud.large { margin: 0 24px 0 0; transform: scale(1.8); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: #aab8c1; font-size: 10px; }

.auth-shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 28px; }
.auth-brand { margin: 0 0 26px 4px; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.installer-card, .login-card { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.installer-card { padding: 38px; }
.login-card { width: min(470px, 100%); margin: 8vh auto 0; padding: 38px; }
.installer-header { margin: -38px -38px 28px; padding: 44px 38px 36px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(7, 13, 19, .94), rgba(7, 13, 19, .55)), url("/assets/images/voxel-panorama.png") center 48% / cover no-repeat; }
.installer-header > * { max-width: 700px; }
.step-label, .eyebrow { color: var(--cyan-soft); font-size: 10px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.installer-header h1, .login-card h1 { margin: 8px 0 10px; font-size: clamp(30px, 4vw, 43px); letter-spacing: -.045em; }
.installer-header h1 { text-shadow: 0 3px 16px rgba(0, 0, 0, .75); }
.installer-header p, .login-card > p { color: #b5c0c7; line-height: 1.6; }

.requirements { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 28px; }
.requirement { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(25, 34, 44, .86); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025); }
.requirement > span { display: grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 7px; background: rgba(5, 9, 13, .56); font-size: 12px; font-weight: 900; }
.requirement.ok > span { color: var(--grass-soft); border-color: rgba(105, 182, 87, .28); }
.requirement.failed > span { color: #ff9aa1; border-color: rgba(240, 116, 125, .28); }
.requirement strong, .requirement small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.requirement strong { font-size: 12px; }
.requirement small { margin-top: 3px; color: var(--muted); font-size: 10px; }

fieldset { margin: 0 0 20px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background-color: rgba(9, 14, 20, .58); background-image: linear-gradient(rgba(143, 159, 169, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(143, 159, 169, .018) 1px, transparent 1px); background-size: 24px 24px; }
legend { display: flex; align-items: center; gap: 11px; padding: 0 10px; font-size: 17px; font-weight: 800; }
legend > span { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid rgba(153, 179, 192, .28); border-radius: 7px; color: var(--cyan-soft); background: linear-gradient(145deg, #2c3841, #131b22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 3px 3px 0 rgba(0, 0, 0, .18); font-size: 12px; }
legend strong { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.field-note { margin: -2px 0 18px; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.field-grid.wide-narrow { grid-template-columns: minmax(0, 3fr) minmax(120px, 1fr); }
label { display: block; color: #cbd4da; font-size: 13px; font-weight: 700; }
.optional { color: var(--muted); font-size: 11px; font-weight: 500; }
input { width: 100%; height: 47px; margin-top: 8px; padding: 0 13px; border: 1px solid #33414c; border-radius: 8px; outline: none; color: var(--text); background: rgba(5, 9, 13, .84); box-shadow: inset 0 1px 4px rgba(0, 0, 0, .45); transition: border-color .15s, box-shadow .15s, background-color .15s; }
input:focus { border-color: var(--cyan); background: rgba(7, 13, 18, .96); box-shadow: 0 0 0 3px rgba(81, 196, 230, .11), inset 0 1px 4px rgba(0, 0, 0, .45); }
.check-row { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.check-row input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--grass); }
.check-row span, .check-row strong, .check-row small { display: block; }
.check-row strong { color: #d6dee3; font-size: 12px; }
.check-row small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
.field-error { display: block; margin-top: 7px; color: #ff9ba2; font-size: 11px; line-height: 1.4; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 47px; padding: 0 19px; border: 1px solid transparent; border-radius: 8px; font-weight: 800; cursor: pointer; transition: transform .14s, filter .14s, border-color .14s; }
.primary-button { color: #031316; background: linear-gradient(135deg, #73c768, #59c9dc); box-shadow: 0 12px 28px rgba(53, 174, 183, .18), inset 0 1px 0 rgba(255, 255, 255, .35); }
.primary-button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.secondary-button { border-color: var(--line); color: var(--text); background: rgba(31, 42, 52, .88); }
.secondary-button:hover:not(:disabled) { border-color: var(--line-strong); background: #25323d; }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .46; }
.installer-card form > .primary-button { width: 100%; margin-top: 2px; }
.blocked-note { margin: 10px 0 0; text-align: center; color: var(--red); font-size: 12px; }
.login-card form { display: grid; gap: 18px; margin-top: 26px; }
.login-card .primary-button { width: 100%; }
.alert { display: flex; flex-direction: column; gap: 5px; margin: 18px 0; padding: 13px 15px; border: 1px solid; border-radius: 9px; font-size: 13px; line-height: 1.45; }
.alert-error { border-color: rgba(240, 116, 125, .34); color: #ffc2c6; background: rgba(114, 39, 46, .22); }
.alert-success { border-color: rgba(105, 182, 87, .34); color: #d0f0c5; background: rgba(50, 91, 41, .22); }
.footer-note { margin: 24px 0 0; text-align: center; color: #84919a; font-size: 11px; }
.error-card { text-align: center; }
.link-button { margin-top: 12px; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 25px 18px 20px; border-right: 1px solid var(--line); background-color: rgba(9, 14, 20, .95); background-image: linear-gradient(rgba(132, 150, 162, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(132, 150, 162, .025) 1px, transparent 1px); background-size: 32px 32px; box-shadow: 14px 0 40px rgba(0, 0, 0, .2); backdrop-filter: blur(18px); }
.sidebar .brand { padding: 0 8px 24px; }
.nav { display: grid; gap: 5px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid transparent; border-radius: 9px; color: #aeb9c0; font-size: 13px; font-weight: 680; }
.nav a > span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid rgba(151, 170, 182, .16); border-radius: 7px; color: #a8b6bf; background: linear-gradient(145deg, rgba(45, 58, 68, .8), rgba(15, 22, 28, .9)); }
.nav a.active { border-color: rgba(81, 196, 230, .16); color: white; background: linear-gradient(90deg, rgba(81, 196, 230, .14), rgba(81, 196, 230, .035)); }
.nav a.active > span { color: var(--cyan-soft); border-color: rgba(81, 196, 230, .3); }
.nav a.disabled { opacity: .5; }
.nav-label { margin: 20px 12px 7px; color: #61717c; font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(17, 24, 31, .66); font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 2px; background: var(--grass-soft); box-shadow: 0 0 9px rgba(105, 182, 87, .5); }
.main-column { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 88px; padding: 18px 34px; border-bottom: 1px solid var(--line); background: rgba(7, 11, 16, .76); backdrop-filter: blur(18px); }
.topbar h1 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.03em; }
.account-menu { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(81, 196, 230, .28); border-radius: 8px; color: var(--cyan-soft); background: linear-gradient(145deg, rgba(49, 89, 105, .7), rgba(15, 25, 32, .9)); font-size: 13px; font-weight: 900; }
.account-name { color: #ccd5da; font-size: 13px; font-weight: 700; }
.text-button { padding: 7px 9px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; }
.text-button:hover { color: white; }
.page-content { padding: 30px 34px 50px; }

.welcome-panel { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; padding: 30px; border: 1px solid rgba(129, 190, 194, .28); border-radius: 16px; background: linear-gradient(90deg, rgba(7, 13, 18, .9), rgba(7, 13, 18, .48)), url("/assets/images/voxel-panorama.png") center 55% / cover; box-shadow: 0 20px 50px rgba(0, 0, 0, .26); }
.welcome-panel > * { position: relative; z-index: 1; }
.welcome-panel h2 { margin: 7px 0 8px; font-size: 29px; letter-spacing: -.04em; text-shadow: 0 3px 16px rgba(0, 0, 0, .8); }
.welcome-panel p { max-width: 670px; margin-bottom: 0; color: #d0d7dc; line-height: 1.55; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.stat-card, .content-card { border: 1px solid var(--line); border-radius: 13px; background-color: rgba(16, 23, 31, .92); background-image: linear-gradient(rgba(145, 162, 173, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(145, 162, 173, .018) 1px, transparent 1px); background-size: 24px 24px; box-shadow: 0 14px 34px rgba(0, 0, 0, .22); backdrop-filter: blur(12px); }
.stat-card { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 19px; }
.stat-card.accent { border-color: rgba(81, 196, 230, .28); }
.stat-icon { display: grid; flex: 0 0 43px; place-items: center; width: 43px; height: 43px; border: 1px solid rgba(145, 168, 181, .2); border-radius: 9px; color: var(--cyan-soft); background: linear-gradient(145deg, rgba(48, 63, 74, .86), rgba(13, 20, 26, .9)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.stat-card small, .stat-card strong, .stat-card div > span { display: block; }
.stat-card small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.stat-card strong { margin: 4px 0 2px; font-size: 24px; }
.stat-card div > span { color: #70808a; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 20px; }
.content-card { padding: 24px; }
.empty-state { display: grid; justify-items: center; min-height: 330px; align-content: center; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 19px; border: 1px solid rgba(81, 196, 230, .26); border-radius: 12px; background: linear-gradient(145deg, rgba(48, 82, 95, .72), rgba(13, 22, 29, .9)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 28px rgba(0, 0, 0, .24); }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { max-width: 500px; margin-bottom: 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.card-heading { display: flex; align-items: center; justify-content: space-between; }
.card-heading h3 { margin: 5px 0 0; }
.health-badge { padding: 6px 9px; border: 1px solid rgba(105, 182, 87, .28); border-radius: 7px; color: #caf0ba; background: rgba(58, 104, 47, .24); font-size: 10px; font-weight: 800; }
.status-list { margin: 24px 0 0; }
.status-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-top: 1px solid var(--line); }
.status-list dt { color: var(--muted); font-size: 12px; }
.status-list dd { margin: 0; font-size: 12px; font-weight: 700; text-align: right; }
.status-list dd.muted { color: #72808a; font-weight: 500; }

@media (max-width: 960px) {
    .requirements, .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .sidebar .brand > span:last-child, .nav a { font-size: 0; }
    .nav a > span { font-size: 15px; }
    .nav-label, .sidebar-footer { display: none; }
    .sidebar .brand { justify-content: center; padding-inline: 0; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
    body.layout-auth { background-position: center top, 56% top; }
    .auth-shell { width: min(100% - 18px, 1060px); padding-top: 18px; }
    .installer-card, .login-card { padding: 22px; border-radius: 14px; }
    .installer-header { margin: -22px -22px 25px; padding: 32px 22px 28px; }
    .requirements, .field-grid, .field-grid.wide-narrow, .stat-grid { grid-template-columns: 1fr; }
    fieldset { padding: 18px; }
    .app-shell { display: block; }
    .sidebar { display: none; }
    .topbar { padding: 16px 18px; }
    .account-name { display: none; }
    .page-content { padding: 18px; }
    .welcome-panel { align-items: flex-start; flex-direction: column; }
}
