:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.5;
  color: #192e43;
  background: #f3f6fa;
  --blue: #146799;
  --navy: #142d44;
  --line: #dce4ed;
  --muted: #596b7e;
  --orange: #92501b;
  --red: #ac303b;
  --green: #176b4c;
  --focus: #126fa8;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button[aria-busy="true"] { cursor: progress; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  border: 1px solid #ccd7e3;
  background: #fff;
  color: #24435f;
  border-radius: 8px;
  padding: 11px 15px;
  min-height: 42px;
  line-height: 1.35;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
button:hover { background: #edf4f9; border-color: #98b6cc; }
.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.primary:hover { background: #10547d; border-color: #10547d; color: #fff; }
.danger { color: var(--red); border-color: #e2bac0; }
.danger:hover { background: #fff1f2; border-color: #bd6d77; }
.quiet { border-color: transparent; background: transparent; }
.small { padding: 8px 11px; min-height: 36px; font-size: 13px; }
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line); padding: 25px 16px;
  display: flex; flex-direction: column; gap: 25px; position: sticky;
  top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.brand { padding: 0 10px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.brand img { height: 54px; width: 62px; object-fit: contain; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.3px; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.nav { display: grid; gap: 7px; }
.nav button { display: flex; align-items: center; gap: 12px; border: 1px solid transparent; background: transparent; color: #53677c; text-align: left; padding: 13px; font-weight: 500; }
.nav button:hover { background: #f4f7fa; }
.nav button.active { color: #105e8c; background: #e9f3fa; border-color: #d9e9f4; font-weight: 650; }
.nav svg { height: 19px; width: 19px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.6; }
.sidebar-bottom { margin-top: auto; padding: 10px; display: grid; gap: 13px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-bottom a { display: block; }
.brand-dot { height: 7px; width: 7px; display: inline-block; background: var(--green); border-radius: 50%; margin-right: 7px; }
.workspace { min-width: 0; }
.topbar { min-height: 78px; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: #324b63; font-weight: 550; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { height: 38px; width: 38px; flex-shrink: 0; border-radius: 50%; background: #e9f1f7; color: #285e82; display: grid; place-items: center; font-weight: 650; }
.user small { display: block; color: var(--muted); font-size: 12px; }
.main { padding: 30px 32px 48px; max-width: 1740px; margin: auto; }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.heading h1 { font-size: clamp(25px, 2vw, 30px); letter-spacing: -.7px; font-weight: 650; line-height: 1.25; margin: 0 0 9px; }
.heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 740px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.25px; font-size: 12px; font-weight: 650; color: var(--muted); margin: 0 0 9px; }
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.metric { display: block; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 21px; min-height: 154px; text-align: left; color: inherit; font-weight: 400; }
button.metric:hover { background: #fff; border-color: #7faac7; box-shadow: 0 4px 16px #183e5c0b; }
.metric-label { font-size: 13px; color: #52677c; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 39px; line-height: 1.5; }
.metric-value { display: block; font-size: clamp(25px, 2.3vw, 32px); font-weight: 650; letter-spacing: -.8px; margin: 10px 0 7px; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric-value.currency { font-size: clamp(23px, 2.1vw, 30px); }
.metric small { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }
.metric.warning .metric-value { color: var(--orange); }
.metric.alert .metric-value { color: var(--red); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 20px 0; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-header h2 { font-size: 17px; margin: 0; letter-spacing: -.2px; font-weight: 650; }
.panel-header p { font-size: 13px; color: var(--muted); margin: 5px 0 0; line-height: 1.6; }
.panel-body { padding: 22px; }
.filters { display: flex; align-items: center; gap: 10px; padding: 17px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filters .search { flex: 1; min-width: 200px; }
.filters input, .filters select { width: auto; max-width: 100%; font-size: 14px; padding: 11px 12px; background: #fafcfe; }
.filters input.search { width: 230px; }
.table-wrap { overflow: auto; scrollbar-width: thin; scrollbar-color: #aabccc #f2f5f8; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: #586e83; background: #f7f9fc; padding: 13px 17px; white-space: nowrap; line-height: 1.5; }
td { padding: 18px 17px; border-top: 1px solid #e8edf3; vertical-align: middle; line-height: 1.6; }
tbody tr:hover { background: #f8fbfe; }
.title-cell { min-width: 220px; max-width: 350px; }
.title-button { padding: 0; min-height: auto; border: none; border-radius: 3px; background: none; color: #174e75; font-weight: 650; text-align: left; line-height: 1.55; }
.title-button:hover { border: none; background: none; color: #0e668f; text-decoration: underline; text-underline-offset: 3px; }
.subtext { color: var(--muted); font-size: 12px; display: block; line-height: 1.65; margin-top: 4px; }
.number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; line-height: 1.45; padding: 5px 9px; border-radius: 6px; background: #edf1f6; color: #53677c; white-space: normal; }
.badge.green { background: #e7f4ec; color: #176348; }
.badge.orange { background: #fff1df; color: #8b4b14; }
.badge.red { background: #ffebee; color: #a02d39; }
.badge.blue { background: #e9f2fb; color: #245e8c; }
.badge.gray { background: #eff2f6; color: #53677c; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.75; margin: 12px 0; }
.banner { padding: 15px 18px; border: 1px solid #e6d0aa; border-radius: 9px; background: #fffaf0; font-size: 13px; line-height: 1.75; margin-bottom: 20px; color: #7d561d; }
.banner.error { border-color: #e9bbc1; background: #fff3f4; color: #9c2f3b; }
.banner.demo { border-color: #bfd7e9; background: #edf6fd; color: #245e86; }
.banner .text-link { margin-left: 4px; }
.banner:has(> div) { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.banner > div { flex: 1 1 300px; }
.banner > button { flex: 0 1 auto; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.85; }
.empty strong { display: block; color: #2e4a64; font-size: 17px; font-weight: 600; margin-bottom: 9px; }
.empty button { margin-top: 15px; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.stat-list { display: grid; gap: 18px; }
.stat-row { display: flex; justify-content: space-between; gap: 20px; font-size: 14px; padding-bottom: 14px; border-bottom: 1px solid #e9eef4; }
.stat-row:last-child { border: 0; padding-bottom: 0; }
.stat-row strong { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--muted); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.nowrap { white-space: nowrap; }
.footer-note { font-size: 12px; line-height: 1.8; color: var(--muted); margin: 24px 0; }
.checkbox { display: inline-flex; gap: 10px; align-items: flex-start; line-height: 1.65; font-size: 14px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--blue); margin: 3px 0 0; }
.modal-shade { position: fixed; inset: 0; background: #10223580; z-index: 10; display: flex; justify-content: flex-end; overflow: hidden; overscroll-behavior: contain; }
.drawer { width: 720px; max-width: 100%; background: #fff; height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; box-shadow: -12px 0 40px #11243c24; scrollbar-gutter: stable; }
.drawer-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; }
.drawer-header h2 { font-size: 23px; line-height: 1.4; letter-spacing: -.3px; margin: 4px 0; overflow-wrap: anywhere; }
.drawer-header .close { font-size: 26px; line-height: 1; min-width: 42px; min-height: 42px; padding: 5px 10px; align-self: flex-start; border: 0; background: #edf3f8; flex-shrink: 0; }
.drawer-body { padding: 24px 28px 36px; }
.drawer-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--line); background: #fff; position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -8px 16px #16364e08; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 28px; position: sticky; top: 0; background: #fff; z-index: 2; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 15px 0; background: none; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.form { display: grid; gap: 18px; }
.form label:not(.checkbox) { display: grid; gap: 8px; font-size: 14px; color: #3d556d; line-height: 1.55; }
.form input, .form textarea, .form select, input, select, textarea { border: 1px solid #bdcbd9; background: #fff; border-radius: 7px; padding: 11px 12px; min-height: 44px; width: 100%; color: #213b54; }
input::placeholder, textarea::placeholder { color: #687b8e; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { color: #516579; background: #f4f7fa; opacity: 1; cursor: not-allowed; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); }
input[type=checkbox], input[type=radio], .form input[type=checkbox], .form input[type=radio] { width: 18px; height: 18px; min-height: 18px; padding: 0; flex: 0 0 18px; accent-color: var(--blue); }
.form textarea { resize: vertical; min-height: 108px; line-height: 1.6; }
.form input[type=file] { font-size: 13px; padding: 12px; background: #fafcfe; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form h3 { font-size: 16px; font-weight: 650; margin: 16px 0 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.form-actions button { max-width: 100%; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-stat { padding: 18px; background: #f2f6fa; border: 1px solid #e4ecf3; border-radius: 9px; min-width: 0; }
.detail-stat small { font-size: 12px; color: var(--muted); display: block; }
.detail-stat strong { display: block; margin-top: 8px; font-size: 24px; letter-spacing: -.5px; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail-line { font-size: 14px; display: flex; justify-content: space-between; gap: 18px; margin: 17px 0; }
.detail-line span:first-child { color: var(--muted); }
.payment-card { padding: 22px 0; border-bottom: 1px solid var(--line); }
.payment-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.payment-heading strong { font-size: 23px; font-weight: 650; font-variant-numeric: tabular-nums; }
.payment-card p { font-size: 14px; line-height: 1.75; margin: 12px 0; color: #50677d; overflow-wrap: anywhere; }
.payment-card .toolbar { margin-top: 14px; }
.history { display: grid; gap: 0; }
.history-item { padding: 0 0 25px 22px; border-left: 1px solid #cad9e6; position: relative; font-size: 14px; }
.history-item::before { position: absolute; content: ''; width: 9px; height: 9px; left: -5px; top: 6px; background: #5f91b2; border: 2px solid #fff; border-radius: 50%; }
.history-item strong { font-size: 14px; font-weight: 650; }
.history-item p { margin: 8px 0; line-height: 1.7; color: #50677d; }
.history-item time { font-size: 12px; color: var(--muted); }
.role-table select { padding: 9px; font-size: 14px; width: 200px; }
.recipients { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.settings-wrap { max-width: 1100px; }
.inline-error { color: var(--red); font-size: 14px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.inline-error:not(:empty), .form-error:not(:empty) { padding: 13px 15px; border: 1px solid #e9bbc1; border-radius: 8px; background: #fff3f4; }
.inline-error:empty, .form-error:empty { display: none; }
.toast { background: #173d59; color: #fff; border-radius: 9px; padding: 15px 19px; margin: 8px; box-shadow: 0 5px 30px #183b5520; max-width: 440px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.toast.error { background: #9e2e3a; }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 30; max-width: calc(100vw - 20px); pointer-events: none; }
.login-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: #f3f6fa; padding: 24px; }
.login-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; max-width: 560px; padding: 42px; text-align: center; }
.login-panel img { width: 140px; height: 120px; object-fit: contain; }
.login-panel h1 { font-size: 28px; letter-spacing: -.6px; margin: 20px 0 14px; line-height: 1.3; }
.login-panel p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.login-panel .inline-error { color: var(--red); }
.login-panel .toolbar { justify-content: center; margin: 24px 0; }
.login-links { display: flex; justify-content: center; gap: 18px; font-size: 13px; flex-wrap: wrap; }
.initial { min-height: 60vh; display: grid; place-items: center; padding: 48px 24px; text-align: center; color: var(--muted); }
.text-link { border: 0; background: none; padding: 3px 0; min-height: auto; font-size: 14px; color: var(--blue); }
.text-link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.loading-line { height: 3px; background: #2b7ca6; animation: pulse 1s infinite alternate; }
.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; }

/* Daily work and role-specific summaries. */
.role-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #e8eef5; border-radius: 10px; }
.role-switch button { border-color: transparent; background: transparent; min-height: 36px; padding: 8px 13px; color: #52677c; }
.role-switch button.active, .role-switch button[aria-pressed="true"] { background: #fff; color: #125e8c; box-shadow: 0 1px 4px #16364e12; }
.role-switch:has(select) { align-items: center; gap: 8px; background: transparent; padding: 0; font-size: 13px; max-width: 100%; }
.role-switch select { width: auto; max-width: 100%; padding: 8px 10px; min-height: 38px; font-size: 13px; }
.queue-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0 26px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 25px; }
.section-heading h2 { font-size: 19px; margin: 0; letter-spacing: -.2px; }
.section-heading .hint { margin: 0; }
.queue-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); text-align: left; color: var(--navy); background: #fff; min-width: 0; }
.queue-card:hover { background: #fafdff; border-color: #7faac7; box-shadow: 0 4px 16px #183e5c0b; }
.queue-card.active, .queue-card[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #f1f8fd; }
.queue-card.alert .queue-count { color: var(--red); }
.queue-count { font-size: 30px; font-weight: 650; letter-spacing: -.8px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.queue-label { font-size: 14px; font-weight: 650; line-height: 1.45; }
.queue-help { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.6; }
.context-strip, .active-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 17px; background: #edf5fc; border: 1px solid #ccdeec; border-radius: 9px; color: #2c5b7d; font-size: 13px; line-height: 1.7; margin: 15px 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #b6d1e5; background: #eaf4fc; color: #205f8c; border-radius: 20px; padding: 7px 12px; min-height: 34px; font-size: 13px; }
.next-action { display: block; margin-top: 7px; color: #2c5d80; font-size: 13px; line-height: 1.6; }
.next-action button { margin-top: 7px; }
.aging-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px 22px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.aging-grid > * { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 13px; color: #52677c; text-align: left; }
.aging-grid strong { font-size: 19px; color: var(--navy); font-variant-numeric: tabular-nums; }
.manager-report th:first-child, .manager-report td:first-child { padding-left: 22px; }

/* Review screens make financial actions explicit. */
.stepper { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: step; }
.step { position: relative; padding: 12px 10px; border-bottom: 3px solid #dbe4ed; color: var(--muted); font-size: 12px; line-height: 1.55; counter-increment: step; }
.step::before { content: counter(step); display: grid; place-items: center; width: 25px; height: 25px; background: #edf2f7; color: #52677c; border-radius: 50%; font-weight: 650; font-size: 12px; margin-bottom: 8px; }
.step.is-current { border-bottom-color: var(--blue); color: #155f8d; font-weight: 600; }
.step.is-current::before { background: var(--blue); color: #fff; }
.step.is-done { border-bottom-color: #60a287; color: var(--green); }
.step.is-done::before { content: "✓"; background: #e2f2e9; color: var(--green); }
.payment-review { border: 1px solid #c8ddeb; border-radius: 10px; background: #f2f8fc; padding: 20px; margin: 8px 0 12px; color: #294f6b; font-size: 14px; line-height: 1.8; }
.payment-review h3 { margin: 0 0 12px; font-size: 17px; color: var(--navy); }
.payment-review strong { color: #163f5c; font-variant-numeric: tabular-nums; }
.payment-review .detail-stat { background: #fff; }
.payment-review .stat-row { border-bottom-color: #d8e6f0; }
.form-notice, .draft-notice { padding: 14px 16px; border: 1px solid #d0dfeb; border-radius: 9px; background: #f3f8fc; color: #375d7c; font-size: 13px; line-height: 1.7; margin: 6px 0; }
.draft-notice { border-color: #e6d5b3; background: #fffaf0; color: #7c561c; }
.draft-notice .toolbar { margin-top: 10px; }
.save-status { font-size: 12px; color: var(--muted); line-height: 1.6; margin-right: auto; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 150px; padding: 30px; color: #526e84; font-size: 14px; text-align: center; }
.loading-state::before { content: ""; display: inline-block; width: 22px; height: 22px; flex-shrink: 0; border: 3px solid #dce9f2; border-top-color: var(--blue); border-radius: 50%; animation: spin .85s linear infinite; }
.skeleton-line { height: 13px; background: #e5edf4; border-radius: 5px; margin: 12px 0; animation: pulse 1s infinite alternate; }

/* Contracts connect documents and the balances of visible deals. */
.contract-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin: 15px 0; overflow: hidden; }
.panel .contract-card { margin: 16px 20px; }
.contract-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; }
.contract-top h3 { font-size: 17px; margin: 0 0 7px; line-height: 1.5; color: #204a69; }
.contract-top p { margin: 5px 0; font-size: 13px; color: var(--muted); }
.contract-top .toolbar { flex-shrink: 0; justify-content: flex-end; }
.contract-financials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; padding: 18px 22px; border-top: 1px solid var(--line); background: #f8fafc; }
.contract-financials > * { min-width: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.contract-financials strong { display: block; font-size: 17px; margin-top: 6px; font-weight: 650; color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.contract-deals { padding: 16px 22px; border-top: 1px solid var(--line); }
.contract-deals summary { cursor: pointer; color: #245d85; font-weight: 600; padding: 6px 0; }
.contract-deals .table-wrap { margin: 10px -22px -16px; }
.contract-deals ul { padding-left: 20px; }
.contract-deals li { margin: 8px 0; }
.contract-deals > button { display: block; margin: 5px 0; width: 100%; text-align: left; }
.contract-card > details { padding: 16px 22px; border-top: 1px solid var(--line); }
.contract-card > details > summary { cursor: pointer; padding: 5px 0; color: #245d85; font-weight: 600; font-size: 14px; }
.contract-card h4 { font-size: 14px; margin: 10px 0; }
.contract-card > .form-notice { margin: 12px 22px; }
.file-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 15px 0; margin: 0; list-style: none; font-size: 13px; }
.file-links a { overflow-wrap: anywhere; }

/* Shared training and setup pages. */
.guide-page { max-width: 1080px; }
.guide-page h1 { font-size: clamp(25px, 3vw, 35px); letter-spacing: -.7px; line-height: 1.25; margin: 12px 0 18px; }
.guide-page > p { max-width: 900px; line-height: 1.8; }
.guide-page > .toolbar { margin: 20px 0; }
.guide-page .panel-body { line-height: 1.85; }
.guide-page .panel-body > :first-child { margin-top: 0; }
.guide-page .panel-body > :last-child { margin-bottom: 0; }
.guide-page li { margin: 9px 0; padding-left: 3px; }
.guide-page ol, .guide-page ul { padding-left: 24px; }
.guide-nav { display: flex; gap: 10px 20px; flex-wrap: wrap; padding: 17px 0 7px; font-size: 14px; }
.guide-page section[id] { scroll-margin-top: 20px; }
.guide-page code { display: inline-block; max-width: 100%; color: #244f70; background: #edf3f8; padding: 3px 7px; border-radius: 5px; font-size: 13px; overflow-wrap: anywhere; white-space: normal; }
.guide-page .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.guide-page .info-grid > div { background: #f4f8fc; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.guide-page .info-grid h3 { font-size: 16px; margin: 0 0 9px; }
.guide-page .info-grid p { margin: 0; }

@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1600px) { .main { padding-left: 42px; padding-right: 42px; } }
@media (max-width: 1280px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr); }
  .main { padding: 26px 24px 42px; }
  .topbar { padding: 14px 24px; }
  .brand { padding-left: 3px; padding-right: 3px; gap: 8px; }
  .brand strong { font-size: 16px; }
  .brand img { width: 53px; }
  .metric { min-height: 140px; }
  .metric-label { min-height: auto; }
  .split { grid-template-columns: 1fr; gap: 0; }
  .queue-count { font-size: 28px; }
  .contract-top { flex-wrap: wrap; }
  .contract-top .toolbar { justify-content: flex-start; }
}
@media (max-width: 1100px) {
  .metrics, .queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; min-width: 0; max-width: 100%; flex-direction: row; align-items: center; gap: 16px; padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { padding: 0; border: 0; flex-shrink: 0; }
  .brand img { height: 40px; width: 48px; }
  .brand div { display: none; }
  .nav { display: flex; gap: 4px; overflow-x: auto; min-width: 0; padding: 4px; scrollbar-width: thin; }
  .nav button { padding: 10px 12px; font-size: 13px; white-space: nowrap; gap: 8px; flex-shrink: 0; }
  .nav svg { width: 17px; height: 17px; }
  .sidebar-bottom { display: none; }
  .topbar { min-height: 65px; }
  .heading { flex-wrap: wrap; gap: 15px; }
  .aging-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-financials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-page .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sidebar { padding: 9px 10px; gap: 5px; }
  .brand img { height: 34px; width: 38px; }
  .nav button { font-size: 13px; padding: 10px; min-height: 40px; }
  .nav button svg { display: none; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .breadcrumb { font-size: 12px; }
  .user { gap: 7px; }
  .user .avatar { height: 31px; width: 31px; font-size: 12px; }
  .user > div:last-child { font-size: 12px; max-width: 155px; }
  .user small { font-size: 12px; }
  .main { padding: 22px 14px 36px; }
  .heading { margin-bottom: 20px; }
  .heading h1 { font-size: 25px; }
  .heading p { font-size: 14px; }
  .eyebrow { font-size: 12px; letter-spacing: .7px; }
  .metrics, .queue-grid { gap: 10px; margin: 18px 0; }
  .metric { padding: 15px; min-height: 154px; }
  .metric-label { font-size: 12px; line-height: 1.55; }
  .metric-value, .metric-value.currency { font-size: 25px; }
  .metric small { font-size: 12px; }
  .queue-card { padding: 15px; gap: 8px; }
  .queue-count { font-size: 27px; }
  .queue-label { font-size: 13px; }
  .queue-help { font-size: 12px; }
  .panel { margin: 16px 0; }
  .panel-header, .filters { padding: 16px; }
  .panel-header { flex-wrap: wrap; gap: 10px; }
  .panel-header h2 { font-size: 16px; }
  .panel-body { padding: 17px; }
  .filters .search { min-width: 100%; }
  .filters input.search { width: 100%; }
  .filters select { flex: 1; min-width: 130px; }
  .filters .checkbox { width: 100%; }
  td, th { padding: 14px; }
  .drawer { width: 100%; scrollbar-gutter: auto; }
  .drawer-header { padding: 19px 17px; }
  .drawer-header h2 { font-size: 21px; }
  .drawer-body { padding: 20px 17px 28px; }
  .drawer-footer { padding: 15px 17px; }
  .tabs { padding: 0 17px; gap: 23px; }
  .form-grid, .recipients { grid-template-columns: 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions button { flex: 1 1 auto; }
  .detail-grid { gap: 10px; }
  .detail-stat { padding: 14px; }
  .detail-stat strong { font-size: 21px; }
  .payment-heading { align-items: flex-start; }
  .payment-heading strong { font-size: 21px; }
  .payment-review { padding: 16px; }
  .detail-line { flex-wrap: wrap; gap: 6px 14px; }
  .step { font-size: 12px; padding: 10px 4px; }
  .login-shell { padding: 15px; }
  .login-panel { padding: 28px 21px; }
  .login-panel h1 { font-size: 26px; }
  .login-panel .toolbar { display: grid; }
  .login-links { gap: 12px; }
  .aging-grid { padding: 16px; gap: 10px; }
  .aging-grid > * { padding: 12px; }
  .aging-grid strong { font-size: 18px; }
  .panel .contract-card { margin: 14px; }
  .contract-top, .contract-financials, .contract-deals, .file-links { padding: 16px; }
  .contract-card > details { padding: 16px; }
  .contract-card > .form-notice { margin: 12px 16px; }
  .contract-card > details .file-links { padding: 10px 0; }
  .contract-top .toolbar { flex-shrink: 1; width: 100%; }
  .contract-deals .table-wrap { margin: 10px -16px -16px; }
  .contract-financials { gap: 14px 10px; }
  .contract-financials strong { font-size: 17px; }
  .context-strip, .active-filter { padding: 12px 14px; }
  #toasts { bottom: 10px; right: 5px; left: 5px; max-width: none; }
  .toast { max-width: none; margin: 5px; }
  .responsive-table, .responsive-table tbody { display: block; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .responsive-table tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 16px; border-top: 1px solid var(--line); }
  .responsive-table tr:first-child { border-top: 0; }
  .responsive-table td { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 5px 12px; padding: 8px 0; border: 0; min-width: 0; max-width: none; width: auto; font-size: 14px; }
  .responsive-table td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 550; color: var(--muted); min-width: 75px; padding-top: 2px; }
  .responsive-table td.title-cell { display: block; padding: 0 0 10px; }
  .responsive-table td.title-cell::before { display: none; }
  .responsive-table td .subtext { width: 100%; }
  .responsive-table td .title-button { font-size: 16px; }
  .responsive-table td.number { white-space: normal; }
  .responsive-table .next-action { width: 100%; }
  .manager-report .responsive-table td:first-child { padding-left: 0; }
  .guide-page h1 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .toolbar, .guide-nav, #toasts { display: none !important; }
  body, .layout { display: block; background: #fff; }
  .main { padding: 0; max-width: none; }
  .panel { break-inside: avoid; border-color: #becbd7; }
  .guide-page a { color: #192e43; text-decoration: underline; }
}
