:root {
  font-family: Inter, Geist, 'Segoe UI', Arial, sans-serif;
  color: #202d32;
  background: #f7f9fa;
  --ink: #202d32;
  --muted: #687980;
  --accent: #166753;
  --accent-dark: #115741;
  --nav: #142e2c;
  --line: #e4e9ea;
  --surface: #fff;
  --soft: #f7faf9;
  --shadow: 0 1px 2px rgba(12, 34, 40, 0.025);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #87c7b4;
  outline-offset: 2px;
}
a {
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
p {
  margin: 0;
}
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.035em;
}
h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 720;
}
h2 {
  font-size: 16px;
  font-weight: 700;
}
h3 {
  font-size: 14px;
}
.app-layout {
  min-height: 100vh;
  display: flex;
}
.app-sidebar {
  width: 246px;
  flex: none;
  min-height: 100vh;
  background: var(--nav);
  color: #dee9e5;
  display: flex;
  flex-direction: column;
  padding: 26px 15px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 12px 33px;
}
.brand-mark {
  border-radius: 11px;
  background: #ebf5f0;
  color: #174939;
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 830;
  letter-spacing: -0.15em;
  padding-right: 5px;
}
.brand-dot {
  color: #82b9a6;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-copy strong {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.7px;
  color: white;
}
.brand-copy small {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #91aba5;
}
.nav-overline {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.55px;
  color: #789b94;
  padding: 0 14px 12px;
}
.nav-overline.inner {
  padding-top: 28px;
  padding-bottom: 12px;
}
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 13px;
  border-radius: 8px;
  text-align: left;
  width: 100%;
  font-size: 13px;
  font-weight: 560;
  color: #b7cbc6;
  min-height: 43px;
}
.nav-item:hover:not(:disabled) {
  background: #203f3b;
  color: white;
}
.nav-item.is-active {
  background: #295248;
  color: #fff;
  font-weight: 650;
}
.nav-item:disabled {
  opacity: 0.52;
}
.nav-icon {
  width: 19px;
  height: 19px;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  font-weight: 400;
  color: #9cbbb2;
}
.is-active .nav-icon {
  color: white;
}
.nav-count {
  margin-left: auto;
  background: #3c6057;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 10px;
  color: #ecf5f2;
}
.future-label {
  margin-left: auto;
  font-size: 9px;
  color: #8aaca4;
  letter-spacing: 0.7px;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 7px 2px;
}
.sidebar-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #325a51;
  display: grid;
  place-items: center;
  color: #e4f3ee;
  font-size: 11px;
  font-weight: 750;
}
.sidebar-bottom strong,
.sidebar-bottom small {
  display: block;
}
.sidebar-bottom strong {
  font-size: 11px;
  color: white;
}
.sidebar-bottom small {
  font-size: 10px;
  margin-top: 3px;
  color: #91a9a3;
}
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 71px;
  flex-shrink: 0;
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: white;
  gap: 16px;
}
.topbar-left,
.topbar-right,
#identity {
  display: flex;
  align-items: center;
  gap: 13px;
}
.breadcrumb {
  color: #74848a;
  font-size: 13px;
}
.breadcrumb-divider {
  color: #c6cfd1;
}
.breadcrumb-current {
  color: #273839;
  font-size: 13px;
  font-weight: 650;
}
.environment {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.85px;
  background: #f0f5f3;
  border: 1px solid #e1ece8;
  border-radius: 5px;
  color: #527a71;
  padding: 6px 9px;
  white-space: nowrap;
}
.topbar label {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #76858a;
  gap: 9px;
  margin: 0;
}
.topbar select {
  width: 198px;
  max-width: 25vw;
  background: #fff;
  min-height: 35px;
  font-size: 12px;
  padding: 7px 26px 7px 10px;
  font-weight: 650;
  margin: 0;
}
.text-button,
.link-button {
  background: transparent;
  color: #3f675b;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 6px;
}
.text-button:hover,
.link-button:hover {
  text-decoration: underline;
}
.main-content {
  padding: 35px 41px 50px;
  max-width: 1650px;
  width: 100%;
  margin: auto;
  flex: 1;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 29px;
}
.eyebrow {
  font-size: 10px;
  color: #517f74;
  letter-spacing: 1.55px;
  font-weight: 820;
  margin: 0 0 9px;
}
.subheading {
  color: #76858b;
  font-size: 13px;
  margin-top: 9px;
  line-height: 1.5;
}
.heading-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
button.primary,
button.secondary,
button[type='submit'],
form button:not(.quiet),
.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  min-height: 39px;
  white-space: nowrap;
  border: 1px solid transparent;
}
button.primary,
button[type='submit'],
form button:not(.quiet) {
  background: var(--accent);
  color: white;
}
button.primary:hover,
button[type='submit']:hover,
form button:not(.quiet):hover {
  background: var(--accent-dark);
}
button.secondary,
button.quiet,
.secondary-file {
  background: white;
  color: #39554d;
  border: 1px solid #dbe3e2;
  min-height: 39px;
  border-radius: 7px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 670;
}
button.secondary:hover,
button.quiet:hover {
  background: #f3f7f5;
}
.surface {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 23px 17px;
}
.panel-head p {
  color: #87949a;
  font-size: 12px;
  margin-top: 6px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}
.metric {
  position: relative;
  min-height: 138px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 21px;
  box-shadow: var(--shadow);
}
.metric p {
  font-size: 12px;
  color: #697b81;
  font-weight: 600;
  margin-bottom: 18px;
}
.metric strong {
  font-size: 27px;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1;
}
.metric small {
  display: block;
  color: #9aa5a9;
  font-size: 10px;
  margin-top: 13px;
}
.metric-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  color: #7fae9f;
  font-size: 19px;
}
.dashboard-split {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 19px;
  margin-bottom: 20px;
}
.attention-list {
  padding: 0 23px 20px;
}
.attention-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid #eef1f1;
}
.attention-row:first-child {
  border-top: 0;
}
.attention-icon {
  height: 38px;
  width: 38px;
  background: #eff6f3;
  color: #377c67;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.attention-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attention-copy strong {
  font-size: 12px;
}
.attention-copy small {
  font-size: 11px;
  color: #8c9a9e;
}
.attention-action {
  border: 0;
  color: #166753;
  font-weight: 700;
  background: none;
  font-size: 11px;
}
.quick-action {
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 17px 4px;
  border: 0;
  border-top: 1px solid #eef1f1;
  background: none;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.quick-action:first-of-type {
  border-top: 0;
}
.quick-action:hover {
  color: #12664f;
}
.action-symbol {
  width: 36px;
  height: 36px;
  background: #f1f6f4;
  color: #346b5a;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 17px;
}
.quick-action span:nth-child(2) {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.quick-action strong {
  font-size: 12px;
}
.quick-action small {
  font-size: 11px;
  color: #95a0a4;
}
.action-chevron {
  font-size: 17px;
  color: #819995;
}
.table-scroll {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  background: #fbfcfc;
  font-size: 10px;
  letter-spacing: 0.35px;
  color: #839096;
  font-weight: 750;
  text-transform: uppercase;
  padding: 14px 22px;
  border-top: 1px solid #f0f1f2;
  border-bottom: 1px solid #eef1f1;
}
.data-table td {
  font-size: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid #f1f3f3;
  color: #344549;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover {
  background: #fafcfb;
}
.data-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #273b39;
}
.supplier-cell {
  font-weight: 680;
  color: #243937;
}
.minor {
  color: #91a0a3;
  font-weight: 400;
  font-size: 11px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 50px;
  padding: 5px 9px;
  background: #eff4f1;
  color: #59786e;
  font-weight: 720;
  font-size: 10px;
  text-transform: capitalize;
  white-space: nowrap;
}
.status-pill[data-status='posted'] {
  background: #e6f5ec;
  color: #247648;
}
.status-pill[data-status='approved'] {
  background: #e8f4f2;
  color: #1c6d5c;
}
.status-pill[data-status='reviewed'] {
  background: #fff3db;
  color: #96610a;
}
.status-pill[data-status='rejected'] {
  background: #fff0ee;
  color: #ac4f44;
}
.status-pill[data-status='draft'] {
  background: #edf1f4;
  color: #627781;
}
.row-open {
  border: 0;
  background: none;
  color: #176750;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.empty-row {
  text-align: center;
  color: #8b9a9e;
  padding: 40px 20px !important;
}
.table-toolbar {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.search-control {
  border: 1px solid #dfe6e7;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #97a6a9;
  padding: 0 12px;
  min-width: 285px;
}
.search-control input {
  border: 0 !important;
  padding: 8px 0 !important;
  margin: 0 !important;
  min-height: 38px;
  outline: 0 !important;
  width: 100%;
}
.inline-field {
  display: flex;
  align-items: center;
  gap: 9px !important;
  margin: 0 !important;
  color: #73888c !important;
}
.inline-field select {
  margin: 0;
  min-width: 155px;
}
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8c9a9f;
  padding: 17px 22px;
  gap: 18px;
  font-size: 11px;
}
.pager {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pager button {
  min-height: 32px;
  padding: 7px 9px;
}
.review-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.review-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(430px, 1.1fr);
  align-items: start;
  gap: 18px;
}
.preview-panel {
  position: sticky;
  top: 18px;
  overflow: hidden;
}
.receipt-preview {
  min-height: 385px;
  height: 450px;
  background: #f3f6f6;
  border-top: 1px solid #eef1f1;
  border-bottom: 1px solid #eef1f1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.preview-empty {
  text-align: center;
  max-width: 220px;
  color: #72868c;
}
.preview-empty span {
  font-size: 40px;
  display: block;
  margin-bottom: 14px;
  color: #9dadad;
}
.preview-empty strong {
  font-size: 14px;
  display: block;
  color: #4a6268;
}
.preview-empty p {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 7px;
}
.receipt-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.receipt-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}
.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 11px;
  color: #708287;
  gap: 8px;
  min-width: 0;
}
.preview-footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.extract-tools {
  padding: 12px 20px 20px;
  border-top: 1px solid #eef1f1;
}
.consent {
  display: flex;
  align-items: start;
  gap: 9px;
  line-height: 1.45;
  font-size: 11px;
}
.extract-tools button {
  margin-top: 10px;
}
.evidence {
  white-space: pre-wrap;
  word-break: break-word;
  color: #617c75;
  font-size: 11px;
}
.edit-panel {
  padding-bottom: 25px;
}
.edit-panel form,
.edit-panel .approval-panel,
.edit-panel #payment-panel {
  padding: 0 23px;
}
.edit-panel #invoice-form {
  padding-top: 2px;
}
.edit-panel .panel-head {
  border-bottom: 1px solid #f0f2f2;
  margin-bottom: 6px;
}
.edit-panel fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.edit-panel label,
.supplier-grid label {
  display: block;
  color: #5e757a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1px;
  margin: 15px 0 6px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.edit-panel input,
.edit-panel select,
.supplier-grid input,
.supplier-grid select,
.topbar select,
.inline-field select {
  width: 100%;
  background: white;
  border: 1px solid #dfe5e6;
  border-radius: 6px;
  color: #314a4a;
  min-height: 39px;
  font-size: 12px;
  display: block;
  padding: 9px 11px;
  outline: 0;
  margin-top: 6px;
}
.edit-panel input:focus,
.edit-panel select:focus,
.supplier-grid input:focus,
.supplier-grid select:focus {
  border-color: #3d9278;
}
.edit-panel h3 {
  border-top: 1px solid #edf1f1;
  margin: 25px 0 11px;
  padding-top: 19px;
}
.muted,
.help-text {
  font-size: 11px;
  color: #8b999e;
  line-height: 1.6;
}
.line {
  border: 1px solid #e6eced;
  border-radius: 8px;
  padding: 15px;
  margin: 13px 0;
  background: #fdfefe;
}
.line .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 10px;
}
.line label {
  font-size: 10px;
  margin: 10px 0 4px;
}
.tax-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #f3f8f6;
  border-radius: 8px;
  padding: 4px 13px 13px;
  margin: 17px 0;
}
.edit-panel button#save {
  margin-top: 16px;
}
.approval-panel,
#payment-panel {
  border-top: 1px solid #edf1f1;
  margin-top: 25px;
  padding-top: 16px !important;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.actions button {
  min-height: 37px;
  font-size: 12px;
  padding: 9px 12px;
}
.actions .danger {
  background: #fff1f0;
  color: #a63b36;
  border: 1px solid #ecc5c2;
  border-radius: 6px;
}
.approval-panel input {
  width: 100%;
  min-height: 39px;
  border: 1px solid #dfe5e6;
  border-radius: 6px;
  padding: 9px 11px;
}
.approval-panel label {
  display: block;
  color: #597076;
  font-size: 11px;
  font-weight: 700;
  margin: 15px 0;
}
.approval-panel #bill-summary {
  font-size: 11px;
  color: #627679;
  line-height: 1.8;
}
.document-list {
  padding: 0 21px 22px;
  display: grid;
  gap: 9px;
}
.doc-item {
  border: 1px solid #e6ebeb;
  border-radius: 8px;
  overflow-wrap: anywhere;
  padding: 10px 14px;
}
.doc-item button {
  border: 0;
  background: transparent;
  min-height: 27px;
  font-size: 12px;
  text-align: left;
  color: #2f6959;
  font-weight: 680;
}
.inbox-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 19px;
}
.upload-surface {
  padding-bottom: 25px;
}
.upload-surface .file-action {
  margin: 8px 20px 0;
}
.file-action {
  display: flex;
  width: calc(100% - 40px);
  cursor: pointer;
  text-align: center;
}
.primary-file {
  background: #166753;
  color: white;
}
.file-action input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.upload-surface .help-text {
  padding: 13px 20px;
}
.supplier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
}
.supplier-grid .surface {
  padding: 0 22px 22px;
}
.supplier-grid .panel-head {
  padding-left: 0;
}
.supplier-grid details {
  margin-top: 20px;
}
.supplier-grid details summary {
  color: #166753;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.supplier-grid button {
  margin-top: 14px;
}
.supplier-grid hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
#notice:not(:empty) {
  padding: 12px 15px;
  background: #eaf6ef;
  color: #245d48;
  border: 1px solid #cce8d6;
  margin-bottom: 22px;
  border-radius: 8px;
  font-size: 12px;
}
#notice.error {
  background: #fff2f1;
  color: #9b3b32;
  border-color: #f0cfc8;
}
.app-footer {
  padding: 14px 40px 21px;
  font-size: 10px;
  color: #a1adb0;
  text-align: center;
}
#history-output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 280px;
  overflow: auto;
  background: #f9fbfb;
  padding: 12px;
  border: 1px solid var(--line);
  font-size: 11px;
}
.auth-layout:has(#login-panel[hidden]):has(#company-setup-panel[hidden]) {
  display: none;
}
.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(130deg, #f4f8f7, #fff);
}
.auth-layout .card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 20px 60px #17392b12;
  padding: 38px;
  max-width: 450px;
  width: calc(100% - 30px);
}
.auth-layout h1 {
  font-size: 28px;
  margin: 10px 0;
}
.auth-layout p:not(.eyebrow) {
  font-size: 13px;
  color: #72878a;
  line-height: 1.6;
  margin-bottom: 20px;
}
.auth-layout label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: #677d80;
  margin-bottom: 13px;
}
.auth-layout input {
  width: 100%;
  display: block;
  min-height: 44px;
  border: 1px solid #dce5e2;
  border-radius: 6px;
  margin-top: 6px;
  padding: 10px;
}
.auth-layout button {
  width: 100%;
  min-height: 42px;
}
.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;
}
.menu-toggle {
  display: none;
}
.loading-quiet {
  color: #899a9b;
  font-size: 12px;
  padding: 18px;
}
.expense-cell-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: #285c4d;
  font-weight: 700;
  font-size: 12px;
  text-align: left;
}
.expense-cell-button:hover {
  text-decoration: underline;
}
@media (max-width: 1200px) {
  .app-sidebar {
    width: 221px;
  }
  .main-content {
    padding: 29px 26px 40px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .review-layout {
    grid-template-columns: minmax(260px, 0.9fr) minmax(400px, 1.1fr);
  }
  .metric {
    min-height: 124px;
  }
}
@media (max-width: 970px) {
  .review-layout {
    grid-template-columns: 1fr;
  }
  .preview-panel {
    position: static;
  }
  .receipt-preview {
    height: 340px;
    min-height: 250px;
  }
  .inbox-grid,
  .supplier-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 20px;
  }
  .environment {
    display: none;
  }
}
@media (max-width: 740px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 260px;
    height: 100dvh;
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  #nav-shade:not([hidden]) {
    position: fixed;
    inset: 0;
    background: #132b2a88;
    z-index: 20;
  }
  .menu-toggle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: 0;
    font-size: 19px;
    color: #235447;
    min-width: 35px;
    min-height: 35px;
  }
  .main-content {
    padding: 24px 18px 30px;
  }
  .topbar {
    height: 61px;
    padding: 0 14px;
  }
  .topbar-right {
    gap: 4px;
    flex-shrink: 0;
  }
  .topbar-left {
    min-width: 0;
    gap: 6px;
  }
  .breadcrumb-current {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #identity {
    gap: 5px;
  }
  .topbar label {
    font-size: 0;
  }
  .topbar select {
    max-width: 145px;
    min-width: 0;
    width: 145px;
    font-size: 11px;
    margin-top: 0;
    padding: 7px;
  }
  .topbar .text-button {
    font-size: 11px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .page-heading .heading-actions {
    flex-shrink: 0;
  }
  .heading-actions button {
    padding: 9px 10px;
    font-size: 11px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 16px;
    min-height: 116px;
  }
  .metric strong {
    font-size: 23px;
  }
  .metric p {
    font-size: 11px;
    margin-bottom: 13px;
  }
  .metric small {
    font-size: 9px;
    margin-top: 9px;
  }
  .dashboard-split {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .panel-head {
    padding: 17px;
  }
  .data-table td,
  .data-table th {
    padding: 13px 16px;
  }
  .table-toolbar {
    padding: 14px;
    flex-wrap: wrap;
  }
  .search-control {
    width: 100%;
    min-width: 0;
  }
  .inline-field {
    flex: 1;
  }
  .table-footer {
    padding: 13px;
    flex-wrap: wrap;
  }
  .pager {
    gap: 5px;
  }
  .pager button {
    font-size: 10px;
  }
  .review-title {
    gap: 8px;
  }
  .line .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .edit-panel form,
  .edit-panel .approval-panel,
  .edit-panel #payment-panel {
    padding: 0 16px;
  }
  .app-footer {
    padding: 16px;
  }
  .topbar .breadcrumb-divider {
    display: none;
  }
}
@media (max-width: 450px) {
  .page-heading {
    flex-direction: column;
    gap: 13px;
  }
  .heading-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .heading-actions button {
    flex: 1;
  }
  .subheading {
    font-size: 12px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    padding: 14px 11px;
  }
  .metric strong {
    font-size: 21px;
  }
  .metric small {
    font-size: 9px;
  }
  .metric-icon {
    top: 13px;
    right: 12px;
    font-size: 15px;
  }
  .preview-footer {
    padding: 12px;
  }
  .grid,
  .line .grid {
    grid-template-columns: 1fr;
  }
  .totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 10px 5px;
  }
  .totals label {
    font-size: 9px;
  }
  .totals input {
    padding: 8px 4px;
    min-height: 35px;
    font-size: 11px;
  }
  .environment {
    display: none;
  }
  .topbar select {
    width: 123px;
  }
  .table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .pager {
    gap: 4px;
  }
}

#notice:not(:empty) {
  position: fixed;
  top: 82px;
  right: 25px;
  width: min(440px, calc(100vw - 26px));
  z-index: 60;
  margin: 0;
  box-shadow: 0 12px 30px #19352816;
}
@media (max-width: 740px) {
  #notice:not(:empty) {
    top: 68px;
    right: 13px;
  }
}
@media (max-width: 600px) {
  .data-table {
    white-space: normal;
    table-layout: fixed;
    width: 100%;
  }
  .data-table thead {
    display: none;
  }
  .data-table tbody {
    display: block;
  }
  .data-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 9px;
    padding: 15px 16px;
    border-bottom: 1px solid #eef1f1;
  }
  .data-table td {
    display: block;
    width: auto;
    padding: 0;
    border: 0 !important;
    font-size: 11px;
    min-width: 0;
    white-space: normal;
  }
  .data-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    font-size: 12px;
  }
  .data-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    color: #687e82;
  }
  .data-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
    color: #91a0a3;
  }
  .data-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
  #view-dashboard .data-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }
  #view-expenses .data-table td:nth-child(5) {
    display: none;
  }
  #view-expenses .data-table td:nth-child(6) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }
  #view-expenses .data-table td:nth-child(7) {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }
  .data-table .empty-row {
    grid-column: 1/-1;
    text-align: left;
  }
}
#review,
#approve,
#post {
  background: #166753;
  color: #fff;
  border: 1px solid #166753;
  border-radius: 7px;
  font-weight: 700;
}
#review:hover,
#approve:hover,
#post:hover {
  background: #115741;
}
#reject {
  font-weight: 680;
}
/* SAWMBooks Expense Intelligence */
.analysis-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
  padding: 18px 20px;
}
.analysis-controls > label {
  flex: 1 1 156px;
  min-width: 142px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.analysis-controls select,
.analysis-controls input {
  width: 100%;
  height: 40px;
  background: #fff;
  border: 1px solid #dae4e2;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 550;
}
.custom-date-fields {
  display: flex;
  flex: 1 1 315px;
  gap: 10px;
}
.custom-date-fields[hidden] {
  display: none;
}
.custom-date-fields label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.analysis-caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0 17px;
}
.analysis-metrics {
  margin-top: 9px;
  margin-bottom: 24px;
}
.analysis-metrics .metric strong,
.advisor-metrics .metric strong {
  font-size: 25px;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.analysis-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  margin-bottom: 23px;
}
.analysis-grid .surface {
  min-width: 0;
}
.analysis-bars {
  padding: 4px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 230px;
}
.analysis-row {
  background: transparent;
  border: 0;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  gap: 8px;
  width: 100%;
  padding: 6px 0;
  color: var(--ink);
}
.analysis-row:hover,
.analysis-row.is-selected {
  color: var(--accent);
}
.analysis-row-name {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analysis-row-amount {
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.analysis-track {
  grid-column: 1 / -1;
  height: 9px;
  border-radius: 8px;
  background: #edf2f1;
  overflow: hidden;
}
.analysis-fill {
  height: 100%;
  border-radius: 8px;
  background: #16745f;
  min-width: 2px;
}
.analysis-row:nth-child(2n) .analysis-fill {
  background: #3b9987;
}
.analysis-row:nth-child(3n) .analysis-fill {
  background: #79b8a9;
}
.analysis-trend {
  padding: 18px 22px 30px;
  min-height: 230px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow: hidden;
}
.trend-bar-wrapper {
  height: 165px;
  flex: 1 1 0;
  min-width: 2px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.trend-bar {
  min-height: 2px;
  background: #2c907a;
  border-radius: 3px 3px 0 0;
}
.trend-bar-wrapper:nth-child(7n) .trend-bar {
  background: #99cbbb;
}
.analysis-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  padding: 32px 12px;
}
.analysis-disclaimer {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 12px;
}
#intel-transactions td {
  vertical-align: middle;
}
#intel-transactions .expense-cell-button {
  font-weight: 650;
}
.advisor-intro {
  display: flex;
  gap: 18px;
  padding: 24px;
  margin-bottom: 21px;
}
.advisor-intro-icon {
  font-size: 32px;
  background: #e7f5f0;
  border-radius: 14px;
  width: 56px;
  height: 56px;
  min-width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.advisor-intro h2,
.advisor-limitations h2 {
  font-size: 17px;
  font-weight: 730;
  margin: 0 0 8px;
}
.advisor-intro p,
.advisor-limitations p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 7px;
}
.advisor-metrics {
  margin-bottom: 20px;
}
.advisor-items {
  padding: 8px 22px 22px;
  display: grid;
  gap: 12px;
  min-height: 90px;
}
.advisor-item {
  width: 100%;
  border: 1px solid #e1e8e5;
  background: #fff;
  border-radius: 11px;
  display: flex;
  gap: 15px;
  text-align: left;
  padding: 17px;
  align-items: flex-start;
}
.advisor-item:hover,
.advisor-item:focus-visible {
  border-color: #77afa2;
  background: #f8fcfa;
}
.advisor-alert-icon {
  height: 36px;
  width: 36px;
  min-width: 36px;
  background: #f4f3e8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #756522;
}
.advisor-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.advisor-item span {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.advisor-item small {
  display: block;
  font-size: 11px;
  color: #59766e;
  margin-top: 9px;
}
.advisor-item .advisor-arrow {
  margin-left: auto;
  color: var(--accent);
  white-space: nowrap;
  font-size: 12px;
  align-self: center;
}
.advisor-limitations {
  padding: 22px 24px;
  margin-top: 19px;
}
@media (max-width: 970px) {
  .analysis-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .analysis-controls {
    padding: 14px;
    gap: 12px;
  }
  .analysis-controls > label {
    flex: 1 1 140px;
    min-width: 0;
  }
  .analysis-trend {
    min-height: 200px;
  }
  .analysis-bars {
    padding: 10px 17px 20px;
  }
  .analysis-grid {
    gap: 14px;
  }
  .advisor-item {
    padding: 13px;
    gap: 10px;
  }
  .advisor-arrow {
    display: none !important;
  }
  .custom-date-fields {
    flex-basis: 100%;
  }
  #intel-transactions td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  #intel-transactions td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  #intel-transactions td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }
  #intel-transactions td:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
  #intel-transactions td:nth-child(5) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .analysis-metrics .metric strong,
  .advisor-metrics .metric strong {
    font-size: 19px;
  }
}
.dashboard-intelligence {
  margin-top: 23px;
  margin-bottom: 22px;
}
.dashboard-intelligence .analysis-bars {
  padding-top: 16px;
  min-height: 192px;
}
.dashboard-advisor {
  display: grid;
  gap: 9px;
  padding: 14px 20px 22px;
  min-height: 192px;
}
.dashboard-advisor-item {
  border: 1px solid #e4ebea;
  background: #fff;
  border-radius: 9px;
  padding: 11px 13px;
  text-align: left;
}
.dashboard-advisor-item:hover {
  border-color: #8ebcaa;
}
.dashboard-advisor-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}
.dashboard-advisor-item span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
/* Bank Intelligence: clean restrained panels, no balance or verification claims. */
.bank-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 19px;
  margin: 18px 0;
}
.bank-import {
  padding: 0 22px 22px;
}
.bank-import .panel-head {
  padding-left: 0;
  padding-right: 0;
}
.bank-import label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: #496763;
  margin: 15px 0;
}
.bank-import input,
.bank-import select {
  display: block;
  margin-top: 7px;
  width: 100%;
  min-height: 40px;
  background: #fff;
  border: 1px solid #dae5e3;
  border-radius: 7px;
  color: #1e3934;
  padding: 9px 11px;
}
.bank-import details {
  border-top: 1px solid #edf1f1;
  margin-top: 24px;
  padding-top: 18px;
  font-size: 12px;
}
.bank-import summary {
  cursor: pointer;
  color: #0d614c;
  font-weight: 700;
}
.bank-form button {
  margin: 12px 0;
}
.bank-alert-list {
  padding: 5px 22px 22px;
}
.bank-alert {
  border: 1px solid #e2e9e7;
  border-left: 3px solid #c89952;
  padding: 14px 15px;
  border-radius: 7px;
  margin-top: 10px;
}
.bank-alert strong {
  font-size: 13px;
  color: #243b38;
}
.bank-alert p {
  font-size: 11px;
  color: #6c7e7b;
  line-height: 1.6;
  margin: 7px 0;
}
.bank-alert small {
  display: block;
  font-size: 11px;
  color: #44776c;
  padding: 5px 0;
  overflow-wrap: anywhere;
}
.bank-context {
  color: #758781;
  font-size: 11px;
  margin: 8px 0 16px;
}
#bank-notice:not(:empty) {
  font-size: 12px;
  background: #eaf6ef;
  padding: 12px 15px;
  border-radius: 6px;
  color: #205f43;
}
#bank-notice.error {
  background: #fff1ef;
  color: #a34339;
}
.bank-empty {
  font-size: 12px;
  color: #718480;
  line-height: 1.6;
}
.bank-activity {
  margin-top: 18px;
}
.bank-file {
  padding: 11px 13px;
  background: #f0f7f4;
  border: 1px dashed #a4c9b7;
  border-radius: 8px;
}
@media (max-width: 850px) {
  .bank-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  #view-banking .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #view-banking .metric strong {
    font-size: 18px;
  }
  #view-banking .bank-activity .data-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  #view-banking .bank-activity .data-table td:nth-child(2) {
    grid-column: 1/-1;
    grid-row: 2;
  }
  #view-banking .bank-activity .data-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }
  #view-banking .bank-activity .data-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  #view-banking .bank-activity .data-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }
}

.bank-example {
  display: inline-block;
  margin: 2px 0 10px;
  font-size: 11px;
  color: #166753;
  text-decoration: underline;
}
.bank-example:hover {
  color: #0c3e30;
}
/* Read-only, test-only bank connection: distinct from manual statement imports. */
.plaid-box {
  margin: 20px 0;
  padding: 20px 24px;
}
.plaid-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.plaid-box .panel-head {
  align-items: center;
}
.plaid-box .badge {
  background: #edf5f2;
  color: #20564b;
  padding: 6px 12px;
  border-radius: 40px;
  font-size: 12px;
  white-space: nowrap;
}
.plaid-box .bank-context.error {
  color: #a23f2e;
}
@media (max-width: 620px) {
  .plaid-box {
    padding: 16px;
  }
  .plaid-actions button {
    width: 100%;
  }
}

/* First-time onboarding stays inside the existing authenticated local session. */
.auth-layout select {
  width: 100%;
  display: block;
  min-height: 44px;
  border: 1px solid #dce5e2;
  border-radius: 6px;
  margin-top: 6px;
  padding: 10px;
  background: #fff;
  color: #29433c;
}
#company-setup-panel .setup-disclaimer {
  font-size: 11px;
  margin: 20px 0 0;
  color: #74877f;
}
#company-setup-panel #setup-back {
  background: transparent;
  color: #255f50;
  border: 0;
  min-height: 38px;
  font-weight: 650;
  margin-top: 6px;
}
#company-setup-panel #create-company[disabled] {
  opacity: 0.55;
  cursor: wait;
}
/* Review-only bank matches and category insights, no ledger posting. */
.bank-review-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.bank-review-actions button {
  background: #f1f7f4;
  border: 1px solid #c6ded2;
  border-radius: 6px;
  color: #176451;
  font-weight: 650;
  font-size: 11px;
  padding: 7px 9px;
  cursor: pointer;
}
.bank-review-actions button:hover {
  background: #e1f2eb;
}
.bank-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.bank-category-item {
  border: 1px solid #e1e9e5;
  border-radius: 7px;
  padding: 13px 14px;
  background: #fff;
}
.bank-category-item span {
  color: #66807a;
  display: block;
  font-size: 11px;
  margin-bottom: 7px;
}
.bank-category-item strong {
  font-size: 18px;
  color: #153c33;
}
.bank-category-item small {
  display: block;
  color: #6c817b;
  font-size: 10px;
  margin-top: 5px;
}
.bank-reconciliation-note {
  font-size: 11px;
  color: #697c77;
  margin: 10px 0;
  line-height: 1.6;
}
.bank-review-confirmed {
  color: #136e53;
  font-weight: 750;
  font-size: 12px;
}

.bank-period-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 6px;
  font-size: 12px;
  font-weight: 650;
  color: #36544c;
}
.bank-period-control select {
  border: 1px solid #dbe6e1;
  border-radius: 7px;
  background: #fff;
  min-height: 36px;
  padding: 6px 12px;
  color: #143c33;
}
.bank-category-section {
  margin: 15px 0;
}
.bank-category-section .panel-head {
  padding-bottom: 10px;
}
#advisor-bank-items .advisor-item {
  margin-bottom: 8px;
  text-align: left;
}
#advisor-bank-items .advisor-item span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#advisor-bank-items .advisor-item small {
  color: #6b807b;
  line-height: 1.5;
}
/* Email invoice collection — consistent finance-first controls. */
#view-emailbills .bank-layout {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}
#email-source-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #4e6762;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}
#email-source-form input,
#email-source-form select,
#email-brand-form input {
  box-sizing: border-box;
  width: 100%;
  background: #fff;
  border: 1px solid #dbe4e2;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  color: #193a33;
  font: inherit;
  font-size: 13px;
}
#email-source-form input:focus,
#email-source-form select:focus,
#email-brand-form input:focus {
  border-color: #27846d;
  outline: 2px solid #d8ede6;
  outline-offset: 1px;
}
#email-brand-select {
  max-width: 100%;
}
#email-source-form button {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}
#view-emailbills .advisor-items {
  min-height: 160px;
  align-content: start;
}
#view-emailbills .advisor-items button {
  font-size: 11px;
  margin-top: 7px;
  border-radius: 6px;
  padding: 8px 12px;
}
#view-emailbills .advisor-items strong {
  overflow-wrap: anywhere;
}
#email-brand-form input {
  min-width: 190px;
  flex: 1;
}
#email-brand-form button {
  flex: 0 0 auto;
}
#view-emailbills details summary {
  font-size: 12px;
  cursor: pointer;
  color: #1d6d58;
  font-weight: 650;
}
#view-emailbills #email-state {
  padding: 13px 0;
  line-height: 1.6;
}
@media (max-width: 920px) {
  #view-emailbills .bank-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  #view-emailbills .page-heading {
    gap: 14px;
  }
  #view-emailbills .panel-head {
    padding: 16px 17px;
  }
  #view-emailbills .advisor-items {
    min-height: 85px;
    padding: 12px 16px;
  }
  #email-source-form {
    padding: 15px 17px !important;
  }
}

/* Keep Gmail authorization feedback immediately adjacent to the relevant inbox. */
.email-connection-status {
  padding: 12px 16px;
  background: #eef5f2;
  color: #254d43;
  border: 1px solid #d3e3dc;
  border-radius: 10px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
}
.email-action-feedback {
  font-size: 14px;
  line-height: 1.5;
  margin: 10px 0 0;
  color: #34564e;
  max-width: 70ch;
}
.email-action-feedback:empty {
  display: none;
}
.email-action-feedback.is-error {
  background: #fff1ed;
  border: 1px solid #f1c2b8;
  padding: 12px 14px;
  border-radius: 8px;
  color: #9d3028;
}
/* Invoice evidence review stays compact and scrolls within narrow layouts. */
.invoice-review-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  background: #f6f9f8;
  border: 1px solid #dbe5e1;
  border-radius: 9px;
}
.invoice-review-form > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}
.invoice-review-form input:not([type='checkbox']) {
  max-width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid #ccdcd7;
  border-radius: 6px;
}
.invoice-review-form fieldset {
  grid-column: 1/-1;
  border: 1px solid #d4e2dd;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}
.invoice-review-form fieldset label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}
.invoice-review-form > strong,
.invoice-review-form > p,
.invoice-review-form > button,
.invoice-review-form > label:has(input[type='checkbox']) {
  grid-column: 1/-1;
}
@media (max-width: 650px) {
  .invoice-review-form,
  .invoice-review-form fieldset {
    grid-template-columns: 1fr;
  }
}

/* SAWMBooks document workflow & linked accounting summaries */
.metric-link,
.invoice-kpi {
  cursor: pointer;
  transition:
    box-shadow 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.metric-link:hover,
.invoice-kpi:hover {
  border-color: #8eb7aa;
  box-shadow: 0 4px 16px #153a2c16;
}
.metric-link:focus-visible,
.invoice-kpi:focus-visible {
  outline: 3px solid #87c7b4;
  outline-offset: 2px;
}
.metric-link::after {
  content: 'View details →';
  display: block;
  font-size: 11px;
  color: #176750;
  margin-top: 10px;
  font-weight: 700;
}
.document-detail {
  margin: 0 21px 15px;
  border: 1px solid #b6d6cb;
  border-radius: 10px;
  padding: 17px;
  background: #f6faf8;
}
.document-detail h3 {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.document-explanation {
  font-size: 12px;
  line-height: 1.65;
  color: #4d6561;
  margin: 12px 0;
}
.document-detail button {
  margin: 8px 8px 0 0;
}
.invoice-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
}
.invoice-kpi {
  min-width: 0;
  text-align: left;
  border: 1px solid #dce6e2;
  border-radius: 10px;
  background: white;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: #304946;
}
.invoice-kpi span {
  font-size: 12px;
  font-weight: 650;
}
.invoice-kpi strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.invoice-kpi small {
  color: #627c77;
  font-size: 11px;
  line-height: 1.4;
}
.invoice-summary-caveat,
.invoice-evidence-summary {
  font-size: 12px;
  line-height: 1.55;
  color: #55736b;
  margin: 12px 0 16px;
}
.invoice-evidence-summary {
  padding: 11px;
  background: #f5f9f7;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
@media (max-width: 1150px) {
  .invoice-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .invoice-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .invoice-kpi {
    padding: 12px;
  }
  .invoice-kpi strong {
    font-size: 19px;
  }
}
/* SAWM Advisor: evidence-backed question and answer panel */
.advisor-ask-panel {
  margin-bottom: 20px;
}
.advisor-ask-inner {
  padding: 2px 22px 22px;
}
.advisor-data-banner {
  background: #ecf4f1;
  color: #28554c;
  border: 1px solid #d5e4df;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.advisor-question-form label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 650;
  color: #203934;
}
.advisor-question-row {
  display: flex;
  gap: 9px;
  align-items: stretch;
}
.advisor-question-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
}
.advisor-question-row button {
  flex-shrink: 0;
  white-space: nowrap;
}
.advisor-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.advisor-suggestions button {
  font-size: 13px;
  padding: 9px 12px;
}
.advisor-answer-thread {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}
.advisor-answer-card {
  border: 1px solid #dce6e3;
  border-radius: 12px;
  background: #fbfdfc;
  padding: 18px 20px;
}
.advisor-user-query {
  margin: 0 0 10px;
  font-weight: 650;
  font-size: 12px;
  color: #30735d;
}
.advisor-answer-card h3 {
  font-size: 18px;
  margin: 4px 0 10px;
}
.advisor-answer-card h4 {
  font-size: 13px;
  margin: 16px 0 8px;
}
.advisor-answer-text {
  white-space: pre-wrap;
  line-height: 1.65;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
}
.advisor-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.advisor-source-link {
  font-size: 13px;
  text-align: left;
  background: #fff;
  border: 1px solid #cedbd7;
  border-radius: 8px;
  padding: 10px 12px;
  color: #145c4a;
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.advisor-source-link:hover,
.advisor-source-link:focus-visible {
  border-color: #176d55;
  outline-offset: 2px;
  background: #edf7f3;
}
.advisor-answer-note {
  color: #647b76;
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.5;
}
#advisor-ask-status.error {
  color: #9e3028;
}
.bank-evidence-highlight {
  outline: 3px solid #137b5a;
  outline-offset: -3px;
  background: #e8f6ef !important;
}
@media (max-width: 600px) {
  .advisor-ask-inner {
    padding: 2px 14px 18px;
  }
  .advisor-question-row {
    flex-direction: column;
  }
  .advisor-question-row button {
    width: 100%;
  }
  .advisor-answer-card {
    padding: 14px;
  }
  .advisor-suggestions button {
    flex: 1 1 auto;
  }
}

.receipt-preview object {
  width: 100%;
  height: 540px;
  border: 0;
}
.invoice-review-form select {
  width: 100%;
  min-width: 0;
}
.invoice-review-line {
  min-width: 0;
}
.advisor-answer-text,
.bank-alert-list-item {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .receipt-preview object {
    height: 420px;
  }
  .sidebar-bottom small {
    font-size: 10px;
  }
}

.receipt-preview canvas {
  max-width: 100%;
  height: auto;
  background: white;
}
.pdf-page-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
}
.pdf-page-controls button {
  font-size: 11px;
  padding: 7px;
}
.pdf-page-controls span {
  font-size: 12px;
}

.table-toolbar {
  flex-wrap: wrap;
}
.table-toolbar .search-control {
  min-width: 0;
}
.table-footer {
  flex-wrap: wrap;
  gap: 10px;
}
