/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* ============================================================================
   Aegis Console — design system
   Two themes via CSS variables. Dark is the default (:root); light overrides
   under :root[data-theme="light"]. Everything is plain CSS — no dependencies.
   Webfont is loaded from a CDN but degrades gracefully to a system stack.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

/* ---- Tokens: DARK (default, "command center") ---- */
:root {
  color-scheme: dark;

  --bg: #0b0f1a;
  --bg-grad: radial-gradient(1200px 600px at 15% -10%, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(1000px 700px at 110% 0%, rgba(139, 92, 246, 0.1), transparent 55%);
  --panel: #121826;
  --panel-2: #161d2e;
  --surface: #121826;
  --surface-2: #161d2e;
  --surface-3: #1c2438;
  --elevated: #1a2135;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --hairline: rgba(255, 255, 255, 0.06);

  --text: #eef1f8;
  --text-2: #c3cbe0;
  --muted: #8a93ab;
  --faint: #838ba3;

  /* RHISE brand — the flame-orange is the BRAND voice (logo, hero, brand
     moments); the violet stays the WORKING accent (controls, focus, data). */
  --brand: #f0741e;
  --brand-2: #fda23a;
  --brand-grad: linear-gradient(135deg, #f0741e 0%, #fda23a 100%);
  --brand-soft: rgba(240, 116, 30, 0.14);
  --brand-text: #f0741e;
  --font-display: 'Sora', 'Inter', ui-sans-serif, system-ui, sans-serif;

  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-hover: #7c7ff5;
  --accent-text: #7c7ef3;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-border: rgba(99, 102, 241, 0.38);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-glow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 8px 24px -6px rgba(99, 102, 241, 0.5);

  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.14);
  --good-border: rgba(52, 211, 153, 0.34);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --warn-border: rgba(251, 191, 36, 0.32);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --danger-border: rgba(248, 113, 113, 0.34);

  --input-bg: #0e1421;
  --input-border: rgba(255, 255, 255, 0.1);
  --ring: rgba(99, 102, 241, 0.45);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 12px 40px -12px rgba(0, 0, 0, 0.7);

  --sidebar-w: 232px;
  --header-h: 60px;
}

/* ---- Tokens: LIGHT (clean modern SaaS) ---- */
:root[data-theme='light'] {
  color-scheme: light;

  --bg: #f5f7fb;
  --bg-grad: radial-gradient(1100px 560px at 12% -12%, rgba(99, 102, 241, 0.09), transparent 60%),
    radial-gradient(900px 620px at 108% -6%, rgba(139, 92, 246, 0.07), transparent 55%);
  --panel: #ffffff;
  --panel-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f1f4f9;
  --elevated: #ffffff;

  --border: #e4e8f0;
  --border-strong: #d3d9e6;
  --hairline: #eef1f6;

  --text: #0f172a;
  --text-2: #33415c;
  --muted: #63738a;
  --faint: #657286;

  --brand: #e2650f;
  --brand-2: #f5921e;
  --brand-grad: linear-gradient(135deg, #e2650f 0%, #f5921e 100%);
  --brand-soft: rgba(226, 101, 15, 0.1);
  --brand-text: #b9530c;

  --accent: #5457e6;
  --accent-2: #7c3aed;
  --accent-hover: #4649d6;
  --accent-text: #5457e6;
  --accent-soft: rgba(84, 87, 230, 0.09);
  --accent-border: rgba(84, 87, 230, 0.28);
  --accent-grad: linear-gradient(135deg, #5457e6 0%, #7c3aed 100%);
  --accent-glow: 0 0 0 1px rgba(84, 87, 230, 0.2), 0 8px 22px -8px rgba(84, 87, 230, 0.45);

  --good: #04815a;
  --good-soft: #ecfdf5;
  --good-border: #a7f3d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --input-bg: #ffffff;
  --input-border: #d7dde8;
  --ring: rgba(84, 87, 230, 0.3);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -6px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 16px 44px -14px rgba(15, 23, 42, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
}

body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
}

.muted {
  color: var(--muted);
}

h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-family: var(--font-display);
}
h2 {
  font-size: 17px;
  margin: 0 0 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
}
h3 {
  font-size: 12px;
  margin: 0 0 10px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================================
   App shell — header / sidebar / main
   ============================================================================ */

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}

.spacer {
  flex: 1 1;
}

/* Brand lockup */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-grad);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px var(--brand-soft), 0 8px 24px -6px rgba(240, 116, 30, 0.45);
  flex: 0 0 auto;
}
.brand-badge svg {
  width: 17px;
  height: 17px;
  color: #fff;
}
.brand-word {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.brand-word .name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--text);
  font-family: var(--font-display);
}
.brand-word .sub {
  font-size: 11px;
  color: var(--faint);
  font-weight: 500;
  white-space: nowrap;
}

/* Layout body: sidebar + main */
.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
}

.sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 45%, transparent);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.side-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-weight: 650;
  padding: 6px 12px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 550;
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0.85;
}
.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--accent-border);
}
.nav-item.active svg {
  color: var(--accent-text);
  opacity: 1;
}
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-weight: 600;
}
.nav-item.active .count {
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.app-main {
  min-width: 0;
  padding: 24px 28px 72px;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================================================
   Top-bar controls: identity chip, pill, buttons
   ============================================================================ */

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.identity-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.identity-text .who {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.identity-text .role {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Party badge — a compact chip that colors by party */
.party-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text-2);
  text-transform: uppercase;
}
.party-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.party-SURETY {
  color: var(--accent-2);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.party-PRODUCER {
  color: var(--good);
  border-color: var(--good-border);
  background: var(--good-soft);
}
.party-PRINCIPAL {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.13);
}
.party-OBLIGEE {
  color: var(--warn);
  border-color: var(--warn-border);
  background: var(--warn-soft);
}
.party-ADMIN {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid var(--accent-border);
  text-transform: uppercase;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-strong);
}
.icon-btn:active {
  transform: translateY(1px);
}

/* Notification unread badge on the header bell */
.notif-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--panel);
}

/* ============================================================================
   KPI stat cards
   ============================================================================ */

.stat-grid {
  display: grid;
  /* Auto-fit so KPI cards WRAP instead of clipping off-screen on narrow
     viewports (R2 of the UI review) — a hidden KPI is worse than none. */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  grid-gap: 14px;
  gap: 14px;
  margin-bottom: 26px;
}
.stat-card {
  min-width: 0;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent-grad);
  opacity: 0.9;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  flex: 0 0 auto;
}
.stat-icon svg {
  width: 16px;
  height: 16px;
}
.stat-value {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.stat-sub strong {
  color: var(--text-2);
  font-weight: 650;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   Sections, cards, list items
   ============================================================================ */

.section {
  margin-bottom: 30px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
}
.section-head .count-chip {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.item:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.snippet {
  color: var(--text-2);
  font-size: 13px;
  margin: 10px 0;
  overflow-wrap: anywhere;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}
.meta strong {
  color: var(--text);
  font-weight: 650;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.meta > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ============================================================================
   Forms
   ============================================================================ */

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--border-strong);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--ring);
}
textarea {
  resize: vertical;
  min-height: 76px;
}
input[type='checkbox'] {
  accent-color: var(--accent-text);
}
select {
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 14px;
  gap: 14px;
  margin-bottom: 12px;
}
.form-grid .full {
  grid-column: 1 / -1;
}

/* ============================================================================
   Buttons
   ============================================================================ */

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease,
    transform 0.05s ease, box-shadow 0.14s ease;
}
button:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

/* ============================================================================
   Accessibility utilities (WCAG 2.1 AA) — see docs/ACCESSIBILITY.md
   ============================================================================ */

/* Screen-reader-only text: present in the a11y tree, visually hidden. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link (WCAG 2.4.1 Bypass Blocks): off-screen until focused. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.12s ease;
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Links get a consistent visible focus ring (WCAG 2.4.7). */
a:focus-visible,
.nav-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: var(--radius-sm);
}
/* A focused <main> after a skip jump should not draw a distracting ring. */
main:focus {
  outline: none;
}

/* Forced-colors / Windows High Contrast ignores box-shadow, so guarantee a real
   outline for every interactive control in that mode (WCAG 2.4.7 / 1.4.11). */
@media (forced-colors: active) {
  a:focus-visible,
  button:focus-visible,
  .nav-item:focus-visible,
  input:focus,
  select:focus,
  textarea:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

/* both .primary and .btn.primary are used across pages */
button.primary,
.btn.primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, var(--shadow-sm);
}
button.primary:hover:not(:disabled),
.btn.primary:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: var(--accent-glow);
}

button.small {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 7px;
}

button.ghost,
.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
button.ghost:hover:not(:disabled),
.btn.ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* anchor buttons used on import/back links */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Inline SVG icons inherit intrinsic sizing nowhere — always constrain them
   inside buttons/section heads so an unsized icon can never take over the page. */
.btn svg,
button svg,
.section-head svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.btn {
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* ============================================================================
   Badges — the six color contract, in both themes
   ============================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  white-space: nowrap;
  /* neutral / default — bumped for WCAG AA on dark surfaces (R9) */
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-strong);
}
.badge.blue {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.34);
}
.badge.amber {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-border);
}
.badge.green {
  background: var(--good-soft);
  color: var(--good);
  border-color: var(--good-border);
}
.badge.red {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}
.badge.purple {
  background: var(--accent-soft);
  color: var(--accent-2);
  border-color: var(--accent-border);
}
.badge.gray {
  background: var(--surface-3);
  color: var(--muted);
  border-color: var(--border);
}

/* Light-theme badge tuning for legibility */
:root[data-theme='light'] .badge {
  background: #eef1f6;
  color: #475569;
  border-color: #dbe1ea;
}
:root[data-theme='light'] .badge.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
:root[data-theme='light'] .badge.amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
:root[data-theme='light'] .badge.green {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}
:root[data-theme='light'] .badge.red {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
:root[data-theme='light'] .badge.purple {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}
:root[data-theme='light'] .badge.gray {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

/* ============================================================================
   Banner (errors — compliance reasons) & toast
   ============================================================================ */

.banner {
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 18px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.banner.error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.banner ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.banner li {
  margin: 3px 0;
}
.banner code {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
/* Quiet informational banner (login "signed out due to inactivity" notice). */
.banner.notice {
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  color: var(--text-2);
}

/* ============================================================================
   Session-timeout toast (web/app/SessionGuard.tsx) — "Still there?" warning.
   Theme-aware via tokens; the global prefers-reduced-motion block neutralizes
   the entrance animation.
   ============================================================================ */

.session-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--warn-border);
  background: var(--elevated);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: session-toast-in 200ms ease-out;
}
@keyframes session-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.session-toast-icon {
  display: inline-flex;
  flex: none;
  color: var(--warn);
}
.session-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.session-toast-text strong {
  font-size: 13.5px;
}
.session-toast-text span {
  color: var(--text-2);
}
.session-toast-btn {
  flex: none;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.session-toast-btn:hover {
  background: var(--accent);
  color: #fff;
}
.session-toast-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* A button that reads as a link — used for "how?" disclosure toggles next to a
   number that needs explaining (e.g. how a premium was rated). Inherits the
   surrounding text size so it never disturbs the line it sits in. */
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--accent, #8b5cf6);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover:not(:disabled) {
  opacity: 0.8;
}
.link-btn:focus-visible {
  outline: 2px solid var(--accent, #8b5cf6);
  outline-offset: 2px;
  border-radius: 2px;
}

.close-x {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 6px;
}
.close-x:hover:not(:disabled) {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--elevated);
  border: 1px solid var(--good-border);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 550;
  animation: toast-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast .toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--good-soft);
  color: var(--good);
  flex: 0 0 auto;
}
.toast .toast-icon svg {
  width: 14px;
  height: 14px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================================
   Empty states, notes, skeletons
   ============================================================================ */

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 40%, transparent);
}
.empty svg {
  width: 26px;
  height: 26px;
  color: var(--faint);
}
.empty.inline {
  border: none;
  background: none;
  padding: 6px 0;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
}

.center-note {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  padding: 60px 20px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent-text);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(
    100deg,
    var(--surface-2) 30%,
    var(--surface-3) 50%,
    var(--surface-2) 70%
  );
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -20% 0;
  }
}

/* details/summary polish (claims docs, import report) */
details > summary {
  cursor: pointer;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 12.5px;
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: '▸ ';
  color: var(--faint);
}
details[open] > summary::before {
  content: '▾ ';
}
pre {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  color: var(--text-2);
}

/* ============================================================================
   Login
   ============================================================================ */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.login-hero {
  position: relative;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, #0d1220 0%, #141a2c 55%, #1a1440 120%);
  color: #fff;
  overflow: hidden;
}
.login-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 420px at 18% 12%, rgba(99, 102, 241, 0.32), transparent 60%),
    radial-gradient(620px 480px at 92% 88%, rgba(139, 92, 246, 0.26), transparent 60%);
  pointer-events: none;
}
.login-hero > * {
  position: relative;
  z-index: 1;
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-brand .brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.hero-brand .brand-badge svg {
  width: 23px;
  height: 23px;
}
.hero-brand .name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero-headline {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 15ch;
  margin: 0 0 14px;
}
.hero-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 42ch;
  margin: 0;
}
.hero-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
.hero-point {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
}
.hero-point .tick {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #c7d2fe;
  flex: 0 0 auto;
}
.hero-point .tick svg {
  width: 13px;
  height: 13px;
}
.hero-foot {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: var(--bg);
  background-image: var(--bg-grad);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
}
.login-card h2 {
  font-size: 20px;
  margin: 0 0 4px;
}
.login-card .sub {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 13.5px;
}
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  font-weight: 650;
}
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1 1;
  height: 1px;
  background: var(--border);
}

.party-group {
  margin-bottom: 16px;
}
.party-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dev-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 8px;
  gap: 8px;
}
.dev-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  text-align: left;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.dev-account:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: var(--surface-3);
}
.dev-account .glyph {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
}
.dev-account .da-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.dev-account .da-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dev-account .da-title {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dev-account .da-scope {
  font-size: 10px;
  color: var(--brand-text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   Responsive
   ============================================================================ */

/* stat-grid now wraps via auto-fit — no per-breakpoint column overrides needed. */

@media (max-width: 900px) {
  .overview-cols {
    grid-template-columns: 1fr !important;
  }
  .app-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    gap: 6px;
  }
  .side-label {
    display: none;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
    padding: 8px 12px;
  }
  .nav-item .count {
    display: none;
  }
  .app-main {
    padding: 18px 16px 60px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .brand-word .sub {
    display: none;
  }
  .identity-text {
    display: none;
  }
}

@media (max-width: 760px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }
  .login-hero {
    display: none;
  }
  .dev-buttons {
    grid-template-columns: 1fr;
  }
}

/* Phones / very narrow: keep the packed console header on one row without
   clipping or forcing horizontal scroll of the page. */
@media (max-width: 560px) {
  .app-header {
    gap: 8px;
    padding: 0 12px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
  /* The identity chip keeps only its avatar on phones (name already hidden
     at ≤900px); trim its padding so the controls fit. */
  .identity {
    padding: 4px;
    gap: 0;
  }
  .app-main {
    padding: 14px 12px 56px;
  }
  /* Bar-chart rows: shrink the fixed label column so the bar keeps room. */
  .bar-row {
    grid-template-columns: 84px 1fr auto !important;
  }
}


/* ============================================================================
   Compact density — tighten spacing for power users at scale.
   Toggled via document.documentElement.dataset.density = 'compact' | 'cozy'.
   Only spacing/size is touched — colors, borders, and semantics are untouched.
   ============================================================================ */

:root[data-density='compact'] .app-main {
  padding: 16px 20px 56px;
}
:root[data-density='compact'] .stat-grid {
  gap: 10px;
  margin-bottom: 18px;
}
:root[data-density='compact'] .stat-card {
  padding: 12px;
}
:root[data-density='compact'] .stat-head {
  margin-bottom: 7px;
}
:root[data-density='compact'] .stat-value {
  font-size: 23px;
}
:root[data-density='compact'] .stat-icon {
  width: 26px;
  height: 26px;
}
:root[data-density='compact'] .section {
  margin-bottom: 20px;
}
:root[data-density='compact'] .section-head {
  margin-bottom: 10px;
}
:root[data-density='compact'] .card {
  padding: 14px;
}
:root[data-density='compact'] .list {
  gap: 8px;
}
:root[data-density='compact'] .item {
  padding: 11px 12px;
}
:root[data-density='compact'] .snippet {
  margin: 7px 0;
}

/* ============================================================================
   Reduced motion — disable all transitions/animations
   ============================================================================ */

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

/* ---- Login: "Explore as…" dropdown picker (UX fix list item 1) ---------- */
.explore { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.explore-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.explore-select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border-strong); font-size: 14.5px;
}
.explore-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.persona-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--border);
}
.persona-card .glyph {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.persona-card .da-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.persona-card .da-name { font-weight: 600; color: var(--text); }
.persona-card .da-title { font-size: 12.5px; color: var(--text-2); }
.persona-card .da-scope { font-size: 12px; color: var(--muted); }
.explore-signin { width: 100%; }

/* ---- Header identity: avatar menu (UX fix list item 2) ------------------ */
.id-menu-wrap { position: relative; }
.id-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 4px 10px 4px 4px; cursor: pointer; color: var(--text);
}
.id-menu-btn:hover, .id-menu-btn[aria-expanded='true'] {
  border-color: var(--border-strong); background: var(--panel-2);
}
.id-menu-btn .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad); color: #fff; font-size: 12px; font-weight: 700;
}
.id-menu-btn .id-name { font-size: 13.5px; font-weight: 600; }
.id-menu-btn .party-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.id-menu-btn .chev { color: var(--muted); display: flex; }
.id-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 270px; max-width: 320px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,0.45);
  padding: 6px; display: flex; flex-direction: column;
}
.id-menu .id-block { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); }
.id-menu .id-block .full-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
.id-menu .id-block .id-title { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.id-menu .id-block .id-plan { font-size: 12px; color: var(--muted); margin-top: 4px; }
.id-menu .id-block .id-scope { font-size: 12px; color: var(--muted); }
.id-menu .menu-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px 4px;
}
.id-menu .menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  padding: 8px 12px; font-size: 13.5px; color: var(--text);
}
.id-menu .menu-item:hover { background: var(--panel-2); }
.id-menu .menu-item .mi-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.id-menu .menu-item .mi-sub { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.id-menu .menu-item.danger { color: #f87171; }
.id-menu .menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.id-menu .fb-inline { padding: 6px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.id-menu .fb-inline textarea {
  width: 100%; min-height: 64px; resize: vertical; border-radius: 8px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border-strong);
  font: inherit; font-size: 13px; padding: 8px 10px;
}
.id-menu .fb-inline .row { display: flex; gap: 8px; justify-content: flex-end; }
.page-title-crumb {
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- Inline claim action confirmation (UX fix list item 5) --------------- */
.claim-confirm {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border-strong);
}
.claim-confirm .cc-label { font-size: 13px; font-weight: 600; color: var(--text); }
.claim-confirm input[type='text'] {
  width: 130px; padding: 6px 9px; border-radius: 8px; font-size: 13.5px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border-strong);
}

/* ---- Cross-tool jump menu on feature pages (UX U6, light form) ----------- */
.tool-jump {
  padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: var(--panel-2); color: var(--text-2);
  border: 1px solid var(--border-strong); cursor: pointer; max-width: 130px;
}
.tool-jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

