/* ==========================================================================
   Docket Vault — design system
   ========================================================================== */

:root {
  --bg-0: #07061a;
  --bg-1: #0c0a24;
  --surface: #12102f;
  --surface-2: #19163f;
  --surface-3: #221e52;
  --glass: rgba(24, 21, 64, 0.62);
  --line: rgba(160, 150, 255, 0.13);
  --line-2: rgba(160, 150, 255, 0.24);
  --line-3: rgba(160, 150, 255, 0.4);

  --text: #efedff;
  --text-2: #b6b2e2;
  --text-3: #8480ba;

  --violet: #8b7cff;
  --violet-600: #6d5cf6;
  --violet-soft: rgba(139, 124, 255, 0.15);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.15);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.15);

  --grad: linear-gradient(135deg, #8b7cff 0%, #5b8cff 52%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 124, 255, 0.22), rgba(34, 211, 238, 0.12));

  --font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk Variable", "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
  --ring: 0 0 0 3px rgba(139, 124, 255, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 68px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img, svg { display: block; max-width: 100%; }
a { color: var(--violet); text-decoration: none; }
a:hover { color: #b0a6ff; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0; letter-spacing: -0.01em; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(139, 124, 255, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.mono { font-family: var(--font-mono); letter-spacing: 0.01em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg-0); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark svg { width: 34px; height: 34px; filter: drop-shadow(0 6px 14px rgba(110, 92, 246, 0.5)); }
.brand-logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 2px; }
.brand-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3); margin-top: 3px; font-weight: 600; }
.brand-link { color: inherit; }
.brand-link:hover { color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--btn-bg); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn .ti { font-size: 18px; }
.btn:hover { background: var(--surface-3); border-color: var(--line-3); color: var(--text); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 10px 26px -10px rgba(109, 92, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { background: var(--grad); color: #fff; filter: brightness(1.08); box-shadow: 0 14px 30px -10px rgba(109, 92, 246, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn-secondary { background: var(--violet-soft); border-color: rgba(139, 124, 255, 0.35); color: #cfc8ff; }
.btn-secondary:hover { background: rgba(139, 124, 255, 0.24); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--line); color: var(--text); }
.btn-danger { background: var(--rose-soft); border-color: rgba(251, 113, 133, 0.35); color: #ffb3c0; }
.btn-danger:hover { background: rgba(251, 113, 133, 0.25); color: #fff; border-color: rgba(251, 113, 133, 0.6); }
.btn-success { background: var(--teal-soft); border-color: rgba(45, 212, 191, 0.35); color: #9ff3e6; }
.btn-success:hover { background: rgba(45, 212, 191, 0.25); color: #fff; }
.btn-exit { background: #3a0f1d; border-color: rgba(251, 113, 133, 0.45); color: #ffc3cd; }
.btn-exit:hover { background: #561428; color: #fff; border-color: var(--rose); }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-sm .ti { font-size: 16px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-xs .ti { font-size: 15px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15.5px; border-radius: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); transition: all 0.15s;
}
.icon-btn .ti { font-size: 19px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: var(--line); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.sm .ti { font-size: 17px; }
.icon-btn.danger:hover { color: var(--rose); background: var(--rose-soft); border-color: rgba(251, 113, 133, 0.3); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid transparent; line-height: 1;
}
.pill .ti { font-size: 14px; }
.pill-teal { background: var(--teal-soft); color: #7af0dc; border-color: rgba(45, 212, 191, 0.3); }
.pill-amber { background: var(--amber-soft); color: #ffd772; border-color: rgba(251, 191, 36, 0.32); }
.pill-rose { background: var(--rose-soft); color: #ffadbb; border-color: rgba(251, 113, 133, 0.35); }
.pill-violet { background: var(--violet-soft); color: #c9c1ff; border-color: rgba(139, 124, 255, 0.32); }
.pill-blue { background: var(--blue-soft); color: #a9cdff; border-color: rgba(96, 165, 250, 0.32); }
.pill-cyan { background: var(--cyan-soft); color: #8beaf8; border-color: rgba(34, 211, 238, 0.3); }
.pill-gray { background: rgba(255, 255, 255, 0.06); color: var(--text-2); border-color: var(--line); }
.pill-sm { height: 22px; padding: 0 8px; font-size: 11px; }
.pill-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill-new { background: var(--grad); color: #fff; border: 0; height: 20px; font-size: 10.5px; padding: 0 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.pill-attention { animation: pulse-ring 2.4s infinite; }
@keyframes pulse-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.35); } 50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); } }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field .opt { color: var(--text-3); font-weight: 500; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 11px;
  background: rgba(8, 7, 28, 0.65); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; font-size: 14.5px;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.field select, select.input { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23b6b2e2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.field select option { background: var(--surface); color: var(--text); }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-3); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); background: rgba(8, 7, 28, 0.9); }
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--text-3); }
.field input[type=date] { color-scheme: dark; }
.field-hint { font-size: 12.5px; color: var(--text-3); }
.field-error { font-size: 12.5px; color: #ff9fb0; display: flex; gap: 6px; align-items: center; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: rgba(251, 113, 133, 0.7); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid-3 { display: grid; grid-template-columns: 2fr 0.6fr 2fr; gap: 16px 18px; }
.input-icon { position: relative; }
.input-icon > .ti { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 18px; pointer-events: none; }
.input-icon input { padding-left: 42px !important; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-2); user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background 0.2s; flex-shrink: 0; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #d8d4ff; transition: transform 0.2s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.switch input:checked + .switch-track { background: var(--violet-600); border-color: transparent; }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }

.segmented { display: inline-flex; padding: 4px; gap: 4px; background: rgba(8, 7, 28, 0.6); border: 1px solid var(--line-2); border-radius: 12px; flex-wrap: wrap; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all 0.15s; }
.segmented span .ti { font-size: 17px; }
.segmented span:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.segmented input:checked + span { background: var(--violet-600); color: #fff; box-shadow: 0 6px 16px -8px rgba(109, 92, 246, 0.9); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 28px 20px; border: 1.5px dashed var(--line-3); border-radius: var(--radius); background: rgba(139, 124, 255, 0.05);
  color: var(--text-2); transition: all 0.2s; cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--violet); background: rgba(139, 124, 255, 0.1); color: var(--text); }
.dropzone .ti { font-size: 34px; color: var(--violet); }
.dropzone strong { color: var(--text); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.upload-previews:empty { display: none; }
.upload-preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.upload-preview img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.upload-preview input { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 8px 10px; font-size: 12.5px; color: var(--text); }
.upload-preview input:focus { outline: none; background: rgba(139, 124, 255, 0.08); }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(26, 23, 66, 0.82), rgba(18, 16, 47, 0.82));
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  position: relative;
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card-head h2 .ti, .card-head h3 .ti { color: var(--violet); font-size: 20px; }
.card-body { padding: 22px; }
.card-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.card-glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.55; pointer-events: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
  padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; color: var(--text);
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
a.stat:hover { transform: translateY(-2px); border-color: var(--line-3); color: var(--text); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent, var(--violet)); opacity: 0.13; filter: blur(10px); }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--violet)) 18%, transparent); color: var(--accent, var(--violet)); margin-bottom: 8px; }
.stat-icon .ti { font-size: 21px; }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.accent-violet { --accent: var(--violet); }
.accent-amber { --accent: var(--amber); }
.accent-teal { --accent: var(--teal); }
.accent-rose { --accent: var(--rose); }
.accent-cyan { --accent: var(--cyan); }
.accent-blue { --accent: var(--blue); }

/* ---------- Avatar ---------- */
.avatar { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; background: var(--grad); flex-shrink: 0; box-shadow: 0 8px 18px -8px rgba(109, 92, 246, 0.8); }
.avatar-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: rgba(139, 124, 255, 0.05); }
.table .row-link { color: var(--text); font-weight: 600; }
.table .row-link:hover { color: #c9c1ff; }
.cell-person { display: flex; align-items: center; gap: 12px; }
.cell-person small { display: block; color: var(--text-3); font-size: 12.5px; font-weight: 500; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; padding: 5px; background: rgba(8, 7, 28, 0.55); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-2); white-space: nowrap; transition: all 0.15s; }
.tab .ti { font-size: 18px; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -10px rgba(109, 92, 246, 0.95); }
.tab-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11.5px; background: rgba(255, 255, 255, 0.1); }
.tab.active .tab-count { background: rgba(255, 255, 255, 0.25); }
.tab-alert { background: var(--amber); color: #3b2500; }

/* ---------- Modal (native <dialog>) ---------- */
dialog.modal {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line-2);
  border-radius: 22px; background: linear-gradient(180deg, #1b1846, #12102f); color: var(--text); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.modal.modal-lg { width: min(860px, calc(100vw - 24px)); }
dialog.modal[open] { animation: modal-in 0.28s var(--ease); display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(4, 3, 16, 0.72); backdrop-filter: blur(6px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.modal-head h3 .ti { color: var(--violet); font-size: 22px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: rgba(8, 7, 28, 0.35); }
dialog.modal form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 36px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 14px;
  background: rgba(22, 19, 56, 0.96); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); backdrop-filter: blur(10px);
  font-size: 14px; animation: toast-in 0.4s var(--ease); border-left: 3px solid var(--violet);
}
.toast > .ti { font-size: 20px; margin-top: 1px; }
.toast span { flex: 1; }
.toast-success { border-left-color: var(--teal); } .toast-success > .ti { color: var(--teal); }
.toast-error { border-left-color: var(--rose); } .toast-error > .ti { color: var(--rose); }
.toast-warning { border-left-color: var(--amber); } .toast-warning > .ti { color: var(--amber); }
.toast-info > .ti { color: var(--violet); }
.toast-close { background: none; border: 0; color: var(--text-3); padding: 0; display: grid; place-items: center; }
.toast-close:hover { color: var(--text); }
.toast.is-leaving { animation: toast-out 0.3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); margin-bottom: 6px; }
.empty-icon .ti { font-size: 30px; color: #c9c1ff; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--text-2); max-width: 380px; font-size: 14px; }
.empty .btn { margin-top: 8px; }

/* ==========================================================================
   Public site
   ========================================================================== */
body.public { background: var(--bg-0); overflow-x: hidden; }
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); border-bottom: 1px solid transparent; transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s; }
.site-header.is-scrolled { background: rgba(7, 6, 26, 0.78); backdrop-filter: blur(14px) saturate(1.4); border-bottom-color: var(--line); }
.site-header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--text-2); font-weight: 500; font-size: 14.5px; padding: 8px 14px; border-radius: 10px; transition: all 0.15s; }
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.site-header-cta { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }

.hero { position: relative; padding: 70px 0 90px; overflow: hidden; }
.hero-bg { position: absolute; inset: -20% -10% 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(109, 92, 246, 0.35), transparent 60%),
    radial-gradient(520px 380px at 85% 10%, rgba(34, 211, 238, 0.2), transparent 60%),
    radial-gradient(700px 500px at 60% 90%, rgba(139, 124, 255, 0.16), transparent 60%);
}
.hero-grid-lines { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(160, 150, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(160, 150, 255, 0.07) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 99px; background: rgba(139, 124, 255, 0.1); border: 1px solid rgba(139, 124, 255, 0.3); font-size: 13px; font-weight: 600; color: #d4ceff; }
.eyebrow b { background: var(--grad); color: #fff; padding: 3px 10px; border-radius: 99px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.03; letter-spacing: -0.035em; margin: 22px 0 20px; font-weight: 700; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 18px; color: var(--text-2); max-width: 540px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-trust { margin-top: 34px; display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 14px; }
.hero-trust-icons { display: flex; }
.hero-trust-icons span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--bg-0); margin-left: -8px; color: #c9c1ff; }
.hero-trust-icons span:first-child { margin-left: 0; }
.hero-trust-icons .ti { font-size: 17px; }

/* Hero device mock */
.mock { position: relative; }
.mock-window { border-radius: 22px; background: linear-gradient(180deg, rgba(30, 26, 76, 0.92), rgba(16, 14, 44, 0.95)); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px rgba(70, 50, 200, 0.6), var(--shadow-lg); overflow: hidden; transform: perspective(1400px) rotateY(-7deg) rotateX(3deg); transition: transform 0.6s var(--ease); }
.mock:hover .mock-window { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg); }
.mock-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3b3670; }
.mock-bar i:nth-child(1) { background: #ff6b81; } .mock-bar i:nth-child(2) { background: #ffcb52; } .mock-bar i:nth-child(3) { background: #2dd4bf; }
.mock-url { margin-left: 10px; flex: 1; height: 26px; border-radius: 8px; background: rgba(8, 7, 28, 0.7); display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 11.5px; color: var(--text-3); }
.mock-url .ti { color: var(--teal); font-size: 13px; }
.mock-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.mock-case { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 14px; background: var(--grad-soft); border: 1px solid var(--line-2); }
.mock-case strong { font-family: var(--font-display); font-size: 15px; display: block; }
.mock-case small { color: var(--text-2); font-size: 12px; font-family: var(--font-mono); }
.mock-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(8, 7, 28, 0.55); border: 1px solid var(--line); }
.mock-item-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.mock-item-icon .ti { font-size: 18px; }
.mock-item strong { font-size: 13.5px; display: block; margin: 5px 0 2px; }
.mock-item p { font-size: 12px; color: var(--text-3); }
.mock-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.mock-thumbs i { aspect-ratio: 4/3; border-radius: 7px; background: linear-gradient(135deg, #2b2670, #1a4a63); }
.mock-thumbs i:nth-child(2) { background: linear-gradient(135deg, #3a2a6e, #20325f); }
.mock-thumbs i:nth-child(3) { background: linear-gradient(135deg, #173f57, #2d2a6b); }
.mock-thumbs i:nth-child(4) { background: linear-gradient(135deg, #312a73, #134a5a); }
.mock-float { position: absolute; padding: 12px 14px; border-radius: 14px; background: rgba(22, 19, 56, 0.95); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; backdrop-filter: blur(10px); animation: float 6s ease-in-out infinite; }
.mock-float .ti { font-size: 20px; }
.mock-float small { display: block; font-weight: 500; color: var(--text-3); font-size: 11.5px; }
.mock-float-1 { left: -34px; bottom: -22px; }
.mock-float-2 { right: -24px; top: 47%; animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.trust-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(12, 10, 36, 0.6); }
.trust-strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 20px; flex-wrap: wrap; }
.trust-strip p { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3); font-weight: 600; }
.trust-items { display: flex; gap: 34px; flex-wrap: wrap; }
.trust-items span { display: inline-flex; align-items: center; gap: 9px; color: var(--text-2); font-weight: 600; font-size: 14.5px; font-family: var(--font-display); }
.trust-items .ti { font-size: 22px; color: #a99dff; }

.section { padding: 96px 0; position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(18, 16, 47, 0.55) 20%, rgba(18, 16, 47, 0.55) 80%, transparent); }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.section-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--cyan); margin-bottom: 14px; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.03em; margin-bottom: 14px; }
.section-head p { color: var(--text-2); font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; position: relative; }
.step { padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.step::before { counter-increment: step; content: "0" counter(step); position: absolute; right: 20px; top: 12px; font-family: var(--font-display); font-weight: 700; font-size: 64px; color: rgba(139, 124, 255, 0.08); line-height: 1; }
.step-icon { width: 52px; height: 52px; border-radius: 15px; background: var(--grad); display: grid; place-items: center; margin-bottom: 20px; box-shadow: 0 12px 26px -10px rgba(109, 92, 246, 0.9); }
.step-icon .ti { font-size: 26px; color: #fff; }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: 14.5px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 26px; border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(26, 23, 66, 0.6), rgba(18, 16, 47, 0.6)); border: 1px solid var(--line); transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s; }
.feature:hover { transform: translateY(-4px); border-color: rgba(139, 124, 255, 0.4); background: linear-gradient(180deg, rgba(34, 30, 86, 0.7), rgba(18, 16, 47, 0.7)); }
.feature-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 18px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.feature-icon .ti { font-size: 23px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: 14.5px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split h2 { font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -0.03em; margin-bottom: 16px; }
.split > div > p { color: var(--text-2); font-size: 16.5px; margin-bottom: 26px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 14px; align-items: flex-start; }
.check-list .ti { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-size: 17px; }
.check-list strong { display: block; font-size: 15px; }
.check-list span { color: var(--text-2); font-size: 14px; }

.security-panel { padding: 28px; border-radius: 24px; background: radial-gradient(400px 260px at 80% 0%, rgba(34, 211, 238, 0.15), transparent 70%), linear-gradient(180deg, #1b1846, #110f2d); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.security-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px dashed var(--line-2); }
.security-row:last-child { border-bottom: 0; }
.security-row .ti { font-size: 22px; color: var(--cyan); }
.security-row div { flex: 1; }
.security-row strong { display: block; font-size: 14.5px; }
.security-row small { color: var(--text-3); font-size: 12.5px; }

.audience { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.audience-card { padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); text-align: left; }
.audience-card .ti { font-size: 30px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; margin-bottom: 14px; }
.audience-card h3 { font-size: 16.5px; margin-bottom: 6px; }
.audience-card p { color: var(--text-2); font-size: 14px; }

.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color 0.2s, background 0.2s; }
.faq details[open] { border-color: rgba(139, 124, 255, 0.4); background: var(--surface-2); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 600; font-size: 15.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ti { font-size: 20px; color: var(--violet); transition: transform 0.25s var(--ease); flex-shrink: 0; }
.faq details[open] summary .ti { transform: rotate(45deg); }
.faq details > div { padding: 0 22px 20px; color: var(--text-2); font-size: 14.5px; }

.cta-band { border-radius: 28px; padding: 54px; position: relative; overflow: hidden; background: radial-gradient(500px 300px at 10% 0%, rgba(139, 124, 255, 0.45), transparent 70%), radial-gradient(500px 300px at 100% 100%, rgba(34, 211, 238, 0.3), transparent 70%), #16133f; border: 1px solid var(--line-2); display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.cta-band h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.03em; margin-bottom: 12px; }
.cta-band p { color: var(--text-2); font-size: 16px; }
.contact-list { display: grid; gap: 12px; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(8, 7, 28, 0.45); border: 1px solid var(--line); }
.contact-item .ti { font-size: 22px; color: var(--cyan); }
.contact-item small { display: block; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.contact-item span { font-weight: 600; }

.site-footer { border-top: 1px solid var(--line); padding: 56px 0 26px; margin-top: 40px; background: rgba(8, 7, 24, 0.6); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 14px; font-family: var(--font-sans); }
.footer-grid a, .footer-grid span { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--text); }
.footer-blurb { color: var(--text-3); font-size: 14px; margin-top: 14px; max-width: 320px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.footer-bottom span { display: inline-flex; align-items: center; gap: 6px; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Auth (client + admin sign in)
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { position: relative; overflow: hidden; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(500px 360px at 20% 10%, rgba(109, 92, 246, 0.5), transparent 65%), radial-gradient(420px 320px at 90% 90%, rgba(34, 211, 238, 0.25), transparent 65%), #0e0c2b; border-right: 1px solid var(--line); }
.auth-aside .hero-grid-lines { opacity: 0.6; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 16px; }
.auth-aside p { color: var(--text-2); font-size: 16px; max-width: 440px; }
.auth-points { display: grid; gap: 12px; margin-top: 28px; }
.auth-points span { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 14.5px; }
.auth-points .ti { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); color: var(--cyan); font-size: 17px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 30px; letter-spacing: -0.03em; margin-bottom: 8px; }
.auth-card > p { color: var(--text-2); margin-bottom: 28px; }
.auth-card form { display: grid; gap: 18px; }
.auth-lock { width: 58px; height: 58px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; margin-bottom: 22px; box-shadow: 0 16px 34px -12px rgba(109, 92, 246, 0.95); }
.auth-lock .ti { font-size: 28px; color: #fff; }
.case-input { font-family: var(--font-mono) !important; text-transform: uppercase; letter-spacing: 0.08em; font-size: 16px !important; }
.pin-input { font-family: var(--font-mono) !important; letter-spacing: 0.6em; font-size: 22px !important; text-align: center; padding-left: 0.6em !important; }
.auth-help { margin-top: 22px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); display: flex; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.auth-help .ti { font-size: 20px; color: var(--violet); flex-shrink: 0; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.alert .ti { font-size: 19px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--rose-soft); border: 1px solid rgba(251, 113, 133, 0.35); color: #ffc0cb; }
.alert-info { background: var(--violet-soft); border: 1px solid rgba(139, 124, 255, 0.35); color: #d6d0ff; }
.alert-warning { background: var(--amber-soft); border: 1px solid rgba(251, 191, 36, 0.35); color: #ffe3a1; }
.alert-success { background: var(--teal-soft); border: 1px solid rgba(45, 212, 191, 0.35); color: #b2f5ea; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.back-link:hover { color: var(--text); }

/* ==========================================================================
   Client portal
   ========================================================================== */
body.portal { background: var(--bg-0); }
.portal-bg { position: fixed; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(700px 420px at 0% 0%, rgba(109, 92, 246, 0.22), transparent 60%), radial-gradient(600px 400px at 100% 0%, rgba(34, 211, 238, 0.12), transparent 60%); }
.portal-header { position: sticky; top: 0; z-index: 40; background: rgba(7, 6, 26, 0.8); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); }
.portal-header-inner { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-header-actions { display: flex; gap: 8px; align-items: center; }
.portal-header .container { max-width: 1080px; }
.portal-main { padding-top: 28px; padding-bottom: 50px; max-width: 1080px; }
.portal-footer { max-width: 1080px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 34px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.portal-footer span { display: inline-flex; align-items: center; gap: 6px; }

.case-hero { padding: 26px; border-radius: 24px; position: relative; overflow: hidden; background: radial-gradient(420px 240px at 100% 0%, rgba(34, 211, 238, 0.2), transparent 70%), radial-gradient(500px 300px at 0% 100%, rgba(139, 124, 255, 0.3), transparent 70%), linear-gradient(180deg, #1d1950, #131036); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.case-hero-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.case-hero-id { display: flex; gap: 16px; align-items: center; }
.case-hero h1 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; color: var(--text-2); font-size: 13.5px; }
.case-meta span { display: inline-flex; align-items: center; gap: 6px; }
.case-meta .ti { color: var(--text-3); font-size: 16px; }
.case-number-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 9px; background: rgba(8, 7, 28, 0.6); border: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; letter-spacing: 0.04em; color: #d9d4ff; }
.case-number-chip .ti { color: var(--violet); }
.case-welcome { color: var(--text-2); margin-top: 18px; font-size: 14.5px; max-width: 720px; }

.stages { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.stages::before, .stages::after { content: ""; position: absolute; top: 17px; left: 12.5%; right: 12.5%; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.stages::after { background: var(--grad); right: auto; width: calc(75% * var(--progress)); box-shadow: 0 0 14px rgba(139, 124, 255, 0.6); }
.stage { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; z-index: 1; text-align: center; }
.stage-dot { width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; background: #1b1846; border: 2px solid var(--line-3); color: var(--text-3); }
.stage-dot .ti { font-size: 17px; }
.stage-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.stage-done .stage-dot { background: var(--violet-600); border-color: transparent; color: #fff; }
.stage-done .stage-label { color: var(--text-2); }
.stage-current .stage-dot { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 6px rgba(139, 124, 255, 0.2), 0 0 24px rgba(139, 124, 255, 0.6); }
.stage-current .stage-label { color: var(--text); }

.summary-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.summary-chip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color 0.2s, transform 0.2s var(--ease); }
a.summary-chip:hover { border-color: var(--line-3); transform: translateY(-2px); color: var(--text); }
.summary-chip .ti { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); flex-shrink: 0; }
.summary-chip strong { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
.summary-chip small { color: var(--text-2); font-size: 12.5px; }
.summary-chip.is-alert { border-color: rgba(251, 191, 36, 0.45); background: linear-gradient(180deg, rgba(251, 191, 36, 0.09), var(--surface)); }

.portal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 30px 0 18px; flex-wrap: wrap; }
.portal-toolbar .tabs { flex: 0 1 auto; }
.view-title { font-size: 14px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }

.attention-banner { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 18px; margin-top: 18px; background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.04)); border: 1px solid rgba(251, 191, 36, 0.35); }
.attention-banner > .ti { font-size: 26px; color: var(--amber); flex-shrink: 0; }
.attention-banner div { flex: 1; }
.attention-banner strong { display: block; font-size: 15px; }
.attention-banner span { color: var(--text-2); font-size: 13.5px; }

/* Timeline */
.timeline { position: relative; display: flex; flex-direction: column; gap: 4px; }
.tl-day { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.tl-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tl-day:first-child { margin-top: 0; }
.tl-day .ti { font-size: 16px; color: var(--violet); }
.tl-entry { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; position: relative; padding-bottom: 16px; }
.tl-entry::before { content: ""; position: absolute; left: 21px; top: 46px; bottom: 0; width: 2px; background: linear-gradient(var(--line-2), transparent); }
.tl-entry:last-child::before { display: none; }
.tl-node { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; position: relative; z-index: 1; background: color-mix(in srgb, var(--accent) 16%, var(--bg-0)); border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); color: var(--accent); }
.tl-node .ti { font-size: 21px; }
.t-note { --accent: var(--violet); }
.t-photo { --accent: var(--blue); }
.t-form { --accent: var(--amber); }
.t-form.is-done { --accent: var(--teal); }
.t-form.is-overdue { --accent: var(--rose); }

.entry { background: linear-gradient(180deg, rgba(26, 23, 66, 0.8), rgba(18, 16, 47, 0.8)); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; transition: border-color 0.2s, box-shadow 0.2s; position: relative; min-width: 0; }
.entry:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.entry.is-pinned { border-color: rgba(139, 124, 255, 0.45); box-shadow: 0 0 0 1px rgba(139, 124, 255, 0.15), var(--shadow); }
.entry-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry-pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.entry-time { font-size: 12.5px; color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; }
.entry h3 { font-size: 17.5px; margin: 12px 0 6px; letter-spacing: -0.01em; }
.entry h3 a { color: var(--text); }
.entry h3 a:hover { color: #cfc8ff; }
.entry-body { color: var(--text-2); font-size: 14.5px; }
.entry-body p + p, .entry-body p + ul, .entry-body ul + p { margin-top: 10px; }
.entry-body ul { margin: 8px 0 0; padding-left: 20px; }
.entry-body li { margin-bottom: 4px; }
.entry-body strong { color: var(--text); }
.entry-body.is-clamped { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.read-more { background: none; border: 0; padding: 0; margin-top: 8px; color: var(--violet); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.entry-foot-note { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }

.form-entry { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(8, 7, 28, 0.5); border: 1px solid var(--line); }
.form-doc-icon { width: 54px; height: 64px; border-radius: 8px; background: linear-gradient(180deg, #fff, #e7e5f5); position: relative; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.6); display: grid; place-items: center; }
.form-doc-icon::before { content: ""; position: absolute; left: 10px; right: 10px; top: 14px; height: 30px; background: repeating-linear-gradient(#c9c6e0 0 2px, transparent 2px 7px); }
.form-doc-icon .ti { position: absolute; right: -8px; bottom: -8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: var(--accent); color: #0b0a1f; border: 2px solid var(--bg-1); }
.form-entry-info strong { display: block; font-size: 14.5px; }
.form-entry-info small { color: var(--text-3); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.photo-grid.count-1 { grid-template-columns: minmax(0, 1fr); }
.photo-grid.count-1 .photo-tile { aspect-ratio: 16/9; }
.photo-grid.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-tile { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); cursor: zoom-in; padding: 0; display: block; width: 100%; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.photo-tile:hover img { transform: scale(1.06); }
.photo-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(5, 4, 20, 0.85)); opacity: 0; transition: opacity 0.3s; }
.photo-tile:hover::after { opacity: 1; }
.photo-tile figcaption { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 1; font-size: 12px; color: #fff; text-align: left; opacity: 0; transform: translateY(6px); transition: all 0.3s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-tile:hover figcaption { opacity: 1; transform: none; }
.photo-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 7, 28, 0.65); font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; z-index: 2; }

.gallery { columns: 3 240px; column-gap: 14px; }
.gallery-item { break-inside: avoid; margin-bottom: 14px; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.gallery-item .photo-tile { aspect-ratio: auto; border: 0; border-radius: 0; }
.gallery-item .photo-tile img { height: auto; }
.gallery-meta { padding: 10px 14px 12px; font-size: 13px; }
.gallery-meta strong { display: block; font-weight: 600; }
.gallery-meta small { color: var(--text-3); }

.form-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.form-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 20px; background: linear-gradient(180deg, rgba(26, 23, 66, 0.8), rgba(18, 16, 47, 0.8)); border: 1px solid var(--line); transition: all 0.25s var(--ease); color: var(--text); }
.form-card:hover { transform: translateY(-3px); border-color: var(--line-3); box-shadow: var(--shadow); color: var(--text); }
.form-card.is-attention { border-color: rgba(251, 191, 36, 0.35); }
.form-card.is-overdue { border-color: rgba(251, 113, 133, 0.45); }
.form-card h3 { font-size: 17px; }
.form-card p { color: var(--text-2); font-size: 13.5px; }
.form-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-3); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.form-card-meta span { display: inline-flex; gap: 5px; align-items: center; }
.section-label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin: 26px 0 14px; }
.section-label:first-child { margin-top: 0; }
.section-label .ti { font-size: 17px; }

/* Form fill page */
.form-page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.form-shell { max-width: 880px; margin: 0 auto; }
.form-actionbar { position: sticky; bottom: 16px; z-index: 30; margin: 22px auto 0; max-width: 880px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px; border-radius: 18px; background: rgba(22, 19, 56, 0.92); backdrop-filter: blur(12px); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); flex-wrap: wrap; }
.form-actionbar-info { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.progress-ring { --p: 0; width: 38px; height: 38px; border-radius: 50%; background: conic-gradient(var(--violet) calc(var(--p) * 1%), rgba(255, 255, 255, 0.1) 0); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; flex-shrink: 0; }
.progress-ring::before { content: attr(data-label); width: 30px; height: 30px; border-radius: 50%; background: #17143f; display: grid; place-items: center; }
.submitted-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; margin-bottom: 18px; background: linear-gradient(90deg, rgba(45, 212, 191, 0.15), rgba(45, 212, 191, 0.04)); border: 1px solid rgba(45, 212, 191, 0.35); }
.submitted-banner > .ti { font-size: 26px; color: var(--teal); }
.submitted-banner div { flex: 1; }
.submitted-banner strong { display: block; }
.submitted-banner span { color: var(--text-2); font-size: 13.5px; }
.investigator-msg { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; background: var(--violet-soft); border: 1px solid rgba(139, 124, 255, 0.3); font-size: 14px; color: #ddd8ff; }
.investigator-msg .ti { font-size: 20px; color: var(--violet); flex-shrink: 0; }

/* ==========================================================================
   Paper: professionally formatted form document
   ========================================================================== */
.paper {
  --ink: #16163a; --ink-2: #4a4a6e; --ink-3: #8a8aa8; --rule: #e4e2f0; --accent-ink: #4b3fd6; --paper-bg: #ffffff;
  background: var(--paper-bg); color: var(--ink); border-radius: 6px; padding: 48px 56px 34px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.04);
  font-family: var(--font-sans); font-size: 14.5px; line-height: 1.55; position: relative;
}
.paper::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 6px 6px 0 0; background: linear-gradient(90deg, #6d5cf6, #5b8cff, #22d3ee); }
.paper-head { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.paper-logo img { max-height: 70px; max-width: 200px; width: auto; object-fit: contain; }
.paper-firm-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); }
.paper-firm-meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.paper-ref { margin: 0; display: grid; gap: 4px; text-align: right; font-size: 12px; }
.paper-ref div { display: flex; gap: 10px; justify-content: flex-end; }
.paper-ref dt { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; font-size: 10.5px; padding-top: 1px; }
.paper-ref dd { margin: 0; font-weight: 600; color: var(--ink); }
.paper.logo-center .paper-head { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 10px; }
.paper.logo-center .paper-ref { grid-auto-flow: column; gap: 22px; text-align: center; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--rule); width: 100%; justify-content: center; }
.paper.logo-center .paper-ref div { justify-content: center; }
.paper.logo-center .paper-logo img { max-height: 84px; max-width: 260px; margin: 0 auto; }
.paper.logo-none .paper-head { grid-template-columns: 1fr auto; }
.paper-titlebar { padding: 26px 0 8px; }
.paper.logo-center .paper-titlebar { text-align: center; }
.paper-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.paper-subtitle { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.paper-instructions { display: flex; gap: 12px; margin: 16px 0 6px; padding: 14px 16px; background: #f4f3fc; border: 1px solid #e3e0f7; border-left: 3px solid var(--accent-ink); border-radius: 4px; font-size: 13.5px; color: var(--ink-2); }
.paper-instructions .ti { color: var(--accent-ink); font-size: 19px; flex-shrink: 0; }
.paper-instructions p + p { margin-top: 6px; }
.paper-instructions ul { margin: 4px 0 0; padding-left: 18px; }
.paper-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin-top: 18px; }
.pf { padding: 14px 0; min-width: 0; }
.pf.span-2 { grid-column: span 2; }
.pf-heading { padding: 22px 0 6px; border-bottom: 1px solid var(--ink); margin-bottom: 4px; }
.pf-heading h2 { font-family: var(--font-display); font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-ink); font-weight: 700; }
.pf-heading p { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.pf-statement { padding: 16px 18px; margin: 10px 0; background: #fafafe; border: 1px solid var(--rule); border-radius: 4px; }
.pf-statement-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; font-size: 14px; }
.pf-statement-body { color: var(--ink-2); font-size: 13.5px; }
.pf-statement-body p + p { margin-top: 8px; }
.pf-statement-body ul { margin: 6px 0 0; padding-left: 18px; }
.pf-label { display: flex; gap: 10px; align-items: baseline; font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.pf-num { flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: #eeecfb; color: var(--accent-ink); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; font-family: var(--font-mono); transform: translateY(-1px); }
.pf-num-inline { margin-right: 8px; }
.pf-req { color: #d6336c; margin-left: 3px; }
.pf-help { color: var(--ink-3); font-size: 12.5px; margin: 0 0 8px 32px; }
.pf .pf-label + .pf-input, .pf .pf-label + .pf-answer, .pf .pf-label + .pf-choices, .pf .pf-label + .pf-select-wrap, .pf .pf-label + .sig, .pf .pf-help + * { margin-left: 32px; width: calc(100% - 32px); }
.pf-label + .pf-select-wrap, .pf-help + .pf-select-wrap { display: block; }
.pf-input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 6px; border: 1px solid #d5d3e6; background: #fdfdff;
  color: var(--ink); font-size: 14.5px; transition: border-color 0.15s, box-shadow 0.15s; min-height: 42px;
}
.pf-input:hover { border-color: #b4b0d6; }
.pf-input:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 3px rgba(75, 63, 214, 0.15); background: #fff; }
.pf-input::placeholder { color: #a9a8c0; }
textarea.pf-input { resize: vertical; line-height: 1.5; }
input[type=date].pf-input { color-scheme: light; }
.pf-select-wrap { position: relative; }
.pf-select-wrap select { appearance: none; padding-right: 36px; }
.pf-select-wrap .ti { position: absolute; right: 12px; top: calc(50% + 3px); transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.pf-answer { margin-top: 6px; padding: 6px 2px 6px; border-bottom: 1px solid #b9b7cf; min-height: 34px; color: #1f1f56; font-weight: 500; font-family: var(--font-sans); }
.pf-answer-long { white-space: normal; line-height: 1.6; }
.pf-choices { display: grid; gap: 8px; margin-top: 8px; }
.pf-choices.inline { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.pf-choice, .pf-ack { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1px solid #e0deee; border-radius: 6px; cursor: pointer; transition: all 0.15s; background: #fff; }
.pf-choice:hover, .pf-ack:hover { border-color: #b4b0d6; background: #fbfaff; }
.pf-choice input, .pf-ack input { position: absolute; opacity: 0; pointer-events: none; }
.pf-mark { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; border: 2px solid #b4b0d6; border-radius: 50%; display: grid; place-items: center; transition: all 0.15s; background: #fff; }
.pf-checkbox .pf-mark, .pf-ack .pf-mark { border-radius: 5px; }
.pf-choice input:checked ~ .pf-mark, .pf-ack input:checked ~ .pf-mark { border-color: var(--accent-ink); background: var(--accent-ink); }
.pf-radio .pf-choice input:checked ~ .pf-mark { background: #fff; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 10px var(--accent-ink); }
.pf-checkbox .pf-choice input:checked ~ .pf-mark::after, .pf-ack input:checked ~ .pf-mark::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.pf-choice:has(input:checked), .pf-ack:has(input:checked), .pf-choice.is-checked, .pf-ack.is-checked { border-color: var(--accent-ink); background: #f5f3ff; }
.pf-choice input:focus-visible ~ .pf-mark, .pf-ack input:focus-visible ~ .pf-mark { box-shadow: 0 0 0 3px rgba(75, 63, 214, 0.25); }
.pf-choice input:disabled, .pf-ack input:disabled { cursor: default; }
.pf-ack { font-weight: 500; color: var(--ink); }
.pf-ack small { display: block; color: var(--ink-3); font-weight: 400; margin-top: 2px; font-size: 12.5px; }
.pf-error { color: #c92a5a; font-size: 12.5px; margin: 6px 0 0 32px; display: flex; gap: 5px; align-items: center; font-weight: 500; }
.pf.has-error .pf-input, .pf.has-error .pf-choice, .pf.has-error .pf-ack, .pf.has-error .sig-canvas { border-color: #e56b8f; }
.pf-empty { text-align: center; color: var(--ink-3); padding: 34px 0; }
.sig { margin-top: 8px; }
.sig-canvas { display: block; width: 100%; height: 150px; border: 1px dashed #b4b0d6; border-radius: 6px; background: repeating-linear-gradient(0deg, #fff 0 29px, #f3f2fa 29px 30px); touch-action: none; cursor: crosshair; }
.sig-line { display: flex; justify-content: space-between; align-items: center; border-top: 1.5px solid var(--ink); margin-top: 6px; padding-top: 4px; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.sig-clear { background: none; border: 0; color: var(--accent-ink); font-size: 12px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; text-transform: none; letter-spacing: 0; }
.sig-view img { max-height: 90px; width: auto; }
.sig-blank { height: 80px; }
.paper-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 11.5px; color: var(--ink-3); }
.paper-foot span { display: inline-flex; gap: 5px; align-items: center; }

/* ==========================================================================
   Admin
   ========================================================================== */
body.admin { background: var(--bg-0); }
.admin-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; background: linear-gradient(180deg, #100e2c, #0b0a22); border-right: 1px solid var(--line); z-index: 60; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.sidebar-close { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 12px; color: var(--text-2); font-weight: 600; font-size: 14.5px; transition: all 0.15s; position: relative; }
.sidebar-nav a .ti { font-size: 20px; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.sidebar-nav a.active { background: var(--grad-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(139, 124, 255, 0.35); }
.sidebar-nav a.active::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.sidebar-nav a.active .ti { color: #b6abff; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--amber); color: #3b2500; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.sidebar-card { padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.sidebar-card-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.sidebar-card-title .ti { color: var(--amber); }
.sidebar-card a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.sidebar-card a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.sidebar-card a .ti { font-size: 17px; color: var(--violet); }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.sidebar-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-user-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text small { font-size: 12px; color: var(--text-3); }
.sidebar-scrim { display: none; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 14px 28px; min-height: 76px; background: rgba(7, 6, 26, 0.82); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 21px; letter-spacing: -0.02em; }
.topbar-title p { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.topbar-search { position: relative; width: 280px; }
.topbar-search .ti { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 17px; }
.topbar-search input { width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(8, 7, 28, 0.7); padding: 0 38px 0 38px; font-size: 13.5px; transition: all 0.15s; }
.topbar-search input:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.topbar-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.topbar-actions { display: flex; gap: 8px; }
.admin-content { padding: 28px; display: flex; flex-direction: column; gap: 22px; max-width: 1400px; width: 100%; }

.welcome-card { padding: 26px 28px; border-radius: 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: radial-gradient(420px 220px at 100% 0%, rgba(34, 211, 238, 0.22), transparent 70%), radial-gradient(520px 300px at 0% 100%, rgba(139, 124, 255, 0.35), transparent 70%), linear-gradient(180deg, #1d1950, #131036); border: 1px solid var(--line-2); }
.welcome-card h2 { font-size: 24px; letter-spacing: -0.02em; }
.welcome-card p { color: var(--text-2); margin-top: 4px; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); color: var(--text); transition: background 0.15s; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: rgba(139, 124, 255, 0.06); color: var(--text); }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-main small { display: block; color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent, var(--violet)) 16%, transparent); color: var(--accent, var(--violet)); }
.list-icon .ti { font-size: 19px; }

/* Composer */
.composer-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.type-card { position: relative; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card > span { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(8, 7, 28, 0.45); transition: all 0.2s var(--ease); height: 100%; }
.type-card > span .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin-bottom: 8px; }
.type-card strong { font-size: 15px; }
.type-card small { color: var(--text-3); font-size: 12.5px; }
.type-card:hover > span { border-color: var(--line-3); }
.type-card input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, rgba(8, 7, 28, 0.45)); box-shadow: 0 0 0 1px var(--accent), 0 14px 30px -18px var(--accent); }
.type-card input:focus-visible + span { box-shadow: var(--ring); }
.composer-panel { display: none; }
.composer-panel.is-active { display: grid; gap: 16px; animation: fade-up 0.3s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

.client-picker { border: 1px solid var(--line-2); border-radius: 14px; background: rgba(8, 7, 28, 0.45); overflow: hidden; }
.client-picker-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.client-picker-head .input-icon { flex: 1; }
.client-picker-head input { min-height: 38px !important; height: 38px; }
.client-picker-list { max-height: 248px; overflow-y: auto; padding: 6px; }
.client-option { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
.client-option:hover { background: rgba(255, 255, 255, 0.04); }
.client-option input { width: 18px; height: 18px; accent-color: var(--violet); flex-shrink: 0; }
.client-option:has(input:checked) { background: var(--violet-soft); }
.client-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.client-option-text strong { font-size: 14px; }
.client-option-text small { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.client-picker-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); display: flex; justify-content: space-between; gap: 10px; }
.picked-count { color: #c9c1ff; font-weight: 700; }

/* Client detail */
.client-header { padding: 24px; border-radius: 24px; background: radial-gradient(420px 240px at 100% 0%, rgba(34, 211, 238, 0.16), transparent 70%), radial-gradient(500px 280px at 0% 100%, rgba(139, 124, 255, 0.28), transparent 70%), linear-gradient(180deg, #1c1850, #131036); border: 1px solid var(--line-2); display: grid; gap: 20px; }
.client-header-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.client-id { display: flex; gap: 16px; align-items: center; }
.client-id h2 { font-size: 26px; letter-spacing: -0.02em; }
.client-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fact { padding: 12px 14px; border-radius: 14px; background: rgba(8, 7, 28, 0.45); border: 1px solid var(--line); min-width: 0; }
.fact small { display: flex; gap: 6px; align-items: center; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-weight: 600; }
.fact small .ti { font-size: 14px; }
.fact span { display: block; margin-top: 4px; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.status-select { display: inline-flex; align-items: center; gap: 8px; }
.status-select select { height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(8, 7, 28, 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23b6b2e2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center; padding: 0 34px 0 12px; appearance: none; font-weight: 600; font-size: 13.5px; }

.item-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: flex-start; padding: 18px 22px; border-bottom: 1px solid var(--line); transition: background 0.15s; }
.item-row:last-child { border-bottom: 0; }
.item-row:hover { background: rgba(139, 124, 255, 0.04); }
.item-row.is-hidden { opacity: 0.6; }
.item-row .tl-node { width: 44px; height: 44px; }
.item-main { min-width: 0; }
.item-main h4 { font-size: 15.5px; font-family: var(--font-display); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-main .entry-body { margin-top: 6px; font-size: 14px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.item-meta span { display: inline-flex; align-items: center; gap: 5px; }
.item-actions { display: flex; gap: 2px; align-items: center; }
.item-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.item-thumb { position: relative; width: 88px; height: 66px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.item-thumb button.photo-tile { border: 0; border-radius: 0; height: 100%; aspect-ratio: auto; }
.item-thumb form { position: absolute; top: 3px; right: 3px; z-index: 3; opacity: 0; transition: opacity 0.15s; }
.item-thumb:hover form { opacity: 1; }
.item-thumb form button { width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(8, 7, 28, 0.85); color: #ffb3c0; display: grid; place-items: center; font-size: 13px; }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 50; padding: 6px; border-radius: 14px; background: #1b1846; border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); display: none; }
.dropdown.is-open .dropdown-menu { display: block; animation: fade-up 0.18s var(--ease); }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 0; background: none; color: var(--text-2); font-size: 13.5px; font-weight: 500; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.dropdown-menu .ti { font-size: 17px; }
.dropdown-menu .danger { color: #ffadbb; }
.dropdown-menu .danger:hover { background: var(--rose-soft); color: #fff; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.dropdown-menu form { margin: 0; }

.credentials { max-width: 620px; margin: 0 auto; }
.cred-slip { padding: 30px; border-radius: 24px; background: linear-gradient(180deg, #1d1950, #131036); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.cred-slip::before { content: ""; position: absolute; inset: 0; background: radial-gradient(360px 200px at 100% 0%, rgba(34, 211, 238, 0.2), transparent 70%); pointer-events: none; }
.cred-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 22px 0; position: relative; }
.cred-box { padding: 18px; border-radius: 16px; background: rgba(8, 7, 28, 0.6); border: 1px solid var(--line-2); }
.cred-box small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); font-weight: 700; margin-bottom: 6px; }
.cred-value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; letter-spacing: 0.06em; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cred-value.pin { letter-spacing: 0.32em; font-size: 28px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Form builder */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.builder-preview { position: sticky; top: 98px; max-height: calc(100vh - 120px); overflow-y: auto; border-radius: 20px; padding: 18px; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0 10px, transparent 10px 20px), var(--bg-1); border: 1px solid var(--line); }
.builder-preview .paper { padding: 34px 36px 26px; font-size: 13.5px; }
.preview-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.preview-label span { display: inline-flex; gap: 6px; align-items: center; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.palette button { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px dashed var(--line-3); background: rgba(8, 7, 28, 0.45); color: var(--text-2); font-size: 13px; font-weight: 600; transition: all 0.15s; text-align: left; }
.palette button .ti { font-size: 18px; color: var(--violet); }
.palette button:hover { border-style: solid; border-color: var(--violet); background: var(--violet-soft); color: #fff; transform: translateY(-1px); }
.field-list { display: flex; flex-direction: column; gap: 10px; }
.field-list:empty::before { content: "Add questions from the palette above."; display: block; text-align: center; padding: 34px; border: 1.5px dashed var(--line-2); border-radius: 16px; color: var(--text-3); font-size: 14px; }
.fcard { border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, rgba(30, 26, 76, 0.75), rgba(20, 18, 52, 0.75)); transition: border-color 0.2s, box-shadow 0.2s; }
.fcard.is-open { border-color: rgba(139, 124, 255, 0.55); box-shadow: 0 0 0 1px rgba(139, 124, 255, 0.2), var(--shadow); }
.fcard-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 8px; cursor: pointer; }
.fcard-grip { cursor: grab; color: var(--text-3); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.fcard-grip:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.fcard-grip .ti { font-size: 18px; }
.fcard-type { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--violet-soft); color: #c4bbff; flex-shrink: 0; }
.fcard-type .ti { font-size: 17px; }
.fcard-title { flex: 1; min-width: 0; }
.fcard-title strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard-title small { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.fcard-body { display: none; padding: 4px 16px 16px; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.fcard.is-open .fcard-body { display: grid; }
.fcard .field input, .fcard .field textarea, .fcard .field select { min-height: 40px; font-size: 14px; }
.fcard .field textarea { min-height: 80px; }
.opt-list { display: grid; gap: 8px; }
.opt-row { display: flex; gap: 8px; align-items: center; }
.opt-row .ti-grip-vertical { color: var(--text-3); cursor: grab; }
.opt-row input { flex: 1; }
.fcard-flags { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: center; }
.sortable-ghost { opacity: 0.35; }
.sortable-chosen { box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.8); }
.logo-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.logo-choice { position: relative; cursor: pointer; }
.logo-choice input { position: absolute; opacity: 0; pointer-events: none; }
.logo-choice > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 86px; padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: #555; font-size: 11.5px; font-weight: 600; transition: all 0.15s; text-align: center; }
.logo-choice > span img { max-height: 46px; max-width: 100%; object-fit: contain; }
.logo-choice.none > span { background: rgba(8, 7, 28, 0.45); color: var(--text-2); }
.logo-choice input:checked + span { box-shadow: 0 0 0 3px var(--violet); border-color: transparent; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.template-card { display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: all 0.25s var(--ease); }
.template-card:hover { border-color: var(--line-3); transform: translateY(-3px); box-shadow: var(--shadow); }
.template-thumb { height: 150px; padding: 18px 26px 0; background: radial-gradient(260px 120px at 50% 0%, rgba(139, 124, 255, 0.35), transparent 70%), var(--bg-1); overflow: hidden; border-bottom: 1px solid var(--line); }
.template-thumb .mini-paper { background: #fff; border-radius: 5px 5px 0 0; height: 100%; padding: 14px 16px; box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, 0.6); }
.mini-paper::before { content: ""; display: block; height: 3px; margin: -14px -16px 10px; border-radius: 5px 5px 0 0; background: linear-gradient(90deg, #6d5cf6, #22d3ee); }
.mini-paper b { display: block; font-family: var(--font-display); color: #16163a; font-size: 12.5px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-paper i { display: block; height: 6px; border-radius: 3px; background: #e9e7f5; margin-bottom: 7px; }
.mini-paper i:nth-child(odd) { width: 70%; }
.mini-paper img { max-height: 22px; margin-bottom: 6px; }
.template-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.template-body h3 { font-size: 16.5px; }
.template-body p { color: var(--text-2); font-size: 13.5px; }
.template-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--text-3); margin-top: auto; padding-top: 10px; }
.template-meta span { display: inline-flex; gap: 5px; align-items: center; }
.template-actions { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); align-items: center; }
.template-actions .btn-primary { margin-left: auto; }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.logo-card { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.logo-card.is-primary { border-color: rgba(139, 124, 255, 0.55); box-shadow: 0 0 0 1px rgba(139, 124, 255, 0.25); }
.logo-stage { height: 130px; display: grid; place-items: center; padding: 18px; background: #fff; background-image: linear-gradient(45deg, #f2f2f7 25%, transparent 25%), linear-gradient(-45deg, #f2f2f7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f2f2f7 75%), linear-gradient(-45deg, transparent 75%, #f2f2f7 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.logo-stage img { max-height: 94px; max-width: 100%; object-fit: contain; }
.logo-info { padding: 12px 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.logo-info strong { font-size: 14px; display: block; }
.logo-info small { color: var(--text-3); font-size: 12px; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.activity-item { display: flex; gap: 14px; padding: 13px 22px; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent, var(--violet)) 15%, transparent); color: var(--accent, var(--violet)); }
.activity-dot .ti { font-size: 17px; }
.activity-item p { color: var(--text-2); }
.activity-item p strong { color: var(--text); font-weight: 600; }
.activity-item small { color: var(--text-3); font-size: 12.5px; display: block; margin-top: 1px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { min-height: 40px; height: 40px; width: auto; }
.filters select.input { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23b6b2e2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; font-weight: 600; background: rgba(8, 7, 28, 0.45); transition: all 0.15s; }
.chip-filter:hover { color: var(--text); border-color: var(--line-3); }
.chip-filter.active { background: var(--violet-soft); color: #fff; border-color: rgba(139, 124, 255, 0.5); }
.chip-filter b { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: grid; place-items: center; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line); color: var(--text-2); }
.pagination a:hover { border-color: var(--line-3); color: var(--text); }
.pagination .current { background: var(--violet-600); color: #fff; border-color: transparent; }

.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; padding: 20px 22px; border-bottom: 1px solid var(--line); align-items: start; }
.setting-row:last-child { border-bottom: 0; }
.setting-row h4 { font-size: 14.5px; font-family: var(--font-sans); }
.setting-row p { color: var(--text-3); font-size: 13px; margin-top: 3px; }

.response-view { background: var(--bg-1); border-radius: 20px; padding: 22px; border: 1px solid var(--line); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(4, 3, 14, 0.94); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 60px 70px; animation: fade-in 0.25s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; max-height: 100%; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 160px); border-radius: 12px; box-shadow: 0 30px 80px -20px #000; object-fit: contain; }
.lb-figure figcaption { color: var(--text-2); font-size: 14px; text-align: center; }
.lb-close { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, 0.08) !important; color: #fff !important; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, 0.08) !important; color: #fff !important; }
.lb-nav .ti { font-size: 24px; }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lb-count { position: absolute; top: 24px; left: 24px; font-family: var(--font-mono); font-size: 13px; color: var(--text-3); }

/* ---------- Idle warning ---------- */
.idle-warning { position: fixed; inset: 0; z-index: 500; background: rgba(4, 3, 14, 0.8); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.idle-card { text-align: center; padding: 34px; border-radius: 24px; background: linear-gradient(180deg, #1d1950, #131036); border: 1px solid var(--line-2); max-width: 380px; box-shadow: var(--shadow-lg); }
.idle-card > .ti { font-size: 42px; color: var(--amber); }
.idle-card h3 { font-size: 22px; margin: 10px 0 6px; }
.idle-card p { color: var(--text-2); margin-bottom: 20px; }

/* ---------- Error / install pages ---------- */
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(600px 400px at 50% 0%, rgba(109, 92, 246, 0.3), transparent 60%), var(--bg-0); }
.error-card { text-align: center; max-width: 440px; }
.error-code { font-family: var(--font-display); font-size: 96px; font-weight: 700; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-card h1 { font-size: 26px; margin: 10px 0; }
.error-card p { color: var(--text-2); margin-bottom: 24px; }
.install { min-height: 100vh; padding: 40px 20px; background: radial-gradient(700px 400px at 50% 0%, rgba(109, 92, 246, 0.3), transparent 60%), var(--bg-0); }
.install-card { max-width: 720px; margin: 0 auto; }
.install-card .card { margin-top: 24px; }
.install-section { padding: 22px; border-bottom: 1px solid var(--line); }
.install-section:last-child { border-bottom: 0; }
.install-section h3 { font-size: 15px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.install-section h3 .num { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); display: grid; place-items: center; font-size: 13px; color: #fff; }
.req-list { display: grid; gap: 8px; }
.req { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.req .ti-circle-check { color: var(--teal); }
.req .ti-circle-x { color: var(--rose); }

/* ==========================================================================
   Secure messaging
   ========================================================================== */
.nav-badge-cyan { background: var(--cyan); color: #032a33; }
.tab-alert-cyan { background: var(--cyan); color: #032a33; }
.summary-chip.is-alert-cyan { border-color: rgba(34, 211, 238, 0.45); background: linear-gradient(180deg, rgba(34, 211, 238, 0.09), var(--surface)); }
.attention-cyan { background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(34, 211, 238, 0.03)); border-color: rgba(34, 211, 238, 0.4); }
.attention-cyan > .ti { color: var(--cyan); }
.header-msg-btn { position: relative; }
.dot-badge { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--cyan); color: #032a33; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; box-shadow: 0 0 0 3px rgba(7, 6, 26, 0.9), 0 0 14px rgba(34, 211, 238, 0.6); }

.messages-shell { max-width: 880px; margin: 0 auto; }
.thread-card { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: linear-gradient(180deg, rgba(26, 23, 66, 0.85), rgba(16, 14, 44, 0.9)); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); height: min(760px, calc(100vh - 210px)); min-height: 460px; }
.thread-card-embedded { height: 680px; }
.thread-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: radial-gradient(360px 120px at 0% 0%, rgba(139, 124, 255, 0.22), transparent 70%), rgba(8, 7, 28, 0.35); flex-shrink: 0; }
.thread-head > div { flex: 1; min-width: 0; }
.thread-head h1 { font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head p { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .avatar .ti { font-size: 22px; }
.messages-note { margin-top: 14px; font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; justify-content: center; text-align: center; }

.thread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 20px 8px; overscroll-behavior: contain;
  background-image: radial-gradient(rgba(160, 150, 255, 0.06) 1px, transparent 1px); background-size: 22px 22px; }
.thread-intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin: 4px auto 18px; max-width: 360px; font-size: 13px; color: var(--text-3); }
.thread-intro strong { color: var(--text-2); font-size: 13.5px; }
.thread-intro-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); border: 1px solid rgba(45, 212, 191, 0.3); margin-bottom: 6px; }
.thread-intro-icon .ti { font-size: 22px; }
.thread-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; color: var(--text-3); font-size: 14px; text-align: center; }
.thread-empty .ti { font-size: 34px; color: var(--violet); opacity: 0.7; }
.thread-list { display: flex; flex-direction: column; gap: 10px; }

.msg-day { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.msg-day::before, .msg-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; position: relative; }
.msg-mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-theirs { align-self: flex-start; }
.msg-new { animation: msg-in 0.35s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.msg-avatar { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; background: var(--surface-3); color: #d6d0ff; border: 1px solid var(--line-2); margin-bottom: 20px; }
.msg-team .msg-avatar { background: var(--grad); color: #fff; border: 0; }
.msg-avatar .ti { font-size: 17px; }
.msg-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg-mine .msg-stack { align-items: flex-end; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; color: var(--text-3); padding: 0 4px; }
.msg-meta strong { font-weight: 600; color: var(--text-2); }
.msg-bubble { border-radius: 18px; padding: 10px 14px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 8px; }
.msg-theirs .msg-bubble { background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-left-radius: 6px; color: var(--text); }
.msg-mine .msg-bubble { background: linear-gradient(135deg, #6d5cf6, #4f7cf7); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 10px 24px -14px rgba(109, 92, 246, 0.9); }
.msg-photo { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; margin: -4px -8px 0; max-width: 300px; }
.msg-photo:only-child { margin: -6px -10px; }
.msg-photo img { width: 100%; height: auto; max-height: 300px; object-fit: cover; display: block; transition: transform 0.3s var(--ease); }
.msg-photo:hover img { transform: scale(1.03); }
.msg-status { font-size: 11.5px; color: var(--text-3); display: inline-flex; gap: 4px; align-items: center; padding: 0 4px; }
.msg-status .ti-checks { color: var(--cyan); }
.msg-delete { position: absolute; top: 18px; opacity: 0; transition: opacity 0.15s; }
.msg-mine .msg-delete { left: -34px; }
.msg-theirs .msg-delete { right: -34px; }
.msg:hover .msg-delete, .msg-delete:focus-within { opacity: 1; }
.msg-delete button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-3); display: grid; place-items: center; }
.msg-delete button:hover { color: var(--rose); border-color: rgba(251, 113, 133, 0.5); }

.composer { flex-shrink: 0; padding: 12px 16px 12px; border-top: 1px solid var(--line); background: rgba(8, 7, 28, 0.55); }
.composer-off { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--text-3); font-size: 14px; padding: 18px; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(8, 7, 28, 0.75); transition: border-color 0.15s, box-shadow 0.15s; }
.composer-row:focus-within { border-color: var(--violet); box-shadow: var(--ring); }
.composer-row textarea { flex: 1; min-height: 40px; max-height: 180px; resize: none; border: 0; background: transparent; padding: 9px 6px; font-size: 14.5px; line-height: 1.5; color: var(--text); outline: none; }
.composer-row textarea::placeholder { color: var(--text-3); }
.composer-attach { position: relative; cursor: pointer; width: 40px; height: 40px; flex-shrink: 0; }
.composer-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.composer-send { height: 40px; border-radius: 11px; flex-shrink: 0; }
.composer-send.is-sending { opacity: 0.7; pointer-events: none; }
.composer-send.is-sending .ti { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer-hint { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 0 4px; font-size: 11.5px; color: var(--text-3); }
.composer-hint kbd { font-family: var(--font-mono); font-size: 10.5px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; }
.composer-error { color: #ff9fb0; font-weight: 500; }
.composer-attach-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); max-width: 340px; }
.composer-attach-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.composer-attach-preview span { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }

/* Admin inbox */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; height: calc(100vh - 130px); min-height: 520px; }
.inbox-list { display: flex; flex-direction: column; overflow: hidden; }
.inbox-tools { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.inbox-tools .input { min-height: 40px; height: 40px; }
.segmented-sm { padding: 3px; }
.segmented-sm a { flex: 1; text-align: center; height: 30px; display: grid; place-items: center; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.segmented-sm a:hover { color: var(--text); }
.segmented-sm a.on { background: var(--violet-600); color: #fff; }
.segmented-sm { display: flex; }
.inbox-items { overflow-y: auto; flex: 1; padding: 6px; }
.inbox-item { display: flex; gap: 12px; padding: 12px; border-radius: 14px; color: var(--text); transition: background 0.15s; position: relative; }
.inbox-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.inbox-item.active { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(139, 124, 255, 0.35); }
.inbox-item.is-unread::before { content: ""; position: absolute; left: 3px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.inbox-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-item-top, .inbox-item-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.inbox-item-top strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item-top time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.inbox-preview { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item.is-unread .inbox-preview { color: var(--text); font-weight: 500; }
.inbox-item small { font-size: 11px; color: var(--text-3); }
.inbox-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; color: var(--text-3); font-size: 13.5px; }
.inbox-empty .ti { font-size: 30px; }
.inbox-thread { display: flex; flex-direction: column; overflow: hidden; }
.inbox-thread .empty { margin: auto; }
.inbox-back { display: none; }
a.client-option { color: var(--text); }
a.client-option:hover { color: var(--text); }

@media (max-width: 980px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .inbox-thread { display: none; }
  .inbox-thread { height: calc(100vh - 120px); min-height: 480px; }
  .inbox-back { display: inline-grid; }
  .inbox-list { max-height: none; }
}
@media (max-width: 640px) {
  .thread-card { height: calc(100vh - 170px); min-height: 420px; border-radius: 18px; }
  .thread-head { padding: 12px 14px; }
  .thread-head .btn span { display: none; }
  .thread-head .btn { width: 36px; padding: 0; }
  .thread-scroll { padding: 14px 12px 6px; }
  .msg { max-width: 90%; }
  .msg-avatar { display: none; }
  .composer { padding: 10px; }
  .composer-send span { display: none; }
  .composer-send { width: 44px; padding: 0; }
  .composer-hint > span:first-child { display: none; }
  .msg-delete { display: none; top: auto; bottom: 22px; opacity: 1; }
  .msg.show-actions .msg-delete { display: block; }
  .msg-mine .msg-delete { left: -32px; }
  .msg-theirs .msg-delete { right: -32px; }
  .header-msg-btn { width: auto !important; padding: 0 10px !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .builder { grid-template-columns: minmax(0, 1fr); }
  .builder-preview { position: static; max-height: none; }
  .client-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-search { width: 220px; }
}
@media (max-width: 980px) {
  .hero-inner, .split, .cta-band { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .mock { max-width: 560px; margin: 0 auto; width: 100%; }
  .mock-window { transform: none; }
  .mock-float-1 { left: -6px; } .mock-float-2 { right: -6px; }
  .features, .steps { grid-template-columns: 1fr 1fr; }
  .audience { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-nav { position: fixed; top: var(--header-h); left: 0; right: 0; flex-direction: column; padding: 12px 16px 20px; background: rgba(7, 6, 26, 0.97); border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform 0.3s var(--ease); z-index: 49; }
  .nav-open .site-nav { transform: none; }
  .site-nav a { padding: 12px 14px; font-size: 16px; }
  .nav-toggle { display: inline-grid; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform 0.3s var(--ease); }
  .sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(4, 3, 14, 0.6); z-index: 55; }
  .sidebar-close, .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .topbar-search { display: none; }
  .admin-content { padding: 18px 16px; }
  .summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .features, .steps, .audience { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .cta-band { padding: 30px 22px; }
  .site-header-cta .btn span, .site-header-cta .btn { font-size: 13px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 24px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .composer-types { grid-template-columns: 1fr; }
  .client-facts { grid-template-columns: 1fr; }
  .cred-row { grid-template-columns: 1fr; }
  .cred-value { font-size: 19px; }
  .cred-value.pin { font-size: 24px; }
  .cred-slip { padding: 20px; }
  .credentials .mono { overflow-wrap: anywhere; }
  .stages { margin-top: 20px; }
  .stage-label { font-size: 11px; }
  .attention-banner { flex-wrap: wrap; }
  .attention-banner .btn { width: 100%; }
  .attention-banner div { min-width: 0; flex-basis: calc(100% - 46px); }
  .portal-header-actions .btn > span { display: none; }
  .portal-header-actions .btn { width: 38px; padding: 0; }
  .case-hero { padding: 20px; }
  .tl-entry { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .tl-node { width: 34px; height: 34px; border-radius: 11px; }
  .tl-node .ti { font-size: 17px; }
  .tl-entry::before { left: 16px; top: 36px; }
  .entry { padding: 16px; }
  .paper { padding: 28px 20px 22px; }
  .paper-head { grid-template-columns: 1fr; gap: 12px; }
  .paper-ref { text-align: left; }
  .paper-ref div { justify-content: flex-start; }
  .paper.logo-center .paper-ref { grid-auto-flow: row; }
  .paper-fields { grid-template-columns: 1fr; }
  .pf.span-1 { grid-column: span 1; }
  .pf.span-2 { grid-column: span 1; }
  .pf .pf-label + .pf-input, .pf .pf-label + .pf-answer, .pf .pf-label + .pf-choices, .pf .pf-label + .pf-select-wrap, .pf .pf-label + .sig, .pf .pf-help + * { margin-left: 0; width: 100%; }
  .pf-help, .pf-error { margin-left: 0; }
  .item-row { grid-template-columns: minmax(0, 1fr) auto; }
  .item-row .tl-node { display: none; }
  .setting-row { grid-template-columns: 1fr; gap: 12px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .lightbox { padding: 60px 10px; }
  .lb-nav { top: auto; bottom: 16px; transform: none; }
  .table .hide-sm { display: none; }
  .topbar-actions .btn .btn-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Print — forms print as clean paper documents
   ========================================================================== */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #000; }
  .portal-header, .portal-footer, .portal-bg, .form-actionbar, .form-page-head, .toast-stack, .sidebar, .topbar, .no-print, .submitted-banner, .investigator-msg, .idle-warning, .lightbox { display: none !important; }
  .admin-shell { display: block; }
  .admin-content, .portal-main { padding: 0 !important; max-width: none; }
  .paper { box-shadow: none; padding: 0; border-radius: 0; }
  .paper::before { display: none; }
  .pf, .pf-statement, .pf-heading { break-inside: avoid; }
  .response-view { background: none; border: 0; padding: 0; }
  .cred-slip { background: #fff !important; color: #111; border: 2px solid #111; }
  .cred-slip * { color: #111 !important; -webkit-text-fill-color: #111 !important; }
  .cred-box { background: #f4f4f8 !important; border-color: #999 !important; }
}
