/* Shared app layout */
.container { width: min(100%, var(--content)); margin: 0 auto; padding: 32px 24px 72px; }
.breadcrumbs { display: flex; margin-bottom: 1.5rem; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.78rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal-700); }
.page-header { display: flex; margin-bottom: 1.5rem; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.page-header > div:first-child { min-width: 0; }
.page-header .eyebrow { margin-bottom: 0.35rem; }
.client-page-header { margin-bottom: 1.15rem; }
.header-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.client-tabs {
  display: flex;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.client-tabs a {
  display: inline-flex;
  min-height: 44px;
  padding: 0.72rem 1rem 0.65rem;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
}
.client-tabs a:hover { color: var(--ink-900); }
.client-tabs a[aria-current="page"] { border-color: var(--teal-600); color: var(--teal-700); }
.panel-card {
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel-card__header { display: flex; min-height: 72px; padding: 1.15rem 1.25rem; align-items: center; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid var(--border); }
.panel-card__header h2, .panel-card__header h3, .panel-card__header p { margin-bottom: 0; }
.panel-card__header p { margin-top: 0.2rem; font-size: 0.82rem; }
.panel-card__header--actions { align-items: flex-start; }
.section-title-row { display: flex; margin-bottom: 1.2rem; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.section-title-row h2, .section-title-row p { margin-bottom: 0; }
.section-title-row > p { max-width: 540px; color: var(--muted); }
.summary-bar {
  display: grid;
  margin-bottom: 1.25rem;
  overflow: hidden;
  grid-template-columns: 180px 220px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.summary-bar > div { display: flex; min-height: 78px; padding: 1rem 1.25rem; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); }
.summary-bar > div:last-child { border-right: 0; }
.summary-bar strong { color: var(--ink-950); font-size: 1.45rem; line-height: 1.15; }
.summary-label { margin-bottom: 0.25rem; color: var(--muted); font-size: 0.76rem; font-weight: 620; }
.summary-guidance { flex-direction: row !important; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.84rem; }
.documents-summary { grid-template-columns: repeat(3, 155px) 1fr; }
.status-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; border: 2px solid #8da09a; border-radius: 50%; background: #fff; }
.status-dot--ok { border-color: var(--success); background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.status-dot--warn { border-color: #b6800a; background: #d39a20; box-shadow: 0 0 0 3px var(--warning-bg); }
.status-dot--error { border-color: var(--error); background: var(--error); box-shadow: 0 0 0 3px var(--error-bg); }
.status-dot--neutral { border-color: #80918b; background: #a2b0ab; box-shadow: 0 0 0 3px #edf1f0; }
.status {
  display: inline-flex;
  min-height: 25px;
  padding: 0.25rem 0.55rem;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1.15;
  white-space: normal;
}
.status--success { border-color: var(--success-border); background: var(--success-bg); color: var(--success); }
.status--warning { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning); }
.status--error { border-color: var(--error-border); background: var(--error-bg); color: var(--error); }
.status--neutral { border-color: var(--border); background: #edf2f1; color: #526761; }
.alert {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--info-border);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--info);
}
.alert h2 { margin-bottom: 0.45rem; color: inherit; font-size: 1rem; }
.alert p:last-child, .alert > :last-child { margin-bottom: 0; }
.alert--success { border-color: var(--success-border); border-left-color: var(--success); background: var(--success-bg); color: var(--success); }
.alert--warning { border-color: var(--warning-border); border-left-color: #b6800a; background: var(--warning-bg); color: var(--warning); }
.alert--error { border-color: var(--error-border); border-left-color: var(--error); background: var(--error-bg); color: var(--error); }
.alert-detail { margin: 0.3rem 0 0; font-size: 0.82rem; }
.flash-region:empty { display: none; }
.flash-item + .flash-item { margin-top: 0.35rem; }

/* Tables */
.table-shell { width: 100%; overflow-x: auto; scrollbar-color: var(--border-strong) transparent; }
table { width: 100%; border-collapse: collapse; }
.data-table { min-width: 720px; }
.data-table th {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.045em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td { padding: 0.82rem 0.9rem; border-bottom: 1px solid #e7ecea; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table td small { display: block; margin-top: 0.22rem; color: var(--muted); font-size: 0.73rem; }
.row-attention { background: #fffbef; }
.table-empty { display: flex; min-height: 90px; padding: 1rem; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.table-empty--success { flex-direction: column; gap: 0.25rem; color: var(--success); }
.key-value-table th, .key-value-table td { padding: 0.72rem 0.8rem; border-bottom: 1px solid #e7ecea; text-align: left; vertical-align: top; }
.key-value-table th { width: 230px; color: var(--muted); font-size: 0.78rem; font-weight: 650; }
.pager { display: grid; padding: 1rem 1.25rem; align-items: center; grid-template-columns: 1fr auto 1fr; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; }
.pager > :last-child { justify-self: end; }

/* App dashboard */
.period-overview { margin-bottom: 1.25rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.period-overview .section-title-row { margin-bottom: 1rem; }
.completion-score { display: flex; min-width: 170px; flex-direction: column; text-align: right; }
.completion-score span { color: var(--muted); font-size: 0.74rem; }
.completion-score strong { color: var(--teal-700); font-size: 1.55rem; line-height: 1.15; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 8px; }
.stat-card {
  display: flex;
  min-width: 0;
  min-height: 116px;
  padding: 1rem;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}
.stat-card:first-child { border-radius: 7px 0 0 7px; }
.stat-card:last-child { border-right: 0; border-radius: 0 7px 7px 0; }
.stat-card:hover { background: var(--teal-50); color: var(--text); }
.stat-card > span { color: var(--muted); font-size: 0.76rem; font-weight: 650; }
.stat-card > strong { margin: 0.15rem 0; color: var(--ink-950); font-size: 1.75rem; line-height: 1.1; }
.stat-card > small { color: var(--muted); font-size: 0.7rem; }
.stat-card--attention { box-shadow: inset 0 3px 0 #c18a18; }
.stat-card--danger { box-shadow: inset 0 3px 0 var(--error); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr); gap: 1.25rem; }
.action-list, .source-list, .mailbox-summary-list { margin: 0; padding: 0; list-style: none; }
.action-list li { display: grid; min-height: 74px; padding: 0.9rem 1.25rem; align-items: center; grid-template-columns: auto 1fr auto; gap: 0.85rem; border-bottom: 1px solid #e7ecea; }
.action-list li:last-child { border-bottom: 0; }
.action-list li > div { display: flex; min-width: 0; flex-direction: column; }
.action-list li strong { color: var(--ink-900); font-size: 0.86rem; }
.action-list li span:not(.status-dot) { color: var(--muted); font-size: 0.76rem; }
.action-list li > a { font-size: 0.8rem; font-weight: 680; text-decoration: none; }
.source-list li { display: grid; min-height: 74px; padding: 0.85rem 1.1rem; align-items: center; grid-template-columns: auto 1fr auto; gap: 0.75rem; border-bottom: 1px solid #e7ecea; }
.source-list li:last-child { border-bottom: 0; }
.source-list li > div { display: flex; flex-direction: column; }
.source-list li strong { color: var(--ink-900); font-size: 0.84rem; }
.source-list li div span { color: var(--muted); font-size: 0.73rem; }
.source-list li > a { font-size: 0.78rem; font-weight: 680; text-decoration: none; }
.source-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: var(--teal-50); color: var(--teal-700); font-size: 0.75rem; font-weight: 800; }
.configuration-section { margin-top: 3rem; scroll-margin-top: 90px; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.integration-card { min-width: 0; }
.integration-grid--core { margin-bottom: 1.25rem; align-items: stretch; }
.integration-grid--core > .panel-card { height: 100%; margin-bottom: 0; overflow: hidden; }
.core-integration-card { display: flex; flex-direction: column; }
.source-badge { display: inline-flex; min-height: 28px; padding: 0.32rem 0.58rem; align-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-soft); color: var(--ink-700); font-size: 0.7rem; font-weight: 780; letter-spacing: 0.04em; }
.upload-box { display: grid; min-height: 220px; padding: 1.2rem; align-content: center; gap: 0.9rem; }
.upload-box > label { display: flex; padding: 1.1rem; flex-direction: column; align-items: center; border: 1px dashed #9fb4ae; border-radius: 8px; background: var(--surface-soft); text-align: center; }
.upload-box > label strong { color: var(--ink-900); }
.upload-box > label span { margin-top: 0.2rem; color: var(--muted); font-size: 0.75rem; }
.manual-import-card { margin-top: 0; }
.upload-box--compact { min-height: 0; align-items: center; grid-template-columns: minmax(240px, 1fr) minmax(250px, 1fr) auto; }
.upload-box--compact > label { align-items: flex-start; padding: 0.9rem 1rem; text-align: left; }
.integration-status { min-height: 86px; padding: 1rem 1.2rem; }
.status-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.status-row .status-dot { margin-top: 0.35rem; }
.status-row > div { display: flex; flex-direction: column; }
.status-row strong { color: var(--ink-900); font-size: 0.86rem; }
.status-row span { color: var(--muted); font-size: 0.76rem; }
.integration-meta { margin: 0.6rem 0 0 1.6rem; color: var(--muted); font-size: 0.75rem; }
.loading-line { color: var(--muted); font-size: 0.82rem; }
.integration-actions { display: flex; padding: 0 1.2rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
.bank-integration-status { display: grid; padding: 1rem 1.2rem; gap: 1rem; }
.bank-coverage-summary { display: grid; overflow: hidden; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.bank-coverage-summary > div { display: flex; min-height: 74px; padding: 0.75rem 0.9rem; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); }
.bank-coverage-summary > div:last-child { border-right: 0; }
.bank-coverage-summary span { color: var(--muted); font-size: 0.67rem; font-weight: 680; text-transform: uppercase; }
.bank-coverage-summary strong { color: var(--ink-950); font-size: 1.15rem; line-height: 1.2; }
.bank-coverage-summary small { color: var(--muted); font-size: 0.67rem; }
.core-integration-form { display: grid; margin-top: auto; padding: 1.1rem 1.2rem 1.2rem; gap: 0.85rem; border-top: 1px solid var(--border); background: #fbfcfc; }
.core-integration-form__actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.embedded-configuration { margin-top: auto; border-top: 1px solid var(--border); background: #fbfcfc; }
.embedded-configuration__header { display: flex; padding: 0.9rem 1.2rem 0; flex-direction: column; gap: 0.08rem; }
.embedded-configuration__header strong { color: var(--ink-900); font-size: 0.84rem; }
.embedded-configuration__header span { color: var(--muted); font-size: 0.72rem; }
.embedded-configuration > form { padding: 1rem 1.2rem 1.2rem; }
.embedded-disclosure { border-top: 1px solid var(--border); }
.embedded-disclosure > summary { padding: 0.78rem 1.2rem; color: var(--teal-700); font-size: 0.8rem; font-weight: 680; cursor: pointer; }
.embedded-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.embedded-disclosure > form { padding: 1.2rem; }
.settings-disclosure { overflow: hidden; }
.settings-disclosure > summary { display: flex; min-height: 72px; padding: 1rem 1.25rem; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.settings-disclosure > summary::-webkit-details-marker { display: none; }
.settings-disclosure > summary > span:first-child { display: flex; flex-direction: column; }
.settings-disclosure > summary strong { color: var(--ink-900); }
.settings-disclosure > summary small { margin-top: 0.15rem; color: var(--muted); font-size: 0.74rem; }
.settings-disclosure > summary > span:last-child { color: var(--teal-700); font-size: 0.76rem; font-weight: 680; }
.settings-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.settings-content { padding: 1.25rem; }
.settings-forms { display: grid; margin-top: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.settings-forms--single { grid-template-columns: 1fr; }
.compact-form { display: grid; padding: 1rem; align-items: end; grid-template-columns: 1fr minmax(180px, 2fr) 100px auto; gap: 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.compact-form h4, .compact-form p { margin-bottom: 0; }
.compact-form p { font-size: 0.72rem; }
.row-actions { display: flex; margin-top: 0.35rem; flex-wrap: wrap; gap: 0.25rem; }
.row-actions--stacked { align-items: stretch; flex-direction: column; }
.row-actions--stacked form, .row-actions--stacked button { width: 100%; }

/* Guided client setup */
.setup-page-header { margin-bottom: 1.25rem; }
.setup-overview { display: grid; margin-bottom: 1rem; padding: 1.25rem 1.4rem; align-items: center; grid-template-columns: 1fr minmax(240px, 0.42fr); gap: 2rem; }
.setup-overview__copy h2 { margin-bottom: 0.25rem; font-size: 1.25rem; }
.setup-overview__copy p:last-child { margin: 0; color: var(--muted); font-size: 0.82rem; }
.setup-progress { display: grid; align-items: center; grid-template-columns: 1fr auto; gap: 0.8rem; }
.setup-progress__track { height: 10px; overflow: hidden; border-radius: 999px; background: #e5ece9; }
.setup-progress__track span { display: block; height: 100%; border-radius: inherit; background: var(--teal-700); transition: width 180ms ease; }
.setup-progress strong { min-width: 42px; color: var(--ink-900); font-size: 0.9rem; text-align: right; }
.setup-steps { display: grid; margin-bottom: 1.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
.setup-step { display: grid; min-width: 0; min-height: 76px; padding: 0.85rem; align-items: center; grid-template-columns: auto 1fr auto; gap: 0.65rem; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-sm); text-decoration: none; }
.setup-step:hover { border-color: #9bbdb3; background: var(--teal-50); }
.setup-step.is-active { border-color: var(--teal-700); box-shadow: inset 0 3px 0 var(--teal-700), var(--shadow-sm); }
.setup-step__number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; background: var(--surface-soft); color: var(--teal-700); font-size: 0.75rem; font-weight: 800; }
.setup-step > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.setup-step strong { overflow: hidden; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.setup-step small { overflow: hidden; margin-top: 0.12rem; color: var(--muted); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.setup-panel { overflow: hidden; }
.setup-panel--transparent { display: grid; overflow: visible; gap: 1rem; }
.setup-panel__header { display: flex; padding: 1.4rem; align-items: flex-start; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid var(--border); }
.setup-panel--transparent > .setup-panel__header { border-bottom: 0; border-radius: var(--radius); }
.setup-panel__header > div { max-width: 760px; }
.setup-panel__header h2 { margin-bottom: 0.35rem; font-size: 1.35rem; }
.setup-panel__header p:last-child { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.6; }
.setup-panel__header > .status { flex: 0 0 auto; }
.setup-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.setup-facts > div { display: flex; min-height: 92px; padding: 1rem 1.2rem; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); }
.setup-facts > div:last-child { border-right: 0; }
.setup-facts span { margin-bottom: 0.2rem; color: var(--muted); font-size: 0.7rem; font-weight: 680; text-transform: uppercase; }
.setup-facts strong { color: var(--ink-900); font-size: 0.9rem; }
.setup-account-list { margin: 0; padding: 0.5rem 1.25rem; list-style: none; }
.setup-account-list li { display: grid; min-height: 64px; padding: 0.65rem 0; align-items: center; grid-template-columns: auto 1fr auto; gap: 0.75rem; border-bottom: 1px solid #e7ecea; }
.setup-account-list li:last-child { border-bottom: 0; }
.setup-account-list li > div { display: flex; min-width: 0; flex-direction: column; }
.setup-account-list li strong { overflow: hidden; color: var(--ink-900); font-size: 0.82rem; text-overflow: ellipsis; }
.setup-account-list li small { color: var(--muted); font-size: 0.7rem; }
.setup-panel > .form-callout { margin: 1rem 1.25rem; }
.setup-panel__actions { display: flex; padding: 1.1rem 1.25rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.6rem; border-top: 1px solid var(--border); }
.setup-panel--transparent > .setup-panel__actions { padding-right: 0; padding-left: 0; border-top: 0; }
.bank-coverage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: #fffaf0; }
.bank-coverage--complete { background: #f2faf6; }
.bank-coverage > div { display: flex; min-height: 108px; padding: 1rem 1.3rem; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); }
.bank-coverage > div:last-child { border-right: 0; }
.bank-coverage span { color: var(--muted); font-size: 0.72rem; font-weight: 680; text-transform: uppercase; }
.bank-coverage strong { margin: 0.08rem 0; color: var(--ink-950); font-size: 1.7rem; line-height: 1.1; }
.bank-coverage small { color: var(--muted); font-size: 0.72rem; }
.setup-bank-table .row-attention { background: #fffaf0; }
.setup-bank-table td small { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.68rem; }
.setup-connect-form { display: grid; margin: 1.25rem; padding: 1.2rem; align-items: end; grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr) auto; gap: 1rem; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.setup-connect-form h3 { margin-bottom: 0.25rem; font-size: 1rem; }
.setup-connect-form p { margin: 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.setup-connect-form .form-callout { grid-column: 1 / -1; }
.setup-mail-form { padding: 1.25rem; }
.setup-mail-form > .button { justify-self: start; }
.setup-panel--transparent .integration-card { width: 100%; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0.55rem; }
.dashboard-setup-card { display: grid; margin-bottom: 1.25rem; padding: 1.25rem 1.4rem; align-items: center; grid-template-columns: 1fr minmax(290px, 0.42fr); gap: 2rem; border-left: 4px solid #c18a18; }
.dashboard-setup-card h2 { margin-bottom: 0.3rem; font-size: 1.2rem; }
.dashboard-setup-card p:last-child { margin: 0; color: var(--muted); font-size: 0.8rem; }
.dashboard-setup-card__status { display: grid; align-items: center; grid-template-columns: 1fr auto; gap: 0.65rem; }
.dashboard-setup-card__status > .button { grid-column: 1 / -1; justify-self: end; }
.dashboard-setup-card__status > strong { color: var(--ink-900); font-size: 0.82rem; }

/* Filters and statement detail */
.filter-bar { margin-bottom: 1.25rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.filter-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.7rem; }
.filter-form--compact { flex-wrap: nowrap; }
.filter-form--compact .field { min-width: 190px; }
.statement-summary { display: grid; margin-bottom: 1.25rem; overflow: hidden; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.statement-summary > div { display: flex; min-height: 100px; padding: 1rem 1.15rem; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); }
.statement-summary > div:last-child { border-right: 0; }
.statement-summary span:first-child { margin-bottom: 0.2rem; color: var(--muted); font-size: 0.74rem; }
.statement-summary strong { color: var(--ink-950); font-size: 1.08rem; font-variant-numeric: tabular-nums; }

/* Documents */
.source-cards { margin: 2.5rem 0 1.5rem; scroll-margin-top: 90px; }
.mailbox-summary-list { padding: 0.75rem 1.15rem; }
.mailbox-summary-list li { display: grid; padding: 0.6rem 0; align-items: center; grid-template-columns: 1fr auto; gap: 0.8rem; border-bottom: 1px solid #e7ecea; }
.mailbox-summary-list li:last-child { border-bottom: 0; }
.mailbox-summary-list li > div { display: flex; flex-direction: column; }
.mailbox-summary-list strong { color: var(--ink-900); font-size: 0.84rem; }
.mailbox-summary-list div span { color: var(--muted); font-size: 0.73rem; }
.queue-section { margin-top: 2.5rem; }
.document-list { display: grid; gap: 0.85rem; }
.document-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.document-card--attention { border-left: 4px solid #c18a18; }
.document-card__header { display: flex; min-height: 72px; padding: 0.9rem 1.1rem; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); }
.document-file { display: flex; min-width: 0; align-items: center; gap: 0.8rem; }
.document-file__type { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-soft); color: var(--ink-700); font-size: 0.64rem; font-weight: 800; }
.document-file > div { display: flex; min-width: 0; flex-direction: column; }
.document-file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-file small { color: var(--muted); font-size: 0.72rem; }
.document-card__body { display: grid; padding: 1rem 1.1rem; align-items: center; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; }
.document-data { display: grid; margin: 0; grid-template-columns: 0.7fr 1fr 1fr 1.8fr 0.8fr; gap: 0.9rem; }
.document-data div { min-width: 0; }
.document-data dt { margin-bottom: 0.2rem; color: var(--muted); font-size: 0.67rem; font-weight: 700; text-transform: uppercase; }
.document-data dd { margin: 0; overflow: hidden; color: var(--ink-900); font-size: 0.81rem; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.document-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem; }
.review-disclosure, .reject-disclosure { display: contents; }
.review-disclosure > summary, .reject-disclosure > summary { list-style: none; }
.review-disclosure > summary::-webkit-details-marker, .reject-disclosure > summary::-webkit-details-marker { display: none; }
.review-disclosure[open], .reject-disclosure[open] { display: block; width: 100%; flex-basis: 100%; }
.review-disclosure[open] > summary, .reject-disclosure[open] > summary { margin-left: auto; }
.review-form, .reject-form { margin-top: 0.75rem; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.reject-form { display: flex; align-items: flex-end; gap: 0.75rem; }
.reject-form .field { flex: 1; }
.accepted-copy { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--success); font-size: 0.78rem; font-weight: 650; }
.error-copy { color: var(--error) !important; }

/* Gaps */
.compact-overview { margin-bottom: 1.25rem; }
.gaps-table { min-width: 1180px; }
.suggested-match { display: grid; margin-top: 0.5rem; padding: 0.55rem; gap: 0.35rem; border: 1px solid var(--info-border); border-radius: 6px; background: var(--info-bg); color: var(--info); font-size: 0.75rem; }

/* Office index */
.popover-panel { position: relative; }
.popover-panel > summary { list-style: none; }
.popover-panel > summary::-webkit-details-marker { display: none; }
.popover-panel[open] > form {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 48px));
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.popover-panel--wide[open] > form { width: min(560px, calc(100vw - 48px)); }
.client-form-alert { margin: 0; }
.manual-client-heading { display: flex; padding-top: 0.15rem; flex-direction: column; gap: 0.2rem; border-top: 1px solid var(--border); }
.manual-client-heading strong { padding-top: 0.85rem; color: var(--ink-900); font-size: 0.88rem; }
.manual-client-heading small { color: var(--muted); font-size: 0.74rem; }
.manual-client-actions { display: flex; align-items: stretch; flex-direction: column; gap: 0.5rem; }
.clients-table td:first-child { min-width: 280px; }
.clients-table td:first-child small { display: block; }
.empty-state { display: flex; min-height: 240px; padding: 2rem; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); text-align: center; }
.empty-state__mark { display: grid; width: 52px; height: 52px; margin-bottom: 0.8rem; place-items: center; border-radius: 50%; background: var(--teal-50); color: var(--teal-700); font-size: 0.8rem; font-weight: 800; }
.empty-state h3 { margin-bottom: 0.35rem; }
.empty-state p { max-width: 480px; margin-bottom: 0; }
.error-state { max-width: 680px; margin: 8vh auto; padding: 3rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); text-align: center; }

/* Login */
.login-page { background: var(--surface); }
.login-container { min-height: calc(100vh - 69px); }
.login-layout { display: grid; min-height: calc(100vh - 69px); grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr); }
.login-intro { display: flex; padding: clamp(3rem, 7vw, 7rem); justify-content: center; flex-direction: column; grid-column: 1; grid-row: 1; background: var(--ink-900); color: #dce9ee; }
.login-intro h2 { max-width: 690px; color: white; font-size: clamp(2.2rem, 4vw, 3.7rem); }
.login-intro > p:not(.eyebrow) { max-width: 650px; color: #c4d5dd; font-size: 1.05rem; }
.login-intro .eyebrow { color: #75d2c7; }
.check-list { display: grid; margin: 1.2rem 0 2rem; padding: 0; gap: 0.8rem; list-style: none; }
.check-list li { position: relative; padding-left: 1.75rem; }
.check-list li::before { position: absolute; top: 0.05rem; left: 0; content: "✓"; color: #75d2c7; font-weight: 800; }
.login-trust { padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 0.82rem !important; }
.login-card { display: flex; width: min(100%, 520px); margin: auto; padding: clamp(2rem, 6vw, 4.5rem); flex-direction: column; justify-content: center; grid-column: 2; grid-row: 1; }
.login-card__heading { margin-bottom: 1.5rem; }
.login-card__heading h1 { font-size: 1.8rem; }
.form-help { margin: 1.2rem 0 0; color: var(--muted); font-size: 0.76rem; text-align: center; }
