:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: rgba(13, 28, 48, .82);
  --panel-solid: #0d1c30;
  --line: rgba(144, 165, 194, .16);
  --text: #ecf3ff;
  --muted: #8ea1bb;
  --blue: #55c3ff;
  --green: #4adea4;
  --amber: #f4c766;
  --red: #fb7185;
  --violet: #a78bfa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--bg); }
body::before {
  position: fixed; inset: 0; z-index: -1; content: ""; pointer-events: none;
  background: radial-gradient(circle at 74% 0%, rgba(18, 86, 123, .22), transparent 34%),
              radial-gradient(circle at 30% 100%, rgba(18, 99, 78, .14), transparent 30%);
}
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app-shell--guest { display: block; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px; border-right: 1px solid var(--line);
  background: rgba(6, 16, 29, .88); backdrop-filter: blur(22px); display: flex; flex-direction: column;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand-mark { position: relative; width: 38px; height: 38px; border: 1px solid rgba(85, 195, 255, .45); border-radius: 12px; background: linear-gradient(145deg, rgba(85,195,255,.24), rgba(74,222,164,.08)); box-shadow: inset 0 0 18px rgba(85,195,255,.12); }
.brand-mark::before, .brand-mark span { position: absolute; content: ""; border-radius: 99px; background: var(--blue); transform: rotate(-36deg); }
.brand-mark::before { width: 18px; height: 3px; left: 9px; top: 17px; }
.brand-mark span { width: 8px; height: 3px; left: 16px; top: 21px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.01em; }
.brand small { display: block; margin-top: 3px; color: #6c819d; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.brand--large strong { font-size: 22px; }
.brand--large .brand-mark { width: 46px; height: 46px; border-radius: 15px; }
.brand--large .brand-mark::before { left: 12px; top: 21px; }
.brand--large .brand-mark span { left: 19px; top: 25px; }

.nav { display: grid; gap: 7px; margin-top: 48px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px; color: #8ea1bb; font-size: 14px; font-weight: 650; }
.nav a:hover { color: var(--text); background: rgba(144, 165, 194, .07); }
.nav a.active { color: #dff5ff; background: linear-gradient(90deg, rgba(85,195,255,.17), rgba(85,195,255,.05)); box-shadow: inset 2px 0 var(--blue); }
.nav-icon { display: grid; place-items: center; width: 20px; color: var(--blue); font-size: 18px; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.account-chip { display: flex; align-items: center; gap: 10px; }
.account-chip strong, .account-chip small { display: block; }
.account-chip strong { font-size: 13px; }
.account-chip small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(85,195,255,.25); border-radius: 50%; color: #bceaff; background: rgba(85,195,255,.1); font-size: 13px; font-weight: 800; }
.avatar--large { width: 42px; height: 42px; }
.text-button { margin: 12px 0 0 44px; padding: 0; border: 0; color: #657992; background: none; cursor: pointer; font-size: 11px; }
.text-button:hover { color: var(--text); }

.main-content { width: min(1280px, 100%); margin: 0 auto; padding: 52px clamp(28px, 5vw, 72px) 28px; }
.main-content--guest { width: 100%; padding: 0; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 5px 0 8px; font-size: clamp(30px, 4vw, 43px); letter-spacing: -.04em; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; color: #b9c7d9; background: rgba(13,28,48,.7); font-size: 12px; white-space: nowrap; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; }
.status-pill--ok span { background: var(--green); box-shadow: 0 0 0 4px rgba(74,222,164,.1); }
.status-pill--warn span { background: var(--amber); box-shadow: 0 0 0 4px rgba(244,199,102,.1); }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric-card, .panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 20px 55px rgba(0,0,0,.18); backdrop-filter: blur(16px); }
.metric-card { min-height: 210px; padding: 20px; border-radius: 17px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 13px; font-weight: 900; }
.metric-icon--blue { color: var(--blue); background: rgba(85,195,255,.12); }
.metric-icon--green { color: var(--green); background: rgba(74,222,164,.1); }
.metric-icon--violet { color: var(--violet); background: rgba(167,139,250,.1); }
.badge { padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 750; }
.badge--ok { color: #7de7bc; background: rgba(74,222,164,.1); }
.badge--warn { color: #f6d98f; background: rgba(244,199,102,.1); }
.badge--error { color: #fda4af; background: rgba(251,113,133,.1); }
.metric-card h2 { margin: 24px 0 8px; font-size: 17px; }
.metric-card p { min-height: 40px; margin: 0 0 15px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.metric-card a { font-size: 12px; font-weight: 700; }
.metric-card a span { margin-left: 4px; }
.card-meta { color: #61758e; font-size: 11px; }

.panel { border-radius: 18px; padding: 24px; }
.checklist-panel { margin-top: 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h2, .form-panel h2, .guide-panel h2 { margin: 5px 0 0; font-size: 19px; }
.step-count, .revision { color: #7286a0; font-size: 11px; }
.check-list { display: grid; gap: 4px; margin-top: 20px; }
.check-row { display: grid; grid-template-columns: 30px 1fr; gap: 13px; padding: 14px 4px; border-top: 1px solid rgba(144,165,194,.1); }
.check-dot { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid rgba(244,199,102,.35); border-radius: 50%; color: var(--amber); font-size: 11px; font-weight: 800; }
.check-row.done .check-dot { border-color: rgba(74,222,164,.35); color: var(--green); background: rgba(74,222,164,.07); }
.check-row strong { font-size: 13px; }
.check-row p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.two-column { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); gap: 16px; align-items: start; }
.two-column--users { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); }
.form-stack { display: grid; gap: 18px; margin-top: 24px; }
.form-stack label { display: grid; gap: 8px; color: #c8d5e6; font-size: 12px; font-weight: 700; }
.form-stack label small { color: #71849d; font-weight: 400; line-height: 1.45; }
.required { float: right; color: #71849d; font-size: 10px; font-weight: 500; }
input, select { width: 100%; height: 44px; padding: 0 13px; border: 1px solid rgba(144,165,194,.2); border-radius: 10px; outline: none; color: var(--text); background: rgba(4,13,24,.7); }
input::placeholder { color: #4f627a; }
input:focus, select:focus { border-color: rgba(85,195,255,.7); box-shadow: 0 0 0 3px rgba(85,195,255,.08); }
.form-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid rgba(144,165,194,.22); border-radius: 10px; color: #dbe8f8; background: rgba(144,165,194,.09); cursor: pointer; font-size: 12px; font-weight: 750; }
.button:hover { filter: brightness(1.12); }
.button--primary { border-color: rgba(85,195,255,.35); color: #06121f; background: linear-gradient(135deg, #69d0ff, #54e1bd); box-shadow: 0 8px 24px rgba(62,186,218,.16); }
.button--wide { width: 100%; }
.button--small { min-height: 31px; padding: 0 10px; border-radius: 8px; font-size: 10px; }
.button--ghost { color: #93a6bd; background: transparent; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.guide-panel { border-color: rgba(85,195,255,.19); background: linear-gradient(145deg, rgba(18,50,72,.68), rgba(10,27,45,.78)); }
.guide-icon, .error-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(85,195,255,.35); border-radius: 10px; color: var(--blue); background: rgba(85,195,255,.1); font-weight: 900; }
.guide-panel p, .guide-panel li { color: var(--muted); font-size: 12px; line-height: 1.6; }
.guide-panel ol { padding-left: 20px; }
.guide-panel a { font-size: 12px; font-weight: 700; }
.code-block { margin: 18px 0; padding: 13px; border: 1px solid rgba(144,165,194,.13); border-radius: 10px; color: #a9bbd1; background: #06101d; font: 10px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.narrow-panel { max-width: 620px; }
.compact-panel { position: sticky; top: 28px; }

.alert { margin-bottom: 16px; padding: 12px 15px; border: 1px solid; border-radius: 11px; font-size: 12px; }
.alert--success { border-color: rgba(74,222,164,.28); color: #8cebc7; background: rgba(74,222,164,.07); }
.alert--error { border-color: rgba(251,113,133,.3); color: #fda4af; background: rgba(251,113,133,.07); }
.alert--warn { border-color: rgba(244,199,102,.3); color: #f8dc96; background: rgba(244,199,102,.07); }

.table-panel { overflow: hidden; }
.user-list { margin: 18px -8px -8px; }
.user-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 15px 8px; border-top: 1px solid rgba(144,165,194,.1); }
.user-main strong, .user-main span { display: block; }
.user-main strong { font-size: 13px; }
.user-main span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.user-actions { display: flex; gap: 7px; }
.reset-form { grid-column: 2 / 4; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.reset-form input { height: 33px; font-size: 11px; }
.error-state { width: min(520px, calc(100% - 40px)); margin: 12vh auto; text-align: center; }
.error-state .error-mark { margin: 0 auto 18px; color: var(--red); border-color: rgba(251,113,133,.3); background: rgba(251,113,133,.08); }
.error-state h1 { margin: 9px 0; }
.error-state p { margin: 0 auto 24px; color: var(--muted); line-height: 1.6; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); align-items: center; gap: 8vw; padding: 8vh 10vw; overflow: hidden; }
.login-layout::before { position: fixed; inset: 0; z-index: -1; content: ""; background: radial-gradient(circle at 15% 15%, rgba(38,114,158,.28), transparent 32%), radial-gradient(circle at 78% 80%, rgba(32,121,95,.16), transparent 30%); }
.login-intro h1 { margin: 10vh 0 22px; font-size: clamp(52px, 7vw, 94px); line-height: .98; letter-spacing: -.065em; }
.login-intro h1 span { color: transparent; background: linear-gradient(90deg, #70d3ff, #65e2be); background-clip: text; }
.login-intro > p { max-width: 480px; color: #97aac2; font-size: 17px; line-height: 1.7; }
.security-note { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; padding: 9px 12px; border: 1px solid rgba(74,222,164,.18); border-radius: 99px; color: #7f9e9a; background: rgba(74,222,164,.05); font-size: 11px; }
.security-note span { color: var(--green); }
.login-card { width: min(430px, 100%); padding: 34px; border-radius: 22px; }
.panel-kicker { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .19em; }
.login-card h2 { margin: 9px 0 7px; font-size: 25px; }
.login-footnote { margin: 18px 0 0; color: #576b83; text-align: center; font-size: 10px; }
.page-footer { margin-top: 28px; color: #4e6178; text-align: right; font-size: 9px; letter-spacing: .08em; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; align-items: center; }
  .brand > span:last-child, .nav a:not(.active) .nav-label, .nav a { font-size: 0; }
  .nav a { justify-content: center; padding: 11px; }
  .nav-icon { font-size: 18px; }
  .account-chip > span:last-child, .text-button { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .two-column, .two-column--users { grid-template-columns: 1fr; }
  .compact-panel { position: static; }
  .login-layout { grid-template-columns: 1fr; gap: 40px; padding: 56px 8vw; }
  .login-intro h1 { margin-top: 50px; }
  .login-card { justify-self: start; }
}

@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; }
  .sidebar .brand > span:last-child { display: block; }
  .nav { display: flex; margin: 0 0 0 auto; }
  .nav a { display: none; }
  .nav a.active { display: flex; }
  .sidebar-footer { display: none; }
  .main-content { padding: 30px 18px 20px; }
  .page-header { flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .login-layout { padding: 34px 20px; }
  .login-intro h1 { margin-top: 42px; font-size: 52px; }
  .login-card { padding: 25px; }
  .user-row { grid-template-columns: 42px 1fr; }
  .user-actions { grid-column: 2; }
  .reset-form { grid-column: 2; }
}
