:root {
  --bg: #07111f;
  --bg-soft: #0b1728;
  --panel: #ffffff;
  --panel-muted: #f7fbff;
  --line: #d8e6f6;
  --text: #0b1b31;
  --muted: #65758b;
  --blue: #0a72ff;
  --cyan: #18d7ff;
  --navy: #041335;
  --danger: #e11d48;
  --success: #14a46c;
  --warning: #f59e0b;
  --shadow: 0 24px 70px rgba(3, 13, 35, .18);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
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:
    radial-gradient(circle at 8% 10%, rgba(24, 215, 255, .18), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(10, 114, 255, .24), transparent 28%),
    linear-gradient(135deg, #eef7ff 0%, #f8fbff 45%, #eef6ff 100%);
}
a { color: inherit; }
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 5%, rgba(24, 215, 255, .22), transparent 25%),
    linear-gradient(145deg, #050b18 0%, #061a36 48%, #09101e 100%);
}
.login-card {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 34px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 40px 120px rgba(0,0,0,.38);
  backdrop-filter: blur(20px);
}
.login-brand {
  position: relative;
  padding: 46px;
  color: white;
  background:
    linear-gradient(150deg, rgba(1, 10, 30, .94), rgba(7, 34, 78, .86)),
    radial-gradient(circle at 70% 15%, rgba(24, 215, 255, .42), transparent 28%);
  overflow: hidden;
}
.login-brand:before,
.login-brand:after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(24, 215, 255, .18);
  inset: 90px 64px auto auto;
  width: 420px;
  height: 420px;
}
.login-brand:after { inset: auto auto -160px -120px; width: 520px; height: 520px; }
.login-brand-content { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.login-logo { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 0 36px rgba(24, 215, 255, .55)); }
.login-wordmark { width: min(360px, 100%); display: block; background: white; border-radius: 18px; padding: 12px 16px; }
.login-brand h1 { font-size: clamp(34px, 4vw, 58px); letter-spacing: -.05em; line-height: .98; margin: 24px 0 14px; }
.login-brand p { font-size: 17px; color: rgba(232,247,255,.8); line-height: 1.7; max-width: 520px; }
.login-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.login-chip { display: inline-flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: rgba(244,250,255,.86); font-size: 13px; }
.login-form-panel { padding: 54px; background: rgba(255,255,255,.96); display: flex; align-items: center; }
.login-form-panel form { width: 100%; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--blue); font-weight: 800; font-size: 12px; }
.login-form-panel h2 { font-size: 36px; letter-spacing: -.04em; margin: 0 0 10px; color: var(--navy); }
.login-form-panel .subtle { margin: 0 0 28px; color: var(--muted); line-height: 1.6; }
.alert { border-radius: 14px; padding: 12px 14px; margin: 0 0 18px; border: 1px solid; }
.alert-danger { color: #9f1239; background: #fff1f2; border-color: #fecdd3; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 292px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: white;
  background:
    radial-gradient(circle at 25% 10%, rgba(24, 215, 255, .25), transparent 24%),
    linear-gradient(180deg, #05142c 0%, #06101f 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 10px; border-radius: 20px; }
.brand-icon { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 0 20px rgba(24, 215, 255, .36)); }
.brand-copy strong { display: block; font-size: 22px; letter-spacing: -.04em; }
.brand-copy span { display: block; color: #7ddcff; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.nav { display: grid; gap: 8px; margin-top: 30px; }
.nav a { display: flex; align-items: center; gap: 11px; color: rgba(240,248,255,.78); text-decoration: none; padding: 12px 14px; border-radius: 16px; transition: .18s ease; }
.nav a:hover { background: rgba(255,255,255,.1); color: white; transform: translateX(2px); }
.nav-dot { width: 9px; height: 9px; border-radius: 999px; background: linear-gradient(135deg, var(--cyan), var(--blue)); box-shadow: 0 0 16px rgba(24,215,255,.7); }
.sidebar-card { margin-top: 32px; border-radius: 22px; padding: 18px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.sidebar-card h3 { margin: 0 0 10px; font-size: 15px; }
.module-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; color: rgba(240,248,255,.76); }
.module-row:first-of-type { border-top: 0; }
.module-state { color: #7fffd4; font-weight: 700; }
.content { min-width: 0; padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.search-pill { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; color: #6b7b91; background: rgba(255,255,255,.78); border: 1px solid rgba(216,230,246,.88); border-radius: 999px; padding: 12px 18px; box-shadow: 0 12px 28px rgba(8, 30, 66, .08); }
.userbar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 999px; background: white; border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(8, 30, 66, .08); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; color: white; font-weight: 900; background: linear-gradient(135deg, var(--cyan), var(--blue)); }
.userbar small { display: block; color: var(--muted); }
.logout { color: var(--danger); font-weight: 800; text-decoration: none; padding: 8px 12px; }
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 34px;
  min-height: 220px;
  color: white;
  background:
    radial-gradient(circle at 83% 14%, rgba(24, 215, 255, .5), transparent 24%),
    linear-gradient(135deg, #051536 0%, #061e4b 55%, #04101d 100%);
  box-shadow: var(--shadow);
}
.hero:after { content:""; position:absolute; right:-90px; bottom:-220px; width:520px; height:520px; border:1px solid rgba(24,215,255,.16); border-radius:999px; }
.hero-content { position: relative; z-index: 1; max-width: 780px; }
.hero-wordmark { width: min(420px, 90%); background: white; border-radius: 18px; padding: 10px 16px; box-shadow: 0 20px 70px rgba(0,0,0,.18); margin-bottom: 20px; }
.hero h1 { font-size: clamp(32px, 4vw, 56px); letter-spacing: -.055em; line-height: 1; margin: 0 0 14px; }
.hero p { color: rgba(238,248,255,.78); line-height: 1.7; margin: 0; max-width: 720px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn, button.btn, form button:not(.link-button):not(.danger-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--blue), #075ce0);
  color: white;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(10, 114, 255, .24);
}
.btn-secondary { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); box-shadow: none; }
.danger-button { background: #fff1f2; color: #be123c; padding: 6px 9px; border-radius: 999px; font-weight: 800; margin: 3px; }
.link-button { background: transparent; color: var(--blue); padding: 0; box-shadow: none; font-weight: 800; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.metric-card { background: rgba(255,255,255,.88); border: 1px solid rgba(216,230,246,.92); border-radius: 22px; padding: 20px; box-shadow: 0 18px 45px rgba(8, 30, 66, .08); }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; font-size: 34px; letter-spacing: -.04em; margin-top: 8px; color: var(--navy); }
.metric-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: rgba(255,255,255,.94); border: 1px solid rgba(216,230,246,.95); border-radius: var(--radius-lg); padding: 22px; box-shadow: 0 18px 45px rgba(8, 30, 66, .08); }
.panel h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; letter-spacing: -.03em; margin: 0 0 8px; color: var(--navy); }
.panel h2 .section-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 12px; background: #e9f7ff; }
.panel .intro { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.form-grid.one { grid-template-columns: 1fr; }
.field { display: grid; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field .label { color: #40536d; font-size: 12px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
input:not([type='checkbox']), select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #ccdbee;
  border-radius: 13px;
  padding: 10px 12px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus { border-color: #4bbcff; box-shadow: 0 0 0 4px rgba(24, 215, 255, .14); }
.checkbox-grid { display: grid; gap: 9px; margin: 4px 0 12px; }
.check-row { display: flex; align-items: center; gap: 10px; color: #40536d; font-size: 14px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.helper { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 12px; }

.table-panel { margin-top: 16px; padding: 0; overflow: hidden; }
.table-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, white, #f8fbff); }
.table-header h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; color: var(--navy); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; padding: 14px 18px; color: #5c6e86; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: #f4f8fc; border-bottom: 1px solid var(--line); }
td { padding: 16px 18px; border-bottom: 1px solid #ecf2f8; vertical-align: top; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.row-title { display: block; font-weight: 900; color: var(--navy); }
.small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #17416d; background: #eef6ff; padding: 4px 7px; border-radius: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; margin: 3px 4px 3px 0; border-radius: 999px; background: #eef6ff; color: #17416d; border: 1px solid #dbeeff; font-weight: 800; font-size: 12px; white-space: nowrap; }
.badge.ok { background: #ecfdf5; border-color: #bbf7d0; color: #047857; }
.badge.warn { background: #fffbeb; border-color: #fde68a; color: #a16207; }
.badge.danger { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.badge.dark { background: #edf2ff; border-color: #d9e2ff; color: #1e3a8a; }
.empty { color: var(--muted); font-style: italic; }
.url-stack { display: grid; gap: 10px; }
.url-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #f6faff; border: 1px solid #e4edf8; }
.url-item span:first-child { font-weight: 900; color: #40536d; }
.recent-list { display: grid; gap: 10px; margin-top: 12px; }
.recent-item { display: grid; gap: 4px; padding: 12px; border-radius: 14px; background: #f8fbff; border: 1px solid #e4edf8; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .content { padding: 18px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .search-pill { max-width: none; }
  .login-card { grid-template-columns: 1fr; }
  .login-brand { min-height: 420px; }
}
@media (max-width: 620px) {
  .hero { padding: 24px; }
  .metric-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-form-panel, .login-brand { padding: 28px; }
}
.nav a.is-active { background: rgba(255,255,255,.12); color: white; }
