:root {
  --app-header-height: 56px;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #121420;
  --muted: #4a4f63;
  --line: #dfe3ec;
  --accent: #1b8f2f;
  --accent-strong: #177a28;
  --danger: #d32020;
  --blue: #1534b7;
  --shadow: 0 8px 18px rgba(18, 20, 32, 0.06);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

.legal-page-body {
  min-height: 100vh;
  background: var(--bg);
}

.legal-page-shell {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1040px;
  padding: 24px;
}

.legal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.public-page-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.public-page-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.public-page-nav a {
  border-radius: 7px;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 10px;
  text-decoration: none;
}

.public-page-nav a:hover,
.public-page-nav a.active {
  background: #eaf6ff;
  color: #005f95;
}

.public-page-nav .public-page-signin {
  border: 1px solid #a9d7ff;
  color: #005f95;
}

.legal-page-panel {
  display: grid;
  gap: 10px;
  max-width: none;
}

.legal-page-panel h1 {
  margin-bottom: 4px;
}

.legal-page-panel h2 {
  margin-top: 14px;
}

.legal-page-panel p {
  color: #334155;
  line-height: 1.55;
  margin: 0;
}

.legal-updated {
  color: #64748b !important;
  font-size: 0.86rem;
}

@media (max-width: 620px) {
  .legal-page-shell {
    padding: 16px;
  }

  .legal-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-page-nav {
    justify-content: flex-start;
    width: 100%;
  }
}

.analytics-page {
  gap: 18px;
}

.analytics-progress-card {
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.analytics-progress-card .home-agent-progress {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 22px;
  row-gap: 8px;
}

.analytics-progress-card .home-agent-progress-head {
  grid-column: 1;
  grid-row: 1;
}

.analytics-progress-card .home-progress-track {
  grid-column: 1;
  grid-row: 2;
}

.analytics-progress-card .home-status-head {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  white-space: nowrap;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.analytics-grid > .panel {
  border-radius: 12px;
}

.analytics-overview-card {
  grid-column: 1 / -1;
  background: #ffffff;
}

.analytics-overview-card .home-agent-summary {
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid #cfe2f3;
  border-radius: 0;
  background: #ffffff;
}

.analytics-overview-card .home-check-list li {
  border: 1px solid #d9eee0;
  border-radius: 8px;
  background: #f5fbf7;
  padding: 10px;
}

@media (max-width: 900px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-overview-card {
    grid-column: 1;
  }
}

@media (max-width: 620px) {
  .analytics-progress-card .home-agent-progress {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .analytics-progress-card .home-agent-progress-head,
  .analytics-progress-card .home-progress-track,
  .analytics-progress-card .home-status-head {
    grid-column: 1;
    grid-row: auto;
  }

  .analytics-progress-card .home-status-head {
    justify-content: flex-start;
  }
}

html {
  font-size: 90%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "Helvetica Neue", Arial, Helvetica, sans-serif;
}

body.books-app {
  background: #fafaf8;
}

button,
input,
select {
  font: inherit;
}

.login-page {
  min-height: 100vh;
  background: var(--bg);
}

.login-top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 18px clamp(18px, 4vw, 42px);
}

.login-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--blue);
  font-weight: 600;
  padding: 9px 14px;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(7, 12, 41, 0.12);
}

.login-nav-link:hover {
  background: #ffffff;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px 16px;
}

.login-card {
  width: min(470px, 100%);
  background: #f6f8fc;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 22px;
  box-shadow: 0 22px 50px rgba(7, 12, 41, 0.22);
  padding: 24px;
}

.login-eyebrow,
.eyebrow {
  margin: 0 0 6px;
  color: #2b806b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.login-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.book-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #103b32;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-logo.small {
  width: 42px;
  height: 42px;
}

.book-logo.small {
  width: 34px;
  height: 34px;
  font-size: 0.86rem;
}

.login-title {
  margin: 0;
  font-size: 1.95rem;
  color: #0f6e58;
}

.login-subtitle {
  margin: 10px 0 18px;
  color: #2b6b5d;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-text-link {
  justify-self: end;
  border: 0;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 2px 0 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-text-link:hover {
  color: #111827;
}

.login-register-prompt {
  margin: 8px 0 -3px;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}

.auth-card-view[hidden] {
  display: none;
}

.registration-success-card {
  display: grid;
  gap: 14px;
  color: #475569;
  line-height: 1.5;
}

.registration-success-card p {
  margin: 0;
}

.registration-success-card strong {
  color: #111827;
  overflow-wrap: anywhere;
}

.registration-success-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e6f7eb;
  color: var(--accent-strong);
  font-size: 1.55rem;
}

.login-field {
  display: grid;
  gap: 7px;
  color: #16644f;
  font-weight: 700;
}

.registration-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.registration-terms input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent-strong);
}

.registration-terms a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-field input,
.form-grid input,
.form-grid select,
.journal-form input,
.journal-form select {
  width: 100%;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: #111827;
  font-weight: 400;
  outline: none;
}

.login-field input {
  border: 1.6px solid #5976d8;
  background: #ecf3ff;
}

.login-field input:focus,
.form-grid input:focus,
.form-grid select:focus,
.journal-form input:focus,
.journal-form select:focus {
  border-color: #224fd6;
  box-shadow: 0 0 0 3px rgba(50, 104, 232, 0.16);
}

.password-row {
  position: relative;
  display: flex;
  align-items: center;
}

.password-row input {
  padding-right: 42px;
}

.password-eye {
  position: absolute;
  right: 12px;
  color: #1a7f63;
  pointer-events: none;
}

.password-toggle {
  position: absolute;
  right: 5px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 1.12rem;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #e9edf2;
  color: #111827;
  outline: none;
}

.login-btn,
.primary-btn,
.danger-btn,
.secondary-login-btn,
.secondary-btn,
.icon-text-btn,
.table-btn,
.tab-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.login-btn {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 700;
  padding: 10px 14px;
}

.primary-btn {
  min-height: 50px;
  border-color: #d9dee7;
  border-radius: 16px;
  background: #ffffff;
  color: #172033;
  font-weight: 500;
  padding: 11px 14px;
}

.primary-btn:hover {
  border-color: #b8c0cc;
  background: #f5f6f8;
  color: #172033;
}

.primary-btn.save-changes-btn {
  border-color: rgba(27, 143, 47, 0.28);
  background: #e6f7eb;
  color: var(--accent-strong);
}

.primary-btn.save-changes-btn:hover {
  border-color: rgba(27, 143, 47, 0.48);
  background: #dcfce7;
  color: var(--accent-strong);
}

.danger-btn {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
  font-weight: 700;
  padding: 10px 14px;
}

.login-btn {
  margin-top: 8px;
  border-radius: 999px;
  background: #111827;
  border-color: #111827;
  color: #ffffff;
  font-size: 1.14rem;
}

.login-btn:hover {
  border-color: #2f3744;
  background: #2f3744;
  color: #ffffff;
}

.login-btn:disabled {
  border-color: #cbd5e1;
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.secondary-login-btn,
.secondary-btn,
.icon-text-btn,
.table-btn,
.tab-btn,
.export-btn {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line);
  font-weight: 700;
  padding: 9px 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.export-btn {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  color: #075985;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
}

.export-btn:hover {
  border-color: #93c5fd;
  background: #e0f2fe;
}

.is-loading {
  cursor: wait;
  opacity: 0.82;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  animation: spin 0.7s linear infinite;
}

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

.bank-reconciliation-progress {
  width: min(420px, calc(100% - 32px));
  box-sizing: border-box;
  padding: 28px;
  border: 1px solid #d9dee7;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  text-align: center;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

.bank-reconciliation-progress::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.bank-reconciliation-progress .button-spinner {
  width: 30px;
  height: 30px;
  border-width: 3px;
  color: #168a3a;
}

.bank-reconciliation-progress h2 {
  margin: 18px 0 12px;
  font-size: 1.2rem;
  line-height: 1.4;
}

.bank-reconciliation-progress p {
  margin: 12px 0 0;
  color: #526174;
  line-height: 1.5;
}

.bank-reconciliation-progress progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 18px;
  accent-color: #168a3a;
}

#bankReconciliationProgressNote {
  font-size: 0.85rem;
}

.secondary-login-btn {
  border-radius: 999px;
}

.auth-message {
  min-height: 22px;
  color: #176b50;
  margin: 4px 0 0;
}

.auth-message.error {
  color: var(--danger);
}

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  border: 1px solid #d7dde6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  padding: 15px 16px;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner strong {
  display: block;
  margin-bottom: 3px;
  color: #111827;
  font-size: 0.96rem;
}

.cookie-banner p {
  margin: 0;
  color: #5b6677;
  font-size: 0.84rem;
  line-height: 1.45;
}

.cookie-banner a {
  color: #111827;
  font-weight: 600;
}

.cookie-banner button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid #111827;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  padding: 9px 18px;
}

.cookie-banner button:hover {
  border-color: #2f3744;
  background: #2f3744;
}

@media (max-width: 620px) {
  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .cookie-banner button {
    width: 100%;
  }
}

.layout-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.global-sidebar {
  background: #fafafa;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  position: sticky;
  top: var(--app-header-height);
  margin-top: var(--app-header-height);
  height: calc(100vh - var(--app-header-height));
  overflow-y: auto;
  z-index: 10;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.app-side-nav {
  display: grid;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #000000;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  font-size: 1rem;
  font-weight: 400;
  border: 1px solid transparent;
}

.side-link .bi {
  font-size: 18px;
  color: inherit;
  flex: 0 0 auto;
}

.side-link:hover {
  background: #eeeeee;
  color: #000000;
}

.side-link.active {
  background: #eeeeee;
  color: #000000;
  border-color: #eeeeee;
}

.side-link.active .bi {
  color: inherit;
}

.side-link:focus-visible {
  outline: 2px solid #171717;
  outline-offset: -2px;
}

.content-shell {
  padding: var(--app-header-height) 0 16px;
}

/* Wide tables should scroll inside their panels, not widen the page. */
.content-shell,
.app-shell,
.page-section,
.sub-view,
.panel,
.filter-panel,
.table-wrap,
.standard-page-header-card,
.open-report-header-card,
.form-grid > label {
  min-width: 0;
}

.app-shell {
  max-width: 1540px;
  margin: 0 auto;
  padding: 22px 11px 36px;
}

.app-shell:has(#reports.active-page #reportsReportView:not([hidden])) {
  max-width: none;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}

.app-shell:has(.page-section.active-page > .standard-page-header-card),
.app-shell:has(.page-section.active-page > .sub-view:not([hidden]) > .standard-page-header-card) {
  max-width: none;
  padding-top: 0;
  padding-left: 11px;
  padding-right: 11px;
}

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-header-height);
  padding: 8px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.app-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #212F3D;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

.app-topbar-brand .brand-logo {
  width: 34px;
  height: 34px;
}

@media (max-width: 480px) {
  .app-topbar-brand span {
    display: none;
  }
}

.topbar-business-name {
  max-width: min(320px, 35vw);
  min-width: 0;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 500;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-topbar-user {
  position: relative;
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.topbar-icon-btn,
.account-menu-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.topbar-icon-btn .bi,
.account-menu-btn .bi {
  font-size: 20px;
}

.topbar-icon-btn:hover,
.account-menu-btn:hover,
.account-menu-btn[aria-expanded="true"] {
  background: #eff6ff;
}

#accountMenuBtn {
  background: transparent;
  color: var(--accent-strong);
}

#accountMenuBtn:hover,
#accountMenuBtn[aria-expanded="true"] {
  background: transparent;
}

.topbar-tools-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid #bfe7cc;
  border-radius: 999px;
  background: #ecfbf1;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.topbar-tools-btn:hover {
  background: #dcf7e5;
}

.subscriptions-page .page-title-row {
  margin-bottom: 18px;
}

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.subscription-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid #d9dde3;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
}

.subscription-card-top {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 270px;
  padding: 24px;
}

.subscription-card-top > .status-pill {
  justify-self: start;
}

.subscription-tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef2f5;
  color: #111827;
  font-size: 1.15rem;
}

.subscription-tool-icon.capture {
  overflow: hidden;
  background: #ffffff;
}

.subscription-tool-icon.capture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.subscription-tool-icon.invoice {
  overflow: hidden;
  background: #ffffff;
}

.subscription-tool-icon.invoice img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.subscription-tool-icon.bank-feed {
  background: #e6f7eb;
  color: #168a3a;
}

.subscription-tool-icon.ai {
  background: #ede9fe;
  color: #7c3aed;
}

.subscription-tool-icon.books {
  overflow: hidden;
  background: #ffffff;
}

.subscription-tool-icon.books img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.subscription-store-badge {
  justify-self: start;
  width: 180px;
  max-width: 100%;
}

.subscription-store-badge img {
  display: block;
  width: 100%;
  height: auto;
}

.subscription-card-with-store {
  grid-template-rows: auto 1fr auto;
}

.subscription-card-store {
  display: grid;
  padding: 0 24px 24px;
  background: #f7f7f8;
}

.mobile-books-tool-card .subscription-card-store {
  gap: 8px;
}

.mobile-books-tool-card .mobile-books-subscribed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  border-color: #d7dbe1;
  color: #111111;
  opacity: 1;
  cursor: default;
}

.mobile-books-tool-card .mobile-books-subscribed .bi {
  color: #168a3a;
}

.subscription-mobile-availability {
  margin: 0;
  color: #667085;
  font-size: 0.8rem;
  line-height: 1.4;
}

.subscription-card h2 {
  margin: 0;
  color: #111827;
  font-size: 1.22rem;
  font-weight: 600;
}

.subscription-tool-description {
  margin: -5px 0 0;
  color: #667085;
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.45;
}

.subscription-price {
  display: grid;
  gap: 4px;
}

.subscription-price strong {
  color: #111827;
  font-size: 1.55rem;
  font-weight: 600;
}

.subscription-price span {
  color: #7a7f88;
  font-size: 0.86rem;
}

.subscription-card button {
  min-height: 48px;
  align-self: end;
  margin-top: auto;
  border: 1px solid #d7dbe1;
  border-radius: 12px;
  background: #f6f7f8;
  color: #7a7f88;
  cursor: not-allowed;
  font-weight: 600;
}

.subscription-card ul {
  display: grid;
  align-content: start;
  gap: 15px;
  margin: 0;
  padding: 22px 24px 26px;
  background: #f7f7f8;
  list-style: none;
}

.subscription-card .capture-billing-button {
  color: #ffffff;
  background: #168a3a;
  border-color: #168a3a;
  cursor: pointer;
}
.subscription-card .capture-billing-button[data-action="subscribe"]:hover:not(:disabled) {
  background: #11722f;
  border-color: #11722f;
}

:is(#captureSubscribeBtn, #invoiceSubscribeBtn)[data-action="subscribe"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

:is(#captureSubscribeBtn, #invoiceSubscribeBtn)[data-action="subscribe"]:hover:not(:disabled) {
  background: #292929;
  border-color: #292929;
}
.subscription-card .capture-billing-button[data-action="cancel"] {
  background: #b42318;
  border-color: #b42318;
  color: #ffffff;
}
.subscription-card .capture-billing-button[data-action="cancel"]:hover:not(:disabled) {
  background: #912018;
  border-color: #912018;
}
.subscription-card .capture-billing-button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.capture-billing-status {
  margin: 0;
  font-size: 0.86rem;
  color: #667085;
}
.capture-billing-status[data-error="true"] { color: #b42318; }
.capture-billing-status[data-active="true"] {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #168a3a;
  font-weight: 600;
}
.capture-billing-status[data-active="true"] .bi {
  flex: 0 0 auto;
}
.subscription-card .capture-billing-retry {
  margin: 0;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
}
.subscription-card [hidden] { display: none; }

.subscription-cancel-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 24px 60px rgba(18, 20, 32, 0.24);
}
.subscription-cancel-dialog::backdrop { background: rgba(18, 20, 32, 0.48); }
.subscription-cancel-dialog .modal-panel {
  width: 100%;
  border-radius: 24px;
  padding: 28px;
  box-shadow: none;
}
.subscription-cancel-description {
  margin: 0;
  color: #667085;
  font-size: 0.94rem;
  line-height: 1.6;
}
.subscription-cancel-dialog h2 {
  margin: 20px 0 0;
  color: #111111;
  font-size: 1.4rem;
  line-height: 1.3;
}
#subscriptionCancelTitle { margin: 0 0 16px; }
.subscription-cancel-description strong { font-weight: 700; }
.subscription-cancel-dialog .modal-actions {
  margin-top: 28px;
  flex-wrap: wrap;
}
.subscription-cancel-help {
  margin: 18px 0 0;
  color: #667085;
  font-size: 0.82rem;
  line-height: 1.5;
}
.subscription-cancel-help a {
  color: #168a3a;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#subscriptionCancelModal .subscription-cancel-close {
  background: #ffffff;
  border-color: #d0d5dd;
  color: #111111;
}
#subscriptionCancelModal .subscription-cancel-confirm {
  background: #b42318;
  border-color: #b42318;
  color: #ffffff;
}
#subscriptionCancelModal .subscription-cancel-confirm:hover {
  background: #912018;
  border-color: #912018;
}

.subscription-success-dialog .modal-panel {
  position: relative;
  padding: 40px 28px 32px;
  text-align: center;
}
.subscription-success-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.subscription-success-close .icon-only-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #667085;
}
.subscription-success-tick {
  display: inline-block;
  color: #168a3a;
  font-size: 2.75rem;
  line-height: 1;
}
.subscription-success-dialog h2 { margin: 16px 0 12px; }

.subscription-card li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  color: #22252b;
  font-size: 0.9rem;
  line-height: 1.4;
}

.subscription-card li .bi {
  color: #168a3a;
  font-size: 1rem;
}

.capture-subscription-card li .bi {
  color: #168a3a;
}

@media (min-width: 1600px) {
  .subscription-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .subscription-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .subscription-grid {
    grid-template-columns: 1fr;
  }

  .subscription-card-top {
    min-height: 0;
  }
}

.notification-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #d32020;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 4px;
}

.topbar-icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  z-index: 90;
  transform: translateX(-50%);
  border-radius: 6px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1;
  opacity: 0;
  padding: 6px 8px;
  pointer-events: none;
  white-space: nowrap;
}

.topbar-icon-btn[data-tooltip]:hover::after,
.topbar-icon-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  padding: 6px;
}

.account-menu[hidden] {
  display: none;
}

.notifications-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 86px;
  width: min(380px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  z-index: 80;
}

.notifications-menu[hidden] {
  display: none;
}

.notifications-menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding: 13px 14px;
}

.notifications-menu-header strong {
  display: block;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 600;
}

.notifications-menu-header span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 0.78rem;
}

.notifications-list {
  max-height: 360px;
  overflow: auto;
}

.notification-item {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid #edf2f7;
  padding: 12px 14px;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.unread {
  background: #f0f9ff;
}

.notification-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #0f172a;
  font-weight: 600;
}

.notification-title i {
  color: #005f95;
}

.notification-item p {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.42;
}

.notification-meta,
.notification-empty {
  color: #64748b;
  font-size: 0.78rem;
}

.notification-empty {
  padding: 18px 14px;
}

.account-menu-email {
  max-width: 260px;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 400;
  margin: 0 4px 5px;
  padding: 8px 6px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  font-weight: 400;
  padding: 9px 10px;
  text-align: left;
}

.account-menu-item:hover {
  background: #eff6ff;
  color: #0f5f95;
}

.page-section {
  display: none;
}

.page-section.active-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.page-title-row,
.panel-title-row,
.journal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#vatReturnDetailView > .page-title-row {
  margin-bottom: 10px;
}

#vatReturnDetailView > .panel + .panel {
  margin-top: 10px;
}

#vatReturnsListView > .page-title-row {
  margin-bottom: 12px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 1.75rem;
}

.page-subtitle {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 0.92rem;
  font-weight: 400;
}

h2 {
  font-size: 1.05rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.metric-card strong {
  font-size: 1.5rem;
}

.metric-card-link {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #0f5f95;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  padding: 0;
}

.metric-card-link:hover {
  text-decoration: underline;
}

.panel {
  padding: 14px;
}

.panel-subtitle {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 400;
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.home-title-row {
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
}

.page-title-row .home-main-title {
  width: 100%;
  color: #000000;
  text-align: center;
}

.home-header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-progress-card {
  width: 75%;
  margin: 0 auto;
  padding: 20px 24px;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.home-agent-card,
.home-attention-hub,
.home-overview-hub {
  grid-column: 1 / -1;
}

.home-agent-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(190px, 260px);
  align-items: center;
  gap: 16px;
  border-color: #cfe2f3;
  background: #f7fbff;
  padding: 18px 20px;
}

.home-agent-copy {
  display: grid;
  gap: 4px;
}

.compact-action-btn.home-header-action-btn {
  min-height: 50px;
  border-color: #d9dee7;
  border-style: solid;
  border-width: 1px;
  border-radius: 16px;
  background: #ffffff;
  color: #172033;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 600;
}

.compact-action-btn.home-header-action-btn:hover {
  border-color: #b8c0cc;
  background: #f5f6f8;
  color: #172033;
}

#homeAssistantQuestionBtn .bi {
  color: #7c3aed;
}

body.ask-ursa-open {
  overflow: hidden;
}

.ask-ursa-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(15, 23, 42, 0.28);
}

.ask-ursa-backdrop[hidden] {
  display: none;
}

.ask-ursa-drawer {
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(430px, calc(100vw - 18px));
  height: 100dvh;
  margin-left: auto;
  border-left: 1px solid #dbe4ee;
  background: #ffffff;
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.16);
  animation: ask-ursa-slide-in 0.2s ease-out;
}

.ask-ursa-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px;
}

.ask-ursa-drawer-header h2,
.ask-ursa-drawer-header p {
  margin: 0;
}

.ask-ursa-drawer-body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: #f8fafc;
}

.ask-ursa-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 320px;
  text-align: center;
}

.ask-ursa-placeholder p {
  margin: 0;
  color: #526176;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.55;
}

.ask-ursa-promo-card {
  width: 100%;
  max-width: 360px;
  padding: 20px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  text-align: left;
}

.ask-ursa-promo-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #ede9fe;
  color: #6d28d9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.ask-ursa-promo-card h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 1.05rem;
}

.ask-ursa-promo-card p {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.55;
}

.ask-ursa-promo-card .compact-action-btn {
  width: 100%;
  justify-content: center;
  border-color: #d9dee7;
  background: #ffffff;
  color: #111827;
}

.ask-ursa-coming-soon {
  display: inline-flex;
  align-items: center;
  border: 1px solid #b7dfc3;
  border-radius: 999px;
  background: #e6f7eb;
  color: #176b32;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
}

@keyframes ask-ursa-slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.home-agent-copy h2,
.home-agent-copy p {
  margin: 0;
}

.home-agent-copy h2 {
  color: #172033;
  font-size: 1.05rem;
  font-weight: 500;
}

.home-agent-copy > p:not(.home-books-date) {
  color: #526176;
  font-size: 0.9rem;
}

.home-agent-progress {
  display: grid;
  gap: 8px;
}

.home-agent-progress .home-status-head {
  justify-content: flex-end;
}

.home-agent-progress .home-status-head strong {
  font-size: 1.55rem;
}

.home-attention-hub,
.home-overview-hub {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.home-attention-hub {
  border-color: #e2e8f0;
  background: #ffffff;
}

.home-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-section-heading h2,
.home-section-heading p,
.home-auto-summary h3,
.home-auto-summary p,
.home-outstanding-block h3,
.home-outstanding-block p {
  margin: 0;
}

.home-section-heading h2 {
  color: #172033;
  font-size: 1.08rem;
  font-weight: 550;
}

.home-section-heading p,
.home-auto-summary p,
.home-outstanding-block p {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.84rem;
}

.home-section-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.home-section-heading.attention .home-section-icon {
  background: #ffedd5;
  color: #c2410c;
}

.home-section-heading.overview .home-section-icon {
  background: #e6f7eb;
  color: var(--accent-strong);
}

.home-section-heading.quick-add .home-section-icon {
  background: #e0f2fe;
  color: #075985;
}

.home-quick-add-card {
  display: block;
  padding: 14px;
}

.home-quick-add-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.home-quick-add-btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  border: 1px solid #b7dfc3;
  border-radius: 8px;
  background: #e6f7eb;
  color: #176b32;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.home-quick-add-btn:hover {
  border-color: #8fcea2;
  background: #d8f1df;
}

.home-quick-add-btn > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 1.1rem;
}

.home-quick-add-btn.sale > span:first-child {
  background: #ccebd5;
  color: #176b32;
}

.home-quick-add-btn.expense > span:first-child {
  background: #ccebd5;
  color: #176b32;
}

.home-quick-add-btn.bank {
  border-color: #bfdbfe;
  background: #eaf6ff;
  color: #075985;
}

.home-quick-add-btn.bank:hover {
  border-color: #93c5fd;
  background: #dcefff;
}

.home-quick-add-btn.bank > span:first-child {
  background: #d3ebfb;
  color: #075985;
}

.home-quick-add-btn.bank small {
  color: #4f7188;
}

.home-quick-add-btn > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.home-quick-add-btn strong {
  font-size: 0.98rem;
  font-weight: 550;
}

.home-quick-add-btn small {
  color: #467357;
  font-size: 0.8rem;
  font-weight: 400;
}

.home-attention-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.home-attention-column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.home-attention-list {
  min-width: 0;
  padding-top: 14px;
}

.home-attention-list {
  display: grid;
  align-content: start;
  gap: 14px;
}

.home-attention-list .home-task-list li {
  border-bottom: 0;
}

.home-fix-btn {
  min-width: 54px;
  border: 1px solid #cfd6df;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.home-fix-btn:hover {
  border-color: #9aa5b3;
  background: #f5f6f8;
}

.home-outstanding-block {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.home-outstanding-block .home-outstanding-grid {
  grid-template-columns: 1fr;
  padding-top: 14px;
}

.home-outstanding-heading-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-outstanding-heading-title > span {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #e6f7eb;
  color: #168a3a;
  font-size: 1rem;
}

.home-overview-hub {
  background: #ffffff;
}

.home-summary-card .home-agent-summary {
  grid-column: auto;
  grid-template-columns: 1fr;
  margin: -20px -20px 0;
  border-bottom: 1px solid #cfe2f3;
  border-radius: 7px 7px 0 0;
}

.home-summary-card .home-agent-progress {
  width: 100%;
}

.home-agent-progress-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.home-agent-progress-head .home-books-date {
  margin: 0;
}

.home-auto-summary {
  display: grid;
  grid-template-columns: minmax(180px, 0.4fr) minmax(0, 1.6fr);
  gap: 18px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.home-auto-summary h3,
.home-outstanding-block h3 {
  color: #273244;
  font-size: 0.94rem;
  font-weight: 550;
}

.home-auto-summary .home-check-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-auto-summary .home-check-list li {
  border: 1px solid #d9eee0;
  border-radius: 8px;
  background: #f5fbf7;
  padding: 10px;
}

.home-status-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
}

.home-financial-year-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.home-outstanding-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.home-outstanding-help .header-help-tooltip {
  top: auto;
  bottom: calc(100% + 8px);
  right: 0;
  left: auto;
}

.home-outstanding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-outstanding-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.home-outstanding-item:hover {
  border-color: #9aa5b3;
  background: #f5f6f8;
}

.home-outstanding-item > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.home-outstanding-item small,
.home-outstanding-item em {
  color: #111827;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 400;
}

.home-outstanding-item strong {
  color: #111827;
  font-size: 1rem;
  font-weight: 500;
}

.home-outstanding-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1rem;
}

.home-outstanding-icon.sales {
  background: #eef2f5;
  color: #111827;
}

.home-outstanding-icon.expenses {
  background: #eef2f5;
  color: #111827;
}

.home-financial-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-financial-stats div {
  display: grid;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.home-financial-stats span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 500;
}

.home-financial-stats strong {
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 600;
}

.home-status-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #475569;
}

.home-status-head strong {
  color: #0f5f95;
  font-size: 2rem;
  font-weight: 600;
}

.home-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eef7;
}

.home-books-date {
  margin: -6px 0 0;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 400;
}

.home-progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f5f95, #168a3a);
}

.home-action-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 245px;
}

.home-attention-card {
  border-color: #fed7aa;
  background: #fff7ed;
  box-shadow: 0 8px 18px rgba(194, 65, 12, 0.08);
}

.home-auto-card {
  border-color: rgba(27, 143, 47, 0.24);
  background: #f1fbf4;
  box-shadow: 0 8px 18px rgba(27, 143, 47, 0.07);
}

.home-attention-card h2 {
  color: #c2410c;
}

.home-auto-card h2 {
  color: var(--accent-strong);
}

.home-attention-card .home-task-list li {
  border-bottom-color: #fed7aa;
}

.home-auto-card .home-check-list li {
  border-bottom-color: rgba(27, 143, 47, 0.2);
}

.home-check-list,
.home-task-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.home-check-list li,
.home-task-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: #273244;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.home-check-list i {
  color: #168a3a;
}

.home-task-list i {
  color: #0f5f95;
}

#homeBankUploadRange {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#homeBankUploadRange small {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.35;
}

.home-connect-bank-btn {
  justify-self: start;
}

.home-review-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.home-review-btn:hover {
  background: #d8efff;
  border-color: #93c5fd;
}

.home-check-list .home-review-btn {
  border-color: rgba(27, 143, 47, 0.22);
  background: #e6f7eb;
  color: var(--accent-strong);
}

.home-check-list .home-review-btn:hover {
  background: #dcfce7;
  border-color: rgba(27, 143, 47, 0.42);
}

.home-review-table-wrap {
  margin: 16px 0;
}

.home-notifications-card {
  grid-column: 1 / -1;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 245px;
}

.home-notifications-list {
  display: grid;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.home-notifications-list .notification-item {
  padding: 12px;
}

.home-notifications-list .notification-empty {
  padding: 16px 12px;
}

#homeReviewTable {
  min-width: 820px;
}

#homeReviewTable td,
#homeReviewTable th {
  white-space: normal;
}

#homeReviewTable td.money,
#homeReviewTable th.money {
  white-space: nowrap;
}

.dashboard-chart-card,
.dashboard-quick-card,
.dashboard-snapshot-card {
  min-height: 245px;
}

.dashboard-chart-card {
  display: flex;
  flex-direction: column;
}

.reconciliation-chart-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 22px;
}

.doughnut-chart {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.doughnut-chart::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.doughnut-chart span {
  position: relative;
  z-index: 1;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 600;
}

.chart-legend {
  display: grid;
  gap: 12px;
}

.chart-legend div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.chart-legend div:last-child {
  border-bottom: 0;
}

.chart-legend span,
.snapshot-list span {
  color: #475569;
  font-weight: 400;
}

.chart-legend strong,
.snapshot-list strong {
  color: #0f172a;
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-reconciled {
  background: #168a3a;
}

.legend-unreconciled {
  background: #0f5f95;
}

.bar-chart {
  min-height: 175px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.bar-chart-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 7px;
  text-align: center;
}

.bar-track {
  height: 118px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  overflow: hidden;
}

.bar-track span {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #168a3a 0%, #0f5f95 100%);
}

.bar-chart-item strong {
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 500;
}

.bar-chart-item small {
  color: #64748b;
  font-size: 0.74rem;
}

.analytics-month-chart.bar-chart {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 6px;
}

.analytics-month-chart .bar-chart-item {
  min-width: 0;
}

.analytics-month-chart .chart-amount-compact {
  display: none;
}

@media (max-width: 650px) {
  .analytics-month-chart .chart-amount-full {
    display: none;
  }

  .analytics-month-chart .chart-amount-compact {
    display: inline;
  }

  .analytics-month-chart .bar-chart-item strong {
    font-size: 0.7rem;
  }
}

.analytics-month-chart .bar-chart-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-month-chart .bar-chart-item small {
  min-height: 2.8em;
}

.analytics-month-chart .bar-track span {
  background: #168a3a;
}

.analytics-month-chart .analytics-expenses-track span {
  background: #297ba5;
}

.analytics-month-chart .analytics-signed-track {
  position: relative;
  display: block;
}

.analytics-signed-track::after {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #b8c2cc;
  content: "";
}

.analytics-month-chart .analytics-signed-track span {
  position: absolute;
  left: 0;
  border-radius: 3px;
}

.analytics-month-chart .bar-track .is-loss {
  background: #bf4b45;
}

.analytics-bank-balance-chart,
.analytics-expense-split-chart {
  margin-top: 18px;
  min-width: 0;
}

.analytics-chart-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.analytics-chart-summary span,
.analytics-expense-ring-total span {
  color: #64748b;
  font-size: 0.78rem;
}

.analytics-chart-summary strong {
  color: #111827;
  font-size: 1.15rem;
}

.analytics-line-plot {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  height: 170px;
}

.analytics-line-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 6px 2px 0;
  color: #64748b;
  font-size: 0.7rem;
}

.analytics-line-plot svg {
  width: 100%;
  height: 170px;
  overflow: visible;
}

.analytics-line-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.analytics-balance-line {
  fill: none;
  stroke: #208982;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.analytics-balance-point {
  fill: #208982;
  stroke: #ffffff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.analytics-line-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding-left: 54px;
  margin-top: 10px;
  gap: 4px;
}

.analytics-line-months > span {
  display: grid;
  min-width: 0;
  gap: 5px;
  text-align: center;
}

.analytics-line-months small {
  color: #64748b;
  font-size: 0.68rem;
}

.analytics-line-months strong {
  color: #111827;
  font-size: 0.68rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-expense-distribution {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 230px;
}

.analytics-expense-ring {
  position: relative;
  width: 160px;
  height: 160px;
  justify-self: center;
}

.analytics-expense-ring svg {
  display: block;
  width: 100%;
  height: 100%;
}

.analytics-expense-segment {
  transform: rotate(-90deg);
  transform-origin: 90px 90px;
}

.analytics-expense-ring-total {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.analytics-expense-ring-total strong {
  color: #111827;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.analytics-expense-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 250px;
  overflow-y: auto;
}

.analytics-expense-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 9px 0;
  font-size: 0.78rem;
}

.analytics-expense-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.analytics-expense-legend li > span:last-child {
  display: grid;
  gap: 3px;
  text-align: right;
}

.analytics-expense-legend strong {
  color: #111827;
  font-weight: 500;
  white-space: nowrap;
}

.analytics-expense-legend small {
  color: #64748b;
}

@media (max-width: 620px) {
  .analytics-expense-distribution {
    grid-template-columns: 1fr;
  }
}

.quick-report-list,
.snapshot-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.snapshot-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.snapshot-list div {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 74px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.quick-report-link {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #0f5f95;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 12px;
  text-align: left;
}

.quick-report-link span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.quick-report-link:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.home-grid > .dashboard-quick-card .quick-report-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.home-grid > .dashboard-quick-card .quick-report-link {
  width: auto;
  min-height: 50px;
  border-color: #d9dee7;
  border-radius: 16px;
  background: #ffffff;
  color: #172033;
  padding: 11px 14px;
  font-weight: 500;
}

.home-grid > .dashboard-quick-card .quick-report-link:hover {
  border-color: #b8c0cc;
  background: #f5f6f8;
}

.home-grid > .dashboard-quick-card .quick-report-link > .bi {
  color: #5b6068;
  font-size: 0.8rem;
}

.home-grid > .home-quick-add-card .home-quick-add-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.home-grid > .home-quick-add-card .home-quick-add-btn,
.home-grid > .home-quick-add-card .home-quick-add-btn.bank {
  width: auto;
  min-height: 50px;
  grid-template-columns: auto auto auto;
  border-color: #d9dee7;
  border-radius: 16px;
  background: #ffffff;
  color: #172033;
  padding: 11px 14px;
}

.home-grid > .home-quick-add-card .home-quick-add-btn:hover,
.home-grid > .home-quick-add-card .home-quick-add-btn.bank:hover {
  border-color: #b8c0cc;
  background: #f5f6f8;
}

.home-grid > .home-quick-add-card .home-quick-add-btn > span:first-child,
.home-grid > .home-quick-add-card .home-quick-add-btn.bank > span:first-child {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: #172033;
  font-size: 1rem;
}

.home-grid > .home-quick-add-card .home-quick-add-btn small {
  display: none;
}

.home-grid > .home-quick-add-card .home-quick-add-btn > .bi {
  color: #5b6068;
  font-size: 0.8rem;
}

/* Home layout: simple overview for non-technical users. */
#home {
  font-weight: 500;
}

#home h1,
#home h2,
#home h3,
#home strong {
  font-weight: 650;
}

#home p,
#home span,
#home small,
#home em {
  font-weight: 500;
}

#home button {
  font-weight: 600;
}

#home .home-title-row {
  min-height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding-top: 28px;
  padding-bottom: 28px;
}

#home .home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 90%;
  margin-right: auto;
  margin-left: auto;
}

#home .home-primary-action-grid {
  grid-column: 1 / -1;
  order: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#home .home-primary-action-card {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  border-radius: 18px;
  padding: 18px 20px;
}

#home .home-primary-action-heading {
  display: flex;
  align-self: start;
  align-items: center;
  gap: 10px;
}

#home .home-primary-action-heading > span {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #eef2f5;
  color: #111827;
  font-size: 1.05rem;
}

#home .home-primary-action-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 1.08rem;
  font-weight: 650;
}

#home .home-primary-action-summary {
  min-width: 0;
  display: grid;
  gap: 3px;
}

#home .home-primary-action-summary small {
  color: #6b7280;
  font-size: 0.78rem;
}

#home .home-primary-action-summary strong {
  margin-top: 2px;
  color: #111827;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

#home .home-primary-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#home .home-primary-action-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  cursor: pointer;
  padding: 10px 14px;
  white-space: nowrap;
}

#home .home-primary-action-btn.add {
  border-color: #cfd6df;
  background: #ffffff;
  color: #111827;
}

#home .home-primary-action-btn.add i {
  color: #168a3a;
}

#home .home-attention-column [data-home-review="missing_invoices"] i {
  color: #b91c1c;
}

#home .home-attention-column [data-home-review="unusual_payments"] i {
  color: #c65d10;
}

#home .home-primary-action-btn.add:hover {
  border-color: #9aa5b3;
  background: #f7f8fa;
}

#home .home-primary-action-btn.view {
  border-color: #cfd6df;
  background: #ffffff;
  color: #111827;
}

#home .home-primary-action-btn.view:hover {
  border-color: #9aa5b3;
  background: #f7f8fa;
}

#home .home-tools-card {
  grid-column: 1 / -1;
  order: 10;
  display: grid;
  gap: 16px;
  border-radius: 18px;
}

#home .home-tools-heading h2 {
  margin: 3px 0 0;
  color: #111827;
  font-size: 1.08rem;
  font-weight: 650;
}

#home .home-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

#home .home-tool-item {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 10px;
  border: 1px solid #e0e5eb;
  border-radius: 12px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
  padding: 14px;
}

#home .home-tool-item:hover {
  background: #f5f6f8;
}

#home .home-tool-item:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 3px;
}

#home .home-tool-item > img,
#home .home-tool-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

#home .home-tool-item > img {
  object-fit: contain;
  background: #ffffff;
}

#home .home-tool-icon {
  display: grid;
  place-items: center;
  font-size: 1rem;
}

#home .home-tool-icon.bank {
  color: #168a3a;
  background: #e6f7eb;
}

#home .home-tool-icon.ai {
  color: #7c3aed;
  background: #ede9fe;
}

#home .home-tool-item h3 {
  margin: 0;
  color: #111827;
  font-size: 0.94rem;
  font-weight: 650;
}

#home .home-tool-item p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.4;
}

#home .home-tool-item > .status-pill {
  justify-self: start;
}

#home .home-main-title {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 2.125rem;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#home .home-header-actions {
  justify-content: center;
}

#home .compact-action-btn.home-header-action-btn {
  min-height: 44px;
  border-radius: 10px;
}

#home .home-header-actions .home-header-action-btn[data-route="dashboard"] {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

#home .home-header-actions .home-header-action-btn[data-route="dashboard"]:hover {
  background: #292929;
  border-color: #292929;
  color: #ffffff;
}

#home .home-header-actions .home-header-action-btn[data-route="dashboard"] .bi {
  color: inherit;
}

#home .home-header-actions .home-header-action-btn:is([data-route="analytics"], [data-route="reports"]) {
  background: #ffffff;
  color: #111111;
}

#home .home-header-actions .home-header-action-btn:is([data-route="analytics"], [data-route="reports"]):hover {
  background: #f5f6f8;
}

#home .home-header-actions .home-header-action-btn:is([data-route="analytics"], [data-route="reports"]) .bi {
  color: inherit;
}

#home #homeAssistantQuestionBtn {
  border-color: #d9dee7;
  background: #ffffff;
  color: #172033;
}

#home #homeAssistantQuestionBtn:hover {
  border-color: #b8c0cc;
  background: #f5f6f8;
  color: #172033;
}

#home .home-progress-card {
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
}

#home .home-agent-progress {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 22px;
  row-gap: 8px;
}

#home .home-agent-progress-head {
  grid-column: 1;
  grid-row: 1;
}

#home .home-progress-track {
  grid-column: 1;
  grid-row: 2;
}

#home .home-agent-progress > .home-status-head {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  white-space: nowrap;
}

#home .home-overview-hub,
#home .home-quick-add-card {
  grid-column: 1 / -1;
}

#home .home-quick-add-card {
  grid-column: auto;
  order: 2;
}

#home .dashboard-quick-card {
  order: 2;
}

#home .home-overview-hub {
  order: 4;
}

#home .home-summary-card .home-agent-summary {
  margin: 0;
  padding: 0 0 14px;
  border-radius: 0;
  background: #ffffff;
}

#home .home-grid > .panel {
  border-radius: 12px;
}

#home .home-quick-add-card {
  padding: 18px 20px;
}

#home .home-quick-add-actions,
#home .home-grid > .home-quick-add-card .home-quick-add-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

#home .home-grid > .home-quick-add-card .home-quick-add-btn,
#home .home-grid > .home-quick-add-card .home-quick-add-btn.bank {
  width: 100%;
  border-radius: 10px;
}

#home .home-grid > .home-quick-add-card .home-quick-add-btn:disabled {
  border-color: #e2e5e9;
  background: #f3f4f6;
  color: #8a929d;
  cursor: not-allowed;
  opacity: 0.72;
}

#home .home-grid > .home-quick-add-card .home-quick-add-btn:disabled:hover {
  border-color: #e2e5e9;
  background: #f3f4f6;
}

#home .home-grid > .home-quick-add-card .home-quick-add-btn:disabled > span:first-child,
#home .home-grid > .home-quick-add-card .home-quick-add-btn:disabled > .bi {
  color: #8a929d;
}

#home .home-fix-btn[data-home-bank-import] {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

#home .home-fix-btn[data-home-bank-import]:hover {
  background: #292929;
  border-color: #292929;
}

#home .home-attention-hub,
#home .home-attention-layout {
  display: contents;
}

#home .home-attention-column,
#home .home-outstanding-block {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

#home .home-attention-column,
#home .home-outstanding-block {
  order: 3;
}

#home .home-attention-column {
  grid-column: 1 / -1;
}

#home .home-attention-column .home-attention-list {
  padding-top: 0;
}

#home .home-attention-column .home-task-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#home .home-attention-column .home-task-list > li {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f7f8fa;
  line-height: 1.5;
}

#home .home-attention-column .home-task-list > li > button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

#home .home-outstanding-block {
  grid-column: span 2;
}

#home .dashboard-quick-card,
#home .home-notifications-card {
  order: 5;
  min-height: 0;
}

#home .dashboard-quick-card {
  order: 2;
}

#home .home-notifications-card {
  grid-column: auto;
}

#home .home-grid > .dashboard-quick-card .quick-report-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#home .home-grid > .dashboard-quick-card .quick-report-link {
  width: 100%;
  border-radius: 10px;
}

#home .home-grid > .home-report-shortcuts {
  order: 3;
  min-width: 0;
  border-radius: 18px;
  padding: 18px 20px;
}

#home .home-grid > .home-report-shortcuts .quick-report-list,
#home .home-profit-actions {
  grid-template-columns: 1fr;
}

#home .home-report-shortcuts .quick-report-link {
  min-width: 0;
  justify-content: space-between;
  white-space: normal;
  text-align: left;
}

#home .home-report-shortcuts .dashboard-card-footer a,
#home .home-report-shortcuts .dashboard-card-footer a:hover,
#home .home-attention-column .dashboard-card-footer a,
#home .home-attention-column .dashboard-card-footer a:hover {
  text-decoration: none;
}

#home .home-outstanding-block > .panel-title-row {
  align-items: flex-start;
  flex-direction: row;
}

#home .home-outstanding-heading-title {
  flex: 1;
  min-width: 0;
}

#home .home-outstanding-heading-title h3 {
  min-width: 0;
}

@media (max-width: 1500px) {
  #home .home-primary-action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  #home .home-grid,
  #home .home-primary-action-grid,
  #home .home-attention-column .home-task-list {
    grid-template-columns: 1fr;
  }

  #home .home-outstanding-block {
    grid-column: 1 / -1;
  }
}

.help-hero-panel {
  display: grid;
  gap: 8px;
}

.help-hero-panel p,
.help-card p,
.help-card li {
  color: #475569;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.55;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.help-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.help-card h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.help-card h2 .bi {
  color: #0f5f95;
  font-size: 1rem;
}

.help-card ol {
  margin: 0;
  padding-left: 18px;
}

.settings-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #94a3b8;
  font-size: 0.82rem;
}

.settings-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 980px;
}

.settings-action-card h2 {
  margin: 0 0 4px;
}

.legal-panel {
  display: grid;
  gap: 10px;
  max-width: 980px;
}

.legal-panel h2 {
  margin-top: 10px;
}

.legal-panel h2:first-child {
  margin-top: 0;
}

.legal-panel p {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.6;
}

.dashboard-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 14px;
}

.bank-file-label {
  color: #334155;
}

.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.header-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #0f5f95;
  cursor: help;
}

.header-help .bi {
  font-size: 15px;
}

.header-help-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 95;
  width: min(390px, calc(100vw - 56px));
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.55;
  opacity: 0;
  padding: 12px;
  pointer-events: none;
  text-align: left;
  white-space: pre-line;
}

.header-help-tooltip strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
  font-weight: 600;
}

.header-help:hover .header-help-tooltip,
.header-help:focus .header-help-tooltip,
.header-help:focus-within .header-help-tooltip {
  opacity: 1;
}

.bank-file-input {
  border-style: dashed !important;
  border-color: #b6c4d8 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  min-height: 42px;
}

#trialBalanceCsvFile {
  border: 0 !important;
}

.bank-file-input::file-selector-button {
  margin-right: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #e0f2fe;
  color: #075985;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 7px 10px;
}

.compact-action-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.88rem;
  white-space: nowrap;
}

#openBankImportModalBtn {
  min-width: 0;
  width: max-content;
}

.bank-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

#bankListView > .page-title-row {
  margin-bottom: 22px;
}

.bank-actions-menu {
  position: relative;
}

.bank-actions-menu summary {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #168a3a;
  border-radius: 10px;
  background: #168a3a;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  list-style: none;
}

.bank-actions-menu summary:hover {
  background: #116e2e;
  border-color: #116e2e;
}

.bank-actions-menu summary::-webkit-details-marker {
  display: none;
}

.bank-actions-menu[open] summary .bi-chevron-down {
  transform: rotate(180deg);
}

.bank-actions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 18;
  width: 220px;
  padding: 7px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.bank-actions-dropdown button {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  text-align: left;
}

.bank-actions-dropdown #openBankImportModalBtn {
  width: 100%;
}

.bank-actions-dropdown button:hover {
  background: #f1f3f5;
}

.bank-feed-promo {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #f5faf7;
}

.bank-feed-promo-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0369a1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.bank-feed-promo h2 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 1rem;
}

.bank-feed-promo p {
  margin: 0;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.45;
}

.bank-feed-promo .compact-action-btn {
  border-color: #d9dee7;
  background: #ffffff;
  color: #111827;
  white-space: nowrap;
}

.blue-secondary-btn {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
}

#openExpenseImportBtn,
#openSaleImportBtn {
  background: #ffffff;
  color: #000000;
}

.green-secondary-btn {
  border: 1px solid rgba(27, 143, 47, 0.28);
  border-radius: 8px;
  background: #e6f7eb;
  color: var(--accent-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
}

.green-secondary-btn:hover {
  background: #dcfce7;
  border-color: rgba(27, 143, 47, 0.48);
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 500;
}

.status-pill.reconciled {
  background: #e6f7eb;
  color: var(--accent-strong);
}

.status-pill.unreconciled {
  background: #e0f2fe;
  color: #075985;
}

.status-pill.part-paid {
  background: #fff4d6;
  color: #8a4b08;
}

.transaction-payment-status.unreconciled {
  border: 1px solid #f2b56b;
  background: #fff1df;
  color: #9a4a00;
}

.icon-danger-btn {
  border: 0;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  width: 38px;
  font-size: 1rem;
}

.icon-danger-btn:hover {
  color: #7f1d1d;
}

#vatReturnForm {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
}

#vatReturnForm > label {
  flex: 1 1 180px;
  max-width: 220px;
  min-width: 0;
}

#vatReturnForm .form-actions {
  flex: 1 1 340px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

#vatReturnForm .vat-final-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

#vatReturnDetailView :is(.form-actions, .page-heading-actions) button {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
}

#saveVatReturnPeriodBtn,
#backToBankAccountsBtn,
#accounts button[data-route="chartAccounts"],
#openAccountModalBtn,
#backToAccountsBtn,
#backToReportsListBtn,
#backToReportsBtn,
#journalForm button[type="submit"] {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

#saveVatReturnPeriodBtn:hover,
#backToBankAccountsBtn:hover,
#accounts button[data-route="chartAccounts"]:hover,
#openAccountModalBtn:hover,
#backToAccountsBtn:hover,
#backToReportsListBtn:hover,
#backToReportsBtn:hover,
#journalForm button[type="submit"]:hover {
  background: #292929;
  border-color: #292929;
  color: #ffffff;
}

#fileVatReturnBtn {
  background: #168a3a;
  border-color: #168a3a;
  color: #ffffff;
}

#fileVatReturnBtn:hover {
  background: #116e2e;
  border-color: #116e2e;
  color: #ffffff;
}

#deleteVatReturnBtn {
  background: #ffffff;
  border-color: #fecaca;
  color: #b91c1c;
}

#deleteVatReturnBtn:hover {
  background: #fff1f2;
  border-color: #fca5a5;
}

.vat-return-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 14px 0 30px;
  padding: 4px;
  width: max-content;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f0f9ff;
}

.vat-return-tabs button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #075985;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  min-height: 34px;
  padding: 7px 15px;
  white-space: nowrap;
}

.vat-return-tabs button:hover {
  background: #e0f2fe;
}

.vat-return-tabs button.active {
  background: #e0f2fe;
  color: #075985;
  box-shadow: 0 1px 4px rgba(7, 89, 133, 0.16);
}

.vat-tab-panel .table-wrap {
  margin-top: 16px;
}

.vat-tab-panel .vat-grid {
  margin-top: 8px;
}

.vat-late-claim-row {
  background: #f0f9ff;
}

.vat-late-claim-row td {
  border-bottom-color: #bfdbfe;
}

.vat-exclusion-warning {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: -4px 0 2px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f0f9ff;
  color: #075985;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 10px;
}

.vat-exclusion-warning.compact-warning {
  margin: 6px 0 0;
  padding: 5px 7px;
  font-size: 0.74rem;
}

.import-account-cell {
  min-width: 190px;
}

.import-account-cell .compact-warning {
  display: flex;
  width: fit-content;
  max-width: 100%;
  clear: both;
}

.bank-table-panel {
  padding: 14px;
}

.bank-table-panel .bank-filter-tabs {
  margin: 14px 0 14px;
  padding: 3px;
}

.bank-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.bank-account-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  max-width: 560px;
  margin-left: 0;
  margin-right: 0;
}

.bank-account-card {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  padding: 14px;
  text-align: left;
}

.bank-card-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bank-card-title {
  overflow: hidden;
  color: #0f5f95;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 400;
}

.bank-card-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.bank-card-stats strong {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
}

.bank-overview-chart-card {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  margin: 18px 0 0;
  width: 100%;
  padding: 14px;
}

.bank-overview-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.bank-overview-chart-head > div:first-child {
  display: grid;
  gap: 4px;
}

.bank-overview-chart-head span {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 400;
}

.bank-overview-chart-head strong {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
}

.bank-overview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.bank-overview-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

@media (max-width: 640px) {
  .bank-overview-chart-head {
    display: grid;
  }

  .bank-overview-stats {
    justify-content: flex-start;
  }
}

.bank-card-chart-wrap {
  display: grid;
  gap: 8px;
  width: 100%;
}

.bank-card-chart-legend {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  color: #64748b;
  font-size: 0.85rem;
}

.bank-card-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-key {
  border-radius: 99px;
  display: inline-block;
  height: 8px;
  width: 24px;
}

.chart-key.in {
  background: #0f5f95;
}

.chart-key.out {
  background: #1b8f2f;
}

.bank-card-chart {
  display: block;
  width: 100%;
  height: 190px;
}

.bank-card-chart-grid {
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 1;
}

.bank-card-chart-axis {
  stroke: rgba(100, 116, 139, 0.45);
  stroke-width: 1;
}

.bank-card-chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.bank-card-chart-line.in {
  stroke: #0f5f95;
}

.bank-card-chart-line.out {
  stroke: #1b8f2f;
}

.bank-card-chart-dates {
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 400;
  padding: 0 4px;
}

.bank-account-card:hover,
.bank-account-card.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.bank-account-card.active {
  box-shadow: inset 0 0 0 1px #0f5f95;
}

.bank-account-switch-row {
  display: flex;
  justify-content: flex-start;
  margin: 14px 0;
}

.bank-account-switch-row label {
  display: grid;
  gap: 6px;
  color: #123326;
  font-weight: 500;
  min-width: min(340px, 100%);
}

.bank-account-switch-row select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  min-height: 40px;
  padding: 8px 10px;
}

.bank-table-panel .bank-search-row {
  margin: 0 0 14px;
}

.bulk-actions,
.bank-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff7f7;
  color: #7f1d1d;
  margin: 0 0 12px;
  padding: 8px 10px;
}

.bulk-actions span,
.bank-bulk-actions span {
  font-size: 0.88rem;
  font-weight: 500;
}

.danger-light-btn {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 500;
  padding: 7px 10px;
}

.danger-light-btn:hover {
  background: #fecaca;
}

.bank-import-file-section {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.bank-import-file-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bank-import-help summary {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #475569;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}

.bank-import-help summary::-webkit-details-marker {
  display: none;
}

.bank-import-help summary:focus-visible {
  outline: 2px solid #475569;
  outline-offset: 2px;
}

.bank-import-help > .bank-import-help-content {
  display: none;
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 5;
  box-sizing: border-box;
  width: min(420px, 100%);
  max-height: min(360px, 50vh);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #d8e0e8;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  font-size: 0.85rem;
  line-height: 1.5;
}

.bank-import-help[open] > .bank-import-help-content,
.bank-import-help:hover > .bank-import-help-content,
.bank-import-help:focus-within > .bank-import-help-content {
  display: block;
}

.bank-import-help-content p,
.bank-import-help-content dl {
  margin: 8px 0 0;
}

.bank-import-help-content dt {
  margin-top: 8px;
  font-weight: 600;
}

.bank-import-help-content dd {
  margin: 0;
}

.bank-rule-import-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
}

.bank-rule-import-file-row > label {
  display: grid;
  flex: 1 1 260px;
  min-width: 0;
  gap: 7px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 600;
}

.bank-rule-import-file-row input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #475569;
  font-family: inherit;
  font-size: 0.92rem;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
}

.bank-rule-import-file-row input::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.bank-rule-import-table {
  table-layout: fixed;
  min-width: 1200px;
}

.bank-rule-import-table th:nth-child(1) { width: 54px; }
.bank-rule-import-table th:nth-child(2) { width: 200px; }
.bank-rule-import-table th:nth-child(3) { width: 175px; }
.bank-rule-import-table th:nth-child(4) { width: 140px; }
.bank-rule-import-table th:nth-child(5) { width: 240px; }
.bank-rule-import-table th:nth-child(6) { width: 95px; }
.bank-rule-import-table th:nth-child(7) { width: 220px; }

.bank-rule-import-table input,
.bank-rule-import-table select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background-color: #fff;
  color: #111827;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.bank-rule-import-table :is(input, select):hover,
.bank-rule-import-file-row input[type="file"]:hover {
  border-color: #94a3b8;
  background-color: #fbfcfd;
}

.bank-rule-import-table :is(input, select):focus,
.bank-rule-import-file-row input[type="file"]:focus-visible {
  outline: 0;
  border-color: #475569;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.bank-rule-import-table [aria-invalid="true"],
.bank-rule-import-table [aria-invalid="true"]:hover,
.bank-rule-import-table [aria-invalid="true"]:focus {
  border-color: #dc2626;
  background: #fff5f5;
}

.bank-rule-import-table :is(input, select):disabled {
  background: #f1f5f8;
  color: #64748b;
  box-shadow: none;
  cursor: wait;
}

@media (max-width: 720px) {
  .bank-rule-import-table input,
  .bank-rule-import-table select,
  .bank-rule-import-file-row input[type="file"] {
    min-height: 48px;
    font-size: 16px;
  }
}

.bank-rule-import-error {
  color: #b91c1c;
  font-size: 0.82rem;
}

#bankRuleImportModal .modal-actions {
  margin-top: 20px;
}

.journal-history-panel {
  margin-top: 18px;
}

.journal-history-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.journal-history-summary::-webkit-details-marker {
  display: none;
}

.journal-history-summary h2 {
  margin: 0 0 4px;
}

.journal-history-summary > .bi-chevron-down {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.journal-history-panel[open] .journal-history-summary > .bi-chevron-down {
  transform: rotate(180deg);
}

.journal-history-filter-panel {
  margin-top: 16px;
  margin-bottom: 14px;
}

.journal-history-panel .journal-history-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: end;
  margin: 0;
}

.journal-history-table {
  min-width: 1040px;
}

.journal-history-table th:first-child {
  width: 42px;
}

.journal-history-table input:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.journal-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.journal-history-pagination span {
  color: #64748b;
  font-size: 0.84rem;
}

.journal-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.journal-detail-meta > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.journal-detail-meta .wide {
  grid-column: 1 / -1;
}

.journal-detail-meta span {
  color: #64748b;
  font-size: 0.78rem;
}

.journal-detail-meta strong {
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 0.94rem;
}

.journal-detail-lines-wrap {
  margin: 0;
}

.journal-protected-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a5f;
}

.journal-protected-notice[hidden] {
  display: none;
}

.journal-protected-notice > i {
  margin-top: 2px;
  color: #2563eb;
  font-size: 1rem;
}

.journal-protected-notice strong {
  display: block;
  margin-bottom: 3px;
}

.journal-protected-notice p {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.45;
}

.journal-detail-lines-table {
  min-width: 680px;
}

.journal-detail-lines-table tfoot th {
  border-top: 2px solid #cbd5e1;
  background: #f8fafc;
}

.journal-detail-balance {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #15803d;
  font-weight: 600;
}

.journal-detail-balance.is-unbalanced {
  color: #b45309;
}

#journalDetailModal .modal-actions {
  margin-top: 22px;
}

@media (max-width: 720px) {
  .journal-history-panel .journal-history-controls {
    grid-template-columns: 1fr;
  }

  .journal-detail-meta {
    grid-template-columns: 1fr;
  }

  .journal-detail-meta .wide {
    grid-column: auto;
  }
}

.bank-table-panel .table-wrap {
  border-top: 0;
}

.bank-table-panel table {
  min-width: 1040px;
}

.bank-table-panel th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.bank-table-panel tbody tr:hover {
  background: #f8fafc;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.compact-form {
  margin: 12px 0;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #273244;
  font-weight: 600;
  font-size: 0.9rem;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.checkbox-label input {
  width: auto;
}

.wide {
  grid-column: span 2;
}

.span-2 {
  grid-column: span 2;
}

.span-4 {
  grid-column: 1 / -1;
}

.transaction-edit-form {
  margin-top: 16px;
}

.settings-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.settings-stack {
  display: grid;
  gap: 18px;
  width: 80%;
  margin-right: auto;
}

.settings-stack .panel {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.settings-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.settings-link-actions a {
  text-decoration: none;
}

#settings .settings-link-actions > a {
  color: #111111;
  background: #f1f3f5;
  border-color: #dfe3e7;
}

#settings .settings-link-actions > a:hover {
  background: #e5e7eb;
}

#settingsLogoutBtn {
  color: #ffffff;
  background: #111111;
  border-color: #111111;
}

#settingsLogoutBtn:hover {
  background: #292929;
  border-color: #292929;
}

#settings .settings-subgrid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: end;
}

@media (max-width: 900px) {
  .settings-stack {
    width: 100%;
  }
}

.settings-fieldset {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  margin: 4px 0 0;
  padding: 14px;
}

.settings-fieldset legend {
  color: #0f5f95;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0 6px;
}

.settings-subgrid {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: center;
}

.filter-panel {
  margin: 8px 0 18px;
  padding: 14px;
  border-color: #cfe4df;
  background:
    linear-gradient(180deg, rgba(27, 143, 47, 0.055), rgba(21, 52, 183, 0.035)),
    #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.filter-panel[data-filter-panel="sales"],
.filter-panel[data-filter-panel="expenses"] {
  background: #ffffff;
}

.transaction-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.transaction-stat-card {
  min-width: 0;
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid #dce3e9;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  padding: 14px 16px;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.transaction-stat-card span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #687386;
  font-size: 0.8rem;
  font-weight: 500;
}

.transaction-stat-card span i {
  color: #168a3a;
  font-size: 0.88rem;
}

.transaction-stat-card strong {
  overflow: hidden;
  color: #111827;
  font-size: 1.35rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-stat-card:hover {
  border-color: #aeb9c5;
  background: #f8fafb;
}

.transaction-stat-card.active {
  border-color: #8bc9a3;
  background: #eef9f2;
  box-shadow: 0 0 0 2px rgba(22, 138, 58, 0.08);
}

.filter-grid {
  grid-template-columns: minmax(260px, 1.45fr) minmax(180px, 0.8fr) minmax(150px, 0.65fr) minmax(150px, 0.65fr) auto;
  gap: 10px;
  align-items: end;
}

.filter-grid.transaction-filter-grid {
  grid-template-columns: minmax(220px, 1.25fr) minmax(165px, 0.8fr) minmax(135px, 0.65fr) minmax(135px, 0.65fr) minmax(185px, 0.8fr) auto;
}

.filter-grid .wide {
  grid-column: auto;
}

.filter-grid label {
  color: #285346;
  font-size: 0.78rem;
  font-weight: 600;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  height: 38px;
  border: 1px solid #bdd8d2;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #172033;
  font-weight: 400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.filter-grid input[type="search"] {
  border-color: #b9d4ff;
  background: #ffffff;
}

.filter-grid input:focus,
.filter-grid select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 52, 183, 0.12);
}

.filter-clear-btn {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #075985;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
}

.filter-clear-btn:hover {
  border-color: #93c5fd;
  background: #e0f2fe;
}

.settings-bank-automation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  color: #111827;
  font-weight: 500;
  cursor: pointer;
}

.settings-bank-automation > span {
  min-width: 0;
}

.settings-bank-automation small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 400;
}

.settings-bank-automation input {
  appearance: none;
  flex: 0 0 46px;
  width: 46px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid #9ca3af;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  cursor: pointer;
}

.settings-bank-automation input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 150ms ease;
}

.settings-bank-automation input:checked {
  background: #168a3a;
  border-color: #168a3a;
}

.settings-bank-automation input:checked::after {
  transform: translateX(20px);
}

.settings-bank-automation input:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 3px;
}

.accounts-zero-toggle {
  grid-column: 1 / 3;
  grid-row: 2;
  justify-self: start;
  min-height: 24px;
  color: #285346;
  font-size: 0.78rem;
  font-weight: 500;
}

.accounts-zero-toggle input {
  appearance: none;
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eaf5ff;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.accounts-zero-toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 0.16s ease;
}

.accounts-zero-toggle input:checked {
  border-color: #0f5f95;
  background: #0f5f95;
}

.accounts-zero-toggle input:checked::after {
  transform: translateX(16px);
}

.account-detail-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #475569;
  font-size: 0.88rem;
  margin: 12px 0;
  padding: 10px 12px;
}

.account-detail-balance strong {
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 600;
}

.account-detail-balance-bottom {
  margin-top: 12px;
}

.transaction-edit-form label {
  color: #334155;
  font-size: 0.84rem;
}

.transaction-edit-form input,
.transaction-edit-form select {
  border-color: #cbd5e1;
  background: #ffffff;
}

.transaction-edit-form input[readonly] {
  background: #eef4f8;
  color: #475569;
}

.modal-form input[readonly] {
  background: #eef4f8;
  color: #475569;
  cursor: default;
}

#bankAllocationForm input[readonly] {
  background: #eef4f8;
  color: #475569;
  cursor: default;
}

.bank-detail-form {
  margin: 16px 0;
}

.bank-detail-form input[readonly],
.bank-detail-form textarea[readonly] {
  background: #eef4f8;
  color: #475569;
  cursor: default;
}

.bank-detail-form textarea[readonly] {
  min-height: 82px;
  resize: none;
}

.bank-detail-amount-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.delete-icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.delete-icon-btn:hover {
  background: #fecaca;
}

.journal-form {
  display: grid;
  gap: 14px;
}

.journal-import-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.journal-import-row .bank-file-label {
  min-width: min(360px, 100%);
}

.journal-import-row .panel-subtitle {
  margin: 0;
}

.journal-account-warning {
  display: block;
  margin-top: 5px;
  border-radius: 7px;
  background: #fff1f2;
  color: #991b1b;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 7px;
  white-space: normal;
}

.journal-form select.account-required-warning {
  border-color: #dc2626;
  background: #fff1f2;
  color: #7f1d1d;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

[data-export-only] {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 810px;
}

.transaction-list-table {
  table-layout: fixed;
  min-width: 1040px;
}

.transaction-list-table th:nth-child(1) { width: 42px; }
.transaction-list-table th:nth-child(2) { width: 128px; }
.transaction-list-table th:nth-child(3) { width: 170px; }
.transaction-list-table th:nth-child(4) { width: 190px; }
.transaction-list-table th:nth-child(5),
.transaction-list-table th:nth-child(6),
.transaction-list-table th:nth-child(7) { width: 92px; }
.transaction-list-table th:nth-child(8) { width: 126px; }
.transaction-list-table th:nth-child(9) { width: 94px; }

@media (min-width: 621px) and (max-width: 1280px) {
  :is(#salesTable, #expensesTable) {
    min-width: 856px;
  }

  :is(#salesTable, #expensesTable) :is(th, td):nth-child(5),
  :is(#salesTable, #expensesTable) :is(th, td):nth-child(6) {
    display: none;
  }
}

.table-truncated-text {
  display: block;
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-party-text { max-width: 170px; }
.table-account-text { max-width: 190px; }
.table-description-text { max-width: 240px; }

.table-truncated-action {
  display: block;
  max-width: 240px;
  overflow: hidden;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
}

.report-section td {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-total td {
  background: #eef7f0;
  font-weight: 600;
}

#reportsReportView .table-link {
  color: #4b5563;
  font-weight: 400;
}

#reportsReportView .report-total td {
  background: #f1f3f5;
  color: #374151;
}

.money {
  text-align: right;
}

.table-date,
.table-code {
  color: #64748b;
  font-weight: 400;
}

.money-input {
  text-align: right;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf2f7;
  color: #394150;
  font-weight: 700;
  font-size: 0.8rem;
}

.pill.ok {
  background: #dcfce7;
  color: #14532d;
}

.pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.table-btn {
  padding: 6px 8px;
  font-size: 0.82rem;
}

.light-table-btn {
  background: #e0f2fe;
  border-color: #bfdbfe;
  color: #075985;
  font-weight: 500;
}

#salesTable .light-table-btn,
#expensesTable .light-table-btn {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

#salesTable .light-table-btn:hover,
#expensesTable .light-table-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

.bank-action-pill {
    border-radius: 999px;
    border-color: transparent;
    font-weight: 600;
  }

  .bank-action-sale,
  .bank-action-expense {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
  }

  .bank-action-sale:hover,
  .bank-action-expense:hover {
    border-color: #2f3744;
    background: #2f3744;
    color: #ffffff;
  }

  .bank-action-unreconcile {
    background: #fee2e2;
    color: #991b1b;
  }

  .bank-action-pill:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 1;
  }

  .bank-match-card {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid #bbdfc4;
    border-radius: 8px;
    background: #f0faf2;
    color: #176b32;
    font-size: 0.82rem;
  }

  .bank-match-card .bank-action-sale {
    border-color: #a7d8b2;
    background: #dff5e4;
    color: #176b32;
  }

  .bank-match-card .bank-action-sale:hover {
    border-color: #75bd86;
    background: #ccefd5;
    color: #125527;
  }

  .bank-match-card .bank-suggestion-type {
    color: #176b32;
    font-size: 0.86rem;
    font-weight: 600;
  }

  .bank-match-card strong,
  .bank-match-card small {
    display: block;
    font-weight: 500;
  }

  .bank-match-card .bank-invoice-matched {
    margin-bottom: 4px;
    color: #172033;
    font-size: 0.96rem;
    font-weight: 700;
  }

  .bank-match-card span {
    color: #64748b;
    font-size: 0.76rem;
  }

  .bank-match-card ul {
    margin: 2px 0 4px;
    padding-left: 16px;
  }

  .bank-suggestion-details {
    padding: 13px 14px;
    border: 1px solid #d8e4ed;
    border-radius: 8px;
    background: #f5f9fc;
    color: #334155;
    font-size: 0.86rem;
  }

  .bank-suggestion-details strong,
  .bank-suggestion-details span {
    display: block;
  }

  .bank-suggestion-details strong {
    margin-bottom: 4px;
    color: #172033;
    font-size: 0.96rem;
  }

  .bank-suggestion-details ul {
    margin: 8px 0 0;
    padding-left: 18px;
  }

  .table-link {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
  }

  .table-link:hover {
    text-decoration: underline;
  }

  .inline-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #075985;
    cursor: pointer;
    font: inherit;
    font-weight: 400;
    text-align: left;
  }

  .inline-link:hover {
    text-decoration: underline;
  }

.icon-only-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 20, 32, 0.46);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(18, 20, 32, 0.24);
  padding: 22px;
}

.modal-panel.wide-modal {
  width: min(980px, 100%);
}

.modal-panel.full-page-modal {
  width: min(1380px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
}

.transaction-import-modal .modal-form {
  flex: 0 0 auto;
}

.transaction-import-modal .import-review {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.transaction-import-modal .import-review .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.import-review-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.import-review {
  margin-top: 16px;
}

.import-review .table-wrap {
  margin-top: 10px;
}

.import-review table {
  min-width: 1220px;
}

.import-review input,
.import-review select {
  width: 100%;
  min-width: 110px;
  border: 1px solid #cfd6e3;
  border-radius: 7px;
  padding: 7px 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-weight: 400;
}

.import-review select.account-required-warning,
.import-review select.account-vat-warning {
  border-color: #dc2626;
  background: #fff1f2;
  color: #7f1d1d;
}

.import-review select.account-required-warning:focus,
.import-review select.account-vat-warning:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.import-review .import-vat-warning {
  border-radius: 7px;
  background: #fff1f2;
  color: #7f1d1d;
  font-weight: 600;
}

.import-review tr.import-row-has-error > td {
  background: #fff7f7;
  border-top-color: #ef4444;
  border-bottom-color: #ef4444;
}

.import-review tr.import-row-has-error > td:first-child {
  border-left: 3px solid #dc2626;
}

.import-row-error {
  margin: 6px 0 0;
  color: #991b1b;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

.vat-rate-warning {
  color: #991b1b;
}

.import-review input[name="party"],
.import-review input[name="notes"] {
  min-width: 170px;
}

.import-fixed-amount,
.import-amount-cell {
  min-width: 90px;
  color: #374151;
  white-space: nowrap;
}

.import-review .import-amount-cell input {
  min-width: 104px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.modal-form {
  margin-top: 16px;
}

.modal-panel .form-grid input,
.modal-panel .form-grid select {
  font-weight: 400;
}

#expenseModal .modal-panel,
#saleModal .modal-panel,
#transactionEditModal .modal-panel,
#bankImportModal .modal-panel {
  border-radius: 18px;
  padding: 22px;
}

#homeReviewModal .modal-panel,
#bankAllocationModal .modal-panel {
  border-radius: 18px;
}

.modal-panel .modal-header h2 {
  color: #111827;
  font-size: 1.65rem;
  font-weight: 650;
  line-height: 1.2;
}

.transaction-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.transaction-modal-title .bi {
  color: #111827;
  font-size: 1.35rem;
}

.capture-modal-promo {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #dce4e1;
  border-radius: 10px;
  background: #f5faf7;
}

.capture-modal-promo img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
}

.invoice-tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #ffffff;
  object-fit: contain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
}

.capture-modal-promo h3 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 0.98rem;
}

.capture-modal-promo p {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.45;
}

.capture-modal-promo .compact-action-btn {
  flex: none;
  border-color: #d9dee7;
  background: #ffffff;
  color: #111827;
  white-space: nowrap;
}

.capture-modal-promo .compact-action-btn:hover {
  border-color: #b8c0cc;
  background: #f5f6f8;
  color: #111827;
}

.capture-manual-divider {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 0.84rem;
  text-align: center;
}

.modal-panel .modal-header .eyebrow {
  color: #7a8493;
  font-weight: 500;
}

#expenseModal .form-grid input,
#expenseModal .form-grid select,
#saleModal .form-grid input,
#saleModal .form-grid select,
#transactionEditModal .form-grid input,
#transactionEditModal .form-grid select {
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
}

#expenseModal .form-grid input:focus,
#expenseModal .form-grid select:focus,
#saleModal .form-grid input:focus,
#saleModal .form-grid select:focus,
#transactionEditModal .form-grid input:focus,
#transactionEditModal .form-grid select:focus {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.modal-panel .form-grid {
  gap: 15px;
}

.modal-panel .form-grid label {
  gap: 7px;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 600;
}

.modal-panel .form-grid > label > input:not([type="checkbox"]):not([type="file"]),
.modal-panel .form-grid > label > select {
  min-height: 56px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background-color: #ffffff;
  color: #111827;
  font-size: 1rem;
  font-weight: 500;
  padding: 0 14px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.modal-panel .form-grid > label > input:not([type="checkbox"]):not([type="file"]):hover,
.modal-panel .form-grid > label > select:hover {
  border-color: #94a3b8;
  background-color: #fbfcfd;
}

.modal-panel .form-grid > label > input:not([type="checkbox"]):not([type="file"]):focus,
.modal-panel .form-grid > label > select:focus {
  border-color: #475569;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.modal-panel .form-grid > label > input[readonly] {
  border-color: #d8e0e8;
  background: #f1f5f8;
  color: #526174;
  box-shadow: none;
}

#bankAllocationForm :is(input[readonly], input:disabled, select:disabled),
#transactionEditForm select[name="paid_method"]:disabled {
  border-color: #d8e0e8;
  background: #eef4f8;
  color: #475569;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

:is(#saleForm, #expenseForm, #transactionEditForm) input[type="number"]:is(:disabled, [readonly]) {
  border-color: #d8dadd;
  background: #f1f2f3;
  color: #60656c;
  -webkit-text-fill-color: #60656c;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

.modal-panel .bank-detail-form > label > textarea {
  width: 100%;
  min-height: 82px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  padding: 14px;
  outline: 0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
}

.modal-panel .bank-detail-form > label > textarea[readonly] {
  border-color: #d8e0e8;
  background: #f1f5f8;
  color: #526174;
  box-shadow: none;
}

.modal-panel .bank-detail-form > label > textarea.bank-detail-combined-notes {
  min-height: 132px;
}

#bankDetailModal .bank-detail-form input[readonly] {
  min-height: 46px;
  padding: 0 10px;
  font-size: 0.92rem;
}

#bankDetailModal .bank-detail-form textarea[readonly] {
  padding: 10px;
  font-size: 0.92rem;
}

#bankAllocationModal .modal-panel {
  padding: 18px;
}

#bankAllocationModal .bank-summary {
  margin: 8px 0 12px;
  padding: 9px 10px;
  font-size: 0.88rem;
}

#bankAllocationForm {
  gap: 10px;
}

#bankAllocationForm label {
  gap: 4px;
  font-size: 0.86rem;
}

#bankAllocationForm > label > input:not([type="checkbox"]),
#bankAllocationForm > label > select {
  min-height: 46px;
  padding: 0 10px;
  font-size: 0.92rem;
}

#bankAllocationForm .bank-suggestion-details {
  padding: 10px 11px;
  font-size: 0.82rem;
}

#bankAllocationForm .bank-suggestion-details strong {
  margin-bottom: 2px;
  font-size: 0.9rem;
}

#bankAllocationForm .bank-suggestion-details ul {
  margin-top: 5px;
}

#bankAllocationForm #bankExistingSourceHint {
  margin: 0;
}

#bankAllocationForm #bankExistingSourceHint:empty {
  display: none;
}

:is(#expenseModal, #saleModal, #transactionEditModal) .modal-panel {
  padding: 18px;
}

:is(#expenseModal, #saleModal, #transactionEditModal) .modal-header h2 {
  font-size: 1.45rem;
}

#expenseForm,
#saleForm {
  margin-top: 0;
}

#transactionEditModal .transaction-edit-form {
  margin-top: 12px;
}

:is(#expenseModal, #saleModal, #transactionEditModal) .form-grid {
  gap: 10px;
}

:is(#expenseModal, #saleModal, #transactionEditModal) .form-grid label {
  gap: 4px;
  font-size: 0.86rem;
}

:is(#expenseModal, #saleModal, #transactionEditModal) .form-grid > label > input:not([type="checkbox"]):not([type="file"]),
:is(#expenseModal, #saleModal, #transactionEditModal) .form-grid > label > select {
  min-height: 46px;
  padding: 0 10px;
  font-size: 0.92rem;
}

:is(#expenseModal, #saleModal) .capture-modal-promo {
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
}

:is(#expenseModal, #saleModal) .capture-modal-promo img,
:is(#expenseModal, #saleModal) .invoice-tool-icon {
  width: 44px;
  height: 44px;
}

:is(#expenseModal, #saleModal) .capture-manual-divider {
  margin-bottom: 10px;
}

:is(#expenseModal, #saleModal) .touch-account-select {
  min-height: 46px;
  grid-template-columns: 38px minmax(0, 1fr);
}

:is(#expenseModal, #saleModal) .touch-account-select > .bi {
  width: 38px;
  height: 30px;
  font-size: 0.95rem;
}

#expenseModal .modal-panel .touch-account-select select,
#saleModal .modal-panel .touch-account-select select {
  min-height: 44px;
  padding: 0 34px 0 10px;
  font-size: 0.92rem;
}

#journalEditModal tbody select,
#journalEditModal tbody input {
  min-height: 48px;
  border-radius: 10px;
  border-color: #cbd5e1;
  font-size: 1rem;
}

.transaction-account-field {
  gap: 7px;
}

.touch-account-select {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 56px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.touch-account-select:hover {
  border-color: #94a3b8;
  background: #fbfcfd;
}

.touch-account-select:focus-within {
  border-color: #475569;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.touch-account-select > .bi {
  display: grid;
  width: 42px;
  height: 32px;
  place-items: center;
  border-right: 1px solid #e2e8f0;
  color: #475569;
  font-size: 1.05rem;
  pointer-events: none;
}

#expenseModal .touch-account-select select,
#saleModal .touch-account-select select {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 0 12px 12px 0;
  background-color: transparent;
  box-shadow: none;
  color: #111827;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  padding: 0 42px 0 13px;
}

#expenseModal .touch-account-select select:focus,
#saleModal .touch-account-select select:focus {
  outline: 0;
  box-shadow: none;
}

.touch-account-select select option,
.touch-account-select select optgroup {
  font-size: 1rem;
}

[data-account-select] option[value="change-category"] {
  font-weight: 700;
}

@media (max-width: 720px) {
  .modal-panel .form-grid > label > input:not([type="checkbox"]):not([type="file"]),
  .modal-panel .form-grid > label > select {
    min-height: 60px;
    font-size: 16px;
  }

  .touch-account-select {
    min-height: 60px;
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .touch-account-select > .bi {
    width: 46px;
    height: 36px;
  }

  #expenseModal .touch-account-select select,
  #saleModal .touch-account-select select {
    min-height: 58px;
    font-size: 16px;
  }
}

#expenseModal button[type="submit"],
#saleModal button[type="submit"],
#transactionEditModal button[type="submit"],
#bankAllocationModal button[type="submit"],
#vatReturnModal button[type="submit"],
#bankImportModal #importCsvBtn,
#transactionImportModal #submitTransactionImportBtn,
#openSaleModalBtn,
#openExpenseModalBtn,
#openVatReturnModalBtn {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

#expenseModal button[type="submit"]:hover,
#saleModal button[type="submit"]:hover,
#transactionEditModal button[type="submit"]:hover,
#bankAllocationModal button[type="submit"]:hover,
#vatReturnModal button[type="submit"]:hover,
#bankImportModal #importCsvBtn:hover,
#transactionImportModal #submitTransactionImportBtn:hover,
#openSaleModalBtn:hover,
#openExpenseModalBtn:hover,
#openVatReturnModalBtn:hover {
  border-color: #2f3744;
  background: #2f3744;
  color: #ffffff;
}

:is(
  .login-btn,
  .cookie-banner button,
  #expenseModal button[type="submit"],
  #saleModal button[type="submit"],
  #transactionEditModal button[type="submit"],
  #bankAllocationModal button[type="submit"],
  #vatReturnModal button[type="submit"],
  #bankImportModal #importCsvBtn,
  #transactionImportModal #submitTransactionImportBtn,
  #openSaleModalBtn,
  #openExpenseModalBtn,
  #openVatReturnModalBtn
) {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #111827;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
}

:is(
  .login-btn,
  .cookie-banner button,
  #expenseModal button[type="submit"],
  #saleModal button[type="submit"],
  #transactionEditModal button[type="submit"],
  #bankAllocationModal button[type="submit"],
  #vatReturnModal button[type="submit"],
  #bankImportModal #importCsvBtn,
  #transactionImportModal #submitTransactionImportBtn,
  #openSaleModalBtn,
  #openExpenseModalBtn,
  #openVatReturnModalBtn
):hover {
  border-color: #2f3744;
  background: #2f3744;
  color: #ffffff;
}

.modal-header,
.modal-actions,
.bank-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-subtitle {
  max-width: 720px;
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.45;
}

.bank-summary {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.bank-summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.detail-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.modal-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.modal-spacer {
  flex: 1 1 auto;
}

.report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reports-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 0;
}

.reports-list-panel {
  width: 100%;
  margin-top: 14px;
}

#reportsReportView > .panel {
  width: 75%;
  margin-left: auto;
  margin-right: auto;
}

.open-report-header-card {
  width: 100%;
  margin-bottom: 30px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.open-report-header-card .report-header-filter {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.standard-page-header-card {
  width: calc(100% + 22px);
  margin-bottom: 18px;
  margin-left: -11px;
  margin-right: -11px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.page-section > .standard-page-header-card {
  margin-bottom: 0;
}

.standard-page-header-card .page-header-filter {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.report-document-heading {
  padding: 8px 0 4px;
  text-align: center;
}

.report-document-heading h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.report-document-heading p {
  margin: 3px 0 0;
  color: var(--muted);
}

#activeReportBusinessName {
  color: var(--text);
  font-weight: 600;
}

.report-export-row {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 12px;
}

.reports-list-panel > .panel-title-row:first-child {
  margin-bottom: 8px;
}

.reports-group-title {
  margin-top: 24px;
  margin-bottom: 8px;
}

.report-list-item {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: #172033;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 12px;
  font: inherit;
  font-weight: 400;
  text-align: left;
}

.report-list-item:hover {
  background: #f8fbff;
  color: #075985;
}

.bank-filter-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 12px 16px 0;
  padding: 4px;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef4f8;
}

.bank-filter-tabs .tab-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  padding: 7px 14px;
  font-size: 0.86rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 142px;
}

.bank-filter-tabs .tab-btn.active {
  background: #e0f2fe;
  color: #075985;
  box-shadow: 0 1px 4px rgba(7, 89, 133, 0.16);
}

.bank-filter-tabs .tab-btn strong {
  color: #075985;
  font-size: 0.95rem;
  font-weight: 600;
}

.bank-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.bank-search-row label {
  display: grid;
  gap: 6px;
  color: #285346;
  font-size: 0.78rem;
  font-weight: 600;
}

.bank-search-row input {
  width: 100%;
  height: 38px;
  border: 1px solid #b9d4ff;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #172033;
  font-weight: 400;
}

.bank-search-row input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 52, 183, 0.12);
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.vat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.vat-list-head,
.vat-list-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 100px 160px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.vat-list-head {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.vat-list-row {
  background: #ffffff;
}

.vat-list-row:last-child {
  border-bottom: 0;
}

.vat-list-row strong {
  color: #075985;
  font-size: 1rem;
  font-weight: 600;
}

.vat-total-due-row strong {
  border-top: 2px solid #0f172a;
  padding-top: 5px;
}

.vat-net-pay-row strong {
  border-top: 2px solid #0f172a;
  border-bottom: 3px double #0f172a;
  padding-top: 5px;
  padding-bottom: 5px;
}

.app-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10000;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  box-shadow: 0 14px 32px rgba(18, 20, 32, 0.16);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.success {
  color: #14532d;
  background: #dcfce7;
  border-color: #86efac;
}

.app-toast.error {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fecaca;
}

@media (min-width: 901px) and (max-width: 1280px) {
  #home .home-tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-grid,
  .filter-grid.transaction-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  /* Keep compact financial statements and their figures visible together. */
  #reportTable:has(> thead > tr > th:last-child:nth-child(-n+4)) {
    min-width: 0;
  }

  #reportTable:has(> thead > tr > th:last-child:nth-child(-n+4)) :is(th, td):not(.money) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 900px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }

  .global-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    margin-top: 0;
    padding: 8px;
    border-right: none;
    border-top: 1px solid var(--line);
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .side-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    white-space: nowrap;
  }

  .content-shell {
    padding-bottom: 86px;
  }

  .app-topbar {
    grid-template-columns: 1fr auto;
  }

  .app-topbar-user {
    grid-column: auto;
  }

  .metric-grid,
  .home-grid,
  .home-financial-stats,
  .dashboard-card-grid,
  .vat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid.transaction-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .transaction-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounts-zero-toggle {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .settings-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-agent-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .home-agent-progress {
    grid-column: 1 / -1;
  }

  .home-agent-progress .home-status-head {
    justify-content: flex-start;
  }

  .home-attention-layout,
  .home-auto-summary {
    grid-template-columns: 1fr;
  }

  .home-auto-summary .home-check-list {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 620px) {
  .reports-list-panel {
    width: 100%;
  }

  .bank-feed-promo {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .bank-feed-promo-icon {
    width: 42px;
    height: 42px;
  }

  .bank-feed-promo .compact-action-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .capture-modal-promo {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .capture-modal-promo img {
    width: 44px;
    height: 44px;
  }

  .invoice-tool-icon {
    width: 44px;
    height: 44px;
  }

  .capture-modal-promo .compact-action-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  #reportsReportView > .panel {
    width: 100%;
  }

  #home .home-primary-action-grid,
  #home .home-primary-action-buttons {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    padding: 8px 12px;
    gap: 8px;
  }

  .app-topbar-user {
    align-items: center;
    flex-direction: row;
    gap: 4px;
  }

  .topbar-business-name {
    display: none;
  }

  .topbar-icon-btn,
  .account-menu-btn {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .topbar-tools-btn {
    min-height: 32px;
    padding: 6px 9px;
  }

  .notifications-menu {
    position: fixed;
    top: calc(var(--app-header-height) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
  }

  .account-menu {
    position: fixed;
    top: calc(var(--app-header-height) + 8px);
    right: 12px;
  }

  .metric-grid,
  .home-grid,
  .home-financial-stats,
  .home-quick-add-actions,
  .home-outstanding-grid,
  .dashboard-card-grid,
  .vat-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .home-agent-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .home-assistant-question-btn {
    align-self: flex-start;
  }

  .home-agent-progress {
    grid-column: 1;
  }

  .settings-subgrid {
    grid-template-columns: 1fr;
  }

  .settings-action-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .reconciliation-chart-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .chart-legend {
    width: 100%;
  }

  .snapshot-list {
    grid-template-columns: 1fr;
  }

  .bar-chart {
    gap: 8px;
    overflow-x: auto;
  }

  .bar-chart-item {
    min-width: 68px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid.transaction-filter-grid {
    grid-template-columns: 1fr;
  }

  .transaction-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounts-zero-toggle {
    grid-column: 1;
  }

  .reports-list {
    grid-template-columns: 1fr;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .bank-search-row {
    grid-template-columns: 1fr;
  }

  .vat-list-head,
  .vat-list-row {
    grid-template-columns: minmax(170px, 1fr) 70px 110px;
  }

  .wide {
    grid-column: auto;
  }

  .span-2,
  .span-4 {
    grid-column: auto;
  }

  .compact-action-btn {
    width: 100%;
  }

  .bank-heading-actions {
    width: 100%;
    flex-direction: column;
  }

  #openBankRulesViewBtn {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
  }

  #openBankImportModalBtn {
    width: 100%;
  }

  .page-title-row,
  .panel-title-row,
  .journal-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-title-row {
    align-items: center;
  }

  .home-title-row .home-header-action-btn {
    width: auto;
  }

  .home-progress-card {
    width: 100%;
  }
}

@media (max-width: 900px) {
  #home .home-grid {
    width: 100%;
  }

  #home .home-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #home .home-quick-add-actions,
  #home .home-grid > .home-quick-add-card .home-quick-add-actions,
  #home .home-grid > .dashboard-quick-card .quick-report-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #home .home-title-row {
    flex-direction: column;
    align-items: center;
  }

  #home .home-main-title {
    text-align: center;
    font-size: 1.75rem;
  }

  #home .home-header-actions {
    width: 100%;
  }

  #home .home-header-action-btn {
    flex: 1 1 0;
  }

  #home .home-agent-progress {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  #home .home-agent-progress-head,
  #home .home-progress-track,
  #home .home-agent-progress > .home-status-head {
    grid-column: 1;
    grid-row: auto;
  }

  #home .home-agent-progress > .home-status-head {
    justify-content: flex-start;
  }

  #home .home-quick-add-actions,
  #home .home-grid > .home-quick-add-card .home-quick-add-actions,
  #home .home-grid > .dashboard-quick-card .quick-report-list {
    grid-template-columns: 1fr;
  }

  #home .home-tools-grid {
    grid-template-columns: 1fr;
  }
}
