/* Consilio identity service — dark theme, mirrors cifx/apps/web
   styling. Hand-rolled CSS (no Tailwind build) but keeps the same
   token semantics: slate-950 base, slate-900 surfaces, slate-800
   borders, indigo-500/600 accents, Inter font. Brand mark sources
   /wwwroot/favicon.svg (the cifx three-band gradient). */

:root {
  --bg: #020617;            /* slate-950 */
  --surface: #0f172a;       /* slate-900 */
  --surface-2: #1e293b;     /* slate-800 */
  --border: #1e293b;        /* slate-800 */
  --border-soft: #334155;   /* slate-700 */
  --text: #f8fafc;          /* slate-50 */
  --text-soft: #cbd5e1;     /* slate-300 */
  --text-muted: #94a3b8;    /* slate-400 */
  --text-faint: #64748b;    /* slate-500 */
  --primary: #6366f1;       /* indigo-500 */
  --primary-strong: #4f46e5;/* indigo-600 */
  --primary-hover: #4338ca; /* indigo-700 */
  --success: #34d399;       /* emerald-400 */
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.25);
  --danger-text: #fca5a5;   /* red-300 */
  --danger-strong: #f87171; /* red-400 */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 10px 25px -5px rgba(99, 102, 241, 0.25);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 120ms;
}
a:hover { color: #818cf8; text-decoration: underline; }

code {
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-soft);
}

/* ============================================================
   App shell — two-column hero/content for auth, single for app
   ============================================================ */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.hero {
  display: none;
  width: 50%;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  padding: 64px;
  background: #050b1f;
  border-right: 1px solid #0b1227;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.08), transparent 50%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero .brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(82, 115, 255, 0.35));
}

.brand-mark--lg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 4px 16px rgba(82, 115, 255, 0.45));
}

.hero .brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #00D0DB 0%, #5273FF 50%, #8D5BD9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Stacked brand lockup — primary line on top, "by Consilio"
   attribution below. Mirrors the docs site treatment. */
.brand-stack {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
  gap: 1px;
}

.brand-primary {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-secondary {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.brand-stack--lg .brand-primary {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-stack--lg .brand-secondary {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-top: 4px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 24px;
  color: #fff;
}

.hero h1 .accent { color: var(--primary); }

.hero p.tagline {
  font-size: 17px;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 28rem;
  margin: 0;
}

.hero .badge-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* Privacy / EULA links sit alongside the "Enterprise Identity" /
   "Secure" badges in the hero footer. They share the badge-row's
   uppercase typography but pick up the aurora accent (var(--primary))
   so they read as the same indigo as the "Consilio Intelligence"
   accent in the headline above. */
.hero .badge-row .badge-link {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
}
.hero .badge-row .badge-link:hover {
  color: #818cf8;
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .hero { display: flex; }
}

.app-content {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
}

/* For app pages with a top nav (grants, diagnostics) */
.app-shell.app-shell--nav {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.app-shell--nav .app-content {
  flex: 1 1 auto;
  width: 100%;
  padding: 32px 24px;
  align-items: stretch;
  justify-content: flex-start;
}

/* ============================================================
   Top nav (only used on authenticated pages)
   ============================================================ */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.top-nav .brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.top-nav .brand-row:hover { text-decoration: none; }

.top-nav .brand-mark { width: 22px; height: 22px; }

.top-nav nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.top-nav nav a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background 120ms, color 120ms;
}
.top-nav nav a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.top-nav nav a.active {
  background: var(--surface);
  color: var(--text);
}

.top-nav .signout {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   Auth-form column header
   ============================================================ */

.auth-card {
  width: 100%;
  max-width: 28rem;
}

/* Wide variant for data-dense auth pages (the workspace picker's datatable) —
   fills the auth column instead of the narrow sign-in width. */
.auth-card--wide {
  max-width: 56rem;
}

.mobile-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.mobile-brand .brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-brand .brand-mark { width: 24px; height: 24px; }
.mobile-brand .brand-name {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #00D0DB 0%, #5273FF 50%, #8D5BD9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@media (min-width: 1024px) {
  .mobile-brand { display: none; }
}

.auth-heading {
  margin-bottom: 24px;
}
.auth-heading h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 6px;
}
.auth-heading p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================================
   Card (used for consent, error, grants list, info panels)
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.card.card--accent {
  background: linear-gradient(135deg, var(--surface), rgba(15, 23, 42, 0.8));
  border-color: rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}
.card.card--accent::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
  pointer-events: none;
}
.card.card--accent > * { position: relative; z-index: 1; }

.card h1, .card h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 6px;
}

.card p.sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ============================================================
   Form fields
   ============================================================ */

.field { margin-bottom: 16px; }

.field label,
label.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}

.field input::placeholder { color: var(--text-faint); }

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: #0a1424;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary-hover));
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: filter 120ms, transform 120ms, box-shadow 120ms;
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-soft);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
  filter: none;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.25);
  color: #fff;
}

.btn-row {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Consent scope list
   ============================================================ */

.consent-scope {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  margin-bottom: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  font-weight: 400;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.consent-scope:hover { border-color: var(--border-soft); }

.consent-scope input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.consent-scope .scope-name {
  font-weight: 600;
  color: var(--text);
  display: block;
  font-size: 13px;
}

.consent-scope .scope-desc {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* User Consent Statement — verbatim block surfaced above the
   scope list on the consent page. The acknowledgement checkbox
   sits inside this block so the gate is visually adjacent to
   the statement copy. */
.consent-statement {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.consent-statement-heading {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.consent-statement-body {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-soft);
}

/* Acknowledgement row inside the statement block — strip the
   double-bordered look that comes from putting a bordered
   .consent-scope inside an already-bordered .consent-statement.
   The acknowledgement reads as part of the same panel. */
.consent-scope--statement {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.consent-scope--statement:hover { border-color: transparent; }

/* Scope-row layout (API scope checkboxes in "Requested permissions").
   Single flex-wrap container — checkbox / name / info badge sit on
   the first row inline; .scope-desc forces a wrap to the next row
   via flex-basis: 100% and aligns under the name with a left margin
   that matches the checkbox slot. Flat direct children avoid the
   nested-flex layout quirk that pushed the checkbox onto its own
   row in the previous structure. */
.consent-scope--scope {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
}
.consent-scope--scope > input[type="checkbox"] { flex: 0 0 auto; }
.consent-scope--scope > .scope-name {
  flex: 1 1 auto;
  display: inline;
  min-width: 0;
}
.consent-scope--scope > .scope-info { flex: 0 0 auto; }
.consent-scope--scope > .scope-desc {
  flex: 0 0 100%;
  /* checkbox (14px) + parent gap (12px) — keeps the description
     visually aligned under the scope name. */
  margin-left: 26px;
  margin-top: 0;
}

/* Per-scope info badge with CSS-only popover — answers the
   privacy team's "hover to see what this shares" requirement.
   Visible on :hover and :focus-within so keyboard users get
   the same affordance. We deliberately do NOT set title= on
   the badge: the browser's native tooltip would race the
   styled one and surface a duplicate after the hover delay. */
.scope-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: help;
  transition: color 120ms, background 120ms, border-color 120ms;
}
.scope-info:hover,
.scope-info:focus-visible {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.scope-info-glyph {
  font-style: italic;
  line-height: 1;
}

.scope-info-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 280px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-soft);
  line-height: 1.5;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms;
  z-index: 10;
  white-space: normal;
  text-align: left;
}
.scope-info:hover .scope-info-tooltip,
.scope-info:focus-visible .scope-info-tooltip,
.scope-info:focus-within .scope-info-tooltip {
  opacity: 1;
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}
.alert-error strong { color: var(--danger-strong); display: block; font-weight: 700; }

.alert-info {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

/* ============================================================
   "Sign in with other methods" disclosure on the login page

   Federated SSO is the strongly-favoured path; the local
   username/password form is tucked inside a <details> disclosure so
   the primary button (.btn-primary above) is the obvious choice. The
   summary is intentionally faint and small — it should read as a
   secondary affordance, not compete with the primary button.

   The disclosure auto-expands on a failed local-login submit (server
   sets the open attribute on the parent details element); see
   Login.cshtml.
   ============================================================ */

.auth-alt-methods {
  margin-top: 16px;
}

.auth-alt-methods > summary {
  list-style: none;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  padding: 6px 0;
  user-select: none;
  transition: color 120ms;
}
.auth-alt-methods > summary::-webkit-details-marker { display: none; }
.auth-alt-methods > summary:hover { color: var(--text-muted); }
.auth-alt-methods > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
  color: var(--text-muted);
}

.auth-alt-methods[open] > summary {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.auth-alt-methods__panel {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Footer block (under cards)
   ============================================================ */

.card-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Grants list (manage user grants)
   ============================================================ */

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

.grant-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.grant-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.grant-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.grant-item-id {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.grant-item-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 12px;
}

.grant-item-meta dt {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 11px;
}

.grant-item-meta dd {
  margin: 0;
  color: var(--text-soft);
  word-break: break-word;
}

.scope-pill {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 4px 4px 0;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-soft);
  font-family: var(--font-mono);
}

.grant-item-actions { margin-top: 16px; }
.grant-item-actions .btn { width: auto; padding: 8px 14px; font-size: 12px; }

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

/* ============================================================
   Diagnostics — claim table
   ============================================================ */

.claims-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mono);
}

.claims-table th,
.claims-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.claims-table th {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  background: var(--bg);
}

.claims-table td:first-child { color: var(--primary); width: 1%; white-space: nowrap; }
.claims-table td:last-child { color: var(--text-soft); }

/* ============================================================
   Page container (wider for grants/diagnostics)
   ============================================================ */

.page-container {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
}

/* Centered welcome card on the home page — single surface
   carrying the Welcome/Sign-in CTA, vertically centered in
   the available app-content area. */
.welcome-card {
  max-width: 28rem;
  margin: 10vh auto 0;
  text-align: center;
}
.welcome-card h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.welcome-card .btn { margin-top: 4px; }
.welcome-card .btn-row { gap: 12px; }

.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  color: var(--text);
}
.page-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================================
   Misc helpers
   ============================================================ */

.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
.center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* ============================================================
   Partner-auth workspace picker (flat workspace datatable)
   ============================================================ */
.matters-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.matters-search-wrap { flex: 1 1 auto; }
.matters-search {
  width: 100%; box-sizing: border-box; padding: 9px 12px; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--radius); outline: none;
}
.matters-search::placeholder { color: var(--text-faint); }
.matters-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
.matters-search:disabled { opacity: 0.5; cursor: not-allowed; }
.matters-count { flex: 0 0 auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.matters-table-wrap {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 14px; min-height: 120px;
}
.matters-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.matters-table thead th {
  text-align: left; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600; padding: 9px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.matters-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.matters-table tbody tr:last-child td { border-bottom: 0; }
.matters-table tbody tr:hover { background: var(--bg); }
.matters-table tbody tr.is-selected { background: rgba(99, 102, 241, 0.08); }
.col-check { width: 40px; }
.col-client { color: var(--text-muted); }
.cell-ws { color: var(--text); font-weight: 500; }
.cell-matter { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.matters-table input[type="checkbox"],
.matters-toolbar input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; margin: 0; }

.matters-empty { padding: 28px 14px; text-align: center; color: var(--text-muted); }

.matters-status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 10px; background: rgba(15, 23, 42, 0.7); color: var(--text-muted);
}
.matters-status[hidden] { display: none; }
.matters-status--error { color: var(--danger-text); }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border-soft); border-top-color: var(--primary);
  border-radius: 50%; animation: matters-spin 0.7s linear infinite;
}
@keyframes matters-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.matters-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.matters-pager__label { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
