:root {
  --bg: #07111f;
  --panel: #0d1b2d;
  --panel-2: #10243b;
  --line: #213650;
  --text: #edf6ff;
  --muted: #8fa5bd;
  --cyan: #2dd4bf;
  --blue: #38bdf8;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% 0%, #102d49 0, var(--bg) 42%); color: var(--text); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #041117; background: linear-gradient(135deg, var(--cyan), var(--blue)); font-weight: 900; box-shadow: 0 14px 35px rgba(45, 212, 191, .22); }
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 26px; background: rgba(13, 27, 45, .93); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card h1 { margin: 14px 0 8px; font-size: 30px; }
.stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #c8d8e8; font-size: 13px; font-weight: 700; }
input, select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--text); background: #091725; transition: border .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(45, 212, 191, .12); }
.primary, .secondary { border: 0; border-radius: 11px; padding: 13px 18px; font-weight: 850; }
.primary { color: #031016; background: linear-gradient(135deg, var(--cyan), var(--blue)); }
.secondary { color: var(--text); border: 1px solid var(--line); background: var(--panel-2); }
.message { min-height: 24px; color: #fda4af; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; border-right: 1px solid var(--line); background: rgba(7, 17, 31, .92); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 28px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { padding: 11px 13px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; font-weight: 750; }
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel-2); }
.nav-item.active { box-shadow: inset 3px 0 var(--cyan); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 8px; color: var(--muted); font-size: 12px; }
.text-button { border: 0; color: var(--blue); background: none; }
main { min-width: 0; padding: 32px clamp(22px, 4vw, 64px) 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.topbar h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); }
.system-state { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 800; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.notice { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; padding: 16px 18px; border: 1px solid #59422a; border-radius: 13px; background: rgba(125, 80, 30, .17); }
.notice strong { white-space: nowrap; color: #fbbf24; }
.notice.secure { border-color: #175b58; background: rgba(20, 108, 100, .14); }
.notice.secure strong { color: var(--cyan); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.metric-grid article, .panel { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(16, 36, 59, .86), rgba(10, 24, 40, .9)); box-shadow: var(--shadow); }
.metric-grid article { padding: 20px; }
.metric-grid span, .metric-grid small { display: block; color: var(--muted); }
.metric-grid strong { display: block; margin: 8px 0 2px; font-size: 25px; }
.panel { padding: 22px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel h2 { margin: 0 0 16px; font-size: 18px; }
.tag { padding: 5px 9px; border-radius: 999px; color: var(--cyan); background: rgba(45, 212, 191, .1); font-size: 11px; font-weight: 850; }
.tag.locked { color: #fda4af; background: rgba(251, 113, 133, .1); }
.progress-list { display: grid; gap: 12px; margin: 4px 0 0; padding-left: 22px; color: var(--muted); }
.progress-list .done { color: var(--cyan); }
.settings-group h2 { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.label-head { display: flex; justify-content: space-between; align-items: center; }
.label-head small { color: var(--muted); }
.label-head small.ok { color: var(--cyan); }
.form-actions { display: flex; justify-content: flex-end; gap: 11px; margin-top: 20px; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--cyan); }
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pipeline span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #091725; }
.pipeline i { color: var(--cyan); font-style: normal; }
.candidate-list { display: grid; gap: 9px; }
.candidate-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #091725; }
.candidate-list article div { min-width: 0; }
.candidate-list article strong, .candidate-list article small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-list article small { color: var(--muted); }
.candidate-list article > span { color: var(--cyan); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .sidebar-foot { margin-top: 18px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .auth-card { padding: 28px 22px; }
  .metric-grid, .field-grid { grid-template-columns: 1fr; }
  .notice { align-items: flex-start; flex-direction: column; gap: 4px; }
  .topbar { align-items: flex-start; gap: 18px; }
}
