/* ===================================================================
   Deedlock411 CM — Forensic Deed Fraud Research System
   Design language: "forensic intelligence console"
   Ink & charcoal surfaces, brass-gold accents, evidentiary typography.
=================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand */
  --brass:        #c9a24b;
  --brass-bright: #e3c478;
  --brass-deep:   #9a7b32;

  /* Ink surfaces (sidebar / topbar / login) */
  --ink-900: #0e1218;
  --ink-850: #141a23;
  --ink-800: #1a212c;
  --ink-700: #232c39;
  --ink-600: #303b4b;

  /* Paper surfaces (workspace) */
  --paper:    #f4f2ec;
  --paper-2:  #faf9f5;
  --card:     #ffffff;
  --line:     #e2ddd1;
  --line-2:   #ece8dd;

  /* Text */
  --ink:        #1b2330;
  --ink-soft:   #55607180;
  --muted:      #6b7480;
  --muted-2:    #9aa1ab;
  --on-ink:     #e8e9ec;
  --on-ink-dim: #8c95a3;

  /* Status */
  --green:  #2f7d5d;
  --amber:  #b9821f;
  --red:    #b23b34;
  --blue:   #3a6098;
  --slate:  #5b6675;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow-1:  0 1px 2px rgba(20,26,35,.06), 0 4px 16px rgba(20,26,35,.06);
  --shadow-2:  0 18px 50px -20px rgba(14,18,24,.45);
  --ring:      0 0 0 3px rgba(201,162,75,.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

button { font-family: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.view { display: none; }
.view.active { display: block; }

/* ===================================================================
   LOGIN
=================================================================== */
#loginView {
  min-height: 100vh;
  grid-template-columns: 1.1fr .9fr;
  background: var(--ink-900);
}
#loginView.active { display: grid; }
@media (max-width: 880px) { #loginView { grid-template-columns: 1fr; } }

.login-aside {
  position: relative;
  padding: 56px 60px;
  color: var(--on-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(201,162,75,.16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(58,96,152,.18), transparent 55%),
    linear-gradient(160deg, #0e1218 0%, #161d27 100%);
  overflow: hidden;
}
.login-aside::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(700px 600px at 70% 20%, #000, transparent 75%);
  pointer-events: none;
}
.login-aside > * { position: relative; z-index: 1; }
@media (max-width: 880px) { .login-aside { display: none; } }

.seal {
  width: 56px; height: 56px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brass-bright), var(--brass-deep));
  color: #1a130a; box-shadow: 0 10px 30px -10px rgba(201,162,75,.6);
}
.seal svg { width: 30px; height: 30px; }

.login-aside h1 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02; margin-top: 28px; color: #fff;
}
.login-aside h1 .gilt { color: var(--brass-bright); font-style: italic; }
.login-aside .lede { color: var(--on-ink-dim); max-width: 30ch; margin-top: 18px; font-size: 16px; }

.cred-list { display: grid; gap: 14px; margin-top: 8px; }
.cred-row { display: flex; gap: 13px; align-items: flex-start; }
.cred-row .tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--brass); color: var(--brass-bright);
  display: grid; place-items: center; font-size: 12px; margin-top: 2px;
}
.cred-row b { color: #f1ece1; font-weight: 600; }
.cred-row span { color: var(--on-ink-dim); font-size: 14px; }

.login-foot { color: #5d6676; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; }

.login-panel {
  display: grid; place-items: center; padding: 40px;
  background: var(--ink-850);
  border-left: 1px solid rgba(255,255,255,.04);
}
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, #1d2530, #171e28);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 34px 32px;
  box-shadow: var(--shadow-2);
}
.login-card .eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--brass); margin-bottom: 6px;
}
.login-card h2 { color: #fff; font-size: 26px; margin-bottom: 4px; }
.login-card .sub { color: var(--on-ink-dim); font-size: 13.5px; margin-bottom: 26px; }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--on-ink-dim); margin-bottom: 7px;
}
.field input, .field select {
  width: 100%; padding: 12px 13px; font-size: 14.5px;
  background: #0f141b; border: 1px solid #2b3543; border-radius: 10px; color: #eef1f5;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #5a6573; }
.field input:focus, .field select:focus { border-color: var(--brass); box-shadow: var(--ring); }

.clearance { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.clearance .role-btn {
  padding: 11px 6px; border-radius: 10px; border: 1px solid #2b3543;
  background: #11161e; color: var(--on-ink-dim); cursor: pointer;
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em; transition: all .16s;
}
.clearance .role-btn:hover { border-color: #3c4a5d; color: #cdd4dd; }
.clearance .role-btn.active {
  background: linear-gradient(180deg, rgba(201,162,75,.22), rgba(201,162,75,.08));
  border-color: var(--brass); color: var(--brass-bright);
  box-shadow: inset 0 0 0 1px rgba(201,162,75,.25);
}

.error-banner {
  background: rgba(178,59,52,.14); border: 1px solid rgba(178,59,52,.4);
  color: #ff9d96; padding: 10px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 14px;
}

/* ===================================================================
   BUTTONS
=================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .08s ease, background .16s, box-shadow .16s, border-color .16s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--brass-bright), var(--brass));
  color: #2a1e08; box-shadow: 0 8px 20px -10px rgba(201,162,75,.7);
}
.btn.primary:hover { box-shadow: 0 10px 26px -10px rgba(201,162,75,.9); }
.btn.full { width: 100%; padding: 13px; font-size: 14.5px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--paper-2); border-color: var(--muted-2); }
.btn.dark { background: var(--ink-800); color: var(--on-ink); }
.btn.dark:hover { background: var(--ink-700); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { filter: brightness(1.06); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===================================================================
   APP SHELL
=================================================================== */
#app { display: none; }
#app.active { display: block; }

.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--ink-900), var(--ink-850));
  color: var(--on-ink); padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; border-right: 1px solid rgba(255,255,255,.05);
}
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-lockup .seal { width: 38px; height: 38px; border-radius: 10px; }
.brand-lockup .seal svg { width: 21px; height: 21px; }
.brand-lockup .bt { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; color: #fff; line-height: 1; }
.brand-lockup .bs { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin-top: 3px; }

.nav-group-label {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: #5a6373; padding: 14px 10px 6px;
}
.nav-btn {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: transparent; color: var(--on-ink-dim);
  border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all .14s;
}
.nav-btn svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-btn:hover { background: rgba(255,255,255,.04); color: #e7eaef; }
.nav-btn.active {
  background: linear-gradient(90deg, rgba(201,162,75,.18), rgba(201,162,75,.03));
  color: var(--brass-bright);
  box-shadow: inset 2px 0 0 var(--brass);
}
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255,255,255,.05); }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brass-bright), var(--brass-deep)); color: #1a130a;
  font-weight: 700; font-size: 13px;
}
.who .nm { font-size: 13px; color: #eef1f5; font-weight: 600; line-height: 1.2; }
.who .rl { font-size: 11px; color: var(--brass); letter-spacing: .03em; }

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

.topbar {
  height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(250,249,245,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40;
}
.topbar .crumb { font-size: 13px; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 28px; max-width: 1340px; width: 100%; }

/* ===================================================================
   PAGE HEADER
=================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--brass-deep); margin-bottom: 5px;
}
.page-head h1 { font-size: 30px; color: var(--ink); }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 60ch; }

/* ===================================================================
   STAT CARDS
=================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-1);
}
.stat-card::after {
  content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  border-radius: 50%; background: radial-gradient(circle, rgba(201,162,75,.1), transparent 70%);
}
.stat-card .k { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat-card .k svg { width: 15px; height: 15px; color: var(--brass-deep); }
.stat-card .v { font-family: 'Fraunces', serif; font-size: 38px; font-weight: 600; color: var(--ink); margin-top: 10px; line-height: 1; }
.stat-card .d { font-size: 12.5px; color: var(--muted-2); margin-top: 7px; }
.stat-card.accent { background: linear-gradient(160deg, #1d2530, #151c25); border-color: #2a3340; }
.stat-card.accent .k { color: var(--on-ink-dim); }
.stat-card.accent .k svg { color: var(--brass-bright); }
.stat-card.accent .v { color: #fff; }
.stat-card.accent .d { color: var(--brass); }

/* ===================================================================
   PANELS / CARDS
=================================================================== */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); margin-top: 18px;
}
.panel-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.panel-hd h3 { font-size: 17px; }
.panel-hd .sub { font-size: 12.5px; color: var(--muted); }
.panel-bd { padding: 18px 20px; }
.panel-bd.flush { padding: 0; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols-3-1 { display: grid; grid-template-columns: 2.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .cols-2, .cols-3-1 { grid-template-columns: 1fr; } }

/* ===================================================================
   TABLES
=================================================================== */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.data th {
  text-align: left; padding: 12px 16px; background: var(--paper-2);
  color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr { transition: background .12s; cursor: default; }
table.data tbody tr:hover { background: #faf8f1; }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-ref { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted-2); }

/* ===================================================================
   PILLS / BADGES
=================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-active { background: #eaf3ef; color: var(--green); }
.pill-new    { background: #eaf0f8; color: var(--blue); }
.pill-warn   { background: #fbf2e0; color: var(--amber); }
.pill-critical { background: #fbe9e7; color: var(--red); }
.pill-done   { background: #eef0f2; color: var(--slate); }

.pri { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pri::before { content: ''; width: 7px; height: 7px; border-radius: 2px; }
.pri-normal { color: var(--slate); } .pri-normal::before { background: var(--slate); }
.pri-high { color: var(--amber); } .pri-high::before { background: var(--amber); }
.pri-critical { color: var(--red); } .pri-critical::before { background: var(--red); }

.phase-tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; font-weight: 600;
  color: var(--brass-deep); background: #f7f0dd; border: 1px solid #ecdfba;
  padding: 2px 8px; border-radius: 6px;
}

/* ===================================================================
   FILTER BAR
=================================================================== */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filterbar input, .filterbar select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px;
  background: var(--card); color: var(--ink); font-family: inherit;
}
.filterbar input.search { min-width: 240px; flex: 1; }
.filterbar input:focus, .filterbar select:focus { border-color: var(--brass); box-shadow: var(--ring); }

/* ===================================================================
   PHASE STEPPER (case workspace)
=================================================================== */
.stepper { display: flex; gap: 0; overflow-x: auto; padding: 4px; }
.step {
  flex: 1; min-width: 116px; position: relative; padding: 12px 12px 12px 16px; cursor: pointer;
  border: none; background: transparent; text-align: left; transition: background .14s;
}
.step + .step::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--line);
}
.step .sn {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 700; font-family: 'IBM Plex Mono', monospace;
  background: var(--paper); color: var(--muted); border: 1px solid var(--line); margin-bottom: 7px;
}
.step .st { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.step.done .sn { background: var(--green); color: #fff; border-color: var(--green); }
.step.done .st { color: var(--ink); }
.step.current { background: #f7f0dd80; border-radius: 10px; }
.step.current .sn { background: linear-gradient(150deg, var(--brass-bright), var(--brass)); color: #2a1e08; border-color: var(--brass); box-shadow: 0 4px 12px -4px rgba(201,162,75,.7); }
.step.current .st { color: var(--ink); }

/* ===================================================================
   FORMS (phase panels / modals)
=================================================================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.fld label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px; color: var(--ink);
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.fld textarea { min-height: 84px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { background: #fff; border-color: var(--brass); box-shadow: var(--ring); }

.switch { display: flex; align-items: center; gap: 11px; padding: 9px 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative;
  flex: none; transition: background .16s; cursor: pointer;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .16s;
}
.switch.on .track { background: var(--green); }
.switch.on .track::after { transform: translateX(18px); }
.switch .lbl { font-size: 13.5px; color: var(--ink); font-weight: 500; }

/* ===================================================================
   FRAUD PATTERN CATALOGUE (Phase 4)
=================================================================== */
.encumbrances { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 800px) { .encumbrances { grid-template-columns: repeat(2,1fr); } }
.enc-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: var(--paper-2); }
.enc-card .et { font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.pattern-list { display: grid; gap: 8px; }
.pattern {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card);
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.pattern:hover { border-color: var(--line); }
.pattern.flagged { border-color: var(--red); background: #fdf4f3; box-shadow: inset 3px 0 0 var(--red); }
.pattern .pn { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted-2); font-weight: 600; }
.pattern .pname { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pattern .psign { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.flag-toggle {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.flag-toggle.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ===================================================================
   CHECKLIST (Phase 5)
=================================================================== */
.checklist { display: grid; gap: 8px; }
.check-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card);
}
.check-row .cname { font-size: 13.5px; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--card); padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on-yes { background: var(--green); color: #fff; }
.seg button.on-no { background: var(--slate); color: #fff; }
.check-row input.note { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; font-family: inherit; min-width: 200px; }

/* ===================================================================
   ACTIVITY FEED
=================================================================== */
.feed { display: grid; gap: 2px; }
.feed-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brass); margin: 5px auto 0; box-shadow: 0 0 0 4px rgba(201,162,75,.14); }
.feed-item .ft { font-size: 13px; color: var(--ink); }
.feed-item .ft b { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.feed-item .fw { font-size: 12px; color: var(--muted-2); white-space: nowrap; }

/* ===================================================================
   META / DEFINITION LISTS
=================================================================== */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13.5px; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { color: var(--ink); font-weight: 500; text-align: right; }

.case-hero {
  background: linear-gradient(150deg, #1d2530, #141b24); color: var(--on-ink);
  border-radius: var(--radius); padding: 22px 24px; border: 1px solid #2a3340;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.case-hero .ref { font-family: 'IBM Plex Mono', monospace; color: var(--brass-bright); font-size: 13px; letter-spacing: .04em; }
.case-hero h2 { color: #fff; font-size: 24px; margin-top: 6px; }
.case-hero .addr { color: var(--on-ink-dim); font-size: 14px; margin-top: 4px; }
.case-hero .hero-meta { display: flex; gap: 22px; flex-wrap: wrap; }
.case-hero .hm .l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--on-ink-dim); }
.case-hero .hm .v { color: #fff; font-weight: 600; margin-top: 3px; }

/* ===================================================================
   MODALS
=================================================================== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(12,16,22,.55); backdrop-filter: blur(3px);
  align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto;
}
.modal-overlay.active { display: flex; animation: fade .18s ease; }
.modal-card {
  width: min(560px, 100%); background: var(--card); border-radius: 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow-2); animation: pop .2s ease;
}
.modal-card.lg { width: min(820px, 100%); }
.modal-hdr { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-hdr h3 { font-size: 19px; }
.modal-x { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 22px; }
.modal-ftr { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-2); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ===================================================================
   TOASTS
=================================================================== */
.toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px;
  padding: 12px 15px; border-radius: 11px; font-size: 13.5px; font-weight: 500;
  background: var(--ink-800); color: #eef1f5; border: 1px solid #2c3543;
  box-shadow: var(--shadow-2); animation: slidein .26s ease;
}
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); flex: none; }
.toast-success { border-color: rgba(47,125,93,.6); } .toast-success .toast-dot { background: #46c08a; }
.toast-error { border-color: rgba(178,59,52,.6); } .toast-error .toast-dot { background: #ef6b62; }
.toast-out { animation: slideout .26s ease forwards; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes slideout { to { opacity: 0; transform: translateX(20px); } }

/* ===================================================================
   EMPTY / SKELETON / MISC
=================================================================== */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ei { width: 46px; height: 46px; margin: 0 auto 12px; color: var(--muted-2); }
.empty h4 { font-size: 16px; color: var(--ink); margin-bottom: 5px; }
.empty p { font-size: 13.5px; max-width: 40ch; margin: 0 auto; }

.skeleton { background: linear-gradient(90deg, #ece8dd 25%, #f4f1e9 37%, #ece8dd 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.report-doc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 44px;
  max-width: 820px; margin: 0 auto; box-shadow: var(--shadow-1);
}
.report-doc .rh { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 16px; margin-bottom: 20px; }
.report-doc h2 { font-size: 24px; }
.report-doc .rmeta { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); }
.report-doc h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--brass-deep); margin: 22px 0 10px; font-family: 'IBM Plex Sans', sans-serif; }

.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.muted { color: var(--muted); }
.tier-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.tier-row:last-child { border-bottom: none; }
.bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; flex: 1; margin: 0 14px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--brass-deep)); border-radius: 999px; }

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  body { background: #fff; }
  .report-doc { border: none; box-shadow: none; }
}
