@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Manrope:wght@400;500;600;700;800&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap');

:root {
  --font-ui: "Manrope", "Segoe UI", Arial, sans-serif;
  --font-display: "DM Sans", "Segoe UI", Arial, sans-serif;
  --bg: #f1f5f9;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d9e6f2;
  --line-strong: #c7d8ea;
  --text: #17324d;
  --muted: #5d738a;
  --brand: #1463b8;
  --brand-strong: #0b4f94;
  --brand-soft: #e8f1ff;
  --accent: #0f766e;
  --accent-soft: #e7f7f5;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
  --shadow: 0 10px 30px rgba(15, 52, 96, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.012em;
  background:
    linear-gradient(rgba(28, 66, 100, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 66, 100, 0.025) 1px, transparent 1px),
    radial-gradient(circle at top right, rgba(20, 99, 184, 0.08), transparent 24%),
    linear-gradient(180deg, #f9fbfd 0%, #edf3f8 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
  color: var(--text);
  max-width: 100%;
  overflow-x: clip;
}

.shell {
  width: min(1380px, 100%);
  min-width: 0;
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 22px 36px;
}

.simple-shell {
  max-width: 1280px;
}

.top-nav-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 22px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 52, 96, 0.05);
  position: sticky;
  top: 10px;
  z-index: 20;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #e2ebf4;
  background: #f8fbff;
  color: #365673;
  font-weight: 800;
  padding: 11px 16px;
  text-decoration: none;
  border-radius: 12px;
}

.nav-tab.active {
  background: #e8f1ff;
  color: #184d95;
  border-color: #bfd6fb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.05);
}

.nav-tab:hover {
  background: #f1f7ff;
  border-color: #cfe0f4;
}

.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

.subscription-ticker {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid #bed8f4;
  border-radius: 14px;
  background: #edf6ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.subscription-ticker-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, #06294b, #0e5f7b);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.subscription-ticker-label small {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: none;
}

.subscription-ticker-window {
  min-width: 0;
  overflow: hidden;
  padding: 9px 0;
}

.subscription-ticker-track {
  display: flex;
  width: max-content;
  animation: subscription-ticker-scroll 60s linear infinite;
}

.subscription-ticker:hover .subscription-ticker-track {
  animation-play-state: paused;
}

.subscription-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 18px;
  white-space: nowrap;
  color: #254967;
  font-size: 12px;
  font-weight: 700;
}

.subscription-ticker-item strong {
  color: #123f72;
}

.subscription-ticker-item span {
  padding-left: 10px;
  border-left: 1px solid #c5dced;
}

.subscription-ticker-item .ticker-odds {
  color: #9a4f09;
}

.subscription-ticker-empty {
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.application-recording-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.application-recording-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.application-recording-status.is-complete {
  color: var(--success);
}

.funding-done {
  color: var(--success);
  font-weight: 800;
}

.funding-status-cell {
  text-align: center;
}

.applications-table {
  width: 920px;
  min-width: 920px;
  table-layout: fixed;
}

.application-register-wrap {
  width: 936px;
  max-width: 100%;
  padding: 7px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, #e6eef5, #f7fafc);
  box-shadow: 0 10px 24px rgba(20, 50, 78, 0.08);
}

/* Keep the register a compact ledger; the global table rule must not stretch its columns. */
.erp-shell .applications-table {
  width: 920px;
  min-width: 920px;
}

.applications-table {
  border-collapse: separate;
  border-spacing: 0 5px;
}

.erp-shell .applications-table thead,
.erp-shell .applications-table th {
  background: #ffffff;
}

.applications-table th {
  padding-top: 9px;
  padding-bottom: 9px;
  border: 0;
  color: #587188;
  font-size: 10px;
  letter-spacing: 0.09em;
}

.filterable-header {
  position: relative;
  vertical-align: bottom;
}

.application-header-filter {
  position: static;
  display: block;
  width: 100%;
  min-width: 0;
  height: 25px;
  margin-top: 5px;
  padding: 0 18px 0 6px;
  border: 1px solid #bcd1e3;
  border-radius: 7px;
  background: #f8fbfe;
  color: #34536e;
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.03em;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.filterable-header.has-active-filter .application-header-filter { border-color: #77aee2; background: #edf6ff; color: #185791; }

.applications-table th:first-child {
  border-radius: 10px 0 0 10px;
}

.applications-table th:last-child {
  border-radius: 0 10px 10px 0;
}

.applications-table tbody tr,
.applications-table tbody tr:nth-child(even) {
  background: #ffffff;
}

.applications-table td {
  border-top: 1px solid #e2ebf2;
  border-bottom: 1px solid #e2ebf2;
  background: #ffffff;
  color: #1a3854;
}

.applications-table td:first-child {
  border-left: 1px solid #e2ebf2;
  border-radius: 10px 0 0 10px;
}

.applications-table td:last-child {
  border-right: 1px solid #e2ebf2;
  border-radius: 0 10px 10px 0;
}

.applications-table tbody tr:hover td {
  border-color: #c4dceb;
  background: #f5faff;
}

.applications-table .application-account-ledger-trigger {
  color: #123d63;
}

.applications-table .funding-done {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: #e6f7ed;
}

.applications-table .status-pill {
  border: 1px solid rgba(201, 151, 65, 0.12);
}

.applications-table th,
.applications-table td {
  padding: 5px 8px;
  height: 42px;
  font-size: 13px;
  line-height: 1.2;
}

.applications-table th:first-child,
.applications-table td:first-child {
  width: 36px;
  text-align: center;
}

.applications-table th:nth-child(2),
.applications-table td:nth-child(2) {
  width: 215px;
}

.applications-table th:nth-child(3),
.applications-table td:nth-child(3) {
  width: 210px;
  text-align: center;
}

.applications-table th:nth-child(4),
.applications-table td:nth-child(4) {
  width: 180px;
}

.applications-table th:nth-child(5),
.applications-table td:nth-child(5) {
  width: 170px;
}

.applications-table th:nth-child(6),
.applications-table td:nth-child(6) {
  width: 135px;
  text-align: center;
}

.application-account-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.application-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.application-actions .secondary-btn {
  padding: 5px 8px;
  font-size: 11px;
}

.application-actions .application-icon-action {
  display: inline-grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.application-actions .edit-icon-action {
  border-color: #bad3e8;
  background: #f4f9fd;
  color: #295678;
}

.planned-delete-application-btn {
  border: 1px solid #f0c5c5;
  background: #fff5f5;
  color: #bd3030;
  box-shadow: none;
}

.delete-all-planned-btn {
  border-color: #f0caca;
  background: #fff6f6;
  color: #b42d35;
}

.funding-needed {
  margin-right: 7px;
}

.compact-record-funding-btn {
  padding: 5px 7px;
  font-size: 10px;
  box-shadow: none;
}

.refund-plan-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.plan-refund-btn {
  padding: 5px 7px;
  border: 1px solid #b9d8c6;
  border-radius: 8px;
  background: #f3fbf6;
  color: #276345;
  font-size: 10px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  box-shadow: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.applications-table td:hover .plan-refund-btn,
.refund-plan-wrap:focus-within .plan-refund-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}


.applications-table .status-pill {
  min-width: 0;
  padding: 4px 8px;
  font-size: 10px;
}

.applications-table .secondary-btn,
.applications-table .primary-btn {
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.1;
  box-shadow: none;
}

.applications-table .application-actions .application-icon-action {
  width: 27px;
  height: 27px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.application-account-ledger-trigger {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #173b63;
  font-weight: 800;
  text-align: left;
  box-shadow: none;
}

.application-account-ledger-trigger:hover {
  transform: none;
  color: var(--brand-strong);
  text-decoration: underline;
}

.account-ledger-header-actions {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 7px;
  min-width: 120px;
}

.ipo-ledger-dialog .dialog-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.ipo-ledger-dialog .dialog-title-row > div:first-child {
  min-width: 0;
}

.ipo-ledger-dialog .dialog-title-row p {
  white-space: normal;
}

.ledger-close-btn {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid #d4e2f1;
  border-radius: 50%;
  background: #f6faff;
  color: #466784;
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

.ledger-close-btn:hover {
  transform: none;
  border-color: #aac5df;
  background: #eaf3fd;
  color: #173b63;
}

.account-ledger-balances {
  display: grid;
  gap: 3px;
  justify-items: end;
}

.account-ledger-balances span {
  color: #58728d;
  font-size: 11px;
  font-weight: 700;
  max-width: 150px;
  text-align: right;
  white-space: normal;
}

.account-ledger-balances .is-settled {
  color: #43825a;
}

.account-ledger-balance {
  color: #68819a;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.account-ledger-account-name {
  margin: 0 0 8px;
  color: #637c95;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ledger-funding {
  margin: 6px 0;
  padding: 11px 10px;
  border: 1px solid #cdebd6;
  border-radius: 10px;
  background: #effbf2;
}

.ledger-return {
  margin: 6px 0;
  padding: 11px 10px;
  border: 1px solid #f2d6d6;
  border-radius: 10px;
  background: #fff3f3;
}

.allotment-encouragement {
  display: block;
  max-width: 190px;
  margin-top: 6px;
  color: #607b50;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.allotment-congratulations {
  color: #9a6500;
}

.closing-checklist-list {
  display: grid;
  gap: 14px;
}
.closing-applicant-orbit { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.closing-applicant-card { position: relative; display: grid; grid-template-columns: 58px; width: 58px; min-height: 58px; overflow: hidden; border: 1px solid #d8e4ed; border-radius: 999px; background: #fff; box-shadow: 0 8px 20px rgba(22, 56, 84, .06); transition: width .22s ease, border-radius .22s ease, box-shadow .22s ease; }
/* Applicant details are deliberately click-only; hover must never open a card. */
.closing-applicant-card:not(.is-expanded) .closing-applicant-detail { visibility: hidden; }
.closing-applicant-card.is-expanded { grid-template-columns: 58px minmax(280px, 1fr); width: min(430px, 100%); border-radius: 18px; box-shadow: 0 15px 34px rgba(22, 56, 84, .14); }
.closing-applicant-avatar { display: grid; width: 58px; height: 58px; place-items: center; overflow: hidden; border: 0; border-radius: 50%; background: linear-gradient(135deg, #0b6a8a, #1454a0); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.closing-applicant-avatar img { width: 100%; height: 100%; object-fit: cover; }
.closing-applicant-card.is-complete .closing-applicant-avatar { background: linear-gradient(135deg, #13864c, #47ad73); }
.closing-applicant-detail { display: grid; gap: 9px; min-width: 280px; padding: 10px 12px 12px 4px; opacity: 0; transform: translateX(-8px); transition: opacity .14s ease .06s, transform .18s ease .06s; pointer-events: none; }
.closing-applicant-card.is-expanded .closing-applicant-detail { opacity: 1; transform: translateX(0); pointer-events: auto; }
.closing-applicant-detail strong, .closing-applicant-detail small { display: block; }
.closing-applicant-detail small { margin-top: 2px; color: #63809a; font-size: 11px; }
.closing-applicant-detail .closing-checklist-items { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; }
.closing-applicant-detail .checkbox { margin: 0; font-size: 11px; }
.closing-applicant-detail .secondary-btn { justify-self: start; min-height: 31px; padding: 6px 9px; font-size: 11px; }

.closing-checklist-ipo {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.closing-checklist-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.closing-checklist-title h3,
.closing-checklist-title p {
  margin: 0;
}

.closing-checklist-title p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.closing-checklist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.closing-checklist-items .checkbox {
  color: var(--text);
}

.closing-checklist-footer {
  margin-top: 14px;
}

.closing-checklist-complete {
  margin: 0;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
}

@keyframes subscription-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4px 18px;
}

.top-strip-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.brand-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.top-strip-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.strip-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  color: #31516d;
  font-size: 12px;
  font-weight: 700;
}

.hero,
.panel,
.card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), rgba(15, 118, 110, 0.04) 55%, transparent 70%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: grid;
  gap: 12px;
  min-width: 210px;
}

.simple-hero {
  align-items: center;
}

.compact-header {
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.045em;
  max-width: 760px;
  margin-bottom: 10px;
}

h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.028em;
  margin-bottom: 6px;
}

h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.024em;
}

.subtext,
.panel-header p,
.note-panel li,
label,
.empty,
.empty-block,
.mini-item,
.stack-item span {
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
}

.compact-cards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.card {
  padding: 18px 18px 16px;
  border-top: 4px solid rgba(37, 99, 235, 0.18);
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 52, 96, 0.1);
}

.small-card h3 {
  font-size: 24px;
}

.card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card h3 {
  margin: 0;
  font-size: 28px;
  color: #183b65;
}

.panel {
  padding: 20px 20px 18px;
  margin-bottom: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2 {
  position: relative;
  padding-left: 14px;
}

.panel-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.simple-focus-grid,
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  align-items: start;
}

.quick-add-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin: 0;
}

.workflow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 11px;
  min-height: 170px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #edf5fc 100%);
  box-shadow: 0 8px 0 rgba(130, 158, 185, 0.16), 0 15px 24px rgba(23, 50, 77, 0.08);
  color: #22476f;
  text-align: left;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
}

.workflow-step:hover { transform: translateY(-3px); box-shadow: 0 11px 0 rgba(130, 158, 185, 0.15), 0 21px 30px rgba(23, 50, 77, 0.12); }
.workflow-step:active { transform: translateY(5px); box-shadow: 0 3px 0 rgba(130, 158, 185, 0.16), 0 8px 14px rgba(23, 50, 77, 0.08); }
.workflow-step.needs-action { border-color: #edc473; background: linear-gradient(145deg, #fffefa 0%, #fff3d9 100%); }
.workflow-step.is-clear { border-color: #b9e0c8; background: linear-gradient(145deg, #ffffff 0%, #eaf8ef 100%); }
.workflow-step-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(145deg, #2775c7, #14569d); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 4px 8px rgba(20, 86, 157, .24); color: #fff; font-size: 13px; font-weight: 800; }
.workflow-step-copy { min-width: 0; }
.workflow-step strong, .workflow-step b, .workflow-step small { display: block; }
.workflow-step b { margin-top: 3px; font-size: 29px; color: #17324d; letter-spacing: -0.055em; }
.workflow-step small { margin-top: 4px; color: #59728a; font-size: 12px; letter-spacing: normal; text-transform: none; }
.workflow-step-action { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid rgba(72, 111, 146, 0.16); color: #1b5e9f; font-size: 11px; letter-spacing: 0.025em; }
.workflow-step-action i { font-style: normal; color: #4d7799; font-size: 10px; }
.workflow-form-staging { display: none; }

.workflow-action-dialog { width: min(860px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; border-color: #d7e4ef; border-radius: 24px; box-shadow: 0 24px 70px rgba(28, 55, 79, .23); }
.workflow-action-dialog-shell { padding: 22px; }
.workflow-action-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 0 2px; }
.workflow-action-dialog-header h3 { margin: 3px 0 0; color: #173b63; font-size: 27px; letter-spacing: -.035em; }
.workflow-action-dialog .simple-form { height: auto; gap: 10px; padding: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 20px; background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%); }
.workflow-action-dialog .simple-form h3 { display: none; }
.workflow-action-dialog .simple-form label { gap: 5px; font-size: 12px; }
.workflow-action-dialog .simple-form label[hidden] { display: none !important; }
.workflow-action-dialog .simple-form input,
.workflow-action-dialog .simple-form select { min-height: 42px; padding: 9px 12px; }
.workflow-action-dialog .simple-form .hint-box,
.workflow-action-dialog .simple-form .application-form-tools,
.workflow-action-dialog .simple-form .application-form-more,
.workflow-action-dialog .simple-form .funding-form-tools,
.workflow-action-dialog .simple-form > button { grid-column: 1 / -1; }
.workflow-action-dialog .simple-form::before { grid-column: 1 / -1; margin-bottom: -2px; }
.workflow-action-dialog .simple-form .hint-box { min-height: 0; padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.application-form-tools { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.application-form-more { border: 1px solid #dce8f2; border-radius: 12px; background: rgba(255, 255, 255, .66); }
.application-form-more summary { padding: 10px 13px; cursor: pointer; color: #315d85; font-size: 12px; font-weight: 750; }
.application-form-more[open] summary { border-bottom: 1px solid #dce8f2; }
.application-form-more .application-form-tools { padding: 9px; }
.workflow-action-dialog .text-action-btn { width: auto; min-height: auto; margin-top: 5px; padding: 0; border: 0; background: transparent; color: #1763ab; font-size: 11px; font-weight: 700; text-align: left; box-shadow: none; }
.workflow-action-dialog .text-action-btn:hover { color: #0c4b87; text-decoration: underline; transform: none; }
.workflow-action-dialog .application-form-tools .secondary-btn { width: auto; min-height: 36px; padding: 7px 11px; border: 1px solid #d6e3ef; border-radius: 10px; background: #fff; color: #315d85; font-size: 12px; box-shadow: none; }
.workflow-action-dialog .application-form-tools .application-template-btn { border-style: solid; background: #f8fbfe; }
.funding-form-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px solid #dce8f2; border-radius: 13px; background: rgba(255, 255, 255, .72); }
.workflow-action-dialog .funding-form-tools .secondary-btn { width: auto; min-height: 36px; padding: 7px 11px; border: 1px solid #d6e3ef; border-radius: 10px; background: #fff; color: #315d85; font-size: 12px; box-shadow: none; }
.workflow-action-dialog .simple-form > .primary-btn { justify-self: end; min-height: 42px; padding: 10px 18px; border-radius: 11px; }
.workflow-action-dialog #applicationForm,
.workflow-action-dialog #fundingForm { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 920px) {
  .workflow-action-dialog #applicationForm,
  .workflow-action-dialog #fundingForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.focus-box,
.simple-form {
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.focus-box {
  position: relative;
}

.focus-box::before,
.simple-form::before {
  content: "";
  display: block;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  margin-bottom: 12px;
}

.simple-form {
  display: grid;
  gap: 12px;
  align-content: start;
  height: 100%;
  min-width: 0;
}

.compact-form {
  grid-template-columns: 1fr;
}

.simple-form h3,
.focus-box h3,
.advanced-content h3 {
  margin-bottom: 2px;
  color: #1f4a76;
}

.advanced-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: #23486f;
}

.advanced-content {
  padding-top: 18px;
}

.compact-workspace-section {
  border: 1px solid #d7e5f1;
  border-radius: 14px;
  background: linear-gradient(135deg, #fbfdff, #f5faff);
  overflow: hidden;
}

.compact-workspace-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  color: #173d61;
}

.compact-workspace-section > summary::-webkit-details-marker { display: none; }
.compact-workspace-section summary strong { display: block; font-size: 14px; }
.compact-workspace-section summary small { display: block; margin-top: 3px; color: #698095; font-size: 12px; font-weight: 500; }
.compact-section-toggle { padding: 5px 10px; border-radius: 999px; background: #e8f1fa; color: #1f65a5; font-size: 11px; font-weight: 800; }
.compact-workspace-section[open] .compact-section-toggle { background: #e1f4e7; color: #18743a; }
.compact-workspace-content { padding: 4px 16px 16px; }
.compact-workspace-content > :first-child { margin-top: 12px; }
.compact-workspace-content .spaced-section { margin-top: 14px; }

.section-note {
  margin: -4px 0 14px;
  color: var(--muted);
}

.lower-add-grid {
  margin-bottom: 20px;
}

.spaced-section {
  margin-top: 18px;
}

.mini-list,
.stack-list {
  display: grid;
  gap: 10px;
}

.mini-item,
.stack-item {
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.stack-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

button.stack-item {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

button.stack-item:hover {
  border-color: #b9d2f2;
  background: #f4f8ff;
  transform: translateY(-1px);
}

.stack-item strong {
  color: #163d67;
  white-space: nowrap;
}

.source-name-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  flex-wrap: wrap;
}

.source-name {
  color: var(--muted);
}

.closing-balance {
  color: #73869a;
  font-size: 11px;
  font-weight: 700;
}

.source-ledger-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ledger-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.ledger-header h3 {
  margin-bottom: 4px;
}

.ledger-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.hint-box {
  padding: 11px 12px;
  background: linear-gradient(180deg, #eff7ff, #e8f4ff);
  border: 1px solid #cfe3fb;
  border-radius: 12px;
  color: #35516d;
  font-size: 13px;
  line-height: 1.45;
}

.reset-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.status-message {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-message.success {
  color: var(--success);
}

.status-message.error {
  color: var(--danger);
}

.reset-btn.confirming {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #9a3412;
}

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.old-ipos-scroll {
  max-height: 315px;
  overflow-y: auto;
}

.old-ipos-scroll thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.old-ipo-action-cell {
  width: 1%;
  text-align: right;
}

.old-ipo-check-btn {
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.market-ipo-list {
  overflow: hidden;
}

.market-ipo-table td {
  padding: 0;
}

.market-ipo-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.market-ipo-row:hover {
  transform: none;
  background: #f3f8fe;
}

.market-ipo-name {
  color: #173b63;
  font-weight: 800;
}

.market-ipo-timing {
  color: #456889;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.ipo-ledger-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: var(--text);
  box-shadow: 0 28px 80px rgba(11, 40, 70, 0.28);
}

.ipo-ledger-dialog::backdrop {
  background: rgba(15, 42, 71, 0.45);
  backdrop-filter: blur(4px);
}

.ipo-ledger-dialog-content {
  padding: 24px;
}

.ipo-ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.ipo-ledger-summary div {
  padding: 12px;
  border: 1px solid #dce9f7;
  border-radius: 12px;
  background: #f7fbff;
}

.ipo-ledger-summary span,
.ipo-ledger-row small {
  display: block;
  color: #617a93;
  font-size: 12px;
}

.ipo-ledger-summary strong {
  display: block;
  margin-top: 4px;
  color: #173b63;
}

.ipo-ledger-rows {
  max-height: 360px;
  overflow-y: auto;
  border-top: 1px solid #e2edf8;
}

.ipo-ledger-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e8f0f8;
}

.ipo-ledger-row > span {
  color: #617a93;
  font-size: 12px;
}

.ipo-ledger-row b {
  color: #173b63;
  white-space: nowrap;
}

/* Market Desk IPO detail: keep the ledger calm, spacious, and action-oriented. */
.market-ipo-dialog {
  width: min(760px, calc(100vw - 32px));
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(208, 222, 233, .92);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(24, 57, 86, .24);
}

.market-ipo-dialog::backdrop {
  background: rgba(21, 49, 74, .34);
  backdrop-filter: blur(10px) saturate(.9);
}

.market-ipo-dialog .ipo-ledger-dialog-content { padding: 28px; }
.market-ipo-dialog .dialog-title-row { padding-bottom: 20px; border-bottom: 1px solid #e7eef4; }
.market-ipo-dialog .dialog-title-row h3 { max-width: 560px; margin-top: 5px; color: #173b5c; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.045em; line-height: 1.1; }
.market-ipo-dialog .dialog-title-row p:not(.eyebrow) { max-width: 490px; color: #657d91; font-size: 14px; line-height: 1.45; }
.market-ipo-dialog .dialog-title-row .secondary-btn { min-width: 88px; }

.market-ipo-dialog .ipo-ledger-summary {
  margin: 18px 0;
  gap: 10px;
}

.market-ipo-dialog .ipo-ledger-summary div {
  padding: 14px;
  border-color: #dfe9ef;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbfdff, #f5f9fb);
}

.market-ipo-dialog .ipo-ledger-summary span { color: #6d8395; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.market-ipo-dialog .ipo-ledger-summary strong { color: #193d5e; font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.market-ipo-dialog .ipo-ledger-rows { max-height: min(300px, 35vh); border-top: 0; border-bottom: 1px solid #e5edf3; }
.market-ipo-dialog .ipo-ledger-row { grid-template-columns: 94px minmax(0, 1fr) auto; gap: 14px; padding: 13px 4px; border-color: #edf2f6; }
.market-ipo-dialog .ipo-ledger-row:hover { background: #f8fbfd; }
.market-ipo-dialog .ipo-ledger-row > span { color: #71879a; font-size: 11px; font-weight: 700; }
.market-ipo-dialog .ipo-ledger-row strong { color: #264968; font-size: 13px; }
.market-ipo-dialog .ipo-ledger-row small { margin-top: 2px; color: #72879a; font-size: 11px; }
.market-ipo-dialog .ipo-ledger-row b { color: #193d5e; font-size: 13px; font-variant-numeric: tabular-nums; }

.ipo-ledger-plan-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #cfe0eb;
  border-radius: 17px;
  background: linear-gradient(135deg, #f2f9fc, #fbfdff);
}

.ipo-ledger-plan-bar > div { display: grid; gap: 2px; min-width: 0; }
.ipo-ledger-plan-bar span { color: #57748b; font-size: 10px; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.ipo-ledger-plan-bar strong { color: #193d5e; font-size: 16px; letter-spacing: -.02em; }
.ipo-ledger-plan-bar small { color: #6d8394; font-size: 11px; line-height: 1.35; }
.ipo-ledger-plan-bar .primary-btn { flex: 0 0 auto; min-height: 42px; padding-inline: 17px; }
.ipo-ledger-plan-bar .primary-btn:disabled { cursor: not-allowed; opacity: .55; }
.ipo-ledger-plan-bar .ipo-ledger-plan-actions { display: flex; flex: 0 0 auto; gap: 9px; align-items: center; }
.ipo-ledger-plan-actions .secondary-btn { min-height: 42px; padding-inline: 14px; font-size: 12px; }
.market-quick-plan-dialog { width: min(940px, calc(100vw - 32px)); }
.market-quick-plan-dialog .edit-account-form { gap: 14px; }
.market-quick-plan-dialog input[readonly] { background: #f7fafc; color: #244b6b; font-weight: 600; }
.market-quick-plan-rows { display: grid; gap: 10px; max-height: min(52vh, 520px); overflow: auto; padding-right: 3px; }
.market-quick-plan-row { padding: 12px; border: 1px solid #d8e5ee; border-radius: 14px; background: #fbfdff; }
.market-quick-plan-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: #234d73; font-size: 13px; }
.market-quick-plan-remove { width: 28px; height: 28px; border: 1px solid #f1c3c7; border-radius: 9px; background: #fff8f8; color: #c83f4c; font-size: 20px; line-height: 1; cursor: pointer; }
.market-quick-plan-remove:disabled { opacity: .35; cursor: not-allowed; }
.market-quick-plan-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 12px; }
.market-quick-plan-fields label { display: grid; gap: 5px; color: #46647e; font-size: 11px; font-weight: 750; }
.market-quick-plan-fields input, .market-quick-plan-fields select { min-height: 40px; padding: 8px 10px; font-size: 12px; }
.market-quick-plan-add { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #d8e5ee; border-radius: 12px; background: #f8fbfd; }
.market-quick-plan-add small { color: #667f93; font-size: 12px; }
@media (max-width: 700px) { .market-quick-plan-fields { grid-template-columns: 1fr; } .market-quick-plan-add { align-items: flex-start; flex-direction: column; } }

.capacity-plan-guidance {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: -2px 0 12px;
  padding: 9px 12px;
  border: 1px solid #cbe1ef;
  border-radius: 10px;
  background: #f3f9fd;
  color: #355e7e;
  font-size: 12px;
  font-weight: 700;
}

.plan-cta-pulse { position: relative; isolation: isolate; }
.plan-cta-pulse::after {
  position: absolute;
  z-index: -1;
  inset: -9px;
  border: 2px solid rgba(28, 116, 190, .54);
  border-radius: 14px;
  content: "";
  pointer-events: none;
  animation: plan-cta-ring 1.65s ease-out infinite;
}

@keyframes plan-cta-ring {
  0% { opacity: .8; transform: scale(.92); }
  75%, 100% { opacity: 0; transform: scale(1.16); }
}

@media (prefers-reduced-motion: reduce) {
  .plan-cta-pulse::after { animation: none; opacity: .8; transform: none; }
}

@media (max-width: 620px) {
  .market-ipo-dialog { width: calc(100vw - 20px); border-radius: 19px; }
  .market-ipo-dialog .ipo-ledger-dialog-content { padding: 19px; }
  .market-ipo-dialog .dialog-title-row { gap: 12px; }
  .market-ipo-dialog .ipo-ledger-summary { grid-template-columns: 1fr; }
  .market-ipo-dialog .ipo-ledger-row { grid-template-columns: 74px minmax(0, 1fr); gap: 8px; }
  .market-ipo-dialog .ipo-ledger-row b { grid-column: 2; }
  .ipo-ledger-plan-bar { align-items: stretch; flex-direction: column; }
  .ipo-ledger-plan-bar .primary-btn { width: 100%; }
  .ipo-ledger-plan-bar .ipo-ledger-plan-actions { flex-direction: column-reverse; }
  .ipo-ledger-plan-actions .secondary-btn { width: 100%; }
}

.compact td,
.compact th {
  white-space: nowrap;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-toolbar input,
.history-toolbar select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #c9d8e8;
  border-radius: 10px;
  background: #fff;
  color: #17324d;
  font: inherit;
}

.history-toolbar input {
  min-width: 260px;
}

.transaction-history-status {
  margin: 8px 0 10px;
}

.transaction-history-table td,
.transaction-history-table th {
  white-space: normal;
  vertical-align: top;
}

.transaction-history-details {
  min-width: 320px;
  color: #38556f;
  line-height: 1.5;
}

.action-queue-panel {
  border-top: 3px solid #0b5fae;
}

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

.action-queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid #d9e6f0;
  border-radius: 12px;
  background: #fff;
  color: #17324d;
  text-align: left;
  cursor: pointer;
}

.action-queue-item:hover,
.action-queue-item:focus-visible {
  border-color: #0b5fae;
  box-shadow: 0 0 0 3px rgba(11, 95, 174, 0.14);
  outline: 0;
}

.action-queue-item.needs-action { background: #fffaf0; }
.action-queue-item.is-clear { background: #f5fbf7; }

.action-queue-count {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0b5fae;
  color: #fff;
  font-weight: 800;
}

.action-queue-item.is-clear .action-queue-count { background: #197447; }
.action-queue-item strong,
.action-queue-item small { display: block; }
.action-queue-item small { margin-top: 3px; color: #5a7188; line-height: 1.35; }
.action-queue-arrow { color: #0b5fae; font-size: 12px; font-weight: 800; text-transform: uppercase; }

.history-workspace-intro { margin-bottom: 18px; }

.history-toolbar {
  align-items: center;
  justify-content: flex-end;
}

.history-toolbar input[type="date"] { min-width: 138px; }

.history-ipo-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #0b5fae;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.history-ipo-link:hover,
.history-ipo-link:focus-visible { text-decoration: underline; outline: 0; }

.application-ipo-group td {
  padding: 10px 12px;
  background: #edf5fd;
  color: #17324d;
  border-top: 1px solid #c9d8e8;
}

.application-ipo-group strong { margin-right: 10px; }
.application-ipo-group span { color: #5a7188; font-size: 12px; }
.ipo-group-select { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; color: #2168ae; font-size: 11px; font-weight: 800; }
.ipo-group-select input { width: 15px; height: 15px; accent-color: #1766ad; }

.application-category-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.application-category-summary > div {
  padding: 13px 15px;
  border: 1px solid #d9e6f0;
  border-radius: 12px;
  background: #f8fbfe;
}

.application-category-summary span,
.application-category-summary small { display: block; color: #5a7188; }
.application-category-summary strong { display: block; margin: 3px 0; color: #17324d; font-size: 23px; }

/* Use the full workspace width while keeping each register column easy to scan. */
.applications-table,
.erp-shell .applications-table {
  width: 100%;
  min-width: 1160px;
  border-spacing: 0 3px;
}

.application-register-wrap { width: 100%; padding: 5px; }

.applications-table th,
.applications-table td { padding: 4px 6px; height: 38px; }

.applications-table th:nth-child(2),
.applications-table td:nth-child(2) { width: 15%; }
.applications-table th:nth-child(3),
.applications-table td:nth-child(3) { width: 17%; }
.applications-table th:nth-child(4),
.applications-table td:nth-child(4) { width: 13%; }
.applications-table th:nth-child(5),
.applications-table td:nth-child(5) { width: 8%; text-align: center; }
.applications-table th:nth-child(6),
.applications-table td:nth-child(6) { width: 10%; text-align: center; }
.applications-table th:nth-child(7),
.applications-table td:nth-child(7) { width: 12%; text-align: center; }
.applications-table th:nth-child(8),
.applications-table td:nth-child(8) { width: 17%; text-align: center; }
.applications-table th:nth-child(9),
.applications-table td:nth-child(9) { width: 7%; text-align: center; }

.applications-table .application-actions { gap: 4px; }
.applications-table .application-actions .application-icon-action { width: 25px; height: 25px; }
.applications-table td:nth-child(8) {
  padding-right: 12px;
  text-align: right;
}

.applications-table .refund-plan-wrap {
  display: flex;
  width: 100%;
  position: relative;
  min-height: 27px;
  justify-content: flex-end;
}

.applications-table td:nth-child(8) > .status-pill,
.applications-table .refund-plan-wrap .status-pill {
  display: inline-flex;
  width: 184px;
  min-width: 184px;
  justify-content: center;
  box-sizing: border-box;
}

/* The optional refund action must not consume a second column's width. */
.applications-table .refund-plan-wrap .plan-refund-btn {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  transform: none;
}

/* Keep the application register inside the workspace instead of forcing a page-wide scroll. */
.applications-table,
.erp-shell .applications-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.application-register-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.applications-table th,
.applications-table td {
  padding: 3px 5px;
  height: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.applications-table th:first-child,
.applications-table td:first-child { width: 3%; }
.applications-table th:nth-child(2),
.applications-table td:nth-child(2) { width: 14%; }
.applications-table th:nth-child(3),
.applications-table td:nth-child(3) { width: 17%; }
.applications-table th:nth-child(4),
.applications-table td:nth-child(4) { width: 11%; }
.applications-table th:nth-child(5),
.applications-table td:nth-child(5) { width: 7%; }
.applications-table th:nth-child(6),
.applications-table td:nth-child(6) { width: 9%; }
.applications-table th:nth-child(7),
.applications-table td:nth-child(7) { width: 9%; }
.applications-table th:nth-child(8),
.applications-table td:nth-child(8) { width: 17%; padding-right: 5px; }
.applications-table th:nth-child(9),
.applications-table td:nth-child(9) { width: 13%; }

.applications-table .application-funding-source,
.applications-table .application-account-ledger-trigger {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.applications-table .refund-plan-wrap,
.applications-table td:nth-child(8) > .status-pill,
.applications-table .refund-plan-wrap .status-pill {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.applications-table .application-actions {
  width: 100%;
  gap: 3px;
}

.applications-table .check-allotment-btn {
  min-width: 0;
  padding: 5px 7px;
  font-size: 11px;
}

.application-category-label {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf5fd;
  color: #295678;
  font-size: 11px;
  font-weight: 800;
}

.application-funding-source {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.application-funding-source.is-recorded { color: #245a86; }
.application-funding-source.is-savings { color: #64798e; font-weight: 600; }
.application-funding-source.is-pending { color: #a26713; }

.funding-done,
.funding-covered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.funding-done { background: #e8f8ed; color: #168239; }
.funding-covered { background: #edf5fd; color: #416b90; }

.bulk-funding-review { display: grid; gap: 8px; }
.bulk-funding-review .eyebrow { margin: 0; }
.bulk-funding-review select { min-width: 180px; }
.account-ledger-edit-btn { padding: 5px 9px; font-size: 11px; }

.operations-report-panel { margin-bottom: 22px; }

.capacity-transfer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.capacity-savings-metric {
  display: grid;
  gap: 1px;
  min-width: 150px;
  padding-right: 12px;
  border-right: 1px solid #dce7f0;
  text-align: right;
}

.capacity-savings-metric span {
  color: #6a8094;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.capacity-savings-metric strong {
  color: #153b60;
  font-size: 20px;
  line-height: 1.15;
  white-space: nowrap;
}

.capacity-transfer-action-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.capacity-transfer-action-buttons .secondary-btn,
.capacity-transfer-action-buttons .primary-btn {
  min-width: 132px;
  white-space: nowrap;
}

.capacity-ledger-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #dce7f0;
  border-radius: 15px;
  background: linear-gradient(145deg, #fbfdff, #f3f8fc);
}

.capacity-ledger-shortcut .eyebrow { margin: 0 0 4px; }
.capacity-ledger-shortcut h3 { margin: 0 0 4px; color: #1c405f; font-size: 16px; }
.capacity-ledger-shortcut p { margin: 0; }
.capacity-ledger-shortcut .secondary-btn { white-space: nowrap; }

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

.workflow-heading-actions .secondary-btn {
  min-height: 38px;
  white-space: nowrap;
}

.savings-transfer-ledger-dialog { width: min(1120px, calc(100vw - 32px)); max-width: none; }
.savings-transfer-ledger-dialog .edit-account-form { max-width: none; }
.savings-ledger-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid #e0eaf2;
  border-radius: 13px;
  background: #f8fbfe;
}
.savings-ledger-toolbar .capacity-savings-metric { text-align: left; }
.savings-transfer-table-wrap { max-height: min(52vh, 480px); overflow: auto; }

@media (max-width: 820px) {
  .capacity-transfer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .capacity-transfer-action-buttons { flex: 1; justify-content: flex-end; }

  .capacity-ledger-shortcut { align-items: flex-start; flex-direction: column; }
  .workflow-heading-actions { width: 100%; justify-content: flex-start; }
  .savings-ledger-toolbar { align-items: stretch; flex-direction: column; }
  .savings-ledger-toolbar .capacity-savings-metric { border-right: 0; border-bottom: 1px solid #dce7f0; padding: 0 0 10px; }
  .savings-ledger-toolbar .capacity-transfer-action-buttons { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .capacity-transfer-actions,
  .capacity-transfer-action-buttons { align-items: stretch; flex-direction: column; }
  .capacity-savings-metric { padding: 0 0 9px; border: 0; border-bottom: 1px solid #dce7f0; text-align: left; }
  .capacity-transfer-action-buttons .secondary-btn,
  .capacity-transfer-action-buttons .primary-btn { width: 100%; }
  .capacity-ledger-shortcut .secondary-btn { width: 100%; }
  .workflow-heading-actions .secondary-btn { width: 100%; }
  .savings-transfer-ledger-dialog { width: calc(100vw - 20px); }
}

@media (max-width: 980px) {
  .action-queue { grid-template-columns: 1fr; }
  .history-toolbar { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .history-toolbar input,
  .history-toolbar select,
  .history-toolbar input[type="date"] { min-width: 100%; width: 100%; }
  .transaction-history-table th:first-child,
  .transaction-history-table td:first-child { position: sticky; left: 0; background: #fff; }
  .transaction-history-table thead th:first-child { background: #edf5fd; }
  .application-category-summary { grid-template-columns: 1fr; }
}

/* Applications register: final compact desktop layout.
   Keep the high-information register readable without letting the table push
   the page horizontally. */
.application-register-panel .application-category-summary {
  gap: 12px;
  margin: 0 0 14px;
}

.application-register-panel .application-category-summary .application-category-tile {
  min-height: 104px;
  padding: 16px 18px;
  border-radius: 17px;
  align-content: center;
}

.application-register-panel .application-category-summary .application-category-tile span {
  font-size: 13px;
}

.application-register-panel .application-category-summary .application-category-tile strong {
  margin: 2px 0;
  font-size: 30px;
  line-height: 1;
}

.application-register-panel .application-category-summary .application-category-tile small {
  font-size: 13px;
}

.application-register-panel .application-register-wrap {
  overflow-x: hidden;
  padding: 10px;
  border-radius: 18px;
  background: #f7fafc;
}

.application-register-panel .applications-table,
.application-register-panel .erp-shell .applications-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-spacing: 0 6px;
}

.application-register-panel .applications-table th {
  padding: 7px 8px 9px;
  color: #617b93;
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: .055em;
  white-space: normal;
}

.application-register-panel .applications-table td {
  min-width: 0;
  height: 46px;
  padding: 7px 8px;
  font-size: 12px;
}

.application-register-panel .applications-table th:nth-child(1),
.application-register-panel .applications-table td:nth-child(1) { width: 3%; }
.application-register-panel .applications-table th:nth-child(2),
.application-register-panel .applications-table td:nth-child(2) { width: 14%; }
.application-register-panel .applications-table th:nth-child(3),
.application-register-panel .applications-table td:nth-child(3) { width: 17%; }
.application-register-panel .applications-table th:nth-child(4),
.application-register-panel .applications-table td:nth-child(4) { width: 14%; }
.application-register-panel .applications-table th:nth-child(5),
.application-register-panel .applications-table td:nth-child(5) { width: 7%; }
.application-register-panel .applications-table th:nth-child(6),
.application-register-panel .applications-table td:nth-child(6) { width: 9%; }
.application-register-panel .applications-table th:nth-child(7),
.application-register-panel .applications-table td:nth-child(7) { width: 9%; }
.application-register-panel .applications-table th:nth-child(8),
.application-register-panel .applications-table td:nth-child(8) { width: 14%; }
.application-register-panel .applications-table th:nth-child(9),
.application-register-panel .applications-table td:nth-child(9) { width: 13%; }

.application-register-panel .applications-table select,
.application-register-panel .applications-table .filter-control {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 28px 0 10px;
  border-radius: 10px;
  font-size: 11px;
}

.application-register-panel .applications-table .funding-source-chip,
.application-register-panel .applications-table .category-badge,
.application-register-panel .applications-table .status-badge,
.application-register-panel .applications-table .refund-badge {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-register-panel .applications-table .funding-status {
  white-space: normal;
  font-size: 11px;
  line-height: 1.2;
}

.application-register-panel .applications-table .application-actions {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.application-register-panel .applications-table .application-actions button,
.application-register-panel .applications-table .application-actions .secondary-btn {
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 10px;
  font-size: 10px;
}

.application-register-panel .applications-table .application-actions .check-result-btn {
  min-width: 74px;
}

.application-register-panel .application-register-collapsed td {
  height: auto;
  padding: 10px 12px !important;
}

.application-register-panel .application-register-picker {
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbfdff, #f2f8fc);
}

.application-register-panel .application-register-picker > div > strong {
  font-size: 14px;
}

.application-register-panel .application-register-picker > div > span {
  font-size: 11px;
}

.application-register-panel .application-ipo-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.application-register-panel .application-ipo-summary-card {
  min-width: 0;
  min-height: 90px;
  padding: 13px 14px;
  border-radius: 13px;
}

.application-register-panel .application-ipo-summary-card strong {
  font-size: 14px;
}

.application-register-panel .application-ipo-summary-card span,
.application-register-panel .application-ipo-summary-card button {
  font-size: 11px;
}

.application-register-panel .application-old-ipo-section {
  gap: 9px;
  padding-top: 12px;
  border-top-color: #dce8f0;
}

@media (max-width: 1100px) {
  .application-register-panel .application-register-wrap { overflow-x: auto; }
  .application-register-panel .applications-table,
  .application-register-panel .erp-shell .applications-table { min-width: 980px; }
}

/* Keep the dashboard decision-first while retaining detailed tools on demand. */
body[data-route]:not([data-route="overview"]) .subscription-ticker { display: none; }
.overview-more-tools { margin-top: 14px; }
.overview-more-tools > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #d8e5ee;
  border-radius: 14px;
  background: #f7fafc;
  color: #214565;
  cursor: pointer;
  list-style: none;
}
.overview-more-tools > summary::-webkit-details-marker { display: none; }
.overview-more-tools-title { font-size: 14px; font-weight: 800; }
.overview-more-tools-note { min-width: 0; color: #71879a; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-more-tools-chevron { width: 9px; height: 9px; border-right: 2px solid #2e5774; border-bottom: 2px solid #2e5774; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.overview-more-tools[open] > summary { border-color: #bcd7e8; background: #f1f7fb; }
.overview-more-tools[open] .overview-more-tools-chevron { transform: rotate(225deg) translate(-1px, -1px); }
.overview-more-tools > .panel:first-of-type { margin-top: 12px; }
.overview-more-tools > .panel + .panel { margin-top: 14px; }

/* Prevent long market/register labels from forcing a second canvas. */
body[data-route="applications"], body[data-route="old-applications"] { overflow-x: hidden; }
.application-register-panel,
.application-register-panel .application-register-wrap,
.application-register-panel .application-register-picker,
.application-register-panel .application-old-ipo-section { box-sizing: border-box; max-width: 100%; }
.application-register-panel .application-register-picker,
.application-register-panel .application-old-ipo-section { width: 100%; }

@media (max-width: 760px) {
  .overview-more-tools > summary { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 13px; }
  .overview-more-tools-note { grid-column: 1; grid-row: 2; }
}

/* Period ledger reporting: MARG-style accounting context in the existing visual language. */
.account-ledger-workspace-dialog {
  width: min(1500px, calc(100vw - 28px));
  max-height: min(940px, calc(100dvh - 28px));
}

.account-ledger-workspace-shell { padding: 22px 24px; }
.account-ledger-workspace { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); min-height: 650px; }
.account-ledger-account-pane { padding-top: 14px; }
.account-ledger-account-list { max-height: 600px; }
.account-ledger-detail-pane { padding: 14px 0 0 18px; }
.account-ledger-detail-header { align-items: center; margin-bottom: 10px; }
.account-ledger-detail-header h3 { font-size: 20px; }

.account-ledger-report-bar {
  display: grid;
  grid-template-columns: auto auto minmax(170px, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid #dce8f1;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fbfe, #f1f7fb);
}

.account-ledger-period-fields { display: grid; grid-template-columns: repeat(2, 132px); gap: 7px; }
.account-ledger-report-bar label { display: grid; gap: 4px; color: #607b93; font-size: 9px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.account-ledger-report-bar input { width: 100%; height: 34px; min-height: 34px; padding: 5px 8px; border: 1px solid #caddea; border-radius: 9px; background: #fff; color: #214563; font: inherit; font-size: 11px; font-weight: 700; }
.account-ledger-report-bar input:focus { border-color: #78aef0; box-shadow: 0 0 0 3px rgba(64, 139, 223, .13); outline: none; }
.account-ledger-movement-search { min-width: 0; }

.account-ledger-view-switch { display: inline-flex; height: 34px; padding: 3px; border: 1px solid #d3e2ec; border-radius: 9px; background: #eaf2f8; }
.account-ledger-view-switch button,
.account-ledger-report-actions button,
.account-ledger-detail-btn {
  min-width: 0;
  min-height: 0;
  border: 0;
  box-shadow: none;
  font-family: inherit;
}
.account-ledger-view-switch button { padding: 4px 9px; border-radius: 6px; background: transparent; color: #607a91; font-size: 10px; font-weight: 800; }
.account-ledger-view-switch button.is-active { background: #fff; color: #1766a9; box-shadow: 0 1px 5px rgba(29, 75, 111, .12); }
.account-ledger-report-actions { display: flex; gap: 6px; }
.account-ledger-report-actions button { height: 34px; padding: 0 11px; border: 1px solid #cbddea; border-radius: 9px; background: #fff; color: #2c628e; font-size: 10px; font-weight: 800; }
.account-ledger-report-actions button:hover { border-color: #8eb8de; background: #f7fbff; }

.account-ledger-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin: 9px 0 6px; }
.account-ledger-summary > div { display: grid; align-content: center; min-height: 58px; padding: 8px 11px; border: 1px solid #dce7ef; border-radius: 11px; background: #fff; }
.account-ledger-summary > div.is-closing { border-color: #bedaf0; background: linear-gradient(145deg, #f2f9ff, #e9f4ff); }
.account-ledger-summary span { color: #71879a; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.account-ledger-summary strong { margin-top: 2px; overflow: hidden; color: #173e60; font-size: clamp(13px, 1.1vw, 17px); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.account-ledger-summary .is-closing strong { color: #0c659f; }

.account-ledger-report-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 25px; padding: 0 3px; color: #71879a; font-size: 10px; }
.account-ledger-report-meta p { margin: 0; font-weight: 700; }
.account-ledger-report-meta label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.account-ledger-report-meta input { margin: 0; accent-color: #1978bf; }

.account-ledger-workspace-dialog .account-ledger-table-wrap { max-height: 285px; }
.account-ledger-workspace-dialog .account-ledger-table-wrap table { min-width: 790px; table-layout: fixed; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th { padding: 9px 10px; font-size: 9px; letter-spacing: .06em; }
.account-ledger-workspace-dialog .account-ledger-table-wrap td { height: 44px; padding: 7px 10px; color: #21425e; font-size: 11px; font-variant-numeric: tabular-nums; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(1) { width: 12%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(2) { width: 18%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(3) { width: 25%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(4),
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(5),
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(6) { width: 11%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(7) { width: 12%; }
.account-ledger-movement-row { cursor: pointer; }
.account-ledger-movement-row:hover td { background: #f5faff; }
.account-ledger-movement-row.is-selected td { background: #eaf4fe; }
.account-ledger-movement-row:focus { outline: 2px solid #73aef0; outline-offset: -2px; }
.account-ledger-movement-row td:nth-child(3) span,
.account-ledger-movement-row td:nth-child(3) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-ledger-movement-row td:nth-child(3) small { margin-top: 2px; color: #7a8fa1; font-size: 9px; }
.account-ledger-opening-row td { height: 36px !important; background: #f8fafc; color: #6c8295 !important; font-size: 10px !important; font-style: italic; }
.account-ledger-detail-btn { padding: 6px 8px; border: 1px solid #cddfeb; border-radius: 8px; background: #fff; color: #21669d; font-size: 9px; font-weight: 800; }
.account-ledger-workspace-actions { gap: 4px; }
.account-ledger-workspace-actions button { min-height: 28px !important; padding: 5px 7px !important; border-radius: 8px !important; font-size: 9px !important; }

.account-ledger-transaction-detail { margin-top: 8px; padding: 10px 12px; border: 1px solid #d5e5f0; border-radius: 12px; background: linear-gradient(145deg, #fff, #f5f9fc); }
.account-ledger-transaction-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.account-ledger-transaction-detail-heading div { display: flex; align-items: baseline; gap: 8px; }
.account-ledger-transaction-detail-heading span { color: #6e8497; font-size: 9px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.account-ledger-transaction-detail-heading strong { color: #20496b; font-size: 12px; }
.account-ledger-transaction-detail-heading button { display: grid; width: 24px; height: 24px; min-width: 24px; min-height: 24px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: #eaf2f8; color: #50718c; box-shadow: none; font-size: 17px; }
.account-ledger-transaction-detail dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 14px; margin: 0; }
.account-ledger-transaction-detail dl > div { min-width: 0; }
.account-ledger-transaction-detail dl > div.is-wide { grid-column: span 2; }
.account-ledger-transaction-detail dt { color: #7a8fa1; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.account-ledger-transaction-detail dd { margin: 2px 0 0; overflow: hidden; color: #234866; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-ledger-keyboard-hint { margin: 7px 2px 0; color: #7890a2; font-size: 9px; text-align: right; }
.account-ledger-keyboard-hint kbd { padding: 1px 4px; border: 1px solid #d1e0ea; border-radius: 4px; background: #f7fafc; color: #4d708d; font-family: inherit; font-size: 8px; font-weight: 800; }

@media (max-width: 1080px) {
  .account-ledger-workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .account-ledger-report-bar { grid-template-columns: 1fr auto; }
  .account-ledger-period-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-ledger-movement-search { grid-column: 1; }
  .account-ledger-report-actions { grid-column: 2; grid-row: 2; }
}

@media (max-width: 760px) {
  .account-ledger-workspace-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .account-ledger-workspace-shell { padding: 16px; }
  .account-ledger-workspace { grid-template-columns: 1fr; min-height: 0; }
  .account-ledger-account-pane { padding: 12px 0; border-right: 0; border-bottom: 1px solid #e1ebf3; }
  .account-ledger-account-list { max-height: 150px; }
  .account-ledger-detail-pane { padding: 12px 0 0; }
  .account-ledger-detail-header { align-items: flex-start; }
  .account-ledger-summary { grid-template-columns: repeat(2, 1fr); }
  .account-ledger-summary > div.is-closing { grid-column: span 2; }
  .account-ledger-transaction-detail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  body.account-ledger-printing * { visibility: hidden !important; }
  body.account-ledger-printing #accountLedgerWorkspaceDialog,
  body.account-ledger-printing #accountLedgerWorkspaceDialog * { visibility: visible !important; }
  body.account-ledger-printing #accountLedgerWorkspaceDialog { position: absolute; inset: 0; display: block; width: 100%; max-height: none; margin: 0; border: 0; box-shadow: none; }
  body.account-ledger-printing .account-ledger-workspace-shell { padding: 12px; }
  body.account-ledger-printing .account-ledger-workspace-title button,
  body.account-ledger-printing .account-ledger-account-pane,
  body.account-ledger-printing .account-ledger-view-switch,
  body.account-ledger-printing .account-ledger-movement-search,
  body.account-ledger-printing .account-ledger-report-actions,
  body.account-ledger-printing .account-ledger-detail-actions button,
  body.account-ledger-printing .account-ledger-report-meta label,
  body.account-ledger-printing .account-ledger-table-wrap th:last-child,
  body.account-ledger-printing .account-ledger-table-wrap td:last-child,
  body.account-ledger-printing .account-ledger-transaction-detail,
  body.account-ledger-printing .account-ledger-keyboard-hint { display: none !important; }
  body.account-ledger-printing .account-ledger-workspace { display: block; min-height: 0; }
  body.account-ledger-printing .account-ledger-detail-pane { padding: 10px 0 0; }
  body.account-ledger-printing .account-ledger-report-bar { grid-template-columns: auto; }
  body.account-ledger-printing .account-ledger-table-wrap { max-height: none !important; overflow: visible !important; }
  body.account-ledger-printing .account-ledger-table-wrap table { min-width: 0; }
}

/* Journal voucher and ledger: make the cash direction explicit without adding visual weight. */
.voucher-lines .voucher-line label > span {
  color: #234d71;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1.2;
  text-transform: none;
}

.voucher-lines .voucher-swap-line {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 5px 0;
  border-top: 1px solid #e7eff6;
  background: #fbfdff;
}

.voucher-lines .voucher-swap-line .voucher-swap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #c8dced;
  border-right: 0;
  border-radius: 999px;
  background: #f7fbff;
  color: #24639a;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.voucher-lines .voucher-swap-line .voucher-swap-btn:hover,
.voucher-lines .voucher-swap-line .voucher-swap-btn:focus-visible {
  border-color: #74a8d7;
  background: #eaf4ff;
  outline: none;
}

.voucher-lines .voucher-swap-line .voucher-swap-btn::first-letter {
  font-size: 16px;
}

.account-ledger-workspace-dialog .account-ledger-table-wrap table {
  min-width: 640px;
}

.account-ledger-workspace-dialog .account-ledger-table-wrap th {
  padding: 9px 10px;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.account-ledger-workspace-dialog .account-ledger-table-wrap td {
  height: auto;
  padding: 10px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.account-ledger-workspace-dialog .account-ledger-table-wrap tbody tr {
  height: 52px;
}

.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(1) { width: 13%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(2) { width: 17%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(3) { width: 22%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(4),
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(5) { width: 11%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(6) { width: 12%; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th:nth-child(7) { width: 14%; }

.account-ledger-workspace-dialog .account-ledger-workspace-actions {
  gap: 5px;
}

.account-ledger-workspace-dialog .account-ledger-workspace-actions .secondary-btn,
.account-ledger-workspace-dialog .account-ledger-voucher-delete-btn {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 11px;
}

/* OD metrics use a dedicated, calm summary treatment rather than generic cards. */
#odInfoCards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

#odInfoCards .od-metric-card {
  display: flex;
  min-height: 126px;
  padding: 18px 18px 16px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #d9e8ee;
  border-top: 1px solid #d9e8ee;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.68) 0 20%, transparent 20.5%),
    linear-gradient(135deg, #f8fcfa, #eaf7f1);
  box-shadow: 0 8px 20px rgba(28, 85, 70, 0.055);
}

#odInfoCards .od-metric-card::before {
  display: none;
}

#odInfoCards .od-metric-card p {
  min-height: 30px;
  margin: 0;
  color: #526c7d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 1.22;
}

#odInfoCards .od-metric-card h3 {
  margin: 12px 0 0;
  color: #153a58;
  font-size: clamp(25px, 2vw, 34px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1;
}

#odInfoCards .od-metric-card-2,
#odInfoCards .od-metric-card-5,
#odInfoCards .od-metric-card-7 {
  border-color: #f1db9f;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.62) 0 20%, transparent 20.5%),
    linear-gradient(135deg, #fffdf4, #fff2c9);
}

#odInfoCards .od-metric-card-3,
#odInfoCards .od-metric-card-4,
#odInfoCards .od-metric-card-6 {
  border-color: #c9dfef;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.64) 0 20%, transparent 20.5%),
    linear-gradient(135deg, #f7fbff, #e6f3fb);
}

@media (max-width: 1180px) {
  #odInfoCards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  #odInfoCards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #odInfoCards .od-metric-card { min-height: 112px; padding: 15px; }
  #odInfoCards .od-metric-card h3 { font-size: 26px; }
}

/* Keep an open voucher picker above the next accounting row. */
.voucher-line:has(.voucher-account-picker.is-open) {
  position: relative;
  z-index: 30;
}

.voucher-line label:has(.voucher-account-picker.is-open),
.voucher-account-picker.is-open {
  position: relative;
  z-index: 31;
  overflow: visible;
}

.voucher-account-picker.is-open .voucher-account-picker-list {
  z-index: 32;
  max-height: 230px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(25, 60, 89, 0.22);
}

/* Reconciliation centre: compact account scan without inheriting the larger
   dashboard-panel rhythm. */
.reconciliation-panel { padding: 16px 18px 18px; }
.reconciliation-panel .panel-header {
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 12px;
}
.reconciliation-panel .panel-header > div { min-width: 0; }
.reconciliation-panel .panel-header .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin: 0 0 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  letter-spacing: .075em;
  white-space: nowrap;
}
.reconciliation-panel .panel-header h2 {
  margin: 0 0 3px;
  font-size: 23px;
  line-height: 1.12;
}
.reconciliation-panel .panel-header p {
  margin: 0;
  font-size: 12px;
  line-height: 1.38;
}
.reconciliation-panel .panel-header .secondary-btn {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 11px;
  white-space: nowrap;
}
.reconciliation-panel .reconciliation-grid { gap: 10px; }
.reconciliation-panel .reconciliation-account {
  gap: 7px;
  min-height: 0;
  padding: 12px 13px;
  border-radius: 13px;
  background: linear-gradient(145deg, #ffffff, #f8fbfd);
}
.reconciliation-panel .reconciliation-account > div { gap: 0; }
.reconciliation-panel .reconciliation-account > div strong { font-size: 14px; line-height: 1.2; }
.reconciliation-panel .reconciliation-account > div span { font-size: 10px; line-height: 1.25; }
.reconciliation-panel .reconciliation-account dl { gap: 8px; }
.reconciliation-panel .reconciliation-account dt { font-size: 9px; line-height: 1.1; }
.reconciliation-panel .reconciliation-account dd { margin-top: 2px; font-size: 12px; line-height: 1.15; }
.reconciliation-panel .reconciliation-account .secondary-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

@media (max-width: 620px) {
  .reconciliation-panel { padding: 14px; }
  .reconciliation-panel .panel-header { align-items: flex-start; flex-direction: column; }
  .reconciliation-panel .panel-header .secondary-btn { width: 100%; }
}

/* Final compact workflow layout: keep Daily operations dense and aligned. */
.daily-workflow-panel {
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(21, 55, 90, 0.05);
}

.daily-workflow-panel .panel-header {
  min-height: 0;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.daily-workflow-panel .panel-header h2 {
  margin: 0 0 2px;
  font-size: 20px;
}

.daily-workflow-panel .panel-header p {
  margin: 0;
  font-size: 12px;
}

.daily-workflow-panel .workflow-heading-actions {
  display: flex;
  gap: 8px;
}

.daily-workflow-panel .workflow-heading-actions .secondary-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.daily-workflow-panel .workflow-steps {
  gap: 8px;
}

.daily-workflow-panel .workflow-step {
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 5px 8px;
  min-height: 112px;
  padding: 10px;
  border-radius: 10px;
}

.daily-workflow-panel .workflow-step-number {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.daily-workflow-panel .workflow-step strong {
  font-size: 12px;
  line-height: 1.15;
}

.daily-workflow-panel .workflow-step b {
  margin-top: 2px;
  font-size: 20px;
}

.daily-workflow-panel .workflow-step small {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.3;
}

.daily-workflow-panel .workflow-step-action {
  min-height: 27px;
  padding: 4px 7px;
  font-size: 10px;
}

.daily-workflow-panel .workflow-step-action i {
  font-size: 9px;
}

@media (max-width: 760px) {
  .daily-workflow-panel { padding: 13px; }
  .daily-workflow-panel .panel-header { gap: 10px; }
  .daily-workflow-panel .workflow-heading-actions { width: 100%; }
  .daily-workflow-panel .workflow-heading-actions .secondary-btn { flex: 1; }
}

/* The IPO picker is a separate browse state, not a compressed transaction table. */
.application-register-panel.is-ipo-picker .application-register-wrap {
  padding: 14px;
  overflow: visible;
  background: #f7fafc;
}

.application-register-panel.is-ipo-picker .applications-table {
  min-width: 0;
  table-layout: auto;
  border-spacing: 0;
}

.application-register-panel.is-ipo-picker .applications-table thead,
.application-register-panel.is-ipo-picker .applications-table tbody,
.application-register-panel.is-ipo-picker .applications-table tr,
.application-register-panel.is-ipo-picker .applications-table th,
.application-register-panel.is-ipo-picker .applications-table td {
  display: block;
  width: auto !important;
}

.application-register-panel.is-ipo-picker .applications-table thead tr {
  display: grid;
  grid-template-columns: 28px minmax(160px, 1fr) minmax(190px, 1.2fr) repeat(4, minmax(100px, 0.62fr));
  gap: 10px;
  align-items: end;
  padding: 0 4px 12px;
}

.application-register-panel.is-ipo-picker .applications-table th {
  min-width: 0;
  height: auto;
  padding: 0;
  text-align: left;
}

.application-register-panel.is-ipo-picker .applications-table th:first-child {
  display: grid;
  place-items: end center;
  min-height: 30px;
}

.application-register-panel.is-ipo-picker .applications-table th:nth-child(4),
.application-register-panel.is-ipo-picker .applications-table th:nth-child(9) {
  display: none;
}

.application-register-panel.is-ipo-picker .applications-table .filterable-header {
  display: grid;
  gap: 5px;
}

.application-register-panel.is-ipo-picker .applications-table .filterable-header > span {
  overflow: visible;
  color: #607a92;
  font-size: 10px;
  letter-spacing: 0.07em;
  line-height: 1.1;
  text-overflow: clip;
  white-space: nowrap;
}

.application-register-panel.is-ipo-picker .application-header-filter {
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 28px 0 10px;
  font-size: 12px;
}

.application-register-panel.is-ipo-picker .application-register-collapsed td {
  padding: 0 !important;
}

.application-register-panel.is-ipo-picker .application-register-picker {
  gap: 12px;
  padding: 18px 14px 14px;
  border-radius: 13px;
  background: linear-gradient(145deg, #fbfdff, #f1f7fb);
}

.application-register-panel.is-ipo-picker .application-register-picker > div:first-child {
  text-align: center;
}

.application-register-panel.is-ipo-picker .application-register-picker > div:first-child strong {
  font-size: 16px;
}

.application-register-panel.is-ipo-picker .application-ipo-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.application-register-panel.is-ipo-picker .application-ipo-summary-card {
  min-width: 0;
  min-height: 116px;
  padding: 15px;
  align-content: start;
  border-radius: 13px;
}

.application-register-panel.is-ipo-picker .application-ipo-summary-card strong {
  font-size: 15px;
  line-height: 1.2;
}

.application-register-panel.is-ipo-picker .application-old-ipo-section {
  gap: 10px;
  padding-top: 12px;
}

@media (max-width: 1050px) {
  .application-register-panel.is-ipo-picker .applications-table thead tr {
    grid-template-columns: 28px repeat(3, minmax(150px, 1fr));
  }

  .application-register-panel.is-ipo-picker .application-ipo-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .application-register-panel.is-ipo-picker .applications-table thead tr,
  .application-register-panel.is-ipo-picker .application-ipo-summary-grid {
    grid-template-columns: 1fr;
  }

  .application-register-panel.is-ipo-picker .applications-table th:first-child {
    display: none;
  }
}

/* Clear responsibility split: snapshot above, exceptions here, entry forms in Daily operations. */
.daily-workflow-panel .workflow-step {
  min-height: 128px;
  padding: 12px;
}
.daily-workflow-panel .workflow-step b { font-size: 22px; }
.daily-workflow-panel .workflow-step small { margin-top: 5px; }

@media (max-width: 760px) {
  .command-center-clear { align-items: flex-start; flex-direction: column; }
}

/* Final compact workflow layout: an NSE-style operational strip, not a dashboard. */
.daily-workflow-panel {
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(23, 50, 77, .035);
}
.daily-workflow-panel .panel-header {
  min-height: 0;
  margin-bottom: 10px;
  padding-bottom: 10px;
}
.daily-workflow-panel .panel-header h2 { margin: 0 0 2px; font-size: 20px; }
.daily-workflow-panel .panel-header p { margin: 0; font-size: 12px; }
.daily-workflow-panel .workflow-heading-actions { display: flex; gap: 8px; }
.daily-workflow-panel .workflow-heading-actions .secondary-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}
.daily-workflow-panel .workflow-steps { gap: 8px; }
.daily-workflow-panel .workflow-step {
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 5px 8px;
  min-height: 112px;
  padding: 10px;
  border-radius: 10px;
}
.daily-workflow-panel .workflow-step-number { width: 24px; height: 24px; font-size: 10px; }
.daily-workflow-panel .workflow-step strong { font-size: 12px; line-height: 1.15; }
.daily-workflow-panel .workflow-step b { margin-top: 2px; font-size: 20px; }
.daily-workflow-panel .workflow-step small { margin-top: 3px; font-size: 10px; line-height: 1.3; }
.daily-workflow-panel .workflow-step-action { min-height: 27px; padding: 4px 7px; font-size: 10px; }
.daily-workflow-panel .workflow-step-action i { font-size: 9px; }

@media (max-width: 760px) {
  .daily-workflow-panel { padding: 13px; }
  .daily-workflow-panel .panel-header { gap: 10px; }
  .daily-workflow-panel .workflow-heading-actions { width: 100%; }
  .daily-workflow-panel .workflow-heading-actions .secondary-btn { flex: 1; }
}

/* Bank statement reconciliation keeps the review list compact and readable. */
.edit-dialog.bank-statement-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
}

.bank-statement-dialog-shell {
  display: grid;
  gap: 16px;
  max-width: none;
  padding: 24px 26px;
}

.bank-statement-dialog .dialog-title-row { align-items: flex-start; }
.bank-statement-dialog .dialog-title-row h3 { margin: 4px 0 5px; }
.bank-statement-dialog .dialog-title-row p:not(.eyebrow) { max-width: 630px; }

.bank-statement-upload-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.2fr);
  gap: 14px;
}

.bank-statement-upload-grid label,
.bank-statement-toggle {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
}

.bank-statement-upload-grid input,
.bank-statement-upload-grid select { width: 100%; min-width: 0; }

.bank-statement-toggle {
  display: flex;
  align-items: center;
  color: var(--text);
  font-weight: 650;
}

.bank-statement-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }

.bank-statement-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bank-statement-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid #dce8f1;
  border-radius: 12px;
  background: #f8fbfd;
  color: #5c7489;
  font-size: 12px;
  font-weight: 800;
}

.bank-statement-stat strong { color: #193d5d; font-size: 21px; letter-spacing: -.03em; }
.bank-statement-stat.is-warning { border-color: #f3d7a1; background: #fffaf0; }
.bank-statement-stat.is-warning strong { color: #a4610a; }

.bank-statement-table-wrap { max-height: min(400px, 45vh); overflow: auto; border-radius: 13px; }
.bank-statement-reconciliation-table { width: 100%; min-width: 760px; table-layout: fixed; }
.bank-statement-reconciliation-table th:nth-child(1) { width: 112px; }
.bank-statement-reconciliation-table th:nth-child(3) { width: 125px; }
.bank-statement-reconciliation-table th:nth-child(4) { width: 110px; }
.bank-statement-reconciliation-table th:nth-child(5) { width: 240px; }
.bank-statement-reconciliation-table td { vertical-align: middle; font-size: 13px; }
.bank-statement-description { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-statement-amount { font-weight: 800; white-space: nowrap; }
.bank-statement-direction { color: #557087; font-size: 12px; font-weight: 800; text-transform: capitalize; }
.bank-statement-match { display: grid; gap: 2px; }
.bank-statement-match strong { color: #177e45; font-size: 12px; }
.bank-statement-match span { color: #6d8293; font-size: 11px; }
.bank-statement-unmatched { color: #a4610a; font-size: 12px; font-weight: 800; }

.application-templates-dialog { width: min(720px, calc(100vw - 28px)); }
.application-templates-shell { display: grid; gap: 14px; max-width: none; padding: 24px 26px; }
.application-templates-list { display: grid; gap: 8px; max-height: min(440px, 55vh); overflow: auto; }
.application-template-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid #dce7f0; border-radius: 12px; background: #fbfdff; }
.application-template-row > div:first-child { display: grid; gap: 3px; min-width: 0; }
.application-template-row strong { color: #1c405f; font-size: 13px; }
.application-template-row span { overflow: hidden; color: #667f93; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.application-template-row > div:last-child { display: flex; gap: 6px; flex-shrink: 0; }
.application-template-row .secondary-btn { min-height: 34px; padding: 6px 9px; font-size: 11px; }
@media (max-width: 720px) { .application-templates-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); } .application-templates-shell { padding: 18px; } .application-template-row { align-items: stretch; flex-direction: column; } .application-template-row > div:last-child { width: 100%; } .application-template-row .secondary-btn { flex: 1; } }

@media (max-width: 720px) {
  .edit-dialog.bank-statement-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .bank-statement-dialog-shell { padding: 18px; }
  .bank-statement-upload-grid,
  .bank-statement-summary { grid-template-columns: 1fr; }
  .bank-statement-table-wrap { max-height: 42vh; }
}

/* Final workspace polish: quiet surfaces, tighter rhythm, and clearer hierarchy. */
.erp-shell {
  --shadow: 0 8px 24px rgba(15, 52, 96, 0.06);
}

.erp-shell .top-nav-tabs {
  gap: 6px;
  padding: 6px;
  border-color: rgba(199, 216, 234, 0.88);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 52, 96, 0.055);
  backdrop-filter: blur(12px);
}

.erp-shell .nav-tab {
  min-height: 36px;
  padding: 8px 11px;
  border-color: transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
}

.erp-shell .nav-tab:hover {
  background: #f2f7fc;
  border-color: #e1ebf4;
}

.erp-shell .nav-tab.active {
  border-color: #c5dcf7;
  background: linear-gradient(135deg, #e8f3ff, #f5faff);
  box-shadow: 0 3px 10px rgba(20, 99, 184, 0.09);
}

.erp-shell .nav-old-ipo-shortcut {
  width: 100%;
  justify-content: flex-start;
  border: 1px solid #d8e6f0;
  background: #f7fbfe;
  color: #2a648e;
  cursor: pointer;
  font: inherit;
}

.erp-shell .nav-old-ipo-shortcut:hover { border-color: #a9cce2; background: #eef7fc; }

.erp-shell .panel {
  padding: 17px 18px;
  border-radius: 14px;
}

.erp-shell .panel-header {
  margin-bottom: 13px;
  padding-bottom: 10px;
}

.erp-shell .panel-header h2::before {
  width: 3px;
  background: linear-gradient(180deg, #1d75c9, #159286);
}

.erp-shell .cards {
  gap: 11px;
  margin-bottom: 14px;
}

.erp-shell .card {
  min-height: 104px;
  padding: 13px 15px;
  border-radius: 13px;
}

.erp-shell .card p {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.erp-shell .card h3 {
  font-size: clamp(22px, 2vw, 27px);
}

.erp-shell input,
.erp-shell select {
  min-height: 40px;
  border-color: #cdddeb;
  border-radius: 10px;
  background: #fbfdff;
}

.erp-shell input:hover,
.erp-shell select:hover {
  border-color: #a9c8e5;
}

.erp-shell .primary-btn,
.erp-shell .secondary-btn {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12px;
}

.erp-shell .secondary-btn {
  border-color: #d2e0ec;
  background: #f8fbfd;
}

.erp-shell .table-wrap {
  border-color: #dbe7f0;
  border-radius: 12px;
}

.erp-shell th {
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 10px;
  letter-spacing: 0.07em;
}

.erp-shell td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.erp-shell .status-pill,
.erp-shell .badge {
  padding: 4px 8px;
  border-radius: 7px;
  letter-spacing: 0.045em;
}

.erp-shell .simple-form,
.erp-shell .focus-box {
  border-radius: 13px;
  box-shadow: none;
}

.erp-shell .simple-form::before,
.erp-shell .focus-box::before {
  width: 28px;
  height: 3px;
  margin-bottom: 8px;
}

.tab-section.active {
  animation: workspace-reveal 180ms ease-out both;
}

@keyframes workspace-reveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead {
  background: linear-gradient(180deg, #f7fbff 0%, #edf5fd 100%);
}

th,
td {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid #e5eef8;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: rgba(245, 249, 253, 0.65);
}

tbody tr:hover {
  background: rgba(232, 241, 255, 0.6);
}

th {
  color: #4e6983;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

td {
  color: #183552;
}

td a {
  color: var(--brand-strong);
  text-decoration: none;
  font-weight: 700;
}

td a:hover {
  text-decoration: underline;
}

.danger {
  color: var(--danger);
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}

input,
select,
button,
.secondary-btn {
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.simple-form input,
.simple-form select,
.simple-form button,
.simple-form .hint-box {
  width: 100%;
  min-width: 0;
}

input:focus,
select:focus,
button:focus,
.secondary-btn:focus {
  outline: none;
  border-color: #8cb5f3;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-weight: 800;
  border: none;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.primary-btn:hover,
.secondary-btn:hover,
button:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: linear-gradient(180deg, #ffffff, #f3f7fb);
  color: #21476e;
  font-weight: 700;
}

.danger-btn {
  background: #fff1f1;
  border-color: #f7c9c9;
  color: #991b1b;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.inline-filter {
  white-space: nowrap;
}

.checkbox input {
  width: auto;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.badge-high,
.status-bad {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.badge-medium,
.status-warn {
  background: rgba(245, 158, 11, 0.16);
  color: #9a5a08;
}

.badge-low,
.badge-neutral {
  background: rgba(37, 99, 235, 0.1);
  color: #2156a9;
}

.status-good {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.status-neutral {
  background: rgba(148, 163, 184, 0.16);
  color: #52667a;
}

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

.note-panel ul {
  margin-bottom: 0;
}

details.panel > summary {
  list-style: none;
}

details.panel > summary::-webkit-details-marker {
  display: none;
}

.edit-dialog {
  width: min(600px, calc(100vw - 28px));
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 0;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 52, 96, 0.24);
}

.edit-dialog::backdrop {
  background: rgba(15, 35, 58, 0.38);
}

.od-transaction-edit-dialog {
  z-index: 20;
  width: min(1080px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  overflow-x: hidden;
}

.od-transaction-edit-dialog::backdrop {
  background: rgba(15, 35, 58, 0.18);
}

.od-transaction-edit-dialog .edit-account-form,
.od-transaction-edit-dialog #odTransactionEditFields,
.od-transaction-edit-dialog label {
  min-width: 0;
  max-width: 100%;
}

.od-transaction-edit-dialog #odTransactionEditFields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.od-transaction-edit-dialog input,
.od-transaction-edit-dialog select {
  width: 100%;
  min-width: 0;
}

.edit-account-form {
  padding: 24px;
}

.dialog-title-row {
  grid-column: span 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-title-row h3,
.dialog-title-row p {
  margin: 0;
}

.dialog-title-row p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* A focused return composer with a stable, app-like action bar. */
.plan-refund-dialog {
  width: min(680px, calc(100vw - 28px));
  border-color: #d6e2ee;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 52, 96, 0.22);
}

.plan-refund-form {
  gap: 16px;
  padding: 28px;
}

.plan-refund-dialog .dialog-title-row {
  align-items: center;
  padding-bottom: 2px;
}

.plan-refund-dialog .dialog-title-row h3 {
  font-size: 26px;
  letter-spacing: -0.035em;
}

.plan-refund-dialog .dialog-title-row p {
  max-width: 390px;
  font-size: 13px;
  line-height: 1.45;
}

.plan-refund-dialog label {
  gap: 7px;
  color: #526b83;
  font-size: 11px;
  letter-spacing: 0.025em;
}

.plan-refund-dialog input,
.plan-refund-dialog select {
  height: 48px;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
}

.plan-refund-dialog input[readonly] {
  border-color: #e0e9f2;
  background: #f7fafd;
  color: #36516b;
}

.plan-refund-dialog .dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  padding-top: 17px;
  border-top: 1px solid #e5edf4;
}

.plan-refund-dialog .dialog-actions button {
  min-height: 42px;
  margin: 0;
  padding: 9px 14px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.plan-refund-dialog #viewRefundApplicantLedgerBtn {
  justify-self: start;
  border-color: transparent;
  background: #edf5fc;
  color: #1c5b94;
}

.plan-refund-dialog #cancelPlanRefundBtn { background: #fff; color: #49657d; }
.plan-refund-dialog .primary-btn { min-width: 118px; box-shadow: 0 5px 12px rgba(11, 79, 148, 0.18); }

@media (max-width: 640px) {
  .plan-refund-dialog { width: calc(100vw - 20px); }
  .plan-refund-form { grid-template-columns: 1fr; gap: 13px; padding: 20px; }
  .plan-refund-dialog .dialog-title-row { grid-column: span 1; align-items: flex-start; }
  .plan-refund-dialog .dialog-actions { grid-column: span 1; grid-template-columns: 1fr; gap: 8px; }
  .plan-refund-dialog .dialog-actions button,
  .plan-refund-dialog #viewRefundApplicantLedgerBtn { width: 100%; justify-self: stretch; }
}

.balance-batch-form {
  display: grid;
  gap: 12px;
}

.balance-shortcut-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: #c9def7;
  background: linear-gradient(100deg, #f7fbff, #ecf5ff);
}

.balance-shortcut-panel h2 {
  margin: 2px 0 4px;
  font-size: 19px;
}

.balance-shortcut-panel p:last-child {
  margin: 0;
  color: var(--muted);
}

.balance-batch-form td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.balance-batch-input {
  min-width: 160px;
  margin: 0;
}

.balance-batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

/* Balance reconciliation needs a wider, denser register than a normal form. */
.balance-update-dialog {
  width: min(1040px, calc(100vw - 36px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}

.balance-update-dialog .edit-account-form {
  max-height: calc(100dvh - 28px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px 20px;
  overflow: hidden;
}

.balance-update-dialog .dialog-title-row { margin-bottom: 0; }
.balance-update-dialog .dialog-title-row h3 { margin-bottom: 4px; }
.balance-update-dialog .dialog-title-row p { margin: 0; }
.balance-update-dialog .balance-effective-date { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(190px, 280px) 1fr; gap: 4px 14px; align-items: center; margin: 0; }
.balance-update-dialog .balance-date-control { grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.balance-update-dialog .balance-effective-date input { width: 100%; min-height: 36px; }
.balance-update-dialog .balance-date-control .secondary-btn { min-height: 36px; padding: 7px 11px; font-size: 13px; white-space: nowrap; }
.balance-update-dialog .balance-effective-date small { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.35; }
.balance-update-dialog .table-wrap { min-height: 0; max-height: none; overflow: auto; }
.balance-update-dialog table { width: 100%; table-layout: fixed; }
.balance-update-dialog th,
.balance-update-dialog td { padding: 5px 12px; }
.balance-update-dialog th:nth-child(1),
.balance-update-dialog td:nth-child(1) { width: 52%; }
.balance-update-dialog th:nth-child(2),
.balance-update-dialog td:nth-child(2) { width: 24%; white-space: nowrap; }
.balance-update-dialog th:nth-child(3),
.balance-update-dialog td:nth-child(3) { width: 24%; }
.balance-update-dialog td small { display: inline; margin: 0 0 0 6px; }
.balance-update-dialog .balance-batch-input { width: 100%; min-width: 0; height: 36px; padding: 6px 10px; }
.balance-update-dialog .dialog-actions { margin-top: 0; }

.balance-update-choice-dialog { width: min(720px, calc(100vw - 36px)); }
.balance-update-choice-dialog .edit-account-form { display: grid; gap: 16px; padding: 24px; }
.balance-update-choice-dialog .dialog-title-row { display: flex; }
.balance-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.balance-choice-card { display: grid; gap: 8px; min-height: 156px; padding: 18px; text-align: left; border: 1px solid #cddfed; border-radius: 16px; background: #fff; color: #173b5c; cursor: pointer; }
.balance-choice-card:hover, .balance-choice-card:focus-visible { border-color: #2473c6; background: #f4f9ff; box-shadow: 0 10px 26px rgba(31, 94, 151, .12); outline: none; }
.balance-choice-card strong { font-size: 17px; line-height: 1.25; }
.balance-choice-card span { color: #647b90; font-size: 13px; line-height: 1.45; font-weight: 600; }

/* Batch funding keeps several ledger entries visible and editable in one review window. */
.batch-funding-dialog {
  width: min(1240px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}

.batch-funding-form {
  display: grid;
  gap: 12px;
  max-height: calc(100dvh - 28px);
  padding: 18px 20px;
  overflow: hidden;
}

.batch-funding-table-wrap {
  min-height: 0;
  max-height: min(50dvh, 470px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.batch-funding-dialog table { width: 100%; min-width: 1050px; table-layout: fixed; }
.batch-funding-dialog th,
.batch-funding-dialog td { padding: 7px 8px; vertical-align: middle; }
.batch-funding-dialog th:nth-child(1) { width: 27%; }
.batch-funding-dialog th:nth-child(2),
.batch-funding-dialog th:nth-child(3) { width: 18%; }
.batch-funding-dialog th:nth-child(4) { width: 13%; }
.batch-funding-dialog th:nth-child(5) { width: 10%; }
.batch-funding-dialog th:nth-child(6) { width: 12%; }
.batch-funding-dialog th:nth-child(7) { width: 42px; }
.batch-funding-dialog select,
.batch-funding-dialog input { width: 100%; min-width: 0; height: 36px; margin: 0; padding: 6px 8px; font-size: 12px; }
.batch-funding-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.batch-funding-total { color: var(--brand-strong); font-size: 14px; white-space: nowrap; }
.batch-remove-row-btn { width: 30px; height: 30px; border: 1px solid #f0c5c7; border-radius: 50%; background: #fff7f7; color: #be3340; font-size: 20px; line-height: 1; cursor: pointer; }
.batch-remove-row-btn:hover { background: #ffeaea; }

.return-todo-panel { border-color: #f2d6a3; background: linear-gradient(110deg, #fffdf7, #fff8e9); }
.return-todo-list { display: grid; gap: 8px; }
.return-todo-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border: 1px solid #f0dfb6; border-radius: 12px; background: #fff; }
.return-todo-row strong,
.return-todo-row span,
.return-todo-row small { display: block; }
.return-todo-row span { margin-top: 2px; color: var(--text); font-weight: 700; }
.return-todo-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.return-todo-row .primary-btn { min-width: 132px; }

.closing-celebration-panel { padding: 0; border: 0; background: transparent; }
.closing-celebration-card { padding: 16px 20px; border: 1px solid #a7d9bc; border-radius: 14px; color: #135b37; background: linear-gradient(105deg, #e9f9ef, #f8fff9); box-shadow: 0 8px 22px rgba(22, 121, 70, 0.08); }
.closing-celebration-card span { display: block; margin-bottom: 3px; color: #238250; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; }
.closing-celebration-card strong { font-size: 17px; }
.closing-celebration-card p { margin: 3px 0 0; }

.application-checklist-dialog { width: min(1080px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: hidden; }
.application-checklist-form { display: grid; gap: 12px; max-height: calc(100dvh - 28px); padding: 18px 20px; overflow: hidden; }
.application-checklist-table-wrap { min-height: 0; max-height: min(55dvh, 500px); overflow: auto; }
.application-checklist-dialog table { width: 100%; min-width: 960px; table-layout: fixed; }
.application-checklist-dialog th,
.application-checklist-dialog td { padding: 7px 9px; vertical-align: middle; }
.application-checklist-dialog th:nth-child(1) { width: 8%; }
.application-checklist-dialog th:nth-child(2) { width: 18%; }
.application-checklist-dialog th:nth-child(3) { width: 22%; }
.application-checklist-dialog th:nth-child(4) { width: 11%; }
.application-checklist-dialog th:nth-child(5) { width: 14%; }
.application-checklist-dialog th:nth-child(6),
.application-checklist-dialog th:nth-child(7) { width: 13.5%; }
.application-checklist-dialog select { width: 100%; min-width: 0; height: 35px; margin: 0; padding: 6px 8px; font-size: 12px; }

.old-ipo-planner-dialog { width: min(1120px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: hidden; }
.old-ipo-planner-form { display: grid; gap: 12px; max-height: calc(100dvh - 28px); padding: 18px 20px; overflow: hidden; }
.old-ipo-planner-rows { display: grid; gap: 10px; min-height: 0; overflow: auto; }
.old-ipo-planner-row { padding: 12px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--panel-soft); }
.old-ipo-main-fields { display: grid; grid-template-columns: 1.35fr 1.45fr 1.15fr 32px; gap: 9px; align-items: end; }
.old-ipo-main-fields label, .old-ipo-add-source-label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
.old-ipo-main-fields select, .old-ipo-funding-source select, .old-ipo-funding-source input, .old-ipo-add-source-label select { width: 100%; min-width: 0; height: 35px; margin: 0; padding: 6px 8px; font-size: 12px; }
.old-ipo-funding-area { display: grid; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.old-ipo-funding-area > strong { font-size: 12px; }
.old-ipo-source-list { display: grid; gap: 7px; }
.old-ipo-funding-source { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, .7fr) 30px; gap: 8px; }
.old-ipo-remove-row, .old-ipo-remove-source { width: 30px; height: 30px; border: 1px solid #f0c5c7; border-radius: 50%; background: #fff7f7; color: #be3340; font-size: 19px; line-height: 1; cursor: pointer; }
.old-ipo-own-balance { color: var(--muted); font-size: 12px; }
.old-ipo-planner-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }

@media (max-width: 720px) {
  .old-ipo-planner-dialog { width: calc(100vw - 18px); }
  .old-ipo-planner-form { padding: 16px; }
  .old-ipo-main-fields { grid-template-columns: 1fr; }
  .old-ipo-main-fields .old-ipo-remove-row { justify-self: end; }
  .old-ipo-planner-footer { align-items: stretch; flex-direction: column; }
  .old-ipo-planner-footer .secondary-btn { width: 100%; }
}

@media (max-width: 720px) {
  .return-todo-row { align-items: stretch; flex-direction: column; }
  .return-todo-row .primary-btn { width: 100%; }
  .application-checklist-dialog { width: calc(100vw - 18px); }
  .application-checklist-form { padding: 16px; }
}

@media (max-width: 720px) {
  .batch-funding-dialog { width: calc(100vw - 18px); }
  .batch-funding-form { padding: 16px; }
  .batch-funding-footer { align-items: stretch; flex-direction: column; }
  .batch-funding-footer .secondary-btn { width: 100%; }
}

@media (max-width: 640px) {
  .balance-update-dialog { width: calc(100vw - 20px); }
  .balance-update-dialog .edit-account-form { padding: 16px; }
  .balance-update-dialog th,
  .balance-update-dialog td { padding: 7px 8px; }
  .balance-update-dialog td small { display: block; margin: 2px 0 0; }
  .balance-update-dialog .balance-effective-date { display: block; }
  .balance-update-dialog .balance-date-control { display: grid; margin-top: 5px; }
  .balance-update-dialog .balance-effective-date small { display: block; margin-top: 5px; }
  .balance-choice-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .balance-shortcut-panel { align-items: stretch; flex-direction: column; }
  .balance-shortcut-panel .primary-btn { width: 100%; }
  .balance-batch-actions { align-items: stretch; flex-direction: column; }
  .balance-batch-actions .primary-btn { width: 100%; }
}

.allotment-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid #b9e4cc;
  border-radius: 22px;
  padding: 0;
  text-align: center;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 52, 96, 0.24);
}

.allotment-dialog::backdrop {
  background: rgba(15, 35, 58, 0.45);
}

.allotment-dialog-content {
  padding: 28px;
}

.celebration-logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 40px;
  background: #e9f9ef;
}

.celebration-logo.is-celebrating {
  animation: celebration-pop 700ms ease-out both;
}

.allotment-dialog h2 {
  margin: 0;
}

.allotment-dialog p {
  color: var(--muted);
  line-height: 1.5;
}

.allotment-list {
  margin: 18px 0;
  text-align: left;
}

.allotment-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.allotment-row span {
  color: var(--muted);
  font-size: 13px;
}

@keyframes celebration-pop {
  0% { transform: scale(0.6) rotate(-14deg); opacity: 0; }
  65% { transform: scale(1.12) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

/* ERP workspace layout */
.erp-shell {
  max-width: none;
  min-height: 100vh;
  padding-left: 286px;
}

.erp-shell .top-nav-tabs {
  position: fixed;
  inset: 16px auto 16px 16px;
  z-index: 50;
  width: 246px;
  margin: 0;
  padding: 16px 12px;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 5px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  color: #17324d;
}

.sidebar-brand strong,
.sidebar-brand small { display: block; }

.sidebar-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.sidebar-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

.sidebar-label {
  margin: 12px 8px 5px;
  color: #7990a7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.nav-spacer { flex: 1; min-height: 10px; }

.erp-shell .nav-tab {
  width: 100%;
  min-height: 43px;
  justify-content: flex-start;
  padding: 10px 13px;
  border-color: transparent;
  background: transparent;
  border-radius: 11px;
  font-size: 13px;
}

.erp-shell .nav-tab:hover {
  background: #edf5ff;
  border-color: #dceafa;
}

.erp-shell .nav-tab.active {
  color: #164d99;
  background: linear-gradient(90deg, #e5f0ff, #f4f8ff);
  border-color: #cbdffc;
  box-shadow: none;
}

.erp-shell .top-strip {
  min-height: 48px;
  padding: 2px 4px 14px;
}

.erp-shell .top-strip-links { gap: 7px; }

.erp-shell .strip-pill {
  padding: 6px 10px;
  font-size: 11px;
}

.erp-shell .hero {
  min-height: 0;
  padding: 20px 24px;
  margin-bottom: 18px;
  border-radius: 16px;
}

.erp-shell .hero h1 {
  max-width: 830px;
  font-size: 28px;
  margin-bottom: 7px;
}

.erp-shell .hero .eyebrow { margin-bottom: 7px; }

.erp-shell .hero .subtext {
  margin-bottom: 0;
  font-size: 13px;
}

.erp-shell .hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 360px;
}

.erp-shell .hero-actions > * { min-width: 120px; }

/* Dashboard hero: a compact financial-command-center treatment. */
.erp-shell .simple-hero {
  min-height: 300px;
  padding: 38px 42px;
  border: 0;
  border-radius: 22px;
  color: #f7fbff;
  background:
    radial-gradient(circle at 78% 24%, rgba(35, 108, 178, 0.48), transparent 31%),
    linear-gradient(122deg, #071c34 0%, #0b2d51 56%, #0d3c66 100%);
  box-shadow: 0 22px 46px rgba(9, 35, 62, 0.19);
}

.dashboard-market-rail[hidden] { display: none; }

/* The rail belongs to Dashboard only, even when a tab is opened directly by URL. */
.erp-shell:has(.tab-section[data-tab-panel="overview"].active) .dashboard-market-rail:not([hidden]) {
  display: grid;
}

.erp-shell:has(.tab-section[data-tab-panel]:not([data-tab-panel="overview"]).active) .dashboard-market-rail {
  display: none !important;
}

.erp-shell .simple-hero::after {
  inset: auto -54px -112px auto;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(104, 188, 255, 0.24), rgba(104, 188, 255, 0.03) 56%, transparent 70%);
}

.erp-shell .simple-hero > .market-motif {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  color: #a9dcff;
  pointer-events: none;
}

.market-chart {
  position: absolute;
  right: 10%;
  bottom: -10%;
  width: min(56%, 650px);
  opacity: 0.14;
}

.market-animal {
  position: absolute;
  width: 158px;
  opacity: 0.16;
}

.market-bull {
  right: 40%;
  bottom: 12%;
  color: #96e7be;
  transform: rotate(-8deg);
}

.market-bear {
  right: 12%;
  top: 11%;
  color: #efb0aa;
  transform: rotate(7deg);
}

.market-motif-label {
  position: absolute;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  opacity: 0.28;
}

.bull-label {
  right: 48%;
  bottom: 9%;
  color: #9deac1;
}

.bear-label {
  right: 16%;
  top: 10%;
  color: #f1bbb4;
}

.erp-shell .simple-hero h1 {
  max-width: 690px;
  margin: 0 0 16px;
  color: #ffffff;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(39px, 4.2vw, 61px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.052em;
}

.erp-shell .simple-hero .eyebrow {
  margin-bottom: 17px;
  padding: 7px 11px;
  border: 1px solid rgba(183, 219, 255, 0.28);
  background: rgba(152, 202, 255, 0.12);
  color: #c9e4ff;
}

.erp-shell .simple-hero .subtext {
  max-width: 590px;
  color: #c9d9e9;
  font-size: 15px;
  line-height: 1.6;
}

.erp-shell .simple-hero .hero-actions {
  display: block;
  min-width: 292px;
  padding: 16px;
  border: 1px solid rgba(208, 231, 255, 0.18);
  border-radius: 17px;
  background: rgba(2, 21, 42, 0.25);
  backdrop-filter: blur(10px);
}

.hero-actions-label {
  margin: 0 0 10px;
  color: #abc9e8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

.erp-shell .hero-action-grid > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  text-decoration: none;
}

.erp-shell .hero-action-grid #syncIpojiBtn {
  grid-column: 1 / -1;
  min-height: 48px;
  border: 1px solid #8ac5ff;
  color: #05213c;
  background: #c7e7ff;
  box-shadow: none;
}

.erp-shell .hero-action-grid .secondary-btn {
  border-color: rgba(208, 231, 255, 0.24);
  color: #e7f3ff;
  background: rgba(255, 255, 255, 0.07);
}

.erp-shell .hero-action-grid .secondary-btn:hover {
  border-color: rgba(208, 231, 255, 0.48);
  background: rgba(255, 255, 255, 0.14);
}

/* Refined market rail: restrained tones, live indicators, and a small bullish crest. */
.erp-shell .simple-hero {
  min-height: 126px;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  align-items: center;
  gap: 22px;
  color: #1b3148;
  border: 1px solid #cfe0f1;
  border-left: 4px solid var(--brand);
  border-radius: 15px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(236, 246, 255, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 37px, rgba(20, 99, 184, 0.05) 38px);
  box-shadow: 0 12px 28px rgba(20, 99, 184, 0.08);
}

.erp-shell .simple-hero::after { display: none; }

.erp-shell .simple-hero > .market-motif {
  color: var(--accent);
  opacity: 1;
}

.erp-shell .simple-hero h1 {
  max-width: none;
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-size: clamp(23px, 2.1vw, 31px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
  color: #18334e;
}

.erp-shell .simple-hero .eyebrow {
  margin-bottom: 6px;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand-strong);
  font-size: 9px;
}

.hero-live-dot,
.indicator-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 5px 1px 7px;
  border-radius: 50%;
  background: #6cb6f1;
  box-shadow: 0 0 0 3px rgba(108, 182, 241, 0.12);
}

.hero-live-dot { background: #1e9a5b; box-shadow: 0 0 0 3px rgba(30, 154, 91, 0.14); }
.indicator-dot.bullish { background: #1e9a5b; box-shadow: 0 0 0 3px rgba(30, 154, 91, 0.14); }

.erp-shell .simple-hero .subtext {
  max-width: 630px;
  color: #61758a;
  font-size: 12px;
  line-height: 1.35;
}

.hero-market-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.hero-market-indicators span {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid #d9e4ec;
  border-radius: 6px;
  background: #ffffff;
  color: #66798b;
  font-size: 9px;
  font-weight: 700;
}

.hero-market-indicators .indicator-dot { margin-left: 0; }
.hero-market-indicators strong { margin-left: 5px; color: #28445d; font-weight: 800; }

.erp-shell .simple-hero .hero-actions {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dae5ed;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.hero-actions-label { margin-bottom: 6px; color: var(--brand-strong); }
.hero-action-grid { gap: 6px; }

.erp-shell .hero-action-grid > * {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 10px;
}

.erp-shell .hero-action-grid #syncIpojiBtn {
  min-height: 34px;
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.erp-shell .hero-action-grid .secondary-btn {
  border-color: #d6e1e9;
  color: #36526b;
  background: #f8fbfd;
}

.market-bull {
  right: 34%;
  bottom: 13%;
  width: 78px;
  opacity: 0.15;
}

.bull-label { right: 35.2%; bottom: 10%; color: var(--accent); font-size: 8px; }
.market-chart { right: 12%; bottom: -77%; width: min(42%, 500px); opacity: 0.07; }

/* IPO Market Desk: quiet editorial surfaces with a live company-logo watchlist. */
.erp-shell .simple-hero {
  grid-template-columns: minmax(280px, 1.12fr) minmax(310px, 0.88fr) 218px;
  gap: 16px;
  padding: 17px 18px 17px 24px;
  border: 1px solid rgba(194, 216, 234, 0.96);
  border-left: 4px solid #1874c5;
  border-radius: 20px;
  background:
    radial-gradient(circle at 59% 4%, rgba(117, 191, 228, 0.15), transparent 29%),
    linear-gradient(135deg, #ffffff 0%, #f5faff 52%, #edf7f7 100%);
  box-shadow: 0 16px 38px rgba(18, 79, 130, 0.09), inset 0 1px rgba(255, 255, 255, 0.95);
}

.erp-shell .simple-hero > .market-motif { display: none; }

.erp-shell .simple-hero h1 {
  max-width: 460px;
  margin-bottom: 5px;
  color: #183851;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.15vw, 33px);
  font-weight: 600;
  letter-spacing: -0.052em;
}

.erp-shell .simple-hero .subtext { max-width: 470px; color: #62798e; }

.market-logo-shelf {
  align-self: stretch;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(202, 222, 234, 0.9);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.95), 0 8px 20px rgba(37, 97, 143, 0.05);
  backdrop-filter: blur(14px);
}

.market-logo-shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 8px;
  color: #31516b;
}

.market-logo-shelf-head span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.market-logo-shelf-head small { color: #7a91a3; font-size: 9px; font-weight: 700; }

.market-logo-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.market-logo-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(209, 225, 235, 0.84);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
  color: #284761;
  text-align: left;
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.market-logo-card:hover {
  border-color: rgba(70, 145, 201, 0.52);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.market-logo-image {
  grid-row: 1 / -1;
  display: grid;
  width: 28px;
  height: 28px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(207, 224, 235, 0.9);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(232, 244, 252, 0.92), rgba(245, 250, 252, 0.74));
}

.market-logo-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: normal;
  opacity: 0.94;
  filter: saturate(1.05) contrast(1.04);
}

.market-logo-image b { color: #2c72a8; font-size: 9px; letter-spacing: -0.04em; }
.market-logo-image img + b { display: none; }
.market-logo-name { overflow: hidden; color: #31506b; font-size: 10px; font-weight: 800; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.market-logo-card small { overflow: hidden; color: #7890a2; font-size: 8px; font-weight: 700; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.market-logo-loading { grid-column: 1 / -1; padding: 16px 8px; color: #7c92a3; font-size: 10px; text-align: center; }

/* A quieter second pass for the dashboard-only market desk. */
.dashboard-market-rail .hero-market-copy { align-self: center; }
.erp-shell .dashboard-market-rail.simple-hero h1 {
  margin-bottom: 7px;
  font-size: clamp(25px, 2vw, 31px);
  letter-spacing: -0.046em;
}
.dashboard-market-rail .hero-market-indicators { margin-top: 11px; }
.dashboard-market-rail .market-logo-shelf {
  padding: 11px;
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(241, 249, 253, 0.78));
}
.dashboard-market-rail .market-logo-shelf-head { padding-bottom: 9px; }
.dashboard-market-rail .market-logo-card {
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 8px;
  min-height: 47px;
  padding: 6px 7px;
  border-radius: 10px;
}
.dashboard-market-rail .market-logo-image {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ffffff;
}
.dashboard-market-rail .market-logo-name { font-size: 10px; letter-spacing: -0.015em; }
.dashboard-market-rail .market-logo-card small { font-size: 8px; }
.dashboard-market-rail .hero-actions {
  padding: 11px;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 253, 0.9));
  box-shadow: 0 8px 18px rgba(28, 82, 123, 0.05);
}
.dashboard-market-rail .hero-actions-label { margin: 1px 0 8px; }

@media (max-width: 1260px) {
  .erp-shell .simple-hero { grid-template-columns: minmax(0, 1fr) minmax(260px, 0.82fr); }
  .erp-shell .simple-hero .hero-actions { grid-column: 1 / -1; }
  .hero-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .erp-shell .hero-action-grid #syncIpojiBtn { grid-column: auto; }
}

@media (max-width: 820px) {
  .erp-shell .simple-hero { grid-template-columns: 1fr; gap: 12px; padding: 17px; }
  .erp-shell .simple-hero .hero-actions { width: 100%; }
  .hero-market-indicators span { font-size: 9px; }
  .market-logo-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-shell .hero-action-grid #syncIpojiBtn { grid-column: 1 / -1; }
}

.erp-shell .cards {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.erp-shell .card {
  padding: 14px 16px;
  border-radius: 14px;
}

.erp-shell .card h3 { margin-bottom: 0; }

.erp-shell .panel {
  border-radius: 16px;
  margin-bottom: 18px;
}

@media (max-width: 1050px) {
  .erp-shell { padding-left: 270px; }
  .erp-shell .top-nav-tabs { width: 230px; }
  .erp-shell .hero-actions { min-width: 260px; }
}

@media (max-width: 840px) {
  .erp-shell { padding-left: 16px; }

  .erp-shell .top-nav-tabs {
    position: sticky;
    inset: auto;
    width: auto;
    margin: 0 0 16px;
    padding: 8px;
    flex-direction: row;
    flex-wrap: wrap;
    border-radius: 15px;
  }

  .sidebar-brand,
  .sidebar-label,
  .nav-spacer { display: none; }

  .erp-shell .nav-tab {
    width: auto;
    min-height: 38px;
    padding: 8px 10px;
    justify-content: center;
    font-size: 12px;
  }

  .erp-shell .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .erp-shell .hero-actions {
    min-width: 0;
    justify-content: flex-start;
  }

  .erp-shell .simple-hero {
    min-height: 0;
    padding: 28px 24px;
  }

  .erp-shell .simple-hero h1 {
    font-size: clamp(37px, 11vw, 52px);
  }

  .erp-shell .simple-hero .hero-actions {
    width: 100%;
  }
}

/* Editorial typography refinements */
.top-strip-brand strong,
.sidebar-brand strong {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.top-strip-brand strong {
  font-size: 17px;
}

.brand-sub,
.sidebar-brand small {
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.erp-shell .hero h1 {
  font-size: clamp(28px, 2.6vw, 38px);
  max-width: 790px;
}

.eyebrow,
.sidebar-label,
.card p,
th,
.workflow-step {
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
}

.subtext,
.panel-header p {
  max-width: 780px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -0.012em;
}

.erp-shell .nav-tab {
  font-weight: 700;
  letter-spacing: -0.018em;
}

.card p {
  margin-bottom: 8px;
  color: #6a8198;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.card h3,
.small-card h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 1.85vw, 30px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.small-card h3 {
  font-size: clamp(20px, 1.55vw, 25px);
}

.panel-header h2 {
  font-size: 20px;
}

.workflow-step {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  color: #416078;
}

label {
  color: #425f78;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

input,
select,
button,
.secondary-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: -0.008em;
}

button,
.primary-btn,
.secondary-btn {
  font-weight: 800;
}

th {
  color: #668099;
  font-size: 10px;
  font-weight: 800;
}

td {
  font-size: 13px;
  font-weight: 500;
}

.status-pill,
.badge {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.065em;
}

.hint-box,
.section-note {
  font-size: 12px;
  line-height: 1.55;
}

.narada-import-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, .8fr) auto auto;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #cfe0f4;
  border-radius: 14px;
  background: linear-gradient(90deg, #f7fbff, #eef6ff);
}

.narada-import-bar textarea {
  grid-column: 1 / -1;
  min-height: 92px;
  resize: vertical;
}

.narada-import-bar strong,
.narada-import-bar span {
  display: block;
}

.narada-import-bar strong {
  font-family: var(--font-display);
  font-size: 15px;
}

.narada-import-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .narada-import-bar {
    grid-template-columns: 1fr;
  }
}

.capacity-planner-panel {
  background: linear-gradient(135deg, #f8fcff 0%, #eef7f2 100%);
}

.capacity-planner-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.capacity-planner-controls select {
  min-width: 220px;
  padding: 9px 11px;
  font-size: 12px;
}

.capacity-planner-controls .primary-btn {
  padding: 10px 13px;
  white-space: nowrap;
}

.capacity-balance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.capacity-balance-summary div {
  padding: 12px 14px;
  border: 1px solid #d8e9e0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.capacity-balance-summary .capacity-balance-card {
  padding: 12px 14px;
  border: 1px solid #8bb7df;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6fbff 0%, #e9f4ff 100%);
  text-align: left;
  cursor: pointer;
}

.capacity-balance-summary .capacity-balance-card:hover { border-color: #2168ae; transform: translateY(-1px); }
.capacity-balance-summary .capacity-balance-card small { display: block; margin-top: 5px; color: #2168ae; font-size: 10px; font-weight: 800; }

.savings-breakdown-dialog { width: min(760px, calc(100vw - 28px)); }
.savings-breakdown-total { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 13px 14px; border-radius: 12px; background: #edf6ff; color: #234d73; }
.savings-breakdown-total strong { font-size: 20px; }
.savings-breakdown-account-btn { padding: 0; border: 0; background: none; color: #173b63; font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.savings-breakdown-account-btn:hover { color: #0a63ad; text-decoration: underline; }

/* Keep the OD ledger readable without horizontal scrolling on a desktop screen. */
.od-available-dialog {
  width: min(1420px, calc(100vw - 32px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}

.od-available-dialog .ipo-ledger-dialog-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  max-height: calc(100dvh - 28px);
  padding: 20px 22px;
  overflow: hidden;
}

.od-available-dialog .dialog-title-row { grid-column: auto; }
.od-available-dialog .ipo-ledger-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; }
.od-available-dialog .ipo-ledger-summary div { padding: 10px 12px; }
.od-available-dialog .ipo-ledger-summary strong { font-size: 20px; }
.od-available-dialog .table-wrap { min-height: 0; max-height: none; overflow: auto; }
.od-available-dialog table { width: 100%; min-width: 0; table-layout: fixed; }
.od-available-dialog th,
.od-available-dialog td { padding: 8px 10px; white-space: nowrap; }
.od-available-dialog th:nth-child(1), .od-available-dialog td:nth-child(1) { width: 9%; }
.od-available-dialog th:nth-child(2), .od-available-dialog td:nth-child(2) { width: 9%; }
.od-available-dialog th:nth-child(3), .od-available-dialog td:nth-child(3) { width: 21%; overflow: hidden; text-overflow: ellipsis; }
.od-available-dialog th:nth-child(4), .od-available-dialog td:nth-child(4) { width: 18%; overflow: hidden; text-overflow: ellipsis; }
.od-available-dialog th:nth-child(5), .od-available-dialog td:nth-child(5) { width: 14%; }
.od-available-dialog th:nth-child(6), .od-available-dialog td:nth-child(6) { width: 15%; }
.od-available-dialog th:nth-child(7), .od-available-dialog td:nth-child(7) { width: 14%; text-align: right; }
.od-available-dialog .secondary-btn { min-width: 58px; padding: 7px 10px; }

@media (max-width: 820px) {
  .od-available-dialog { width: calc(100vw - 20px); }
  .od-available-dialog .ipo-ledger-dialog-content { padding: 16px; }
  .od-available-dialog .ipo-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-transaction-edit-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .od-transaction-edit-dialog .edit-account-form { padding: 16px; }
  .od-transaction-edit-dialog #odTransactionEditFields { grid-template-columns: 1fr; }
}

.action-history-panel { margin-top: 18px; }
.action-history-details summary { color: #1e65b5; cursor: pointer; font-weight: 700; }
.action-history-details pre { max-width: 440px; margin: 8px 0 0; padding: 9px; overflow: auto; border-radius: 8px; background: #f4f8fc; color: #38546c; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

.advanced-content { display: grid; gap: 18px; }
.advanced-content > section, .advanced-content > .grid-two { margin: 0; }
.advanced-content h3 { margin-bottom: 5px; }
.advanced-content .form-grid, .advanced-content .quick-add-grid { gap: 10px; }
.balance-update-centre { border: 1px solid #cddfed; border-radius: 14px; background: #f8fbfe; overflow: hidden; }
.balance-update-centre summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; color: #193d61; cursor: pointer; list-style: none; }
.balance-update-centre summary::-webkit-details-marker { display: none; }
.balance-update-centre summary small { display: block; margin-top: 3px; color: #647c91; font-size: 12px; }
.balance-update-open { padding: 5px 9px; border-radius: 999px; background: #e6f1fb; color: #1d65a7; font-size: 11px; font-weight: 800; }
.balance-update-centre[open] .balance-update-open { background: #dff4e7; color: #18743a; }
.balance-update-centre .section-copy, .balance-update-centre .balance-batch-form { margin-left: 16px; margin-right: 16px; }
.balance-update-centre .balance-batch-form { margin-bottom: 16px; }

/* Setup is a management workspace: keep the report visible and place maintenance work behind calm, focused disclosures. */
.setup-page {
  display: grid;
  gap: 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8e5ee;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(246, 250, 253, .96));
  box-shadow: 0 18px 44px rgba(22, 58, 91, .08);
}

.setup-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e1eaf1;
  background: linear-gradient(105deg, #ffffff 0%, #f5faff 100%);
}

.setup-page-header .eyebrow {
  width: fit-content;
  margin: 0 0 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #245d9d;
}

.setup-page-header h2 {
  margin: 0;
  color: #193953;
  font-family: var(--font-display);
  font-size: clamp(23px, 2.1vw, 31px);
  font-weight: 650;
  letter-spacing: -.05em;
}

.setup-page-header p:not(.eyebrow) {
  max-width: 620px;
  margin: 6px 0 0;
  color: #637b90;
  font-size: 13px;
  line-height: 1.5;
}

.setup-page-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.setup-page-actions .secondary-btn { min-height: 38px; padding: 8px 12px; border-radius: 10px; }

.backup-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 20px;
  margin: 0 18px;
  padding: 14px 16px;
  border: 1px solid #cfe2ef;
  border-radius: 14px;
  background: linear-gradient(110deg, #f6fbff, #eef8f4);
}
.backup-center-copy .eyebrow { margin: 0 0 4px; color: #2470ae; font-size: 10px; }
.backup-center-copy h3 { margin: 0; color: #1c4161; font-size: 16px; letter-spacing: -.02em; }
.backup-center-copy p:not(.eyebrow) { margin: 3px 0 0; color: #688199; font-size: 12px; }
.backup-center-actions { display: flex; align-items: center; gap: 8px; }
.backup-center-actions .secondary-btn,
.backup-center-actions .primary-btn { min-height: 36px; padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.backup-status { grid-column: 1 / -1; margin: 0; color: #257443; font-size: 11px; font-weight: 700; }
.backup-status.is-error { color: #b34343; }

.setup-page-content {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.setup-page .operations-report-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 20px;
  border: 1px solid #d9e5ed;
  border-radius: 16px;
  background: #ffffff;
}

.setup-page .operations-report-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid #e1eaf0;
}

.setup-page .operations-report-panel .panel-header .eyebrow { margin: 0 0 6px; color: #16746e; }
.setup-page .operations-report-panel .panel-header h3 { margin: 0; color: #1a3f5f; font-size: 20px; letter-spacing: -.035em; }
.setup-page .operations-report-panel .section-note { margin: 4px 0 0; color: #6b8194; font-size: 12px; }

.setup-page .operations-report-panel .cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dbe6ee;
  border-radius: 13px;
  background: #f8fbfd;
}

.setup-page .operations-report-panel .card {
  min-width: 0;
  min-height: 82px;
  padding: 13px 14px;
  border: 0;
  border-left: 1px solid #dbe6ee;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.setup-page .operations-report-panel .card:first-child { border-left: 0; }

.setup-page .operations-report-panel .card p { overflow: hidden; margin: 0 0 6px; color: #6d8397; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.setup-page .operations-report-panel .card h3 { overflow: hidden; color: #1b4262; font-size: clamp(17px, 1.55vw, 23px); text-overflow: ellipsis; white-space: nowrap; }
.setup-page .operations-report-panel > .table-wrap { grid-column: 1 / -1; margin: 0; border: 1px solid #dfe8ef; border-radius: 12px; background: #fff; }
.setup-page .operations-report-panel table { min-width: 0; }
.setup-page .operations-report-panel th,
.setup-page .operations-report-panel td { padding: 8px 11px; }

.setup-page .compact-workspace-section {
  border-color: #dce7ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(30, 74, 108, .035);
}

.setup-page .compact-workspace-section > summary {
  min-height: 66px;
  padding: 14px 16px 14px 18px;
}

.setup-page .compact-workspace-section > summary::before {
  content: "";
  width: 4px;
  align-self: stretch;
  border-radius: 99px;
  background: linear-gradient(180deg, #1971b9, #129381);
}

.setup-page .compact-workspace-section > summary > span:first-child { flex: 1; }
.setup-page .compact-workspace-section summary strong { color: #1d405d; font-size: 14px; letter-spacing: -.02em; }
.setup-page .compact-workspace-section summary small { color: #6b8398; font-size: 11px; }
.setup-page .compact-section-toggle { min-width: 50px; text-align: center; }
.setup-page .compact-workspace-section[open] .compact-section-toggle { font-size: 0; }
.setup-page .compact-workspace-section[open] .compact-section-toggle::after { content: "Close"; font-size: 11px; }
.setup-page .compact-workspace-content {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
  border-top: 1px solid #edf2f6;
  background: linear-gradient(180deg, #fbfdff, #f7fafc);
}
.setup-page .compact-workspace-content > :first-child { margin-top: 0; }
.setup-page .compact-workspace-content .spaced-section { margin-top: 0; }

.setup-page .compact-workspace-content > section,
.setup-page .compact-workspace-content > .grid-two > section,
.setup-page .compact-workspace-content > .grid-two > details {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e0e9f0;
  border-radius: 13px;
  background: rgba(255, 255, 255, .9);
}

.setup-page .compact-workspace-content h3 { margin: 0 0 4px; color: #244866; font-size: 15px; letter-spacing: -.025em; }
.setup-page .compact-workspace-content .section-note,
.setup-page .compact-workspace-content .section-copy { margin: 0 0 11px; color: #6c8396; font-size: 11px; }
.setup-page .compact-workspace-content .form-grid { gap: 9px; }
.setup-page .compact-workspace-content label { gap: 4px; font-size: 10px; }
.setup-page .compact-workspace-content input,
.setup-page .compact-workspace-content select { min-height: 37px; padding: 7px 9px; font-size: 12px; }
.setup-page .compact-workspace-content .primary-btn,
.setup-page .compact-workspace-content .secondary-btn { min-height: 36px; padding: 7px 10px; border-radius: 9px; font-size: 11px; }

.setup-page .quick-add-grid { gap: 12px; margin: 0; }
.setup-page .quick-add-grid .simple-form { padding: 14px; border-radius: 13px; box-shadow: none; }
.setup-page .quick-add-grid .simple-form::before { width: 28px; height: 3px; margin-bottom: 6px; }
.setup-page .quick-add-grid .simple-form h3 { font-size: 14px; }
.setup-page .grid-two { gap: 12px; }

.setup-page .balance-update-centre { padding: 0; background: #fbfdff; }
.setup-page .balance-update-centre summary { min-height: 100%; padding: 14px; }
.setup-page .balance-update-centre .section-copy { margin: 0 14px 10px; }
.setup-page .balance-update-centre .balance-batch-actions { margin: 0 14px 14px; }

.setup-page .operations-report-panel + .compact-workspace-section { margin-top: 0; }
.setup-page .history-toolbar { gap: 7px; }

/* Setup menu: management report stays visible; maintenance areas reveal on demand. */
.setup-page-content { display: grid; gap: 16px; }
.setup-page .operations-report-panel { margin: 0; }
.setup-menu-group {
  position: relative;
  margin: 0;
  overflow: visible;
  border: 1px solid #d9e5ee;
  border-radius: 16px;
  background: #f8fbfd;
  box-shadow: 0 8px 24px rgba(24, 64, 92, .04);
}
.setup-menu-group > summary {
  min-height: 60px;
  padding: 14px 18px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #f8fbfd, #eef6fb);
}
.setup-menu-group > summary strong { font-size: 15px; }
.setup-menu-group > summary small { display: block; margin-top: 3px; }
.setup-menu-group > summary::after { content: "Explore"; }
.setup-menu-group[open] > summary::after { content: "Collapse"; }
.setup-menu-group[open] > summary { background: linear-gradient(135deg, #eaf4fb, #f5fbf9); }
.setup-menu-group > .compact-workspace-content {
  display: none;
  padding: 14px 16px 16px;
  border-top: 1px solid #dce8ef;
  animation: setup-menu-reveal .18s ease-out;
}
.setup-menu-group[open] > .compact-workspace-content { display: block; }
.setup-menu-group .compact-workspace-content > section,
.setup-menu-group .compact-workspace-content > .grid-two > section,
.setup-menu-group .compact-workspace-content > .grid-two > details {
  padding: 14px;
  border: 1px solid #dce8ef;
  border-radius: 13px;
  background: #fff;
}
.setup-menu-group .compact-workspace-content > section + section,
.setup-menu-group .compact-workspace-content > .grid-two,
.setup-menu-group .compact-workspace-content > .spaced-section { margin-top: 12px; }
.setup-menu-group .compact-workspace-content > section h3,
.setup-menu-group .compact-workspace-content > .grid-two h3 { margin-bottom: 8px; }
.setup-menu-group .compact-workspace-content .quick-add-grid { margin-top: 10px; }
.setup-menu-group .compact-workspace-content > section,
.setup-menu-group .compact-workspace-content > .grid-two > section { cursor: default; }
.setup-menu-group .compact-workspace-content > section > :not(h3),
.setup-menu-group .compact-workspace-content > .grid-two > section > :not(h3) {
  display: revert;
}
@keyframes setup-menu-reveal { from { opacity: .4; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .setup-page .operations-report-panel .panel-header { padding: 0 0 12px; border-bottom: 1px solid #e1eaf0; }
}

@media (max-width: 800px) {
  .setup-page-header { align-items: stretch; flex-direction: column; padding: 18px 16px 15px; }
  .setup-page-actions { justify-content: flex-start; }
  .backup-center { grid-template-columns: 1fr; margin: 0 12px; }
  .backup-center-actions { flex-wrap: wrap; }
  .backup-center-actions > * { flex: 1 1 180px; }
  .setup-page-content { padding: 0 12px 12px; }
  .setup-page .operations-report-panel { padding: 14px; }
  .setup-page .operations-report-panel .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-page .operations-report-panel .card:last-child { grid-column: span 2; }
  .setup-page .compact-workspace-section > summary { min-height: 62px; padding: 12px 13px; }
  .setup-page .compact-workspace-content { padding: 0 10px 10px; }
}

.capacity-balance-summary span,
.capacity-plan-result span {
  display: block;
  color: #5f788c;
  font-size: 11px;
  font-weight: 700;
}

.capacity-balance-summary strong {
  display: block;
  margin-top: 4px;
  color: #173b63;
  font-size: 16px;
}

.capacity-plan-result {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eaf7ef;
  color: #25613f;
  font-size: 13px;
}

.capacity-allocation {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.capacity-category-btn {
  padding: 8px 11px;
  border: 1px solid #b9d8c6;
  border-radius: 999px;
  background: #f4fbf6;
  color: #276345;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.capacity-category-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.capacity-account-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid #d5e7dc;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}

.capacity-account-picker > strong,
.capacity-account-picker > span {
  grid-column: 1 / -1;
}

.capacity-account-picker > span {
  color: #5f788c;
  font-size: 12px;
}

.capacity-account-picker label {
  display: grid;
  gap: 5px;
  font-size: 12px;
}

.capacity-account-picker select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
}

.capacity-account-action {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.capacity-account-action .capacity-account-select {
  flex: 1 1 48%;
  min-width: 260px;
}

.capacity-required-balance {
  flex: 0 0 auto;
  color: #6b7f91;
  font-size: 11px;
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
}

.capacity-account-action .secondary-btn {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .capacity-account-action { flex-wrap: wrap; }
  .capacity-account-action .capacity-account-select { flex-basis: 100%; width: 100%; }
  .capacity-account-action .secondary-btn { margin-left: auto; }
}

.capacity-account-picker .primary-btn {
  justify-self: start;
  margin-top: 2px;
  padding: 9px 12px;
  font-size: 12px;
}

.application-template-btn {
  border-style: dashed;
  color: #285d8e;
  background: #f5faff;
}

/* Productivity workspace: decisions, market dates, and quick record access. */
.nav-utility { display: flex; gap: 5px; margin-left: auto; }
.nav-utility-btn {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #d4e2ee;
  border-radius: 8px;
  background: #f7fbfe;
  color: #315773;
  font-size: 11px;
  font-weight: 800;
}

.command-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.command-center-panel {
  min-width: 0;
  overflow: hidden;
  border-color: #d7e5ed;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
}
.command-center-panel .panel-header {
  align-items: center;
  margin-bottom: 12px;
  padding: 0 0 11px;
}
.command-center-panel .panel-header .eyebrow {
  margin-bottom: 5px;
  background: linear-gradient(135deg, #e5f4f0, #eaf2ff);
  color: #17666d;
}
.command-center-panel .panel-header h2 {
  font-size: 22px;
  line-height: 1.08;
}
.command-center-panel .panel-header p {
  margin: 4px 0 0;
  color: #61788e;
  font-size: 12px;
  line-height: 1.4;
}
.command-center-panel .panel-header .secondary-btn {
  min-height: 34px;
  padding: 7px 11px;
  border-color: #cddfea;
  font-size: 11px;
}
.command-center-item {
  display: grid;
  grid-template-areas:
    "label value"
    "detail detail"
    "action action";
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 5px 8px;
  min-width: 0;
  min-height: 94px;
  padding: 11px 12px 10px;
  border: 1px solid #d9e3ea;
  border-radius: 13px;
  background: #ffffff;
  color: #1d405e;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(19, 51, 76, .035);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.command-center-item:hover {
  transform: translateY(-1px);
  border-color: #a9c4d6;
  box-shadow: 0 8px 20px rgba(19, 51, 76, .08);
}
.command-center-item > span {
  grid-area: label;
  align-self: baseline;
  color: #60778c;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1.1;
  text-transform: uppercase;
}
.command-center-item > strong {
  grid-area: value;
  min-width: 0;
  align-self: baseline;
  color: #173b5c;
  font-size: clamp(16px, 1.28vw, 20px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  line-height: 1;
  white-space: nowrap;
  text-align: right;
}
.command-center-item > small {
  grid-area: detail;
  align-self: center;
  color: #5d7489;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}
.command-center-item > b {
  grid-area: action;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: #1266a7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
}
.command-center-item > b::after {
  content: "→";
  margin-left: 5px;
  font-size: 13px;
  line-height: 1;
}
.command-center-item.clear {
  border-top: 3px solid #58a688;
  background: linear-gradient(145deg, #ffffff, #f4fbf7);
}
.command-center-item.watch {
  border-top: 3px solid #4d8fbd;
  background: linear-gradient(145deg, #ffffff, #f3f9fe);
}
.command-center-item.urgent {
  border-top: 3px solid #c99242;
  background: linear-gradient(145deg, #ffffff, #fffbf3);
}
.command-center-clear {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid #cde6d8;
  border-left: 4px solid #58a688;
  border-radius: 13px;
  background: linear-gradient(120deg, #f5fcf7, #fbfefd);
}
.command-center-clear div { display: grid; gap: 3px; }
.command-center-clear strong { color: #1d5b44; font-size: 14px; }
.command-center-clear span { color: #638074; font-size: 12px; }
.command-center-clear .secondary-btn { flex: 0 0 auto; }
.data-health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.data-health-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 9px; padding: 11px 12px; border: 1px solid #dce6ed; border-radius: 12px; background: #fbfdff; color: #244963; text-align: left; box-shadow: none; }
.data-health-item > span { color: #60788d; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }.data-health-item > strong { color: #183d5d; font-size: 18px; }.data-health-item > small { grid-column: 1 / -1; color: #687f91; font-size: 10px; font-weight: 650; line-height: 1.35; }.data-health-item > b { color: #1672b2; font-size: 10px; }.data-health-item.needs-review { border-top: 3px solid #d39a42; background: #fffdf8; }.data-health-item.is-clear { border-top: 3px solid #57a588; }

@media (max-width: 1280px) {
  .command-center-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.reconciliation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.reconciliation-account { display: grid; gap: 9px; padding: 12px; border: 1px solid #dbe7f0; border-radius: 11px; background: #fbfdff; }
.reconciliation-account > div { display: grid; gap: 1px; }
.reconciliation-account > div strong { color: #183d5f; font-size: 13px; }
.reconciliation-account > div span { color: #72889a; font-size: 10px; }
.reconciliation-account dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 0; }
.reconciliation-account dl div { min-width: 0; }
.reconciliation-account dt { color: #72889a; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.reconciliation-account dd { margin: 2px 0 0; overflow: hidden; color: #234864; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.reconciliation-account .secondary-btn { width: 100%; }

.exposure-monitor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.exposure-account { display: grid; gap: 10px; padding: 12px; border: 1px solid #dbe7f0; border-radius: 11px; background: linear-gradient(135deg, #fbfdff, #f4f9fd); color: #244963; text-align: left; box-shadow: none; }
.exposure-account:hover { border-color: #a8cde9; background: #f5faff; }
.exposure-account > div { display: grid; gap: 2px; }
.exposure-account > div strong { overflow: hidden; color: #183d5f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.exposure-account > div span { color: #71889b; font-size: 10px; }
.exposure-account dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.exposure-account dt { color: #70869a; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.exposure-account dd { margin: 2px 0 0; overflow: hidden; color: #234864; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.exposure-account > b { color: #1768ad; font-size: 11px; }

.ipo-calendar { display: grid; gap: 6px; }
.ipo-calendar-row { display: grid; grid-template-columns: minmax(150px, 1.8fr) repeat(4, minmax(78px, 1fr)); gap: 8px; align-items: center; padding: 9px 11px; border: 1px solid #e0eaf2; border-radius: 10px; background: #fff; color: #274964; text-align: left; box-shadow: none; }
.ipo-calendar-row:hover { border-color: #9dc3e8; background: #f7fbff; }
.ipo-calendar-row > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ipo-calendar-row span { display: grid; gap: 1px; color: #274964; font-size: 11px; font-weight: 700; }
.ipo-calendar-row b { color: #7690a6; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.ipo-calendar-row.is-closing { border-left: 3px solid #d58b1e; background: #fffaf1; }

.cashflow-calendar-panel { min-width: 0; }
.cashflow-calendar-legend { display: flex; flex-wrap: wrap; gap: 7px; margin: -2px 0 12px; }
.cashflow-calendar-legend span { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .025em; }
.cashflow-close { background: #fff2dc; color: #9a5c08; }
.cashflow-funding { background: #eaf5ff; color: #1765a0; }
.cashflow-refund { background: #e9f8ef; color: #167345; }
.cashflow-od { background: #f0edf9; color: #635092; }
.cashflow-calendar { display: grid; gap: 7px; }
.cashflow-day { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 12px; align-items: start; padding: 9px 11px; border: 1px solid #e0eaf2; border-radius: 11px; background: linear-gradient(115deg, #fbfdff, #fff); }
.cashflow-day time { padding-top: 7px; color: #385b76; font-size: 12px; font-weight: 800; }
.cashflow-events { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.cashflow-event { display: grid; gap: 2px; min-width: 148px; padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; color: #234762; text-align: left; box-shadow: none; }
.cashflow-event b { font-size: 10px; letter-spacing: .035em; text-transform: uppercase; }
.cashflow-event span { max-width: 230px; overflow: hidden; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.cashflow-event.close { border-color: #f4d29b; background: #fff9ef; color: #955b0c; }
.cashflow-event.funding { border-color: #c7e2f6; background: #f3faff; color: #17669f; }
.cashflow-event.refund { border-color: #c6e8d1; background: #f3fbf6; color: #177644; }
.cashflow-event.od { border-color: #ddd5f1; background: #f8f6fd; color: #604b91; }
.cashflow-event:hover { filter: brightness(.985); transform: translateY(-1px); }

.global-search-dialog { width: min(680px, calc(100vw - 28px)); }
.global-search-dialog .edit-account-form { display: grid; gap: 12px; }
.global-search-results { display: grid; gap: 6px; max-height: min(54vh, 460px); overflow: auto; }
.global-search-result { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #dce7f0; border-radius: 9px; background: #fff; color: #234764; text-align: left; box-shadow: none; }
.global-search-result:hover { border-color: #9fc6ea; background: #f6fbff; }
.global-search-result strong { font-size: 13px; }
.global-search-result span { color: #637a8f; font-size: 11px; }
.command-palette-actions { display: grid; gap: 6px; }
.command-palette-action { grid-template-columns: minmax(0, 1fr) auto; }
.command-palette-action span { grid-column: 1; }
.command-palette-action kbd { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* Compact command palette: search first, then clear operational shortcuts. */
.global-search-dialog { width: min(760px, calc(100vw - 28px)); }
.global-search-dialog .edit-account-form { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 22px 24px; }
.global-search-dialog .dialog-title-row { align-items: center; padding-bottom: 10px; border-bottom: 1px solid #e5edf3; }
.global-search-dialog .dialog-title-row h3 { margin: 3px 0 0; font-size: 23px; letter-spacing: -.03em; }
.global-search-dialog #globalSearchInput { box-sizing: border-box; width: 100%; min-height: 46px; height: 46px; margin: 0; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.global-search-dialog .global-search-results { max-height: min(380px, 48vh); overflow: auto; }
.global-search-dialog .command-palette-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.global-search-dialog .command-palette-action { min-height: 72px; padding: 11px 12px; border-radius: 11px; }
.global-search-dialog .command-palette-action strong { font-size: 13px; }
.global-search-dialog .command-palette-action span { font-size: 11px; }
.global-search-dialog .section-note { margin: 0; font-size: 11px; }
@media (max-width: 620px) { .global-search-dialog .edit-account-form { padding: 18px; } .global-search-dialog .command-palette-actions { grid-template-columns: 1fr; } .global-search-dialog .command-palette-action { min-height: 62px; } }
.mobile-quick-actions { display: none; }
@media (max-width: 720px) { body { padding-bottom: 78px; } .mobile-quick-actions { position: fixed; z-index: 40; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 8px; border: 1px solid rgba(205, 222, 235, .95); border-radius: 17px; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 30px rgba(21, 53, 81, .18); backdrop-filter: blur(14px); } .mobile-quick-actions button { min-height: 44px; padding: 6px 3px; border: 1px solid #dbe7f0; border-radius: 11px; background: #f8fbfe; color: #24537b; font-size: 11px; font-weight: 850; box-shadow: none; } .mobile-quick-actions button:first-child { border-color: #bcdaf1; background: #edf7ff; color: #1264a0; } .mobile-quick-actions button:nth-child(2) { border-color: #c5e6d4; background: #f1fbf5; color: #197643; } .mobile-quick-actions button:nth-child(3) { border-color: #f0d9ab; background: #fff9ee; color: #98600d; } .mobile-quick-actions button:nth-child(4) { border-color: #ddd3f0; background: #f8f6fd; color: #635090; } }
kbd { padding: 1px 5px; border: 1px solid #cfddeb; border-radius: 4px; background: #f5f8fb; color: #34536d; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }

.application-timeline-dialog { width: min(720px, calc(100vw - 28px)); }
.application-timeline-dialog .edit-account-form { display: grid; gap: 14px; }
.timeline-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.timeline-summary span { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid #dce8f1; border-radius: 9px; color: #6a8196; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.timeline-summary strong { color: #193d60; font-size: 15px; text-transform: none; }
.application-timeline { display: grid; gap: 0; }
.application-timeline article { display: grid; grid-template-columns: 105px 1fr; gap: 14px; padding: 10px 0 10px 14px; border-left: 2px solid #bad7ee; }
.application-timeline article:last-child { border-left-color: transparent; }
.application-timeline time { color: #6b8296; font-size: 11px; font-weight: 800; }
.application-timeline div { display: grid; gap: 2px; }
.application-timeline strong { color: #1c405f; font-size: 13px; }
.application-timeline span { color: #60788d; font-size: 12px; }

.operator-mode .top-strip,
.operator-mode .dashboard-market-rail,
.operator-mode .subscription-ticker,
.operator-mode .section-note,
.operator-mode .subtext,
.operator-mode .eyebrow { display: none !important; }
.operator-mode .panel { margin-bottom: 10px; }
.operator-mode .panel-header { margin-bottom: 9px; }

@media (max-width: 980px) {
  .command-center-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reconciliation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exposure-monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ipo-calendar-row { grid-template-columns: minmax(130px, 1.4fr) repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .nav-utility { width: 100%; margin-left: 0; }
  .nav-utility-btn { flex: 1; }
  .command-center-grid, .data-health-grid, .reconciliation-grid, .exposure-monitor-grid, .timeline-summary { grid-template-columns: 1fr; }
  .ipo-calendar-row { grid-template-columns: 1fr 1fr; }
  .ipo-calendar-row > strong { grid-column: 1 / -1; }
  .cashflow-day { grid-template-columns: 1fr; gap: 7px; }
  .cashflow-day time { padding: 0; }
  .cashflow-event { flex: 1 1 145px; }
  .application-timeline article { grid-template-columns: 1fr; gap: 3px; }
}

/* Market-workspace polish: compact, scan-friendly surfaces for daily decisions. */
.erp-shell .panel,
.erp-shell .card {
  border-color: #d8e3ed;
  box-shadow: 0 7px 18px rgba(24, 57, 86, 0.045);
}

.erp-shell .panel {
  background: rgba(255, 255, 255, 0.94);
}

.erp-shell .panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #e5edf4;
}

.erp-shell .panel-header h2,
.erp-shell .card h3 {
  color: #102f4d;
  letter-spacing: -0.025em;
}

.erp-shell .card {
  position: relative;
  overflow: hidden;
}

.erp-shell .card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #27a66b, #1084a2);
}

.erp-shell th {
  background: #f3f7fa;
  color: #5a7188;
}

.erp-shell tbody tr:hover {
  background: #f2f8fc;
}

.erp-shell .status-good {
  background: #e7f7ec;
  color: #197447;
}

.erp-shell .status-warn {
  background: #fff4df;
  color: #9a5a08;
}

.erp-shell .status-bad {
  background: #fff0f0;
  color: #b52b32;
}

.erp-shell .primary-btn {
  background: linear-gradient(135deg, #0b5fae, #0b4a8a);
}

.erp-shell .primary-btn:hover {
  background: linear-gradient(135deg, #126ec1, #0b579f);
}

@media (max-width: 720px) {
  .erp-shell .hero h1 {
    font-size: 28px;
  }

  .card h3,
  .small-card h3 {
    font-size: 23px;
  }
}

@media (max-width: 980px) {
  .grid-two,
  .form-grid,
  .hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    min-width: unset;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .quick-add-grid {
    grid-template-columns: 1fr;
  }

  .workflow-steps {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .shell {
    padding: 14px 14px 28px;
  }

  h1 {
    font-size: 28px;
  }

  .panel,
  .hero,
  .card {
    border-radius: 16px;
  }

  .top-strip-links {
    gap: 8px;
  }

  .strip-pill {
    font-size: 11px;
  }

  .top-nav-tabs {
    top: 6px;
    padding: 8px;
  }

  .nav-tab {
    width: 100%;
    justify-content: center;
  }
}

/* Application register: a calm, readable workspace without sacrificing data density. */
[data-tab-panel="applications"] {
  display: grid;
  gap: 20px;
}

.application-register-panel,
.application-archive-panel {
  padding: 22px;
  border-color: #dce7f1;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 253, 0.99));
  box-shadow: 0 12px 30px rgba(22, 53, 84, 0.07);
}

.application-register-panel .panel-header,
.application-archive-panel .panel-header {
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid #e5edf4;
}

.application-register-panel .panel-header h2,
.application-archive-panel .panel-header h2 {
  margin-bottom: 4px;
  font-size: clamp(24px, 2.1vw, 30px);
  letter-spacing: -0.04em;
}

.application-register-panel .panel-header p,
.application-archive-panel .panel-header p {
  margin: 0;
  color: #61788d;
}

.application-register-panel .application-recording-actions {
  max-width: 620px;
  gap: 8px;
}

.application-register-panel .application-recording-status {
  flex: 1 1 180px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f3f8fc;
  color: #4e6c86;
  line-height: 1.25;
}

.application-register-panel .application-recording-actions button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}

.application-register-panel .application-category-summary {
  gap: 12px;
  margin: 18px 0;
}

.application-register-panel .application-category-summary > div {
  padding: 14px 16px;
  border-color: #e0eaf3;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f5f9fc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.application-register-panel .application-category-summary strong {
  margin: 4px 0;
  font-size: 25px;
}

/* Compact category tiles keep the register lively without competing with its data. */
.application-register-panel .application-category-summary {
  gap: 10px;
  margin: 14px 0;
}

.application-register-panel .application-category-summary .application-category-tile {
  position: relative;
  min-height: 92px;
  padding: 12px 15px 11px;
  overflow: hidden;
  border-width: 1px;
  border-radius: 15px;
  box-shadow: 0 7px 18px rgba(31, 64, 87, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.application-register-panel .application-category-summary .application-category-tile::after {
  position: absolute;
  top: -28px;
  right: -17px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  content: "";
}

.application-register-panel .application-category-summary .application-category-tile span,
.application-register-panel .application-category-summary .application-category-tile small,
.application-register-panel .application-category-summary .application-category-tile strong {
  position: relative;
  z-index: 1;
}

.application-register-panel .application-category-summary .application-category-tile span {
  color: #536a78;
  font-size: 13px;
  font-weight: 750;
}

.application-register-panel .application-category-summary .application-category-tile strong {
  margin: 2px 0 1px;
  color: #18384a;
  font-size: 27px;
  line-height: 1;
}

.application-register-panel .application-category-summary .application-category-tile small {
  color: #496575;
  font-size: 12px;
  font-weight: 700;
}

.application-register-panel .application-category-summary .is-retail {
  border-color: #d7ead3;
  background: linear-gradient(135deg, #f9fff2 0%, #e3f6d9 100%);
}

.application-register-panel .application-category-summary .is-shni {
  border-color: #f4dfaa;
  background: linear-gradient(135deg, #fffbed 0%, #fff0c4 100%);
}

.application-register-panel .application-category-summary .is-bhni {
  border-color: #f3c991;
  background: linear-gradient(135deg, #fff7e9 0%, #ffe0ac 100%);
}

.application-register-panel .application-register-wrap {
  width: 100%;
  max-width: 100%;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid #e1eaf2;
  border-radius: 16px;
  background: #f6f9fc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.application-register-panel .applications-table,
.application-register-panel .erp-shell .applications-table {
  width: 100%;
  min-width: 1060px;
  max-width: none;
  table-layout: fixed;
  border-spacing: 0 7px;
}

.application-register-panel .applications-table th {
  height: auto;
  padding: 8px 10px 11px;
  background: transparent;
  color: #688096;
  font-size: 10px;
  letter-spacing: 0.075em;
}

.application-register-panel .applications-table td {
  height: 48px;
  padding: 8px 10px;
  border-top: 1px solid #e4edf4;
  border-bottom: 1px solid #e4edf4;
  background: #ffffff;
  color: #1d3e5e;
  font-size: 13px;
  line-height: 1.35;
}

.application-register-panel .applications-table td:first-child {
  border-left: 1px solid #e4edf4;
  border-radius: 11px 0 0 11px;
}

.application-register-panel .applications-table td:last-child {
  border-right: 1px solid #e4edf4;
  border-radius: 0 11px 11px 0;
}

.application-register-panel .applications-table tbody tr:not(.application-ipo-group):hover td {
  border-color: #ccdfef;
  background: #f7fbff;
}

.application-register-panel .applications-table th:nth-child(2),
.application-register-panel .applications-table td:nth-child(2) { width: 15%; }
.application-register-panel .applications-table th:nth-child(3),
.application-register-panel .applications-table td:nth-child(3) { width: 17%; }
.application-register-panel .applications-table th:nth-child(4),
.application-register-panel .applications-table td:nth-child(4) { width: 13%; }
.application-register-panel .applications-table th:nth-child(5),
.application-register-panel .applications-table td:nth-child(5) { width: 8%; }
.application-register-panel .applications-table th:nth-child(6),
.application-register-panel .applications-table td:nth-child(6) { width: 10%; }
.application-register-panel .applications-table th:nth-child(7),
.application-register-panel .applications-table td:nth-child(7) { width: 12%; }
.application-register-panel .applications-table th:nth-child(8),
.application-register-panel .applications-table td:nth-child(8) { width: 17%; }
.application-register-panel .applications-table th:nth-child(9),
.application-register-panel .applications-table td:nth-child(9) { width: 7%; }

.application-register-panel .application-header-filter {
  height: 30px;
  margin-top: 6px;
  padding: 0 24px 0 8px;
  border-radius: 9px;
  background: #ffffff;
  font-size: 10px;
}

.application-register-panel .applications-table .application-actions { gap: 5px; }
.application-register-panel .applications-table .application-actions .application-icon-action { width: 28px; height: 28px; }

.application-register-panel .application-ipo-group td {
  height: auto;
  padding: 10px 12px;
  border-color: #d8e5f0;
  border-radius: 10px;
  background: linear-gradient(145deg, #eff6fc, #e8f1fa);
  color: #244f77;
  width: auto !important;
  text-align: left !important;
  vertical-align: middle;
}

.application-register-collapsed td { padding: 12px !important; border: 0 !important; background: transparent !important; }
.application-register-picker { display: grid; gap: 14px; padding: 16px; border: 1px solid #d7e4ee; border-radius: 15px; background: linear-gradient(145deg, #f9fcff, #f2f8fc); }
.application-register-picker > div > strong, .application-register-picker > div > span { display: block; }
.application-register-picker > div > strong { color: #244c70; font-size: 15px; }
.application-register-picker > div > span { margin-top: 3px; color: #6a8295; font-size: 12px; }
.application-ipo-summary-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.application-ipo-summary-card { display: grid; min-width: min(100%, 260px); flex: 1 1 260px; gap: 3px; padding: 12px 13px; border: 1px solid #d4e2ed; border-radius: 12px; background: rgba(255,255,255,.9); color: #214a70; text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.application-ipo-summary-card:hover, .application-ipo-summary-card:focus-visible { border-color: #79add4; box-shadow: 0 8px 18px rgba(46, 99, 140, .12); outline: 0; transform: translateY(-1px); }
.application-ipo-summary-card strong { font-size: 14px; }
.application-ipo-summary-card span { color: #607c92; font-size: 11px; }
.application-ipo-summary-card small { color: #1766ad; font-size: 11px; font-weight: 800; }
.application-old-ipo-section { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid #dbe6ee; }
.application-old-ipo-section > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.application-old-ipo-section > div:first-child strong { color: #6c5d47; font-size: 13px; }
.application-old-ipo-section > div:first-child span { margin: 0; color: #887967; font-size: 11px; }
.application-picker-empty { color: #6a8295; font-size: 12px; }

.application-register-panel .ipo-group-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px 0 0;
  padding: 5px 8px;
  border: 1px solid #cbddeb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #39617f;
  line-height: 1;
  vertical-align: middle;
}

.application-register-panel .ipo-group-select input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.application-register-panel .application-ipo-group strong,
.application-register-panel .application-ipo-group span {
  display: inline-block;
  vertical-align: middle;
}

.application-register-panel .applications-table .refund-plan-wrap { min-height: 28px; }

/* Register controls need a guaranteed action column; never compress them into unreadable fragments. */
.application-register-panel .applications-table,
.application-register-panel .erp-shell .applications-table {
  min-width: 1020px;
}

.application-register-panel .applications-table th:first-child,
.application-register-panel .applications-table td:first-child { width: 4%; }
.application-register-panel .applications-table th:nth-child(2),
.application-register-panel .applications-table td:nth-child(2) { width: 14%; }
.application-register-panel .applications-table th:nth-child(3),
.application-register-panel .applications-table td:nth-child(3) { width: 16%; }
.application-register-panel .applications-table th:nth-child(4),
.application-register-panel .applications-table td:nth-child(4) { width: 11%; }
.application-register-panel .applications-table th:nth-child(5),
.application-register-panel .applications-table td:nth-child(5) { width: 7%; }
.application-register-panel .applications-table th:nth-child(6),
.application-register-panel .applications-table td:nth-child(6) { width: 9%; }
.application-register-panel .applications-table th:nth-child(7),
.application-register-panel .applications-table td:nth-child(7) { width: 9%; }
.application-register-panel .applications-table th:nth-child(8),
.application-register-panel .applications-table td:nth-child(8) { width: 15%; }
.application-register-panel .applications-table th:nth-child(9),
.application-register-panel .applications-table td:nth-child(9) { width: 15%; }

.application-register-panel .applications-table .application-actions {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  justify-content: flex-end;
  gap: 5px;
}

.application-register-panel .applications-table .check-allotment-btn {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  height: 28px;
  padding: 0;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1;
}

.application-register-panel .applications-table .application-actions .application-icon-action {
  display: inline-grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  box-sizing: border-box;
  border-radius: 9px;
  font-size: 16px;
  line-height: 1;
}

/* Source and category now read as one calm, structured detail pair. */
.application-register-panel .applications-table th:nth-child(4),
.application-register-panel .applications-table td:nth-child(4) { width: 12%; }
.application-register-panel .applications-table th:nth-child(5),
.application-register-panel .applications-table td:nth-child(5) { width: 8%; }
.application-register-panel .applications-table th:nth-child(6),
.application-register-panel .applications-table td:nth-child(6) { width: 9%; }
.application-register-panel .applications-table th:nth-child(7),
.application-register-panel .applications-table td:nth-child(7) { width: 9%; }
.application-register-panel .applications-table th:nth-child(8),
.application-register-panel .applications-table td:nth-child(8) { width: 13%; }
.application-register-panel .applications-table th:nth-child(9),
.application-register-panel .applications-table td:nth-child(9) { width: 15%; }

.application-register-panel .applications-table .application-funding-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #dce8f2;
  border-radius: 8px;
  background: #f7fafc;
  color: #315b80;
  font-size: 11px;
  font-weight: 800;
}

/* Keep long funding requirements readable within their fixed register column. */
.application-register-panel .applications-table td.funding-status-cell {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.application-register-panel .applications-table .funding-needed {
  display: inline-flex;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  margin: 0;
  color: #315b80;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.12;
  white-space: normal;
}

.application-register-panel .applications-table .funding-needed strong {
  display: block;
  max-width: 100%;
  color: #1d476d;
  font-size: clamp(9px, 0.76vw, 11px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.application-register-panel .applications-table .funding-status-cell .compact-record-funding-btn {
  margin-top: 4px;
}

/* Type-ahead keeps a long ledger list fast to use without losing account groups. */
.voucher-account-picker-list .voucher-account-search {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  min-height: 34px;
  margin: 0 0 5px;
  padding: 6px 9px;
  box-sizing: border-box;
  border: 1px solid #cbddec;
  border-radius: 8px;
  background: #fbfdff;
  color: #1d405f;
  font: inherit;
  font-size: 12px;
}

.voucher-account-picker-list .voucher-account-search:focus {
  border-color: #79aefa;
  box-shadow: 0 0 0 3px rgba(80, 145, 237, 0.14);
  outline: 0;
}

.voucher-line .voucher-debit-marker,
.voucher-line .voucher-credit-marker {
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.voucher-line .voucher-debit-marker small,
.voucher-line .voucher-credit-marker small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.application-register-panel .applications-table .application-funding-source i {
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5e9bd0;
}

.application-register-panel .applications-table .application-funding-source.is-savings i { background: #7f9a89; }
.application-register-panel .applications-table .application-funding-source.is-pending i { background: #c98b35; }
.application-register-panel .applications-table td:nth-child(4) { padding-right: 3px; }
.application-register-panel .applications-table td:nth-child(5) { padding-left: 3px; }

.application-register-panel .applications-table .check-allotment-btn {
  flex: 0 0 86px;
  width: 86px;
  min-width: 86px;
  min-height: 28px;
  height: 28px;
  padding: 0 8px;
  letter-spacing: -0.01em;
}

/* Applicant ledger: keep every transaction in one composed, scannable row. */
.account-ledger-dialog {
  width: min(790px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  border-radius: 24px;
  background: #fbfdff;
}

.account-ledger-dialog .ipo-ledger-dialog-content { padding: 26px; }

.account-ledger-dialog .dialog-title-row {
  align-items: center;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e3edf5;
}

.account-ledger-dialog .account-ledger-account-name {
  margin: 0 0 6px;
  color: #688097;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.account-ledger-dialog .account-ledger-balance {
  color: #173b63;
  font-size: 22px;
  font-weight: 800;
}

.account-ledger-dialog .account-ledger-header-actions {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.account-ledger-dialog .account-ledger-balances {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.account-ledger-dialog .account-ledger-balances span {
  max-width: 210px;
  padding: 5px 8px;
  border: 1px solid #dce8f2;
  border-radius: 999px;
  background: #f4f8fc;
  color: #55718b;
  font-size: 10px;
  line-height: 1.25;
}

.account-ledger-dialog .account-ledger-balances .is-settled {
  border-color: #d5eadc;
  background: #f0faf3;
  color: #377654;
}

.account-ledger-dialog .ipo-ledger-rows {
  max-height: 430px;
  margin-top: 16px;
  border: 1px solid #e0eaf2;
  border-radius: 15px;
  background: #ffffff;
}

.account-ledger-dialog .ipo-ledger-row {
  grid-template-columns: 88px minmax(0, 1fr) minmax(92px, auto) auto;
  gap: 14px;
  min-height: 64px;
  margin: 0;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #e7eef5;
  border-radius: 0;
  background: transparent;
}

.account-ledger-dialog .ipo-ledger-row:last-child { border-bottom: 0; }
.account-ledger-dialog .ipo-ledger-row:hover { background: #f7fbff; }

.account-ledger-dialog .ledger-row-date {
  color: #6d8498;
  font-size: 11px;
  font-weight: 700;
}

.account-ledger-dialog .ledger-row-detail strong {
  display: block;
  margin-bottom: 3px;
  color: #234766;
  font-size: 13px;
}

.account-ledger-dialog .ledger-row-detail small { line-height: 1.35; }
.account-ledger-dialog .ipo-ledger-row b { color: #173b63; font-size: 13px; text-align: right; }

.account-ledger-dialog .ledger-funding b { color: #287747; }
.account-ledger-dialog .ledger-refund b { color: #a45b31; }
.account-ledger-dialog .ledger-transfer b { color: #276a98; }

.account-ledger-dialog .account-ledger-edit-btn {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  box-shadow: none;
}

.account-ledger-dialog .account-ledger-entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.account-ledger-dialog .account-ledger-delete-btn {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #f2c9c9;
  border-radius: 8px;
  background: #fff8f8;
  color: #b34040;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
}

.account-ledger-dialog .account-ledger-delete-btn:hover { background: #fff0f0; }

.account-ledger-workspace-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.account-ledger-voucher-delete-btn {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #f2c9c9;
  border-radius: 9px;
  background: #fff8f8;
  color: #b34040;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.account-ledger-voucher-delete-btn:hover { background: #fff0f0; }

.ledger-shortcut-key {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 7px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f5f9fc;
  color: #58738b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
}

/* Accounting workspace: choose a ledger at left, review its complete trail at right. */
.account-ledger-workspace-dialog {
  width: min(1320px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  border-radius: 24px;
  background: #fbfdff;
}

.account-ledger-workspace-shell { padding: 26px; }
.account-ledger-workspace-title { padding-bottom: 18px; border-bottom: 1px solid #e1ebf3; }
.account-ledger-workspace-title h3 { margin: 4px 0 5px; color: #173b63; font-size: 27px; }
.account-ledger-workspace-title p:not(.eyebrow) { margin: 0; color: #637b93; }
.account-ledger-workspace { display: grid; grid-template-columns: minmax(238px, .34fr) minmax(0, 1fr); min-height: 580px; }
.account-ledger-account-pane { padding: 18px 16px 18px 0; border-right: 1px solid #e1ebf3; }
.account-ledger-search-label { display: grid; gap: 7px; color: #46627d; font-size: 12px; font-weight: 800; }
.account-ledger-search-label input { min-height: 38px; padding: 8px 10px; border: 1px solid #cddfed; border-radius: 10px; background: #fff; }
.account-ledger-list-heading { display: flex; justify-content: space-between; margin: 18px 10px 8px; color: #6f869a; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.account-ledger-account-list { display: grid; max-height: 510px; overflow-y: auto; border: 1px solid #e0eaf2; border-radius: 12px; background: #fff; }
.account-ledger-account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf2f6; border-radius: 0; background: #fff; color: #284a68; text-align: left; box-shadow: none; }
.account-ledger-account-row:last-child { border-bottom: 0; }
.account-ledger-account-row span { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.account-ledger-account-row b { color: #173b63; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-ledger-account-row:hover { background: #f5f9fc; }
.account-ledger-account-row.is-selected { background: #eaf4ff; box-shadow: inset 3px 0 0 #1675c1; }
.account-ledger-empty { margin: 0; padding: 18px; color: #70869a; font-size: 12px; }
.account-ledger-detail-pane { min-width: 0; padding: 18px 0 0 20px; }
.account-ledger-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.account-ledger-detail-header h3 { margin: 3px 0 4px; color: #173b63; font-size: 22px; }
.account-ledger-detail-header p:not(.eyebrow) { margin: 0; color: #698097; font-size: 12px; }
.account-ledger-detail-actions { display: flex; align-items: center; gap: 10px; }
.account-ledger-detail-actions > strong { padding: 10px 13px; border: 1px solid #cfe1f1; border-radius: 11px; background: #f5faff; color: #174a74; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-ledger-detail-actions .primary-btn { min-height: 40px; padding: 9px 14px; border-radius: 11px; white-space: nowrap; }
.account-ledger-workspace-dialog .account-ledger-table-wrap { max-height: 315px; margin: 0; border: 1px solid #dce8f2; border-radius: 13px; }
.account-ledger-workspace-dialog .account-ledger-table-wrap table { min-width: 720px; }
.account-ledger-workspace-dialog .account-ledger-table-wrap th { position: sticky; top: 0; z-index: 1; background: #eef6ff; }

/* MARG's keyboard-first voucher flow, in the app's Apple-style dialog language. */
.voucher-type-dialog, .voucher-entry-dialog { border: 1px solid rgba(202, 218, 232, .9); border-radius: 28px; background: rgba(255, 255, 255, .98); box-shadow: 0 30px 90px rgba(24, 57, 86, .26); color: #173b63; }
.voucher-type-dialog { width: min(620px, calc(100vw - 32px)); }.voucher-entry-dialog { width: min(1020px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.voucher-type-dialog::backdrop, .voucher-entry-dialog::backdrop { background: rgba(26, 46, 67, .38); backdrop-filter: blur(7px); }
.voucher-marg-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 0 26px; border-bottom: 1px solid #e3edf5; background: linear-gradient(135deg, #f9fcff, #eef6fd); color: #58728d; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.voucher-marg-bar button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #54708a; font-size: 23px; font-weight: 400; box-shadow: none; }.voucher-marg-bar button:hover { background: #e6f1fa; color: #1d5f98; }
.voucher-type-content { padding: 28px; }.voucher-type-content h3, .voucher-entry-header h3 { margin: 5px 0 7px; color: #173b63; font-family: inherit; font-size: 28px; letter-spacing: -.035em; }.voucher-type-content > p:not(.eyebrow), .voucher-entry-header p:not(.eyebrow) { margin: 0; color: #617a93; }
.voucher-type-list { display: grid; gap: 10px; margin: 24px 0; }.voucher-type-choice { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 14px; padding: 15px; border: 1px solid #d7e5f0; border-radius: 15px; background: #fff; color: #234766; text-align: left; box-shadow: 0 3px 10px rgba(25, 62, 93, .035); }.voucher-type-choice:hover, .voucher-type-choice:focus-visible, .voucher-type-choice.is-active { border-color: #8bbbf0; background: #f5faff; box-shadow: 0 8px 20px rgba(38, 111, 174, .12); outline: none; transform: translateY(-1px); }.voucher-type-choice kbd { display: grid; place-items: center; width: 36px; height: 30px; border: 1px solid #bfd7ec; border-radius: 8px; background: #eef6ff; color: #23659f; font-size: 11px; font-weight: 800; }.voucher-type-choice strong, .voucher-type-choice small { display: block; }.voucher-type-choice strong { font-size: 16px; }.voucher-type-choice small { margin-top: 2px; color: #71879a; font-size: 12px; }.voucher-type-actions { display: flex; align-items: center; justify-content: space-between; color: #71879a; font-size: 12px; }.voucher-type-actions kbd { padding: 2px 5px; border: 1px solid #d2e2ef; border-radius: 5px; background: #f7fbff; color: #52718e; }
.voucher-entry-shell { min-height: 0; }.voucher-entry-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 26px 18px; border-bottom: 1px solid #e3edf5; }.voucher-entry-header .secondary-btn { border-radius: 12px; background: #f8fbfe; }.voucher-meta { display: grid; grid-template-columns: 1fr 180px; gap: 20px; padding: 15px 26px; background: #fbfdff; border-bottom: 1px solid #e6eef5; }
.voucher-entry-shell label { display: grid; gap: 6px; color: #4d6983; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }.voucher-entry-shell input, .voucher-entry-shell select, .voucher-entry-shell textarea { width: 100%; border: 1px solid #c8dced; border-radius: 11px; background: #fff; color: #1d405f; box-shadow: inset 0 1px 2px rgba(21, 55, 85, .025); font-family: inherit; font-size: 14px; }.voucher-entry-shell input:focus, .voucher-entry-shell select:focus, .voucher-entry-shell textarea:focus { border-color: #79aefa; box-shadow: 0 0 0 4px rgba(80, 145, 237, .14); outline: none; }.voucher-entry-shell input, .voucher-entry-shell select { min-height: 42px; padding: 8px 11px; }.voucher-entry-shell textarea { min-height: 72px; padding: 10px 11px; resize: vertical; }
.voucher-lines { margin: 18px 26px 0; overflow: visible; border: 1px solid #d4e3ef; border-radius: 15px; background: #fff; }.voucher-line-head, .voucher-line { display: grid; grid-template-columns: 64px minmax(300px, 1.55fr) minmax(130px, .6fr) minmax(140px, .65fr); align-items: stretch; }.voucher-line-head { background: #eef6ff; color: #63809a; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }.voucher-line-head span, .voucher-line > * { min-width: 0; padding: 10px; border-right: 1px solid #e2edf5; }.voucher-line-head span:last-child, .voucher-line > *:last-child { border-right: 0; }.voucher-line { min-height: 70px; border-top: 1px solid #e7eff6; }.voucher-line strong { display: flex; align-items: center; justify-content: center; font-size: 15px; }.voucher-debit-marker { color: #2472b4; background: #f0f7ff; }.voucher-credit-marker { color: #a75a3d; background: #fff7f2; }.voucher-line label { padding: 8px 10px; }.voucher-line label select { min-height: 36px; padding: 5px 8px; border-radius: 9px; font-size: 12px; }.voucher-account-picker { position: relative; }.voucher-account-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }.voucher-account-trigger { display: flex; align-items: center; width: 100%; min-height: 36px; padding: 5px 34px 5px 8px; border: 1px solid #c8dced; border-radius: 9px; background: #fff; color: #1d405f; font: inherit; font-size: 12px; font-weight: 700; text-align: left; box-shadow: inset 0 1px 2px rgba(21, 55, 85, .025); }.voucher-account-trigger::after { position: absolute; top: 50%; right: 13px; width: 7px; height: 7px; border-right: 1.5px solid #315b7e; border-bottom: 1.5px solid #315b7e; content: ""; transform: translateY(-68%) rotate(45deg); }.voucher-account-trigger:focus { border-color: #79aefa; box-shadow: 0 0 0 4px rgba(80, 145, 237, .14); outline: none; }.voucher-account-picker-list { position: absolute; z-index: 12; top: calc(100% + 6px); right: 0; left: 0; max-height: 255px; overflow: auto; padding: 6px; border: 1px solid #cddfec; border-radius: 12px; background: rgba(255, 255, 255, .99); box-shadow: 0 16px 32px rgba(25, 60, 89, .18); }.voucher-account-group + .voucher-account-group { margin-top: 5px; padding-top: 5px; border-top: 1px solid #e5eef5; }.voucher-account-group > strong { display: block; padding: 6px 8px 4px; color: #6b8295; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }.voucher-account-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; width: 100%; gap: 16px; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: #234766; text-align: left; box-shadow: none; }.voucher-account-option span { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }.voucher-account-option b { color: #4d718f; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }.voucher-account-option:hover, .voucher-account-option:focus, .voucher-account-option.is-selected { background: #eaf4ff; color: #164f84; outline: none; }.voucher-account-option.is-selected b { color: #164f84; }.voucher-line output { display: flex; align-items: center; justify-content: flex-end; color: #315b7e; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }.voucher-line input { align-self: stretch; border: 0; border-radius: 0; padding: 10px; text-align: right; font-size: 16px; font-weight: 800; }.voucher-notes { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; padding: 18px 26px; }.voucher-entry-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 26px; border-top: 1px solid #e0ebf4; background: #fbfdff; }.voucher-entry-footer div { min-width: 122px; padding-right: 14px; border-right: 1px solid #dce9f2; }.voucher-entry-footer span, .voucher-entry-footer strong { display: block; }.voucher-entry-footer span { color: #71879a; font-size: 10px; text-transform: uppercase; }.voucher-entry-footer strong { color: #173b63; font-size: 14px; }.voucher-entry-footer .secondary-btn, .voucher-entry-footer .primary-btn { min-height: 40px; border-radius: 11px; }.voucher-entry-footer .primary-btn { background: #1468b8; box-shadow: 0 8px 18px rgba(24, 100, 181, .2); }

/* Daily workflow: a quiet, practical operating panel inspired by trading workspaces. */
.daily-workflow-panel {
  padding: 22px;
  border-color: #e0e7ed;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 50, 77, 0.045);
}

.daily-workflow-panel .panel-header {
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid #edf1f4;
}

.daily-workflow-panel .panel-header h2 {
  margin-bottom: 3px;
  color: #293b4d;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.daily-workflow-panel .panel-header p {
  color: #6b7c8b;
  font-size: 12px;
}

.daily-workflow-panel .workflow-heading-actions .secondary-btn {
  min-height: 34px;
  border-color: #d9e1e7;
  border-radius: 6px;
  color: #387ed1;
  font-size: 12px;
  font-weight: 700;
}

.daily-workflow-panel .workflow-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.daily-workflow-panel .workflow-step {
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 7px 10px;
  min-height: 148px;
  padding: 14px;
  border: 1px solid #e1e7eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  color: #415466;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.daily-workflow-panel .workflow-step:hover {
  transform: none;
  border-color: #b8cde0;
  background: #fcfdfe;
  box-shadow: 0 3px 10px rgba(41, 70, 96, 0.07);
}

.daily-workflow-panel .workflow-step:active { transform: none; box-shadow: none; }
.daily-workflow-panel .workflow-step.needs-action { border-top: 3px solid #e6a23c; background: #fffdfa; }
.daily-workflow-panel .workflow-step.is-clear { border-top: 3px solid #42a86c; background: #fcfffd; }

.daily-workflow-panel .workflow-step-number {
  grid-column: 1;
  grid-row: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef5fc;
  box-shadow: none;
  color: #387ed1;
  font-size: 11px;
}

.daily-workflow-panel .workflow-step-copy {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding-top: 1px;
}
.daily-workflow-panel .workflow-step strong {
  color: #31485e;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.daily-workflow-panel .workflow-step b {
  margin-top: 4px;
  color: #202f3d;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.daily-workflow-panel .workflow-step small {
  margin-top: 7px;
  color: #748594;
  font-size: 11px;
  line-height: 1.4;
}

.daily-workflow-panel .workflow-step-action {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 3;
  align-items: center;
  justify-content: space-between;
  align-self: end;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid #e0e9f1;
  border-radius: 6px;
  background: #f8fbfe;
  color: #387ed1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
}

.daily-workflow-panel .workflow-step-action i {
  display: inline;
  margin-top: 0;
  color: #6b8eb1;
  font-size: 9px;
}

@media (max-width: 760px) {
  [data-tab-panel="applications"] { gap: 14px; }

  .application-register-panel,
  .application-archive-panel {
    padding: 16px;
    border-radius: 16px;
  }

  .application-register-panel .panel-header,
  .application-archive-panel .panel-header { flex-direction: column; }

  .application-register-panel .application-recording-actions {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .application-register-panel .application-recording-status {
    flex-basis: 100%;
    width: 100%;
  }

  .application-register-panel .application-recording-actions button { flex: 1 1 calc(50% - 8px); }
  .application-register-panel .application-category-summary { grid-template-columns: 1fr; gap: 8px; }
  .application-register-panel .applications-table { min-width: 990px; }

  .account-ledger-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .account-ledger-dialog .ipo-ledger-dialog-content { padding: 18px; }
  .account-ledger-dialog .dialog-title-row { align-items: flex-start; }
  .account-ledger-dialog .account-ledger-header-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
  .account-ledger-dialog .ipo-ledger-row { grid-template-columns: 72px minmax(0, 1fr) 52px; gap: 9px; padding: 11px; }
  .account-ledger-dialog .ipo-ledger-row b { grid-column: 2; grid-row: 2; text-align: left; }
  .account-ledger-dialog .account-ledger-entry-actions { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; }

  .account-ledger-workspace-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 18px; }
  .account-ledger-workspace-shell { padding: 18px; }
  .account-ledger-workspace { grid-template-columns: 1fr; min-height: 0; }
  .account-ledger-account-pane { padding: 14px 0; border-right: 0; border-bottom: 1px solid #e1ebf3; }
  .account-ledger-account-list { max-height: 210px; }
  .account-ledger-detail-pane { padding: 16px 0 0; }
  .account-ledger-detail-header { align-items: stretch; flex-direction: column; }
  .account-ledger-detail-actions { width: 100%; justify-content: space-between; }
  .account-ledger-detail-actions > strong { width: fit-content; }
  .account-ledger-workspace-dialog .account-ledger-table-wrap { max-height: 270px; }

  .voucher-type-dialog, .voucher-entry-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .voucher-entry-shell { min-height: 0; }
  .voucher-entry-header { padding: 16px; }.voucher-entry-header h3, .voucher-type-content h3 { font-size: 23px; }
  .voucher-meta, .voucher-notes { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
  .voucher-lines { margin: 0 16px; overflow-x: auto; }
  .voucher-line-head, .voucher-line { min-width: 650px; }
  .voucher-entry-footer { flex-wrap: wrap; padding: 12px 16px; }.voucher-entry-footer div { flex: 1; }

  .daily-workflow-panel { padding: 16px; border-radius: 13px; }
  .daily-workflow-panel .panel-header { align-items: flex-start; }
  .daily-workflow-panel .workflow-steps { grid-template-columns: 1fr; }
  .daily-workflow-panel .workflow-step { min-height: 132px; }
}

@media (min-width: 761px) and (max-width: 1200px) {
  .daily-workflow-panel .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Application capacity: a balanced planning surface with one clear visual language. */
.capacity-planner-panel {
  padding: 22px;
  border-color: #e0e7ed;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow: 0 8px 22px rgba(23, 50, 77, 0.045);
}

.capacity-planner-panel .panel-header {
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9eef2;
}

.capacity-planner-panel .panel-header h2 {
  margin-bottom: 3px;
  color: #263b4f;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.capacity-planner-panel .panel-header p { color: #6e7f8f; font-size: 12px; }

.capacity-planner-panel .capacity-planner-controls {
  flex: 0 1 510px;
  min-width: min(100%, 360px);
  padding: 4px;
  border: 1px solid #e1e7ec;
  border-radius: 11px;
  background: #f4f6f8;
}

.capacity-planner-panel .capacity-planner-controls select {
  min-width: 270px;
  height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: #ffffff;
  color: #344c60;
  font-size: 12px;
}

.capacity-planner-panel .capacity-planner-controls select:disabled {
  color: #8a98a5;
  background-color: #f8f9fa;
}

.capacity-planner-panel .capacity-planner-controls .primary-btn {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 8px;
  background: #1677e8;
  box-shadow: none;
  font-size: 12px;
}

.capacity-planner-panel .capacity-balance-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.capacity-planner-panel .capacity-balance-summary > div,
.capacity-planner-panel .capacity-balance-summary .capacity-balance-card {
  min-height: 94px;
  padding: 15px;
  border: 1px solid #e0e6eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

.capacity-planner-panel .capacity-balance-summary .capacity-balance-card {
  border-color: #cfe0f0;
  background: linear-gradient(145deg, #ffffff, #f3f8fd);
}

.capacity-planner-panel .capacity-balance-summary .capacity-balance-card:hover {
  transform: none;
  border-color: #8ab7e1;
  box-shadow: 0 3px 10px rgba(40, 91, 133, 0.08);
}

.capacity-planner-panel .capacity-balance-summary span {
  color: #718394;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.capacity-planner-panel .capacity-balance-summary strong {
  margin-top: 8px;
  color: #2a3e50;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.capacity-planner-panel .capacity-balance-summary small {
  margin-top: 6px;
  color: #2875bf;
  font-size: 10px;
}

.capacity-planner-panel .capacity-plan-result {
  min-height: 48px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #d9e7f3;
  border-radius: 10px;
  background: #f5faff;
  color: #35617f;
  font-size: 12px;
}

.capacity-planner-panel .capacity-allocation {
  gap: 8px;
  margin-top: 12px;
}

.capacity-planner-panel .capacity-category-btn,
.capacity-planner-panel .capacity-allocation .secondary-btn {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 7px;
  box-shadow: none;
  font-size: 11px;
}

.capacity-planner-panel .capacity-category-btn {
  border-color: #cae0d1;
  background: #f2faf5;
  color: #31754e;
}

.capacity-planner-panel .capacity-ledger-shortcut {
  align-items: center;
  margin-top: 16px;
  padding: 15px 16px;
  border-color: #e1e7ec;
  border-radius: 12px;
  background: #fbfcfd;
}

.capacity-planner-panel .capacity-ledger-shortcut h3 { color: #324a5d; }
.capacity-planner-panel .capacity-ledger-shortcut .secondary-btn {
  min-height: 38px;
  border-radius: 8px;
  color: #2e6fae;
  font-size: 12px;
}

@media (max-width: 980px) {
  .capacity-planner-panel .panel-header { align-items: flex-start; flex-direction: column; }
  .capacity-planner-panel .capacity-planner-controls { width: 100%; max-width: 560px; }
  .capacity-planner-panel .capacity-balance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .capacity-planner-panel { padding: 16px; border-radius: 14px; }
  .capacity-planner-panel .capacity-planner-controls { align-items: stretch; flex-direction: column; }
  .capacity-planner-panel .capacity-planner-controls select,
  .capacity-planner-panel .capacity-planner-controls .primary-btn { width: 100%; min-width: 0; }
  .capacity-planner-panel .capacity-balance-summary { grid-template-columns: 1fr; }
  .capacity-planner-panel .capacity-balance-summary > div,
  .capacity-planner-panel .capacity-balance-summary .capacity-balance-card { min-height: 82px; }
}

/* Final workspace containment: inactive panels must never influence another tab's layout. */
body { overflow-x: hidden; }
.tab-section:not(.active) { display: none !important; }
.tab-section[data-tab-panel="applications"].active { display: grid; }

.application-register-panel { min-width: 0; overflow: hidden; }
.application-register-panel .application-register-wrap { overscroll-behavior-inline: contain; }

/* Dates remain on one calm, readable line in the transaction register. */
.transaction-history-table th:first-child,
.transaction-history-table td:first-child {
  width: 104px;
  min-width: 104px;
  white-space: nowrap;
}

/* Dashboard market strip: compact NSE-style session metrics on one desktop line. */
.erp-shell #summaryCards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid #dce7ee;
  border-radius: 15px;
  background: rgba(248, 251, 253, .82);
}

.erp-shell #summaryCards .summary-market-card {
  position: relative;
  min-width: 0;
  min-height: 82px;
  padding: 13px 12px 11px;
  overflow: hidden;
  border: 1px solid #dde7ed;
  border-radius: 10px;
  border-top: 3px solid #3d8ebd;
  background: linear-gradient(145deg, #fff, #f9fbfc);
  box-shadow: none;
}

.erp-shell #summaryCards .summary-market-card:nth-child(1),
.erp-shell #summaryCards .summary-market-card:nth-child(5) { border-top-color: #4aa27d; }
.erp-shell #summaryCards .summary-market-card:nth-child(3) { border-top-color: #1c719f; }
.erp-shell #summaryCards .summary-market-card:nth-child(4) { border-top-color: #b17d3b; }

.erp-shell #summaryCards .summary-market-card p {
  min-height: 22px;
  margin: 0 0 7px;
  overflow: hidden;
  color: #647c91;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .065em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.erp-shell #summaryCards .summary-market-card h3 {
  margin: 0;
  overflow: hidden;
  color: #173d5f;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.25vw, 22px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .erp-shell #summaryCards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .erp-shell #summaryCards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 7px; }
  .erp-shell #summaryCards .summary-market-card { min-height: 76px; padding: 11px 10px; }
}

/* Savings ledger: a wide, contained transaction workspace rather than a squeezed form dialog. */
.edit-dialog.savings-transfer-ledger-dialog {
  width: min(1080px, calc(100vw - 36px));
  max-width: min(1080px, calc(100vw - 36px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid #d5e2eb;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(21, 55, 83, .22);
}

.savings-transfer-ledger-dialog::backdrop {
  background: rgba(17, 46, 70, .34);
  backdrop-filter: blur(8px) saturate(.9);
}

.savings-transfer-ledger-dialog .edit-account-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: none;
  max-height: min(760px, calc(100dvh - 32px));
  padding: 24px 26px 22px;
}

.savings-transfer-ledger-dialog .dialog-title-row,
.savings-transfer-ledger-dialog .savings-ledger-toolbar,
.savings-transfer-ledger-dialog .savings-transfer-table-wrap { grid-column: 1; }

.savings-transfer-ledger-dialog .dialog-title-row {
  align-items: flex-start;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8eef3;
}

.savings-transfer-ledger-dialog .dialog-title-row h3 { margin-top: 4px; color: #193d5d; font-size: 24px; letter-spacing: -.035em; }
.savings-transfer-ledger-dialog .dialog-title-row p:not(.eyebrow) { max-width: 640px; color: #6b8192; font-size: 13px; line-height: 1.45; }
.savings-transfer-ledger-dialog .dialog-title-row .secondary-btn { min-width: 84px; }

.savings-transfer-ledger-dialog .savings-ledger-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 13px 14px;
  border-color: #dfeaf1;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbfd, #f2f8fb);
}

.savings-transfer-ledger-dialog .capacity-savings-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid #dbe7ee;
}
.savings-transfer-ledger-dialog .capacity-savings-metric span { color: #688095; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.savings-transfer-ledger-dialog .capacity-savings-metric strong { color: #173d5f; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; white-space: nowrap; }

.savings-transfer-ledger-dialog .capacity-transfer-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.savings-transfer-ledger-dialog .capacity-transfer-action-buttons .primary-btn,
.savings-transfer-ledger-dialog .capacity-transfer-action-buttons .secondary-btn {
  min-width: 0;
  min-height: 37px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 11px;
}

.savings-transfer-ledger-dialog .savings-transfer-table-wrap {
  max-height: min(420px, 49vh);
  min-height: 0;
  margin: 0;
  overflow: auto;
  border: 1px solid #dbe7ee;
  border-radius: 14px;
}

.savings-transfer-ledger-dialog .savings-ledger-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.savings-transfer-ledger-dialog .savings-ledger-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px;
  background: #f2f7fb;
  color: #627b91;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.savings-transfer-ledger-dialog .savings-ledger-table td {
  padding: 13px 12px;
  color: #274965;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.savings-transfer-ledger-dialog .savings-ledger-table tr:nth-child(even) td { background: #fbfdfe; }
.savings-transfer-ledger-dialog .savings-ledger-table th:nth-child(1) { width: 12%; }
.savings-transfer-ledger-dialog .savings-ledger-table th:nth-child(2),
.savings-transfer-ledger-dialog .savings-ledger-table th:nth-child(3) { width: 18%; }
.savings-transfer-ledger-dialog .savings-ledger-table th:nth-child(4) { width: 13%; }
.savings-transfer-ledger-dialog .savings-ledger-table th:nth-child(5) { width: 18%; }
.savings-transfer-ledger-dialog .savings-ledger-table th:nth-child(6) { width: 21%; }
.savings-transfer-ledger-dialog .savings-ledger-table td:nth-child(1),
.savings-transfer-ledger-dialog .savings-ledger-table td:nth-child(4) { white-space: nowrap; }
.savings-transfer-ledger-dialog .savings-ledger-table td:nth-child(4) { color: #173d5f; font-weight: 800; font-variant-numeric: tabular-nums; }

.savings-ledger-row-actions { display: flex; gap: 6px; white-space: nowrap; }
.savings-ledger-row-actions .secondary-btn { min-height: 28px; padding: 4px 7px; border-radius: 7px; box-shadow: none; font-size: 10px; }

@media (max-width: 820px) {
  .edit-dialog.savings-transfer-ledger-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .savings-transfer-ledger-dialog .edit-account-form { padding: 18px; }
  .savings-transfer-ledger-dialog .savings-ledger-toolbar { grid-template-columns: 1fr; }
  .savings-transfer-ledger-dialog .capacity-savings-metric { padding: 0 0 11px; border-right: 0; border-bottom: 1px solid #dbe7ee; }
  .savings-transfer-ledger-dialog .capacity-transfer-action-buttons { justify-content: flex-start; flex-wrap: wrap; }
  .savings-transfer-ledger-dialog .savings-ledger-table { min-width: 760px; }
}

/* Historical planning: a focused single-column sheet with compact planning rows. */
.edit-dialog.old-ipo-planner-dialog {
  width: min(1040px, calc(100vw - 36px));
  max-width: min(1040px, calc(100vw - 36px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid #d5e2eb;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(21, 55, 83, .22);
}

.old-ipo-planner-dialog::backdrop { background: rgba(17, 46, 70, .34); backdrop-filter: blur(8px) saturate(.9); }

.old-ipo-planner-dialog .old-ipo-planner-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  width: 100%;
  max-width: none;
  max-height: min(760px, calc(100dvh - 32px));
  padding: 24px 26px 22px;
}

.old-ipo-planner-dialog .dialog-title-row,
.old-ipo-planner-dialog .old-ipo-planner-rows,
.old-ipo-planner-dialog .old-ipo-planner-footer,
.old-ipo-planner-dialog .dialog-actions { grid-column: 1; }

.old-ipo-planner-dialog .dialog-title-row { align-items: flex-start; padding-bottom: 15px; border-bottom: 1px solid #e8eef3; }
.old-ipo-planner-dialog .dialog-title-row h3 { margin-top: 4px; color: #193d5d; font-size: 24px; letter-spacing: -.035em; }
.old-ipo-planner-dialog .dialog-title-row p:not(.eyebrow) { max-width: 630px; color: #6b8192; font-size: 13px; line-height: 1.45; }
.old-ipo-planner-dialog .dialog-title-row .secondary-btn { min-width: 84px; }

.old-ipo-planner-dialog .old-ipo-planner-rows { display: grid; gap: 10px; min-height: 0; max-height: min(420px, 48vh); overflow: auto; padding-right: 2px; }
.old-ipo-planner-dialog .old-ipo-planner-row { padding: 16px; border-color: #dbe7ee; border-radius: 14px; background: linear-gradient(145deg, #fff, #f8fbfd); box-shadow: 0 3px 10px rgba(23, 61, 91, .025); }
.old-ipo-planner-dialog .old-ipo-main-fields { grid-template-columns: 1.2fr 1.3fr 1fr 32px; gap: 12px; }
.old-ipo-planner-dialog .old-ipo-main-fields label,
.old-ipo-planner-dialog .old-ipo-add-source-label { color: #60788d; font-size: 10px; letter-spacing: .02em; }
.old-ipo-planner-dialog .old-ipo-account-label { position: relative; }
.old-ipo-planner-dialog .old-ipo-existing-application {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  color: #7a8d9e;
  font-size: 10px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}
.old-ipo-planner-dialog .old-ipo-planner-row.has-existing-application .old-ipo-funding-area { margin-top: 29px; }
.old-ipo-planner-dialog .old-ipo-main-fields select,
.old-ipo-planner-dialog .old-ipo-funding-source select,
.old-ipo-planner-dialog .old-ipo-funding-source input,
.old-ipo-planner-dialog .old-ipo-add-source-label select { height: 38px; border-color: #ccddea; border-radius: 10px; background: #fbfdff; font-size: 12px; }
.old-ipo-planner-dialog .old-ipo-funding-area { gap: 9px; margin-top: 14px; padding-top: 13px; border-top-color: #e3edf3; }
.old-ipo-planner-dialog .old-ipo-funding-area > strong { color: #284a67; font-size: 12px; }
.old-ipo-planner-dialog .old-ipo-funding-source { grid-template-columns: minmax(220px, 1.15fr) minmax(150px, .7fr) minmax(150px, .7fr) 32px; gap: 10px; align-items: end; }
.old-ipo-planner-dialog .old-ipo-funding-source label { display: grid; gap: 4px; color: #60788d; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.old-ipo-planner-dialog .old-ipo-remove-row,
.old-ipo-planner-dialog .old-ipo-remove-source {
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  place-items: center;
  align-self: end;
  box-sizing: border-box;
  border-radius: 10px;
  font-size: 17px;
  line-height: 1;
}
.old-ipo-planner-dialog .old-ipo-planner-footer { align-items: center; padding: 11px 13px; border: 1px solid #dce8ef; border-radius: 12px; background: #f7fbfd; color: #637b8f; font-size: 11px; }
.old-ipo-planner-dialog .old-ipo-planner-footer .secondary-btn { min-height: 35px; border-radius: 9px; font-size: 11px; }
.old-ipo-planner-dialog .old-ipo-planner-footer .secondary-btn[hidden] { display: none; }
.old-ipo-planner-dialog .dialog-actions { margin-top: 0; padding-top: 2px; }

#editOldIpoFromPlannerBtn:not([hidden]) { margin-right: auto; }

.data-health-dialog { width: min(820px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); }
.data-health-dialog-shell { display: grid; gap: 14px; max-width: none; padding: 24px 26px; }
.data-health-dialog .dialog-title-row { align-items: flex-start; padding-bottom: 13px; border-bottom: 1px solid #e4edf3; }
.data-health-dialog .dialog-title-row h3 { margin: 4px 0 5px; font-size: 24px; letter-spacing: -.035em; }
.data-health-dialog-rows { display: grid; gap: 8px; max-height: min(510px, 60vh); overflow: auto; padding-right: 3px; }
.data-health-dialog-rows article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 13px; border: 1px solid #dce7ef; border-radius: 12px; background: linear-gradient(135deg, #fff, #f8fbfd); }
.data-health-dialog-rows article > div { display: grid; gap: 3px; min-width: 0; }
.data-health-dialog-rows strong { overflow: hidden; color: #1c405f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.data-health-dialog-rows span { color: #6b8294; font-size: 11px; font-weight: 650; }
.data-health-dialog-rows .secondary-btn { min-width: 96px; min-height: 36px; padding: 7px 10px; flex-shrink: 0; font-size: 11px; }
.data-health-bulk-toolbar { display: grid; grid-template-columns: auto minmax(210px, 1fr) auto; align-items: end; gap: 10px; padding: 11px 12px; border: 1px solid #dce7ef; border-radius: 12px; background: #f5f9fc; }
.data-health-bulk-toolbar .checkbox { align-self: center; white-space: nowrap; color: #31536e; font-size: 12px; font-weight: 700; }
.data-health-date-field { display: grid; gap: 4px; color: #58738a; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.data-health-date-field input { min-height: 36px; padding: 7px 9px; border: 1px solid #c9ddec; border-radius: 9px; background: #fff; color: #1c405f; font: inherit; letter-spacing: normal; text-transform: none; }
.data-health-bulk-toolbar .primary-btn { min-height: 36px; padding: 7px 12px; font-size: 11px; white-space: nowrap; }
.data-health-date-list { display: grid; gap: 8px; }
.data-health-date-list article { padding: 10px 12px; }
.data-health-date-select { display: flex; align-items: center; gap: 9px; min-width: 0; cursor: pointer; }
.data-health-date-select > span { display: grid; gap: 3px; min-width: 0; }
.data-health-date-select input, .data-health-bulk-toolbar input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; accent-color: #1769aa; }
@media (max-width: 680px) { .data-health-bulk-toolbar { grid-template-columns: 1fr; align-items: stretch; } .data-health-bulk-toolbar .checkbox { align-self: auto; } }

.global-search-dialog .edit-account-form { display: grid !important; grid-template-columns: 1fr !important; align-items: start !important; }
.global-search-dialog #globalSearchInput { grid-column: 1 !important; grid-row: auto !important; height: 46px !important; min-height: 46px !important; }
.global-search-dialog .global-search-results { grid-column: 1 !important; grid-row: auto !important; width: 100% !important; max-height: min(400px, 48vh) !important; }
.global-search-dialog .global-search-result { width: 100%; box-sizing: border-box; }

@media (max-width: 720px) {
  .edit-dialog.old-ipo-planner-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .old-ipo-planner-dialog .old-ipo-planner-form { padding: 18px; }
  .old-ipo-planner-dialog .old-ipo-main-fields,
  .old-ipo-planner-dialog .old-ipo-funding-source { grid-template-columns: 1fr; }
  .old-ipo-planner-dialog .old-ipo-remove-row,
  .old-ipo-planner-dialog .old-ipo-remove-source { justify-self: end; }
  .old-ipo-planner-dialog .old-ipo-planner-footer { align-items: stretch; flex-direction: column; }
}

/* Final precedence for the Applications register. These rules intentionally
   sit at the end of the stylesheet so earlier legacy table styles cannot
   reintroduce clipping or excess vertical space. */
.application-register-panel .application-category-summary { gap: 12px; margin: 0 0 14px; }
.application-register-panel .application-category-summary .application-category-tile { min-height: 104px; padding: 16px 18px; border-radius: 17px; align-content: center; }
.application-register-panel .application-category-summary .application-category-tile span { font-size: 13px; }
.application-register-panel .application-category-summary .application-category-tile strong { margin: 2px 0; font-size: 30px; line-height: 1; }
.application-register-panel .application-category-summary .application-category-tile small { font-size: 13px; }

.application-register-panel .application-register-wrap { overflow-x: hidden; padding: 10px; border-radius: 18px; background: #f7fafc; }
.application-register-panel .applications-table,
.application-register-panel .erp-shell .applications-table { width: 100%; min-width: 0; table-layout: fixed; border-spacing: 0 6px; }
.application-register-panel .applications-table th { padding: 7px 8px 9px; color: #617b93; font-size: 10px; line-height: 1.15; letter-spacing: .055em; white-space: normal; }
.application-register-panel .applications-table td { min-width: 0; height: 46px; padding: 7px 8px; font-size: 12px; }
.application-register-panel .applications-table th:nth-child(1), .application-register-panel .applications-table td:nth-child(1) { width: 3%; }
.application-register-panel .applications-table th:nth-child(2), .application-register-panel .applications-table td:nth-child(2) { width: 14%; }
.application-register-panel .applications-table th:nth-child(3), .application-register-panel .applications-table td:nth-child(3) { width: 17%; }
.application-register-panel .applications-table th:nth-child(4), .application-register-panel .applications-table td:nth-child(4) { width: 14%; }
.application-register-panel .applications-table th:nth-child(5), .application-register-panel .applications-table td:nth-child(5) { width: 7%; }
.application-register-panel .applications-table th:nth-child(6), .application-register-panel .applications-table td:nth-child(6) { width: 9%; }
.application-register-panel .applications-table th:nth-child(7), .application-register-panel .applications-table td:nth-child(7) { width: 9%; }
.application-register-panel .applications-table th:nth-child(8), .application-register-panel .applications-table td:nth-child(8) { width: 14%; }
.application-register-panel .applications-table th:nth-child(9), .application-register-panel .applications-table td:nth-child(9) { width: 13%; }
.application-register-panel .applications-table select,
.application-register-panel .applications-table .filter-control { width: 100%; min-width: 0; height: 34px; padding: 0 28px 0 10px; border-radius: 10px; font-size: 11px; }
.application-register-panel .applications-table .funding-source-chip,
.application-register-panel .applications-table .category-badge,
.application-register-panel .applications-table .status-badge,
.application-register-panel .applications-table .refund-badge { max-width: 100%; box-sizing: border-box; overflow: hidden; font-size: 10px; line-height: 1.1; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.application-register-panel .applications-table .funding-status { white-space: normal; font-size: 11px; line-height: 1.2; }
.application-register-panel .applications-table .application-actions { display: flex; min-width: 0; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.application-register-panel .applications-table .application-actions button,
.application-register-panel .applications-table .application-actions .secondary-btn { min-width: 0; min-height: 34px; padding: 6px 9px; border-radius: 10px; font-size: 10px; }
.application-register-panel .applications-table .application-actions .check-result-btn { min-width: 74px; }
.application-register-panel .application-register-collapsed td { height: auto; padding: 10px 12px !important; }
.application-register-panel .application-register-picker { gap: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(145deg, #fbfdff, #f2f8fc); }
.application-register-panel .application-register-picker > div > strong { font-size: 14px; }
.application-register-panel .application-register-picker > div > span { font-size: 11px; }
.application-register-panel .application-ipo-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.application-register-panel .application-ipo-summary-card { min-width: 0; min-height: 90px; padding: 13px 14px; border-radius: 13px; }
.application-register-panel .application-ipo-summary-card strong { font-size: 14px; }
.application-register-panel .application-ipo-summary-card span,
.application-register-panel .application-ipo-summary-card button { font-size: 11px; }
.application-register-panel .application-old-ipo-section { gap: 9px; padding-top: 12px; border-top-color: #dce8f0; }

@media (max-width: 1100px) {
  .application-register-panel .application-register-wrap { overflow-x: auto; }
  .application-register-panel .applications-table,
  .application-register-panel .erp-shell .applications-table { min-width: 980px; }
}
.new-ledger-dialog {
  width: min(650px, calc(100vw - 28px));
}

/* Keep the decision layer compact and separate from the execution workflow. */
.command-center-panel { margin-bottom: 16px; }
.command-center-panel + .daily-workflow-panel,
.daily-workflow-panel { margin-top: 0; }
.daily-workflow-panel .workflow-steps { margin-top: 14px; }

.app-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  border: 1px solid #b9e3cf;
  border-radius: 12px;
  background: #effaf4;
  color: #176b43;
  box-shadow: 0 14px 34px rgba(20, 54, 83, 0.16);
  font-size: 14px;
  font-weight: 700;
}

.app-toast[hidden] { display: none; }
.app-toast.error { border-color: #f0c5c5; background: #fff5f5; color: #a52c2c; }

@media (max-width: 720px) {
  .app-toast { right: 14px; bottom: 14px; max-width: calc(100vw - 28px); }
}

/* Hosted accounts get a calm entry point without changing the application shell. */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(234, 242, 250, .96), rgba(245, 250, 247, .98));
}

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

.auth-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid #cfe0ef;
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 70px rgba(26, 66, 100, .18);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  color: #173b61;
  font-weight: 800;
}

.auth-card h1 { margin: 8px 0 10px; color: #14385d; font-size: clamp(30px, 5vw, 42px); }
.auth-copy, .auth-footnote { color: #6d849a; line-height: 1.55; }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form label { display: grid; gap: 7px; color: #466582; font-weight: 800; }
.auth-form input { width: 100%; box-sizing: border-box; }
.auth-error { margin: 0; color: #a52c2c; font-weight: 700; }
.text-btn { margin-top: 18px; padding: 0; border: 0; background: transparent; color: #1768b2; font-weight: 800; cursor: pointer; }
.auth-footnote { margin: 22px 0 0; font-size: 13px; }

.new-ledger-dialog .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.new-ledger-dialog .dialog-actions {
  grid-column: 1 / -1;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .new-ledger-dialog .form-grid {
    grid-template-columns: 1fr;
  }

  .new-ledger-dialog .dialog-actions {
    grid-column: auto;
  }
}
