:root {
  --ink: #17312b;
  --ink-soft: #51635e;
  --forest: #173f35;
  --forest-deep: #102f28;
  --green: #2f8068;
  --green-soft: #e3efe9;
  --cream: #f0ede7;
  --paper: #fffdfa;
  --paper-muted: #f7f5f1;
  --line: #d8d4cc;
  --amber: #a56b19;
  --amber-soft: #f8ecd7;
  --red: #a5453e;
  --red-soft: #f7e5e1;
  --blue: #356c82;
  --blue-soft: #e3edf1;
  --shadow: 0 14px 38px rgba(27, 47, 41, .11);
  --ui: "Public Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: var(--ui); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.welcome-screen { position: relative; z-index: 1; min-height: 100vh; overflow: hidden; background: var(--cream); }
.welcome-screen[hidden] { display: none; }
.welcome-nav, .welcome-screen main, .welcome-footer { width: min(1120px, calc(100% - 44px)); margin: 0 auto; }
.welcome-nav { display: flex; align-items: center; gap: 24px; min-height: 72px; border-bottom: 1px solid rgba(23, 49, 43, .12); }
.welcome-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--forest); font-size: 19px; font-weight: 750; letter-spacing: -.7px; }
.welcome-brand .brand-mark { border-color: var(--green); }
.welcome-brand .brand-mark i { background: var(--green); }
.welcome-links { display: flex; gap: 4px; margin-left: 10px; }
.welcome-links a { padding: 7px 10px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.welcome-links a:hover { color: var(--forest); }
.welcome-login { margin-left: auto; padding: 9px 14px; border: 1px solid rgba(23, 49, 43, .22); color: var(--forest); font-size: 13px; font-weight: 700; }
.welcome-login:hover { border-color: var(--green); background: #fffdfa; }
.welcome-hero { max-width: 805px; padding: 82px 0 48px; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 23px; padding: 6px 11px; border: 1px solid rgba(23, 49, 43, .14); background: #fffdfa; color: var(--ink-soft); font: 11px var(--mono); }
.welcome-kicker span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.welcome-hero h1 { max-width: 760px; font-size: clamp(40px, 5.3vw, 63px); line-height: 1.04; letter-spacing: -2.4px; }
.welcome-copy { max-width: 665px; margin: 23px 0 0; color: var(--ink-soft); font-size: clamp(17px, 1.8vw, 20px); line-height: 1.55; }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 29px; }
.welcome-primary, .welcome-secondary { min-height: 45px; display: inline-flex; align-items: center; padding: 0 19px; font-size: 14px; font-weight: 750; }
.welcome-primary { background: var(--green); color: #fff; }
.welcome-primary:hover { background: #246d58; }
.welcome-secondary { border: 1px solid rgba(23, 49, 43, .2); color: var(--forest); }
.welcome-secondary:hover { background: #fffdfa; }
.welcome-actions small { color: var(--ink-soft); font-size: 12px; }
.product-preview { border: 1px solid rgba(23, 49, 43, .14); background: #fffdfa; box-shadow: 0 24px 48px -38px rgba(23, 49, 43, .58); }
.preview-browser { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #f7f5f1; }
.preview-browser span { width: 9px; height: 9px; border-radius: 50%; background: #d1cdc4; }
.preview-browser b { margin-left: 8px; color: #78827e; font: 10px var(--mono); font-weight: 500; }
.preview-content { padding: 26px; }
.preview-top { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.preview-top p { margin: 0 0 5px; color: var(--green); font: 9px var(--mono); letter-spacing: .65px; }
.preview-top strong { font-size: 24px; letter-spacing: -.7px; }
.preview-top button { border: 0; padding: 10px 13px; background: var(--green); color: #fff; font-size: 12px; font-weight: 750; }
.preview-metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 22px; border: 1px solid var(--line); }
.preview-metrics div { min-height: 102px; padding: 17px; border-right: 1px solid var(--line); }
.preview-metrics div:last-child { border: 0; }
.preview-metrics small, .preview-metrics strong { display: block; }
.preview-metrics small { color: var(--ink-soft); font-size: 10px; }
.preview-metrics strong { margin-top: 12px; font: 25px var(--mono); font-weight: 500; }
.preview-metrics .amber { color: var(--amber); }
.preview-metrics .red { color: var(--red); }
.preview-rows { display: grid; grid-template-columns: 1.3fr .7fr; gap: 13px; margin-top: 13px; }
.preview-rows article { min-height: 112px; padding: 18px; border: 1px solid var(--line); }
.preview-rows b, .preview-rows span { display: block; }
.preview-rows b { font-size: 13px; }
.preview-rows span { margin-top: 22px; color: var(--ink-soft); font-size: 11px; }
.welcome-workflow { display: grid; grid-template-columns: .8fr 1.2fr; gap: 52px; padding: 94px 0; }
.welcome-workflow h2 { max-width: 410px; margin: 0; font-size: clamp(27px, 3.2vw, 38px); line-height: 1.1; letter-spacing: -1.2px; }
.welcome-workflow ol { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); background: var(--line); }
.welcome-workflow li { display: grid; grid-template-columns: 46px 1fr; gap: 13px; padding: 20px; background: #fffdfa; }
.welcome-workflow li > span { color: var(--green); font: 11px var(--mono); }
.welcome-workflow li strong { font-size: 14px; }
.welcome-workflow li p { margin: 6px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.welcome-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 35px; border-top: 1px solid rgba(23, 49, 43, .12); color: var(--ink-soft); font-size: 12px; }
.welcome-footer a { color: var(--forest); font-weight: 700; }
.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 27px 18px 20px; color: #dce8e3; background: var(--forest-deep); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: #fff; font-size: 21px; font-weight: 750; letter-spacing: -.7px; }
.brand-mark { width: 26px; height: 26px; display: flex; align-items: end; gap: 3px; padding: 5px; border: 1px solid #6db49d; }
.brand-mark i { width: 4px; background: #6db49d; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 10px; }
.agency-card { display: flex; align-items: center; gap: 10px; margin: 27px 2px 22px; padding: 12px; border: 1px solid #31544a; background: #173a31; }
.agency-avatar { display: grid; width: 32px; height: 32px; place-items: center; flex: 0 0 auto; background: #d5e8df; color: var(--forest); font: 10px var(--mono); font-weight: 700; }
.agency-card strong, .agency-card small { display: block; }
.agency-card strong { color: #f8faf8; font-size: 12px; }
.agency-card small { margin-top: 3px; color: #8eb0a6; font-size: 10px; }
nav { display: grid; gap: 4px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 11px 10px; border-left: 2px solid transparent; color: #fff; font-size: 13px; }
nav a:hover, nav a.active { border-left-color: #73bca4; background: #1a4439; color: #fff; }
nav a > span { width: 18px; color: #7fb9a7; text-align: center; font-size: 15px; }
nav b { min-width: 23px; margin-left: auto; padding: 2px 5px; border-radius: 10px; background: #2b574b; color: #cce4dc; font: 9px var(--mono); text-align: center; }
.logout-button { width: 100%; margin-top: auto; padding: 10px; border: 1px solid #31544a; background: transparent; color: #fff; font-size: 12px; font-weight: 700; text-align: left; }
.logout-button:hover { border-color: #73bca4; background: #1a4439; }
.sidebar-foot { display: flex; gap: 9px; align-items: start; margin-top: 14px; padding: 14px 9px 0; border-top: 1px solid #315047; color: #a1b9b1; font-size: 11px; }
.sidebar-foot small { display: block; margin-top: 4px; color: #708f86; font-size: 9px; }
.system-dot { width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: #6fc49f; box-shadow: 0 0 0 3px rgba(111, 196, 159, .12); }

main { min-width: 0; padding: 34px clamp(24px, 4vw, 62px) 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; max-width: 1480px; margin: 0 auto 27px; }
.eyebrow { margin: 0 0 6px; color: var(--green); font: 10px var(--mono); letter-spacing: .8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; letter-spacing: -.9px; }
h2 { margin-bottom: 5px; font-size: 18px; letter-spacing: -.4px; }
h3 { margin-bottom: 4px; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search { width: min(350px, 32vw); display: flex; align-items: center; gap: 8px; height: 39px; padding: 0 10px; border: 1px solid #cac6bd; background: var(--paper); color: #75817d; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.global-search kbd { padding: 2px 5px; border: 1px solid var(--line); color: #7b8581; background: var(--paper-muted); font: 9px var(--mono); }
.button { min-height: 38px; padding: 9px 14px; border: 1px solid transparent; font-weight: 700; font-size: 12px; }
.button.primary { color: #fff; background: var(--green); }
.button.primary:hover { background: #266e59; }
.button.secondary { border-color: #c9c6be; background: var(--paper); color: var(--ink-soft); }

#app-content { max-width: 1480px; margin: 0 auto; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--paper); }
.metric { min-height: 115px; padding: 18px 20px; border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric small { display: block; color: var(--ink-soft); font-size: 11px; }
.metric strong { display: block; margin: 11px 0 7px; font: 28px var(--mono); font-weight: 500; }
.metric p { margin: 0; color: #72807b; font-size: 10px; }
.metric.warning strong { color: var(--amber); }
.metric.danger strong { color: var(--red); }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); background: var(--paper); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-head p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.panel-link { border: 0; padding: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }
.action-list { padding: 0 18px; }
.action { display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; align-items: center; padding: 14px 0; border-bottom: 1px solid #e6e2db; }
.action:last-child { border: 0; }
.action-icon { display: grid; width: 31px; height: 31px; place-items: center; background: var(--amber-soft); color: var(--amber); font: 13px var(--mono); }
.action p { margin: 0 0 3px; font-size: 12px; font-weight: 700; }
.action small { color: var(--ink-soft); font-size: 10px; }
.action time { color: var(--red); font: 9px var(--mono); }
.risk-list { padding: 4px 18px; }
.risk-row { display: flex; align-items: center; gap: 11px; padding: 13px 0; border-bottom: 1px solid #e6e2db; cursor: pointer; }
.risk-row:last-child { border: 0; }
.risk-row:hover strong { color: var(--green); }
.risk-row > span:first-child { display: grid; width: 30px; height: 30px; place-items: center; background: var(--green-soft); color: var(--forest); font: 10px var(--mono); }
.risk-row strong, .risk-row small { display: block; }
.risk-row strong { font-size: 12px; }
.risk-row small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.risk-row .status { margin-left: auto; }

.page-tools { display: flex; gap: 8px; margin-bottom: 13px; }
.page-tools .search-field { flex: 1; }
.page-tools { flex-wrap: wrap; align-items: end; }
.page-tools > label:not(.search-field) { display: grid; gap: 6px; font-size: 13px; }
.page-tools select { min-height: 40px; max-width: 230px; padding: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.case-details-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.case-details-form label, .document-add-form label, .note-add-form label { display: grid; flex: 1; gap: 6px; min-width: 160px; }
.document-add-form, .note-add-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.detail-section input, .detail-section select, .detail-section textarea { padding: 10px; border: 1px solid var(--line); font: inherit; max-width: 100%; }
.detail-section textarea { width: 100%; resize: vertical; }
.case-note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.case-note p { white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.search-field { display: flex; align-items: center; gap: 8px; height: 39px; padding: 0 11px; border: 1px solid #c9c5bd; background: var(--paper); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter { min-width: 100px; padding: 9px 11px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); font-size: 11px; }
.filter.active { border-color: var(--green); background: var(--green-soft); color: var(--forest); font-weight: 700; }
.table-wrap { overflow: auto; }
.case-table { width: 100%; border-collapse: collapse; }
.case-table th { padding: 11px 14px; background: var(--paper-muted); color: #75827d; font: 9px var(--mono); letter-spacing: .45px; text-align: left; white-space: nowrap; }
.case-table td { padding: 13px 14px; border-top: 1px solid #e6e2db; font-size: 12px; vertical-align: middle; }
.case-table tbody tr { cursor: pointer; }
.case-table tbody tr:hover { background: #faf8f4; }
.cell-title, .cell-meta { display: block; }
.cell-title { font-weight: 700; }
.cell-meta { max-width: 350px; margin-top: 3px; color: var(--ink-soft); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner { display: flex; align-items: center; gap: 7px; }
.avatar { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--forest); font: 9px var(--mono); font-weight: 700; }
.status { display: inline-block; padding: 4px 7px; font: 9px var(--mono); white-space: nowrap; }
.status.at_risk { color: var(--amber); background: var(--amber-soft); }
.status.blocked { color: var(--red); background: var(--red-soft); }
.status.in_progress, .status.new { color: var(--blue); background: var(--blue-soft); }
.status.submitted, .status.received { color: var(--green); background: var(--green-soft); }
.status.missing, .status.expired { color: var(--red); background: var(--red-soft); }
.status.review { color: var(--amber); background: var(--amber-soft); }
.deadline.urgent { color: var(--red); }
.deadline.soon { color: var(--amber); }
.mono { font-family: var(--mono); font-size: 10px; }
.empty, .error-state, .loading { padding: 55px 25px; color: var(--ink-soft); text-align: center; }
.loading-bars { width: min(430px, 80%); margin: 18px auto 0; }
.loading-bars i { display: block; height: 8px; margin: 8px 0; background: linear-gradient(90deg, #e3dfd7, #f7f4ee, #e3dfd7); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.loading-bars i:nth-child(2) { width: 76%; }
.loading-bars i:nth-child(3) { width: 88%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.timeline { border: 1px solid var(--line); background: var(--paper); }
.timeline-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 18px; align-items: center; padding: 17px 19px; border-bottom: 1px solid #e6e2db; }
.timeline-row:last-child { border: 0; }
.timeline-row time { color: var(--green); font: 10px var(--mono); }
.timeline-row p { margin: 0 0 3px; font-size: 12px; font-weight: 700; }
.timeline-row small { color: var(--ink-soft); font-size: 10px; }

dialog { width: min(650px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(12, 30, 25, .58); }
.dialog-card { padding: 25px; }
#detail-dialog { width: min(1080px, calc(100vw - 64px)); max-height: min(88vh, 900px); overflow-x: hidden; overflow-y: auto; }
.detail-card { width: 100%; min-width: 0; overflow: hidden; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 22px; }
.icon-close { width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: 20px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 20px 0 8px; }
.form-grid label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .followup-form input, .followup-form select { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid #c8c4bc; background: #fff; color: var(--ink); }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 19px; }
.form-error { min-height: 15px; margin: 7px 0 0; color: var(--red); font-size: 11px; }
.detail-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 18px 0; background: var(--line); border: 1px solid var(--line); }
.detail-stat { padding: 13px; background: var(--paper-muted); }
.detail-stat small, .detail-stat strong { display: block; }
.detail-stat small { margin-bottom: 6px; color: var(--ink-soft); font: 9px var(--mono); }
.detail-stat strong { font-size: 12px; }
.detail-section { margin-top: 22px; }
.detail-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.detail-section-head h3 { margin: 0; }
.completion { color: var(--green); font: 10px var(--mono); }
.document-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid #e6e2db; }
.document-row strong { display: block; font-size: 11px; }
.document-row small { color: var(--ink-soft); font-size: 9px; }
.document-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.document-actions select { padding: 6px 7px; border: 1px solid var(--line); background: #fff; font-size: 10px; }
.followup-form { position: relative; z-index: 1; display: grid; grid-template-columns: 110px minmax(0, 1fr) 135px auto; gap: 7px; margin-top: 10px; }
.followup-form label { display: grid; gap: 4px; min-width: 0; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.followup-form input, .followup-form select { min-height: 36px; pointer-events: auto; font-size: 10px; }
.followup-item { display: grid; grid-template-columns: 80px 1fr auto; gap: 9px; align-items: center; padding: 10px 0; border-top: 1px solid #e6e2db; }
.followup-item p { margin: 0; font-size: 11px; }
.followup-item small { color: var(--ink-soft); font-size: 9px; }
.mini-button { padding: 6px 8px; border: 1px solid var(--line); background: var(--paper); color: var(--green); font-size: 9px; font-weight: 700; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 340px; padding: 12px 15px; background: var(--forest); color: #fff; box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: none; }
.login-screen { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 30px; overflow: hidden; background-color: var(--cream); background-image: linear-gradient(rgba(23, 49, 43, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 49, 43, .055) 1px, transparent 1px); background-size: 208px 188px; }
.login-screen::before { content: ""; position: absolute; z-index: -1; width: 120vw; height: 310px; left: -10vw; bottom: 16%; border-top: 6px solid rgba(47, 128, 104, .12); border-radius: 50%; transform: rotate(8deg); }
.login-screen[hidden] { display: none; }
.login-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.login-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 38px; color: var(--forest); font-size: 23px; font-weight: 750; letter-spacing: -.7px; }
.brand-wave { width: 30px; height: 30px; flex: 0 0 auto; }
.login-brand .brand-mark { border-color: var(--green); }
.login-brand .brand-mark i { background: var(--green); }
.login-card h1 { margin-bottom: 9px; font-size: 31px; }
.login-copy { margin-bottom: 26px; color: var(--ink-soft); line-height: 1.5; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; margin: -6px 0 20px; border: 1px solid var(--line); }
.auth-switch button { min-height: 36px; border: 0; background: transparent; color: var(--ink-soft); font: 700 10px var(--mono); cursor: pointer; }
.auth-switch button + button { border-left: 1px solid var(--line); }
.auth-switch button.active { background: var(--forest); color: #fff; }
.login-form { display: grid; gap: 16px; }
.login-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.login-form .signup-only[hidden] { display: none; }
.login-form input { min-height: 43px; padding: 10px 11px; border: 1px solid #c8c4bc; background: #fff; color: var(--ink); }
.password-field { position: relative; display: block; }
.password-field input { display: block; width: 100%; padding-right: 45px; }
.password-field button { position: absolute; top: 50%; right: 6px; display: grid; width: 30px; height: 30px; padding: 0; place-items: center; transform: translateY(-50%); border: 0; background: transparent; color: var(--green); cursor: pointer; }
.password-field button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.password-field button:hover { color: var(--forest); background: var(--green-soft); }
.password-field button:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.login-form .button { width: 100%; margin-top: 4px; }
.login-note { margin: 22px 0 0; color: #75817d; font-size: 10px; text-align: center; }
.form-success { min-height: 15px; margin: 7px 0 0; color: var(--green); font-size: 11px; line-height: 1.45; }
.login-back { display: block; margin-top: 15px; color: var(--forest); font-size: 11px; font-weight: 700; text-align: center; }
.onboarding-panel { max-width: 680px; margin: 32px auto; padding: 34px; }
.onboarding-panel h2 { margin: 0 0 8px; font-size: 24px; }
.onboarding-panel > p { max-width: 550px; margin: 0; color: var(--ink-soft); line-height: 1.6; }
.onboarding-form { display: grid; grid-template-columns: 1fr 160px auto; align-items: end; gap: 14px; margin-top: 26px; }
.onboarding-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.onboarding-form label small, .signup-only small { color: var(--ink-soft); font-size: 9px; font-weight: 500; }
.onboarding-form input { min-height: 42px; padding: 10px 11px; border: 1px solid #c8c4bc; background: #fff; color: var(--ink); }
@media (max-width: 760px) { .onboarding-form { grid-template-columns: 1fr; } }
.app-booting .app-shell,
.app-booting #welcome-screen,
.app-booting #login-screen { display: none !important; }
.app-shell[hidden] { display: none !important; }
.is-logged-out .app-shell { display: none; }
.app-shell.view-enter { animation: workspace-enter .26s ease-out both; }
@keyframes workspace-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .app-shell.view-enter { animation: none; }
}

@media (max-width: 980px) {
  .welcome-workflow { grid-template-columns: 1fr; gap: 28px; }
  .app-shell { grid-template-columns: 76px 1fr; }
  .sidebar { padding: 23px 10px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .agency-card > span:last-child, nav a:not(.active) { font-size: 0; }
  .agency-card { justify-content: center; padding: 10px 0; border: 0; background: transparent; }
  nav a { justify-content: center; padding: 11px 8px; }
  nav a > span { font-size: 16px; }
  .sidebar-foot, nav b { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section-grid { grid-template-columns: 1fr; }
  .global-search { width: 260px; }
}

@media (max-width: 680px) {
  .welcome-nav, .welcome-screen main, .welcome-footer { width: min(100% - 30px, 1120px); }
  .welcome-nav { min-height: 64px; gap: 8px; }
  .welcome-links { display: none; }
  .welcome-hero { padding: 54px 0 36px; }
  .welcome-hero h1 { font-size: 38px; letter-spacing: -1.5px; }
  .preview-content { padding: 16px; }
  .preview-metrics { grid-template-columns: repeat(2, 1fr); }
  .preview-metrics div:nth-child(2) { border-right: 0; }
  .preview-metrics div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .preview-rows { grid-template-columns: 1fr; }
  .welcome-workflow { padding: 60px 0; }
  .welcome-footer { align-items: start; flex-direction: column; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; }
  .brand { margin-right: auto; }
  .brand > span:last-child { display: inline; font-size: 18px; }
  .agency-card { display: none; }
  nav { display: flex; }
  nav a { width: 38px; border: 0; }
  nav a.active { border: 0; }
  .topbar { align-items: end; }
  .topbar-actions .global-search { display: none; }
  main { padding: 23px 13px 50px; }
  h1 { font-size: 24px; }
  .metrics { margin: 0 -13px; border-left: 0; border-right: 0; }
  .metric { min-height: 100px; padding: 14px; }
  .page-tools { flex-wrap: wrap; }
  .page-tools .search-field { flex-basis: 100%; }
  .filter { flex: 1; min-width: 0; }
  .case-table th:nth-child(2), .case-table td:nth-child(2), .case-table th:nth-child(5), .case-table td:nth-child(5) { display: none; }
  .timeline-row { grid-template-columns: 85px 1fr; }
  .timeline-row > :last-child { grid-column: 2; justify-self: start; }
  .form-grid, .detail-overview { grid-template-columns: 1fr; }
  .form-grid label.wide { grid-column: auto; }
  .followup-form { grid-template-columns: 1fr 1fr; }
  .followup-form input { grid-column: 1 / -1; }
  .document-row { grid-template-columns: 1fr; }
  .document-actions { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce), (max-width: 980px) {
}

/* Échelle desktop large : le tableau de bord doit rester lisible sur un écran large. */
@media (min-width: 1600px) {
  .app-shell { grid-template-columns: 320px minmax(0, 1fr); }
  .sidebar { padding: 34px 23px 24px; }
  .brand { gap: 14px; font-size: 28px; }
  .brand-mark { width: 34px; height: 34px; }
  .agency-card { margin: 34px 2px 28px; padding: 15px; }
  .agency-avatar { width: 38px; height: 38px; font-size: 11px; }
  .agency-card strong { font-size: 14px; }
  .agency-card small { font-size: 11px; }
  nav { gap: 6px; }
  nav a { padding: 16px 13px; gap: 14px; font-size: 17px; }
  nav a > span { width: 23px; font-size: 19px; }
  nav b { min-width: 27px; font-size: 10px; }
  .sidebar-foot { padding: 17px 10px 0; font-size: 12px; }
  .sidebar-foot small { font-size: 10px; }
  main { padding: 46px 48px 80px; }
  .topbar, #app-content { width: 100%; max-width: none; }
  .topbar { margin-bottom: 34px; }
  .eyebrow { font-size: 11px; }
  h1 { font-size: 41px; }
  h2 { font-size: 23px; }
  .global-search { width: min(430px, 32vw); height: 45px; font-size: 13px; }
  .global-search input, .button { font-size: 14px; }
  .button { min-height: 45px; padding: 11px 17px; }
  .metric { min-height: 142px; padding: 23px 25px; }
  .metric small { font-size: 13px; }
  .metric strong { margin: 14px 0 9px; font-size: 40px; }
  .metric p, .panel-head p { font-size: 12px; }
  .section-grid { grid-template-columns: minmax(0, 2fr) minmax(500px, .8fr); gap: 24px; margin-top: 20px; }
  .panel-head { padding: 21px 23px; }
  .action-list, .risk-list { padding-left: 23px; padding-right: 23px; }
  .action { padding: 18px 0; }
  .action p, .risk-row strong { font-size: 15px; }
  .action small, .risk-row small { font-size: 13px; }
  .case-table th { padding: 14px 17px; font-size: 10px; }
  .case-table td { padding: 18px; font-size: 15px; }
  .cell-meta { font-size: 13px; }
  .status { font-size: 10px; }
  .page-tools { gap: 10px; margin-bottom: 17px; }
  .search-field { height: 45px; }
  .search-field input, .filter { font-size: 13px; }
  .filter { padding: 11px 14px; }
}

/* Landing page v2: adapted from the approved design export, without its prototype runtime. */
.landing-v2 { background: #faf9f6; color: #14130f; }
.landing-v2 .welcome-nav, .landing-v2 main, .landing-v2 .welcome-footer { width: min(1320px, calc(100% - 64px)); }
.landing-v2 .welcome-nav { position: sticky; top: 0; z-index: 5; min-height: 66px; background: rgba(250,249,246,.94); backdrop-filter: blur(9px); }
.landing-v2 .welcome-hero { position: relative; max-width: none; min-height: calc(100vh - 66px); padding: 0; display: grid; place-items: center; overflow: hidden; }
.landing-v2 .welcome-hero > :not(.landing-waves) { position: relative; z-index: 1; }
.landing-v2 .landing-waves { position: absolute; inset: auto 0 0; height: 54%; overflow: hidden; opacity: .8; }
.landing-v2 .landing-waves i { position: absolute; width: 150%; height: 38%; left: -25%; bottom: -20%; border-top: 3px solid rgba(28,107,82,.48); border-radius: 50% 50% 0 0; animation: landing-wave 22s linear infinite; }
.landing-v2 .landing-waves i:nth-child(2) { bottom: 2%; opacity: .65; animation-duration: 31s; animation-direction: reverse; }
.landing-v2 .landing-waves i:nth-child(3) { bottom: 24%; opacity: .35; animation-duration: 39s; }
.landing-v2 .landing-waves b { position: absolute; width: 11px; height: 11px; border: 1px solid rgba(28,107,82,.35); border-radius: 50%; animation: landing-bubble 7s ease-in-out infinite alternate; }
.landing-v2 .landing-waves b:nth-of-type(1) { left: 14%; bottom: 33%; }.landing-v2 .landing-waves b:nth-of-type(2) { left: 72%; bottom: 22%; width: 16px; height: 16px; animation-delay: 1.5s; }.landing-v2 .landing-waves b:nth-of-type(3) { left: 88%; bottom: 41%; animation-delay: 3s; }
@keyframes landing-wave { from { transform: translateX(-5%); } to { transform: translateX(6%); } }
@keyframes landing-bubble { from { transform: translateY(9px); } to { transform: translateY(-11px); } }
.landing-v2 .welcome-hero > div:last-child { width: min(1060px, 100%); display: flex; align-items: center; gap: clamp(28px, 6vw, 86px); padding: 82px 0 142px; }
.landing-v2 .welcome-hero h1 { max-width: 20ch; color: #14130f; font-size: clamp(42px, 5.6vw, 68px); letter-spacing: -.055em; }
.landing-v2 .welcome-copy { max-width: 58ch; color: rgba(20,19,15,.63); }
.landing-v2 .welcome-actions small { display: none; }
.landing-v2 .welcome-primary { background: #0c3a2c; }.landing-v2 .welcome-secondary { background: #faf9f6; color: #14130f; }
.landing-v2 .landing-hero-symbol { display: grid; place-items: center; width: clamp(115px, 15vw, 205px); height: clamp(115px, 15vw, 205px); color: #dbe4dd; background: #0c3a2c; border-radius: 48% 52% 46% 54%; font: clamp(80px, 11vw, 150px)/1 Georgia, serif; transform: rotate(-9deg); }
.landing-v2 .welcome-workflow, .landing-v2 .landing-pricing, .landing-v2 .landing-access { width: min(1180px, 100%); margin: 0 auto; }
.landing-v2 .welcome-workflow { padding-top: 120px; }
.landing-pricing { padding: 122px 0; }.landing-pricing-heading { margin-bottom: 36px; }.landing-pricing-heading h2, .landing-access h2 { margin: 0; font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -.04em; }
.landing-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }.landing-plans article { min-height: 258px; display: flex; flex-direction: column; gap: 11px; padding: 25px; background: #0c3a2c; color: #fff; }.landing-plans h3, .landing-plans p { margin: 0; }.landing-plans h3 { font-size: 18px; }.landing-plans strong { margin-top: 6px; font: 23px var(--mono); }.landing-plans small { color: rgba(219,228,221,.7); font-size: 12px; }.landing-plans p { color: rgba(219,228,221,.84); font-size: 13px; line-height: 1.5; }.landing-plans a { margin-top: auto; padding: 10px; border: 1px solid rgba(219,228,221,.45); text-align: center; font: 11px var(--mono); }
.landing-access { min-height: 400px; display: flex; flex-direction: column; justify-content: center; padding: 72px 0; border-top: 1px solid rgba(0,0,0,.12); }.landing-access > p:not(.eyebrow) { max-width: 58ch; margin: 14px 0 26px; color: rgba(20,19,15,.62); line-height: 1.55; }.landing-access .welcome-primary { width: fit-content; }
.landing-v2 .welcome-footer { padding-top: 27px; }.landing-v2 .welcome-footer span:first-child { font-size: 14px; font-weight: 700; }.landing-v2 .welcome-footer span:first-child::first-letter { color: #1c6b52; }
@media (max-width: 850px) { .landing-v2 .welcome-nav, .landing-v2 main, .landing-v2 .welcome-footer { width: min(100% - 32px, 1320px); }.landing-v2 .landing-demo-link { display: none; }.landing-v2 .welcome-hero > div:last-child { padding: 72px 0 120px; flex-direction: column; align-items: flex-start; }.landing-v2 .landing-hero-symbol { width: 105px; height: 105px; font-size: 78px; }.landing-plans { grid-template-columns: repeat(2, 1fr); }.landing-v2 .welcome-workflow, .landing-v2 .landing-pricing, .landing-v2 .landing-access { width: 100%; } }
@media (max-width: 560px) { .landing-v2 .welcome-login { font-size: 11px; padding: 8px 10px; }.landing-v2 .welcome-hero h1 { font-size: 42px; }.landing-plans { grid-template-columns: 1fr; }.landing-pricing { padding: 74px 0; }.landing-v2 .welcome-workflow { padding-top: 74px; } }
