:root {
  --bg: #0a0f15;
  --bg-soft: #0e151e;
  --panel: #111a24;
  --panel-2: #0d151d;
  --panel-3: #16222f;
  --border: #213044;
  --border-soft: #1a2736;
  --text: #e8eef7;
  --text-soft: #c2cede;
  --muted: #8798ae;
  --faint: #5f7186;
  --accent: #55a4ff;
  --accent-soft: rgba(85, 164, 255, 0.14);
  --accent-strong: #2f8cff;
  --teal: #35d6b2;
  --teal-soft: rgba(53, 214, 178, 0.13);
  --ok: #42d392;
  --warn: #ffc857;
  --danger: #ff6b7a;
  --danger-soft: rgba(255, 107, 122, 0.13);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html[data-theme="light"] {
  --bg: #eef3f9;
  --bg-soft: #e6edf6;
  --panel: #ffffff;
  --panel-2: #f6f9fd;
  --panel-3: #edf3fa;
  --border: #d7e1ee;
  --border-soft: #e5ecf5;
  --text: #142033;
  --text-soft: #33475f;
  --muted: #64778f;
  --faint: #8a9bb0;
  --accent: #1f6feb;
  --accent-soft: rgba(31, 111, 235, 0.1);
  --accent-strong: #155bd4;
  --teal: #0b9e82;
  --teal-soft: rgba(11, 158, 130, 0.1);
  --ok: #129c62;
  --warn: #b7791f;
  --danger: #d9364a;
  --danger-soft: rgba(217, 54, 74, 0.09);
  --shadow: 0 18px 45px rgba(30, 55, 90, 0.12);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}
.main,
.auth-shell,
.portal-shell,
.modal-backdrop,
.drawer-form-body,
.log-pre {
  overscroll-behavior: none;
}

body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(85, 164, 255, 0.12), transparent 60%),
    radial-gradient(900px 600px at -10% 100%, rgba(53, 214, 178, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

html[data-theme="light"] body {
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(31, 111, 235, 0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 100%, rgba(11, 158, 130, 0.06), transparent 55%),
    var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 22px; height: 22px; }

/* ── shell ── */
.app-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.boot-screen {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), #1a5fd0 70%);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(47, 140, 255, 0.35);
  position: relative;
  overflow: hidden;
  color: #fff;
}
.brand-mark svg { width: 74%; height: 74%; display: block; }
.brand-mark-lg { width: 52px; height: 52px; border-radius: 16px; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(17, 26, 36, 0.92), rgba(10, 15, 21, 0.6));
  min-height: 0;
}
html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(238, 243, 249, 0.6));
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 8px;
}
.brand-text { min-width: 0; }
.brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.nav-item:hover { background: var(--panel-2); color: var(--text-soft); }
.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(85, 164, 255, 0.25);
  color: var(--accent);
}
.nav-item .nav-label { flex: 1; font-weight: 550; }

.sidebar-spacer { flex: 1; }

.sidebar-footer { display: flex; flex-direction: column; gap: 10px; }
.manager-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}
.manager-chip .status-dot { flex: none; }
.manager-chip .chip-text { min-width: 0; }
.manager-chip strong {
  display: block;
  color: var(--text-soft);
  font-weight: 550;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.manager-chip em {
  font-style: normal;
  font-size: 11px;
  color: var(--faint);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-actions { display: flex; gap: 8px; }
.sidebar-actions .btn { flex: 1; justify-content: center; }

/* ── main ── */
.main {
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }

.page { padding: 24px 30px 42px; width: 100%; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
}
.page-head h1 {
  margin: 0 0 4px;
  font-size: 25px;
  letter-spacing: -0.4px;
  font-weight: 680;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 760px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head-actions .btn { height: 34px; padding-block: 0; }

.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.metric-head strong { color: var(--text-soft); font-size: 14px; font-weight: 600; }
.meter {
  margin-top: 8px;
  height: 7px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.4s ease;
}
.meter.warn > span { background: var(--warn); }
.meter.danger > span { background: var(--danger); }
.metric-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── buttons ── */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-soft);
  border-radius: 10px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.08s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--border); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(47, 140, 255, 0.28);
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 122, 0.3); background: var(--danger-soft); }
.btn.danger:hover { background: rgba(255, 107, 122, 0.2); color: var(--danger); }
.btn.small { padding: 5px 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.icon-only { padding: 8px; }
.btn.group { padding-inline: 10px; }

.icon-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ── stats & panels ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-card {
  position: relative;
  padding: 17px 17px 15px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.03), transparent 55%),
    var(--panel);
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -50px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.stat-icon.teal { background: var(--teal-soft); color: var(--teal); }
.stat-icon.warn { background: rgba(255, 200, 87, 0.12); color: var(--warn); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.1; }
.stat-value small { font-size: 14px; color: var(--faint); font-weight: 500; letter-spacing: 0; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-meta { margin-top: 9px; font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 6px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-title { display: flex; align-items: center; gap: 8px; font-weight: 620; font-size: 13.5px; }
.panel-title .icon { color: var(--muted); }
.panel-sub { font-size: 11.5px; color: var(--faint); }
.panel-body { padding: 14px 17px 16px; }
.panel-body.tight { padding: 0; }

.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.mini-row:last-child { border-bottom: 0; }
.mini-main { flex: 1; min-width: 0; }
.mini-name { font-weight: 550; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── entity cards ── */
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.entity-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.entity-card:hover { border-color: var(--border); transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.entity-head { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.entity-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.entity-icon.teal { background: var(--teal-soft); color: var(--teal); }
.entity-title-wrap { flex: 1; min-width: 0; }
.entity-title {
  font-weight: 640;
  font-size: 14.5px;
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-sub {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.entity-status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  padding: 11px 12px;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
}
.meta-item { min-width: 0; }
.meta-label { font-size: 10.5px; color: var(--faint); letter-spacing: 0.2px; }
.meta-value { font-size: 12.5px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-value.mono { font-family: var(--mono); font-size: 12px; }
.meta-value a { color: var(--accent); }
.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 2px;
}
.card-actions .spacer { flex: 1; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill.ok { color: var(--ok); background: rgba(66, 211, 146, 0.1); border-color: rgba(66, 211, 146, 0.18); }
.pill.warn { color: var(--warn); background: rgba(255, 200, 87, 0.1); border-color: rgba(255, 200, 87, 0.18); }
.pill.err { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 122, 0.18); }
.pill.muted { color: var(--muted); background: var(--panel-2); border-color: var(--border-soft); }
.pill.accent { color: var(--accent); background: var(--accent-soft); border-color: rgba(85, 164, 255, 0.18); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
  box-shadow: 0 0 0 3px rgba(135, 152, 174, 0.08);
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.12); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 200, 87, 0.12); animation: pulse 1.6s ease infinite; }
.status-dot.err { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.status-dot.accent { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-family: var(--mono);
  background: var(--panel-3);
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: rgba(66, 211, 146, 0.1); color: var(--ok); }
.badge.warn { background: rgba(255, 200, 87, 0.1); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.key-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-soft);
  min-width: 0;
}
.key-chip .key-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-chip .icon { color: var(--faint); }

/* ── empty states ── */
.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 46px 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.012);
}
.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-title { font-weight: 620; font-size: 15px; margin-bottom: 4px; }
.empty-text { color: var(--muted); font-size: 12.5px; max-width: 460px; margin: 0 auto 16px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ── tables ── */
.table-wrap { width: 100%; overflow-x: auto; overflow-y: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--muted);
  padding: 9px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th:first-child { border-top-left-radius: var(--radius); }
.data-table th:last-child { border-top-right-radius: var(--radius); }
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.data-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
.data-table tbody tr:hover td { background: var(--panel-2); }
.data-table .align-right { text-align: right; }
.data-table .align-center { text-align: center; }
.data-table .table-empty { padding: 28px 14px; color: var(--muted); text-align: center; }
.data-table .name-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.data-table .name-main { font-weight: 550; color: var(--text-soft); }
.data-table .name-sub { font-size: 11px; color: var(--faint); }
.data-table .name-error {
  font-size: 11px;
  color: var(--danger);
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table .name-error.warn { color: var(--warn); }
.data-table .cell-badges { display: flex; flex-wrap: wrap; gap: 4px; max-width: 340px; }
.data-table .actions { display: flex; gap: 4px; justify-content: flex-start; }

/* sticky horizontal scrubber */
.table-wrap.has-scrubber {
  padding-bottom: 68px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.table-wrap.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.table-wrap.is-dragging * { cursor: grabbing; }
.table-wrap.has-scrubber::-webkit-scrollbar { display: none; }
.table-scrubber {
  position: fixed;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.table-scrubber.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.table-scrubber.no-transition { transition: none; }
.table-scrubber-btn {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.table-scrubber-btn:hover { background: var(--panel-2); color: var(--text); }
.table-scrubber-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.table-scrubber-btn .icon { width: 14px; height: 14px; }
.table-scrubber-btn.prev .icon { transform: rotate(180deg); }
.table-scrubber-range {
  flex: 1 1 auto;
  min-width: 80px;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  background: var(--panel-3);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}
.table-scrubber-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px rgba(85, 164, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
  cursor: grab;
}
.table-scrubber-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px rgba(85, 164, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
  cursor: grab;
}
.table-scrubber-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--panel-3);
}

/* ── dropzone ── */
.dropzone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.16s ease, background 0.16s ease;
  background: var(--panel-2);
}
.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 26px; height: 26px; color: var(--accent); margin-bottom: 8px; }
.dropzone strong { display: block; color: var(--text-soft); font-size: 13px; margin-bottom: 2px; }
.dropzone span { font-size: 11.5px; color: var(--faint); }

/* ── forms ── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; color: var(--text-soft); font-weight: 550; }
.field-label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:disabled, .select:disabled { opacity: 0.55; cursor: not-allowed; }
.textarea { min-height: 74px; resize: vertical; font-family: var(--mono); font-size: 12px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

/* custom select */
.custom-select { position: relative; width: 100%; min-width: 0; }
.select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select-trigger:hover { border-color: var(--border); }
.select-trigger:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-trigger:disabled { opacity: 0.55; cursor: not-allowed; }
.select-trigger .select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger .select-caret { display: inline-flex; color: var(--faint); flex: none; }
.select-trigger .select-caret .icon { width: 13px; height: 13px; transform: rotate(90deg); }
.select-menu {
  position: fixed;
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}
.select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.select-option:hover, .select-option.is-active { background: var(--panel-2); color: var(--text); }
.select-option[aria-selected="true"] { color: var(--accent); }
.select-option:disabled { opacity: 0.45; cursor: not-allowed; }

/* custom number stepper */
.input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.number-stepper { position: relative; display: flex; flex: 1 1 auto; width: 100%; min-width: 0; }
.number-stepper .input { padding-right: 30px; }
.number-actions {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 25px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  opacity: 0.7;
  transition: opacity 0.12s ease;
}
.number-stepper:hover .number-actions,
.number-stepper:focus-within .number-actions { opacity: 1; }
.number-actions button {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}
.number-actions button:hover { background: var(--panel-3); color: var(--text); }
.number-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.number-actions .icon { width: 12px; height: 12px; }
.number-actions button:first-child .icon { transform: rotate(-90deg); }
.number-actions button:last-child .icon { transform: rotate(90deg); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.hint strong { color: var(--text-soft); font-weight: 550; }
.inline-error { color: var(--danger); font-size: 12px; }
.form-note {
  font-size: 11.5px;
  color: var(--muted);
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  line-height: 1.55;
}
.form-note.ok { color: var(--ok); background: rgba(66, 211, 146, 0.07); border-color: rgba(66, 211, 146, 0.18); }
.form-note.warn { color: var(--warn); background: rgba(255, 200, 87, 0.07); border-color: rgba(255, 200, 87, 0.18); }
.form-note.err { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 122, 0.18); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.segment {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.segment.active { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease;
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}
.switch input:checked + .track { background: var(--accent-soft); border-color: rgba(85, 164, 255, 0.4); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent); }
.switch .switch-text { font-size: 12.5px; color: var(--text-soft); }

.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap .input { padding-right: 38px; }
.password-wrap .icon-btn { position: absolute; right: 3px; width: 30px; height: 30px; }

/* ── modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 8, 13, 0.68);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 30px;
  overflow-y: auto;
  animation: fadeIn 0.15s ease;
}
html[data-theme="light"] .modal-backdrop { background: rgba(24, 39, 58, 0.35); }
.modal {
  width: min(620px, 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease;
  overflow: hidden;
}
.modal.wide { width: min(760px, 100%); }
.modal.small { width: min(440px, 100%); }
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.modal-title-wrap { flex: 1; min-width: 0; }
.modal-title { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.modal-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 18px 20px; }
.modal-body.flush { padding: 0; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel-2);
}
.modal-foot .left { margin-right: auto; }
.modal .form-grid + .form-grid { margin-top: 13px; }
.modal .form-note { margin-top: 13px; }
.modal .hint { margin-top: 8px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* ── drawer ── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 8, 13, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease;
}
html[data-theme="light"] .drawer-backdrop { background: rgba(24, 39, 58, 0.25); }
.drawer {
  width: min(720px, 92vw);
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
  animation: drawerIn 0.18s ease;
}
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h3 { margin: 0; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.drawer-title .path {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.drawer.form-drawer { width: min(640px, 92vw); }
.drawer-head-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.drawer-form-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: var(--panel);
}
.drawer-foot.form-foot {
  justify-content: flex-end;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
}
.drawer-form-body .form-grid { grid-template-columns: minmax(0, 1fr); }
.drawer-form-body .form-grid + .form-grid { margin-top: 13px; }
.drawer-form-body .form-note { margin-top: 13px; }
.drawer-form-body .hint { margin-top: 8px; }
.drawer-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2);
  flex-wrap: wrap;
}
.drawer-body { flex: 1; min-height: 0; padding: 0; background: #070b10; }
html[data-theme="light"] .drawer-body { background: #0e1722; }
.log-pre {
  margin: 0;
  padding: 16px 20px 30px;
  height: 100%;
  overflow: auto;
  color: #c6d4e4;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-pre::-webkit-scrollbar { width: 10px; }
.log-pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
.drawer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--faint);
}
.drawer-foot .spacer { flex: 1; }

/* ── designer (full-screen drawer) ── */
.designer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  animation: fadeIn 0.15s ease;
}
.designer-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--panel);
}
.designer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  flex: none;
}
.designer-head-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.designer-title { flex: 1; min-width: 0; }
.designer-title h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.designer-title p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.designer-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg);
}

/* ── detail ── */
.detail-section { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.detail-section:last-child { border-bottom: 0; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-soft);
  margin-bottom: 11px;
}
.section-title .icon { color: var(--muted); }
.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--text-soft); min-width: 0; word-break: break-all; }
.kv dd.mono { font-family: var(--mono); font-size: 11.5px; }

/* OAuth2 provider documentation */
.provider-docs {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.provider-docs .section-title { margin: 16px 0 10px; }
.provider-docs .section-title:first-child { margin-top: 0; }
.provider-docs .hint-line { margin: 0 0 12px; }
.provider-docs .form-note { margin-top: 10px; }
.doc-details {
  margin-bottom: 8px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--panel-2);
}
.doc-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
}
.doc-details summary::-webkit-details-marker { display: none; }
.doc-details summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--faint);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}
.doc-details[open] summary::before { transform: rotate(90deg); }
.doc-details .kv { grid-template-columns: 96px minmax(0, 1fr); padding: 2px 0 10px; }
.code-block {
  position: relative;
  background: #070b10;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  padding-right: 44px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #c6d4e4;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}
.code-block .copy-float { position: absolute; top: 6px; right: 6px; color: #8fa1b8; }
.code-block .copy-float:hover { color: #fff; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── banners/toasts ── */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.banner .icon { margin-top: 1px; flex: none; }
.banner.warn { color: var(--warn); background: rgba(255, 200, 87, 0.06); border-color: rgba(255, 200, 87, 0.18); }
.banner.info { color: var(--accent); background: var(--accent-soft); border-color: rgba(85, 164, 255, 0.18); }
.banner.error { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 122, 0.18); }
.banner strong { color: inherit; font-weight: 600; }
.banner + .service-grid, .banner + .panel, .banner + .table-wrap { margin-top: 14px; }
.page > .banner { margin-bottom: 14px; }

.toast-root {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 220px;
  max-width: 420px;
  padding: 11px 14px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text-soft);
  animation: toastIn 0.18s ease;
}
.toast .icon { flex: none; margin-top: 1px; color: var(--accent); }
.toast.success .icon { color: var(--ok); }
.toast.error .icon { color: var(--danger); }
.toast.error { border-color: rgba(255, 107, 122, 0.28); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── misc ── */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 11.5px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex: none;
}
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border-soft); margin: 14px 0; }
.row { display: flex; align-items: center; gap: 9px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.copy-inline {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--faint);
  padding: 2px;
  border-radius: 5px;
  display: inline-flex;
}
.copy-inline:hover { color: var(--accent); background: var(--accent-soft); }

.mobile-nav { display: none; }
.mobile-head { display: none; }

/* ── responsive ── */
/* ── accounts & auth ── */
.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--panel-2);
}
.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  flex: none;
}
.account-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.account-meta strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta span { font-size: 10.5px; color: var(--faint); }
.account-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}
.account-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12.5px;
}
.account-tab:hover { background: var(--panel-2); color: var(--text); }
.account-tab.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(85, 164, 255, 0.25); }
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-soft);
  cursor: pointer;
  min-width: 0;
}
.check-item input { accent-color: var(--accent); }
.check-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-item.is-disabled { opacity: 0.5; }

/* ── login ── */
.auth-shell {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  background: var(--bg);
}
.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 4.6vw, 62px);
  color: #e8eef7;
  background:
    radial-gradient(900px 620px at 12% 8%, rgba(85, 164, 255, 0.22), transparent 62%),
    radial-gradient(720px 520px at 92% 92%, rgba(53, 214, 178, 0.16), transparent 58%),
    linear-gradient(135deg, #070d18, #0d1a2e 58%, #08222c);
}
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000, transparent 76%);
  mask-image: radial-gradient(circle at 30% 30%, #000, transparent 76%);
  pointer-events: none;
}
.auth-hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.auth-hero-glow.one {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -120px;
  background: radial-gradient(circle, rgba(85, 164, 255, 0.32), transparent 66%);
}
.auth-hero-glow.two {
  width: 380px;
  height: 380px;
  left: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(53, 214, 178, 0.24), transparent 66%);
}
.auth-hero-brand,
.auth-hero-body,
.auth-hero-foot { position: relative; z-index: 1; }
.auth-hero-brand { display: flex; align-items: center; gap: 11px; }
.auth-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}
.auth-brand-text { min-width: 0; }
.auth-brand-text strong {
  display: block;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.auth-brand-text em {
  display: block;
  font-style: normal;
  color: rgba(232, 238, 247, 0.62);
  font-size: 11.5px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-hero-body { max-width: 620px; margin: auto 0; padding: 54px 0; }
.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #7fb2ff;
}
.auth-hero h1 {
  margin: 16px 0 18px;
  font-size: clamp(38px, 4vw, 64px);
  line-height: 1.05;
  letter-spacing: -2px;
  font-weight: 750;
}
.auth-hero h1 span {
  background: linear-gradient(90deg, #9ac8ff, #5eead4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-hero-copy {
  margin: 0;
  max-width: 520px;
  color: #b9c9dc;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.8;
}
.auth-hero-points {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #cbd8e8;
  font-size: 13.5px;
}
.auth-hero-points li { display: flex; align-items: center; gap: 10px; }
.auth-dot {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(53, 214, 178, 0.14);
  color: #5eead4;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.auth-hero-foot { color: #6f87a3; font-size: 11px; letter-spacing: 0.04em; }

.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 64px);
  background: var(--panel);
  border-left: 1px solid var(--border);
  min-width: 0;
}
.auth-theme {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.auth-theme:hover { color: var(--text); background: var(--panel-3); }
.auth-card { width: min(420px, 100%); }
.auth-mobile-brand { display: none; }
.auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 2.3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.7px;
}
.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { gap: 7px; }
.auth-field .field-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > .icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.auth-input-wrap .input {
  height: 44px;
  padding: 0 12px 0 40px;
  border-radius: 11px;
  background: var(--panel-2);
  font-size: 13.5px;
}
.auth-input-wrap.has-toggle .input { padding-right: 66px; }
.auth-input-wrap .input:focus { background: var(--panel); }
.auth-toggle {
  position: absolute;
  right: 8px;
  padding: 6px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 650;
}
.auth-toggle:hover { background: var(--accent-soft); }
.auth-submit {
  width: 100%;
  height: 44px;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 12px 26px rgba(47, 140, 255, 0.26);
}
.auth-submit:hover { transform: translateY(-1px); }
.auth-submit-arrow { font-size: 15px; line-height: 1; }
.auth-providers { margin-top: 18px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--faint);
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--border-soft); }
.auth-provider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.auth-provider:hover {
  border-color: var(--accent);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-1px);
}
.auth-provider-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.auth-provider-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.auth-provider-arrow { color: var(--faint); }
.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--faint);
  font-size: 11.5px;
}
.auth-foot-brand { font-weight: 650; letter-spacing: 0.04em; }
.auth-theme:focus-visible,
.auth-toggle:focus-visible,
.auth-provider:focus-visible,
.auth-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .auth-theme,
  .auth-toggle,
  .auth-provider,
  .auth-submit { transition: none; }
  .auth-provider:hover,
  .auth-submit:hover { transform: none; }
}

@media (max-width: 980px) {
  .auth-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .auth-hero { display: none; }
  .auth-panel {
    min-height: 100vh;
    min-height: 100dvh;
    align-items: flex-start;
    padding: 42px 22px 36px;
    border-left: 0;
    background:
      radial-gradient(760px 340px at 50% -130px, var(--accent-soft), transparent 70%),
      var(--panel);
  }
  .auth-theme { position: fixed; top: 14px; right: 14px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
  .auth-mobile-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .auth-mobile-brand .auth-brand-text strong { color: var(--text); }
  .auth-mobile-brand .auth-brand-text em { color: var(--muted); }
  .auth-card { width: min(440px, 100%); margin: 0 auto; }
  .auth-card h1 { font-size: 27px; }
}

@media (max-width: 560px) {
  .auth-panel { padding: 28px 16px 30px; }
  .auth-mobile-brand { margin-bottom: 22px; }
  .auth-card h1 { font-size: 25px; }
}

.portal-shell {
  grid-column: 1 / -1;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
}
.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-soft);
}
.portal-account { display: flex; align-items: center; gap: 10px; }
.account-name { font-size: 13px; color: var(--text-soft); }
.portal-main { width: 100%; padding: 34px 28px 60px; }
.portal-head h1 { margin: 0 0 6px; font-size: 24px; }
.portal-head p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.portal-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.portal-card-head { display: flex; align-items: flex-start; gap: 10px; }
.portal-card-title { flex: 1; min-width: 0; }
.portal-loading { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 30px 0; }

@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100vh; }
  .sidebar { display: none; }
  .main { height: auto; overflow: visible; }
  .mobile-head {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
  }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 14px; }
  .mobile-head-actions { display: flex; gap: 6px; }
  .mobile-nav {
    position: sticky;
    top: 59px;
    z-index: 19;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    overflow-x: auto;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
    scrollbar-width: none;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav .nav-item { padding: 7px 11px; white-space: nowrap; flex: none; }
  .page { padding: 16px 16px 40px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head h1 { font-size: 22px; }
  .stat-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 3vh 12px 20px; }
  .drawer { width: 100%; }
}

@media (max-width: 620px) {
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 3px; }
  .kv dd { margin-bottom: 6px; }
  .page-head h1 { font-size: 21px; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .designer-head { padding: 8px 10px; gap: 8px; }
  .designer-title p { display: none; }
}
