/* AI Project Tracker — shared design system
 *
 * Centryn Group brand: Navy #133354, Bronze #AE8F63.
 * Clean, professional, framework-free. All class names are generic and reusable
 * so the per-page agents can compose UI without writing their own CSS.
 */

/* ============================================================= Tokens ===== */
:root {
  /* Brand */
  --navy: #133354;
  --navy-700: #1c456e;
  --navy-300: #4a6c92;
  --bronze: #ae8f63;
  --bronze-600: #997a4f;
  --bronze-100: #efe6d6;

  /* Neutrals */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e7ee;
  --border-strong: #cdd5e0;
  --text: #1b2733;
  --text-muted: #5b6877;
  --text-faint: #8a96a3;

  /* Status palette */
  --green: #2e7d52;
  --green-bg: #e3f3ea;
  --amber: #b8860b;
  --amber-bg: #fbf1d8;
  --red: #b3261e;
  --red-bg: #fae6e4;
  --blue: #2563a8;
  --blue-bg: #e4eefa;
  --gray: #6b7785;
  --gray-bg: #eef1f5;

  /* Severity */
  --sev-critical: #8a1c16;
  --sev-critical-bg: #f7dedb;
  --sev-high: #b3261e;
  --sev-high-bg: #fae6e4;
  --sev-medium: #b8860b;
  --sev-medium-bg: #fbf1d8;
  --sev-low: #2e7d52;
  --sev-low-bg: #e3f3ea;

  /* Geometry */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(19, 51, 84, 0.06);
  --shadow: 0 4px 14px rgba(19, 51, 84, 0.08);
  --shadow-lg: 0 12px 32px rgba(19, 51, 84, 0.14);
  --container: 1080px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, 'Liberation Mono', monospace;
}

/* ============================================================= Reset ====== */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 0.4em;
  color: var(--navy);
  font-weight: 650;
  line-height: 1.25;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: 0.95rem; }

p { margin: 0 0 0.8em; }

a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); font-size: 0.86em; }

hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ============================================================ Layout ====== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.page { padding: 28px 0 64px; }

.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.stack-lg > * + * { margin-top: 1.75rem; }

.row { display: flex; gap: 12px; align-items: center; }
.row-wrap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.right { margin-left: auto; }

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

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.74rem; }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header .subtitle { color: var(--text-muted); margin: 2px 0 0; }

/* ============================================================ Nav bar ===== */
.nav {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 650;
  font-size: 1.05rem;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bronze);
  color: var(--navy);
  font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.92rem;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.nav-link-active { color: #fff; background: rgba(174, 143, 99, 0.32); }
.nav-logout { margin-left: 6px; }
.nav .btn-ghost { color: rgba(255, 255, 255, 0.9); border-color: rgba(255, 255, 255, 0.3); }
.nav .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ============================================================= Cards ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.card + .card { margin-top: 16px; }
.card-pad-lg { padding: 28px 30px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-header h2, .card-header h3 { margin: 0; }
.card-title { margin: 0 0 4px; }
.card-sub { color: var(--text-muted); font-size: 0.86rem; margin: 0; }
.card-muted { background: var(--surface-2); }
.card-accent { border-left: 4px solid var(--bronze); }

/* Clickable project / list card */
.list-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.list-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ============================================================ Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--navy-700); text-decoration: none; }
.btn:focus-visible { outline: 3px solid rgba(19, 51, 84, 0.3); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }

.btn-secondary { background: var(--bronze); color: #fff; }
.btn-secondary:hover { background: var(--bronze-600); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #951f18; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #25634090; }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--navy-300); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: transparent;
}
.btn-ghost:hover { background: rgba(19, 51, 84, 0.07); }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.btn-group { display: inline-flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================== Forms ===== */
.form { max-width: 720px; }
.form-wide { max-width: none; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

label, .label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.required { color: var(--red); font-weight: 700; }
.hint { color: var(--text-muted); font-size: 0.8rem; font-weight: 400; margin: 4px 0 0; }

input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
input[type='url'],
input[type='date'],
input[type='datetime-local'],
input[type='search'],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 150px; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--navy-300);
  box-shadow: 0 0 0 3px rgba(74, 108, 146, 0.18);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6877' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* Inline radio / checkbox groups (yes/no flags, outcomes) */
.choice-group { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}
.choice:hover { border-color: var(--navy-300); }
.choice input { width: auto; margin: 0; accent-color: var(--navy); }
.choice-selected { border-color: var(--navy); background: rgba(19, 51, 84, 0.06); font-weight: 600; }

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 400;
  color: var(--text);
}
.checkbox-line input { width: auto; margin-top: 2px; accent-color: var(--navy); }

.field-error { color: var(--red); font-size: 0.8rem; margin-top: 5px; }

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 18px;
}
legend {
  padding: 0 8px;
  font-weight: 650;
  color: var(--navy);
  font-size: 0.95rem;
}

/* ----- Repeatable row groups (milestones / acceptance criteria / log) ----- */
.repeat-group { display: flex; flex-direction: column; gap: 10px; }
.repeat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.repeat-row .repeat-fields { display: grid; gap: 10px; }
.repeat-row .repeat-fields.cols-2 { grid-template-columns: 1fr 1fr; }
.repeat-remove {
  align-self: start;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--red);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.repeat-remove:hover { background: var(--red-bg); border-color: var(--red); }
.repeat-add { align-self: flex-start; }
.repeat-index {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================= Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--gray-bg);
  color: var(--gray);
}
.badge-sm { padding: 2px 8px; font-size: 0.68rem; }

/* Stage badge */
.badge-stage { background: rgba(19, 51, 84, 0.1); color: var(--navy); }

/* Launch-prompt staleness */
.badge-current { background: var(--green-bg); color: var(--green); }
.badge-outdated { background: var(--amber-bg); color: var(--amber); }

/* Generic semantic */
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.badge-danger { background: var(--red-bg); color: var(--red); }
.badge-info { background: var(--blue-bg); color: var(--blue); }
.badge-neutral { background: var(--gray-bg); color: var(--gray); }

/* Lifecycle state */
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-on_hold, .badge-on-hold { background: var(--amber-bg); color: var(--amber); }
.badge-cancelled { background: var(--red-bg); color: var(--red); }

/* Stage status */
.badge-complete { background: var(--green-bg); color: var(--green); }
.badge-in_progress, .badge-in-progress { background: var(--blue-bg); color: var(--blue); }

/* LLM recommendation */
.badge-proceed { background: var(--green-bg); color: var(--green); }
.badge-caution { background: var(--amber-bg); color: var(--amber); }
.badge-donotproceed, .badge-do-not-proceed { background: var(--red-bg); color: var(--red); }

/* Severity badges (security gate items) */
.badge-severity { text-transform: capitalize; }
.badge-critical { background: var(--sev-critical-bg); color: var(--sev-critical); }
.badge-high { background: var(--sev-high-bg); color: var(--sev-high); }
.badge-medium { background: var(--sev-medium-bg); color: var(--sev-medium); }
.badge-low { background: var(--sev-low-bg); color: var(--sev-low); }

/* Severity colored left border for gate-item cards */
.sev-border-critical { border-left: 4px solid var(--sev-critical); }
.sev-border-high { border-left: 4px solid var(--sev-high); }
.sev-border-medium { border-left: 4px solid var(--sev-medium); }
.sev-border-low { border-left: 4px solid var(--sev-low); }

/* ========================================================= Score chips ==== */
.score-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.score-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.score-chip .score-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.score-chip .score-value {
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--navy);
  line-height: 1.1;
}
.score-chip .score-value .score-max { font-size: 0.8rem; font-weight: 500; color: var(--text-faint); }
/* Tone variants: callers can add these based on whether high is good/bad. */
.score-chip.tone-good { background: var(--green-bg); border-color: #c7e4d2; }
.score-chip.tone-good .score-value { color: var(--green); }
.score-chip.tone-warn { background: var(--amber-bg); border-color: #ecdcb0; }
.score-chip.tone-warn .score-value { color: var(--amber); }
.score-chip.tone-bad { background: var(--red-bg); border-color: #ecc7c4; }
.score-chip.tone-bad .score-value { color: var(--red); }

/* Single inline score pill */
.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  background: rgba(19, 51, 84, 0.08);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.82rem;
}

/* ============================================================= Tables ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--surface);
}
table.table th,
table.table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: var(--surface-2); }
table.table.table-fixed { table-layout: fixed; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 28px; text-align: center; color: var(--text-muted); }

/* ===================================================== LLM result panels === */
.llm-panel {
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
}
.llm-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.llm-panel-header .llm-title { margin: 0; font-size: 1rem; color: var(--navy); }
.llm-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bronze-100);
  color: var(--bronze-600);
  font-weight: 800;
  font-size: 0.8rem;
}
.llm-narrative { color: var(--text); margin: 0 0 12px; }
.llm-section { margin-top: 14px; }
.llm-section h4 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.llm-list { margin: 0; padding-left: 20px; }
.llm-list li { margin-bottom: 4px; }
.llm-advisory { border-left-color: var(--bronze); }
.llm-truncated {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* Findings list (completeness / security passes) */
.finding {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-2);
}
.finding + .finding { margin-top: 10px; }
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.finding-title { font-weight: 650; color: var(--navy); }

/* Launch prompt block (selectable / copyable text) */
.prompt-block {
  background: var(--navy);
  color: #e7eef6;
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow: auto;
}
.prompt-block-light {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.prompt-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

/* Spec snapshot / markdown render container */
.markdown {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
}

/* ====================================================== Error panels ====== */
.error-panel {
  border: 1px solid #ecc7c4;
  border-left: 4px solid var(--red);
  background: var(--red-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: #7e201a;
}
.error-panel h3, .error-panel h4 { color: var(--red); margin: 0 0 6px; }
.error-panel .error-actions { margin-top: 12px; display: flex; gap: 10px; }

.notice {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
}
.notice-info { background: var(--blue-bg); color: #1c4d82; border: 1px solid #c5dcf2; }
.notice-warn { background: var(--amber-bg); color: #8a6608; border: 1px solid #ecdcb0; }
.notice-success { background: var(--green-bg); color: #1f5c3c; border: 1px solid #c7e4d2; }

/* Hard-gate / blocking banner */
.gate-banner {
  border: 1px solid #ecdcb0;
  border-left: 4px solid var(--amber);
  background: var(--amber-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: #7d5d05;
  font-size: 0.9rem;
}
.gate-banner.gate-blocked {
  border-color: #ecc7c4;
  border-left-color: var(--red);
  background: var(--red-bg);
  color: #7e201a;
}
.gate-banner.gate-clear {
  border-color: #c7e4d2;
  border-left-color: var(--green);
  background: var(--green-bg);
  color: #1f5c3c;
}

/* ========================================================= Timeline ======= */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  position: relative;
  padding: 0 0 18px 28px;
  border-left: 2px solid var(--border);
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -8px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border-strong);
}
.timeline-item.is-complete .timeline-dot { border-color: var(--green); background: var(--green); }
.timeline-item.is-current .timeline-dot { border-color: var(--bronze); background: var(--bronze); }
.timeline-item.is-current { }
.timeline-stage { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.timeline-title { font-weight: 650; color: var(--navy); }
.timeline-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Stage progress strip (compact 1..11) */
.stage-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-pip {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--gray-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.stage-pip.done { background: var(--green); color: #fff; border-color: var(--green); }
.stage-pip.current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ============================================================ Toasts ====== */
.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--navy); }

/* ============================================================= Login ====== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--navy) 0%, #0d2741 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 30px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .nav-brand-mark { width: 44px; height: 44px; font-size: 1.3rem; margin: 0 auto 10px; }
.login-brand h1 { font-size: 1.3rem; margin: 0; }
.login-brand p { color: var(--text-muted); font-size: 0.86rem; margin: 4px 0 0; }

/* ============================================================ Utility ====== */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: app-spin 0.7s linear infinite;
  vertical-align: -2px;
}
.spinner-dark { border-color: rgba(19, 51, 84, 0.25); border-top-color: var(--navy); }
.spinner-lg { width: 26px; height: 26px; border-width: 3px; }
@keyframes app-spin { to { transform: rotate(360deg); } }

.loading-block { display: flex; align-items: center; gap: 10px; color: var(--text-muted); padding: 24px; justify-content: center; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state h3 { color: var(--text-muted); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 0.9rem; }
.kv dt { color: var(--text-muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--text); }

.divider-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 6px 0;
}
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ========================================================= Responsive ===== */
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .repeat-row { grid-template-columns: 1fr; }
  .repeat-row .repeat-fields.cols-2 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .nav-brand-text { display: none; }
  .nav-inner { height: 54px; }
  h1 { font-size: 1.4rem; }
}
