
:root {
  --bg: #0b1220;
  --bg-2: #0e1729;
  --panel: #111c31;
  --panel-2: #16233c;
  --text: #e9effc;
  --muted: #93a6c6;
  --accent: #4cc9f0;
  --accent-2: #7c5cff;
  --ok: #37d67a;
  --warn: #f5b942;
  --danger: #ff6b6b;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(76, 201, 240, 0.16), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(124, 92, 255, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 3.2vw, 3rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

/* ---------- auth layout ---------- */
.auth-page { min-height: 100vh; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}
.auth-shell-narrow { grid-template-columns: 1fr; }
.auth-brand {
  padding: clamp(2rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(76, 201, 240, 0.06), transparent 40%),
    rgba(9, 15, 28, 0.35);
}
.brand-lockup { display: flex; align-items: center; gap: 0.85rem; }
.brand-mark {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px;
  font-weight: 800; font-size: 1.35rem;
  color: #04121f;
  background: linear-gradient(135deg, var(--accent), #8ef0ff 55%, var(--accent-2));
  box-shadow: 0 10px 30px rgba(76, 201, 240, 0.3);
}
.brand-mark.small { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
.brand-name { font-weight: 750; letter-spacing: -0.01em; font-size: 1.1rem; }
.brand-subtitle { color: var(--muted); font-size: 0.85rem; }
.brand-copy { max-width: 34rem; }
.brand-copy h1 { margin-bottom: 1rem; }
.feature-list {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
  display: grid; gap: 0.7rem;
}
.feature-list li {
  position: relative; padding-left: 1.6rem; color: #c7d4ea;
}
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 0.45rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.14);
}
.brand-footer {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em;
}
.auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  gap: 1.25rem;
}
.auth-panel-center { min-height: 100vh; }
.auth-card {
  width: 100%; max-width: 430px;
  background: linear-gradient(180deg, rgba(22, 35, 60, 0.9), rgba(15, 25, 44, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.auth-card-head { margin-bottom: 1.5rem; }
.auth-card-head h2 { margin-bottom: 0.35rem; }
.auth-meta {
  display: flex; align-items: center; gap: 0.55rem;
  margin-top: 1.4rem; color: var(--muted); font-size: 0.78rem;
}
.lock-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 4px rgba(55, 214, 122, 0.14);
}
.auth-legal {
  max-width: 430px; color: var(--muted); font-size: 0.78rem;
  text-align: center; line-height: 1.5; margin: 0;
}

/* ---------- forms ---------- */
.field { margin-bottom: 1.05rem; }
.field label {
  display: block; margin-bottom: 0.45rem;
  font-size: 0.82rem; font-weight: 600; color: #c6d3e9;
}
.field-input {
  width: 100%;
  padding: 0.82rem 0.95rem;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 12, 24, 0.55);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field-input::placeholder { color: #60718f; }
.field-input:focus {
  outline: none;
  border-color: rgba(76, 201, 240, 0.7);
  box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.14);
  background: rgba(6, 12, 24, 0.8);
}
.code-input { letter-spacing: 0.35em; font-size: 1.25rem; text-align: center; }
.field-error { margin-top: 0.4rem; color: var(--danger); font-size: 0.8rem; }
.turnstile-wrap { margin: 1.1rem 0 1.2rem; min-height: 65px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0.78rem 1.1rem;
  font: inherit; font-weight: 650;
  color: var(--text); background: var(--panel-2);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: progress; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5ad7ff 45%, var(--accent-2));
  color: #04121f;
  box-shadow: 0 12px 30px rgba(76, 201, 240, 0.22);
}
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-danger { background: rgba(255, 107, 107, 0.14); border-color: rgba(255, 107, 107, 0.4); color: #ffb3b3; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 0.8rem; font-size: 0.82rem; }

/* ---------- alerts ---------- */
.alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.alert-error { border-color: rgba(255, 107, 107, 0.35); background: rgba(255, 107, 107, 0.09); color: #ffc2c2; }
.alert-success { border-color: rgba(55, 214, 122, 0.35); background: rgba(55, 214, 122, 0.09); color: #b7f5ce; }
.alert-warning { border-color: rgba(245, 185, 66, 0.35); background: rgba(245, 185, 66, 0.09); color: #ffe1a3; }
.alert-info { border-color: rgba(76, 201, 240, 0.35); background: rgba(76, 201, 240, 0.09); color: #c2f1ff; }

/* ---------- app shell ---------- */
.app-page { min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: rgba(9, 15, 28, 0.72);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.topbar-right form { margin: 0; }
.pill {
  display: inline-flex; align-items: center;
  padding: 0.34rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: #c8d5ea; font-size: 0.76rem; white-space: nowrap;
}
.pill-soft { color: var(--muted); }
.pill-ok { border-color: rgba(55, 214, 122, 0.35); color: #9ff0bd; }
.pill-warn { border-color: rgba(245, 185, 66, 0.4); color: #ffe1a3; }
.container { max-width: 1180px; margin: 0 auto; padding: clamp(1.4rem, 3vw, 2.5rem); }
.container.narrow { max-width: 860px; }
.page-head { margin-bottom: 1.6rem; }
.page-head.split {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  flex-wrap: wrap;
}
.company-switcher {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.company-switcher label { font-size: 0.78rem; color: var(--muted); }
.company-switcher select {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 0.45rem 0.6rem; font: inherit; font-size: 0.85rem;
}
.grid { display: grid; gap: 1rem; }
.modules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.module-card, .card {
  background: linear-gradient(180deg, rgba(22, 35, 60, 0.82), rgba(15, 25, 44, 0.86));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.module-card h2 { font-size: 1.05rem; margin: 0; }
.module-card p { font-size: 0.85rem; margin: 0.7rem 0 1rem; }
.module-link { font-size: 0.78rem; color: var(--muted); }
.status-pill {
  display: inline-flex; align-items: center;
  padding: 0.22rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border); font-size: 0.7rem; color: var(--muted);
}
.status-ok { border-color: rgba(55, 214, 122, 0.4); color: #9ff0bd; }
.foundation { margin-top: 1.2rem; }
.check-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1.2rem; margin-top: 0.8rem;
}
.check { color: var(--ok); font-weight: 800; margin-right: 0.45rem; }
.status-row { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.stack { display: grid; gap: 0.8rem; }
.mfa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.qr-frame {
  width: 200px; height: 200px; margin: 1rem 0;
  background: #fff; border-radius: 14px; padding: 10px;
}
.qr-frame svg { width: 100%; height: 100%; display: block; }
.secret {
  display: inline-block; padding: 0.5rem 0.7rem; border-radius: 8px;
  background: rgba(6, 12, 24, 0.6); border: 1px solid var(--border);
  font-size: 0.85rem; letter-spacing: 0.08em; word-break: break-all;
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { border-right: 0; border-bottom: 1px solid var(--border); gap: 1.5rem; }
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mfa-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .modules, .check-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-right { width: 100%; }
  .auth-brand { padding: 1.5rem; }
  .auth-panel { padding: 1.2rem; }
}

/* ---------- app navigation and data tables ---------- */
.topbar { flex-wrap: wrap; }
.topbar-left { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.brand-link { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); }
.brand-link:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; margin-left: 1.2rem; }
.nav a {
  padding: 0.42rem 0.7rem; border-radius: 8px;
  color: var(--muted); font-size: 0.84rem; white-space: nowrap;
}
.nav a:hover { background: rgba(76, 201, 240, 0.08); color: var(--text); text-decoration: none; }
.nav a.active { background: rgba(76, 201, 240, 0.14); color: var(--text); }
.module-link-card { display: block; color: var(--text); }
.module-link-card:hover { text-decoration: none; border-color: rgba(76, 201, 240, 0.35); }
.module-link-card:hover .module-link { color: var(--accent); }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(9, 15, 28, 0.35);
}
table.data { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.data th {
  text-align: left; padding: 0.7rem 0.8rem;
  color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}
table.data td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data.compact th, table.data.compact td { padding: 0.5rem 0.65rem; }
table.data tbody tr:hover { background: rgba(76, 201, 240, 0.04); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; }
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  font-size: 0.72rem; white-space: nowrap; margin: 0.1rem 0.15rem 0.1rem 0;
}
.badge-draft { border-color: rgba(245, 185, 66, 0.4); color: #ffe1a3; background: rgba(245, 185, 66, 0.08); }
.badge-posted { border-color: rgba(55, 214, 122, 0.4); color: #9ff0bd; background: rgba(55, 214, 122, 0.08); }
.badge-cancelled { border-color: rgba(255, 107, 107, 0.4); color: #ffb3b3; background: rgba(255, 107, 107, 0.08); }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.5rem; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.form-grid .field { margin-bottom: 0; }
.form-actions { display: flex; gap: 0.7rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.2rem; }
.actions-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.actions-row form { margin: 0; }
.section-title { margin: 1.5rem 0 0.8rem; font-size: 1.05rem; }
.searchbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.searchbar .field-input { max-width: 320px; }
.searchbar select.field-input { max-width: 220px; }
.scanbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.empty { padding: 2.2rem; text-align: center; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 1rem; margin-bottom: 1rem; }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1rem; margin: 0.8rem 0 0; font-size: 0.86rem; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }
.totals { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1rem; }
.totals .value { font-size: 1.15rem; font-weight: 700; }
.hint { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.76rem; }
.form-table td { vertical-align: top; }
.form-table .field-input { min-width: 110px; }
.form-table td:first-child .field-input { min-width: 180px; }
@media (max-width: 980px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .nav { margin-left: 0; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar-left { width: 100%; }
}
.field-wide { grid-column: 1 / -1; }
