:root {
  --bg: #08090a;
  --bg-deep: #010102;
  --panel: #0f1011;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --text: #f7f8f8;
  --muted: #8a8f98;
  --soft: #d0d6e0;
  --dim: #62666d;
  --accent: #7170ff;
  --accent-bg: #5e6ad2;
  --green: #10b981;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 30px 80px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, rgba(113,112,255,.22), transparent 34rem), radial-gradient(circle at 90% 0%, rgba(16,185,129,.09), transparent 24rem), var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: "cv01", "ss03";
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding-left: 1.1rem; }
li { margin: .35rem 0; color: var(--soft); }
code { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .78rem; color: #b6baff; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem clamp(1.25rem, 6vw, 6rem);
}
.login-card, .system-card, .ops-card, .department-card, .stats-grid article, .flow-grid div {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
}
.login-card { padding: 2rem; max-width: 520px; }
.brand-row, .brand-lockup, .department-top, .card-head, .topbar, .section-heading, .department-footer, .hero-actions { display: flex; align-items: center; gap: 1rem; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-bg), #8b5cf6);
  box-shadow: 0 0 45px rgba(113,112,255,.45);
  color: white; font-weight: 700; letter-spacing: -.04em;
}
.eyebrow { color: var(--accent); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
h1, h2, h3 { margin: 0; letter-spacing: -.04em; }
h1 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 650; }
h2 { font-size: clamp(2rem, 5vw, 4rem); line-height: .98; font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
h4 { margin: 0 0 .65rem; color: var(--text); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
p { color: var(--muted); line-height: 1.65; }
.login-copy { margin: 1.4rem 0 1.5rem; }
.login-form { display: grid; gap: 1rem; }
.login-form label span { display: block; margin-bottom: .45rem; color: var(--soft); font-size: .9rem; font-weight: 600; }
.login-form input {
  width: 100%; padding: .95rem 1rem;
  border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0,0,0,.22); color: var(--text);
  outline: none; font: inherit;
}
.login-form input:focus { border-color: rgba(113,112,255,.75); box-shadow: 0 0 0 4px rgba(113,112,255,.13); }
.primary-button, .ghost-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 .95rem; border-radius: 10px;
  font-weight: 700; font-size: .9rem; border: 1px solid transparent;
}
.primary-button { background: var(--accent-bg); color: white; box-shadow: 0 12px 34px rgba(94,106,210,.32); }
.ghost-button { background: rgba(255,255,255,.035); color: var(--soft); border-color: var(--border); }
.alert { border: 1px solid rgba(251,113,133,.25); background: rgba(251,113,133,.1); color: #fecdd3; border-radius: 12px; padding: .85rem 1rem; margin-bottom: 1rem; }
.security-note, .login-footer { color: var(--muted); font-size: .82rem; margin-top: 1rem; }
.status-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--green); display: inline-block; box-shadow: 0 0 18px var(--green); }
.login-side { position: relative; min-height: 560px; display: grid; align-items: center; }
.halo { position: absolute; inset: 10% 20%; border-radius: 999px; background: radial-gradient(circle, rgba(113,112,255,.28), transparent 65%); filter: blur(20px); }
.system-card { position: relative; padding: 2rem; max-width: 420px; justify-self: center; }
.system-card ul { margin-top: 1rem; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  justify-content: space-between;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(8,9,10,.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
}
.top-actions { display: flex; gap: .55rem; align-items: center; color: var(--soft); font-size: .9rem; }
.top-actions a:not(.ghost-button) { padding: .65rem .75rem; border-radius: 9px; color: var(--muted); }
.top-actions a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.dashboard-shell { padding: clamp(1rem, 3vw, 2.5rem); max-width: 1580px; margin: 0 auto; }
.hero-panel {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); gap: 1.5rem;
  align-items: stretch; margin: 1rem 0 1.5rem;
}
.hero-panel > div:first-child, .live-card { padding: clamp(1.4rem, 4vw, 2.5rem); border: 1px solid var(--border); border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); box-shadow: var(--shadow); }
.hero-panel p { max-width: 840px; font-size: 1.05rem; }
.pill, .mini-badge { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--border); border-radius: 999px; color: var(--soft); background: rgba(255,255,255,.035); padding: .38rem .7rem; font-size: .78rem; font-weight: 650; }
.metric-list { display: grid; gap: .85rem; margin: 1.25rem 0 0; }
.metric-list div, .meta-grid div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border-soft); }
dt, .meta-grid span { color: var(--muted); font-size: .78rem; }
dd { margin: 0; color: var(--text); font-weight: 750; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stats-grid article { padding: 1rem; border-radius: 18px; }
.stats-grid span { color: var(--accent); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.stats-grid strong { display: block; margin-top: .55rem; font-size: 1.02rem; }
.stats-grid p { margin: .45rem 0 0; font-size: .88rem; }
.section-block { margin: 2rem 0; }
.section-heading { justify-content: space-between; margin-bottom: 1rem; }
.section-heading h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); }
.section-heading p { max-width: 520px; }
.department-grid { display: grid; gap: 1rem; }
.department-card { padding: 1.25rem; border-radius: 22px; }
.dept-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.055); border: 1px solid var(--border); font-size: 1.35rem; flex: 0 0 auto; }
.department-top p { margin: .35rem 0 0; }
.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin: 1rem 0; }
.meta-grid strong { font-size: .8rem; text-align: right; overflow-wrap: anywhere; }
.detail-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.detail-columns > div { background: rgba(0,0,0,.16); border: 1px solid var(--border-soft); border-radius: 16px; padding: 1rem; }
.detail-columns li { font-size: .88rem; }
.department-footer { justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-soft); }
.department-footer a { color: #b6baff; font-weight: 700; }
.split-section { display: grid; grid-template-columns: 1.25fr .75fr; gap: 1rem; }
.ops-card { padding: 1.2rem; border-radius: 22px; }
.card-head { justify-content: space-between; margin-bottom: 1rem; color: var(--soft); font-weight: 750; }
.timeline { display: grid; gap: .8rem; }
.timeline-row { display: grid; grid-template-columns: 18px 1fr; gap: .75rem; align-items: start; }
.timeline-row p { margin: .25rem 0 0; font-size: .85rem; }
.time-dot { width: 10px; height: 10px; margin-top: .35rem; border-radius: 999px; background: var(--accent); box-shadow: 0 0 24px rgba(113,112,255,.8); }
.control-list { display: grid; gap: .9rem; }
.control-list div { padding: .85rem; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border-soft); }
.control-list strong { display: block; margin-bottom: .4rem; }
.muted-note { font-size: .88rem; }
.flow-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.flow-grid div { padding: 1.1rem; border-radius: 20px; }
.flow-grid span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: rgba(113,112,255,.14); color: #c4c7ff; margin-bottom: .8rem; font-weight: 800; }
.flow-grid p { font-size: .9rem; margin-bottom: 0; }
.footer { color: var(--dim); text-align: center; padding: 2rem; border-top: 1px solid var(--border-soft); font-size: .85rem; }

@media (max-width: 1100px) {
  .hero-panel, .split-section { grid-template-columns: 1fr; }
  .stats-grid, .detail-columns, .flow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; padding: 1rem; }
  .login-side { display: none; }
  .topbar, .section-heading, .department-footer { align-items: flex-start; flex-direction: column; }
  .top-actions { flex-wrap: wrap; }
  .stats-grid, .detail-columns, .flow-grid, .meta-grid { grid-template-columns: 1fr; }
  h2 { font-size: 2.1rem; }
}
