/* CID / Operations workspace — visual system refresh */
:root {
  color-scheme: light;
  --ink: #17191c;
  --ink-2: #202328;
  --ink-3: #2a2e34;
  --paper: #f3f4f2;
  --paper-2: #eceeeb;
  --surface: #ffffff;
  --surface-2: #f8f9f7;
  --line: #e4e7e2;
  --line-strong: #d7dbd5;
  --line-dark: rgba(255,255,255,.09);
  --text: #202329;
  --muted: #737982;
  --muted-2: #969ca3;
  --gold: #d8ad3d;
  --gold-bright: #edc85f;
  --gold-deep: #8f6b17;
  --gold-soft: #fbf5e4;
  --green: #2f7657;
  --red: #a9473d;
  --blue: #466d9c;
  --shadow-sm: 0 2px 8px rgba(22,28,22,.035);
  --shadow: 0 12px 32px rgba(22,28,22,.055);
  --shadow-lg: 0 24px 60px rgba(12,16,14,.14);
  --radius: 15px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(216,173,61,.38); outline-offset: 2px; }

.cid-app { min-height: 100vh; background: var(--paper); }
.app-frame { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }

/* Sidebar */
.sidebar {
  position: sticky; top: 0; z-index: 30; height: 100vh; min-height: 650px;
  display: flex; flex-direction: column; padding: 25px 17px 18px;
  color: #f3f4f0; background: var(--ink);
  border-right: 1px solid rgba(0,0,0,.12);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 7px 23px; border-bottom: 1px solid var(--line-dark);
}
.sidebar-brand img {
  width: 52px; height: 52px; flex: 0 0 52px; object-fit: contain;
  filter: drop-shadow(0 5px 13px rgba(216,173,61,.16));
}
.sidebar-brand span { display: grid; gap: 3px; min-width: 0; }
.sidebar-brand strong {
  color: #fff; font-size: 22px; line-height: 1; font-weight: 850;
  letter-spacing: .15em;
}
.sidebar-brand small {
  color: #8f949b; font-size: 8px; line-height: 1.4; font-weight: 800;
  letter-spacing: .13em; white-space: nowrap;
}
.sidebar-label {
  padding: 25px 12px 10px; color: #717780; font-size: 9px;
  font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
}
.side-nav { display: grid; gap: 5px; }
.side-nav a {
  min-height: 45px; display: flex; align-items: center; gap: 12px;
  padding: 0 12px; border: 1px solid transparent; border-radius: 9px;
  color: #aeb3ba; font-size: 12px; font-weight: 650;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.055); }
.side-nav a.is-active {
  color: #f2d47f; background: linear-gradient(90deg, rgba(216,173,61,.16), rgba(216,173,61,.07));
  border-color: rgba(216,173,61,.19); box-shadow: inset 2px 0 0 var(--gold);
}
.nav-symbol {
  width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center;
  color: #848b93; font-size: 16px; line-height: 1;
}
.nav-symbol svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a.is-active .nav-symbol { color: var(--gold-bright); }
.sidebar-spacer { flex: 1; min-height: 24px; }
.sidebar-status {
  display: flex; align-items: center; gap: 11px; margin: 0 0 14px; padding: 12px 11px;
  border: 1px solid var(--line-dark); border-radius: 10px; background: rgba(255,255,255,.025);
}
.sidebar-status > span:last-child { display: grid; gap: 2px; }
.sidebar-status strong { color: #dfe4dc; font-size: 9px; letter-spacing: .12em; }
.sidebar-status small { color: #777f87; font-size: 8px; letter-spacing: .045em; }
.status-pulse, .secure-pill i {
  width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%;
  background: #79b58a; box-shadow: 0 0 0 4px rgba(121,181,138,.12);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 4px 13px; border-top: 1px solid var(--line-dark); }
.avatar {
  width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center;
  border-radius: 10px; font-size: 13px; font-weight: 850;
}
.avatar-gold { color: #191a1c; background: linear-gradient(145deg, #f1d27a, #c99a2e); }
.sidebar-user-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.sidebar-user-copy strong { overflow: hidden; color: #f1f2ef; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { color: #8f969e; font-size: 9px; }
.user-settings {
  width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px;
  color: #a3a9b0; font-size: 16px; transition: background .16s, color .16s;
}
.user-settings:hover { color: var(--gold-bright); background: rgba(255,255,255,.07); }
.sidebar-logout button {
  width: 100%; height: 38px; padding: 0 11px; text-align: left;
  color: #a7adb4; background: transparent; border: 1px solid var(--line-dark);
  border-radius: 8px; font-size: 10px; font-weight: 650; transition: .16s ease;
}
.sidebar-logout button:hover { color: #f0d27c; border-color: rgba(216,173,61,.35); background: rgba(216,173,61,.05); }
.sidebar-logout button span { margin-right: 8px; }

/* Main header and content */
.main-column { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 74px; flex: 0 0 74px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 58px); background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.topbar-context { display: grid; gap: 3px; }
.topbar-overline { color: #9299a0; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.topbar-context strong { color: #20242a; font-size: 16px; line-height: 1.25; font-weight: 780; letter-spacing: -.025em; }
.topbar-right { display: flex; align-items: center; gap: 18px; color: #858c93; font-size: 10px; }
.secure-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px;
  color: #52665a; background: #f1f5f0; border: 1px solid #e3ebe1;
  border-radius: 30px; font-size: 8px; font-weight: 850; letter-spacing: .1em;
}
.secure-pill i { width: 6px; height: 6px; flex-basis: 6px; }
.topbar-date { color: #7d858c; font-size: 10px; font-variant-numeric: tabular-nums; }
.mobile-nav-toggle { display: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #fff; font-size: 18px; }
.page-content { width: 100%; max-width: 1660px; flex: 1; margin: 0 auto; padding: 34px clamp(24px, 4vw, 58px) 48px; }
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; padding: 17px clamp(24px, 4vw, 58px);
  color: #9aa0a4; border-top: 1px solid var(--line); background: rgba(255,255,255,.44);
  font-size: 8px; font-weight: 750; letter-spacing: .105em;
}

/* Feedback and page headings */
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 0 19px; padding: 12px 15px; border: 1px solid transparent;
  border-radius: 10px; font-size: 11px; font-weight: 650;
}
.flash button { padding: 0 3px; color: inherit; border: 0; background: transparent; font-size: 19px; opacity: .65; }
.flash-success { color: #2f674a; background: #edf6ef; border-color: #d9eadd; }
.flash-warning { color: #87651a; background: #fbf5e6; border-color: #eee1bd; }
.flash-error { color: #99453c; background: #fbefed; border-color: #f0d9d4; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 25px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; color: var(--gold-deep);
  font-size: 8px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase;
}
.page-heading h1 {
  margin: 7px 0 5px; color: #1d2227; font-size: clamp(26px, 3vw, 35px);
  line-height: 1.12; font-weight: 820; letter-spacing: -.055em;
}
.page-heading p { max-width: 690px; margin: 0; color: #737b83; font-size: 12px; line-height: 1.65; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* Buttons and links */
.button {
  min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 0 15px; color: #30353a; background: #fff; border: 1px solid transparent;
  border-radius: 9px; font-size: 10px; font-weight: 800; letter-spacing: .015em;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { color: #1c1b17; background: linear-gradient(135deg, #e8c45e, #d6aa36); border-color: #d5aa3c; box-shadow: 0 4px 10px rgba(170,128,29,.13); }
.button-primary:hover { background: linear-gradient(135deg, #f0d47a, #e0b94c); box-shadow: 0 7px 16px rgba(170,128,29,.19); }
.button-dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.button-dark:hover { background: #30343a; }
.button-outline { color: #424951; background: #fff; border-color: #dce1dc; box-shadow: var(--shadow-sm); }
.button-outline:hover { color: #805e12; background: #fffdf7; border-color: #d8bd76; }
.button-danger { color: #a0443c; background: #fff5f3; border-color: #f0d8d3; }
.button-small { min-height: 33px; padding: 0 11px; border-radius: 7px; font-size: 9px; }
.button-full { width: 100%; }
.text-link { color: #8a681b; font-size: 10px; font-weight: 800; }
.text-link:hover { color: #5d4511; text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }

/* Dashboard overview */
.dashboard-welcome {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  min-height: 220px; margin: 0 0 19px; padding: 30px 34px;
  color: #f7f7f3; background: linear-gradient(112deg, #191c20 0%, #22262b 60%, #292b2d 100%);
  border: 1px solid #2b3034; border-radius: 16px; box-shadow: 0 15px 32px rgba(19,22,23,.12);
}
.dashboard-welcome::before {
  content: ""; position: absolute; z-index: -1; inset: 0; opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: linear-gradient(90deg, transparent, #000 48%, #000);
}
.dashboard-welcome::after {
  content: ""; position: absolute; z-index: -1; width: 390px; height: 390px; right: 3%; top: -225px;
  border: 1px solid rgba(222,181,73,.28); border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(222,181,73,.035), 0 0 0 70px rgba(222,181,73,.025), 0 0 0 110px rgba(222,181,73,.018);
}
.welcome-copy { max-width: 700px; position: relative; z-index: 1; }
.welcome-copy .eyebrow { color: #e4c15f; }
.welcome-copy h1 { margin: 10px 0 9px; color: #fff; font-size: clamp(27px, 3.2vw, 38px); line-height: 1.14; font-weight: 800; letter-spacing: -.055em; }
.welcome-copy p { max-width: 610px; margin: 0; color: #bdc2c5; font-size: 12px; line-height: 1.75; }
.welcome-mark { width: 124px; height: 124px; flex: 0 0 124px; object-fit: contain; opacity: .96; filter: drop-shadow(0 8px 20px rgba(216,173,61,.18)); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 19px; }
.welcome-actions .button-outline { color: #e7e9e7; background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.16); box-shadow: none; }
.welcome-actions .button-outline:hover { color: #f1d27c; border-color: rgba(216,173,61,.55); background: rgba(216,173,61,.07); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 0 0 19px; }
.stat-card {
  min-width: 0; padding: 16px 17px 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #d8dcd5; box-shadow: var(--shadow); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #707880; font-size: 10px; font-weight: 700; }
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; color: #896819; background: var(--gold-soft); border: 1px solid #f1e7c9; border-radius: 9px; font-size: 15px; }
.stat-icon svg, .quick-action-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stat-number { margin: 12px 0 3px; color: #20252a; font-size: 29px; line-height: 1.05; font-weight: 820; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.stat-foot { color: #969da2; font-size: 9px; }

/* Panels and case rows */
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr); gap: 16px; align-items: start; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 65px; padding: 14px 18px; border-bottom: 1px solid #edf0ec;
}
.panel-head h2 { margin: 0; color: #24292e; font-size: 12px; line-height: 1.35; font-weight: 800; letter-spacing: -.018em; }
.panel-head p { margin: 4px 0 0; color: #90979c; font-size: 9px; line-height: 1.5; }
.panel-body { padding: 17px 18px; }
.case-list { display: grid; }
.case-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  border-bottom: 1px solid #eff1ed; transition: background .14s ease;
}
.case-row:last-child { border-bottom: 0; }
.case-row:hover { background: #fafbf8; }
.case-ref {
  width: 41px; height: 41px; flex: 0 0 41px; display: grid; place-items: center;
  color: #e9c96d; background: #22262a; border: 1px solid #31363a; border-radius: 10px;
  font-size: 9px; font-weight: 850; letter-spacing: .05em;
}
.case-row-main { min-width: 0; flex: 1; }
.case-row-main strong { display: block; overflow: hidden; color: #2a3035; font-size: 11px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.case-row-main small { display: block; margin-top: 3px; overflow: hidden; color: #92999e; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.case-row-meta { display: grid; justify-items: end; gap: 5px; flex: 0 0 auto; }
.case-row-meta small { color: #9ba1a5; font-size: 8px; }
.status-badge, .priority-badge, .role-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 22px; padding: 3px 8px; border: 1px solid transparent; border-radius: 30px;
  font-size: 8px; font-weight: 850; letter-spacing: .015em; white-space: nowrap;
}
.status-open { color: #426d4c; background: #edf5ed; border-color: #dfebdf; }
.status-in_progress { color: #3c648f; background: #edf3fa; border-color: #dce7f3; }
.status-closed { color: #71787c; background: #f0f2f1; border-color: #e5e8e6; }
.status-archived { color: #806b4e; background: #f5f0e8; border-color: #ece4d7; }
.priority-low { color: #68756c; background: #f0f4f0; border-color: #e3ebe3; }
.priority-normal { color: #7c6a37; background: #f7f3e8; border-color: #ede5d0; }
.priority-high { color: #93691b; background: #fff4dc; border-color: #f3e5bf; }
.priority-urgent { color: #a0443b; background: #fbefed; border-color: #f1dcd7; }
.role-chip { color: #78601f; background: #f8f3e5; border-color: #eee4c9; }
.empty-state { padding: 34px 20px; color: #8d959b; text-align: center; font-size: 10px; line-height: 1.65; }
.empty-state strong { display: block; margin-bottom: 5px; color: #3c4348; font-size: 13px; font-weight: 800; }
.quick-actions { display: grid; gap: 8px; }
.quick-action {
  display: flex; align-items: center; gap: 11px; padding: 11px;
  border: 1px solid #edf0eb; border-radius: 10px; background: #fff;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.quick-action:hover { transform: translateY(-1px); border-color: #dfc77f; background: #fffdf7; }
.quick-action-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: #886819; background: #faf4e3; border: 1px solid #f1e7ca; border-radius: 9px; font-size: 15px; }
.quick-action span:last-child { display: grid; gap: 2px; min-width: 0; }
.quick-action strong { color: #343a3f; font-size: 10px; font-weight: 780; }
.quick-action small { color: #92999f; font-size: 8px; line-height: 1.5; }

/* Case register, filters, tables */
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px; padding: 11px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm);
}
.filter-bar input, .filter-bar select {
  height: 35px; padding: 0 10px; color: #40474d; background: #fbfcfa;
  border: 1px solid #e4e8e2; border-radius: 7px; outline: none; font-size: 9px;
}
.filter-bar input { flex: 1; min-width: 220px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #c9a84e; box-shadow: 0 0 0 3px rgba(216,173,61,.12); background: #fff; }
.filter-count { margin-left: auto; color: #8d959a; font-size: 9px; font-weight: 700; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.data-table th {
  padding: 11px 14px; color: #899198; background: #f8f9f7; border-bottom: 1px solid #e9ede8;
  text-align: left; font-size: 8px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.data-table td { padding: 13px 14px; color: #535b61; border-bottom: 1px solid #eff1ed; font-size: 9px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .13s ease; }
.data-table tbody tr:hover { background: #fafbf8; }
.table-title { display: inline-grid; vertical-align: middle; gap: 3px; }
.table-title a, .table-title strong { color: #293036; font-size: 10px; font-weight: 800; }
.table-title a:hover { color: #8b6818; }
.table-title small { color: #939ba0; font-size: 8px; }
.table-muted { color: #a0a6aa; font-size: 9px; }
.nowrap { white-space: nowrap; }

/* Forms */
.form-card { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label, .field-label { color: #515960; font-size: 9px; font-weight: 800; letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 41px; padding: 9px 11px; color: #282f35; background: #fbfcfa;
  border: 1px solid #dfe4de; border-radius: 8px; outline: none; font-size: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input::placeholder, .field textarea::placeholder { color: #aab0b3; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #cba74a; box-shadow: 0 0 0 3px rgba(216,173,61,.12); background: #fff; }
.field input:disabled { color: #7e858b; background: #f1f3f0; cursor: not-allowed; }
.field textarea { min-height: 112px; resize: vertical; line-height: 1.65; }
.field-hint { color: #929a9e; font-size: 8px; line-height: 1.55; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 17px; padding-top: 15px; border-top: 1px solid #edf0eb; }
.form-error { margin: 0 0 14px; padding: 11px 13px; color: #98483f; background: #fbefed; border: 1px solid #f0d9d4; border-radius: 9px; font-size: 10px; font-weight: 650; }

/* Case detail */
.case-hero {
  position: relative; isolation: isolate; overflow: hidden; margin: 0 0 16px; padding: 25px 27px;
  color: #f4f5f1; background: linear-gradient(110deg, #1a1e22 0%, #252a2e 75%, #2d302f 100%);
  border: 1px solid #30363a; border-radius: 14px; box-shadow: 0 12px 25px rgba(23,26,27,.1);
}
.case-hero::before {
  content: ""; position: absolute; z-index: -1; width: 315px; height: 315px; right: 7%; top: -202px;
  border: 1px solid rgba(218,178,73,.25); border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(218,178,73,.035), 0 0 0 62px rgba(218,178,73,.022);
}
.case-hero-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.case-number { color: #dfbf67; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.case-hero h1 { margin: 8px 0 9px; color: #fff; font-size: clamp(23px, 2.8vw, 31px); line-height: 1.16; font-weight: 820; letter-spacing: -.05em; }
.case-hero p { max-width: 900px; margin: 0; color: #bac0c2; font-size: 10px; line-height: 1.8; white-space: pre-wrap; }
.case-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 2px; }
.case-hero .status-badge, .case-hero .priority-badge { color: #e9ece8; background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.1); }
.case-hero .status-open { color: #b7d9b8; background: rgba(105,166,112,.14); border-color: rgba(105,166,112,.2); }
.case-hero .status-in_progress { color: #b9d1ef; background: rgba(92,140,196,.16); border-color: rgba(92,140,196,.2); }
.case-hero .status-closed { color: #d0d5d3; }
.case-hero .priority-high, .case-hero .priority-urgent { color: #f0d27a; background: rgba(216,173,61,.13); border-color: rgba(216,173,61,.2); }
.case-detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(285px, .82fr); gap: 15px; align-items: start; }
.case-main-stack, .case-side-stack { display: grid; gap: 15px; min-width: 0; }
.member-list { display: grid; gap: 12px; }
.member-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-avatar { width: 33px; height: 33px; flex: 0 0 33px; display: grid; place-items: center; color: #795b17; background: #f8f1dd; border: 1px solid #eee3c5; border-radius: 9px; font-size: 10px; font-weight: 850; }
.member-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.member-copy strong { color: #343b40; font-size: 9px; font-weight: 800; }
.member-copy small { color: #969da1; font-size: 8px; }
.link-list, .attachment-list, .note-list { display: grid; gap: 9px; }
.link-item, .attachment-item {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px;
  background: #fff; border: 1px solid #e9ede8; border-radius: 9px;
}
.link-icon, .file-icon {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  color: #86651a; background: #faf4e3; border: 1px solid #f0e6c9; border-radius: 8px; font-size: 12px; font-weight: 850;
}
.link-copy, .file-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.link-copy strong, .file-copy strong { overflow: hidden; color: #384047; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.link-copy small, .file-copy small { overflow-wrap: anywhere; color: #929a9e; font-size: 8px; line-height: 1.5; }
.link-actions { display: flex; align-items: center; gap: 5px; }
.mini-action { padding: 5px; color: #876518; background: transparent; border: 0; border-radius: 5px; font-size: 8px; font-weight: 850; }
.mini-action:hover { color: #59420f; background: #faf4e4; }
.note-card { padding: 13px 14px; background: #fff; border: 1px solid #e9ede8; border-radius: 10px; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.note-head strong { color: #384047; font-size: 9px; font-weight: 800; }
.note-head small { color: #9ba2a6; font-size: 8px; white-space: nowrap; }
.note-card p { margin: 0; color: #5b646a; font-size: 9px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.attachment-card { overflow: hidden; background: #fff; border: 1px solid #e5e9e4; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.attachment-card:hover { border-color: #d5c18b; box-shadow: var(--shadow-sm); }
.attachment-preview { height: 145px; display: grid; place-items: center; overflow: hidden; background: #eef0ed; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.attachment-card:hover .attachment-preview img { transform: scale(1.025); }
.attachment-preview .file-icon { width: 48px; height: 48px; font-size: 18px; }
.attachment-preview video { display: block; width: 100%; height: 100%; max-height: 190px; object-fit: contain; background: #101316; }
.attachment-info { padding: 10px; }
.attachment-info strong { display: block; overflow: hidden; color: #343c42; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.attachment-info small { display: block; margin-top: 3px; color: #959da1; font-size: 8px; line-height: 1.5; }
.attachment-info .button { width: 100%; min-height: 29px; margin-top: 9px; font-size: 8px; }
.inline-form { display: inline; }
.activity-list { display: grid; }
.activity-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eff1ed; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; color: #86651a; background: #faf4e3; border: 1px solid #f0e6c9; border-radius: 8px; font-size: 10px; }
.activity-copy { display: grid; min-width: 0; gap: 3px; }
.activity-copy strong { color: #424a50; font-size: 9px; font-weight: 800; }
.activity-copy p { margin: 0; color: #7d868c; font-size: 9px; line-height: 1.55; }
.activity-copy small { color: #9ca3a7; font-size: 8px; line-height: 1.5; }

/* People and account administration */
.user-table-avatar { width: 29px; height: 29px; display: inline-grid; place-items: center; margin-right: 8px; color: #7e6019; background: #f8f1df; border: 1px solid #eee4c9; border-radius: 8px; font-size: 9px; font-weight: 850; vertical-align: middle; }
.account-state { font-size: 8px; font-weight: 850; letter-spacing: .03em; }
.account-active { color: #397451; }
.account-inactive { color: #a44940; }
.danger-zone { padding: 15px; background: #fff8f6; border: 1px solid #f0d8d2; border-radius: 10px; }
.danger-zone h3 { margin: 0 0 4px; color: #98483e; font-size: 10px; }
.danger-zone p { margin: 0 0 12px; color: #987b76; font-size: 9px; }

/* Authentication and first-run */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  color: #fff; background: #171a1d;
}
.auth-brand-side {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  justify-content: space-between; min-height: 100vh; padding: clamp(35px, 6vw, 82px);
  background: radial-gradient(ellipse at 18% 30%, rgba(216,173,61,.13), transparent 38%), linear-gradient(135deg, #181c20 0%, #20252a 54%, #171a1d 100%);
}
.auth-brand-side::before {
  content: ""; position: absolute; z-index: -1; width: 650px; height: 650px; left: -245px; bottom: -390px;
  border: 1px solid rgba(220,184,86,.2); border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(220,184,86,.025), 0 0 0 90px rgba(220,184,86,.018), 0 0 0 145px rgba(220,184,86,.012);
}
.auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.auth-logo img { width: 70px; height: 70px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(216,173,61,.16)); }
.auth-logo strong { display: block; color: #fff; font-size: 25px; line-height: 1; font-weight: 850; letter-spacing: .14em; }
.auth-logo small { display: block; margin-top: 5px; color: #989fa3; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.auth-message { position: relative; z-index: 1; max-width: 620px; }
.auth-message .eyebrow { color: #e6c66d; }
.auth-message h1 { margin: 17px 0; color: #fff; font-size: clamp(39px, 5vw, 64px); line-height: 1.03; font-weight: 830; letter-spacing: -.065em; }
.auth-message h1 span { color: #e6c15b; }
.auth-message p { max-width: 480px; color: #b6bdc0; font-size: 12px; line-height: 1.85; }
.auth-brand-foot { position: relative; z-index: 1; color: #798187; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(30px, 5vw, 68px); color: #20262b; background: #f7f8f5; }
.auth-card { width: 100%; max-width: 390px; }
.auth-card .section-eyebrow { color: #94701b; font-size: 8px; font-weight: 850; letter-spacing: .17em; }
.auth-card h2 { margin: 9px 0 6px; color: #20262b; font-size: 30px; line-height: 1.15; font-weight: 820; letter-spacing: -.055em; }
.auth-card > p { margin: 0 0 23px; color: #818a90; font-size: 10px; line-height: 1.65; }
.auth-form { display: grid; gap: 13px; }
.auth-form .field input { height: 45px; background: #fff; }
.auth-form .button { min-height: 47px; margin-top: 3px; }
.auth-foot { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; color: #929a9e; font-size: 8px; line-height: 1.65; }
.auth-foot span { color: #96721d; }
.auth-error, .auth-success { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; font-size: 9px; line-height: 1.6; }
.auth-error { color: #98473e; background: #fbefed; border: 1px solid #f0d9d4; }
.auth-success { color: #3d704d; background: #edf6ef; border: 1px solid #dbeadf; }
.auth-back { display: block; margin-top: 19px; color: #8b6919; font-size: 9px; font-weight: 800; }
.install-note { margin-top: 14px; color: #8b9499; font-size: 8px; line-height: 1.7; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: #a2a8ab; }
.auth-or span { height: 1px; flex: 1; background: #e0e4de; }
.auth-or small { font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.button-discord { min-height: 47px; color: #fff; background: #5865f2; border: 1px solid #5865f2; box-shadow: 0 4px 12px rgba(88,101,242,.14); }
.button-discord:hover { color: #fff; background: #4752c4; border-color: #4752c4; box-shadow: 0 7px 17px rgba(88,101,242,.2); }
.discord-mark { display: inline-grid; place-items: center; font-size: 17px; line-height: 1; }
.discord-mark svg { width: 18px; height: 18px; display: block; }
.auth-discord-note { margin-top: 9px; color: #899297; font-size: 8px; line-height: 1.6; text-align: center; }

/* Upload interface */
.upload-progress { margin: 13px 0 3px; padding: 12px 13px; background: #fffdf7; border: 1px solid #eee3c5; border-radius: 9px; }
.upload-progress[hidden] { display: none; }
.upload-progress-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: #596168; font-size: 9px; }
.upload-progress-label strong { color: #886719; font-variant-numeric: tabular-nums; }
.upload-progress progress { display: block; width: 100%; height: 8px; accent-color: #d6aa36; }
.upload-progress small { display: block; margin-top: 7px; color: #90999e; font-size: 8px; line-height: 1.55; }

/* Responsive */
@media (max-width: 1180px) {
  .app-frame { grid-template-columns: 235px minmax(0, 1fr); }
  .sidebar { padding-right: 13px; padding-left: 13px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-detail-grid { grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr); }
}
@media (max-width: 860px) {
  .app-frame { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 275px; height: 100dvh; min-height: 0; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.28); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; display: block; background: rgba(10,13,14,.53); border: 0; }
  .main-column { min-height: 100vh; }
  .topbar { height: 68px; flex-basis: 68px; justify-content: flex-start; gap: 12px; padding: 0 22px; }
  .mobile-nav-toggle { display: grid; place-items: center; }
  .topbar-right { margin-left: auto; }
  .topbar-date { display: none; }
  .page-content { padding: 27px 22px 38px; }
  .content-grid, .case-detail-grid { grid-template-columns: 1fr; }
  .dashboard-welcome { min-height: 190px; padding: 25px; }
  .welcome-mark { width: 95px; height: 95px; flex-basis: 95px; }
  .app-footer { padding: 15px 22px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-side { min-height: 335px; padding: 30px; }
  .auth-message h1 { margin: 14px 0 7px; font-size: 39px; }
  .auth-message p { font-size: 10px; }
  .auth-brand-foot { display: none; }
  .auth-panel { min-height: 470px; padding: 32px 25px; }
}
@media (max-width: 580px) {
  .topbar { padding: 0 14px; }
  .topbar-context strong { font-size: 14px; }
  .topbar-overline { font-size: 7px; }
  .secure-pill { padding: 6px 8px; font-size: 7px; }
  .page-content { padding: 21px 14px 31px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .page-heading h1 { font-size: 28px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 12px; }
  .stat-top { font-size: 8px; }
  .stat-number { font-size: 24px; }
  .stat-icon { width: 28px; height: 28px; }
  .dashboard-welcome { min-height: 0; align-items: flex-start; padding: 20px 18px; }
  .welcome-copy h1 { font-size: 26px; }
  .welcome-copy p { font-size: 10px; }
  .welcome-mark { width: 58px; height: 58px; flex-basis: 58px; align-self: flex-start; }
  .panel-head { padding: 13px 14px; }
  .panel-body { padding: 14px; }
  .case-row { gap: 9px; padding: 11px 13px; }
  .case-ref { width: 36px; height: 36px; flex-basis: 36px; }
  .case-row-meta { max-width: 105px; }
  .filter-bar { padding: 9px; }
  .filter-bar input { min-width: 100%; flex-basis: 100%; }
  .filter-count { margin-left: 0; }
  .form-card { padding: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .case-hero { padding: 19px; }
  .case-hero-top { flex-direction: column; }
  .case-hero h1 { font-size: 24px; }
  .case-meta { justify-content: flex-start; }
  .attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attachment-preview { height: 105px; }
  .app-footer { flex-direction: column; gap: 5px; padding: 14px; font-size: 7px; }
  .auth-brand-side { min-height: 270px; padding: 23px; }
  .auth-logo img { width: 55px; height: 55px; }
  .auth-logo strong { font-size: 20px; }
  .auth-message h1 { font-size: 32px; }
  .auth-panel { min-height: 455px; padding: 27px 20px; }
  .auth-card h2 { font-size: 26px; }
  .attachment-info { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
