/* ==========================================================================
   Vantage design system
   Ported from designsource/"Vantage Login.dc.html". The token block below is
   the mock's :root verbatim; the light palette and accent handling come from
   its applyTheme(). Everything else in the app is built from these tokens so
   the admin panel and the login screen stay one design.
   ========================================================================== */

:root {
  --bg: #0A0B0D;
  --bg2: #101216;
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .20);
  --fg: #EDEAE4;
  --fg2: #99A0A8;
  --fg3: #8A9099;
  --field: #15181D;
  --ax: #C8F04F;
  --axfg: #0A0B0D;
  --pulse: #C8F04F;
  --focus: rgba(200, 240, 79, .28);
  --danger: #FF8A73;

  /* Extensions needed by the panel, derived from the same palette. */
  --ok: #9BE38B;
  --warn: #F5C451;
  --info: #7DD3FC;
  --raise: rgba(255, 255, 255, .03);
  --raise2: rgba(255, 255, 255, .06);
  --radius: 3px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Instrument Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --sidebar-w: 260px;
}

[data-theme="light"] {
  --bg: #F2F1EC;
  --bg2: #FFFFFF;
  --line: rgba(16, 18, 22, .12);
  --line2: rgba(16, 18, 22, .26);
  --fg: #13161A;
  --fg2: #585E67;
  --fg3: #6A7078;
  --field: #FAFAF8;
  --ax: #13161A;
  --axfg: #FBFAF7;
  --focus: rgba(19, 22, 26, .14);
  --danger: #B03A20;
  --ok: #2F7D32;
  --warn: #9A6B00;
  --info: #0E6F9E;
  --raise: rgba(16, 18, 22, .03);
  --raise2: rgba(16, 18, 22, .06);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  -webkit-font-smoothing: antialiased;
  font-family: var(--sans);
  color: var(--fg);
  min-height: 100vh;
}

input, select, textarea, button { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--fg3); }
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset;
  caret-color: var(--fg);
}
::selection { background: var(--pulse); color: #0A0B0D; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--pulse); }

:focus-visible {
  outline: 2px solid var(--pulse);
  outline-offset: 2px;
}

@keyframes vpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .3; transform: scale(.7); }
}
@keyframes vspin { to { transform: rotate(360deg); } }
@keyframes vrise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --- typography ---------------------------------------------------------- */

.v-mono {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--fg2);
  text-transform: uppercase;
}
.v-mono--dim { color: var(--fg3); }
.v-mono--tight { letter-spacing: .11em; }
.v-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--fg3);
  text-transform: uppercase;
}
.v-h1 {
  margin: 0;
  font-size: clamp(38px, 3.7vw, 58px);
  line-height: 1.02;
  letter-spacing: -.038em;
  font-weight: 600;
  text-wrap: balance;
}
.v-h2 {
  margin: 0;
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: -.028em;
  font-weight: 600;
}
.v-h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 600;
}
.v-lede { margin: 0; font-size: 17px; line-height: 1.55; color: var(--fg2); text-wrap: pretty; }
.v-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--fg2); text-wrap: pretty; }
.v-small { font-size: 13.5px; line-height: 1.45; color: var(--fg2); }
.v-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- the pulsing status dot from the mock -------------------------------- */

.v-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pulse);
  animation: vpulse 2.4s ease-in-out infinite;
  flex: none;
}
.v-dot--fast { animation-duration: 1.4s; }
.v-dot--static { animation: none; }
.v-dot--ok { background: var(--ok); }
.v-dot--warn { background: var(--warn); }
.v-dot--danger { background: var(--danger); }
.v-dot--idle { background: var(--fg3); animation: none; }

.v-statusline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--fg2);
  text-transform: uppercase;
}

/* --- the masked grid backdrop -------------------------------------------- */

.v-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(120% 95% at 6% 4%, #000 0%, transparent 70%);
  mask-image: radial-gradient(120% 95% at 6% 4%, #000 0%, transparent 70%);
  pointer-events: none;
}

/* --- logo lockup --------------------------------------------------------- */

.v-brand { position: relative; display: flex; align-items: center; gap: 13px; }
.v-brand__mark {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  flex: none;
}
.v-brand__text { display: flex; flex-direction: column; gap: 3px; }
.v-brand__name { font-size: 12px; font-weight: 600; letter-spacing: .24em; }
.v-brand__sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--fg3);
}

/* --- buttons ------------------------------------------------------------- */

.v-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, background .15s, filter .15s, transform .08s;
  white-space: nowrap;
}
.v-btn:hover { border-color: var(--fg2); background: var(--raise); color: var(--fg); }
.v-btn:active { transform: translateY(1px); }
.v-btn[disabled], .v-btn.is-disabled { opacity: .55; cursor: not-allowed; }
.v-btn[disabled]:active { transform: none; }

.v-btn--accent {
  height: 52px;
  border: 0;
  background: var(--ax);
  color: var(--axfg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
}
.v-btn--accent:hover { filter: brightness(1.08); background: var(--ax); color: var(--axfg); }

.v-btn--sm { height: 36px; padding: 0 13px; font-size: 13.5px; }
.v-btn--block { width: 100%; }
.v-btn--danger { border-color: var(--danger); color: var(--danger); }
.v-btn--danger:hover { border-color: var(--danger); background: rgba(255, 138, 115, .09); color: var(--danger); }

.v-btn--ghost {
  height: auto;
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.v-btn--ghost:hover { border-color: var(--pulse); color: var(--pulse); background: transparent; }

.v-btn__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, .25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: vspin .7s linear infinite;
  flex: none;
}
.v-btn--accent .v-btn__spinner { border-color: rgba(0, 0, 0, .25); border-top-color: currentColor; }
.v-btn:not(.v-btn--accent) .v-btn__spinner { border-color: var(--line2); border-top-color: currentColor; }

/* --- form fields --------------------------------------------------------- */

.v-form { display: flex; flex-direction: column; gap: 18px; }
.v-label { display: flex; flex-direction: column; gap: 9px; }
.v-label__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--fg2);
  text-transform: uppercase;
}

.v-field {
  height: 50px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--fg);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.v-field:focus { border-color: var(--line2); box-shadow: 0 0 0 3px var(--focus); }
.v-field--sm { height: 40px; font-size: 14px; }
.v-field--area { height: auto; min-height: 88px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.v-field--invalid { border-color: var(--danger); }
select.v-field {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg3) 50%),
                    linear-gradient(135deg, var(--fg3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select.v-field--sm { background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; }

.v-pwwrap { position: relative; display: flex; }
.v-pwwrap .v-field { flex: 1; padding-right: 74px; }
.v-pwtoggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: var(--fg3);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  cursor: pointer;
}
.v-pwtoggle:hover { color: var(--fg); }

.v-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--fg2);
  cursor: pointer;
}
.v-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--pulse);
  cursor: pointer;
  flex: none;
}
.v-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: .06em;
  color: var(--fg3);
  text-transform: uppercase;
}
.v-fieldnote { font-size: 12.5px; line-height: 1.45; color: var(--fg3); }
.v-caps {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--danger);
  text-transform: uppercase;
}

/* --- alerts -------------------------------------------------------------- */

.v-alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: rgba(255, 138, 115, .07);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--fg);
  animation: vrise .18s ease-out;
}
.v-alert__mark { font-family: var(--mono); color: var(--danger); flex: none; }
.v-alert--ok { border-color: var(--ok); background: rgba(155, 227, 139, .07); }
.v-alert--ok .v-alert__mark { color: var(--ok); }
.v-alert--warn { border-color: var(--warn); background: rgba(245, 196, 81, .07); }
.v-alert--warn .v-alert__mark { color: var(--warn); }
.v-alert--info { border-color: var(--line2); background: var(--raise); }
.v-alert--info .v-alert__mark { color: var(--info); }
.v-alert ul { margin: 4px 0 0; padding-left: 18px; }

/* --- cards & panels ------------------------------------------------------ */

.v-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  animation: vrise .2s ease-out;
}
.v-card--flat { background: transparent; }
.v-card > * { min-width: 0; }
.v-card--tight { padding: 18px; gap: 12px; }
.v-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.v-rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* the numbered 01/02/03 list from the story panel */
.v-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.v-list__row {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: baseline;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.v-list__n { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--fg3); }
.v-list__t { margin: 0; max-width: 44ch; font-size: 15.5px; line-height: 1.5; text-wrap: pretty; }

/* --- badges -------------------------------------------------------------- */

.v-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg2);
  white-space: nowrap;
}
.v-badge--accent { border-color: var(--pulse); color: var(--pulse); }
.v-badge--ok { border-color: var(--ok); color: var(--ok); }
.v-badge--warn { border-color: var(--warn); color: var(--warn); }
.v-badge--danger { border-color: var(--danger); color: var(--danger); }
.v-badge--muted { border-color: var(--line); color: var(--fg3); }

/* --- tables -------------------------------------------------------------- */

.v-tablewrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--field);
  max-width: 100%;
  min-width: 0;
}
.v-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.v-table th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--field);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg3);
  white-space: nowrap;
}
.v-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  vertical-align: middle;
}
.v-table tbody tr:last-child td { border-bottom: 0; }
.v-table tbody tr:hover { background: var(--raise); }
.v-table td.v-td-num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.v-table td.v-td-dim { color: var(--fg2); }
.v-table td.v-td-actions { text-align: right; white-space: nowrap; }
.v-table--fixed { table-layout: fixed; }
/* Timestamps and tag chips must never wrap mid-token - the table scrolls
   horizontally instead, which stays readable in a narrow column. */
.v-table td.v-td-ts {
  white-space: nowrap;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
.v-table td.v-td-tags { white-space: nowrap; }
.v-table td.v-td-tags .v-code { word-break: normal; white-space: nowrap; }

.v-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
  color: var(--fg3);
}
.v-empty__mark { font-family: var(--mono); font-size: 22px; color: var(--line2); }

/* --- stat tiles ---------------------------------------------------------- */

.v-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.v-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--field);
}
.v-stat__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg3);
}
.v-stat__value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.v-stat__meta { font-size: 12.5px; color: var(--fg2); }
.v-stat__value--accent { color: var(--pulse); }

/* --- pagination ---------------------------------------------------------- */

.v-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.v-pager__links { display: flex; gap: 8px; }

/* --- footers & meta rows ------------------------------------------------- */

.v-metarow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .11em;
  color: var(--fg3);
  text-transform: uppercase;
}
.v-metarow a { color: var(--fg2); }

/* --- login screen layout ------------------------------------------------- */

.v-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  background: var(--bg);
  color: var(--fg);
}
.v-story {
  position: relative;
  overflow: hidden;
  padding: 52px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 56px;
  border-right: 1px solid var(--line);
}
.v-story__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 560px;
}
.v-story__foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  color: var(--fg3);
  text-transform: uppercase;
}
.v-authpane {
  background: var(--bg2);
  padding: 52px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.v-authbox {
  width: 100%;
  max-width: 436px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.v-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--fg3);
  text-transform: uppercase;
}
.v-divider::before, .v-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --- misc utilities ------------------------------------------------------ */

.v-stack { display: flex; flex-direction: column; gap: 18px; }
.v-stack--sm { gap: 10px; }
.v-stack--lg { gap: 28px; }
.v-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.v-row--between { justify-content: space-between; }
.v-row--end { justify-content: flex-end; }
.v-grow { flex: 1; min-width: 0; }
.v-nowrap { white-space: nowrap; }
.v-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-hidden { display: none !important; }
.v-danger { color: var(--danger); }
.v-ok { color: var(--ok); }
.v-dim { color: var(--fg2); }
.v-dimmer { color: var(--fg3); }
.v-accent { color: var(--pulse); }
.v-code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--fg2);
  word-break: break-all;
}
.v-pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg2);
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.v-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--ax);
  color: var(--axfg);
  z-index: 100;
}
.v-skip:focus { left: 8px; top: 8px; }
.v-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .v-story { padding: 40px 28px; gap: 40px; border-right: 0; border-bottom: 1px solid var(--line); }
  .v-authpane { padding: 40px 28px; }
}
@media (max-width: 520px) {
  .v-split { grid-template-columns: 1fr; }
  .v-story { padding: 32px 20px; }
  .v-authpane { padding: 32px 20px; }
  .v-h2 { font-size: 26px; }
}
