:root {
  color-scheme: light;
  --navy-950: #071d2e;
  --navy-900: #0d2940;
  --navy-800: #143a55;
  --teal-700: #08758f;
  --teal-600: #0b8ca8;
  --teal-100: #e5f7fa;
  --ink: #152238;
  --slate-700: #4f647b;
  --slate-500: #8194aa;
  --slate-300: #c9d5e2;
  --slate-200: #dfe7ef;
  --slate-100: #f1f5f8;
  --background: #f6f8fb;
  --surface: #fff;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --warning: #946200;
  --warning-bg: #fff6db;
  --success: #087a5b;
  --success-bg: #e5f6ef;
  --shadow: 0 18px 55px rgba(12, 38, 59, .11);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--background); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { letter-spacing: -.03em; }
.muted { color: var(--slate-700); }
.eyebrow { margin: 0 0 7px; color: var(--teal-700); font-size: .68rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow-light { color: #8dd6df; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

input, select { width: 100%; padding: 11px 12px; border: 1px solid var(--slate-300); border-radius: 9px; outline: none; color: var(--ink); background: #fff; transition: border-color .16s, box-shadow .16s; }
input:focus, select:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(11, 140, 168, .14); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(11, 140, 168, .3); outline-offset: 2px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border: 0; border-radius: 9px; font-weight: 780; transition: transform .14s, background .14s, opacity .14s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .43; }
.button-primary { color: #fff; background: var(--teal-700); box-shadow: 0 8px 20px rgba(8, 117, 143, .2); }
.button-primary:hover:not(:disabled) { background: #075f75; }
.button-secondary { color: #fff; background: var(--navy-900); }
.button-quiet { color: var(--navy-800); background: var(--slate-100); }
.button-wide { width: 100%; margin-top: 6px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--slate-200); border-radius: 10px; color: var(--navy-800); background: #fff; font-size: 1.15rem; }
.icon-button:hover { color: var(--teal-700); border-color: #aadbe3; background: #f4fcfd; }
.form-error { min-height: 1.1em; margin: 2px 0 0; color: var(--danger); font-size: .8rem; }
.toast { position: fixed; z-index: 100; top: 18px; left: 50%; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 10px; transform: translate(-50%, -140%); color: #fff; background: var(--navy-900); box-shadow: var(--shadow); font-weight: 750; transition: transform .22s; }
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* Login */
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .9fr) minmax(520px, 1.1fr); }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vw, 110px); background: var(--surface); }
.brand-lockup { display: flex; align-items: center; gap: 18px; margin-bottom: 58px; }
.brand-lockup h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.035em; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: #fff; background: linear-gradient(145deg, var(--navy-900), var(--teal-600)); box-shadow: 0 10px 26px rgba(8, 117, 143, .22); font-weight: 850; letter-spacing: -.04em; }
.brand-mark-small { width: 40px; height: 40px; border-radius: 12px; font-size: .82rem; }
.login-intro { max-width: 520px; margin-bottom: 34px; color: var(--slate-700); font-size: 1.08rem; line-height: 1.65; }
.login-form { max-width: 430px; display: grid; gap: 12px; }
.login-form label, .send-confirmation label, .preview-toolbar label, .contact-dialog-body label { font-size: .82rem; font-weight: 780; }
.login-form input { font-size: 1.2rem; letter-spacing: .18em; }
.security-note { margin-top: 28px; color: var(--slate-500); font-size: .8rem; }
.security-note span { margin-right: 7px; color: var(--success); }
.login-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(50px, 8vw, 120px); color: #fff; background: radial-gradient(circle at 80% 10%, rgba(44, 175, 192, .3), transparent 30%), linear-gradient(145deg, #0b1f33, #123d52 60%, #176b87); }
.login-aside::after { content: ""; position: absolute; right: -180px; bottom: -240px; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.login-aside h2 { max-width: 650px; margin-bottom: 56px; font-size: clamp(2.2rem, 4.5vw, 4.7rem); line-height: 1.02; }
.process-list { position: relative; z-index: 1; display: grid; gap: 25px; padding: 0; margin: 0; list-style: none; }
.process-list li { display: flex; align-items: flex-start; gap: 18px; }
.process-list li > span { padding-top: 4px; color: #8dd6df; font-size: .76rem; font-weight: 800; }
.process-list strong, .process-list small { display: block; }
.process-list strong { margin-bottom: 4px; font-size: 1.03rem; }
.process-list small { color: #c9dce8; line-height: 1.5; }

/* App chrome */
.app-view { min-height: 100vh; }
.app-header { position: sticky; z-index: 40; top: 0; height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--slate-200); background: rgba(255,255,255,.95); backdrop-filter: blur(14px); }
.app-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.app-brand strong, .app-brand small { display: block; }
.app-brand strong { font-size: .95rem; }
.app-brand small { margin-top: 2px; color: var(--slate-500); font-size: .76rem; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.sender-badge { max-width: 440px; overflow: hidden; padding: 7px 11px; border: 1px solid #b8e4e8; border-radius: 999px; color: var(--teal-700); background: #edfafa; font-size: .73rem; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }
.app-layout { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 288px minmax(0, 1fr); }
.sidebar { padding: 24px 16px; border-right: 1px solid var(--slate-200); background: #f9fbfd; }
.sidebar-heading { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 8px 14px; }
.sidebar-heading h2 { margin: 0; font-size: .98rem; }
.import-list { display: grid; gap: 8px; }
.import-entry { position: relative; min-width: 0; }
.import-item { width: 100%; min-width: 0; padding: 13px 52px 13px 13px; border: 1px solid transparent; border-radius: 11px; text-align: left; background: transparent; }
.import-item:hover { border-color: var(--slate-200); background: #fff; }
.import-item.active { border-color: #9dd5df; background: #fff; box-shadow: 0 7px 22px rgba(16,42,67,.07); }
.import-item strong, .import-item small { display: block; }
.import-item strong { overflow: hidden; margin-bottom: 4px; text-overflow: ellipsis; white-space: nowrap; }
.import-item small { color: var(--slate-500); }
.import-item .import-amount { display: block; margin-top: 7px; color: var(--navy-900); font-size: .88rem; font-weight: 820; }
.delete-import-button { position: absolute; top: 9px; right: 9px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 8px; color: var(--slate-500); background: transparent; font-size: 1rem; }
.delete-import-button:hover:not(:disabled) { color: var(--danger); border-color: #f2c7c3; background: var(--danger-bg); }
.delete-import-button:disabled { cursor: wait; opacity: .65; }
.delete-import-button:disabled i { animation: spin .8s linear infinite; }
.empty-list { padding: 18px 10px; color: var(--slate-500); font-size: .84rem; line-height: 1.5; }
.workspace { min-width: 0; }
.workspace-section { max-width: 1620px; margin: 0 auto; padding: 30px 26px 132px; }

/* Upload */
.welcome-copy { max-width: 760px; }
.welcome-copy p:not(.eyebrow) { max-width: 680px; color: var(--slate-700); font-size: 1.05rem; line-height: 1.65; }
.upload-card { max-width: 830px; display: grid; gap: 15px; margin-top: 38px; padding: 20px; border: 1px solid var(--slate-200); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(16,42,67,.05); }
.drop-zone { min-height: 225px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 30px; border: 1.5px dashed #9fb8c8; border-radius: 13px; background: #f8fbfd; text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
.drop-zone.dragover { border-color: var(--teal-600); background: var(--teal-100); }
.drop-zone small { color: var(--slate-500); }
.upload-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 14px; color: var(--teal-700); background: var(--teal-100); font-size: 1.5rem; }
.file-name { min-height: 1em; margin-top: 7px; color: var(--teal-700); font-size: .85rem; font-weight: 750; }
.guardrail-grid { max-width: 980px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 48px; }
.guardrail-grid article { padding: 22px; border-top: 3px solid #8dd6df; background: #fff; }
.guardrail-grid article > span { color: var(--teal-600); font-size: .72rem; font-weight: 850; }
.guardrail-grid h3 { margin: 20px 0 8px; font-size: 1rem; }
.guardrail-grid p { margin: 0; color: var(--slate-700); font-size: .86rem; line-height: 1.5; }

/* Review cockpit */
.review-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.review-header h1 { margin-bottom: 7px; font-size: clamp(2rem, 3.2vw, 2.85rem); }
.review-header .muted { margin: 0; font-size: .86rem; }
.back-button { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; padding: 0; border: 0; color: var(--teal-700); background: transparent; font-size: .84rem; font-weight: 780; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; box-shadow: 0 4px 15px rgba(16,42,67,.035); }
.metric-card small, .metric-card strong, .metric-card span { display: block; }
.metric-card small { color: var(--slate-500); font-size: .65rem; font-weight: 820; letter-spacing: .075em; text-transform: uppercase; }
.metric-card strong { overflow: hidden; margin-top: 5px; color: var(--navy-900); font-size: clamp(1rem, 1.5vw, 1.25rem); text-overflow: ellipsis; white-space: nowrap; }
.metric-card span { margin-top: 3px; color: var(--slate-500); font-size: .69rem; }
.metric-card > i { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 1.15rem; }
.metric-total > i { color: #2865a9; background: #e7f0fb; }
.metric-below > i { color: var(--success); background: var(--success-bg); }
.metric-mid > i { color: var(--warning); background: var(--warning-bg); }
.metric-overdue > i { color: var(--danger); background: var(--danger-bg); }
.warning-panel { margin-top: 13px; padding: 13px 16px; border: 1px solid #f0cf78; border-radius: 10px; color: #6e4f00; background: var(--warning-bg); font-size: .8rem; }
.warning-panel ul { margin: 7px 0 0; padding-left: 20px; }

.table-card { margin-top: 16px; overflow: hidden; border: 1px solid var(--slate-200); border-radius: 13px; background: #fff; box-shadow: 0 6px 20px rgba(16,42,67,.04); }
.customer-toolbar { min-height: 82px; display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 280px) 175px auto; align-items: center; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--slate-200); }
.customer-heading h2 { margin: 0; font-size: 1.1rem; }
.customer-search, .salesperson-filter { position: relative; display: block; }
.customer-search i, .salesperson-filter i { position: absolute; top: 50%; left: 12px; z-index: 1; transform: translateY(-50%); color: var(--slate-500); font-size: 1rem; pointer-events: none; }
.customer-search input, .salesperson-filter select { height: 38px; padding: 8px 12px 8px 36px; border-color: var(--slate-200); background: var(--slate-100); }
.salesperson-filter select { font-size: .75rem; font-weight: 720; }
.status-tabs { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--slate-200); border-radius: 9px; background: var(--slate-100); }
.status-tab { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 0; border-radius: 6px; color: var(--slate-700); background: transparent; font-size: .72rem; font-weight: 760; white-space: nowrap; }
.status-tab span { min-width: 18px; padding: 2px 5px; border-radius: 999px; color: var(--slate-700); background: rgba(255,255,255,.75); font-size: .64rem; }
.status-tab.active { color: var(--navy-900); background: #fff; box-shadow: 0 2px 6px rgba(16,42,67,.09); }
.status-tab.active span { color: var(--teal-700); background: var(--teal-100); }
.table-scroll { max-height: calc(100vh - 425px); min-height: 310px; overflow: auto; }
.customer-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: .78rem; }
.customer-table th { position: sticky; z-index: 2; top: 0; padding: 10px; color: var(--slate-500); background: #f7f9fb; box-shadow: 0 1px 0 var(--slate-200); text-align: left; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
.customer-table td { padding: 10px; border-top: 1px solid #edf1f5; vertical-align: middle; }
.customer-table tbody tr { position: relative; transition: background .12s, box-shadow .12s; }
.customer-table tbody tr:hover { background: #f9fcfd; }
.customer-table tbody tr.selected { background: #effbfc; box-shadow: inset 3px 0 0 var(--teal-600); }
.customer-table .salesperson-group { background: #eef4f8; box-shadow: none; }
.customer-table .salesperson-group:hover { background: #eef4f8; }
.customer-table .salesperson-group td { position: sticky; z-index: 1; top: 35px; padding: 7px 11px; border-top-color: var(--slate-200); color: var(--navy-800); }
.salesperson-group td { display: table-cell; }
.salesperson-group span { display: inline-flex; align-items: center; }
.salesperson-group span { gap: 6px; font-size: .7rem; font-weight: 850; letter-spacing: .06em; }
.salesperson-group em { margin-left: 4px; color: var(--slate-500); font-size: .63rem; font-style: normal; font-weight: 680; letter-spacing: 0; text-transform: none; }
.salesperson-group small { float: right; color: var(--slate-500); font-size: .66rem; font-weight: 680; text-transform: none; }
.customer-table tr.email-missing .customer-check { opacity: .4; }
.customer-table .check-cell { width: 40px; text-align: center; }
.customer-table input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--teal-700); }
.customer-name { min-width: 190px; }
.customer-name strong, .customer-name small { display: block; }
.customer-name strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-name small { margin-top: 3px; color: var(--slate-500); font-size: .67rem; }
.email-column { width: 220px; }
.email-action { max-width: 220px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.email-action > span { display: inline-flex; align-items: center; gap: 5px; font-weight: 780; }
.email-action small { width: 100%; overflow: hidden; color: var(--slate-500); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.email-action-saved > span { color: var(--success); font-size: .7rem; }
.email-action-saved:hover small { color: var(--teal-700); text-decoration: underline; }
.email-action-missing { min-height: 32px; flex-direction: row; align-items: center; padding: 6px 9px; border: 1px solid #efd48e; border-radius: 7px; color: var(--warning); background: var(--warning-bg); font-size: .7rem; font-weight: 790; }
.amount-cell { min-width: 105px; text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pending-cell { color: var(--navy-900); font-weight: 720; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: .65rem; font-weight: 820; white-space: nowrap; }
.status-ready { color: var(--success); background: var(--success-bg); }
.status-missing { color: var(--warning); background: var(--warning-bg); }
.status-issue { color: var(--danger); background: var(--danger-bg); }
.empty-table { height: 220px; color: var(--slate-500); text-align: center; }

/* Reminder action dock */
.reminder-dock { position: fixed; z-index: 30; right: 8px; bottom: 8px; left: 8px; min-height: 96px; display: grid; grid-template-columns: 270px minmax(460px, 1fr) 180px 210px; align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid #1d445e; border-radius: 13px; color: #fff; background: rgba(7, 29, 46, .98); box-shadow: 0 18px 50px rgba(4, 23, 37, .28); backdrop-filter: blur(14px); }
.dock-selection { min-width: 0; display: flex; align-items: center; gap: 11px; }
.dock-selection-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #48647a; border-radius: 50%; color: #8aa0b2; background: #17384f; }
.reminder-dock.ready .dock-selection-icon { color: var(--navy-950); border-color: #82d4df; background: #82d4df; }
.dock-selection strong, .dock-selection small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-selection strong { font-size: .88rem; }
.dock-selection small { margin-top: 4px; color: #9fb5c4; font-size: .7rem; }
.dock-label { display: block; margin-bottom: 7px; color: #95adbe; font-size: .62rem; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.dock-scope { min-width: 0; }
.filter-chips { display: flex; gap: 6px; }
.filter-chip { min-height: 42px; display: flex; flex: 1 1 0; flex-direction: column; justify-content: center; padding: 7px 10px; border: 1px solid #49657a; border-radius: 8px; color: #dce8ef; background: #12364e; font-size: .7rem; font-weight: 750; text-align: left; white-space: nowrap; }
.filter-chip small { margin-top: 2px; color: #93aaba; font-size: .59rem; font-weight: 650; }
.filter-chip:hover { border-color: #7fc5cf; background: #17445e; }
.filter-chip.active { border-color: #8ad8e2; color: #072633; background: #8ad8e2; box-shadow: 0 0 0 2px rgba(138,216,226,.15); }
.filter-chip.active small { color: #185061; }
.dock-total { padding-left: 15px; border-left: 1px solid #315066; }
.dock-total strong { display: block; overflow: hidden; font-size: 1.13rem; text-overflow: ellipsis; white-space: nowrap; }
.review-email-button { width: 100%; min-height: 48px; background: var(--teal-600); }

/* Contact editor and preview */
.contact-dialog { width: min(430px, 100vw); max-width: none; height: 100dvh; max-height: none; padding: 0; margin: 0 0 0 auto; border: 0; border-radius: 18px 0 0 18px; background: #fff; box-shadow: -24px 0 70px rgba(4,25,45,.25); }
.contact-dialog::backdrop, .preview-dialog::backdrop { background: rgba(5, 23, 38, .6); backdrop-filter: blur(3px); }
.contact-dialog-shell { height: 100%; display: flex; flex-direction: column; }
.contact-dialog-header, .contact-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; }
.contact-dialog-header { border-bottom: 1px solid var(--slate-200); }
.contact-dialog-header h2 { margin: 0; font-size: 1.25rem; }
.contact-dialog-body { flex: 1; padding: 24px 20px; }
.contact-dialog-body .muted { margin-bottom: 24px; font-size: .82rem; line-height: 1.55; }
.contact-dialog-body label { display: block; margin-bottom: 7px; }
.contact-dialog-body small { display: block; margin-top: 7px; color: var(--slate-500); font-size: .72rem; }
.contact-dialog-footer { border-top: 1px solid var(--slate-200); }

.preview-dialog { width: min(980px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 30px 100px rgba(4, 25, 45, .3); }
.dialog-shell { max-height: calc(100vh - 28px); display: flex; flex-direction: column; }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; }
.dialog-header { border-bottom: 1px solid var(--slate-200); }
.dialog-header h2 { margin: 0; }
.dialog-body { overflow: auto; padding: 20px 22px; background: #f5f7fa; }
.preview-toolbar { display: grid; grid-template-columns: 110px minmax(250px, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.preview-summary { color: var(--slate-700); font-size: .8rem; text-align: right; }
.preview-frame { width: 100%; height: 480px; border: 1px solid var(--slate-200); border-radius: 11px; background: #fff; }
.dialog-footer { gap: 20px; border-top: 1px solid var(--slate-200); }
.send-confirmation { width: min(360px, 100%); }
.send-confirmation label { display: block; margin-bottom: 6px; }
.send-confirmation input { padding: 9px 11px; }
.send-confirmation small { display: block; margin-top: 5px; color: var(--slate-500); font-size: .72rem; }
.dialog-actions { display: flex; gap: 9px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1250px) {
  .app-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .workspace-section { padding-right: 20px; padding-left: 20px; }
  .customer-toolbar { grid-template-columns: 1fr minmax(210px, 300px); }
  .customer-heading { grid-column: 1 / -1; }
  .status-tabs { grid-column: 1 / -1; justify-self: end; }
  .table-scroll { max-height: calc(100vh - 470px); }
  .reminder-dock { grid-template-columns: 220px minmax(390px, 1fr) 150px 185px; gap: 12px; }
}

@media (max-width: 1000px) {
  .login-view { grid-template-columns: 1fr; }
  .login-aside { min-height: 600px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--slate-200); }
  .sidebar-heading { align-items: center; padding-bottom: 10px; }
  .import-list { display: flex; overflow-x: auto; }
  .import-entry, .import-item { min-width: 230px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .table-scroll { max-height: 440px; }
  .reminder-dock { grid-template-columns: minmax(180px, 1fr) 150px 185px; }
  .dock-scope { grid-column: 1 / -1; grid-row: 2; }
  .dock-total { grid-column: 2; grid-row: 1; }
  .review-email-button { grid-column: 3; grid-row: 1; }
  .workspace-section { padding-bottom: 160px; }
}

@media (max-width: 720px) {
  .login-panel, .login-aside { padding: 36px 24px; }
  .app-header { padding: 0 14px; }
  .sender-badge { display: none; }
  .app-brand small { display: none; }
  .workspace-section { padding: 24px 14px 238px; }
  .guardrail-grid { grid-template-columns: 1fr; }
  .review-header { align-items: flex-start; flex-direction: column; }
  .review-header h1 { font-size: 1.85rem; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { align-items: flex-start; padding: 11px 12px; }
  .metric-card strong { font-size: .93rem; }
  .metric-card > i { width: 28px; height: 28px; font-size: .95rem; }
  .customer-toolbar { grid-template-columns: 1fr; gap: 10px; }
  .customer-heading, .customer-search, .salesperson-filter, .status-tabs { grid-column: auto; }
  .status-tabs { overflow-x: auto; }
  .status-tab { flex: 1 0 auto; }
  .table-scroll { max-height: 460px; min-height: 240px; }
  .customer-table { min-width: 0; display: block; padding: 8px; }
  .customer-table thead { display: none; }
  .customer-table tbody { display: grid; gap: 8px; }
  .customer-table tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; padding: 12px; border: 1px solid var(--slate-200); border-radius: 10px; }
  .customer-table .salesperson-group { position: sticky; top: 0; z-index: 2; display: block; padding: 0; border: 0; border-radius: 8px; }
  .customer-table .salesperson-group td { position: static; display: flex; grid-column: 1 / -1; padding: 9px 10px; }
  .customer-table .salesperson-group small { float: none; margin-left: auto; }
  .customer-table td { padding: 0; border: 0; }
  .customer-table .check-cell { width: auto; grid-column: 1; grid-row: 1 / 3; padding-top: 2px; text-align: left; }
  .customer-table .customer-name { min-width: 0; grid-column: 2; grid-row: 1; }
  .customer-name strong { max-width: 100%; }
  .customer-table .pending-cell { min-width: 0; grid-column: 3; grid-row: 1; }
  .customer-table .email-column { width: auto; grid-column: 2 / 4; grid-row: 2; margin-top: 10px; }
  .email-action { max-width: 100%; }
  .customer-table .ageing-column, .customer-table .status-cell { display: none; }
  .reminder-dock { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
  .dock-selection { grid-column: 1; grid-row: 1; }
  .dock-total { grid-column: 2; grid-row: 1; padding-left: 12px; }
  .dock-scope { grid-column: 1 / -1; grid-row: 2; overflow: hidden; }
  .filter-chips { overflow-x: auto; padding-bottom: 2px; }
  .filter-chip { min-width: 120px; flex: 0 0 auto; }
  .review-email-button { grid-column: 1 / -1; grid-row: 3; }
  .contact-dialog { width: 100vw; border-radius: 0; }
  .preview-toolbar { grid-template-columns: 1fr; }
  .preview-summary { text-align: left; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .dialog-actions { justify-content: flex-end; }
}

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