/* ==========================================================================
   ProxyGuard dashboard - Apple-inspired dark design system
   --------------------------------------------------------------------------
   Materials: translucent fills + backdrop blur (vibrancy), SF Pro type stack,
   pill controls, Apple system colors, generous radii and whitespace.
   Every class used by public/ts/** must stay defined here.
   ========================================================================== */

:root {
  /* canvas + materials */
  --bg: #0a0a0c;
  --material-1: rgba(255, 255, 255, 0.035);
  --material-2: rgba(255, 255, 255, 0.055);
  --material-3: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* type */
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;

  /* Apple system colors */
  --accent: #0a84ff;
  --accent-2: #64d2ff;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --ok: #30d158;
  --ok-soft: rgba(48, 209, 88, 0.14);
  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, 0.15);
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.14);
  --purple: #bf5af2;

  /* geometry */
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --pill: 980px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 44px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sidebar-w: 248px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  /* ambient aurora - the only decoration on the canvas */
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(10, 132, 255, 0.10), transparent 62%),
    radial-gradient(820px 560px at -12% 108%, rgba(191, 90, 242, 0.07), transparent 60%),
    radial-gradient(700px 480px at 45% 120%, rgba(48, 209, 88, 0.045), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }

::selection { background: rgba(10, 132, 255, 0.32); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- layout */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 14px 16px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border-right: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 20px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand em { font-style: normal; color: var(--accent); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--accent), #5e5ce6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
}
.brand-mark svg { width: 18px; height: 18px; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-item svg { width: 17px; height: 17px; opacity: 0.8; transition: opacity 0.18s ease; }
.nav-item:hover { background: var(--material-2); color: var(--text); text-decoration: none; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--material-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.nav-item.active svg { color: var(--accent); opacity: 1; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--material-1);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent), var(--purple));
}

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line-soft);
}
.page-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

.view {
  flex: 1;
  padding: 32px 28px 56px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}
.view > * { animation: rise 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* -------------------------------------------- sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 20;
  animation: fadeIn 0.2s ease both;
}

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--material-1);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; }
.card-head .spacer { margin-left: auto; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.section-title {
  margin: 28px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* ----------------------------------------------------------------- stats */
.stat {
  background: var(--material-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
}
.stat .label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
}
.stat .label svg { width: 15px; height: 15px; }
.stat .value { font-size: 32px; font-weight: 600; margin-top: 10px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.stat.accent .value { color: var(--accent); }
.stat.danger .value { color: var(--danger); }
.stat.ok .value { color: var(--ok); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--material-2);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.08s ease, opacity 0.16s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--material-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 22px rgba(10, 132, 255, 0.28);
}
.btn-primary:hover { background: #3395ff; }
.btn-primary:active { background: #0071e3; }
.btn-primary.busy { position: relative; color: transparent; }
.btn-primary.busy::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-danger { background: var(--danger-soft); border-color: rgba(255, 69, 58, 0.3); color: #ff6961; }
.btn-danger:hover { background: rgba(255, 69, 58, 0.22); border-color: rgba(255, 69, 58, 0.45); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--material-2); color: var(--text); }

.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--material-2);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.icon-btn:hover { background: var(--material-3); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

/* ----------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); }

.input, .select, textarea.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--material-1);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(10, 132, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.18);
}
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; min-height: 76px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a6' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 44px; }
.input-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}
.input-eye:hover { color: var(--text); background: var(--material-2); }
.input-eye.on { color: var(--accent); }
.input-eye svg { width: 16px; height: 16px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }

/* ---------------------------------------------------------------- switch */
.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 26px;
  flex: none;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--pill);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: #4cd964; }
.badge-warn { background: var(--warn-soft); color: #ffb340; }
.badge-danger { background: var(--danger-soft); color: #ff6961; }
.badge-muted { background: var(--material-2); color: var(--text-2); }
.badge-accent { background: var(--accent-soft); color: #64b5ff; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--material-1);
  font-size: 12px;
  color: var(--text-2);
}
.pill-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

/* ---------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--material-1);
}
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.14s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table .ip { font-family: var(--mono); font-size: 12.5px; }
.table .muted { color: var(--text-3); }

/* ----------------------------------------------------------------- chart */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 156px;
  padding-top: 10px;
}
.chart .bar {
  position: relative;
  flex: 1;
  min-width: 4px;
  border-radius: 5px 5px 2px 2px;
  background: rgba(10, 132, 255, 0.4);
  transition: background 0.16s ease;
}
.chart .bar:hover { background: rgba(10, 132, 255, 0.7); }
.chart .bar .blocked {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 5px 5px 2px 2px;
  background: var(--danger);
}
.chart .bar .tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40, 40, 44, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11.5px;
  white-space: nowrap;
  z-index: 3;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.chart .bar:hover .tip { display: block; }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

/* ------------------------------------------------------------------ list */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-size: 13.5px; font-weight: 500; }
.list-item .sub { font-size: 12px; color: var(--text-3); }

/* ----------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 18px 40px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease both;
}
.modal {
  width: 100%;
  max-width: 560px;
  background: rgba(30, 30, 33, 0.9);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: modalIn 0.26s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.modal.modal-lg { max-width: 760px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 22px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
}

/* ----------------------------------------------------------------- toast */
.toast-host {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(40, 40, 44, 0.88);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  max-width: 380px;
  animation: toastIn 0.26s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.toast svg { width: 16px; height: 16px; flex: none; }
.toast-ok { border-color: rgba(48, 209, 88, 0.35); }
.toast-ok svg { color: var(--ok); }
.toast-error { border-color: rgba(255, 69, 58, 0.4); }
.toast-error svg { color: var(--danger); }
.toast.leaving { animation: toastOut 0.2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }

/* ======================================================================
   Auth screen - fully separate from the app shell
   ====================================================================== */
.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 72px 64px;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(760px 520px at 18% 8%, rgba(10, 132, 255, 0.22), transparent 62%),
    radial-gradient(620px 460px at 78% 96%, rgba(191, 90, 242, 0.16), transparent 60%);
}

.auth-orb {
  position: absolute;
  top: -180px;
  right: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, rgba(10, 132, 255, 0.5), rgba(100, 210, 255, 0.35), rgba(191, 90, 242, 0.4), rgba(10, 132, 255, 0.5));
  filter: blur(90px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-46px, 40px, 0) scale(1.08); }
}

.auth-hero-inner { position: relative; max-width: 520px; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--accent), #5e5ce6);
  color: #fff;
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.4);
}
.auth-brand-mark svg { width: 23px; height: 23px; }
.auth-brand-name em { font-style: normal; color: var(--accent); }

.auth-title {
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #ffffff, #b8c4dd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 460px;
  margin-bottom: 36px;
}

.auth-features { list-style: none; margin: 0 0 36px; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.auth-feature { display: flex; gap: 14px; align-items: flex-start; }
.auth-feature-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--material-2);
  border: 1px solid var(--line);
  color: var(--accent-2);
}
.auth-feature-icon svg { width: 18px; height: 18px; }
.auth-feature-title { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.auth-feature-text { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }

.auth-foot { font-size: 12.5px; color: var(--text-3); margin: 0; }

.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  animation: rise 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  background: var(--material-1);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  margin-bottom: 28px;
}
.seg button {
  padding: 7px 10px;
  border: none;
  border-radius: var(--pill);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.seg button.active {
  background: var(--material-3);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-heading { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--text-2); margin-bottom: 26px; }
.auth-form { display: block; }
.auth-error {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid rgba(255, 69, 58, 0.3);
  color: #ff6961;
  font-size: 13px;
}
.auth-error[hidden] { display: none; }
.auth-note { font-size: 12.5px; color: var(--text-3); margin: 20px 0 0; text-align: center; }

/* ------------------------------------------------------------- utils */
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.wrap-anywhere { overflow-wrap: anywhere; }
.code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
  overflow-x: auto;
}
.code-box .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
pre.code-block {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  max-height: 320px;
  overflow: auto;
  white-space: pre;
  margin: 0;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty svg { width: 34px; height: 34px; opacity: 0.5; margin-bottom: 12px; }
.empty h4 { color: var(--text-2); margin-bottom: 6px; font-size: 15px; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--material-1) 25%, var(--material-2) 50%, var(--material-1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  min-height: 18px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 12px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #64b5ff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(10, 132, 255, 0.3);
}
.step .step-body { font-size: 13.5px; color: var(--text-2); }
.step .step-body b { color: var(--text); font-weight: 600; }

.notice {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid rgba(10, 132, 255, 0.25);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.notice svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 2px; }
.notice-warn { background: var(--warn-soft); border-color: rgba(255, 159, 10, 0.3); }
.notice-warn svg { color: var(--warn); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters .field { margin-bottom: 0; min-width: 150px; flex: 1; }

.pagination { display: flex; justify-content: center; margin-top: 16px; }

/* --------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { border-right: none; border-bottom: 1px solid var(--line-soft); padding: 64px 40px; }
  .auth-pane { padding: 48px 24px 72px; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(78vw, 272px);
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .view { padding: 22px 18px 48px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .auth-hero { padding: 56px 28px; }
  .auth-features { gap: 16px; }
}

@media (max-width: 560px) {
  .cols-4 { grid-template-columns: 1fr; }
  .stat .value { font-size: 28px; }
  .modal-backdrop { padding: 3vh 10px 24px; }
  .row .btn { flex: 1; }
  .auth-title { font-size: 32px; }
  .auth-lead { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
