:root {
  --ink: #142c33;
  --ink-soft: #526970;
  --muted: #71848a;
  --line: #dce5e6;
  --line-strong: #c8d4d6;
  --surface: #ffffff;
  --surface-soft: #f5f8f8;
  --canvas: #edf3f3;
  --brand-950: #092d35;
  --brand-900: #103b45;
  --brand-800: #15505c;
  --brand-700: #176676;
  --brand-600: #168091;
  --brand-100: #dff2f3;
  --accent: #ed744f;
  --accent-soft: #fff0ea;
  --blue: #3976c2;
  --blue-soft: #e9f1fb;
  --amber: #ad7415;
  --amber-soft: #fff4d9;
  --green: #247759;
  --green-soft: #e2f3ea;
  --red: #b9463e;
  --red-soft: #fdebea;
  --purple: #7857a8;
  --purple-soft: #f0eafb;
  --shadow-sm: 0 1px 2px rgba(9, 45, 53, .04), 0 4px 14px rgba(9, 45, 53, .035);
  --shadow-md: 0 16px 40px rgba(9, 45, 53, .10);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 252px;
  --topbar-height: 68px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-900); }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; color: var(--ink); font-size: clamp(26px, 3vw, 34px); line-height: 1.18; letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 18px; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: 15px; }
small { line-height: 1.35; }
:focus-visible { outline: 3px solid rgba(22, 128, 145, .3); outline-offset: 2px; }
::selection { background: var(--brand-100); color: var(--brand-950); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; width: var(--sidebar-width); flex-direction: column; overflow-y: auto; color: #dce9eb; background: linear-gradient(180deg, var(--brand-950) 0%, #0d3740 100%); }
.sidebar__brand { display: flex; min-height: var(--topbar-height); align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; }
.brand:hover { color: inherit; }
.brand__mark { display: inline-grid; width: 36px; height: 36px; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #fff; background: linear-gradient(145deg, var(--brand-600), #22a3aa); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); font-size: 18px; font-weight: 800; }
.brand__copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand__copy strong { color: #fff; font-size: 15px; letter-spacing: -.01em; }
.brand__copy small { margin-top: 3px; color: #8cb1b8; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.sidebar__nav { flex: 1; padding: 24px 14px; }
.sidebar__label { margin: 0 12px 10px; color: #769ba2; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 12px; margin: 3px 0; padding: 10px 12px; border-radius: 10px; color: #bcd1d5; font-weight: 600; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.is-active { color: #fff; background: rgba(49, 173, 180, .18); box-shadow: inset 3px 0 0 #45b6b8; }
.nav-link__icon { display: inline-grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: #8db5bc; background: rgba(255,255,255,.055); font-size: 17px; }
.nav-link.is-active .nav-link__icon { color: #9ee6e4; background: rgba(255,255,255,.08); }
.sidebar__footer { padding: 16px 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar__user { display: flex; min-width: 0; align-items: center; gap: 10px; margin: 0 6px 14px; }
.sidebar__user-copy { display: flex; min-width: 0; flex-direction: column; }
.sidebar__user-copy strong, .sidebar__user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-copy strong { color: #f7fbfb; font-size: 13px; }
.sidebar__user-copy small { color: #89a9af; font-size: 11px; }
.avatar { display: inline-grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--brand-900); background: #c9e8e8; font-weight: 800; }
.sidebar__close, .topbar__menu, .nav-backdrop { display: none; }
.app-main { min-height: 100vh; padding-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; height: var(--topbar-height); align-items: center; gap: 14px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.topbar__context { display: flex; min-width: 0; flex-direction: column; }
.topbar__eyebrow { color: var(--brand-700); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.topbar__name { overflow: hidden; color: var(--ink-soft); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.topbar__avatar { width: 32px; height: 32px; font-size: 12px; }
.language-switcher { display: inline-flex; align-items: center; gap: 4px; color: var(--line-strong); }
.language-switcher__option { padding: 4px 3px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.language-switcher__option:hover, .language-switcher__option.is-active { color: var(--brand-800); }
.page { width: min(100%, 1480px); margin: 0 auto; padding: 32px clamp(20px, 3vw, 42px) 56px; }

/* Controls */
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1.15; transition: box-shadow .18s ease, transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button--primary { color: #fff; background: var(--brand-700); box-shadow: 0 5px 14px rgba(21, 102, 118, .18); }
.button--primary:hover { color: #fff; background: var(--brand-800); box-shadow: 0 8px 18px rgba(21, 102, 118, .22); }
.button--secondary { color: var(--ink); border-color: var(--line-strong); background: #fff; }
.button--secondary:hover { color: var(--brand-800); border-color: #a8c0c4; background: #fbfdfd; }
.button--ghost { color: #afc8cc; border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.04); }
.button--ghost:hover { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.08); }
.button--danger { color: #fff; background: var(--red); }
.button--danger:hover { color: #fff; background: #9d352f; }
.button--danger-outline { color: var(--red); border-color: #efc4c1; background: #fff; }
.button--danger-outline:hover { color: #92352f; border-color: #dfa09b; background: var(--red-soft); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button--large { min-height: 46px; padding-inline: 20px; }
.button--small { min-height: 33px; padding: 7px 11px; font-size: 12px; }
.button--full { width: 100%; }
.button.is-disabled { opacity: .46; pointer-events: none; }
.icon-button { display: inline-grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; cursor: pointer; font-size: 16px; }
.icon-button:hover { color: var(--brand-800); border-color: #b5cbce; background: var(--surface-soft); }
.icon-button--mail { color: var(--brand-700); background: var(--brand-100); }
.icon-button--danger { color: var(--red); background: var(--red-soft); }
.inline-form { display: inline-flex; margin: 0; }
.link-button { padding: 0; border: 0; color: var(--brand-700); background: transparent; cursor: pointer; font-size: inherit; font-weight: inherit; }
.text-link { font-size: 12px; font-weight: 750; white-space: nowrap; }
.danger-link { color: var(--red) !important; }

/* Headers and surfaces */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header > div:first-child { min-width: 0; }
.page-header p:not(.eyebrow) { max-width: 720px; margin-bottom: 0; color: var(--ink-soft); }
.page-header--compact { margin-bottom: 20px; }
.page-header--dashboard { align-items: center; }
.page-header__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.eyebrow { margin-bottom: 7px; color: var(--brand-700); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel:not(.panel--flush):not(.form-panel):not(.confirmation-card):not(.email-preview):not(.sticky-actions) { padding: 22px; }
.panel--flush { overflow: hidden; }
.panel__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel__header h2, .panel__header p { margin-bottom: 0; }
.panel__header p { color: var(--muted); font-size: 12px; }
.panel__header--padded { margin: 0; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.panel__header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 17px; color: var(--muted); font-size: 11px; }
.breadcrumbs a { font-weight: 700; }
.breadcrumbs span:last-child { overflow: hidden; max-width: 42ch; text-overflow: ellipsis; white-space: nowrap; }

/* Feedback */
.message-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.message { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 12px; border: 1px solid #c5dfe0; border-radius: 10px; color: var(--brand-900); background: #eaf7f6; }
.message--success { color: #175b43; border-color: #b7dfcb; background: var(--green-soft); }
.message--error { color: #8d302c; border-color: #f1c7c4; background: var(--red-soft); }
.message--warning { color: #76500c; border-color: #f0d8a5; background: var(--amber-soft); }
.message__icon { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.7); font-weight: 850; }
.message__text { flex: 1; }
.message__close { border: 0; color: currentColor; background: transparent; cursor: pointer; font-size: 20px; opacity: .65; }

/* Dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; display: flex; min-height: 116px; align-items: center; gap: 14px; overflow: hidden; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.stat-card::after { position: absolute; right: -18px; bottom: -28px; width: 86px; height: 86px; border-radius: 50%; background: currentColor; content: ""; opacity: .045; }
.stat-card:hover { color: var(--ink); border-color: #c5d5d7; box-shadow: 0 8px 24px rgba(9,45,53,.08); }
.stat-card__icon { display: inline-grid; width: 42px; height: 42px; place-items: center; flex: 0 0 auto; border-radius: 12px; font-size: 20px; }
.stat-card__copy { display: flex; min-width: 0; flex-direction: column-reverse; }
.stat-card__copy small { overflow: hidden; color: var(--ink-soft); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.stat-card__copy strong { font-size: 28px; line-height: 1.15; letter-spacing: -.04em; }
.stat-card__arrow { margin-left: auto; color: var(--muted); }
.stat-card--teal .stat-card__icon { color: var(--brand-700); background: var(--brand-100); }
.stat-card--blue .stat-card__icon { color: var(--blue); background: var(--blue-soft); }
.stat-card--amber .stat-card__icon { color: var(--amber); background: var(--amber-soft); }
.stat-card--coral .stat-card__icon { color: var(--accent); background: var(--accent-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 18px; }
.operations-section { margin-top: 24px; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 11px; }
.section-title h2, .section-title p { margin-bottom: 0; }
.operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.queue-panel .panel__header h2 { font-size: 14px; }
.queue-count { display: inline-grid; min-width: 24px; height: 24px; place-items: center; padding: 0 6px; border-radius: 999px; color: var(--brand-800); background: var(--brand-100); font-size: 10px; font-weight: 850; }
.queue-list { display: grid; }
.queue-row { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.queue-row:first-child { border-top: 0; }
.queue-row:hover { color: var(--ink); background: var(--surface-soft); }
.queue-row__mark { display: inline-grid; width: 30px; height: 30px; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--brand-700); background: var(--brand-100); font-weight: 850; }
.queue-row__mark--amber { color: var(--amber); background: var(--amber-soft); }
.queue-row__mark--coral, .record-row__avatar--danger { color: var(--red); background: var(--red-soft); }
.queue-row__mark--green { color: var(--green); background: var(--green-soft); }
.queue-row__copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.queue-row__copy strong, .queue-row__copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row__copy small, .queue-row time { color: var(--muted); font-size: 10px; }
.queue-row__action { color: var(--brand-700); font-size: 9px; font-weight: 800; }
.queue-empty { min-height: 90px; padding: 34px 16px; color: var(--muted); text-align: center; }
.record-list, .deadline-list { display: grid; }
.record-row, .deadline-row { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--ink); }
.record-row:first-child, .deadline-row:first-child { border-top: 0; }
.record-row:hover, .deadline-row:hover { color: var(--ink); background: var(--surface-soft); }
.record-row__avatar { display: inline-grid; width: 36px; height: 36px; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--brand-800); background: var(--brand-100); font-weight: 800; }
.record-row__main { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.record-row__main strong, .record-row__main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-row__main small { color: var(--muted); }
.record-row time { color: var(--muted); font-size: 11px; }
.date-tile { display: inline-grid; width: 42px; height: 46px; place-items: center; flex: 0 0 auto; padding: 5px; border-radius: 9px; color: var(--brand-800); background: var(--brand-100); line-height: 1; }
.date-tile strong { font-size: 16px; }
.date-tile small { font-size: 9px; font-weight: 800; text-transform: uppercase; }
.compact-empty { display: grid; min-height: 150px; place-items: center; align-content: center; gap: 8px; padding: 28px; color: var(--muted); text-align: center; }
.compact-empty > span { display: inline-grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--brand-700); background: var(--brand-100); font-size: 18px; }
.compact-empty p { margin: 0; }

/* Status */
.status-badge { display: inline-flex; width: fit-content; min-height: 24px; align-items: center; padding: 3px 9px; border-radius: 999px; color: var(--ink-soft); background: #edf1f2; font-size: 10px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.status-badge--active, .status-badge--completed, .status-badge--complete, .status-badge--verified, .status-badge--submitted, .status-badge--sent { color: var(--green); background: var(--green-soft); }
.status-badge--new, .status-badge--draft, .status-badge--pending { color: var(--blue); background: var(--blue-soft); }
.status-badge--contacted, .status-badge--in-progress, .status-badge--in_progress, .status-badge--partial { color: var(--amber); background: var(--amber-soft); }
.status-badge--qualified, .status-badge--converted { color: var(--purple); background: var(--purple-soft); }
.status-badge--overdue, .status-badge--failed, .status-badge--missing { color: var(--red); background: var(--red-soft); }
.status-badge--inactive, .status-badge--cancelled { color: #65777c; background: #e9edef; }
.status-badge--archived { color: #59656a; border: 1px solid #d4dcde; background: #edf1f2; }
.status-badge--required { color: var(--purple); background: var(--purple-soft); }
.status-badge--optional { color: #65777c; background: #e9edef; }
.status-badge--approved { color: var(--green); background: var(--green-soft); }
.status-badge--changes-required, .status-badge--changes_required { color: var(--red); background: var(--red-soft); }

/* Filters and data tables */
.filter-bar { display: flex; align-items: center; gap: 9px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.search-field { position: relative; flex: 1; max-width: 520px; }
.search-field > span { position: absolute; top: 50%; left: 13px; color: var(--muted); font-size: 18px; transform: translateY(-50%); }
.search-field input { width: 100%; padding-left: 38px; }
.filter-bar select { width: auto; min-width: 150px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fbfcfc; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid #e7eeee; color: var(--ink-soft); vertical-align: middle; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fafcfc; }
.data-table tbody tr.is-archived, .data-table tbody tr.is-inactive { background: #f7f8f8; }
.data-table tbody tr.is-archived td, .data-table tbody tr.is-inactive td { color: #68777b; }
.data-table tbody tr.is-archived .table-avatar, .data-table tbody tr.is-inactive .table-avatar { color: #6f7c80; background: #e7ebec; filter: grayscale(.4); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.primary-cell { display: inline-flex; min-width: 190px; align-items: center; gap: 10px; color: var(--ink); }
.primary-cell:hover { color: var(--brand-700); }
.primary-cell > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.primary-cell strong, .primary-cell small { overflow: hidden; max-width: 230px; text-overflow: ellipsis; white-space: nowrap; }
.primary-cell small, .table-subtext { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.table-avatar { display: inline-grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--brand-700); background: var(--brand-100); font-weight: 800; }
.table-actions { display: flex; min-width: 62px; align-items: center; justify-content: flex-end; gap: 5px; text-align: right; }
.document-actions { min-width: 190px; flex-wrap: wrap; }
.document-filename-edit { white-space: nowrap; }
.table-title-link { color: var(--ink); font-weight: 750; }
.muted-text { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-top: 1px solid var(--line); background: #fbfcfc; }
.pagination__summary { margin: 0; color: var(--muted); font-size: 11px; }
.pagination__controls { display: flex; gap: 7px; }
.empty-state { display: grid; min-height: 390px; place-items: center; align-content: center; padding: 40px 24px; text-align: center; }
.empty-state__mark { display: inline-grid; width: 52px; height: 52px; place-items: center; margin-bottom: 8px; border-radius: 16px; color: var(--brand-700); background: var(--brand-100); font-size: 24px; }
.empty-state h2 { margin-bottom: 5px; }
.empty-state p { max-width: 420px; margin-bottom: 18px; color: var(--muted); }

/* Forms */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; box-shadow: inset 0 1px 1px rgba(9,45,53,.02); transition: border-color .16s ease, box-shadow .16s ease; }
textarea { min-height: 132px; resize: vertical; }
input[type="file"] { padding: 7px; }
input::placeholder, textarea::placeholder { color: #97a7aa; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); outline: 0; box-shadow: 0 0 0 3px rgba(22,128,145,.12); }
input[disabled], select[disabled], textarea[disabled] { color: #71848a; background: #f0f4f4; cursor: not-allowed; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: start; gap: 18px; }
.form-panel { padding: 25px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.section-heading__number { display: inline-grid; min-width: 34px; height: 34px; place-items: center; border-radius: 9px; color: var(--brand-700); background: var(--brand-100); font-size: 11px; font-weight: 850; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.section-heading p { color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 18px; }
.form-grid--single { grid-template-columns: 1fr; }
.form-field { min-width: 0; }
.form-field--wide, .form-field:has(textarea) { grid-column: 1 / -1; }
.form-field > label:not(.checkbox-control) { display: inline-block; margin-bottom: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.required-mark { margin-left: 3px; color: var(--red); }
.help-text { margin-top: 5px; color: var(--muted); font-size: 10px; }
.field-errors { margin-top: 5px; color: var(--red); font-size: 10px; }
.field-errors ul, .form-alert ul { margin: 4px 0 0; padding-left: 18px; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: #da7c76; background: #fffafa; }
.form-field--checkbox { display: flex; align-items: flex-end; }
.checkbox-control { display: inline-flex; min-height: 42px; align-items: center; gap: 9px; color: var(--ink-soft); font-weight: 650; cursor: pointer; }
.checkbox-control input { width: 17px; height: 17px; accent-color: var(--brand-700); }
.form-alert { margin-bottom: 18px; padding: 11px 13px; border: 1px solid #efc1bd; border-radius: 9px; color: #8f342f; background: var(--red-soft); }
.editor-actions { min-width: 0; }
.sticky-actions { position: sticky; top: calc(var(--topbar-height) + 18px); display: grid; gap: 9px; padding: 16px; }
.sticky-actions > p { margin: 0 0 5px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.stacked-actions { display: grid; gap: 9px; }
.action-hint { display: flex; gap: 8px; margin: 3px 0 0; padding: 10px; border-radius: 8px; color: var(--ink-soft); background: var(--surface-soft); font-size: 10px; }
.action-hint > span { display: inline-grid; width: 18px; height: 18px; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--brand-700); background: var(--brand-100); font-weight: 800; }
.context-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 20px; padding: 12px; border-radius: 9px; color: var(--ink-soft); background: var(--surface-soft); }
.context-banner > span { color: var(--brand-700); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.context-banner small { color: var(--muted); }

/* Entity and details */
.entity-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.entity-header__identity { display: flex; min-width: 0; align-items: center; gap: 15px; }
.entity-header__identity > div { min-width: 0; }
.entity-header h1 { overflow-wrap: anywhere; margin-bottom: 2px; }
.entity-header p { margin: 0; color: var(--muted); }
.entity-header__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.entity-avatar { display: inline-grid; width: 56px; height: 56px; place-items: center; flex: 0 0 auto; border-radius: 17px; color: var(--brand-800); background: var(--brand-100); font-size: 22px; font-weight: 850; }
.entity-avatar--filing { color: var(--blue); background: var(--blue-soft); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 18px; }
.detail-grid__main, .detail-grid__side { display: grid; gap: 18px; min-width: 0; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list--two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
.detail-list > div { min-width: 0; padding: 11px 0; border-top: 1px solid #e8eeee; }
.detail-list > div:first-child, .detail-list--two-col > div:nth-child(2) { border-top: 0; }
.detail-list dt { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 620; }
.prose-note { margin-top: 13px; padding: 14px; border-radius: 9px; background: var(--surface-soft); }
.prose-note > span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.prose-note p { margin: 6px 0 0; color: var(--ink-soft); }
.quick-actions { padding: 0 !important; overflow: hidden; }
.quick-actions .panel__header { margin: 0; padding: 18px 18px 10px; }
.quick-actions > a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.quick-actions > a:hover { background: var(--surface-soft); }
.quick-actions > a > span:first-child { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: var(--brand-700); background: var(--brand-100); }
.quick-actions > a > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.quick-actions small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.mini-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.mini-stat { display: flex; min-width: 0; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.mini-stat span { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.mini-stat strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.archive-banner { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #d5dcde; border-radius: var(--radius); color: #4f6065; background: linear-gradient(135deg, #f7f9f9, #eef2f3); box-shadow: var(--shadow-sm); }
.archive-banner__icon { display: inline-grid; width: 36px; height: 36px; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #5c696d; background: #fff; font-size: 18px; font-weight: 850; }
.archive-banner > div { min-width: 0; flex: 1; }
.archive-banner strong { color: var(--ink); }
.archive-banner p { margin: 3px 0 0; color: #68777b; }
.archive-banner dl { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 10px 0 0; }
.archive-banner dl > div { display: flex; align-items: baseline; gap: 7px; }
.archive-banner dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.archive-banner dd { margin: 0; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.archive-banner--compact { margin-bottom: 14px; padding: 12px 14px; }
.archive-banner--compact .archive-banner__icon { width: 30px; height: 30px; font-size: 14px; }
.archived-records-panel { border-color: #d9e0e1; }
.filing-checklist .panel__header p { max-width: 760px; }
.checklist-count { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.checklist-table .table-actions { min-width: 245px; flex-wrap: wrap; }
.checklist-row--complete, .checklist-row--verified { background: #fbfdfc; }

/* Timeline */
.timeline { padding: 5px 22px 20px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; }
.timeline-item::before { position: absolute; top: 18px; bottom: -6px; left: 6px; width: 1px; background: var(--line); content: ""; }
.timeline-item:last-child::before { display: none; }
.timeline-item__dot { position: relative; z-index: 1; width: 13px; height: 13px; margin-top: 19px; border: 3px solid var(--brand-100); border-radius: 50%; background: var(--brand-600); }
.timeline-item__content { min-width: 0; padding: 13px 0 15px; border-bottom: 1px solid #e8eeee; }
.timeline-item:last-child .timeline-item__content { border-bottom: 0; }
.timeline-item__content header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline-item__content header time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.timeline-item__content p { margin: 6px 0; color: var(--ink-soft); }
.timeline-item__content footer { display: flex; gap: 12px; margin-top: 6px; font-size: 10px; font-weight: 750; }
.follow-up-chip { display: inline-flex; padding: 3px 7px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 9px; font-weight: 750; }
.follow-up-chip--complete { color: var(--green); background: var(--green-soft); }
.follow-up-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 7px; }
.follow-up-row .link-button { font-size: 9px; font-weight: 800; }
.note-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note-attachments a { max-width: 100%; overflow: hidden; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfc; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

/* Customer document center */
.document-filter-bar .search-field { min-width: 230px; }
.document-table .document-primary-cell { min-width: 250px; }
.document-table .document-primary-cell strong, .document-table .document-primary-cell small { max-width: 310px; }
.document-file-icon, .document-summary-row__icon, .document-context-card__icon { color: var(--blue); background: var(--blue-soft); }
.document-summary-list { display: grid; }
.document-summary-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); }
.document-summary-row:first-child { border-top: 0; }
.document-summary-row:hover { background: var(--surface-soft); }
.document-summary-row__main { display: flex; min-width: 0; flex: 1; align-items: center; gap: 11px; color: var(--ink); }
.document-summary-row__main:hover { color: var(--brand-700); }
.document-summary-row__icon { display: inline-grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border-radius: 10px; font-weight: 800; }
.document-summary-row__copy { display: flex; min-width: 0; flex-direction: column; }
.document-summary-row__copy strong, .document-summary-row__copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-summary-row__copy small { color: var(--muted); font-size: 10px; }
.document-summary-row__meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.document-summary-row__meta time { color: var(--muted); font-size: 10px; }
.document-summary-row--expired, .document-row--expired { background: #fff8f7; }
.document-summary-row--expired:hover { background: var(--red-soft); }
.document-expiry { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; }
.document-expiry--expired { color: var(--red) !important; font-weight: 850 !important; }
.status-badge--expired { color: var(--red); background: var(--red-soft); }
.document-compact-empty { min-height: 170px; }
.file-picker { position: relative; min-height: 190px; overflow: hidden; border: 1.5px dashed #9cbfc4; border-radius: 12px; background: #f8fbfb; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.file-picker:hover, .file-picker:focus-within, .file-picker.is-dragging { border-color: var(--brand-600); background: var(--brand-100); box-shadow: 0 0 0 3px rgba(22,128,145,.1); }
.file-picker__input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; cursor: pointer; }
.file-picker__surface { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; padding: 24px; color: var(--ink-soft); text-align: center; pointer-events: none; }
.file-picker__surface > span:last-child { color: var(--muted); font-size: 11px; }
.file-picker__mark { display: inline-grid; width: 44px; height: 44px; place-items: center; margin-bottom: 3px; border-radius: 13px; color: var(--brand-700); background: #fff; box-shadow: var(--shadow-sm); font-size: 22px; font-weight: 800; }
.file-picker__details { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.file-picker__details p { margin: 0; }
.file-picker__summary { display: block; width: 100%; max-height: 220px; overflow: auto; margin-top: 12px; padding: 10px 12px; border-radius: 8px; color: var(--ink-soft); background: var(--surface-soft); font-size: 11px; }
.file-picker__summary-header, .file-picker__selected-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-picker__summary-header { position: sticky; top: -10px; z-index: 1; margin: -10px -12px 6px; padding: 10px 12px 8px; background: var(--surface-soft); }
.file-picker__selected-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.file-picker__selected-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.file-picker__selected-name { min-width: 0; overflow-wrap: anywhere; }
.file-picker__clear, .file-picker__remove { flex: 0 0 auto; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--brand-700); background: #fff; cursor: pointer; font: inherit; font-weight: 750; }
.file-picker__clear:hover, .file-picker__remove:hover { border-color: var(--brand-600); background: var(--brand-100); }
.file-picker__clear:focus-visible, .file-picker__remove:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.document-meta-fields { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.document-meta-fields .form-field--original_name { order: 0; }
.document-meta-fields .form-field--package_type { order: 1; }
.document-meta-fields .form-field--category { order: 2; }
.document-meta-fields .form-field--filing_period { order: 3; }
.document-meta-fields .form-field--expires_on { order: 4; }
.document-meta-fields .form-field--notes { order: 5; }
.document-context-card { display: flex; min-width: 0; align-items: center; gap: 13px; margin-bottom: 18px; }
.document-context-card__icon { display: inline-grid; width: 44px; height: 44px; place-items: center; flex: 0 0 auto; border-radius: 12px; font-size: 18px; font-weight: 800; }
.document-context-card__copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.document-context-card__copy strong, .document-context-card__copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-context-card__copy span { color: var(--muted); font-size: 10px; }
.document-context-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.document-delete-object { display: flex; align-items: center; gap: 11px; text-align: left; }
.document-delete-object > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.document-delete-object strong { overflow-wrap: anywhere; }
.document-delete-object small { color: var(--muted); }
.package-badge { display: inline-flex; min-height: 24px; align-items: center; padding: 3px 9px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.package-badge--company { color: var(--green); background: var(--green-soft); }
.package-badge--supporting { color: var(--purple); background: var(--purple-soft); }
.package-badge--other { color: var(--ink-soft); background: #edf1f2; }
.package-policy-banner { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #c5dfe0; border-radius: 10px; color: var(--brand-900); background: #f1f9f9; }
.package-policy-banner > span { display: inline-grid; width: 24px; height: 24px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #fff; font-weight: 850; }
.package-policy-banner p { margin: 2px 0; color: var(--ink-soft); font-size: 11px; }
.package-policy-banner small { display: block; color: var(--muted); }
.package-policy-banner--form { margin: 20px 0 0; }
.document-actions { position: relative; align-items: flex-start; flex-wrap: wrap; }
.bulk-review-toolbar { display: grid; gap: 5px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fbfdfd; }
.bulk-review-toolbar__controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bulk-review-select-all, .bulk-review-checkbox { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 750; cursor: pointer; }
.bulk-review-select-all input, .bulk-review-checkbox input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand-600); cursor: pointer; }
.bulk-review-count { min-width: 78px; color: var(--muted); font-size: 10px; font-weight: 750; }
.bulk-review-toolbar__hint { color: var(--muted); }
.bulk-review-error { margin: 3px 0 0; color: var(--red); font-size: 11px; font-weight: 750; }
.bulk-review-table-cell { width: 42px; text-align: center; }
.bulk-review-checkbox--card { align-self: center; padding: 6px; border-radius: 7px; }
.bulk-review-checkbox--card:hover { background: var(--brand-100); }
.document-review-control { min-width: 34px; }
.document-review-control > summary { list-style: none; }
.document-review-control > summary::-webkit-details-marker { display: none; }
.document-review-control > summary:focus-visible { outline: 3px solid rgba(22,128,145,.2); outline-offset: 2px; }
.document-review-control[open] { width: min(330px, 72vw); }
.document-review-control[open] > summary { margin-left: auto; color: var(--brand-800); border-color: #9fc3c8; background: var(--brand-100); }
.icon-button--review { color: var(--green); background: var(--green-soft); }
.document-review-panel { width: 100%; margin-top: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-md); text-align: left; }
.document-review-panel form { display: grid; gap: 7px; }
.document-review-panel form > strong { color: var(--ink); }
.document-review-panel p { margin: 0 0 3px; color: var(--muted); font-size: 10px; }
.document-review-panel small { color: var(--muted); font-size: 9px; }
.document-review-panel label { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.document-review-panel select { min-height: 38px; }
.document-review-panel textarea { min-height: 82px; }
.review-note-preview { max-width: 210px; white-space: normal; }
.readiness-summary { display: flex; align-items: flex-start; gap: 10px; }
.readiness-summary > span { display: inline-grid; width: 28px; height: 28px; place-items: center; flex: 0 0 auto; border-radius: 9px; font-weight: 850; }
.readiness-summary p { margin: 6px 0 0; }
.readiness-summary--ready > span { color: var(--green); background: var(--green-soft); }
.readiness-summary--blocked > span { color: var(--red); background: var(--red-soft); }
.readiness-reasons { margin: 8px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 11px; }
.notification-readiness .panel__header { align-items: flex-start; }
.readiness-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.readiness-check { display: flex; min-width: 0; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid #efc4c1; border-radius: 9px; background: var(--red-soft); }
.readiness-check > span { display: inline-grid; width: 22px; height: 22px; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--red); background: #fff; font-weight: 850; }
.readiness-check > div { display: flex; min-width: 0; flex-direction: column; }
.readiness-check strong { color: var(--ink); font-size: 11px; }
.readiness-check small { color: var(--muted); }
.readiness-check.is-passed { border-color: #b7dfcb; background: var(--green-soft); }
.readiness-check.is-passed > span { color: var(--green); }
.notification-blockers { margin-top: 12px; padding: 11px 13px; border-radius: 9px; color: #8d302c; background: var(--red-soft); }
.notification-blockers ul { margin: 5px 0 0; padding-left: 18px; }
.filing-package-isolation-note { display: block; margin-top: 7px; color: var(--amber); font-weight: 750; }
.filing-package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.filing-package-group { min-width: 0; padding: 18px; background: var(--surface); }
.filing-package-group > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.filing-package-group > header h3 { margin: 7px 0 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.filing-package-upload { margin-bottom: 12px; }
.package-expiry-warning { display: flex; align-items: center; gap: 5px; margin: 7px 0 0; color: var(--red); font-size: 10px; font-weight: 800; }
.package-expiry-warning > span { display: inline-grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: var(--red-soft); }
.package-expiry-warning--inline { display: inline; margin: 0; }
.filing-package-group .document-summary-row { padding-inline: 0; }
.filing-package-group .document-summary-row__meta { align-items: flex-end; flex-direction: column; }
.filing-package-group .document-summary-row__meta small { max-width: 150px; color: var(--muted); font-size: 9px; text-align: right; }
.simple-checklist__list { border-top: 1px solid var(--line); }
.simple-checklist__row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.simple-checklist__row:last-child { border-bottom: 0; }
.simple-checklist__row.is-checked { background: var(--green-soft); }
.simple-checklist__copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.simple-checklist__copy strong { overflow-wrap: anywhere; }
.simple-checklist__row.is-checked .simple-checklist__copy strong { color: var(--green); }
.simple-checklist__actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex: 0 0 auto; }
.simple-checklist__toggle { display: inline-grid; width: 36px; height: 36px; place-items: center; cursor: pointer; }
.simple-checklist__toggle input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); cursor: pointer; }
.simple-checklist__toggle input:disabled { cursor: not-allowed; }
.package-empty-note { margin: 0; padding: 20px 12px; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--muted); text-align: center; }

/* Confirmations */
.confirmation-layout { display: grid; min-height: calc(100vh - var(--topbar-height) - 80px); place-items: start center; padding-top: clamp(20px, 7vh, 70px); }
.confirmation-card { width: min(100%, 620px); padding: clamp(24px, 5vw, 38px); text-align: center; }
.confirmation-card__icon { display: inline-grid; width: 52px; height: 52px; place-items: center; margin-bottom: 15px; border-radius: 16px; color: var(--brand-800); background: var(--brand-100); font-size: 24px; font-weight: 800; }
.confirmation-card__icon--danger { color: var(--red); background: var(--red-soft); }
.confirmation-card > p:not(.eyebrow) { max-width: 500px; margin: 0 auto 20px; color: var(--ink-soft); }
.confirm-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 22px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--line); text-align: left; }
.confirm-summary > div { min-width: 0; padding: 11px 13px; background: #fff; }
.confirm-summary dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.confirm-summary dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.warning-callout { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid #ebd298; border-radius: 9px; color: #78530e; background: var(--amber-soft); text-align: left; }
.warning-callout > span { display: inline-grid; width: 21px; height: 21px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.7); font-weight: 850; }
.warning-callout p { margin: 0; }
.warning-callout--danger { color: #913832; border-color: #ecc2bf; background: var(--red-soft); }
.confirmation-card__actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.confirmation-card--form { text-align: left; }
.confirmation-card--form > .eyebrow, .confirmation-card--form > h1, .confirmation-card--form > p { text-align: center; }
.user-summary { display: flex; align-items: center; gap: 10px; margin: 18px 0; padding: 12px; border-radius: 10px; background: var(--surface-soft); }
.user-summary > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.user-summary small { color: var(--muted); }
.reset-form .form-grid { grid-template-columns: 1fr; }
.delete-object { margin: 8px 0 18px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); overflow-wrap: anywhere; }

/* Email */
.email-preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: start; gap: 18px; }
.email-preview { padding: 0; overflow: hidden; }
.email-preview__headers { margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.email-preview__headers > div { display: grid; grid-template-columns: 75px 1fr; gap: 12px; padding: 6px 0; }
.email-preview__headers dt { color: var(--muted); font-size: 10px; font-weight: 750; }
.email-preview__headers dd { margin: 0; overflow-wrap: anywhere; }
.email-preview__body { min-height: 300px; padding: 28px 30px; color: #263e45; font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.email-preview__body p { margin-bottom: 1em; }
.attachment-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 13px 22px; border-top: 1px solid var(--line); background: #fbfcfc; }
.attachment-list h2 { width: 100%; margin: 0 0 4px; font-size: 11px; }
.attachment-list span { padding: 5px 8px; border-radius: 7px; background: var(--surface-soft); font-size: 10px; }
.preview-dialog { width: min(calc(100% - 28px), 760px); max-height: calc(100vh - 36px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(5,30,36,.25); }
.preview-dialog::backdrop { background: rgba(5,30,36,.55); backdrop-filter: blur(3px); }
.preview-dialog__header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.preview-dialog__header h2, .preview-dialog__header p { margin-bottom: 0; }
.preview-dialog__actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }

/* Login */
.login-body { min-height: 100vh; background: #fff; }
.login-page { display: grid; min-height: 100vh; grid-template-columns: minmax(380px, .92fr) minmax(480px, 1.08fr); }
.login-visual { position: relative; overflow: hidden; color: #e6f1f2; background: radial-gradient(circle at 18% 22%, rgba(40,164,171,.23), transparent 34%), linear-gradient(145deg, #092e37 0%, #124955 62%, #17606d 100%); }
.login-visual::after { position: absolute; right: -12vw; bottom: -22vw; width: 46vw; height: 46vw; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 5vw rgba(255,255,255,.018), 0 0 0 10vw rgba(255,255,255,.018); content: ""; }
.login-visual__inner { position: relative; z-index: 1; display: flex; min-height: 100%; flex-direction: column; padding: clamp(28px, 5vw, 64px); }
.brand--light { color: #fff; }
.login-visual__copy { max-width: 570px; margin: auto 0; padding: 80px 0; }
.login-visual__copy .eyebrow { color: #75d0d0; }
.login-visual__copy h1 { color: #fff; font-size: clamp(36px, 5vw, 58px); line-height: 1.08; }
.login-visual__copy p { color: #a9c7cc; }
.login-visual__pattern { display: flex; align-items: flex-end; gap: 7px; height: 36px; }
.login-visual__pattern span { width: 28px; border-radius: 5px 5px 2px 2px; background: #44aeb4; opacity: .7; }
.login-visual__pattern span:nth-child(1) { height: 14px; }
.login-visual__pattern span:nth-child(2) { height: 24px; }
.login-visual__pattern span:nth-child(3) { height: 34px; }
.login-panel { position: relative; display: grid; place-items: center; padding: 70px clamp(28px, 7vw, 110px); background: #fff; }
.login-panel__top { position: absolute; top: 28px; right: 32px; }
.login-card { width: min(100%, 410px); }
.login-card h2 { margin-bottom: 7px; font-size: 30px; letter-spacing: -.035em; }
.login-card__intro { margin-bottom: 27px; color: var(--ink-soft); }
.login-card__mobile-brand { display: none; }
.login-form { display: grid; gap: 18px; }
.login-form .button { margin-top: 2px; }
.password-field { position: relative; }
.password-field input { padding-right: 45px !important; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: inline-grid; width: 32px; height: 32px; place-items: center; border: 0; color: var(--muted); background: transparent; cursor: pointer; transform: translateY(-50%); }
.login-card__notice { margin: 22px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.login-card__notice span { margin-right: 5px; color: var(--green); font-size: 7px; }

/* Responsive */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .mini-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  :root { --sidebar-width: 244px; }
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-md); }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .sidebar__close, .topbar__menu { display: inline-grid; }
  .sidebar__close { color: #c7dadd; border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.04); }
  .nav-backdrop { position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(5,26,31,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .app-shell.nav-open .nav-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .app-main { padding-left: 0; }
  .topbar { padding: 0 20px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid__side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { flex-wrap: wrap; }
  .search-field { max-width: none; flex: 1 0 100%; }
  .document-filter-bar select { flex: 1; }
  .readiness-checklist { grid-template-columns: 1fr; }
  .filing-package-grid { grid-template-columns: 1fr; }
  .simple-checklist__row { align-items: flex-start; flex-direction: column; }
  .simple-checklist__actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-actions { order: -1; }
  .sticky-actions { position: static; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
  .sticky-actions > p { flex: 1 1 180px; }
  .sticky-actions .button { width: auto; }
  .email-preview-layout { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.2fr); }
}

@media (max-width: 760px) {
  .page { padding: 24px 16px 42px; }
  .topbar { padding: 0 15px; }
  .topbar__avatar { display: none; }
  .page-header, .entity-header { align-items: flex-start; flex-direction: column; }
  .page-header__actions { width: 100%; justify-content: flex-start; }
  .panel__header-actions { width: 100%; justify-content: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 102px; padding: 15px; }
  .stat-card__icon { width: 36px; height: 36px; }
  .stat-card__copy strong { font-size: 23px; }
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .search-field { max-width: none; flex: 1 0 100%; }
  .filter-bar select { flex: 1; }
  .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr { display: block; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .data-table tbody { display: grid; gap: 10px; padding: 12px; }
  .data-table tbody tr { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
  .data-table td { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 38px; padding: 8px 0; border-bottom: 1px solid #edf1f1; text-align: right; }
  .data-table td::before { color: var(--muted); content: attr(data-label); font-size: 9px; font-weight: 850; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
  .data-table td:first-child { align-items: center; }
  .data-table td:first-child::before, .data-table .table-actions::before { display: none; }
  .data-table .primary-cell { width: 100%; min-width: 0; text-align: left; }
  .data-table .table-actions { justify-content: flex-end; border-bottom: 0; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination__controls { justify-content: space-between; }
  .form-grid, .detail-list--two-col { grid-template-columns: 1fr; }
  .detail-list--two-col > div:nth-child(2) { border-top: 1px solid #e8eeee; }
  .detail-grid__side { grid-template-columns: 1fr; }
  .document-context-card { align-items: flex-start; flex-wrap: wrap; }
  .document-context-card__actions { width: 100%; justify-content: flex-start; padding-left: 57px; }
  .document-review-control[open] { width: min(100%, 420px); }
  .entity-header__identity { align-items: flex-start; }
  .entity-avatar { width: 48px; height: 48px; border-radius: 14px; }
  .mini-stat-grid { grid-template-columns: 1fr 1fr; }
  .operations-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 72px 22px 40px; }
  .login-card__mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 42px; }
  .login-card__mobile-brand .brand__mark { width: 34px; height: 34px; }
}

@media (max-width: 520px) {
  h1 { font-size: 26px; }
  .topbar__name { display: none; }
  .page-header__actions .button { flex: 1; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 88px; }
  .record-row, .deadline-row { padding-inline: 14px; }
  .record-row .status-badge, .record-row time { display: none; }
  .filter-bar .button { flex: 1; }
  .form-panel { padding: 18px; }
  .panel__header--padded { padding-inline: 16px; }
  .panel__header--padded:has(.panel__header-actions) { align-items: flex-start; flex-direction: column; }
  .document-summary-row { align-items: flex-start; }
  .document-summary-row__meta time { display: none; }
  .document-summary-row__meta .status-badge { display: none; }
  .filing-package-group .document-summary-row__meta .status-badge { display: inline-flex; }
  .file-picker { min-height: 165px; }
  .file-picker__details { align-items: flex-start; flex-direction: column; }
  .document-context-card__actions { padding-left: 0; }
  .document-actions { width: 100%; }
  .bulk-review-toolbar { padding-inline: 14px; }
  .bulk-review-toolbar__controls { align-items: stretch; flex-direction: column; }
  .bulk-review-toolbar__controls .button { width: 100%; }
  .bulk-review-count { min-width: 0; }
  .document-review-control[open] { width: 100%; }
  .mini-stat-grid { grid-template-columns: 1fr; }
  .archive-banner { padding: 14px; }
  .archive-banner dl { display: grid; gap: 5px; }
  .entity-header__identity { width: 100%; }
  .entity-header h1 { font-size: 23px; }
  .confirmation-card { padding: 23px 18px; }
  .confirm-summary { grid-template-columns: 1fr; }
  .confirmation-card__actions { align-items: stretch; flex-direction: column-reverse; }
  .confirmation-card__actions .button { width: 100%; }
  .sticky-actions { align-items: stretch; flex-direction: column; }
  .sticky-actions > p { flex-basis: auto; }
  .sticky-actions .button { width: 100%; }
  .email-preview__headers > div { grid-template-columns: 58px 1fr; }
  .email-preview__body { padding: 22px 18px; }
  .preview-dialog__actions { align-items: stretch; flex-direction: column-reverse; }
  .preview-dialog__actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .sidebar, .topbar, .page-header__actions, .editor-actions, .nav-backdrop { display: none !important; }
  .app-main { padding-left: 0; }
  .page { width: 100%; padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
}
