/* Practice Management — design system (load Plus Jakarta Sans via <link> in base.html) */

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f5f7fb;
  --bg-subtle: #eef2f7;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-hover: #1d4ed8;
  --sidebar: #0f172a;
  --sidebar-2: #0f172a;
  --sidebar-text: #f1f5f9;
  --sidebar-link: #cbd5f5;
  --sidebar-muted: #94a3b8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 60% at 100% 0%, rgba(37, 99, 235, 0.045), transparent 55%),
    radial-gradient(ellipse 80% 50% at 0% 100%, rgba(15, 23, 42, 0.03), transparent 50%);
  background-attachment: fixed;
}

.layout { display: flex; min-height: 100vh; width: 100%; }

/* —— Sidebar —— */
.sidebar {
  width: 252px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
  border-right: 1px solid rgba(30, 41, 59, 0.85);
}

.brand {
  padding: 1.35rem 1.25rem 1.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.brand-mark {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
}

.brand-tagline {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  opacity: 0.9;
}

.nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.65rem;
  flex: 1;
  gap: 0.2rem;
}

.nav a {
  color: var(--sidebar-link);
  text-decoration: none;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: inset 3px 0 0 transparent;
}
.nav a:link,
.nav a:visited {
  color: var(--sidebar-link);
}
.nav a:link,
.nav a:visited,
.nav a:hover,
.nav a:active,
.nav a:focus,
.nav a:focus-visible {
  text-decoration: none;
}
.nav a:active {
  color: #fff;
}

.nav a:hover {
  color: #f8fafc;
  background: #1e293b;
}

.nav a.active {
  color: #f8fafc;
  background: #1e293b;
  box-shadow: inset 3px 0 0 #2563eb;
}

.sidebar-foot {
  padding: 1rem 1.1rem 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-foot .user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--sidebar-text);
  font-size: 0.85rem;
}

.sidebar-foot .user-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.35);
}

.sidebar-foot a {
  color: var(--sidebar-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
}

.sidebar-foot a:hover { color: #fff; }

.sidebar-logout-form {
  margin: 0;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  text-align: left;
}

.sidebar-logout-btn:hover {
  color: #fff;
}

/* —— Main content —— */
.main {
  margin-left: 252px;
  flex: 1 1 auto;
  padding: 2rem 2.25rem 3rem;
  min-width: 0;
  width: 100%;
  max-width: none;
}

.page-header {
  margin-bottom: 1.75rem;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: var(--text);
}

.page-header h1 {
  margin: 0 0 0.35rem;
}

.page-header__lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 42rem;
}

.page-header__lead a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.page-header__lead a:hover {
  text-decoration: underline;
}

.page-header--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.page-header--split .page-header__intro {
  flex: 1 1 18rem;
  min-width: 0;
}
.page-header--split .page-header__intro .page-header__lead {
  max-width: 40rem;
}

/* ASIC company detail — client in page header (read-only link or legacy selector) */
.asic-company-page-header__intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.75rem;
}

.asic-company-page-header__text {
  flex: 1 1 14rem;
  min-width: 0;
}

.asic-header-client {
  flex: 1 1 16rem;
  max-width: min(100%, 26rem);
  min-width: min(100%, 14rem);
}

.asic-header-client__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #3949ab;
  margin-bottom: 0.28rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.asic-header-client__control .asic-header-client-select,
.asic-header-client__control select {
  width: 100%;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 1 auto;
  padding-top: 0.15rem;
}
.code-inline {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.86em;
  background: var(--panel-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.card__hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

h2 {
  font-size: 1rem;
  font-weight: 650;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.muted { color: var(--muted); font-size: 0.9rem; }

/* —— Buttons —— */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.toolbar { position: relative; z-index: 2; }
.stack-inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.row-actions--nowrap { flex-wrap: nowrap; white-space: nowrap; }

/* —— Email (Outlook-like shell) —— */
.email-shell {
  display: grid;
  grid-template-columns: 220px minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .email-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .email-read { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .email-shell { grid-template-columns: 1fr; }
}

.email-nav {
  padding: 0.85rem 0.85rem 0.9rem;
}
.email-nav__title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 0.55rem;
}
.email-nav__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.email-nav__label { flex: 1; min-width: 0; }
.email-nav__chev { color: #64748b; font-weight: 900; }
.email-nav__item:hover {
  background: var(--panel-muted);
}
.email-nav__item.is-active {
  background: rgba(79, 124, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.18);
}
.email-subfolders {
  margin: 0.35rem 0 0.6rem 0.95rem;
  display: grid;
  gap: 0.25rem;
}
.email-subfolders__new {
  justify-self: start;
  margin-bottom: 0.25rem;
}
.email-nav__subitem {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 650;
  font-size: 0.86rem;
}
.email-nav__subitem:hover {
  background: var(--panel-muted);
}
.email-nav__subitem.is-active {
  background: rgba(79, 124, 255, 0.10);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.14);
}
.email-nav__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(79, 124, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}

.email-list {
  padding: 0;
  overflow: hidden;
  min-width: 0;
}
.email-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 0.95rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,1));
}
.email-list__head-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.email-sync-bar {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
}
.email-sync-bar__track {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.email-sync-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #6366f1);
  transition: width 0.25s ease;
}
.email-sync-bar__text {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.email-list__commandbar {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(226,232,240,0.75);
  background: #fff;
}
.email-search input[type="search"] {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  background: rgba(248, 250, 252, 0.9);
}
.email-search input[type="search"]:focus {
  border-color: rgba(79, 124, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.14);
  background: #fff;
}
.email-list__folder {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}
.email-list__body {
  max-height: min(72vh, 780px);
  overflow: auto;
}
.email-row {
  display: block;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(226,232,240,0.75);
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: default;
  transition: background 160ms ease;
}
.email-row.is-unread .email-row__from,
.email-row.is-unread .email-row__subject {
  font-weight: 850;
}
.email-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.85);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  flex: 0 0 auto;
  margin-right: 0.5rem;
  opacity: 0;
}
.email-row.is-unread .email-row__dot {
  opacity: 1;
}
.email-row:link,
.email-row:visited,
.email-row:hover,
.email-row:active {
  color: inherit;
  text-decoration: none;
}
.email-row:focus {
  outline: none;
}
.email-row:focus-visible {
  outline: 2px solid rgba(79, 124, 255, 0.75);
  outline-offset: -2px;
}
.email-row:active {
  transform: none;
}
.email-row:hover {
  background: var(--panel-muted);
}
.email-row.is-selected {
  background: rgba(79, 124, 255, 0.10);
  border-left: 3px solid rgba(79, 124, 255, 0.75);
  padding-left: calc(0.9rem - 3px);
}
.email-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.email-row__from {
  font-weight: 750;
  font-size: 0.86rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  min-width: 0;
}
.email-row__date {
  font-size: 0.75rem;
  white-space: nowrap;
}
.email-row__subject {
  margin-top: 0.25rem;
  font-size: 0.86rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-row__preview {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.email-row__cc {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-read {
  padding: 0;
  overflow: hidden;
  min-width: 0;
}
.email-read.email-read--loading {
  transition: opacity 0.15s ease;
  opacity: 0.88;
}
.email-read__head {
  padding: 0.95rem 1.05rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,1));
}
.email-read__head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.email-read__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.email-move {
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  background: #fff;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
}
.email-move:disabled {
  opacity: 0.65;
}
.btn.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0.35rem 0 0.45rem;
}
.rte {
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  min-height: 140px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  outline: none;
}
.rte:focus {
  border-color: rgba(79, 124, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.16);
}
.rte--compose {
  min-height: 240px;
}
.pms-signature {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  color: #475569;
}
.email-read__subject {
  font-weight: 850;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.email-read__sub {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}
.email-read__body {
  padding: 1rem 1.05rem 1.15rem;
  max-height: min(72vh, 780px);
  overflow: auto;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  scrollbar-gutter: stable;
}
.email-frame {
  width: 100%;
  height: min(72vh, 780px);
  border: 0;
  display: block;
  background: #fff;
}
.email-read__body * {
  max-width: 100%;
  box-sizing: border-box;
}
.email-read__body img,
.email-read__body svg,
.email-read__body video,
.email-read__body canvas {
  max-width: 100% !important;
  height: auto !important;
}
.email-read__body table {
  max-width: 100% !important;
  width: auto !important;
}
.email-read__body pre,
.email-read__body code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.email-read__body a {
  color: var(--accent);
  text-decoration: underline;
}
.email-read__body a:hover {
  text-decoration: none;
}

.email-compose {
  width: min(880px, 96vw);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.35);
}
.email-compose::backdrop {
  background: rgba(2, 6, 23, 0.55);
}
.email-compose__form {
  margin: 0;
  padding: 0;
  background: #fff;
  max-height: min(88vh, 860px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.email-compose__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,1));
}
.email-compose__title {
  font-weight: 850;
  letter-spacing: -0.02em;
}
.email-compose__fields {
  padding: 0.95rem 1rem 0.8rem;
  display: grid;
  gap: 0.7rem;
  overflow: auto;
}
.email-compose__fields .field__label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 0.25rem;
}
.email-compose__fields input,
.email-compose__fields textarea {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  background: #fff;
}
.email-compose__fields textarea {
  resize: vertical;
  min-height: 220px;
}
.email-compose__fields input:focus,
.email-compose__fields textarea:focus {
  border-color: rgba(79, 124, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.16);
}
.email-compose__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  background: #fff;
  position: sticky;
  bottom: 0;
}
.email-read__empty {
  padding: 2.2rem 1.25rem;
  text-align: center;
}
.email-read__empty-title {
  font-weight: 800;
  margin-bottom: 0.35rem;
}
form.inline-form { display: inline; margin: 0; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.attach-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pms-doc-results {
  display: grid;
  gap: 0.5rem;
}
.pms-picker {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0.85rem;
}
@media (max-width: 860px) {
  .pms-picker { grid-template-columns: 1fr; }
}
.pms-pane {
  min-width: 0;
}
.pms-list {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.4rem;
}
.pms-autocomplete { position: relative; }
.pms-suggest {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.18);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.pms-suggest__item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  display: grid;
  gap: 0.1rem;
}
.pms-suggest__item:hover {
  background: rgba(37, 99, 235, 0.06);
}
.pms-suggest__name { font-weight: 850; color: var(--text); }
.pms-suggest__meta { font-size: 0.82rem; color: #64748b; }
.pms-suggest__empty { padding: 0.7rem; color: #64748b; font-size: 0.9rem; }
.pms-doc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.pms-doc-tools {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.pms-doc-tools input[type="search"] {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}
.pms-doc-tools input[type="search"]:focus {
  border-color: rgba(79, 124, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.14);
}
.pms-doc-row {
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.pms-doc-row:hover {
  background: rgba(248, 250, 252, 0.9);
}
.pms-doc-main { min-width: 0; }
.pms-doc-title {
  font-weight: 800;
  color: var(--text);
}
.pms-doc-meta {
  margin-top: 0.1rem;
  font-size: 0.82rem;
}

.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: rgba(30, 64, 175, 1);
  font-size: 0.82rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip__remove {
  border: 0;
  background: rgba(30, 64, 175, 0.08);
  color: rgba(30, 64, 175, 1);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  line-height: 18px;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.attach-chip__remove:hover {
  background: rgba(30, 64, 175, 0.14);
}
.attach-chip__remove:disabled {
  opacity: 0.6;
  cursor: default;
}

.pms-doc-add.is-loading {
  position: relative;
  opacity: 0.9;
}
.pms-doc-add.is-loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(37, 99, 235, 0.30);
  border-top-color: rgba(37, 99, 235, 0.95);
  display: inline-block;
  margin-left: 8px;
  vertical-align: -2px;
  animation: pmsSpin 0.8s linear infinite;
}
@keyframes pmsSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.btn:hover {
  background: var(--panel-muted);
  border-color: var(--border-strong);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25), 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
}

.btn.danger:hover {
  background: var(--danger-hover);
  filter: none;
}

.btn.outline,
a.btn.outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid #cbd5f5;
  box-shadow: none;
}

.btn.outline:hover,
a.btn.outline:hover {
  background: var(--panel-muted);
  border-color: #94a3b8;
  color: var(--text);
}

.btn.success {
  color: #fff;
  background: var(--success);
  border-color: transparent;
}
.btn.success:hover {
  filter: brightness(1.05);
}

.btn.warning {
  color: #fff;
  background: var(--warning);
  border-color: transparent;
}
.btn.warning:hover {
  filter: brightness(1.05);
}

.btn.soft {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.22);
  color: #1e40af;
}
.btn.soft:hover {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}

.btn.teal {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.35);
  color: #047857;
}
.btn.teal:hover {
  background: rgba(5, 150, 105, 0.18);
  border-color: rgba(5, 150, 105, 0.45);
}

.btn.purple {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.38);
  color: #4338ca;
}
.btn.purple:hover {
  background: rgba(99, 102, 241, 0.20);
  border-color: rgba(99, 102, 241, 0.5);
}

.btn.gray {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.28);
  color: #334155;
}
.btn.gray:hover {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(100, 116, 139, 0.38);
}

.btn.sky {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.38);
  color: #0369a1;
}
.btn.sky:hover {
  background: rgba(14, 165, 233, 0.20);
  border-color: rgba(14, 165, 233, 0.5);
}

.btn.rose {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.30);
  color: #9f1239;
}
.btn.rose:hover {
  background: rgba(225, 29, 72, 0.18);
  border-color: rgba(225, 29, 72, 0.42);
}

.btn.small { font-size: 0.8rem; padding: 0.3rem 0.6rem; }

/* —— Cards —— */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.card > h2:first-child {
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* —— KPI / stats —— */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* —— Dashboard: bank overview (Xero-style cards) —— */
.bank-overview {
  margin-bottom: 1.75rem;
}

.bank-overview__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.bank-overview__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.bank-overview__lead {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  flex: 1 1 100%;
}

.bank-overview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.bank-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.2rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bank-card__header {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.bank-card__client {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bank-card__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.bank-card__number {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
}

.bank-card__balances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.bank-card__balance-col--right {
  text-align: right;
}

.bank-card__amount {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.bank-card__amount--empty {
  font-weight: 600;
  color: var(--muted);
}

.bank-card__balance-label {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.bank-card__balance-date {
  white-space: nowrap;
}

.bank-card__status {
  flex: 1;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.bank-card__reconciled {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--success);
}

.bank-card__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.75rem;
  line-height: 1;
}

.bank-card__diff {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8125rem;
}

.bank-card__diff strong {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.bank-card__actions {
  margin-top: auto;
  padding-top: 1rem;
}

.bank-card__btn {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

/* —— Communication —— */
.comm-page {
  max-width: 1200px;
  margin: 0 auto;
}

.comm-tab-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 52rem;
}

.comm-tabstrip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.45rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}

.comm-tabstrip__btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(14, 165, 233, 0.38);
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.comm-tabstrip__btn:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.48);
}

.comm-tabstrip__btn.is-active,
.comm-tabstrip__btn[aria-selected='true'] {
  background: rgba(14, 165, 233, 0.26);
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 1px 8px rgba(14, 165, 233, 0.2);
  color: #0c4a6e;
}

.comm-tabstrip__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.comm-tabstrip__meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #0369a1;
}

.comm-tabstrip__btn.is-active .comm-tabstrip__meta,
.comm-tabstrip__btn[aria-selected='true'] .comm-tabstrip__meta {
  background: #fff;
  border-color: rgba(14, 165, 233, 0.5);
}

.comm-campaign-strip {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.comm-readonly-value {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #0f172a;
  padding: 0.2rem 0 0;
}

.comm-readonly-value--multiline {
  white-space: pre-wrap;
}

.comm-email-preview-frame {
  display: block;
  width: 100%;
  min-height: 360px;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.comm-tabpanels {
  min-height: 2rem;
}

.comm-tabpanel[hidden] {
  display: none !important;
}

.comm-tabpanel .comm-subheading {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.15rem 0 0.55rem;
  color: var(--text-primary);
}

/* Campaign edit page — not comm-shell (avoids any grid / cache confusion). */
.campaign-editor-page {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

.campaign-editor-page .campaign-edit-card {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  padding: 1.5rem 1.75rem 1.85rem;
  box-sizing: border-box;
}

.campaign-editor-page .compose__body textarea {
  min-height: clamp(300px, 42vh, 560px);
}

/* Communication now uses plain textareas on index page — no TinyMCE required. */

.comm-create-group {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--panel-muted) 0%, rgba(248, 250, 252, 0.7) 100%);
}

.comm-create-toggle > summary.btn {
  width: fit-content;
}
.comm-create-toggle[open] > summary.btn {
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.18);
}

.comm-create-toggle > form,
.comm-create-toggle > .o365-form {
  margin-top: 0.8rem;
}

/* Campaign action buttons row */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.btn-row .btn.primary {
  min-width: 9.5rem;
}
.btn-row .btn.send {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}
.btn-row .btn.send:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
}

/* Compliance choice (segmented) */
.segmented {
  display: inline-flex;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(255, 251, 235, 0.45);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.2rem;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented label {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: #92400e;
  border: 1px solid transparent;
}
.segmented label:hover {
  background: rgba(245, 158, 11, 0.12);
}
.segmented input:checked + label {
  background: #fff;
  border-color: rgba(217, 119, 6, 0.35);
  box-shadow: 0 1px 8px rgba(217, 119, 6, 0.14);
}

.comm-create-toggle > summary {
  list-style: none;
}
.comm-create-toggle > summary::-webkit-details-marker {
  display: none;
}
.comm-create-toggle[open] > summary {
  margin-bottom: 0.75rem;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem 1rem;
  align-items: start;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  user-select: none;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Client form: keep “same as” checkbox neat */
.client-addr-same {
  width: 100%;
  justify-content: flex-start;
  gap: 0.5rem;
}
.client-addr-same span {
  line-height: 1.25;
}
.check-row--align-start {
  align-items: flex-start;
}
.check-row--align-start input[type='checkbox'] {
  margin-top: 0.22rem;
  flex-shrink: 0;
}

.hint-row {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}

/* Office-like form styling (O365-ish) */
.o365-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.o365-section {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.o365-label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
}

.o365-input,
.o365-textarea,
.o365-select {
  width: 100%;
  max-width: none;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.o365-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(1em + 2px),
    calc(100% - 13px) calc(1em + 2px),
    100% 0;
  background-size:
    5px 5px,
    5px 5px,
    2.5em 2.5em;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

/* Button-like select (used for recipient group) */
.o365-select--pill {
  border-radius: 999px;
  font-weight: 650;
  padding: 0.6rem 2.35rem 0.6rem 0.85rem;
  border-color: rgba(14, 165, 233, 0.35);
  background-color: rgba(14, 165, 233, 0.08);
}
.o365-select--pill:focus {
  border-color: rgba(14, 165, 233, 0.85);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

/* OneDrive / SharePoint–style location picker */
.o365-select--folder {
  min-height: 2.75rem;
  font-weight: 500;
  border-color: #94a3b8;
  border-radius: 8px;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.o365-select--folder:hover {
  border-color: #64748b;
  background-color: #fafafa;
}
.o365-select--folder:focus {
  border-color: #2563eb;
  background-color: #fff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2), 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.doc-upload-title-input {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
  border-radius: 8px;
  border-color: #94a3b8;
  line-height: 1.4;
}
.doc-upload-title-input::placeholder {
  font-weight: 400;
  color: #94a3b8;
}
.doc-upload-title-input:hover {
  border-color: #64748b;
}

.doc-upload-o365-section {
  margin-bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.doc-upload-title-block {
  margin: 0;
}
.doc-upload-title-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}
.doc-upload-folder-block {
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid #e2e8f0;
}
.doc-upload-folder-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}
.doc-upload-folder-icon {
  flex-shrink: 0;
  align-self: center;
  width: 2.35rem;
  height: 1.85rem;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(165deg, #93c5fd 0%, #3b82f6 42%, #2563eb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 6px rgba(37, 99, 235, 0.25);
  position: relative;
}
.doc-upload-folder-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 46%;
  height: 42%;
  background: linear-gradient(180deg, #bfdbfe, #60a5fa);
  border-radius: 3px 5px 0 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.doc-upload-folder-select-wrap {
  flex: 1;
  min-width: 0;
}
.doc-upload-folder-select-wrap .o365-select--folder {
  width: 100%;
}
.doc-upload-folder-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.doc-upload-o365-section--secondary {
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
  padding: 1rem 1.05rem;
  gap: 1rem;
}
.doc-upload-form .o365-label {
  margin-bottom: 0.4rem;
}

.o365-input:focus,
.o365-textarea:focus,
.o365-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.o365-select.o365-select--folder:focus {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22), 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.o365-input.doc-upload-title-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15), 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.o365-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.o365-row .check-row {
  margin-top: 0.25rem;
}

.o365-body-editor .tox-tinymce {
  border-radius: 12px !important;
  border-color: #cbd5e1 !important;
}
.tox-tinymce {
  position: relative !important;
  z-index: 1;
}

.card-subsection {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.card-subsection__title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Form sections (campaign) */
.form-section {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

/* Outlook-like compose box (campaign body) */
.compose {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.compose__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(180deg, rgba(59, 91, 253, 0.08), rgba(248, 250, 252, 0.75));
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
}
.compose__title {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
}
.compose__meta {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}
.compose__body {
  padding: 0.75rem 0.85rem 0.25rem;
}
.compose__body textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 0;
  outline: none;
  padding: 0;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  background: transparent;
}
.compose__foot {
  padding: 0.5rem 0.85rem 0.75rem;
  border-top: 1px dashed rgba(203, 213, 225, 0.85);
  background: rgba(248, 250, 252, 0.6);
}
.form-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-section--template {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.10), rgba(248, 250, 252, 0.7));
  border-color: rgba(99, 102, 241, 0.25);
}
.form-section--message {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.10), rgba(248, 250, 252, 0.7));
  border-color: rgba(14, 165, 233, 0.25);
}
.form-section--recipients {
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.08), rgba(248, 250, 252, 0.7));
  border-color: rgba(5, 150, 105, 0.22);
}
.form-section--compliance {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.10), rgba(248, 250, 252, 0.7));
  border-color: rgba(217, 119, 6, 0.28);
}
.form-section--compliance .check-row {
  padding: 0.55rem 0.75rem;
  border: 1px dashed rgba(217, 119, 6, 0.35);
  border-radius: 12px;
  background: rgba(255, 251, 235, 0.55);
}

.form-section--send-as {
  background: linear-gradient(180deg, rgba(59, 91, 253, 0.08), rgba(248, 250, 252, 0.75));
  border-color: rgba(59, 91, 253, 0.22);
}

.campaign-send-as-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.campaign-send-as-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.campaign-send-as-option:hover {
  border-color: rgba(59, 91, 253, 0.35);
  box-shadow: 0 1px 0 rgba(59, 91, 253, 0.06);
}

.campaign-send-as-option input[type='radio'] {
  margin: 0.2rem 0 0;
  flex-shrink: 0;
}

.campaign-send-as-option__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.campaign-send-as-option__title {
  font-weight: 750;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.campaign-send-as-option__meta {
  font-size: 0.82rem;
  line-height: 1.4;
}

.campaign-send-as-option--muted {
  opacity: 0.72;
}

.campaign-send-as-option:has(input:disabled) {
  cursor: not-allowed;
  background: rgba(248, 250, 252, 0.85);
}

.pill--sky {
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.35);
}
.pill--teal {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.campaign-sent-card h2 {
  margin-bottom: 0.35rem;
}
.campaign-sent-meta {
  display: grid;
  gap: 0.65rem 1.25rem;
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.campaign-sent-meta > div {
  margin: 0;
}
.campaign-sent-meta dt {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.campaign-sent-meta dd {
  margin: 0;
  font-weight: 600;
  color: var(--text-secondary);
}
.campaign-sent-subhead {
  margin: 1.35rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.campaign-sent-subhead--small {
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 700;
}
.campaign-sent-body {
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  max-height: min(480px, 55vh);
  overflow: auto;
}
.campaign-sent-extra-list {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}
.campaign-sent-actions {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.campaign-sent-actions__hint {
  margin: 0.65rem 0 0;
  max-width: 42rem;
  line-height: 1.45;
}

/* Recipient picker (chips) */
.recipient-picker {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.75rem 0.75rem 0.65rem;
}
.recipient-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-muted);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.recipient-chip__meta {
  font-weight: 500;
  color: var(--muted);
}
.recipient-chip__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.recipient-chip__remove:hover {
  color: var(--danger);
}
.recipient-picker__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
}
.recipient-picker__input {
  flex: 1 1 auto;
  min-width: 12rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
}
.recipient-picker__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.token-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.45rem;
}

.recipient-suggest {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.recipient-suggest__item {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}
.recipient-suggest__item:hover {
  background: rgba(59, 91, 253, 0.06);
}
.recipient-suggest__name {
  font-weight: 650;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipient-suggest__email {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .comm-tabstrip__btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 140px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.stat {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0.9;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat .status-badge {
  margin: 0;
}

.stat__kpi-badge {
  display: flex;
  align-items: center;
  min-height: 2.35rem;
}

.stat strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.stat span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.stat--clients::before { height: 4px; background: #2563eb; }
.stat--clients { background: linear-gradient(180deg, #ffffff 0%, #eff6ff 120%); }

.stat--open::before { height: 4px; background: #059669; }
.stat--open { background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 120%); }

.stat--risk::before { height: 4px; background: #dc2626; }
.stat--risk { background: linear-gradient(180deg, #ffffff 0%, #fef2f2 120%); }

.stat--today::before { height: 4px; background: #d97706; }
.stat--today { background: linear-gradient(180deg, #ffffff 0%, #fffbeb 120%); }

/* —— Tables —— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* —— Jobs work overview (New jobs) — match reference layout — */
.jobs-overview {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.25rem 0 2rem;
  color: #0f172a;
}

.jobs-overview--job-list {
  max-width: none;
  width: 100%;
  padding: 0.35rem 0 1rem;
}

.jobs-overview__page-title {
  margin: 0 0 1.25rem;
}

.jobs-overview__h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.jobs-overview__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .jobs-overview__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.jobs-overview__metric {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.jobs-overview__metric-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
}

.jobs-overview__metric-badge--blue {
  background: #2b6cb0;
  color: #fff;
}

.jobs-overview__metric-badge--purple {
  background: #9f7aea;
  color: #fff;
}

.jobs-overview__metric-badge--neutral {
  background: #edf2f7;
  color: #2d3748;
  border: 1px solid #e2e8f0;
}

.jobs-overview__metric-text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.35;
}

.jobs-overview__section-kicker {
  margin: 0 0 0.65rem;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #0f172a;
}

.jobs-overview__section-kicker strong {
  font-weight: 800;
}

.jobs-overview__tabstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.4rem;
  background: #edf2f7;
  border-radius: 10px;
}

.jobs-overview__pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #4a5568;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.jobs-overview__pill:hover {
  color: #1a202c;
  background: rgba(255, 255, 255, 0.65);
}

.jobs-overview__pill.is-active {
  background: #fff;
  color: #2b6cb0;
  border-color: #bee3f8;
  box-shadow: 0 1px 3px rgba(43, 108, 176, 0.12);
}

/* Inactive pills: soft tint from status colour (avoids neon full-chroma borders on white). */
.jobs-overview__pill--themed:not(.is-active) {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  -webkit-text-fill-color: #475569;
}

.jobs-overview__tabstrip .jobs-overview__pill--themed:not(.is-active):hover {
  filter: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  background-color: #e8eef5;
  border-color: #cbd5e1;
  color: #334155;
  -webkit-text-fill-color: #334155;
}

@supports (background: color-mix(in srgb, white 50%, black)) {
  .jobs-overview__pill--themed:not(.is-active) {
    background-color: color-mix(in srgb, var(--pill-accent, #64748b) 12%, #ffffff);
    border-color: color-mix(in srgb, var(--pill-accent, #64748b) 20%, #e2e8f0);
    color: color-mix(in srgb, var(--pill-accent, #64748b) 42%, #334155);
    -webkit-text-fill-color: color-mix(in srgb, var(--pill-accent, #64748b) 42%, #334155);
  }

  .jobs-overview__tabstrip .jobs-overview__pill--themed:not(.is-active):hover {
    background-color: color-mix(in srgb, var(--pill-accent, #64748b) 18%, #ffffff);
    border-color: color-mix(in srgb, var(--pill-accent, #64748b) 32%, #cbd5e1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    color: color-mix(in srgb, var(--pill-accent, #64748b) 48%, #1e293b);
    -webkit-text-fill-color: color-mix(in srgb, var(--pill-accent, #64748b) 48%, #1e293b);
  }
}

.jobs-overview__pill--themed.is-active {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.jobs-overview__toolbar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.jobs-overview__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.1rem;
}

.jobs-overview__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 7.5rem;
}

.jobs-overview__field-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #718096;
}

.jobs-overview__select,
.jobs-overview__input {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1a202c;
  min-width: 9.5rem;
}

.jobs-overview__select:focus,
.jobs-overview__input:focus {
  outline: none;
  border-color: #90cdf4;
  box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.jobs-overview__field--due {
  min-width: 10.5rem;
}

.jobs-overview__due-wrap {
  position: relative;
  display: block;
}

.jobs-overview__due-wrap .jobs-overview__input {
  width: 100%;
  min-width: 0;
  padding-right: 2.25rem;
}

.jobs-overview__due-icon {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  pointer-events: none;
  display: flex;
}

.jobs-overview__apply {
  margin-left: auto;
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2b6cb0;
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: 8px;
  cursor: pointer;
}

.jobs-overview__apply:hover {
  background: #bee3f8;
}

.jobs-overview__add-job {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: #2b6cb0;
  border-radius: 8px;
  border: none;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.35);
}

.jobs-overview__add-job:hover {
  background: #2c5282;
  color: #fff;
}

.jobs-overview__list-shell {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  background: #fff;
}

.jobs-overview__list-shell .jobs-overview__table-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.jobs-overview__table-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  overflow: auto;
}

.jobs-overview__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.jobs-overview__table th,
.jobs-overview__table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
}

.jobs-overview__table thead th {
  background: #f7fafc;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #718096;
}

.jobs-overview__table tbody tr:hover td {
  background: #f7fafc;
}

.jobs-overview__th-check {
  width: 2.75rem;
}

.jobs-overview__client-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #1a202c;
}

.jobs-overview__period {
  color: #4a5568;
  font-size: 0.8125rem;
  line-height: 1.35;
  max-width: 14rem;
  white-space: normal;
  word-break: break-word;
}

.jobs-overview__client-meta {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: #718096;
}

.jobs-overview__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2b6cb0;
  text-decoration: none;
  background: #fff;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
}

.jobs-overview__edit:hover {
  border-color: #90cdf4;
  background: #ebf8ff;
}

.jobs-overview__empty {
  padding: 2rem !important;
  text-align: center;
}

.jobs-overview__list-shell .jobs-overview__bulk-bar {
  border: none;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
}

.jobs-overview__bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0;
  padding: 0.75rem 1.1rem;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.jobs-overview__bulk-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4a5568;
}

.jobs-overview__bulk-apply {
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: #2b6cb0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.jobs-overview__bulk-apply:hover {
  background: #2c5282;
}

.jobs-overview__pagination {
  margin-top: 1.1rem;
}

.jobs-overview__hint {
  margin-top: 1rem;
  font-size: 0.8125rem;
}

.card .table-wrap {
  box-shadow: none;
}

/* Client dashboard: ref + status stacked in one column */
.client-list-ref-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

/* Client list: many columns — use full width; slightly denser cells to reduce horizontal scroll */
.table-wrap--clients {
  width: 100%;
}
.table-wrap--clients table.data {
  width: 100%;
}
.table-wrap--clients table.data th,
.table-wrap--clients table.data td {
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
}

/* Client dashboard: make header row more attractive */
.table-wrap--clients table.data thead th {
  background: #f1f5f9;
  border-bottom-color: var(--border);
}
.table-wrap--clients table.data thead th a {
  color: var(--text-secondary);
}

/* Document library index: not the client roster — avoid fixed nth-column widths */
.table-wrap--documents {
  width: 100%;
}
.table-wrap--documents table.data {
  table-layout: auto;
  width: 100%;
}
.table-wrap--documents table.data thead th {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--text-secondary);
}
.table-wrap--documents table.data tbody td {
  vertical-align: middle;
  font-size: 0.875rem;
}
.table-wrap--documents table.data th:nth-child(1),
.table-wrap--documents table.data td.doc-lib-td-ref {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
.table-wrap--documents table.data th:nth-child(2),
.table-wrap--documents table.data td.doc-lib-td-name {
  min-width: 10rem;
  max-width: 22rem;
  font-weight: 600;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
.doc-lib-th-action,
.doc-lib-td-action {
  text-align: right;
  white-space: nowrap;
}

/* Jobs dashboard: match clients header row style */
.table-wrap--job-list table.data thead th {
  background: #f1f5f9;
  border-bottom-color: var(--border);
  font-weight: 700;
}
.table-wrap--job-list table.data thead th a {
  color: var(--text-secondary);
  font-weight: 700;
}

.table-wrap--journal-list table.data thead th {
  background: #f1f5f9;
  border-bottom-color: var(--border);
}
.table-wrap--journal-list table.data thead th a {
  color: var(--text-secondary);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.data th,
table.data td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table.data th {
  background: #f1f5f9;
  font-weight: 650;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
}

table.data tbody tr:last-child td { border-bottom: none; }

table.data tbody tr:hover td { background: #f8fafc; }

/* Job list: inline status / priority dropdowns (change without opening edit) */
.job-status-cell,
.job-priority-cell {
  vertical-align: middle;
}

.job-status-inline-select {
  box-sizing: border-box;
  max-width: min(100%, 12rem);
  width: 100%;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: #fff;
  color: var(--text);
  cursor: pointer;
  line-height: 1.25;
  /* Hide native chevron — not required; whole control still opens the list on click. */
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
}

.job-status-inline-select::-ms-expand {
  display: none;
}

.job-status-inline-select:hover {
  border-color: #cbd5e1;
}

/* Status dropdown on Jobs list: tint from Practice setup → Job statuses colour */
.layout.layout--saas .main .table-wrap--job-list .job-status-inline-select.job-status-inline-select--accent {
  border-color: color-mix(in srgb, var(--status-accent, #64748b) 32%, #e2e8f0);
  background-color: color-mix(in srgb, var(--status-accent, #64748b) 14%, #ffffff);
  color: color-mix(in srgb, var(--status-accent, #64748b) 48%, #1e293b);
  -webkit-text-fill-color: color-mix(in srgb, var(--status-accent, #64748b) 48%, #1e293b);
}

.layout.layout--saas .main .table-wrap--job-list .job-status-inline-select.job-status-inline-select--accent:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--status-accent, #64748b) 42%, #cbd5e1);
  background-color: color-mix(in srgb, var(--status-accent, #64748b) 20%, #ffffff);
}

.layout.layout--saas .main .table-wrap--job-list .job-status-inline-select.job-status-inline-select--accent:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--status-accent, #64748b) 55%, #93c5fd);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-accent, #64748b) 22%, transparent);
}

@supports not (background: color-mix(in srgb, white 50%, black)) {
  .layout.layout--saas .main .table-wrap--job-list .job-status-inline-select.job-status-inline-select--accent {
    border-color: var(--status-accent, #64748b);
    background-color: #f8fafc;
    color: #334155;
    -webkit-text-fill-color: #334155;
  }
}

.table-wrap--job-list .job-status-inline-select:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Job list: status column; rows stay neutral */
.table-wrap--job-list table.data tbody tr.job-row--status > td {
  background-color: transparent;
}
.table-wrap--job-list table.data tbody tr.job-row--status:hover > td {
  background: #f8fafc;
}

/* Job list: priority indicator (right-side bar). */
.table-wrap--job-list table.data tbody tr.job-row--prio-urgent > td { box-shadow: inset -4px 0 0 rgba(220, 38, 38, 0.85); }

/*
 * Status badges — app-wide (jobs, clients, e-sign, campaigns, ASIC, etc.).
 * Modifier class suffix = django slugify(display label). .job-status-badge kept as alias.
 */
.status-badge,
.job-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid transparent;
}

/* Job workflow (canonical colours) */
.status-badge--not-started,
.job-status-badge--not-started { background: #fef3c7; color: #92400e; border-color: rgba(146, 64, 14, 0.12); }
.status-badge--in-progress,
.job-status-badge--in-progress { background: #dbeafe; color: #1d4ed8; border-color: rgba(29, 78, 216, 0.12); }
.status-badge--review,
.job-status-badge--review { background: #e9d5ff; color: #6b21a8; border-color: rgba(107, 33, 168, 0.12); }
.status-badge--complete,
.status-badge--completed,
.status-badge--closed,
.status-badge--done,
.job-status-badge--complete,
.job-status-badge--completed,
.job-status-badge--closed,
.job-status-badge--done { background: #dcfce7; color: #166534; border-color: rgba(22, 101, 52, 0.12); }
.status-badge--overdue,
.job-status-badge--overdue { background: #fee2e2; color: #991b1b; border-color: rgba(153, 27, 27, 0.12); }

.status-badge--waiting,
.status-badge--on-hold,
.status-badge--pending,
.job-status-badge--waiting,
.job-status-badge--on-hold,
.job-status-badge--pending { background: #e0e7ff; color: #3730a3; border-color: rgba(55, 48, 163, 0.1); }
.status-badge--cancelled,
.job-status-badge--cancelled { background: #f1f5f9; color: #64748b; border-color: var(--border); }

/* Client roster — same green family as before, slightly matted so it is not glossy / “shining” */
.status-badge--active,
.job-status-badge--active {
  background: #d6ebe0;
  color: #166534;
  border-color: rgba(22, 101, 52, 0.14);
}
/* Archived — red tint (inactive / out of roster), softer than error “declined” */
.status-badge--archived,
.job-status-badge--archived {
  background: #fcefef;
  color: #b42323;
  border-color: rgba(180, 35, 35, 0.16);
}

/* E-sign envelope + signer */
.status-badge--draft,
.job-status-badge--draft { background: #fef3c7; color: #92400e; border-color: rgba(146, 64, 14, 0.12); }
.status-badge--sent,
.job-status-badge--sent { background: #dbeafe; color: #1d4ed8; border-color: rgba(29, 78, 216, 0.12); }
.status-badge--declined,
.job-status-badge--declined { background: #fee2e2; color: #991b1b; border-color: rgba(153, 27, 27, 0.12); }
.status-badge--signed,
.job-status-badge--signed { background: #dcfce7; color: #166534; border-color: rgba(22, 101, 52, 0.12); }

/* Email campaigns */
.status-badge--scheduled,
.job-status-badge--scheduled { background: #e0e7ff; color: #3730a3; border-color: rgba(55, 48, 163, 0.1); }
.status-badge--sending,
.job-status-badge--sending { background: #dbeafe; color: #1d4ed8; border-color: rgba(29, 78, 216, 0.12); }
.status-badge--failed,
.job-status-badge--failed { background: #fee2e2; color: #991b1b; border-color: rgba(153, 27, 27, 0.12); }

/* Deliveries / misc “open pipeline” */
.status-badge--queued,
.job-status-badge--queued { background: #fef3c7; color: #92400e; border-color: rgba(146, 64, 14, 0.12); }
.status-badge--delivered,
.job-status-badge--delivered { background: #dcfce7; color: #166534; border-color: rgba(22, 101, 52, 0.12); }

/* Ledger FY — “Open” reads as active; “Closed” shares completed terminal styling */
.status-badge--open,
.job-status-badge--open { background: #dcfce7; color: #166534; border-color: rgba(22, 101, 52, 0.12); }

/* ASIC registry headline */
.status-badge--registered,
.job-status-badge--registered { background: #dcfce7; color: #166534; border-color: rgba(22, 101, 52, 0.12); }
.status-badge--other-unknown,
.job-status-badge--other-unknown { background: #f1f5f9; color: #64748b; border-color: var(--border); }

/* Jobs bulk: assign popovers in header (same row as Add / Export) */
.page-header__actions .bulk-assign {
  align-self: flex-start;
}
.bulk-assign {
  position: relative;
}
.bulk-assign > summary {
  list-style: none;
}
.bulk-assign > summary::-webkit-details-marker {
  display: none;
}
.bulk-assign__panel {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-width: min(18rem, calc(100vw - 2rem));
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.bulk-assign__panel select {
  flex: 1 1 10rem;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
}

table.data a { color: var(--accent); font-weight: 600; text-decoration: none; }
table.data a:hover { text-decoration: underline; }

.planned-jobs-formset table.planned-jobs-table { font-size: 0.875rem; }
.planned-jobs-table select,
.planned-jobs-table input[type='number'],
.planned-jobs-table input.planned-due-full {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 0.875rem;
}
.planned-jobs-table input.planned-due-full {
  max-width: 8.5rem;
}
.input-ddmm {
  max-width: 9rem;
  font-size: 0.875rem;
}
.planned-jobs-table .planned-jobs-notes textarea {
  min-width: 7rem;
  max-width: 16rem;
  min-height: 2.75rem;
  font-size: 0.8125rem;
}
.planned-period-start-full,
.planned-period-end-full {
  width: 100%;
  box-sizing: border-box;
}
.planned-jobs-table th.planned-jobs-del,
.planned-jobs-table td.planned-jobs-del {
  width: 3.75rem;
  text-align: center;
  vertical-align: middle;
}
.planned-jobs-table th.planned-jobs-check,
.planned-jobs-table td.planned-jobs-check {
  width: 2.25rem;
  text-align: center;
  vertical-align: middle;
}

.planned-jobs-table th.planned-jobs-job,
.planned-jobs-table td.planned-jobs-job {
  min-width: 14rem;
}

/* —— Client add/edit (two-column) —— */
.client-form-shell {
  max-width: 1120px;
  margin: 0 auto;
}

.client-form-header {
  margin-bottom: 1.25rem;
}

.client-form-title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.client-form-lead {
  margin: 0;
  max-width: 48rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

form.client-form.card {
  padding: 1.5rem 1.6rem 1.35rem;
}

.client-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
}

@media (max-width: 880px) {
  .client-form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.client-form-col {
  min-width: 0;
}

.client-form-col--primary {
  padding: 1.1rem 1.25rem;
  background: linear-gradient(165deg, var(--panel-muted) 0%, rgba(248, 250, 252, 0.72) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.client-form-col--secondary {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.client-form-section + .client-form-section {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}

.client-form-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--muted);
}

.client-form-section__title--emphasize {
  font-size: 0.78rem;
  color: var(--accent-hover);
  letter-spacing: 0.07em;
}

.client-form-help {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

form.client-form.stacked .client-form-grid label.stack {
  margin-bottom: 0.75rem;
}

form.client-form.stacked .client-form-grid input,
form.client-form.stacked .client-form-grid select,
form.client-form.stacked .client-form-grid textarea {
  max-width: none;
}

.client-form-full {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.client-form-planned__intro {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 56rem;
}

.related-clients-widget {
  position: relative;
}
.related-clients-hidden-inputs {
  /* Values submitted via type="hidden" inputs (no clipped multi-select). */
  margin: 0;
  padding: 0;
  border: 0;
}
.client-form-errors {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: rgba(254, 242, 242, 0.85);
  border-radius: var(--radius);
}
.client-form-errors__title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: #991b1b;
}
.client-form-errors__list {
  margin: 0;
  padding-left: 1.2rem;
}
.related-clients-widget__search {
  position: relative;
  margin-top: 0.35rem;
}
.related-clients-widget__search-label {
  margin-bottom: 0;
}
.related-clients-widget__label-text {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.related-clients-widget__input {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font: inherit;
  background: var(--panel);
  box-sizing: border-box;
}
.related-clients-suggest {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.25rem 0;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
}
.related-clients-suggest__item {
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-bottom: 1px solid var(--border);
}
.related-clients-suggest__item:last-child {
  border-bottom: 0;
}
.related-clients-suggest__item:hover,
.related-clients-suggest__item:focus-within {
  background: var(--accent-soft);
}
.related-clients-suggest__label {
  font-weight: 600;
}
.related-clients-suggest__ref {
  font-size: 0.8rem;
}
.related-clients-suggest__empty {
  padding: 0.5rem 0.65rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.related-clients-chips {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.related-clients-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 91, 253, 0.25);
  font-size: 0.85rem;
}
.related-clients-chip__remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.15rem;
  color: var(--text-secondary);
}
.related-clients-chip__remove:hover {
  color: var(--danger, #b91c1c);
}

/* —— Tag multi-select dropdown —— */
.client-form-section--tags .client-tags-hint {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  line-height: 1.4;
}
.client-form-section--tags .client-tags-field-label {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.client-form-section--tags .client-tags-field {
  margin-bottom: 0.55rem;
}

.tag-ms {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.tag-ms__btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.2;
}
.tag-ms__btn.is-empty { color: var(--muted); }
.tag-ms__btn:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tag-ms__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  padding: 0.4rem;
  display: none;
  box-sizing: border-box;
  max-height: 14rem;
  overflow: auto;
}
.tag-ms.is-open .tag-ms__panel { display: block; }
.tag-ms__opt {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: start;
  column-gap: 0.5rem;
  row-gap: 0.1rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tag-ms__opt:hover { background: var(--panel-muted); }
.tag-ms__opt input {
  width: 1rem;
  height: 1rem;
  margin: 0.1rem 0 0;
  justify-self: start;
}
.tag-ms__text {
  font-size: 0.875rem;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.settings-tag-swatch {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  vertical-align: middle;
  margin-right: 0.35rem;
}

.client-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

/* —— Forms —— */
form.stacked label.stack { display: block; margin-bottom: 0.85rem; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
form.stacked input,
form.stacked select,
form.stacked textarea {
  display: block;
  width: 100%;
  max-width: 42rem;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

form.stacked input:focus,
form.stacked select:focus,
form.stacked textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* —— Job add / edit form (card layout) —— */
.job-edit-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 0.25rem 0 2.5rem;
}

.job-edit-card {
  display: block;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.job-edit-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.35rem 1.5rem 1.15rem;
  border-bottom: 1px solid #e2e8f0;
}

.job-edit-card__header-text {
  min-width: 0;
  flex: 1 1 12rem;
}

.job-edit-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.25;
}

.job-edit-card__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #718096;
  line-height: 1.45;
}

.job-edit-card__stage {
  flex-shrink: 0;
  text-align: right;
  font-size: 0.875rem;
  line-height: 1.4;
}

.job-edit-card__stage-prefix {
  font-weight: 600;
  color: #4a5568;
  margin-right: 0.35rem;
}

.job-edit-card__stage-name {
  font-weight: 700;
  color: #2b6cb0;
}

.job-edit-card__body {
  padding: 1.35rem 1.5rem 1.5rem;
}

.job-edit-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .job-edit-card__grid {
    grid-template-columns: 1fr;
  }
  .job-edit-card__stage {
    text-align: left;
    width: 100%;
  }
}

.job-edit-card__col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.job-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.job-edit-field--grow textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.job-edit-field__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #718096;
}

.job-edit-field__hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #a0aec0;
}

.job-edit-field--check .job-edit-field__check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2d3748;
  cursor: pointer;
}

.job-edit-field--check .job-edit-field__check-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.job-edit-field__static {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #2d3748;
}

.job-edit-field--info {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #f7fafc;
  border: 1px solid #edf2f7;
}

.job-edit-field--info .job-edit-field__hint a {
  color: #3182ce;
  font-weight: 600;
  text-decoration: none;
}

.job-edit-field--info .job-edit-field__hint a:hover {
  text-decoration: underline;
}

.job-edit-card select,
.job-edit-card input[type='text'],
.job-edit-card input[type='search'],
.job-edit-card input[type='number'],
.job-edit-card input[type='date'],
.job-edit-card textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1a202c;
}

.job-edit-card select:focus,
.job-edit-card input:focus,
.job-edit-card textarea:focus {
  outline: none;
  border-color: #90cdf4;
  box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.job-edit-card select:disabled,
.job-edit-card input:disabled {
  background: #f7fafc;
  color: #718096;
  cursor: not-allowed;
}

.job-edit-card textarea {
  line-height: 1.45;
}

.job-edit-card .errorlist {
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: #c53030;
}

.job-edit-card > .errorlist {
  margin: 0 1.5rem;
  padding: 0.75rem 0 0;
}

.job-edit-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
}

.job-edit-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.job-edit-card__btn--primary {
  color: #fff;
  background: #2b6cb0;
  border-color: #2b6cb0;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.35);
}

.job-edit-card__btn--primary:hover {
  background: #2c5282;
  border-color: #2c5282;
}

.job-edit-card__btn--cancel {
  color: #1a202c;
  background: #fff;
  border-color: #cbd5e0;
}

.job-edit-card__btn--cancel:hover {
  border-color: #a0aec0;
  background: #f7fafc;
}

/* Shared form footer (e.g. settings user edit) */
.job-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.filters { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: flex-end; margin-bottom: 1.15rem; }
.filters label { font-size: 0.78rem; font-weight: 500; display: flex; flex-direction: column; gap: 0.3rem; color: var(--text-secondary); }
.filters input,
.filters select {
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  min-width: 8.5rem;
  font: inherit;
}

.pagination { margin-top: 1rem; font-size: 0.9rem; display: flex; gap: 0.75rem; align-items: center; }

/* —— Messages —— */
.messages { list-style: none; padding: 0; margin: 0 0 1.15rem; }
.messages li { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.9rem; }
.messages li:not(.error) {
  background: var(--success-soft);
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.messages li.error {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* —— Login —— */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 45%, #0f766e 100%);
  padding: 1.5rem;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 2rem;
  width: min(920px, 100%);
  justify-content: center;
}

.login-brand {
  flex: 1 1 240px;
  max-width: 340px;
  padding: 1.5rem 0.5rem;
  color: rgba(241, 245, 249, 0.95);
  align-self: center;
}

.login-brand__title {
  display: inline-block;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.login-brand__title span {
  color: #2dd4bf;
  font-weight: 600;
}

.login-brand__tagline {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(148, 163, 184, 0.95);
}

.login-back {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.login-back a {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
}

.login-back a:hover {
  color: #2563eb;
}

@media (max-width: 720px) {
  .login-brand {
    text-align: center;
    max-width: none;
    padding-bottom: 0;
  }
}

.login-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(59, 91, 253, 0.35), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.25), transparent 40%);
  pointer-events: none;
}

.login-card {
  position: relative;
  background: rgba(255, 255, 255, 0.97);
  padding: 2.25rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.5);
  width: min(400px, 100%);
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  margin-bottom: 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stack { display: block; margin-bottom: 0.85rem; }
.btn.full { width: 100%; margin-top: 0.65rem; }
.error { color: var(--danger); font-weight: 500; }

/* —— Pills & misc —— */
.pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

/* Recent campaigns status coloring */
.campaign-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--panel-muted);
  color: var(--text-secondary);
}
.campaign-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.campaign-status--sent {
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.22);
  color: #065f46;
}
.campaign-status--sent::before { background: #059669; }

.campaign-status--failed {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.22);
  color: #991b1b;
}
.campaign-status--failed::before { background: #dc2626; }

.campaign-status--draft {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.24);
  color: #92400e;
}
.campaign-status--draft::before { background: #d97706; }

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.35rem;
  text-align: center;
  color: var(--muted);
  margin: 0.5rem 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }

/* —— Client document library (upload + folders) —— */
.doc-client-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 960px) {
  .doc-client-layout {
    /* Explorer ~20% narrower than right */
    grid-template-columns: minmax(520px, 1fr) minmax(0, 1.25fr);
  }
  .doc-client-aside { order: 0; }
  .doc-client-main { order: 0; }
}
@media (max-width: 959px) {
  .doc-client-aside { order: 2; }
  .doc-client-main { order: 1; }
  .doc-folders-aside--related-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}

.doc-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.doc-panel-input,
.doc-panel-select,
.doc-folder-form input[type="text"],
.doc-folder-form select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font: inherit;
  background: var(--panel);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-panel-input:focus,
.doc-panel-select:focus,
.doc-folder-form input:focus,
.doc-folder-form select:focus {
  outline: none;
  border-color: rgba(59, 91, 253, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 91, 253, 0.12);
}

/* Folders: real .btn outside any card; expanded form in a separate snapshot card */
.doc-folders-aside {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
@media (min-width: 960px) {
  .doc-folders-aside--related-nav {
    display: grid;
    grid-template-columns: minmax(148px, 178px) minmax(0, 1fr);
    gap: 0.85rem 1rem;
    align-items: start;
  }
  .doc-folders-aside--related-nav .doc-related-lib-nav {
    grid-column: 1;
  }
  .doc-folders-aside--related-nav .doc-aside-explorer-column {
    grid-column: 2;
    min-width: 0;
  }
}
.doc-related-lib-nav {
  padding: 0.85rem 1rem 1rem;
  margin-bottom: 0;
}
.doc-related-lib-nav__title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.doc-related-lib-nav__lead {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.45;
}
.doc-related-lib-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.doc-related-lib-nav__link {
  display: block;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--accent-hover);
  text-decoration: none;
}
.doc-related-lib-nav__link:hover {
  background: var(--accent-soft);
}
.doc-related-lib-nav__current {
  display: block;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(59, 91, 253, 0.12);
  border: 1px solid rgba(59, 91, 253, 0.22);
}
.doc-related-lib-nav__ref {
  font-weight: 500;
  font-size: 0.78rem;
}
.page-header__banner {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 48rem;
}

.doc-aside-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem 0.75rem;
  margin-bottom: 0.65rem;
}
.doc-aside-toolbar .doc-folders-disclosure {
  flex: 1 1 auto;
  min-width: min(100%, 11rem);
}
.doc-aside-toolbar__email {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.doc-email-attach-block {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.doc-email-attach-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
}
.doc-email-attach-hint--strong {
  color: var(--text);
  font-size: 0.88rem;
}
.doc-email-attach-details {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-muted);
}
.doc-email-attach-details__head {
  margin-bottom: 0.5rem;
}
.doc-email-attach-details__label {
  margin-bottom: 0.25rem;
}
.doc-email-attach-details__lead {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.doc-email-attach-details__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.doc-email-attach-details__item {
  margin: 0;
}
.doc-email-attach-details__main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  line-height: 1.4;
}
.doc-email-attach-details__text {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.doc-email-pick-layout {
  display: grid;
  gap: 0.85rem 1rem;
  align-items: start;
}
@media (min-width: 640px) {
  .doc-email-pick-layout {
    grid-template-columns: minmax(148px, 200px) minmax(0, 1fr);
  }
}
.doc-email-pick-nav {
  padding: 0.75rem 0.85rem 0.9rem;
  margin: 0;
}
.doc-email-pick-nav__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.doc-email-pick-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.doc-email-pick-nav__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--accent-hover);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.doc-email-pick-nav__btn:hover {
  background: var(--panel-muted);
  border-color: var(--border);
}
.doc-email-pick-nav__btn.is-current {
  background: rgba(59, 91, 253, 0.1);
  border-color: rgba(59, 91, 253, 0.35);
  color: var(--text);
  font-weight: 650;
}
.doc-email-pick-nav__name {
  display: block;
}
.doc-email-pick-nav__ref {
  font-size: 0.78rem;
}
.doc-email-pick-explorer-wrap {
  min-width: 0;
}
.doc-email-pick-explorer {
  padding: 0.75rem 0.85rem 0.9rem;
  margin: 0;
}
.doc-email-pick-explorer__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.doc-email-pick-explorer__body {
  max-height: min(42vh, 24rem);
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 0.35rem 0.45rem 0.5rem;
}
.doc-email-pick-explorer__body .doc-file-explorer {
  margin: 0;
}
.doc-email-pick-explorer__body .doc-file-explorer__root {
  margin: 0;
  padding: 0;
}
.doc-email-file-path {
  font-size: 0.75rem;
  margin-left: 0.25rem;
}
.doc-lib-dialog--email .doc-file-explorer__summary .doc-email-add-folder {
  flex-shrink: 0;
  margin-left: auto;
}
.doc-lib-dialog--email .doc-file-explorer__file-main .doc-email-add-doc {
  flex-shrink: 0;
}
.doc-email-attach-error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(254, 242, 242, 0.9);
  border: 1px solid rgba(185, 28, 28, 0.35);
  color: #991b1b;
  font-size: 0.88rem;
}
.doc-email-lib {
  margin-bottom: 0.9rem;
}
.doc-email-lib:last-child {
  margin-bottom: 0;
}
.doc-email-lib__title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
}
.doc-email-lib__ref {
  font-weight: 500;
  font-size: 0.82rem;
}
.doc-email-lib__subtitle {
  margin: 0.55rem 0 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.doc-email-lib__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-email-lib__row {
  margin: 0.22rem 0;
}
.doc-email-lib__row label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  cursor: pointer;
  line-height: 1.38;
}
.doc-email-lib__row input[type='checkbox'] {
  margin-top: 0.22rem;
  flex-shrink: 0;
}
.doc-email-lib__empty {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}
.doc-email-attach-summary {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
}

.doc-folders-disclosure {
  margin: 0;
  padding: 0;
  border: 0;
}
.doc-folders-disclosure__summary {
  list-style: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.doc-folders-disclosure__summary::-webkit-details-marker {
  display: none;
}
.doc-folders-disclosure__summary::marker {
  content: '';
}
.doc-folders-disclosure__summary:focus {
  outline: none;
}
.doc-folders-disclosure__cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  pointer-events: none;
  margin: 0;
}
.doc-folders-disclosure__summary:focus-visible .doc-folders-disclosure__cta {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}
.doc-folders-snapshot {
  margin-top: 0.9rem;
  padding: 1.2rem 1.3rem 1.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  background: var(--panel);
}

.doc-folders-panel__head {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card .doc-folders-panel__title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  padding-bottom: 0;
  border: none;
}
.doc-folders-panel__lead {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.doc-folder-form__submit {
  width: 100%;
  margin-top: 0.25rem;
}
.doc-folder-form .stack { margin-bottom: 0.75rem; }

.doc-file-explorer-card {
  margin-top: 1rem;
  padding: 1.2rem 1.25rem 1.3rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  background: var(--panel);
  min-width: 0;
}
.doc-file-explorer__head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.card .doc-file-explorer__title {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  padding-bottom: 0;
  border: none;
}
.doc-file-explorer__lead {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.doc-file-explorer__empty {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}
.doc-lib-toolbar {
  margin-bottom: 0.85rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.doc-lib-toolbar__status {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
}
.doc-lib-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}
.doc-lib-toolbar__clear {
  margin-left: auto;
}
@media (max-width: 420px) {
  .doc-lib-toolbar__clear {
    margin-left: 0;
    flex-basis: 100%;
  }
}

.doc-lib-dialog {
  padding: 0;
  border: none;
  border-radius: var(--radius-lg, 10px);
  max-width: calc(100vw - 2rem);
  width: min(22rem, 100%);
  background: transparent;
  box-shadow: none;
}
.doc-lib-dialog--wide {
  width: min(30rem, 100%);
}
.doc-lib-dialog--email {
  width: min(46rem, calc(100vw - 1.5rem));
  max-height: min(92vh, 900px);
}
.doc-lib-dialog--email .doc-lib-dialog__panel {
  max-height: min(88vh, 860px);
  overflow-y: auto;
  overflow-x: hidden;
}
.doc-lib-email-hint {
  margin: 0 0 0.65rem;
  font-size: 0.74rem;
  line-height: 1.45;
}
.doc-lib-email-body {
  min-height: 8rem;
  resize: vertical;
  font-family: inherit;
}
.doc-lib-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.doc-lib-dialog__panel {
  padding: 1.15rem 1.2rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  box-shadow: var(--shadow-md);
}

/* Upload dialog: nicer header + accent styling */
.doc-lib-dialog--upload {
  --upload-accent: #4F7CFF;
  --upload-accent-hover: #3f6cff;
  --upload-text: #1F2A37;
  --upload-muted: #6B7280;
  --upload-field-bg: #F7F9FC;
  --upload-border: rgba(148, 163, 184, 0.45);

  width: min(28rem, 100%);
}
.doc-lib-dialog--upload .doc-lib-dialog__panel {
  border-radius: 14px;
  border-color: rgba(79, 124, 255, 0.22);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  padding: 0;
}
.doc-lib-dialog--upload .doc-upload-dialog__head {
  padding: 1.05rem 1.1rem 0.9rem;
  background:
    radial-gradient(ellipse 120% 80% at 20% 0%, rgba(79, 124, 255, 0.20), transparent 60%),
    linear-gradient(180deg, rgba(248, 250, 252, 1) 0%, rgba(241, 245, 249, 1) 100%);
  border-bottom: 1px solid rgba(79, 124, 255, 0.14);
}
.doc-lib-dialog--upload .doc-lib-dialog__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 750;
  color: var(--upload-text);
}
.doc-lib-dialog--upload .doc-lib-dialog__title::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.16);
  border: 1px solid rgba(79, 124, 255, 0.28);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}
.doc-lib-dialog--upload .doc-lib-dialog__form {
  padding: 1rem 1.1rem 1.1rem;
}
.doc-lib-dialog--upload .doc-lib-dialog__label {
  margin-bottom: 0.85rem;
}
.doc-lib-dialog--upload .doc-panel-input,
.doc-lib-dialog--upload .doc-panel-select,
.doc-lib-dialog--upload select,
.doc-lib-dialog--upload input[type="text"],
.doc-lib-dialog--upload input[type="file"],
.doc-lib-dialog--upload textarea {
  border-color: var(--upload-border);
  background: var(--upload-field-bg);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}
.doc-lib-dialog--upload .doc-panel-input:focus,
.doc-lib-dialog--upload .doc-panel-select:focus,
.doc-lib-dialog--upload select:focus,
.doc-lib-dialog--upload input[type="text"]:focus,
.doc-lib-dialog--upload input[type="file"]:focus,
.doc-lib-dialog--upload textarea:focus {
  border-color: rgba(79, 124, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.16);
}
.doc-lib-dialog--upload .doc-lib-dialog__footer {
  margin-top: 0.2rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(79, 124, 255, 0.10);
}

/* Upload dialog form layout */
.doc-upload-dialog__grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 520px) {
  .doc-lib-dialog--upload {
    width: min(34rem, 100%);
  }
  .doc-upload-dialog__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem 1rem;
  }
  .doc-upload-dialog__field--title {
    grid-column: 1 / -1;
  }
  .doc-upload-dialog__field--file {
    grid-column: 1 / -1;
  }
}
.doc-upload-dialog__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Folder select with icon */
.doc-upload-dialog__select-wrap {
  position: relative;
  display: block;
}
.doc-upload-dialog__select-wrap .doc-upload-dialog__select-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 14px;
  border-radius: 3px;
  background: rgba(79, 124, 255, 0.18);
  border: 1px solid rgba(79, 124, 255, 0.28);
}
.doc-upload-dialog__select-wrap select {
  padding-left: 2.45rem;
}
.doc-upload-dialog__select-wrap select:focus {
  background: rgba(79, 124, 255, 0.08);
}

/* Tags chips (rendered by JS) */
.doc-upload-dialog__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.doc-upload-dialog__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.14);
  color: #1e40af;
  border: 1px solid rgba(79, 124, 255, 0.22);
  font-size: 0.72rem;
  font-weight: 650;
}
.doc-upload-dialog__chip button {
  border: none;
  background: transparent;
  color: #1e40af;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 0.9em;
}
.doc-upload-dialog__chip button:hover {
  color: #0b2aa8;
}

/* File upload: dashed dropzone */
.doc-upload-dropzone__surface {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  padding: 1.1rem 1rem;
  border-radius: 14px;
  border: 2px dashed rgba(79, 124, 255, 0.45);
  background: rgba(79, 124, 255, 0.06);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.doc-upload-dropzone__surface:hover,
.doc-upload-dropzone__surface:focus {
  outline: none;
  border-style: solid;
  border-color: rgba(79, 124, 255, 0.8);
  background: rgba(79, 124, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.14);
}
.doc-upload-dropzone.dragover .doc-upload-dropzone__surface {
  border-style: solid;
  border-color: rgba(79, 124, 255, 0.9);
  background: rgba(79, 124, 255, 0.10);
}
.doc-upload-dropzone__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(79, 124, 255, 0.16);
  border: 1px solid rgba(79, 124, 255, 0.25);
}
.doc-upload-dropzone__text {
  color: var(--upload-muted);
  font-size: 0.9rem;
  text-align: center;
}
.doc-upload-dropzone__browse {
  color: var(--upload-accent);
  font-weight: 700;
}
.doc-upload-dropzone__meta {
  font-size: 0.78rem;
}

/* Buttons: accent + hover lift */
.doc-lib-dialog--upload .btn.primary {
  background: var(--upload-accent);
  border-color: rgba(79, 124, 255, 0.9);
  color: #fff;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.doc-lib-dialog--upload .btn.primary:hover {
  background: var(--upload-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(79, 124, 255, 0.25);
}
.doc-lib-dialog--upload .btn.soft {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.65);
  color: var(--upload-text);
}
.doc-lib-dialog__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
}
.doc-lib-dialog__lead {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
}
.doc-lib-dialog__form .stack {
  margin-bottom: 0;
}
.doc-lib-dialog__label {
  margin-bottom: 1rem;
}
.doc-lib-dialog__select,
.doc-lib-dialog__text {
  width: 100%;
  box-sizing: border-box;
}
.doc-lib-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.doc-lib-dialog__panel--danger {
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(220, 38, 38, 0.06);
}

.doc-file-explorer {
  min-height: 15rem;
  max-height: min(70vh, 36rem);
  overflow: auto;
  padding-right: 0.15rem;
  margin-right: -0.15rem;
}
.doc-file-explorer__root,
.doc-file-explorer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-file-explorer__list {
  padding: 0.2rem 0 0.35rem 0.5rem;
  margin-left: 0.35rem;
  border-left: 1px solid var(--border);
}
.doc-file-explorer__details {
  border-radius: var(--radius-sm);
}
.doc-file-explorer__details > .doc-file-explorer__list {
  margin-top: 0.15rem;
}
.doc-file-explorer__check {
  flex-shrink: 0;
  width: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-file-explorer__check--spacer {
  flex-shrink: 0;
  width: 1.2rem;
}
.doc-file-explorer__check input[type='checkbox'] {
  width: 0.88rem;
  height: 0.88rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent, #3b5bfd);
}
.doc-file-explorer__summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  cursor: pointer;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.12s ease;
}
.doc-file-explorer__summary:hover {
  background: var(--panel-muted);
}
.doc-file-explorer__summary::-webkit-details-marker {
  display: none;
}
.doc-file-explorer__summary::marker {
  content: '';
}
.doc-file-explorer__chev {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  margin-right: 0.15rem;
  margin-left: 0.1rem;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.doc-file-explorer__details[open] > .doc-file-explorer__summary .doc-file-explorer__chev {
  transform: rotate(45deg);
  margin-top: -0.1rem;
}
.doc-file-explorer__folder-icon {
  width: 1rem;
  height: 0.75rem;
  flex-shrink: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(59, 91, 253, 0.35) 0%, rgba(59, 91, 253, 0.18) 100%);
  border: 1px solid rgba(59, 91, 253, 0.35);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}
.doc-file-explorer__label {
  flex: 1 1 auto;
  min-width: 0;
}
.doc-file-explorer__meta {
  font-size: 0.72rem;
  font-weight: 500;
  flex-basis: 100%;
  padding-left: 0;
}
@media (min-width: 340px) {
  .doc-file-explorer__meta {
    flex-basis: auto;
    margin-left: auto;
  }
}
.doc-file-explorer__node--file {
  display: block;
  padding: 0.32rem 0.45rem 0.32rem 0.55rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  margin: 0.1rem 0;
  border: 1px solid transparent;
}
.doc-file-explorer__file-main {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem 0.45rem;
  width: 100%;
  min-width: 0;
}
.doc-file-explorer__node--file:hover {
  background: var(--panel-muted);
  border-color: var(--border);
}
.doc-file-explorer__file-icon {
  width: 0.55rem;
  height: 0.75rem;
  flex-shrink: 0;
  margin-left: 0;
  border-radius: 1px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: 1px 1px 0 var(--border);
}
.doc-file-explorer__file-title {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-file-explorer__file-ver {
  font-size: 0.72rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.doc-file-explorer__file-actions {
  flex-shrink: 0;
  white-space: nowrap;
}
.doc-file-explorer__dl {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
}

.doc-move-select {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
  font-size: 0.78rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font: inherit;
}
.doc-library-panel__th-check {
  width: 2rem;
}
.doc-library-panel__check {
  width: 2rem;
  vertical-align: middle;
  text-align: center;
}
.doc-library-panel__check .doc-lib-pick--doc {
  width: 0.88rem;
  height: 0.88rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent, #3b5bfd);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.doc-upload-panel__head {
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card .doc-upload-panel__head h2 {
  margin: 0 0 0.35rem;
  padding-bottom: 0;
  border: none;
  font-size: 1.05rem;
}

/* Upload form: two columns, distinct tinted panels */
.doc-upload-form__two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 1.35rem;
  align-items: stretch;
  margin-bottom: 0.25rem;
}
/* Upload file + tags/note share ~50% width; library table ~50% (1fr + 1fr + 2fr). */
.doc-upload-form__three-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1rem 1.2rem;
  align-items: stretch;
  margin-bottom: 0.25rem;
}
@media (max-width: 1200px) {
  .doc-upload-form__three-col {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-upload-form__three-col .doc-upload-col--library-table {
    grid-column: 1 / -1;
  }
}
@media (max-width: 880px) {
  .doc-upload-form__two-col {
    grid-template-columns: 1fr;
  }
  .doc-upload-form__three-col {
    grid-template-columns: 1fr;
  }
  .doc-upload-form__three-col .doc-upload-col--library-table {
    grid-column: auto;
  }
}

.doc-upload-col {
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem 1.2rem;
  min-width: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.doc-upload-col--details {
  background: linear-gradient(
    165deg,
    rgba(59, 91, 253, 0.09) 0%,
    rgba(238, 242, 255, 0.55) 42%,
    rgba(248, 250, 252, 0.98) 100%
  );
  border-color: rgba(59, 91, 253, 0.18);
}

.doc-upload-col--meta {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(
    165deg,
    rgba(5, 150, 105, 0.07) 0%,
    rgba(236, 253, 245, 0.4) 38%,
    rgba(248, 250, 252, 0.98) 100%
  );
  border-color: rgba(5, 150, 105, 0.2);
}

.doc-upload-tags-block {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(59, 91, 253, 0.12);
}
.doc-upload-note-block {
  margin-top: 0.65rem;
}

.doc-upload-col__label {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.doc-upload-col__label--details {
  color: #3730a3;
}
.doc-upload-col__label--library {
  color: #0f766e;
}
.doc-upload-col--library-table {
  background: linear-gradient(
    165deg,
    rgba(15, 118, 110, 0.06) 0%,
    rgba(240, 253, 250, 0.45) 40%,
    rgba(248, 250, 252, 0.98) 100%
  );
  border-color: rgba(15, 118, 110, 0.2);
}
.doc-upload-library-table-hint {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  line-height: 1.4;
}
.doc-upload-library-table-wrap {
  max-height: min(52vh, 28rem);
  overflow: auto;
  margin: 0;
  width: 100%;
}
.doc-upload-col--library-table .data {
  font-size: 0.76rem;
  table-layout: fixed;
  width: 100%;
}
.doc-upload-col--library-table .data th,
.doc-upload-col--library-table .data td {
  padding: 0.34rem 0.4rem;
}

/* Library table column sizing (more compact ~25%) */
.doc-upload-col--library-table .data th.doc-library-panel__th-check,
.doc-upload-col--library-table .data td.doc-library-panel__check {
  width: 34px;
}
.doc-upload-col--library-table .data th.doc-lib-col-title,
.doc-upload-col--library-table .data td.doc-lib-col-title {
  width: 34%;
}
.doc-upload-col--library-table .data th.doc-lib-col-folder,
.doc-upload-col--library-table .data td.doc-lib-col-folder {
  width: 18%;
}
.doc-upload-col--library-table .data th.doc-lib-col-tags,
.doc-upload-col--library-table .data td.doc-lib-col-tags {
  width: 26%;
}
.doc-upload-col--library-table .data th.doc-lib-col-actions,
.doc-upload-col--library-table .data td.doc-lib-col-actions {
  width: 92px;
  white-space: nowrap;
}
.doc-upload-col--library-table .doc-lib-title {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-upload-col--library-table .doc-lib-pill {
  font-size: 0.68rem;
  padding: 0.16rem 0.42rem;
}

/* Flatten nested o365 grey boxes inside tinted columns */
.doc-upload-col .o365-section.doc-upload-o365-section--in-col {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  margin-bottom: 0;
}
.doc-upload-col--details .doc-upload-folder-block {
  border-top-color: rgba(59, 91, 253, 0.14);
}

.doc-upload-file-block {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(59, 91, 253, 0.14);
}

.doc-dropzone--in-col {
  margin-bottom: 0;
}
.doc-upload-col--details .doc-upload-file-errors {
  margin-top: 0.5rem;
}

.doc-upload-col--meta .doc-upload-o365-section--secondary {
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
}

.doc-upload-form__grid--secondary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.doc-upload-form__field--wide { grid-column: 1 / -1; }
.doc-upload-form .stack { margin-bottom: 0; }
.doc-upload-form__actions--in-col {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(5, 150, 105, 0.22);
}
.doc-upload-form__btn {
  min-width: 11rem;
  box-shadow: 0 2px 12px rgba(59, 91, 253, 0.25);
}

.doc-dropzone {
  position: relative;
  margin: 0 0 1rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.doc-dropzone.dragover {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, #fff 45%);
  box-shadow: 0 0 0 2px rgba(59, 91, 253, 0.2), 0 8px 28px rgba(59, 91, 253, 0.1);
}

/* Native file input is display:none; #docChooseFileBtn calls input.click() */
.doc-upload-native-hidden {
  display: none !important;
}
.doc-upload-native-hidden input[type='file'],
input#doc-upload-file.doc-upload-file-input--sr {
  display: none !important;
}

.doc-dropzone:focus-within {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.doc-dropzone__surface {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.65rem 1.5rem 1.5rem;
  min-height: 9.5rem;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  margin: 0.85rem;
  background: linear-gradient(165deg, #fafbfc 0%, #f8fafc 100%);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.doc-dropzone__surface--minimal {
  min-height: 6.5rem;
  padding: 1.25rem 1rem;
}
.doc-dropzone.dragover .doc-dropzone__surface {
  border-color: var(--accent);
  background: rgba(232, 236, 255, 0.35);
}

/* Clickable drop area (no separate “Choose file” button) */
.doc-dropzone__surface--clickable {
  cursor: pointer;
  user-select: none;
}
.doc-dropzone__surface--clickable:hover {
  border-color: #94a3b8;
  background: linear-gradient(165deg, #f1f5f9 0%, #f8fafc 100%);
}
.doc-dropzone__surface--clickable:focus {
  outline: none;
}
.doc-dropzone__surface--clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.doc-dropzone.dragover .doc-dropzone__surface--clickable:focus-visible {
  outline-color: var(--accent-hover);
}

.doc-dropzone__file {
  position: relative;
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  text-align: center;
}
.doc-dropzone__file-name {
  font-weight: 650;
  color: var(--text);
  word-break: break-all;
}

.doc-library-panel__head {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card .doc-library-panel__head h2 {
  margin: 0 0 0.35rem;
  padding-bottom: 0;
  border: none;
  font-size: 1.05rem;
}
.doc-library-panel .table-wrap {
  margin-bottom: 0;
}
.doc-library-panel__empty {
  padding: 1.25rem 0.5rem !important;
  text-align: center;
}

.pill--folder {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.28);
}

.client-field-group.is-hidden { display: none !important; }

/* Client form: JS toggles is-hidden on these wrappers (not .client-field-group). */
.client-tax-company-fields.is-hidden,
.client-tax-acn-fields.is-hidden {
  display: none !important;
}

.sort-ind { color: var(--muted); font-weight: 600; font-size: 0.85em; }

/* —— Reports hub & link cards —— */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.report-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.15s ease;
}

.report-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.35);
}

.report-card__title {
  font-weight: 650;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 0.35rem;
}

.report-card--wide {
  grid-column: 1 / -1;
}

.report-card__desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
  flex: 1;
  line-height: 1.45;
}

/* Column flex stretches children by default — keep actions button-sized, not full card width */
.report-card > .btn {
  align-self: flex-start;
  text-align: center;
}

.report-card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.report-card__actions .btn.small { margin: 0; }

/* Planned work report: search + sort bar */
.planned-work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-end;
  margin-top: 0.35rem;
}
.planned-work-filters__search { flex: 1 1 16rem; min-width: 12rem; margin: 0; }
.planned-work-filters__sort { flex: 0 1 12rem; margin: 0; }
.planned-work-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.15rem;
}
.planned-work-filters__count { margin: 1rem 0 0; font-size: 0.88rem; }
.planned-work-filters input[type="search"],
.planned-work-filters select { width: 100%; max-width: 100%; }

/* Job type edit: inline bulk due date (per period row) */
.bulk-due-cell {
  vertical-align: top;
  min-width: 11rem;
}
.bulk-due-cell__panel {
  margin-top: 0.5rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  max-width: 22rem;
}
.bulk-due-cell__form {
  margin: 0;
}
.bulk-due-cell__date-label span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.bulk-due-cell__date {
  width: 100%;
  max-width: 100%;
  margin-top: 0.2rem;
}
.bulk-due-cell__only-open {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
}
.bulk-due-cell__form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.65rem;
}

/* Settings — job names: add type dialog + shared job type form */
.settings-job-names__bulk-link {
  white-space: nowrap;
  vertical-align: middle;
}
.settings-job-names__bulk-link .btn {
  max-width: 100%;
}

.settings-job-status-swatch {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  vertical-align: middle;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

/* Edit job type — in-page anchors from job names list */
#bulk-periods,
#bulk-due-editing-option {
  scroll-margin-top: 1.25rem;
}
.settings-job-type-dialog {
  border: none;
  padding: 0;
  max-width: calc(100vw - 1.5rem);
  width: min(40rem, 100%);
  max-height: calc(100vh - 1.5rem);
  background: transparent;
}
.settings-job-type-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}
.settings-job-type-dialog__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 1.5rem);
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  overflow: hidden;
}
.settings-job-type-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), var(--panel));
  flex-shrink: 0;
}
.settings-job-type-dialog__titlewrap {
  flex: 1;
  min-width: 0;
}
.settings-job-type-dialog__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}
.settings-job-type-dialog__subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 400;
  max-width: 32rem;
}
.settings-job-type-dialog__close {
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.settings-job-type-dialog .settings-job-type-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Generic stacked create form inside settings dialogs (priorities, statuses, tags, users) */
.settings-job-type-dialog__panel > form.stacked {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.35rem 0;
  gap: 0;
}

.settings-job-type-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.95rem 1.35rem 1.15rem;
  margin-top: 0;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.65);
  flex-shrink: 0;
}

/* Job type form (dialog + edit page) */
.settings-job-type-form__nonfield .errorlist {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.22);
  color: #b91c1c;
  font-size: 0.88rem;
  list-style: none;
}
.settings-job-type-dialog .settings-job-type-form__nonfield {
  padding: 0 1.35rem;
  flex-shrink: 0;
}
.settings-job-type-dialog__panel > form.stacked .settings-job-type-form__nonfield {
  padding: 0;
  margin-bottom: 0.25rem;
}
.settings-job-type-dialog .settings-job-type-form__nonfield .errorlist {
  margin: 0.75rem 0 0;
}
.settings-job-type-form--page .settings-job-type-form__nonfield .errorlist {
  margin-bottom: 0.75rem;
}
.settings-job-type-form__body {
  padding: 1.1rem 1.35rem 0.25rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.settings-job-type-form--page .settings-job-type-form__body {
  padding: 0.25rem 0 0.5rem;
  overflow: visible;
}
.settings-job-type-form__group {
  margin-bottom: 1.25rem;
}
.settings-job-type-form__group--tight {
  margin-bottom: 0.35rem;
}
.settings-job-type-form__group-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-job-type-form__field {
  display: block;
  margin-bottom: 0.95rem;
}
.settings-job-type-form__field:last-child {
  margin-bottom: 0;
}
.settings-job-type-form__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.settings-job-type-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}
@media (max-width: 28rem) {
  .settings-job-type-form__row {
    grid-template-columns: 1fr;
  }
}
.settings-job-type-form input[type="text"],
.settings-job-type-form input[type="number"],
.settings-job-type-form select,
.settings-job-type-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.settings-job-type-form input:focus,
.settings-job-type-form select:focus,
.settings-job-type-form textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.settings-job-type-form__help {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}
.settings-job-type-form .errorlist {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: #b91c1c;
}
.settings-job-type-form__check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.8);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  width: fit-content;
  max-width: 100%;
}
.settings-job-type-form__check:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #fff;
}
.settings-job-type-form__check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.settings-job-type-form__check-label {
  user-select: none;
}
.settings-job-type-form__footer--page {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.settings-job-type-form__body .job-type-bulk-card {
  margin-top: 0.15rem;
  margin-bottom: 1.1rem;
}
.settings-job-type-form__body .job-type-bulk-card__title {
  margin-bottom: 0;
}

/* Job type forms — “Enable bulk editing?” */
.job-type-bulk-card {
  margin: 0.35rem 0 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(160deg, var(--accent-soft), rgba(255, 255, 255, 0.94));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}
.job-type-bulk-card__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.1rem 1.1rem;
}
@media (min-width: 40rem) {
  .job-type-bulk-card__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.35rem;
  }
}
.job-type-bulk-card__text {
  flex: 1;
  min-width: 0;
}
.job-type-bulk-card__title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}
.job-type-bulk-card__note {
  margin: 0.25rem 0 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 400;
}
.job-type-bulk-card__hint {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38rem;
}
.job-type-bulk-card__control {
  flex-shrink: 0;
}
.job-type-bulk-card__errors {
  padding: 0 1rem 0.85rem;
  font-size: 0.82rem;
}
.job-type-bulk-card__errors .errorlist {
  margin: 0;
}

/* Django RadioSelect uses a div.job-type-bulk-radio-list (or ul on older templates) */
.job-type-bulk-radio-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
}
.job-type-bulk-radio-list > li,
.job-type-bulk-radio-list > div {
  margin: 0;
  padding: 0;
  list-style: none;
}
.job-type-bulk-radio-list li label,
.job-type-bulk-radio-list > div label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 3.75rem;
  justify-content: center;
  padding: 0.42rem 1rem;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.job-type-bulk-radio-list li label:hover,
.job-type-bulk-radio-list > div label:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.95);
}
.job-type-bulk-radio-list li label:has(input:checked),
.job-type-bulk-radio-list > div label:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-hover);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
}
.job-type-bulk-radio-list li label:has(input:focus-visible),
.job-type-bulk-radio-list > div label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.job-type-bulk-radio-list input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.job-type-bulk-radio-list li label:has(input:checked) input[type="radio"],
.job-type-bulk-radio-list > div label:has(input:checked) input[type="radio"] {
  accent-color: #fff;
}

/* —— Documents index: empty state —— */
.doc-empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem 2.75rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.doc-empty-state__icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--accent-soft), rgba(99, 102, 241, 0.08));
  border: 1px dashed rgba(59, 91, 253, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.doc-empty-state__title {
  border: none;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.doc-empty-state__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.doc-empty-state__text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.doc-empty-state__text a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .main { margin-left: 220px; padding: 1.25rem 1.25rem 2rem; }
}

@media (max-width: 640px) {
  .page-header__actions {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
  }
  .brand { border-bottom: none; border-right: 1px solid rgba(148, 163, 184, 0.12); flex: 0 0 auto; }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1;
    padding: 0.65rem;
  }
  .nav a { padding: 0.45rem 0.65rem; font-size: 0.82rem; }
  .sidebar-foot {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .main { margin-left: 0; max-width: none; }
}

/* —— Company registration wizard (reference-style layout) —— */
.biz-reg-repeat {
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
}
.biz-reg-formset-list {
  margin-top: 0.35rem;
}

.biz-reg-wizard {
  max-width: 68rem;
}
.biz-reg-wizard > .card {
  padding: 0;
  overflow: hidden;
}
.biz-reg-form {
  margin: 0;
}
.biz-reg-stepper-wrap {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, var(--panel-muted), var(--panel));
  border-bottom: 1px solid var(--border);
}
.biz-reg-stepper {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  min-width: min(100%, 52rem);
  margin: 0 auto;
  justify-content: space-between;
}
.biz-reg-stepper__item {
  flex: 1 1 0;
  min-width: 5.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.biz-reg-stepper__item:hover {
  border-color: var(--accent);
  color: var(--text);
}
.biz-reg-stepper__num {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--panel-muted);
  border: 1px solid var(--border);
}
.biz-reg-stepper__item.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.biz-reg-stepper__item.is-active .biz-reg-stepper__num {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.biz-reg-stepper__item.is-done:not(.is-active) {
  border-color: rgba(59, 91, 253, 0.35);
  background: rgba(59, 91, 253, 0.06);
}
.biz-reg-step {
  padding: 1.15rem 1.25rem 1.5rem;
}
.biz-reg-section {
  margin-bottom: 1.35rem;
}
.biz-reg-section:last-child {
  margin-bottom: 0;
}
.biz-reg-section__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #e8e8e8;
  border: 1px solid #d4d4d4;
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
}
.biz-reg-section__icons {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.biz-reg-help-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid #555;
  background: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  color: #333;
}
.biz-reg-section__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1rem 1.5rem;
  padding: 1rem 0 0;
  align-items: start;
}
.biz-reg-section__grid > .biz-reg-reg-occupier-other--span {
  grid-column: 1 / -1;
}
.biz-reg-section__grid--stack {
  grid-template-columns: 1fr;
}
@media (max-width: 800px) {
  .biz-reg-section__grid {
    grid-template-columns: 1fr;
  }
}
.biz-reg-section__fields {
  min-width: 0;
}
.biz-reg-section__fields label.stack,
.biz-reg-section__fields .check-row {
  margin-bottom: 0.75rem;
}
.biz-reg-section__fields label.stack {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
/* Corporate beneficiary / appointor: ACN, name, registration date — one row, inputs aligned */
.biz-reg-section__fields .trust-deed-corp-identity-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: stretch;
}
.biz-reg-section__fields .trust-deed-corp-identity-row > label.stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0 !important;
  min-height: 100%;
}
.biz-reg-section__fields .trust-deed-corp-identity-row > label.stack > input,
.biz-reg-section__fields .trust-deed-corp-identity-row > label.stack > select,
.biz-reg-section__fields .trust-deed-corp-identity-row > label.stack > textarea {
  margin-top: auto;
}
.biz-reg-section__fields .trust-deed-corp-identity-row > label.stack > ul.errorlist {
  margin-top: 0.35rem;
  margin-bottom: 0;
}
@media (max-width: 800px) {
  .biz-reg-section__fields .trust-deed-corp-identity-row {
    grid-template-columns: 1fr;
  }
}
/* Corporate trustee: ACN + name + date — top-aligned inputs, even gaps (no margin-top:auto stagger) */
.biz-reg-section__fields .trust-deed-corp-identity-row--trustee-company {
  align-items: start;
  grid-template-columns: minmax(9.5rem, 11.5rem) minmax(0, 1fr) minmax(11.5rem, 13.5rem);
  gap: 0.5rem 1rem;
}
.biz-reg-section__fields .trust-deed-corp-identity-row--trustee-company > label.stack {
  min-height: 0;
}
.biz-reg-section__fields .trust-deed-corp-identity-row--trustee-company > label.stack > input,
.biz-reg-section__fields .trust-deed-corp-identity-row--trustee-company > label.stack > select,
.biz-reg-section__fields .trust-deed-corp-identity-row--trustee-company > label.stack > textarea {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 800px) {
  .biz-reg-section__fields .trust-deed-corp-identity-row--trustee-company {
    grid-template-columns: 1fr;
  }
}
/* Corporate trustee execution: first name | last name | signing capacity — one row */
.biz-reg-section__fields .trust-deed-corp-identity-row--exec-signatory {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(11rem, 1.15fr);
}
@media (max-width: 800px) {
  .biz-reg-section__fields .trust-deed-corp-identity-row--exec-signatory {
    grid-template-columns: 1fr;
  }
}
.biz-reg-section__help {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #444;
  padding: 0.35rem 0;
}
.biz-reg-section__help--alert {
  color: #b91c1c;
  font-weight: 500;
}
.biz-reg-yesno {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.biz-reg-yesno__legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 0.45rem;
  padding: 0;
}
.biz-reg-yesno > div {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: center;
}
.biz-reg-yesno label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  cursor: pointer;
}

/* Make Beneficial owner prompt bigger and single-line */
.biz-reg-beneficial-owner {
  padding: 1.25rem 1.5rem !important;
}
.biz-reg-beneficial-owner .biz-reg-yesno__legend {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.biz-reg-beneficial-owner .biz-reg-yesno--inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.biz-reg-beneficial-owner .biz-reg-yesno--inline > div {
  gap: 1.25rem;
}
.biz-reg-beneficial-owner .biz-reg-yesno--inline label {
  font-size: 1.02rem;
  font-weight: 600;
}
.biz-reg-beneficial-owner input[type='radio'] {
  transform: scale(1.25);
  transform-origin: left center;
}
.biz-reg-uhc-details {
  margin-top: 0.85rem;
}
.biz-reg-reg-occupier-other {
  margin-top: 0.85rem;
}
.biz-reg-reg-occupier-other--span {
  margin-top: 0.35rem;
}
.biz-reg-ppob-address-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.biz-reg-ppob-address-fields > .stack {
  margin-bottom: 0.75rem;
}
.biz-reg-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  max-width: 100%;
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
  font-weight: 400;
  color: #374151;
  line-height: 1.55;
}
.biz-reg-consent-label:hover {
  border-color: #cbd5e1;
  background: #fafafa;
}
.biz-reg-consent-label:focus-within {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.biz-reg-consent-label input[type='checkbox'] {
  margin-top: 0.28rem;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
}
.biz-reg-consent-label__text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.55;
}
.biz-reg-reg-occupier-other .errorlist {
  margin: 0.35rem 0 0;
}
/* Use .biz-reg-conditional-hidden instead of the HTML hidden attribute on form subtrees
   (avoids UAs that skip nested controls in POST). */
.biz-reg-conditional-hidden {
  display: none !important;
}

/* Wizard: only the active step is shown; others use CSS display:none (not [hidden]) so inputs still submit. */
.biz-reg-wizard .biz-reg-step:not(.biz-reg-step--active) {
  display: none !important;
}

/* Company name availability (Business API helper) */
.biz-reg-name-check-panel {
  margin-top: 0.65rem;
  max-width: 38rem;
}
.biz-reg-name-check-panel[hidden] {
  display: none !important;
}
.biz-reg-name-result {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-muted, #f8fafc);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1e293b;
}
.biz-reg-name-result--ok {
  border-color: #6ee7b7;
  background: var(--success-soft, #ecfdf5);
}
.biz-reg-name-result--bad {
  border-color: #fca5a5;
  background: #fef2f2;
}
.biz-reg-name-result--warn {
  border-color: #fcd34d;
  background: var(--warning-soft, #fffbeb);
}
.biz-reg-name-result__checked {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: #475569;
}
.biz-reg-name-result__checked strong {
  font-weight: 600;
  color: #1e293b;
}
.biz-reg-name-result__statusline {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  color: #334155;
}
.biz-reg-name-result__status {
  display: inline-block;
  font-weight: 600;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.biz-reg-name-result__status--ok {
  background: #d1fae5;
  color: #047857;
}
.biz-reg-name-result__status--warn {
  background: #fef3c7;
  color: #b45309;
}
.biz-reg-name-result__status--bad {
  background: #fee2e2;
  color: #b91c1c;
}
.biz-reg-name-result__status--neutral {
  background: #e2e8f0;
  color: #475569;
}
.biz-reg-name-result__headline {
  font-weight: 600;
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
}
.biz-reg-name-result__objections-label {
  font-weight: 600;
  margin: 0.65rem 0 0.3rem;
  font-size: 0.86rem;
  color: #334155;
}
.biz-reg-name-result__sub {
  margin: 0 0 0.55rem;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.45;
}
.biz-reg-name-result__list {
  margin: 0.15rem 0 0;
  padding-left: 1.2rem;
}
.biz-reg-name-result__list li {
  margin: 0.25rem 0;
}
.biz-reg-name-result__technical {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.biz-reg-name-result__technical summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: #64748b;
  user-select: none;
}
.biz-reg-name-result__technical summary:hover {
  color: #334155;
}
.biz-reg-name-result__technical pre {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #475569;
}
form.biz-reg-form input[type='text'],
form.biz-reg-form input[type='number'],
form.biz-reg-form input[type='email'],
form.biz-reg-form input[type='date'],
form.biz-reg-form input[type='password'],
form.biz-reg-form select,
form.biz-reg-form textarea {
  background: #fffef5;
  border-color: #d6d3b8;
}
form.biz-reg-form input:focus,
form.biz-reg-form select:focus,
form.biz-reg-form textarea:focus {
  background: #fff;
}

/* Business registration: highlight fields that failed validation */
form.biz-reg-form label.stack:has(ul.errorlist) input[type='text'],
form.biz-reg-form label.stack:has(ul.errorlist) input[type='number'],
form.biz-reg-form label.stack:has(ul.errorlist) input[type='email'],
form.biz-reg-form label.stack:has(ul.errorlist) input[type='date'],
form.biz-reg-form label.stack:has(ul.errorlist) select,
form.biz-reg-form label.stack:has(ul.errorlist) textarea,
form.biz-reg-form .biz-reg-dir-field:has(ul.errorlist) input,
form.biz-reg-form .biz-reg-dir-field:has(ul.errorlist) select,
form.biz-reg-form fieldset.biz-reg-dir-dob:has(ul.errorlist) select,
form.biz-reg-form .biz-reg-dob-row__part:has(ul.errorlist) select {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.4);
  background: #fff5f5 !important;
}
form.biz-reg-form ul.errorlist {
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}
form.biz-reg-form .biz-reg-share-structure-table td:has(ul.errorlist) input,
form.biz-reg-form .biz-reg-share-structure-table td:has(ul.errorlist) select {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.4);
  background: #fff5f5 !important;
}
form.biz-reg-form fieldset.biz-reg-yesno:has(> ul.errorlist),
form.biz-reg-form fieldset.biz-reg-dir-dob:has(ul.errorlist) {
  outline: 2px solid rgba(220, 38, 38, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Trust / SMSF deed wizard: Next blocked — show step-level message */
.biz-reg-wizard .biz-reg-step.biz-reg-step--validation-error {
  outline: 2px solid rgba(220, 38, 38, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}
form.biz-reg-form input.biz-reg-has-error,
form.biz-reg-form select.biz-reg-has-error,
form.biz-reg-form textarea.biz-reg-has-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.4);
  background: #fff5f5 !important;
}

/* Wizard client-side step validation (Next) */
form.biz-reg-form label.stack.biz-reg-has-error input[type='text'],
form.biz-reg-form label.stack.biz-reg-has-error input[type='number'],
form.biz-reg-form label.stack.biz-reg-has-error input[type='email'],
form.biz-reg-form label.stack.biz-reg-has-error input[type='date'],
form.biz-reg-form label.stack.biz-reg-has-error select,
form.biz-reg-form label.stack.biz-reg-has-error textarea,
form.biz-reg-form .biz-reg-dir-field.biz-reg-has-error input,
form.biz-reg-form .biz-reg-dir-field.biz-reg-has-error select,
form.biz-reg-form fieldset.biz-reg-yesno.biz-reg-has-error,
form.biz-reg-form fieldset.biz-reg-dir-dob.biz-reg-has-error,
form.biz-reg-form .biz-reg-consent-label.biz-reg-has-error {
  outline: 2px solid rgba(220, 38, 38, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}
form.biz-reg-form label.stack.biz-reg-has-error input[type='text'],
form.biz-reg-form label.stack.biz-reg-has-error input[type='number'],
form.biz-reg-form label.stack.biz-reg-has-error input[type='email'],
form.biz-reg-form label.stack.biz-reg-has-error input[type='date'],
form.biz-reg-form label.stack.biz-reg-has-error select,
form.biz-reg-form label.stack.biz-reg-has-error textarea,
form.biz-reg-form .biz-reg-dir-field.biz-reg-has-error input,
form.biz-reg-form .biz-reg-dir-field.biz-reg-has-error select {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.4);
  background: #fff5f5 !important;
}
form.biz-reg-form td.biz-reg-has-error input,
form.biz-reg-form td.biz-reg-has-error select {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.4);
  background: #fff5f5 !important;
}
.biz-reg-section--has-error .biz-reg-section__bar {
  border-left: 4px solid var(--danger);
  padding-left: 0.5rem;
  margin-left: -0.25rem;
}
form.biz-reg-form .biz-reg-inline-err {
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.biz-reg-share-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}
.biz-reg-share-table th,
.biz-reg-share-table td {
  border: 1px solid var(--border-strong);
  padding: 0.45rem 0.55rem;
  vertical-align: middle;
}
.biz-reg-share-table thead th {
  background: #e8e8e8;
  font-weight: 700;
  text-align: left;
}
.biz-reg-share-table tbody th {
  font-weight: 600;
  text-align: left;
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
}
.biz-reg-share-table td input {
  width: 100%;
  max-width: none;
  margin-top: 0;
}
form.biz-reg-form .biz-reg-share-table input[type='text'],
form.biz-reg-form .biz-reg-share-table input[type='number'],
form.biz-reg-form .biz-reg-share-table select {
  max-width: none;
}
.biz-reg-share-table .biz-reg-share-muted td {
  background: var(--panel-muted);
  color: var(--muted);
}
.biz-reg-share-table .biz-reg-share-muted input:disabled {
  background: var(--panel-muted);
  cursor: not-allowed;
}

.biz-reg-share-structure-wrap {
  overflow-x: auto;
  margin-top: 0.35rem;
}
.biz-reg-share-structure-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.biz-reg-share-structure-table th,
.biz-reg-share-structure-table td {
  border: 1px solid var(--border-strong, #d4d4d4);
  padding: 0.5rem 0.65rem;
  vertical-align: middle;
  text-align: left;
}
.biz-reg-share-structure-table thead th {
  background: #e8e8e8;
  font-weight: 700;
}
.biz-reg-share-structure-class {
  white-space: nowrap;
}
.biz-reg-share-structure-class-label {
  font-weight: 700;
  margin-left: 0.25rem;
}
.biz-reg-share-structure-class-label--ord {
  color: #15803d;
}
.biz-reg-share-structure-code {
  font-size: 0.78rem;
  margin-left: 0.2rem;
}
.biz-reg-share-structure-total {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
form.biz-reg-form .biz-reg-share-structure-table input.biz-reg-share-structure-input {
  width: 100%;
  max-width: 12rem;
  margin: 0;
}
form.biz-reg-form .biz-reg-share-structure-table input[type='number'] {
  max-width: 10rem;
}
form.biz-reg-form .biz-reg-share-structure-table input[type='text'].biz-reg-share-structure-input {
  max-width: 11rem;
}
.biz-reg-wizard-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--panel-muted);
}
.biz-reg-wizard-nav__mid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1 1 auto;
}
.biz-reg-summary {
  margin: 0;
}
.biz-reg-summary__row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.biz-reg-summary__row dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-secondary);
}
.biz-reg-summary__row dd {
  margin: 0;
}
.biz-reg-summary__list {
  margin: 0;
  padding-left: 1.2rem;
}
.biz-reg-summary__list li {
  margin: 0.3rem 0;
}
.biz-reg-summary__name {
  font-weight: 600;
}
.biz-reg-summary__holder {
  margin: 0.55rem 0 0;
}
.biz-reg-summary__holder:first-child {
  margin-top: 0;
}
.biz-reg-summary__holder-name {
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.biz-reg-summary__sublist {
  margin: 0.15rem 0 0 1.1rem;
  padding: 0;
}
.biz-reg-summary__sublist li {
  margin: 0.2rem 0;
}

/* ABN — Business API business-industries suggestions (main activity) */
.biz-reg-abn-activity-label {
  margin-bottom: 0.35rem;
}
.biz-reg-abn-activity-combo {
  margin-bottom: 0.75rem;
}
.biz-reg-abn-activity-anchor {
  position: relative;
}
.biz-reg-abn-industry-dd {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  z-index: 40;
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.biz-reg-abn-industry-dd__opt {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: none;
  border-bottom: 1px solid var(--border-muted, #f1f5f9);
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.35;
  cursor: pointer;
  color: inherit;
}
.biz-reg-abn-industry-dd__opt:last-child {
  border-bottom: none;
}
.biz-reg-abn-industry-dd__opt:hover,
.biz-reg-abn-industry-dd__opt:focus {
  background: var(--panel-muted, #f8fafc);
  outline: none;
}
.biz-reg-abn-industry-dd__code {
  font-weight: 600;
  margin-right: 0.35rem;
}
.biz-reg-abn-industry-dd__desc {
  color: var(--text-secondary, #64748b);
}
.biz-reg-abn-industry-dd__empty,
.biz-reg-abn-industry-dd__err {
  padding: 0.5rem 0.65rem;
  font-size: 0.84rem;
}

.biz-reg-static-block {
  padding: 0.75rem 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.biz-reg-static-block ul {
  margin: 0.5rem 0 0 1.1rem;
  padding: 0;
}
.biz-reg-intro-lead {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 48rem;
}

/* Company registration — director layout & PMS client picker */
.biz-reg-dir-form__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Standalone trust ABN — trustee row: compact summary + expandable full form */
.biz-reg-trustee-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.biz-reg-trustee-details__summary {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  list-style: none;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: var(--text);
}
.biz-reg-trustee-details__summary::-webkit-details-marker,
.biz-reg-trustee-details__summary::marker {
  display: none;
}
.biz-reg-trustee-details__chev {
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-top: 0.35em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.biz-reg-trustee-details[open] .biz-reg-trustee-details__chev {
  transform: rotate(45deg);
}
.biz-reg-trustee-details__summary-inner {
  flex: 1 1 auto;
  min-width: 0;
}
.biz-reg-trustee-details__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}
.biz-reg-trustee-summary {
  font-size: 0.86rem;
  line-height: 1.45;
}
.biz-reg-trustee-summary__line {
  margin: 0;
  padding: 0;
  min-width: 0;
  word-break: break-word;
}
.biz-reg-trustee-summary__line--name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.biz-reg-trustee-summary__k {
  font-weight: 500;
  color: var(--text-secondary);
  margin-right: 0.2rem;
}
.biz-reg-trustee-summary__sep {
  margin: 0 0.35rem;
  color: var(--muted);
  font-weight: 400;
}
.biz-reg-trustee-details__body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
}
.biz-reg-section__grid > .biz-reg-trustee-details {
  min-width: 0;
  margin-bottom: 0;
}

.biz-reg-dir-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr 1fr;
}
.biz-reg-dir-address {
  grid-column: 1 / -1;
}
.biz-reg-dir-subheading {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  font-weight: 600;
}
.biz-reg-dir-subheading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.65rem;
}
.biz-reg-dir-subheading-row .biz-reg-dir-subheading {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.biz-reg-dir-col {
  min-width: 0;
}
.biz-reg-dir-field__label-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}
.biz-reg-dir-field__label {
  font-weight: 500;
  font-size: 0.9rem;
}
.biz-reg-dir-dob__legend {
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0;
  margin: 0 0 0.35rem;
}
.biz-reg-dob-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.biz-reg-dob-row__part {
  flex: 1 1 4.5rem;
  min-width: 0;
}
.biz-reg-dob-row__part--year {
  flex: 1 1 5.5rem;
}
.biz-reg-dir-gender .biz-reg-yesno > div {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.biz-reg-dir-res-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0 0 1rem;
  align-items: flex-start;
}
.biz-reg-dir-check-pill {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 16rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}
.biz-reg-dir-check-pill__text {
  white-space: normal;
}
.biz-reg-dir-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.biz-reg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.86rem;
  background: var(--card-bg, #fff);
  transition: border-color 0.15s, background 0.15s;
}
.biz-reg-chip:hover {
  border-color: var(--border-strong, #94a3b8);
}
.biz-reg-chip:has(input:checked) {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}
.biz-reg-chip input {
  margin: 0;
  accent-color: #2563eb;
}
.biz-reg-chip__text {
  user-select: none;
}
.biz-reg-alloc-summary-wrap {
  overflow-x: auto;
}
.biz-reg-alloc-summary-table {
  width: 100%;
  max-width: 36rem;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.biz-reg-alloc-summary-table th,
.biz-reg-alloc-summary-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  text-align: left;
}
.biz-reg-alloc-summary-table thead th {
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
  font-weight: 600;
}
.biz-reg-alloc-summary-table td[data-biz-alloc-left].biz-reg-alloc-warn {
  color: #b45309;
  font-weight: 600;
}
.biz-reg-dir-form .biz-reg-section__help {
  margin-top: 0.75rem;
}
@media (max-width: 720px) {
  .biz-reg-dir-layout {
    grid-template-columns: 1fr;
  }
}

/* Director: share allocation table UX */
.biz-reg-dir-share-table input.biz-reg-dir-share-input {
  width: 100%;
  max-width: 9rem;
}

/* Director: remove row (red) */
.biz-reg-dir-remove {
  color: #b91c1c;
  font-weight: 600;
}

/* Shareholder row: two-column layout */
.biz-reg-sh-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr 1fr;
}
.biz-reg-sh-layout--2 {
  grid-template-columns: 1fr 1.7fr;
}
.biz-reg-sh-layout--addr {
  grid-template-columns: 1.25fr 1fr;
  gap: 1.1rem;
}
.biz-reg-sh-col {
  min-width: 0;
}

@media (max-width: 720px) {
  .biz-reg-sh-layout {
    grid-template-columns: 1fr;
  }
}

.biz-reg-sh-below {
  display: grid;
  grid-template-columns: 2.2fr 1.4fr;
  gap: 1.25rem;
  margin-top: 1rem;
  align-items: start;
}
.biz-reg-sh-address-card {
  padding: 0.95rem 1.15rem;
}

.biz-reg-sh-info {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px dashed rgba(217, 119, 6, 0.45);
  border-radius: 12px;
  background: rgba(255, 251, 235, 0.55);
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.35;
}
.biz-reg-sh-info__text {
  margin: 0;
}

.biz-reg-sh-address-full {
  padding: 0.9rem 1.1rem;
  margin-top: 0.9rem;
}
@media (max-width: 920px) {
  .biz-reg-sh-below {
    grid-template-columns: 1fr;
  }
}

.biz-reg-yesno--inline > div {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.biz-reg-pms-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.biz-reg-pms-modal[hidden] {
  display: none !important;
}
.biz-reg-pms-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}
.biz-reg-pms-modal__panel {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  width: 100%;
  max-height: min(80vh, 32rem);
  overflow: auto;
  padding: 1.25rem;
}
.biz-reg-pms-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.biz-reg-pms-modal__title {
  font-size: 1.05rem;
  margin: 0;
}
.biz-reg-pms-modal__q {
  width: 100%;
  background: #fffef5;
  border: 1px solid #d6d3b8;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}
.biz-reg-pms-modal__results {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
.biz-reg-pms-modal__pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.35rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.biz-reg-pms-modal__pick:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.05));
}

/* Company reg — country typeahead (director / shareholder) */
.biz-country-ac {
  position: fixed;
  z-index: 10050;
  max-height: min(16rem, 42vh);
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  background: var(--surface, #fffef5);
  border: 1px solid var(--border, #d6d3b8);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.biz-country-ac[hidden] {
  display: none !important;
}
.biz-country-ac__opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.65rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.biz-country-ac__opt:hover,
.biz-country-ac__opt:focus-visible {
  background: var(--surface-hover, rgba(0, 0, 0, 0.06));
  outline: none;
}
.biz-country-ac__opt:active {
  background: var(--surface-hover, rgba(0, 0, 0, 0.12));
}
.biz-reg-country-ac-input {
  width: 100%;
}

.biz-reg-minutes-visible-select {
  width: 100%;
  max-width: 36rem;
  min-height: 2.75rem;
  color: var(--text, #1a1a1a);
  background-color: #fffef5;
}
form.biz-reg-form .biz-reg-minutes-visible-select:focus {
  background-color: #fff;
}

/* —— E-sign: new signature request (commercial-style flow) —— */
.esign-create {
  max-width: 920px;
}

.esign-create__header .page-header__lead {
  max-width: 42rem;
}

.esign-create__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.esign-create__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.esign-create__trust li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.esign-create__trust li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

.esign-create__steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.esign-create__step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.esign-create__step--current {
  color: var(--text);
}

.esign-create__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--panel-muted);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.esign-create__step--current .esign-create__step-num {
  background: linear-gradient(145deg, var(--accent-soft) 0%, #dbe4ff 100%);
  border-color: rgba(59, 91, 253, 0.45);
  color: var(--accent-hover);
}

.esign-create__step-label {
  line-height: 1.25;
}

.esign-create__step-connector {
  flex: 0 0 1.25rem;
  height: 2px;
  background: linear-gradient(90deg, var(--border-strong), var(--border));
  border-radius: 1px;
  opacity: 0.85;
}

.esign-create__form.card {
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
}

.esign-create__form.card > *:not(.esign-create__footer) {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.esign-create__form.card > .esign-create__alert {
  margin-top: 1.25rem;
}

.esign-create__form.card > .esign-create__panel:first-of-type {
  margin-top: 1.25rem;
}

.esign-create__alert {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.esign-create__alert-title {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--danger);
}

.esign-create__alert-list {
  margin: 0;
}

.esign-req {
  color: var(--danger);
  font-weight: 700;
}

.esign-create__panel {
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.esign-create__panel:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.esign-create__panel-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.esign-create__panel-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--accent-soft) 0%, #f1f5f9 100%);
  color: var(--accent);
  border: 1px solid rgba(59, 91, 253, 0.15);
}

.esign-create__panel-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.esign-create__panel-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 40rem;
}

.esign-create__panel-body {
  padding-left: 0.15rem;
}

.esign-create__hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.esign-lib-selected {
  margin: 0.35rem 0 0;
  min-height: 1.15em;
}

.esign-lib-explorer {
  margin-top: 0.5rem;
  max-height: min(50vh, 28rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: 0.35rem 0.45rem 0.5rem;
  background: var(--panel-muted, #f9fafb);
}

.esign-lib-explorer__root {
  margin: 0;
  padding: 0;
  list-style: none;
}

.esign-lib-explorer__versions {
  list-style: none;
  margin: 0.2rem 0 0.35rem;
  padding: 0 0 0 1.35rem;
}

.esign-lib-explorer__version {
  margin: 0.1rem 0;
}

.esign-lib-pick-ver.is-selected {
  box-shadow: 0 0 0 2px var(--accent, #3b5bfd);
}

.esign-lib-explorer__doc-head {
  margin-top: 0.2rem;
}

.esign-create__doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 800px) {
  .esign-create__doc-grid {
    grid-template-columns: 1fr;
  }
  .esign-create__steps {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .esign-create__step-connector {
    display: none;
  }
}

.esign-create__upload-col .o365-section {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.esign-file-slot {
  margin-top: 0.35rem;
}

.esign-file-slot__ui {
  position: relative;
  display: block;
  min-height: 7.5rem;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border-strong);
  background: linear-gradient(180deg, #ffffff 0%, var(--panel-muted) 100%);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.esign-file-slot__ui:hover {
  border-color: rgba(59, 91, 253, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.esign-file-slot__visual {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.25rem;
}

.esign-file-slot__ui .esign-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 0;
}

.esign-file-slot__icon {
  color: var(--accent);
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.esign-file-slot__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.esign-file-slot__title em {
  font-style: normal;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.esign-file-slot__meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 14rem;
  line-height: 1.35;
}

.esign-signers {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.esign-create__panel-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.esign-create__panel-head-main {
  display: flex;
  gap: 0.85rem;
  flex: 1;
  min-width: 12rem;
}

.esign-add-signer {
  flex-shrink: 0;
  font-weight: 650;
}

.esign-message-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.esign-message-toolbar__label {
  margin: 0;
}

.esign-signer-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.esign-signer-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.esign-signer-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.esign-pms-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.esign-pms-modal[hidden] {
  display: none !important;
}

.esign-pms-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.esign-pms-modal__panel {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  max-height: min(85vh, 32rem);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.15rem 1.25rem;
}

.esign-pms-modal__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.esign-pms-modal__hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.esign-pms-modal__field {
  margin-bottom: 0.65rem;
}

.esign-pms-modal__results {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: 14rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}

.esign-pms-modal__result {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.esign-pms-modal__result:last-child {
  border-bottom: none;
}

.esign-pms-modal__result-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}

.esign-pms-modal__result-btn:hover {
  background: var(--panel);
}

.esign-pms-modal__result-line {
  font-weight: 600;
  font-size: 0.88rem;
}

.esign-pms-modal__result-email {
  font-size: 0.78rem;
  font-weight: 500;
}

.esign-pms-modal__empty {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
}

.esign-pms-modal__footer {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
}

.esign-signer-card__badge {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--accent) 0%, #6366f1 100%);
  box-shadow: 0 2px 8px rgba(59, 91, 253, 0.35);
}

.esign-signer-card__fields {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 640px) {
  .esign-signer-card__fields {
    grid-template-columns: 1fr;
  }
}

.esign-signer-card__section {
  margin: 0;
  padding: 0.65rem 0.75rem;
}

.esign-create__footer {
  margin: 0 !important;
  margin-top: 0.5rem !important;
  padding: 1.15rem 1.5rem 1.35rem;
  background: linear-gradient(180deg, var(--panel-muted) 0%, #f1f5f9 100%);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.esign-create__footer-note {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  font-size: 0.82rem;
  max-width: 28rem;
}

.esign-create__footer-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.esign-create__submit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 1.15rem;
  padding-right: 1rem;
  font-weight: 650;
  box-shadow: 0 2px 12px rgba(59, 91, 253, 0.35);
}

.esign-create__submit:hover {
  box-shadow: 0 4px 16px rgba(59, 91, 253, 0.42);
}

.esign-create__submit-chevron {
  opacity: 0.9;
}

/* —— ASIC compliance workspace —— */
/* Company detail: header + KPI strip + tabs/cards share one readable column */
.asic-company-shell {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

.asic-company-shell > .page-header {
  margin-bottom: 1.25rem;
}

.asic-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

/* Company detail: five KPIs in one even row, aligned with tabs/cards below */
.asic-company-shell > .asic-stat-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem 0.85rem;
  margin-bottom: 1.35rem;
}

@media (max-width: 1080px) {
  .asic-company-shell > .asic-stat-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .asic-company-shell > .asic-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .asic-company-shell > .asic-stat-row {
    grid-template-columns: 1fr;
  }
}

.asic-stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.asic-company-shell > .asic-stat-row > .asic-stat-card {
  padding: 0.85rem 0.95rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.asic-stat-card--wide {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .asic-stat-card--wide {
    grid-column: span 1;
  }
}

.asic-stat-card__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.asic-stat-card__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.asic-stat-card__value--alert {
  color: var(--danger);
}

.asic-company-title {
  font-size: 1.35rem;
  line-height: 1.2;
}

.asic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  padding-bottom: 0.1rem;
}

.asic-tab {
  display: inline-block;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  margin-bottom: -1px;
}

.asic-tab:hover {
  color: var(--accent-hover);
  background: var(--panel-muted);
}

.asic-tab.is-active {
  color: var(--accent-hover);
  border-color: var(--border);
  border-bottom-color: var(--panel);
  background: var(--panel);
}

/* Business registration hub: distinct tab colours (company / trust / SMSF) */
.business-reg-tabs .asic-tab--reg-company {
  color: #1d4ed8;
}
.business-reg-tabs .asic-tab--reg-company:hover {
  color: #1e3a8a;
  background: rgba(37, 99, 235, 0.1);
}
.business-reg-tabs .asic-tab--reg-company.is-active {
  color: #1e3a8a;
  border-color: rgba(37, 99, 235, 0.35);
  border-bottom-color: var(--panel);
  background: var(--panel);
  box-shadow: inset 0 -3px 0 #2563eb;
}

.business-reg-tabs .asic-tab--reg-trust {
  color: #6d28d9;
}
.business-reg-tabs .asic-tab--reg-trust:hover {
  color: #5b21b6;
  background: rgba(124, 58, 237, 0.1);
}
.business-reg-tabs .asic-tab--reg-trust.is-active {
  color: #5b21b6;
  border-color: rgba(124, 58, 237, 0.35);
  border-bottom-color: var(--panel);
  background: var(--panel);
  box-shadow: inset 0 -3px 0 #7c3aed;
}

.business-reg-tabs .asic-tab--reg-smsf {
  color: #047857;
}
.business-reg-tabs .asic-tab--reg-smsf:hover {
  color: #065f46;
  background: rgba(5, 150, 105, 0.1);
}
.business-reg-tabs .asic-tab--reg-smsf.is-active {
  color: #065f46;
  border-color: rgba(5, 150, 105, 0.35);
  border-bottom-color: var(--panel);
  background: var(--panel);
  box-shadow: inset 0 -3px 0 #059669;
}

.asic-panel-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.asic-subhead {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 650;
}

.asic-toolbar {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
}

.asic-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.asic-search-form__field {
  flex: 1;
  min-width: 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.asic-form-card {
  padding: 1.15rem 1.25rem;
}

.asic-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.85rem 1.1rem;
}

.asic-form-grid--tight {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}

/* Officer add form: country / state / place of birth on one row */
.asic-form-grid--officer-birth {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

@media (max-width: 52rem) {
  .asic-form-grid--officer-birth {
    grid-template-columns: 1fr;
  }
}

.asic-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.asic-nested-form {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.asic-table th,
.asic-table td {
  vertical-align: top;
}

.asic-money--due {
  color: var(--danger);
  font-weight: 600;
}

.asic-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.asic-pill--ok {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
}

.asic-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
  background: var(--border-strong);
}

.asic-status-dot--delivered {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.asic-status-dot--sent {
  background: #3b82f6;
}

.asic-status-dot--failed {
  background: var(--danger);
}

.asic-status-dot--logged {
  background: var(--muted);
}

.asic-dl-grid {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

.asic-dl-grid dt {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

.asic-dl-grid dd {
  margin: 0;
}

.asic-note-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.asic-note-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.asic-note-list li:last-child {
  border-bottom: none;
}

.asic-note-body {
  margin-top: 0.25rem;
  font-size: 0.92rem;
}

.asic-structure-banner .asic-panel-title {
  font-size: 1.02rem;
}

.asic-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

.asic-card-head .asic-panel-title {
  margin: 0;
}

.asic-meta-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--panel-muted);
  color: var(--muted);
  border: 1px solid var(--border);
}

.asic-meta-pill--sync {
  flex-shrink: 0;
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #2563eb) 22%, transparent);
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .asic-meta-pill--sync {
    box-shadow: none;
    border-color: var(--accent, #2563eb);
  }
}

/* ASIC RA61 / RA63 / RA67 read-only extract (company detail) */
.asic-ra-extract-card {
  border-color: var(--border);
}

.asic-ra-extract-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.asic-extract-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.asic-extract-section {
  margin: 0;
  padding: 1rem 1.15rem;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
}

.asic-extract-section__title {
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.asic-extract-code {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  vertical-align: middle;
}

.asic-extract-code-sep {
  display: inline-block;
  margin: 0 0.2rem;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  vertical-align: middle;
}

.asic-dl-grid--extract {
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.55rem 1.25rem;
}

.asic-dl-grid--extract dt {
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
}

.asic-extract-dd--money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.asic-stack-card {
  padding: 1.15rem 1.25rem;
}

.asic-company-registry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.asic-company-registry-head__intro {
  flex: 1 1 16rem;
  min-width: 0;
}

.asic-company-registry-head__actions {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Company details — 4×2 ASIC-style grid */
.asic-company-details-client {
  margin-bottom: 1.15rem;
  max-width: 42rem;
}

.asic-company-details-client--readonly .asic-company-details__value-text a {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.asic-company-details {
  margin-bottom: 0.35rem;
}

.asic-company-details__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

.asic-company-details__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}

.asic-company-details__status-edit {
  flex-shrink: 0;
}

.asic-company-details__status-edit select,
.asic-company-details__status-edit .asic-company-details-select {
  min-width: 12rem;
}

.asic-company-details__box {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: 1.15rem 1.25rem 1.2rem;
}

.asic-company-details__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.35rem;
}

@media (max-width: 960px) {
  .asic-company-details__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .asic-company-details__grid {
    grid-template-columns: 1fr;
  }
}

.asic-company-details__cell {
  min-width: 0;
}

.asic-company-details__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #3949ab;
  margin-bottom: 0.32rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.asic-company-details__control .asic-company-details-input,
.asic-company-details__control .asic-company-details-select,
.asic-company-details__control select.o365-select,
.asic-company-details__control input.o365-input {
  width: 100%;
  max-width: 100%;
}

.asic-company-details__value-text {
  font-size: 0.8rem;
  color: #757575;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  word-break: break-word;
}

.asic-company-details__value-text--plain {
  text-transform: none;
  letter-spacing: 0.02em;
}

.asic-registry-pill {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  border: 1px solid var(--border);
}

.asic-registry-pill--registered {
  background: #2e7d32;
  color: #fff;
  border-color: #1b5e20;
}

/* Address details — stacked panel (ASIC-style read-only layout; form uses same shell) */
.asic-address-panel {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.asic-address-panel__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.asic-address-panel__lead {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.asic-address-panel__box {
  margin: 0;
  padding: 0;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

.asic-address-panel__row {
  padding: 0.65rem 1rem 0.7rem;
}

.asic-address-panel__label {
  margin: 0 0 0.28rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
}

.asic-address-panel__value {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.asic-address-panel__divider {
  height: 0;
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.asic-address-panel__field textarea,
.asic-address-panel__field .o365-textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 1.35rem;
  line-height: 1.35;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.82rem;
  color: var(--muted);
  resize: vertical;
}

.asic-address-panel__field textarea:focus,
.asic-address-panel__field .o365-textarea:focus {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
  border-radius: 4px;
}

.asic-address-panel--readonly .asic-address-panel__row .asic-address-panel__value {
  word-break: break-word;
}

.asic-table-address {
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 22rem;
}

.asic-structure-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.asic-officer-dates-form {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.asic-officer-dates-form__title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
}

.asic-form-grid--dates {
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  margin-bottom: 0.65rem;
}

label.small-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.asic-reveal-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.asic-reveal-toggle {
  margin-bottom: 0.5rem;
}

.asic-reveal-panel[hidden] {
  display: none !important;
}

.asic-reveal-panel:not([hidden]) {
  display: block;
  padding-top: 0.35rem;
}

.asic-nested-form--flush {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.asic-table--compact td,
.asic-table--compact th {
  font-size: 0.82rem;
}

.asic-pill--neutral {
  background: var(--panel-muted);
  color: var(--muted);
  border: 1px solid var(--border);
}

.asic-checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.asic-checkbox-row input[type='checkbox'] {
  width: auto;
  margin: 0;
}

/* ASIC company workspace — layout & editing UX */
.asic-workspace {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-bottom: 2rem;
}

.asic-workspace--structure-edit {
  padding-left: 0.85rem;
  border-left: 4px solid var(--accent, #2563eb);
  border-radius: 0 10px 10px 0;
  margin-left: 0;
}

@media (min-width: 900px) {
  .asic-workspace--structure-edit {
    padding-left: 1rem;
  }
}

.asic-tabs--scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap: 0.2rem;
  padding-bottom: 0.2rem;
  margin-bottom: 1.35rem;
}

.asic-tabs--scroll .asic-tab {
  flex-shrink: 0;
  white-space: nowrap;
}

.asic-tab:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
}

.asic-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.asic-tab-panel > .card {
  margin-bottom: 0;
}

/* Details tab — ASIC quick actions (structured BAPI forms) */
.asic-details-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}

.asic-action-dropdown {
  position: relative;
}

.asic-action-dropdown > summary {
  list-style: none;
}

.asic-action-dropdown > summary::-webkit-details-marker {
  display: none;
}

.asic-action-dropdown__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}

.asic-action-dropdown__caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  margin-top: 2px;
  transition: transform 0.15s ease, margin-top 0.15s ease;
}

.asic-action-dropdown[open] .asic-action-dropdown__caret {
  transform: rotate(180deg);
  margin-top: -1px;
}

.asic-action-dropdown__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: min(100vw - 2.5rem, 18.5rem);
  max-width: calc(100vw - 2.5rem);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 12px 24px -8px rgba(15, 23, 42, 0.18);
  padding: 0.4rem 0;
  z-index: 25;
}

.asic-action-dropdown__item {
  display: block;
  padding: 0.55rem 1rem 0.55rem 1.05rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.asic-action-dropdown__item:hover,
.asic-action-dropdown__item:focus-visible {
  background: var(--accent-soft, rgba(59, 91, 253, 0.1));
  color: var(--accent-hover);
  outline: none;
}

.asic-action-dropdown__item:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(59, 91, 253, 0.35);
}

.asic-structure-banner {
  border-radius: var(--radius-lg, 10px);
}

/* Single Edit structure control — keep visible while scrolling the Details tab */
.asic-structure-banner--sticky {
  position: sticky;
  top: 0.65rem;
  z-index: 8;
  background: var(--panel);
  box-shadow:
    0 1px 0 var(--border),
    0 10px 28px -12px rgba(15, 23, 42, 0.18);
}

.asic-structure-banner--sticky.asic-structure-banner--editing {
  box-shadow:
    0 1px 0 var(--border),
    0 10px 28px -12px rgba(15, 23, 42, 0.18);
}

.asic-structure-banner--editing {
  border-color: var(--accent, #2563eb);
  background: linear-gradient(
    135deg,
    var(--panel) 0%,
    color-mix(in srgb, var(--accent, #2563eb) 7%, var(--panel)) 100%
  );
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent, #2563eb) 20%, transparent);
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .asic-structure-banner--editing {
    background: var(--panel-muted);
  }
}

.asic-structure-banner__lead {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 40rem;
}

.asic-structure-banner__actions .btn-row {
  gap: 0.5rem;
}

.asic-card--sync {
  padding: 0.9rem 1.1rem;
  background: var(--panel-muted);
  border-style: dashed;
  border-color: var(--border);
}

.asic-card--sync .asic-inline-actions {
  align-items: flex-start;
}

.asic-card--sync .muted {
  max-width: 36rem;
  line-height: 1.45;
}

.asic-panel-title--form {
  margin-bottom: 0.65rem;
}

.asic-section-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 44rem;
}

.asic-table tbody tr {
  transition: background-color 0.12s ease;
}

.asic-table tbody tr:hover {
  background: var(--panel-muted);
}

.asic-table td.muted,
.asic-table-empty {
  text-align: center;
  padding: 1.35rem 1rem !important;
  font-size: 0.9rem;
}

.asic-note-list li.asic-table-empty {
  list-style: none;
  border-bottom: none;
}

.asic-form-block {
  margin-top: 1.25rem;
  padding: 1.1rem 1.2rem;
  background: var(--panel-muted);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
}

.asic-form-block__title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
}

.asic-form-block .asic-subhead {
  margin-top: 0;
}

.asic-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.asic-form-actions--tight {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.asic-reveal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px dashed var(--border-strong, #d1d5db);
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.asic-reveal-toggle:hover {
  border-color: var(--accent, #2563eb);
  color: var(--accent-hover, #1d4ed8);
  background: var(--panel-muted);
}

.asic-reveal-panel:not([hidden]) {
  display: block;
  margin-top: 0.65rem;
  padding: 1rem 1.15rem;
  background: var(--panel-muted);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
}

.asic-inset-panel {
  margin-top: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
}

.asic-inset-panel__title {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
  margin-bottom: 0.25rem;
}

.asic-doc-callout {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.25rem 1.35rem;
  border-left: 4px solid var(--accent, #2563eb);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent, #2563eb) 8%, var(--panel)) 0%,
    var(--panel) 48%
  );
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .asic-doc-callout {
    background: var(--panel-muted);
  }
}

.asic-doc-callout .asic-panel-title {
  margin-bottom: 0.35rem;
}

.asic-doc-callout .muted {
  margin: 0;
  line-height: 1.5;
  max-width: 40rem;
}

.asic-reviews-summary {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  background: var(--panel-muted);
}

.asic-note-list li.muted {
  padding: 1.25rem 0;
  text-align: center;
  border-bottom: none;
}

.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
}

/* E-sign — place fields (draft) */
.esign-place-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  gap: 1rem;
  align-items: start;
}

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

.esign-place-sidebar {
  padding: 1rem 1.1rem;
}

.esign-place-sidebar__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.esign-place-intro {
  max-width: 48rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.esign-place-signer-hint {
  margin: 0 0 0.65rem;
}

.esign-place-signer-editor {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: min(40vh, 22rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.esign-place-signer-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.esign-place-signer-row.is-active {
  border-color: var(--signer-color, var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--signer-color, var(--accent)) 22%, transparent);
}

.esign-place-signer-row-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.esign-place-signer-head-spacer {
  flex: 1;
  min-width: 0.25rem;
}

.esign-place-signer-row .esign-place-signer-pick {
  flex-shrink: 0;
}

.esign-place-signer-row .esign-place-signer-remove {
  flex-shrink: 0;
}

.esign-place-signer-fields {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.esign-place-signer-fields .o365-input {
  width: 100%;
  font-size: 0.85rem;
}

.esign-place-signer-pms-wrap {
  margin-top: 0.25rem;
}

.esign-place-signer-pms-wrap[hidden] {
  display: none !important;
}

.esign-place-signer-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.25rem;
}

.esign-place-signer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.esign-place-signer-list li {
  margin-bottom: 0.45rem;
}

.esign-place-signer-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  transition: background 0.12s, border-color 0.12s;
}

.esign-place-signer-btn:hover {
  background: var(--panel-muted);
}

.esign-place-signer-btn.is-active {
  border-color: var(--signer-color, var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--signer-color, var(--accent)) 25%, transparent);
}

.esign-place-signer-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  background: var(--signer-color, #2563eb);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.esign-place-signer-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.esign-place-control-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1rem 0 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.esign-place-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: none;
}

.esign-place-actions-form {
  margin: 0;
}

.esign-place-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.esign-place-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.esign-place-fields-head {
  margin: 1rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 650;
}

.esign-place-field-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 12rem;
  overflow: auto;
  font-size: 0.85rem;
}

.esign-place-field-summary li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.esign-summary-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.esign-place-doc {
  padding: 1rem;
  min-height: 24rem;
}

.esign-place-doc__inner {
  overflow: auto;
  max-height: calc(100vh - 12rem);
  text-align: center;
}

.esign-pages-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 0.5rem;
}

.esign-page-stack-label {
  text-align: center;
  margin-bottom: 0.35rem;
}

.esign-canvas-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  vertical-align: top;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  background: #fff;
  overflow: visible;
}

.esign-page-canvas {
  display: block;
  vertical-align: top;
  /* Let clicks hit the overlay layer so signature placement always works (canvas sat on top in hit-testing otherwise). */
  pointer-events: none;
  user-select: none;
}

.esign-field-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  cursor: crosshair;
  overflow: visible;
  pointer-events: auto;
}

.esign-place-overlay-box {
  position: absolute;
  box-sizing: border-box;
  border-radius: 4px;
  pointer-events: auto;
}

.esign-place-overlay-box--pending {
  cursor: move;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.esign-place-overlay-resize {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border-radius: 3px;
  background: var(--panel, #fff);
  border: 2px solid;
  cursor: nwse-resize;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.esign-placement-float {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  width: max-content;
  max-width: calc(100% - 8px);
  padding: 0.3rem 0.45rem;
  background: var(--panel, #fff);
  border: 1px solid var(--border-strong, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  line-height: 1.2;
}

.esign-placement-float__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}

.esign-field-layer--preview {
  cursor: default;
  pointer-events: none;
}

.esign-detail-title-block {
  margin-bottom: 0.35rem;
}

.esign-detail-title-block .o365-label {
  font-size: 1.05rem;
  font-weight: 700;
}

.esign-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.esign-detail-title-row .o365-input {
  flex: 1;
  min-width: min(100%, 12rem);
  max-width: 36rem;
}

.esign-bulk-th,
.esign-bulk-td {
  width: 2.25rem;
  text-align: center;
  vertical-align: middle;
}

.esign-bulk-cb {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.esign-bulk-doc-list {
  list-style: disc;
}

.esign-draft-preview-hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.esign-draft-preview-legend {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.esign-draft-preview-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.esign-draft-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.esign-draft-preview-actions {
  margin: 0 0 0.85rem;
  padding: 0.45rem 0.55rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--panel-muted, #f9fafb);
  max-width: 100%;
}

.esign-draft-preview-actions__hint {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.esign-draft-preview-actions__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
}

.esign-draft-preview-actions__form {
  margin: 0;
  display: inline-flex;
}

.esign-draft-preview-actions__row .btn.small {
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.25;
  white-space: nowrap;
}

.esign-draft-preview-doc {
  border-top: none;
}

.esign-draft-preview-card .esign-place-doc__inner {
  max-height: min(70vh, 52rem);
}

/* Draft envelope: preview sits directly under Actions — light visual tie-in */
.esign-draft-preview-card--after-actions {
  border-color: var(--border-strong, #e4e4e7);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

/* Inhouse company formation document selector */
.inhouse-doc-checklist {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.inhouse-doc-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.inhouse-doc-check input {
  margin-top: 0.2rem;
}

/* —— Trust / SMSF deed setup (wizard layout) —— */
.deed-setup-layout {
  margin: -2rem -2.25rem -3rem;
  padding: 2rem 2.25rem 3rem;
  min-height: calc(100vh - 3rem);
  background: linear-gradient(180deg, #bfdbfe 0%, #dbeafe 18%, #e8f4fc 45%, #f1f5f9 100%);
  box-sizing: border-box;
}

.deed-setup-toplinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

.deed-setup-toplinks__a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.deed-setup-toplinks__a:hover {
  text-decoration: underline;
}

.deed-setup-toplinks__sep {
  color: var(--muted);
  user-select: none;
}

.deed-setup-card.card {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  padding: 1.75rem 1.85rem 1.65rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
}

.deed-setup-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.65rem;
  color: var(--text);
  line-height: 1.2;
}

.deed-setup-card__lead {
  margin: 0 0 1.65rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.deed-setup-card__lead strong {
  color: var(--text);
  font-weight: 650;
}

.deed-setup-form {
  margin: 0;
}

.deed-setup-errors {
  margin: 0 0 1rem;
}

.deed-setup-section {
  margin-bottom: 1rem;
  border: 1px solid #c5cdd8;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.deed-setup-section__bar {
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: #1e293b;
  background: linear-gradient(180deg, #e8eaed 0%, #dce0e6 100%);
  border-bottom: 1px solid #b8c0cc;
  line-height: 1.35;
}

.deed-setup-req {
  color: #b91c1c;
  font-weight: 700;
}

.deed-setup-bar-hint {
  font-weight: 500;
  font-size: 0.78rem;
  color: #64748b;
}

.deed-setup-section__body {
  padding: 1rem 1.1rem 1.1rem;
  background: #fafbfc;
}

.deed-setup-section__body > .errorlist {
  margin: 0 0 0.65rem;
}

.deed-setup-section__body input[type='text'],
.deed-setup-section__body input[type='date'],
.deed-setup-section__body input[type='email'],
.deed-setup-section__body input[type='url'],
.deed-setup-section__body select,
.deed-setup-section__body textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fffef5;
  border: 1px solid #d6d0c4;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-size: 0.92rem;
}

.deed-setup-section__body textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.deed-setup-section__body select {
  cursor: pointer;
}

.deed-setup-help {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36rem;
}

.deed-setup-control-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.deed-setup-control-group li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.deed-setup-control-group li label {
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  margin: 0;
}

.deed-setup-warning {
  margin: 0.85rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 0.88rem;
  line-height: 1.45;
}

.deed-setup-actions {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.deed-setup-btn-primary {
  font-weight: 650;
}

.deed-setup-footnote {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .deed-setup-layout {
    margin: -1.25rem -1rem -2rem;
    padding: 1.25rem 1rem 2rem;
  }
}

/* —— Ledger (per-client bookkeeping) —— */
.ledger-subnav {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.ledger-subnav__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.ledger-subnav__client {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  flex: 1 1 14rem;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md, 10px);
  background: linear-gradient(
    105deg,
    rgba(59, 91, 253, 0.09) 0%,
    rgba(59, 91, 253, 0.04) 42%,
    rgba(13, 122, 79, 0.05) 100%
  );
  border: 1px solid rgba(59, 91, 253, 0.14);
  border-left: 3px solid var(--accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ledger-subnav__client-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
  letter-spacing: -0.015em;
}
.ledger-subnav__client-sep {
  color: var(--border-strong);
  opacity: 0.85;
  user-select: none;
  font-weight: 500;
}
.ledger-subnav__top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
  flex: 0 1 auto;
  margin-left: auto;
}
.ledger-subnav__client-list-link {
  font-size: 0.8125rem;
  font-weight: 600;
  align-self: center;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--accent, #3b5bfd);
  border: 1px solid rgba(59, 91, 253, 0.35);
  background: rgba(59, 91, 253, 0.06);
  white-space: nowrap;
}
.ledger-subnav__client-list-link:hover {
  background: var(--accent-soft);
  color: var(--accent-hover, #2d4ae8);
}
.ledger-subnav__fy {
  flex: 0 0 auto;
  text-align: right;
  max-width: 100%;
  margin-left: 0;
}
.ledger-subnav__fy-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  padding: 0.2rem 0.45rem;
  margin: -0.2rem -0.45rem;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}
.ledger-subnav__fy-link:hover {
  background: var(--accent-soft);
}
.ledger-subnav__fy-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ledger-subnav__fy-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.ledger-subnav__fy-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
}
.ledger-subnav__fy-empty {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--danger);
}
.ledger-subnav__fy-status {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.ledger-subnav__fy-status--closed {
  background: var(--danger-soft);
  color: var(--danger);
}
.ledger-subnav__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}
.ledger-subnav__row + .ledger-subnav__row {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}
.ledger-subnav__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  width: 100%;
  margin-bottom: 0.15rem;
}
.ledger-subnav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
}
.ledger-subnav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.ledger-subnav a.active {
  background: rgba(59, 91, 253, 0.12);
  color: var(--accent);
  font-weight: 600;
}

/* Client breadcrumb row: links stay text-style, not tab pills */
.ledger-subnav .ledger-subnav__client a {
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.ledger-subnav .ledger-subnav__client a:hover {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}

body:has(.ledger-fy-bar) .main {
  padding-bottom: 4.5rem;
}

.ledger-fy-bar {
  position: fixed;
  z-index: 40;
  bottom: 0;
  left: 252px;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.06);
}
.ledger-fy-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.88rem;
}
.ledger-fy-bar__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.ledger-fy-bar__value {
  font-weight: 700;
  color: var(--text);
}
.ledger-fy-bar__range {
  font-size: 0.82rem;
}
.ledger-fy-bar__badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}
.ledger-fy-bar__badge--open {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}
.ledger-fy-bar__badge--closed {
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}
.ledger-fy-bar__warn {
  color: var(--text-secondary);
  flex: 1 1 12rem;
}
.ledger-fy-bar__actions {
  margin-left: auto;
}
.ledger-fy-bar__actions a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.ledger-fy-bar__actions a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .ledger-fy-bar { left: 220px; }
}
@media (max-width: 720px) {
  .ledger-fy-bar { left: 0; }
}

.ledger-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}
.ledger-tabs a {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.ledger-tabs a:hover { background: var(--panel-muted); }
.ledger-tabs a.active {
  background: var(--panel);
  border-color: var(--border-strong);
  color: var(--text);
}
.ledger-journal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}
.ledger-journal-toolbar .ledger-tabs {
  margin-bottom: 0;
}
.ledger-journal-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  flex: 1 1 12rem;
  min-width: 0;
  justify-content: flex-end;
}
.ledger-journal-search__input {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 22rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.875rem;
}
.ledger-journal-search__btn {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
}
.ledger-journal-search__clear {
  flex-shrink: 0;
  font-size: 0.875rem;
}
@media (max-width: 40rem) {
  .ledger-journal-search {
    justify-content: stretch;
    width: 100%;
  }
  .ledger-journal-search__input {
    max-width: none;
  }
}
.ledger-tabs--coa {
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.ledger-tabs--coa a {
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
}
.ledger-coa-section {
  scroll-margin-top: 1.25rem;
}

/* —— Chart of accounts (Xero-style) —— */
.coa-page-header {
  margin-bottom: 1.25rem;
}
.coa-page-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
.coa-page-header__lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 52rem;
}
.coa-banner {
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.coa-banner__body strong {
  color: var(--text);
}
.coa-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.coa-toolbar--primary {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.coa-toolbar__sep {
  width: 1px;
  height: 1.25rem;
  background: var(--border-strong);
  margin: 0 0.15rem;
}
.coa-toolbar__hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 0.25rem;
}
.coa-toolbar--secondary {
  justify-content: space-between;
  padding: 0.65rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.coa-bulk-form {
  display: flex;
  align-items: center;
}
.coa-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.coa-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.coa-search-form input[type="search"] {
  min-width: 12rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
}
.coa-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 0;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0 0.25rem;
}
.coa-tabs__item {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.coa-tabs__item:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.6);
}
.coa-tabs__item--active {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border-strong);
  border-bottom-color: var(--panel);
  box-shadow: 0 -2px 0 0 var(--accent) inset;
  font-weight: 600;
}
.coa-table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: none;
  padding: 0.5rem 0 1rem;
}
.coa-table .coa-table__chk {
  width: 2.25rem;
}
.coa-table__sort a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.coa-table__sort a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.coa-table__name {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.coa-table__name:hover {
  text-decoration: underline;
}
.coa-table__desc {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.2rem;
  line-height: 1.35;
}
.coa-table__mono {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.coa-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.coa-table__code {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.coa-table tbody tr:nth-child(even) {
  background: var(--panel-muted);
}
.coa-table__row--inactive {
  opacity: 0.72;
}
@media print {
  .layout .sidebar,
  .sidebar-foot,
  .no-print,
  .messages {
    display: none !important;
  }
  .layout .main {
    margin-left: 0 !important;
    padding: 0.5rem !important;
  }
  .coa-table-wrap {
    border: none;
  }
  .coa-page-header__lead,
  .coa-banner {
    display: none;
  }
}

/* —— Add / edit account (Xero-style) —— */
.coa-account-page {
  max-width: 52rem;
}
.coa-breadcrumb {
  font-size: 0.86rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
}
.coa-breadcrumb a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.coa-breadcrumb a:hover {
  text-decoration: underline;
}
.coa-breadcrumb__sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}
.coa-breadcrumb__current {
  color: var(--text-secondary);
  font-weight: 500;
}
.coa-account-hero {
  margin-bottom: 1.25rem;
}
.coa-account-hero__title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}
.coa-account-hero__lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 40rem;
}
.coa-account-hero__meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}
.coa-account-hero__pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.coa-account-hero__link {
  font-size: 0.86rem;
  font-weight: 600;
  margin-left: 0.25rem;
  color: var(--accent);
  text-decoration: none;
}
.coa-account-hero__link:hover {
  text-decoration: underline;
}
.coa-banner--account {
  margin-bottom: 1rem;
}
.coa-account-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.coa-account-form {
  margin-top: 0.5rem;
}
.coa-form-errors .errorlist {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  list-style: none;
}
.coa-account-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.coa-account-panel--options {
  padding-bottom: 1rem;
}
.coa-account-panel__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text);
}
.coa-account-panel__intro {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}
.coa-form-grid {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px) {
  .coa-form-grid {
    grid-template-columns: 1fr;
  }
}
.coa-form-grid--single {
  grid-template-columns: 1fr;
}
.coa-form-field--inline {
  display: flex;
  gap: 1rem;
}
.coa-form-field__grow {
  flex: 1;
  min-width: 0;
}
.coa-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.coa-help {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.coa-help--check {
  margin-left: 1.65rem;
  margin-top: 0.15rem;
  margin-bottom: 0.65rem;
}
.coa-input,
.coa-select,
.coa-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
}
.coa-input:focus,
.coa-select:focus,
.coa-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.coa-input--code {
  max-width: 10rem;
}
.coa-textarea {
  resize: vertical;
  min-height: 4.5rem;
}
.coa-form-field .errorlist {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--danger);
}
.coa-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.coa-check {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.coa-check-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}
.coa-account-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.ledger-num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger-muted { color: var(--muted); font-size: 0.88rem; }

/* —— Balance sheet (accounting presentation) —— */
.ledger-bs-report__entity {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.ledger-bs-report__asof {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.ledger-bs-report__major {
  margin: 1.75rem 0 0.5rem;
  padding-bottom: 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.ledger-bs-report__sub {
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.ledger-bs-report__table {
  margin-bottom: 0.25rem;
}
.ledger-bs-report__table td,
.ledger-bs-report__grand th,
.ledger-bs-report__grand td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}
.ledger-bs-report__acct {
  padding-left: 0.5rem;
}
.ledger-bs-report__amt {
  color: var(--accent, #3b5bfd);
  font-weight: 500;
}
.ledger-bs-report__subtotal td {
  font-weight: 600;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.ledger-bs-report__grand {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 36rem;
}
.ledger-bs-report__grand th {
  text-align: left;
  font-weight: 700;
}
.ledger-bs-report__grand--double {
  margin-top: 1rem;
  border-top: 2px solid var(--border);
}

/* —— Balance sheet (professional layout) —— */
.ledger-bs-page {
  max-width: 52rem;
  margin: 0 auto;
  padding-bottom: 2.5rem;
}
.ledger-bs-masthead {
  margin-bottom: 1.75rem;
  padding-bottom: 0;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.ledger-bs-masthead__identity {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}
.ledger-bs-masthead__kicker {
  margin: 0 0 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-bs-masthead__title {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
.ledger-bs-masthead__asof {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--muted);
}
.ledger-bs-masthead__asof-strong {
  color: var(--text);
  font-weight: 700;
}
.ledger-bs-masthead__asof-prior {
  display: inline;
  font-size: 0.92em;
}
.ledger-bs-masthead__callout {
  margin: 0;
  padding: 1rem 1.15rem 1.05rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--accent-soft) 0%, var(--panel-muted) 55%, var(--panel-muted) 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  max-width: 46rem;
}
.ledger-bs-masthead__callout-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-bs-masthead__callout-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}
.ledger-bs-masthead__callout-actions {
  margin: 0.75rem 0 0;
}
.ledger-bs-masthead__pl-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-hover);
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 91, 253, 0.35);
  background: var(--panel);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ledger-bs-masthead__pl-link:hover {
  background: var(--panel-muted);
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(59, 91, 253, 0.12);
}
.ledger-bs-masthead__toolbar {
  padding: 1rem 1.15rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.ledger-bs-masthead__toolbar-eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-bs-masthead__form {
  margin: 0;
}
.ledger-bs-masthead__form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.35rem;
}
.ledger-report-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 0;
}
.ledger-report-field__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-report-field__date {
  width: auto;
  min-width: 11.25rem;
  max-width: 12.5rem;
}
.ledger-report-field--grow {
  flex: 1 1 14rem;
  min-width: 0;
}
.ledger-report-field__select {
  width: 100%;
  min-width: 12rem;
  max-width: 28rem;
}
.ledger-report-form-row--ledger {
  align-items: flex-end;
}
.ledger-report-empty-hint {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.ledger-bs-masthead__compare {
  padding-bottom: 0.45rem;
}
.ledger-bs-masthead__submit {
  min-height: 2.5rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  font-weight: 600;
}
@media (max-width: 36rem) {
  .ledger-bs-masthead__form-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ledger-report-field__date {
    max-width: none;
  }
  .ledger-report-field__select {
    max-width: none;
  }
  .ledger-report-field--grow {
    flex: 1 1 auto;
    max-width: none;
  }
  .ledger-bs-masthead__compare {
    padding-bottom: 0;
  }
  .ledger-bs-masthead__submit {
    width: 100%;
  }
}
.ledger-bs-sheet {
  padding: 1.5rem 1.75rem 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}
.ledger-bs-sheet__legend {
  margin: 0 0 1rem;
  line-height: 1.45;
  font-size: 0.875rem;
  color: var(--muted);
}
.ledger-bs-section {
  margin-top: 1.5rem;
}
.ledger-bs-section:first-of-type {
  margin-top: 0.5rem;
}
.ledger-bs-section__title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.ledger-bs-section__subtitle {
  margin: 1rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.ledger-bs-section__title + .ledger-bs-section__subtitle {
  margin-top: 0.45rem;
}
.ledger-bs-table-wrap {
  margin-bottom: 0.35rem;
}
.ledger-bs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.ledger-bs-table tbody tr:not(.ledger-bs-row-subtotal):not(.ledger-bs-row-profit):not(.ledger-bs-row-equity-total):hover td {
  background: rgba(59, 91, 253, 0.04);
}
.ledger-bs-col-desc { min-width: 14rem; }
.ledger-bs-col-amt { width: 38%; min-width: 11.5rem; }
.ledger-bs-acct {
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  vertical-align: top;
}
.ledger-bs-amt {
  padding: 0.4rem 0.75rem 0.4rem 0.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--accent, #3b5bfd);
  white-space: nowrap;
}
.ledger-bs-row-subtotal td {
  padding-top: 0.65rem;
  padding-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
}
.ledger-bs-row-subtotal .ledger-bs-amt {
  font-weight: 700;
  color: var(--text);
}
.ledger-bs-row-gst-heading td {
  padding-top: 0.55rem;
  padding-bottom: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.ledger-bs-row-gst-sub td {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}
.ledger-bs-acct--gst-sub {
  padding-left: 1.35rem !important;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.ledger-bs-row-gst-net td {
  padding-bottom: 0.5rem;
}
.ledger-bs-row-profit td {
  padding-top: 0.55rem;
  padding-bottom: 0.45rem;
  background: rgba(59, 91, 253, 0.06);
}
.ledger-bs-row-profit .ledger-bs-amt {
  font-weight: 600;
}
.ledger-bs-row-equity-total td {
  padding: 0.65rem 0.5rem 0.65rem 0.75rem;
  font-size: 1rem;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
}
.ledger-bs-row-equity-total .ledger-bs-amt {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.ledger-bs-hero-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: 1.25rem 0 0;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 91, 253, 0.12) 0%, rgba(59, 91, 253, 0.04) 100%);
  border: 1px solid rgba(59, 91, 253, 0.2);
  box-sizing: border-box;
}
.ledger-bs-hero-total--secondary {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.06) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-color: var(--border);
}
.ledger-bs-hero-total--grand {
  margin-top: 1.75rem;
  padding: 1rem 1.35rem;
  font-size: 1.05rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.03) 100%);
  border-width: 2px;
  border-color: var(--border);
}
.ledger-bs-hero-total__label {
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.ledger-bs-hero-total__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.125rem;
  color: var(--accent, #3b5bfd);
  flex-shrink: 0;
}
.ledger-bs-hero-total__values {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem 1.35rem;
  flex-shrink: 0;
  justify-content: flex-end;
}
.ledger-bs-hero-total__value--prior {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}
.ledger-bs-hero-total--grand .ledger-bs-hero-total__value--prior {
  font-size: 1.05rem;
}
.ledger-bs-hero-total--grand .ledger-bs-hero-total__value {
  font-size: 1.2rem;
}
.ledger-bs-page--compare {
  max-width: 58rem;
}
.ledger-bs-table--compare .ledger-bs-col-amt {
  width: 24%;
  min-width: 9rem;
}
.ledger-bs-reconcile {
  margin-top: 2rem;
  padding: 1.25rem 1.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg, #fff);
}
.ledger-bs-reconcile--ok {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08) 0%, transparent 100%);
}
.ledger-bs-reconcile--warn {
  border-color: rgba(234, 179, 8, 0.5);
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.1) 0%, transparent 100%);
}
.ledger-bs-reconcile__title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-bs-reconcile__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
@media (min-width: 36rem) {
  .ledger-bs-reconcile__grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
  }
}
.ledger-bs-reconcile__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ledger-bs-reconcile__k {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.3;
}
.ledger-bs-reconcile__v {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ledger-bs-reconcile__badge {
  margin: 1rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(21, 128, 61);
  background: rgba(34, 197, 94, 0.15);
}
.ledger-bs-reconcile__warn-msg {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

/* —— Profit and loss (statement layout) —— */
.ledger-pl-report .ledger-pl-sheet__legend {
  margin: 0 0 1.35rem;
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 46rem;
}
.ledger-pl-table-wrap {
  margin-top: 0.25rem;
}
.ledger-pl-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
}
.ledger-pl-col-desc {
  min-width: 14rem;
}
.ledger-pl-col-amt {
  width: 38%;
  min-width: 11rem;
}
.ledger-pl-table--compare .ledger-pl-col-amt {
  width: 22%;
  min-width: 8.5rem;
}
.ledger-pl-th-year {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.95em;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.ledger-report-compare-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.ledger-pl-th-desc {
  padding: 0.75rem 0.5rem 0.65rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  vertical-align: bottom;
  background: rgba(59, 91, 253, 0.07);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 8px;
}
.ledger-pl-th-amt {
  padding: 0.75rem 0.5rem 0.65rem 0.5rem;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  vertical-align: bottom;
  background: rgba(59, 91, 253, 0.07);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.ledger-pl-table thead th.ledger-pl-th-amt:last-child {
  border-top-right-radius: 8px;
}
.ledger-pl-row-heading td {
  padding: 1.1rem 0.75rem 0.45rem 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.ledger-pl-table tbody tr.ledger-pl-row-heading:first-child td {
  border-top: none;
  padding-top: 0.35rem;
}
.ledger-pl-row-detail td {
  padding: 0.45rem 0.5rem 0.45rem 0.75rem;
  vertical-align: top;
}
.ledger-pl-row-detail--empty td {
  padding-left: 1.25rem;
  font-size: 0.875rem;
}
.ledger-pl-acct__link {
  color: var(--accent, #3b5bfd);
  text-decoration: none;
  font-weight: 500;
}
.ledger-pl-acct__link:hover {
  text-decoration: underline;
}
.ledger-pl-amt {
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--accent, #3b5bfd);
  white-space: nowrap;
}
.ledger-pl-amt--strong {
  font-weight: 700;
  color: var(--text);
}
.ledger-pl-row-subtotal td {
  padding: 0.65rem 0.5rem 0.55rem 0.75rem;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
}
.ledger-pl-row-subtotal .ledger-pl-amt {
  font-weight: 700;
  color: var(--text);
}
.ledger-pl-row-gross td {
  padding: 0.75rem 0.5rem 0.65rem 0.75rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  background: rgba(59, 91, 253, 0.07);
}
.ledger-pl-row-gross .ledger-pl-amt {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.ledger-pl-row-net td {
  padding: 1rem 0.5rem 0.85rem 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-top: 2px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
}
.ledger-pl-row-net .ledger-pl-amt--net {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent, #3b5bfd);
}
.ledger-pl-row--after-tax td {
  padding: 0.75rem 0.5rem 0.65rem 0.75rem;
  font-weight: 700;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
}
.ledger-pl-row--retained-close td {
  padding: 0.85rem 0.5rem 0.75rem 0.75rem;
  font-weight: 700;
  border-top: 1px solid var(--border);
  border-bottom: 3px double var(--border-strong);
  background: rgba(15, 23, 42, 0.03);
}
.ledger-pl-row-spacer td {
  border: none;
  padding: 0.35rem 0;
  height: 0.25rem;
  font-size: 0;
  line-height: 0;
}
.ledger-pl-re-note {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 42rem;
}
.ledger-pl-table tbody tr.ledger-pl-row-detail:hover td {
  background: rgba(59, 91, 253, 0.04);
}

/* —— Depreciation / fixed assets register —— */
.ledger-dep-page {
  max-width: min(100%, 96rem);
  width: 100%;
  margin: 0 auto;
  padding-bottom: 2rem;
  box-sizing: border-box;
}
.ledger-dep-split {
  display: grid;
  grid-template-columns: minmax(17rem, 28rem) minmax(0, 1fr);
  gap: 1.15rem 1.5rem;
  align-items: start;
  margin-bottom: 1.35rem;
}
.ledger-dep-sidebar {
  padding: 1rem 1.05rem 1.1rem;
}
.ledger-dep-sidebar .ledger-dep-card-title {
  margin-bottom: 0.65rem;
}
.ledger-dep-groups-table-wrap {
  max-height: min(70vh, 28rem);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.ledger-dep-sidebar-hint {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}
.ledger-dep-main {
  min-width: 0;
}
.ledger-dep-detail-card {
  padding: 1.05rem 1.15rem 1.15rem;
}
.ledger-dep-post-card {
  margin-top: 0;
}
.ledger-dep-fy-select-form {
  margin: 0 0 1rem;
  max-width: 22rem;
}
.ledger-dep-fy-select-form__field {
  margin-bottom: 0;
}
.ledger-dep-fy-select-form .coa-select {
  width: 100%;
}
.ledger-dep-asset-tabs {
  margin: 0 0 0.85rem;
}
.ledger-dep-tab-panel {
  min-width: 0;
}
.ledger-dep-tab-empty {
  margin: 0.25rem 0 0;
}
.ledger-dep-disposed-scope,
.ledger-dep-disposed-note {
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0 0 0.5rem;
}
.ledger-dep-disposed-note {
  margin-bottom: 0.75rem;
}
.ledger-dep-asset-table {
  font-size: 0.875rem;
  width: 100%;
  min-width: 32rem;
}
.ledger-dep-asset-table th.ledger-th-stacked,
.ledger-dep-post-table th.ledger-th-stacked {
  white-space: normal;
  vertical-align: middle;
  line-height: 1.2;
}
.ledger-th-stacked .ledger-th-stacked__line {
  display: block;
}
.ledger-dep-method-stacked {
  display: inline-block;
  text-align: center;
  line-height: 1.2;
  white-space: normal;
}
.ledger-dep-method-stacked .ledger-dep-method-stacked__line {
  display: block;
}
.ledger-dep-page .ledger-dep-asset-table tbody td:nth-child(2),
.ledger-dep-page .ledger-dep-post-table tbody td:nth-child(4) {
  text-align: center;
  vertical-align: middle;
}
/* Depreciation page: centre-align headers; numeric columns stay right-aligned in tbody via .ledger-num on td */
.ledger-dep-page .data thead th {
  text-align: center;
  vertical-align: middle;
}
.ledger-dep-detail-card .table-wrap {
  width: 100%;
  overflow-x: auto;
}
.ledger-dep-card-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.ledger-dep-sidebar .data tbody tr.ledger-dep-row-active td {
  background: rgba(59, 91, 253, 0.09);
}
.ledger-dep-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.ledger-dep-detail-head .ledger-dep-card-title {
  margin-bottom: 0;
}
@media (max-width: 52rem) {
  .ledger-dep-split {
    grid-template-columns: 1fr;
  }
  .ledger-dep-groups-table-wrap {
    max-height: none;
  }
}
.ledger-dep-post-lead {
  margin: 0 0 1rem;
  max-width: 72rem;
}
.ledger-dep-post-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ledger-dep-post-table {
  width: 100%;
  min-width: 64rem;
  table-layout: auto;
}
.ledger-dep-post-table th,
.ledger-dep-post-table td {
  white-space: nowrap;
}
.ledger-dep-post-table__sel-col {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}
.ledger-dep-post-table th:nth-child(3),
.ledger-dep-post-table td:nth-child(3) {
  white-space: normal;
  min-width: 8rem;
}
.ledger-dep-post-table__calc {
  font-weight: 600;
  color: var(--text-secondary);
}
.ledger-dep-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}
form.ledger-dep-inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}
button.btn-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent, #3b5bfd);
  cursor: pointer;
  text-decoration: underline;
}
button.btn-link.danger {
  color: #b91c1c;
}
button.btn-link:hover {
  opacity: 0.88;
}

/* Depreciation report (ledger reports): wide layout + full-width table; one font with app UI */
.ledger-bs-page.ledger-dep-report-page {
  max-width: min(120rem, 100%);
  width: 100%;
  box-sizing: border-box;
  padding-left: clamp(0.5rem, 1.5vw, 1.25rem);
  padding-right: clamp(0.5rem, 1.5vw, 1.25rem);
  font-family: var(--font-sans);
}
.ledger-dep-report-sheet.card {
  max-width: none;
}
.ledger-dep-report-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ledger-dep-report-table {
  width: 100%;
  min-width: 58rem;
  table-layout: auto;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.ledger-dep-report-table thead th {
  white-space: normal;
  vertical-align: bottom;
  line-height: 1.3;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.ledger-dep-report-th-center.ledger-num {
  text-align: center !important;
}
.ledger-dep-report-table thead th.ledger-dep-report-col-method {
  text-align: center !important;
}
.ledger-dep-report-col-asset {
  text-align: left !important;
  font-weight: 500;
}
.ledger-dep-report-col-method {
  text-align: center;
  vertical-align: middle;
  font-size: 0.875rem;
}
.ledger-dep-report-data-row td.ledger-num {
  font-variant-numeric: tabular-nums;
}
.ledger-dep-report-th-sub {
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  text-transform: none;
  display: block;
  margin-top: 0.2rem;
  line-height: 1.25;
  color: var(--muted, #64748b);
}
.ledger-dep-report-cell-note {
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 400;
}
.ledger-dep-report-empty {
  margin: 1rem;
}
.ledger-dep-report-toolbar .ledger-bs-masthead__form-row {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}
.ledger-dep-report-section-head th {
  text-align: left;
  background: var(--panel-muted, #f4f4f5);
  font-weight: 700;
  padding-top: 0.65rem;
  padding-bottom: 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary, #334155);
}
.ledger-dep-report-subtotal th,
.ledger-dep-report-subtotal td {
  border-top: 1px solid var(--border, #cbd5e1);
  font-weight: 700;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  background: var(--panel-muted, #f1f5f9);
  font-size: 0.9rem;
}
.ledger-dep-report-subtotal .ledger-num {
  font-variant-numeric: tabular-nums;
}
.ledger-dep-report-grand th,
.ledger-dep-report-grand td {
  border-top: 2px solid var(--text, #0f172a);
  font-weight: 800;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  font-size: 1.03rem;
  background: rgba(15, 23, 42, 0.06);
}
.ledger-dep-report-grand .ledger-num {
  font-variant-numeric: tabular-nums;
}
.ledger-dep-report-footnote {
  margin-top: 1rem;
  font-size: 0.9rem;
}
@media print {
  .ledger-dep-report-page .ledger-bs-masthead__toolbar {
    display: none !important;
  }
  .ledger-dep-report-page .ledger-bs-sheet.card {
    box-shadow: none;
    border: none;
  }
  .ledger-dep-report-page {
    font-family: var(--font-sans);
  }
}

/* Financials — line notes: editable note ref (maps to pack Note column) */
.financials-line-notes-ref-cell {
  vertical-align: middle;
  min-width: 4.75rem;
}
.financials-line-notes-ref-input {
  width: 4.5rem;
  max-width: 100%;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-muted);
  box-sizing: border-box;
}
.financials-line-notes-ref-input:focus {
  outline: 2px solid var(--accent, #3b5bfd);
  outline-offset: 1px;
  background: var(--panel, #fff);
  border-color: var(--accent, #3b5bfd);
}
.financials-line-notes-ref-input::placeholder {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

/* Financials — line notes: compact expandable note body */
.financials-line-notes-table .financials-line-notes-row td {
  vertical-align: middle;
}
.financials-line-notes-body-cell {
  vertical-align: top !important;
  min-width: 11rem;
  max-width: 38rem;
}
.financials-line-note-expand {
  margin: 0;
}
.financials-line-note-expand__summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 0.35rem 0.15rem 0.35rem 0;
  border-radius: 8px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.financials-line-note-expand__summary::-webkit-details-marker {
  display: none;
}
.financials-line-note-expand__summary::before {
  content: '';
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.4rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  vertical-align: 0.15rem;
  opacity: 0.75;
}
.financials-line-note-expand[open] .financials-line-note-expand__summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05rem;
}
.financials-line-note-expand__summary:hover {
  background: var(--panel-muted);
}
.financials-line-note-expand__preview {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.financials-line-note-expand__placeholder {
  font-style: normal;
}
.financials-line-note-expand .financials-line-notes-textarea {
  display: block;
  width: 100%;
  max-width: 40rem;
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
  resize: vertical;
  min-height: 6.5rem;
}

.financials-line-notes-th-sort {
  white-space: nowrap;
  vertical-align: bottom;
}
.financials-line-notes-sort-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.financials-line-notes-sort-link:hover {
  text-decoration: underline;
  color: var(--accent, #3b5bfd);
}
.financials-line-notes-sort-ind {
  font-weight: 700;
  opacity: 0.85;
}

/* Fixed asset add/edit — panel layout */
.ledger-fa-form-card {
  max-width: min(100%, 56rem);
  padding: 1.25rem 1.35rem 1.35rem;
}
.ledger-fa-form__intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}
.ledger-fa-form__intro-main {
  flex: 1 1 16rem;
  min-width: 0;
}
.ledger-fa-form__intro-meta {
  flex: 0 0 auto;
  width: min(100%, 7.5rem);
}
.ledger-fa-form__intro-meta .ledger-report-field {
  margin-bottom: 0;
}
.ledger-fa-form__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem 1.35rem;
  align-items: stretch;
  margin-bottom: 1.15rem;
}
@media (max-width: 44rem) {
  .ledger-fa-form__split {
    grid-template-columns: 1fr;
  }
}
.ledger-fa-form__panel {
  background: linear-gradient(165deg, rgba(59, 91, 253, 0.04) 0%, rgba(15, 23, 42, 0.02) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.05rem 1.15rem 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ledger-fa-form__panel--depreciation {
  background: linear-gradient(165deg, rgba(59, 91, 253, 0.08) 0%, rgba(13, 122, 79, 0.04) 100%);
  border-color: rgba(59, 91, 253, 0.2);
  margin-bottom: 1.15rem;
}
.ledger-fa-form__panel--notes {
  background: var(--panel, #fff);
  margin-bottom: 0;
}
.ledger-fa-form__panel-title {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-fa-form__panel-lead {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.ledger-fa-form__subhead {
  margin: 1rem 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}
.ledger-fa-form__field--full {
  margin-top: 0.65rem;
  max-width: 12rem;
}
.ledger-fa-form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}
.ledger-fa-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.25rem;
  align-items: start;
}
.ledger-fa-form__grid--tight {
  gap: 0.65rem 1rem;
}
@media (max-width: 36rem) {
  .ledger-fa-form__grid {
    grid-template-columns: 1fr;
  }
}
.ledger-fa-form__narrow {
  max-width: 10rem;
}
.ledger-fa-help {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}
.ledger-fa-form__panel .coa-input,
.ledger-fa-form__panel .coa-select,
.ledger-fa-form__panel select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.ledger-fa-form__method {
  margin-bottom: 0.85rem;
}
.ledger-fa-form__method ul {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
}
.ledger-fa-form__method li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg, #fff);
  font-size: 0.8125rem;
  font-weight: 500;
}
.ledger-fa-form__method li:has(input:checked) {
  border-color: rgba(59, 91, 253, 0.45);
  background: rgba(59, 91, 253, 0.08);
}
.ledger-fa-form__method input[type='radio'] {
  margin: 0;
}
.ledger-fa-form__panel--notes textarea.coa-input {
  min-height: 6rem;
  width: 100%;
  max-width: 100%;
  resize: vertical;
}

/* —— Reclassify (two-pane workspace) —— */
.ledger-reclassify-page {
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 2.5rem;
}
.ledger-reclassify-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 17.5rem) minmax(0, 1fr);
  gap: 0;
  align-items: start;
  min-height: calc(100vh - 10rem);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
@media (max-width: 52rem) {
  .ledger-reclassify-layout {
    grid-template-columns: 1fr;
    border-radius: 10px;
  }
  .ledger-reclassify-sidebar {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    max-height: 22rem;
  }
}
.ledger-reclassify-sidebar {
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.03) 0%, transparent 12rem);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-width: 0;
}
.ledger-reclassify-sidebar__head {
  padding: 1.1rem 1rem 0.85rem;
  flex-shrink: 0;
}
.ledger-reclassify-sidebar__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-reclassify-sidebar__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.ledger-reclassify-sidebar__hint {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}
.ledger-reclassify-sidebar__search-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.ledger-reclassify-sidebar__search {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  box-sizing: border-box;
}
.ledger-reclassify-sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.5rem 1rem;
  min-height: 0;
}
.ledger-reclassify-sidebar__all {
  display: block;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}
.ledger-reclassify-sidebar__all:hover {
  background: rgba(15, 23, 42, 0.04);
}
.ledger-reclassify-sidebar__all--active {
  background: rgba(13, 122, 79, 0.12);
  color: rgb(6, 95, 70);
  border-color: rgba(13, 122, 79, 0.35);
}
.ledger-reclassify-sidebar__group-title {
  margin: 0.65rem 0 0.35rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-reclassify-sidebar__ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ledger-reclassify-sidebar__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 2px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  border: 1px solid transparent;
}
.ledger-reclassify-sidebar__row:hover {
  background: rgba(15, 23, 42, 0.04);
}
.ledger-reclassify-sidebar__row--active {
  background: rgba(13, 122, 79, 0.1);
  border-color: rgba(13, 122, 79, 0.28);
}
.ledger-reclassify-sidebar__acct {
  flex: 1;
  min-width: 0;
}
.ledger-reclassify-sidebar__acct-name {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.ledger-reclassify-sidebar__acct-meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.ledger-reclassify-sidebar__amt {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
}
.ledger-reclassify-main {
  padding: 1.35rem 1.5rem 2rem;
  min-width: 0;
  background: var(--bg, #fff);
}
.ledger-reclassify-main__header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.ledger-reclassify-main__title {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.ledger-reclassify-main__lead {
  margin: 0;
  max-width: 40rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.ledger-reclassify-panel {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem 1.15rem;
  margin-bottom: 1.25rem;
}
.ledger-reclassify-panel--results {
  background: var(--card-bg, #fff);
}
.ledger-reclassify-panel__title {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-reclassify-panel__head {
  margin-bottom: 1rem;
}
.ledger-reclassify-panel--filters .ledger-reclassify-panel__title {
  margin-bottom: 0.35rem;
}
.ledger-reclassify-panel--filters {
  padding: 0.65rem 0.85rem 0.7rem;
  margin-bottom: 1rem;
}
.ledger-reclassify-panel--filters .ledger-reclassify-panel__head {
  margin-bottom: 0.55rem;
}
.ledger-reclassify-panel--filters .ledger-reclassify-panel__hint {
  font-size: 0.75rem;
  line-height: 1.35;
}
.ledger-reclassify-panel__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 40rem;
}
.ledger-reclassify-form-error {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.875rem;
  background: rgba(220, 38, 38, 0.08);
  color: rgb(153, 27, 27);
}
.ledger-reclassify-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ledger-reclassify-filters--compact {
  gap: 0;
}
.ledger-reclassify-filters__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}
.ledger-reclassify-filters__toolbar--combined {
  align-items: flex-end;
  gap: 0.65rem 1rem;
}
.ledger-reclassify-filters__get {
  flex: 1 1 auto;
  min-width: 0;
}
.ledger-reclassify-filters__get-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}
.ledger-reclassify-filters__bulk {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding-left: 0.85rem;
  border-left: 1px solid var(--border);
}
.ledger-reclassify-filters__bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.ledger-reclassify-dialog .ledger-reclassify-select {
  width: 100%;
  max-width: 100%;
}
.ledger-reclassify-dialog__fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.ledger-reclassify-dialog__check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.ledger-reclassify-dialog__check input {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.ledger-reclassify-field--compact .ledger-reclassify-select {
  min-width: 10.5rem;
  max-width: 15rem;
}
.ledger-reclassify-filters__mini-label--spacer {
  visibility: hidden;
  min-height: 0.875rem;
}
.ledger-reclassify-filters__group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.ledger-reclassify-filters__group--account {
  flex: 0 1 11.5rem;
  min-width: 9rem;
}
.ledger-reclassify-filters__group--search {
  flex: 1 1 10rem;
  min-width: min(100%, 12rem);
}
.ledger-reclassify-filters__group--submit {
  flex: 0 0 auto;
}
.ledger-reclassify-filters__mini-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}
.ledger-reclassify-filters__footnote {
  margin: 0.45rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--muted);
}
.ledger-reclassify-dates-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}
.ledger-reclassify-dates-inline .ledger-reclassify-date {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 9.25rem;
}
.ledger-reclassify-dates-inline__sep {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
  padding: 0 0.05rem;
}
.ledger-reclassify-filters--compact .ledger-reclassify-date,
.ledger-reclassify-filters--compact .ledger-reclassify-select,
.ledger-reclassify-filters--compact .ledger-reclassify-search-input {
  padding: 0.3rem 0.45rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  border-radius: 6px;
  min-height: 2rem;
}
.ledger-reclassify-filters--compact .ledger-reclassify-scope label {
  padding: 0.3rem 0.55rem;
  min-height: 2rem;
  font-size: 0.8125rem;
  gap: 0.35rem;
}
.ledger-reclassify-filters--compact .ledger-reclassify-scope input {
  width: 0.85rem;
  height: 0.85rem;
}
.ledger-reclassify-filters--compact .ledger-reclassify-scope li {
  min-width: 0;
  flex: 0 1 auto;
}
.ledger-reclassify-filters--compact .ledger-reclassify-btn-find {
  min-width: 0;
  padding: 0.38rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 6px;
  line-height: 1.25;
}
@media (max-width: 36rem) {
  .ledger-reclassify-filters__toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .ledger-reclassify-filters__toolbar--combined {
    flex-direction: column;
    align-items: stretch;
  }
  .ledger-reclassify-filters__bulk {
    padding-left: 0;
    border-left: none;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
  }
  .ledger-reclassify-filters__group--account,
  .ledger-reclassify-filters__group--search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
  .ledger-reclassify-dates-inline .ledger-reclassify-date {
    max-width: none;
    flex: 1 1 0;
  }
  .ledger-reclassify-filters__group--submit .ledger-reclassify-btn-find {
    width: 100%;
  }
  .ledger-reclassify-filters__bulk-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
.ledger-reclassify-scope ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--input-bg, #fff);
}
.ledger-reclassify-scope li {
  margin: 0;
  flex: 1 1 auto;
  min-width: min(100%, 9rem);
}
.ledger-reclassify-scope li + li {
  border-left: 1px solid var(--border);
}
.ledger-reclassify-scope label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, var(--muted));
  min-height: 2.65rem;
  box-sizing: border-box;
  transition: background 0.12s ease, color 0.12s ease;
}
.ledger-reclassify-scope label:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}
.ledger-reclassify-scope label:has(input:checked) {
  background: rgba(13, 122, 79, 0.14);
  color: rgb(6, 95, 70);
}
.ledger-reclassify-scope input {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: rgb(13, 122, 79);
}
.ledger-reclassify-filters--compact .ledger-reclassify-scope ul {
  border-radius: 6px;
}
.ledger-reclassify-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ledger-reclassify-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.ledger-reclassify-field__hint {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}
.ledger-reclassify-date,
.ledger-reclassify-select,
.ledger-reclassify-search-input {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  box-sizing: border-box;
  background: var(--input-bg, #fff);
  color: var(--text);
}
.ledger-reclassify-search-input {
  max-width: 100%;
}
.ledger-reclassify-field__err {
  font-size: 0.75rem;
  color: rgb(185, 28, 28);
}
.ledger-reclassify-results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.ledger-reclassify-results__meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.ledger-reclassify-table-wrap {
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.ledger-reclassify-table {
  margin: 0;
}
.ledger-reclassify-th-check {
  width: 2.5rem;
}
.ledger-reclassify-source {
  font-size: 0.8125rem;
  color: var(--muted);
}
.ledger-reclassify-bulk {
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.ledger-reclassify-bulk__title {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.ledger-reclassify-bulk__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.ledger-reclassify-bulk__row .ledger-reclassify-field {
  flex: 1;
  min-width: 14rem;
}
.ledger-reclassify-btn-move {
  flex-shrink: 0;
}
.ledger-reclassify-empty {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  max-width: 26rem;
  margin: 0 auto;
}
.ledger-reclassify-empty__art {
  color: var(--muted);
  margin-bottom: 1rem;
  opacity: 0.85;
}
.ledger-reclassify-empty__svg {
  width: 7.5rem;
  height: auto;
  margin: 0 auto;
  display: block;
}
.ledger-reclassify-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.ledger-reclassify-empty__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

/* —— Ledger settings (Xero-inspired) —— */
.ledger-settings-page {
  max-width: 44rem;
  margin: 0 auto;
  padding-bottom: 2.5rem;
}
.ledger-settings-page__header {
  margin-bottom: 1.75rem;
}
.ledger-settings-page__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-settings-page__title {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.ledger-settings-page__lead {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 36rem;
}
.ledger-settings-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.ledger-settings-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}
.ledger-settings-panel--rates {
  padding-bottom: 0;
}

/* Collapsible sections (native <details>) */
.ledger-settings-disclosure {
  border-bottom: 1px solid var(--border);
}
.ledger-settings-disclosure:last-child {
  border-bottom: none;
}
.ledger-settings-panel > .ledger-settings-disclosure:last-of-type {
  border-bottom: none;
}
.ledger-settings-panel form > .ledger-settings-disclosure:last-of-type {
  border-bottom: none;
}
.ledger-settings-disclosure__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  background: linear-gradient(180deg, var(--panel-muted) 0%, var(--panel) 100%);
  transition: background 0.15s ease;
}
.ledger-settings-disclosure__summary::-webkit-details-marker {
  display: none;
}
.ledger-settings-disclosure__summary::marker {
  content: '';
}
.ledger-settings-disclosure__summary:hover {
  background: linear-gradient(180deg, rgba(248, 250, 252, 1) 0%, var(--panel) 100%);
}
.ledger-settings-disclosure__summary:focus {
  outline: none;
}
.ledger-settings-disclosure__summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}
.ledger-settings-disclosure__summary-text {
  flex: 1;
  min-width: 0;
}
.ledger-settings-disclosure__summary-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.ledger-settings-disclosure__summary-hint {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}
.ledger-settings-disclosure__chevron {
  flex-shrink: 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  margin-top: 0.2rem;
  transition: transform 0.2s ease, color 0.15s ease;
}
.ledger-settings-disclosure[open] > .ledger-settings-disclosure__summary .ledger-settings-disclosure__chevron {
  transform: rotate(180deg);
  color: var(--accent);
}
.ledger-settings-disclosure__body {
  padding: 0.5rem 1.35rem 1.25rem;
  background: var(--panel);
}
.ledger-settings-disclosure__body--rates {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0.5rem;
}
.ledger-settings-rows--in-disclosure {
  padding-top: 0.15rem;
}
.ledger-settings-disclosure__placeholder {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 32rem;
}
.ledger-settings-panel__icon--muted {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}
.ledger-settings-panel__head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.35rem 1.35rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-muted) 0%, var(--panel) 100%);
}
.ledger-settings-panel__icon {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ledger-settings-panel__icon--teal {
  background: var(--success-soft);
  color: var(--success);
}
.ledger-settings-panel__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}
.ledger-settings-panel__subtitle {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}
.ledger-settings-rows {
  padding: 0.25rem 1.35rem 0;
}
.ledger-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.15rem 0;
}
.ledger-settings-row--bordered {
  border-top: 1px solid var(--border);
}
.ledger-settings-row__copy {
  flex: 1;
  min-width: min(100%, 14rem);
}
.ledger-settings-row__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.ledger-settings-row__hint {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 26rem;
}
.ledger-settings-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ledger-settings-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.ledger-settings-switch__input:focus-visible + .ledger-settings-switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ledger-settings-switch__track {
  display: block;
  width: 2.875rem;
  height: 1.6rem;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}
.ledger-settings-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.15rem;
  height: 1.15rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}
.ledger-settings-switch__input:checked + .ledger-settings-switch__track {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.ledger-settings-switch__input:checked + .ledger-settings-switch__track::after {
  transform: translateX(1.25rem);
}
.ledger-settings-suffix-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ledger-settings-suffix-field .ledger-settings-rate-input {
  width: 5.5rem;
  max-width: 6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
}
.ledger-settings-suffix-field__unit {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 1rem;
}
.ledger-settings-panel__footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.35rem 1.35rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  background: var(--panel-muted);
}
.ledger-settings-save {
  min-width: 6.5rem;
  font-weight: 600;
}
.ledger-settings-rate-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0;
}
.ledger-settings-rate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}
.ledger-settings-rate-row:last-child {
  border-bottom: none;
}
.ledger-settings-rate-row:hover {
  background: rgba(248, 250, 252, 0.85);
}
.ledger-settings-rate-row--inactive {
  opacity: 0.72;
}
.ledger-settings-rate-row--inactive:hover {
  opacity: 0.88;
}
.ledger-settings-rate-row__main {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
.ledger-settings-rate-row__name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.ledger-settings-rate-row__pct {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  min-width: 3.5rem;
  text-align: right;
}
.ledger-settings-rate-row__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.ledger-settings-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.ledger-settings-pill--on {
  background: var(--success-soft);
  color: var(--success);
}
.ledger-settings-pill--off {
  background: var(--bg-subtle);
  color: var(--muted);
}
.ledger-settings-inline-form {
  margin: 0;
  display: inline;
}
.ledger-settings-text-btn {
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.ledger-settings-text-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.ledger-settings-empty {
  margin: 0;
  padding: 1.25rem 1.35rem 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.ledger-settings-add-card {
  margin: 1rem 1.35rem 1.35rem;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-muted);
}
.ledger-settings-add-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--text);
}
.ledger-settings-add-card__hint {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.ledger-settings-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
@media (max-width: 36rem) {
  .ledger-settings-add-grid {
    grid-template-columns: 1fr;
  }
}
.ledger-settings-add-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.ledger-settings-add-field .coa-input {
  width: 100%;
}
.ledger-settings-add-micro {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}
.ledger-settings-add-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-start;
}
.ledger-settings-add-submit {
  font-weight: 600;
}
.ledger-settings-page .errorlist {
  list-style: none;
  margin: 0 1.35rem 0.65rem;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--danger);
}
.ledger-settings-page .ledger-settings-rows + .errorlist,
.ledger-settings-page .ledger-settings-row + .errorlist {
  margin-top: -0.35rem;
  margin-bottom: 0.75rem;
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}

/* —— Journal entry form (professional / Xero-inspired) —— */
.ledger-je-page {
  max-width: 72rem;
  margin: 0 auto;
  padding-bottom: 2.75rem;
}
.ledger-je-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ledger-je-errors {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.875rem;
}
.ledger-je-shell {
  background: linear-gradient(180deg, #e8eef5 0%, #f1f5f9 48%, var(--panel) 100%);
  border: 1px solid #c5d0dc;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ledger-je-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.45);
}
.ledger-je-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.ledger-je-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.ledger-je-badge--edit {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}
.ledger-table-actions {
  white-space: nowrap;
}
.ledger-je-topbar__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.ledger-je-topbar__hint {
  margin: 0;
  max-width: 22rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}
.ledger-je-topbar__hint a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.ledger-je-body {
  padding: 1.15rem 1.35rem 1.25rem;
  background: var(--panel);
}
.ledger-je-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ledger-je-field--grow {
  min-width: 0;
  flex: 1;
}
.ledger-je-field--narration {
  margin-bottom: 1rem;
}
.ledger-je-meta-row {
  display: grid;
  grid-template-columns: minmax(11rem, 13rem) 1fr;
  gap: 1rem 1.5rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 36rem) {
  .ledger-je-meta-row {
    grid-template-columns: 1fr;
  }
}
.ledger-je-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}
.ledger-je-input,
.ledger-je-textarea {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #94a3b8;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.ledger-je-textarea--narration {
  font-size: 0.9375rem;
  line-height: 1.45;
  min-height: 5.5rem;
  resize: vertical;
}
.ledger-je-input:focus,
.ledger-je-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ledger-je-input--date {
  max-width: 13rem;
}
.ledger-je-input--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  width: 100%;
  max-width: 9.5rem;
  margin-left: auto;
  display: block;
}
.ledger-je-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0;
}
.ledger-je-check input {
  margin-top: 0.2rem;
}
.ledger-je-grid-panel {
  background: var(--panel);
  border: 1px solid #c5d0dc;
  border-top: none;
  padding: 0.65rem 0 0.5rem;
  box-shadow: var(--shadow);
}
.ledger-je-grid-footnote {
  margin: 0.65rem 1.35rem 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.ledger-je-select {
  font-size: 0.875rem;
  padding: 0.45rem 0.55rem;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 1px solid #94a3b8;
  background: #fff;
}
.ledger-je-select--tax {
  min-width: 9rem;
  max-width: 100%;
}
.ledger-je-table-wrap {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--border);
}
.ledger-je-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  background: #fff;
}
.ledger-je-th {
  text-align: left;
  padding: 0.55rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 2px solid #cbd5e1;
  background: #f8fafc;
  white-space: nowrap;
}
.ledger-je-th--grip {
  width: 2rem;
  padding-left: 0.35rem;
}
.ledger-je-th--desc {
  min-width: 11rem;
}
.ledger-je-th--account {
  min-width: 15rem;
}
.ledger-je-th--tax {
  min-width: 11rem;
}
.ledger-je-th--num {
  text-align: right;
  width: 7rem;
}
.ledger-je-th--del {
  width: 2.5rem;
  text-align: center;
}
.ledger-je-grip {
  display: inline-block;
  color: #cbd5e1;
  font-size: 0.7rem;
  letter-spacing: -0.12em;
  line-height: 1;
  user-select: none;
}
.ledger-je-line .ledger-je-td {
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
}
.ledger-je-line:hover .ledger-je-td {
  background: #f8fafc;
}
.ledger-je-td--grip {
  vertical-align: middle;
}
.ledger-je-td--desc .ledger-je-input {
  width: 100%;
  max-width: 100%;
}
.ledger-je-td--num {
  text-align: right;
}
.ledger-je-td--del {
  text-align: center;
  vertical-align: middle;
}
.ledger-je-delete-chk {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  accent-color: var(--danger);
}
.ledger-je-totals-panel {
  background: var(--panel);
  border: 1px solid #c5d0dc;
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 0.85rem 1.35rem 1rem;
  box-shadow: var(--shadow);
}
.ledger-je-totals {
  max-width: 22rem;
  margin-left: auto;
}
.ledger-je-totals__row {
  display: grid;
  grid-template-columns: 1fr 5.5rem 5.5rem;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.ledger-je-totals__row--grand {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 3px double #0f172a;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.ledger-je-totals__label {
  text-align: right;
  padding-right: 0.5rem;
}
.ledger-je-totals__val {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ledger-je-imbalance {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #b45309;
  text-align: right;
}
.ledger-je-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  padding: 1.15rem 0 0;
}
.btn.ledger-je-post,
.btn.success.ledger-je-post {
  min-width: 9rem;
  font-weight: 650;
  padding: 0.55rem 1.15rem;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border: 1px solid #047857;
  color: #fff;
}
.btn.ledger-je-post:hover,
.btn.success.ledger-je-post:hover {
  filter: brightness(1.05);
  color: #fff;
}
.ledger-je-field .errorlist,
.ledger-je-grid-panel > .errorlist {
  margin: 0.35rem 1.35rem 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--danger);
}
.ledger-je-meta-row .ledger-je-field .errorlist {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
}

/* Ledger client overview (home): bank snapshot cards */
.ledger-home-bank {
  margin-top: 0.5rem;
}
.ledger-home-bank__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.ledger-home-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 1rem;
}
.ledger-home-bank-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem 1rem;
}
.ledger-home-bank-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.ledger-home-bank-card__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}
.ledger-home-bank-card__name a {
  color: inherit;
  text-decoration: none;
}
.ledger-home-bank-card__name a:hover {
  text-decoration: underline;
  color: var(--accent-hover, #3b5bfd);
}
.ledger-home-bank-card__code {
  font-size: 0.8125rem;
  font-weight: 600;
}
.ledger-home-bank-card__stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.875rem;
}
.ledger-home-bank-card__stat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}
.ledger-home-bank-card__stat--action {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(59, 91, 253, 0.06);
  border: 1px solid rgba(59, 91, 253, 0.12);
}
.ledger-home-bank-card__stat-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  width: 100%;
}
.ledger-home-bank-card__stat-value {
  font-weight: 700;
  color: var(--text);
}
.ledger-home-bank-card__pill--ok {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}
.ledger-home-bank-card__pill--warn {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}
.ledger-home-bank-card__diff {
  font-size: 0.875rem;
  font-weight: 600;
}
.ledger-home-bank-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

/* Bank bulk selection toolbar & dialogs */
.ledger-bank-bulk-form--floating {
  margin: 0 0 0.85rem;
}
.ledger-bank-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(59, 91, 253, 0.07) 0%, rgba(15, 23, 42, 0.02) 100%);
}
.ledger-bank-toolbar__count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.ledger-bank-toolbar__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.ledger-bank-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: min(100vw - 2rem, 26rem);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.ledger-bank-dialog--allocate {
  max-width: min(100vw - 2rem, 34rem);
}
.ledger-bank-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}
.ledger-bank-dialog__inner {
  padding: 1.25rem 1.35rem 1.15rem;
}
.ledger-bank-dialog--allocate .ledger-bank-dialog__inner {
  padding: 1.5rem 1.5rem 1.35rem;
}
.ledger-bank-dialog__header {
  margin: 0 0 1.35rem;
}
.ledger-bank-dialog__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}
.ledger-bank-dialog__lead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
}
.ledger-bank-dialog--allocate .ledger-bank-dialog__header {
  margin-bottom: 1.5rem;
}
.ledger-bank-dialog--allocate .ledger-bank-dialog__title {
  margin-bottom: 0.4rem;
}
.ledger-bank-dialog--allocate .ledger-bank-dialog__lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.ledger-bank-dialog--allocate .ledger-bank-dialog__lead strong {
  color: var(--text);
  font-weight: 700;
}
.ledger-bank-dialog__warn {
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.ledger-bank-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.ledger-bank-dialog--allocate .ledger-bank-dialog__footer {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  gap: 0.65rem;
}
.ledger-bank-dialog .ledger-bank-allocate__grid {
  margin-bottom: 0;
}

/* Bank bulk allocate (inside dialog) */
.ledger-bank-allocate {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.ledger-bank-allocate__intro {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.ledger-bank-allocate__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.ledger-bank-allocate__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.75rem;
  margin-bottom: 0;
  align-items: start;
}
@media (max-width: 40rem) {
  .ledger-bank-allocate__grid {
    grid-template-columns: 1fr;
  }
}
.ledger-bank-allocate__field {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.ledger-bank-allocate__field--tax .ledger-bank-alloc-tax {
  margin-top: 0;
}
.ledger-bank-allocate__hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.ledger-bank-dialog--allocate .ledger-bank-alloc-account,
.ledger-bank-dialog--allocate .ledger-bank-alloc-tax {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.875rem;
  line-height: 1.35;
  min-height: 2.5rem;
}
.ledger-bank-alloc-account,
.ledger-bank-alloc-tax {
  width: 100%;
  max-width: 100%;
}

/* Bank transactions — filters & category picker */
.bank-tx-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}
.bank-tx-filters__search .coa-input {
  min-width: min(100%, 220px);
  width: 16rem;
  max-width: 100%;
}
.bank-tx-filters__date {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
}
.bank-tx-filters__date .coa-input {
  font-size: 0.875rem;
}

.ledger-bank-card {
  overflow: visible;
}
.ledger-bank-table-wrap {
  overflow-x: auto;
}
.ledger-bank-table__chk {
  width: 2.5rem;
}
.ledger-bank-th-sort {
  padding: 0;
  vertical-align: bottom;
}
.ledger-bank-sort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.35rem;
  margin: 0;
  padding: 0.5rem 0.35rem 0.5rem 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: left;
  letter-spacing: 0.02em;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.25;
  box-sizing: border-box;
}
.ledger-bank-th-sort--num .ledger-bank-sort-btn {
  justify-content: flex-end;
  text-align: right;
  padding-left: 0.5rem;
  padding-right: 1rem;
}

/* Bank import table — amount column: header + figures share one right-aligned column */
.ledger-bank-table th.ledger-bank-table__amt,
.ledger-bank-table td.ledger-bank-table__amt {
  text-align: right;
  vertical-align: middle;
  width: 7.75rem;
  min-width: 6.5rem;
  max-width: 10rem;
  box-sizing: border-box;
}

.ledger-bank-table td.ledger-bank-table__amt {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  white-space: nowrap;
  padding-right: 1rem;
  padding-left: 0.5rem;
}

.ledger-bank-table th.ledger-bank-table__amt {
  padding-right: 0;
  padding-left: 0;
}
.ledger-bank-sort-btn:hover,
.ledger-bank-sort-btn:focus-visible {
  background: rgba(59, 91, 253, 0.08);
  color: var(--accent, #3b5bfd);
  outline: none;
}
.ledger-bank-sort-btn--active {
  color: var(--accent, #3b5bfd);
}
.ledger-bank-sort-ind {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.9;
  min-width: 1em;
}
.ledger-bank-table__desc {
  max-width: 22rem;
  word-break: break-word;
}
.ledger-bank-table__amt--out {
  color: var(--danger);
}
.ledger-bank-table__cat {
  min-width: 12rem;
  vertical-align: top;
}
.ledger-bank-table__actions {
  white-space: nowrap;
  vertical-align: top;
}
.ledger-bank-row-form {
  display: inline-block;
  margin: 0;
}
.ledger-bank-bulk-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.bank-cat-picker {
  position: relative;
  min-width: 0;
}
.bank-cat-picker__toggle {
  width: 100%;
  max-width: 16rem;
  text-align: left;
  justify-content: flex-start;
}
.bank-cat-picker__label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bank-cat-picker__panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  width: min(22rem, 92vw);
  max-height: min(22rem, 55vh);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.65rem 0.5rem 0.5rem;
}
/* Single shared category picker on bank pending tab (one DOM subtree for all rows). */
.ledger-bank-cat-flyout {
  position: fixed;
  z-index: 120;
  max-height: min(22rem, 55vh);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.65rem 0.5rem 0.5rem;
}
.bank-cat-picker__search-wrap {
  padding: 0 0.35rem 0.5rem;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}
.bank-cat-picker__filter {
  width: 100%;
  font-size: 0.875rem;
}
.bank-cat-picker__add {
  padding: 0 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}
.bank-cat-picker__add-link {
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}
.bank-cat-picker__add-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
.bank-cat-picker__section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.35rem 0.4rem 0.25rem;
}
.bank-cat-picker__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem;
}
.bank-cat-picker__item {
  margin: 0;
  padding: 0;
}
.bank-cat-picker__pick {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
}
.bank-cat-picker__pick:hover {
  background: var(--accent-soft);
}
.bank-cat-picker__pick-name {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.bank-cat-picker__pick-type {
  flex-shrink: 0;
  font-size: 0.72rem;
  max-width: 42%;
  text-align: right;
}
/* Bank account — Pending / Posted as a segmented control */
.ledger-tabs--bank {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1rem;
  padding: 0.2rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ledger-tabs--bank .ledger-tabs--bank__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem;
  min-height: 2.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ledger-tabs--bank .ledger-tabs--bank__tab:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
}

.ledger-tabs--bank .ledger-tabs--bank__tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}

.ledger-tabs--bank .ledger-tabs--bank__tab.active {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.layout.layout--saas .ledger-tabs--bank {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.layout.layout--saas .ledger-tabs--bank .ledger-tabs--bank__tab.active {
  border-color: #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
}
