.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: #0f273f;
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 6px 0;
  font-size: 13px;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

:root {
  --color-background: #eef4f8;
  --color-surface: #ffffff;
  --color-surface-alt: #f6f9fb;
  --color-surface-strong: #fdfbf5;
  --color-border: #d9e4ea;
  --color-border-strong: #b8c9d3;
  --color-text: #16242f;
  --color-muted: #657785;
  --color-nav: #122432;
  --color-nav-muted: #9fb1be;
  --color-primary: #1f8f76;
  --color-secondary: #123c69;
  --color-gold: #f1b434;
  --color-primary-soft: #e5f4ef;
  --color-success-bg: #e8f6ee;
  --color-success-text: #1d7b49;
  --color-warning-bg: #fff3dc;
  --color-warning-text: #8a5c00;
  --color-danger-bg: #ffe8e6;
  --color-danger-text: #b1312d;
  --color-neutral-bg: #eef3f8;
  --color-neutral-text: #50637a;
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --surface-alt: var(--color-surface-alt);
  --surface-strong: var(--color-surface-strong);
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --nav: var(--color-nav);
  --nav-muted: var(--color-nav-muted);
  --nav-active: var(--color-primary);
  --accent: var(--color-primary);
  --accent-2: var(--color-secondary);
  --accent-3: var(--color-gold);
  --accent-soft: var(--color-primary-soft);
  --success-bg: var(--color-success-bg);
  --success-text: var(--color-success-text);
  --warning-bg: var(--color-warning-bg);
  --warning-text: var(--color-warning-text);
  --danger-bg: var(--color-danger-bg);
  --danger-text: var(--color-danger-text);
  --neutral-bg: var(--color-neutral-bg);
  --neutral-text: var(--color-neutral-text);
  --shadow: 0 18px 48px rgba(18, 36, 50, 0.10);
  --shadow-soft: 0 8px 22px rgba(18, 36, 50, 0.07);
  --radius: 20px;
  --radius-sm: 12px;
  --density-page-x: 20px;
  --density-page-y: 12px;
  --density-card-pad: 14px;
  --density-panel-pad-x: 16px;
  --density-panel-pad-y: 12px;
  --density-tab-height: 34px;
  --density-control-height: 30px;
}

/* Proposal alignment base styles. The final cascade lock lives at EOF. */
body {
  background: #f4f7fb;
  color: #10233f;
}

#app {
  min-height: 100vh;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: #f4f7fb;
}

.sidebar {
  background: #ffffff;
  color: #10233f;
  border-right: 1px solid #d9e2ef;
  box-shadow: 8px 0 28px rgba(15, 35, 66, 0.06);
  padding: 18px 14px;
}

.brand {
  align-items: center;
  border-bottom: 1px solid #e4ebf5;
  color: #10233f;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 8px 16px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #0b66e4, #13a860);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand-title {
  color: #10233f;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-section-title {
  color: #8aa0bc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 16px 10px 8px;
  text-transform: uppercase;
}

.nav-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #42526e;
  display: flex;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
}

.nav-item:hover,
.nav-item.active {
  background: #eef6ff;
  border-color: #d2e6ff;
  color: #0b66e4;
}

.nav-icon {
  align-items: center;
  background: #edf3fb;
  border-radius: 7px;
  color: #0b66e4;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  min-width: 28px;
}

.content-area {
  min-width: 0;
  padding: 0 0 42px;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d9e2ef;
  box-shadow: 0 8px 24px rgba(15, 35, 66, 0.05);
  color: #10233f;
  display: flex;
  gap: 12px;
  min-height: 68px;
  padding: 12px 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.proposal-search {
  flex: 1 1 320px;
  max-width: 520px;
  min-width: 160px;
}

.proposal-search input,
.entity-select select,
.field input,
.field select,
.field textarea {
  background: #f8fafc;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  color: #10233f;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  color: #42526e;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  min-width: 36px;
  padding: 0 10px;
}

.user-chip {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  color: #10233f;
  display: flex;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
}

.avatar {
  align-items: center;
  background: #0b66e4;
  border-radius: 7px;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.module-tabs {
  background: #ffffff;
  border-bottom: 1px solid #d9e2ef;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 22px;
}

.module-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
}

.module-tab.active {
  background: #eef6ff;
  border-color: #d2e6ff;
  color: #0b66e4;
}

.page {
  padding: 22px;
}

.panel,
.card,
.stat-card {
  background: #ffffff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 35, 66, 0.06);
  color: #10233f;
}

.panel {
  padding: 18px;
}

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

.panel-title,
.card h3 {
  color: #10233f;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel-subtitle,
.muted,
.stat-note,
.stat-label {
  color: #64748b;
}

.proposal-page-title {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.proposal-page-title h1 {
  color: #10233f;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

.proposal-page-title p {
  color: #64748b;
  margin: 6px 0 0;
}

.proposal-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.proposal-kpi-grid.four {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.proposal-stat {
  display: grid;
  gap: 10px;
  grid-template-columns: 36px 1fr;
  min-height: 124px;
  padding: 14px;
  position: relative;
}

.stat-icon {
  align-items: center;
  background: #eef6ff;
  border-radius: 8px;
  color: #0b66e4;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.stat-value {
  color: #10233f;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.sparkline {
  grid-column: 1 / -1;
  height: 28px;
  overflow: visible;
  width: 100%;
}

.sparkline-line {
  fill: none;
  stroke-linecap: round;
  stroke-width: 2;
}

.proposal-dashboard-grid,
.proposal-finance-grid,
.inventory-proposal-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.proposal-dashboard-grid .wide,
.inventory-proposal-grid .wide {
  grid-column: span 2;
}

.proposal-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.proposal-action {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  color: #10233f;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  text-align: left;
}

.proposal-action span {
  align-items: center;
  background: #eef6ff;
  border-radius: 7px;
  color: #0b66e4;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  min-width: 28px;
}

.proposal-filter-bar {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
}

.table-wrap {
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  color: #10233f;
  width: 100%;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

th,
td {
  border-bottom: 1px solid #e7edf5;
  padding: 10px 12px;
}

.proposal-statusbar {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #d9e2ef;
  bottom: 0;
  color: #64748b;
  display: flex;
  gap: 14px;
  left: 248px;
  min-height: 38px;
  padding: 8px 22px;
  position: fixed;
  right: 0;
  z-index: 25;
}

.proposal-statusbar .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-statusbar .legend span {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.proposal-statusbar i {
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 72px 1fr;
  }

  .brand-title,
  .brand-subtitle,
  .sidebar-section-title {
    display: none;
  }

  .sidebar {
    padding: 14px 10px;
  }

  .proposal-statusbar {
    left: 72px;
  }

  .proposal-kpi-grid,
  .proposal-kpi-grid.four,
  .proposal-dashboard-grid,
  .proposal-finance-grid,
  .inventory-proposal-grid {
    grid-template-columns: 1fr 1fr;
  }

  .proposal-dashboard-grid .wide,
  .inventory-proposal-grid .wide {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    border-bottom: 1px solid #d9e2ef;
    border-right: 0;
    position: static;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .topbar,
  .proposal-page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    margin-left: 0;
  }

  .page {
    padding: 16px;
  }

  .proposal-kpi-grid,
  .proposal-kpi-grid.four,
  .proposal-dashboard-grid,
  .proposal-finance-grid,
  .inventory-proposal-grid,
  .proposal-dashboard-grid .wide,
  .inventory-proposal-grid .wide {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .proposal-statusbar {
    left: 0;
    position: static;
  }
}

/* Proposal-style Phase 1 presentation alignment */
:root {
  --color-background: #f5f8fc;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fbff;
  --color-border: #dfe7f1;
  --color-border-strong: #c8d5e4;
  --color-text: #071833;
  --color-muted: #61708a;
  --color-nav: #ffffff;
  --color-nav-muted: #65748b;
  --color-primary: #0b66e4;
  --color-secondary: #0f2747;
  --color-gold: #f97316;
  --color-primary-soft: #edf5ff;
  --shadow: 0 14px 34px rgba(15, 39, 71, 0.08);
  --shadow-soft: 0 8px 20px rgba(15, 39, 71, 0.06);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  letter-spacing: 0 !important;
}

body {
  background: var(--color-background);
  color: var(--color-text);
}

.shell {
  background: var(--color-background);
}

.sidebar {
  background: #ffffff;
  color: var(--color-text);
  border-right: 1px solid var(--color-border);
  box-shadow: 10px 0 30px rgba(15, 39, 71, 0.04);
}

.brand-title,
.brand-title.dark,
.footer-card-title {
  color: var(--color-text);
}

.brand-subtitle,
.brand-subtitle.dark {
  color: var(--color-muted);
}

.proposal-logo {
  background: linear-gradient(135deg, #2f80ed 0%, #11c5d8 100%);
  border-radius: 10px;
  color: #ffffff;
}

.nav-group-label {
  color: var(--color-muted);
}

.nav-item {
  color: #13233b;
  border-radius: 8px;
  min-height: 44px;
}

.nav-icon {
  background: transparent;
  color: #243b63;
}

.nav-item:hover,
.nav-item.active {
  background: #edf5ff;
  border-color: #dbeafe;
  box-shadow: none;
  color: #0b66e4;
  transform: none;
}

.nav-item.active .nav-icon {
  color: #0b66e4;
}

.sidebar-toggle {
  color: #61708a;
  background: transparent;
  border-color: transparent;
  justify-content: start;
}

.workspace {
  background: var(--color-background);
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
  min-height: 70px;
  margin: 0;
  border-radius: 0;
}

.topbar-left,
.topbar-actions,
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left strong {
  color: var(--color-text);
  font-size: 0.98rem;
}

.entity-select {
  max-width: 220px;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-weight: 700;
}

.search-input,
.select-control {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
  min-height: 38px;
}

.topbar .search-input {
  width: min(430px, 34vw);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #ffffff;
  color: #071833;
  font-weight: 800;
}

.user-chip span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #12bfd2;
  color: #ffffff;
  font-weight: 900;
}

.user-chip {
  display: grid;
  grid-template-columns: 42px auto;
  column-gap: 10px;
}

.user-chip strong,
.user-chip em {
  grid-column: 2;
  font-style: normal;
  line-height: 1.1;
}

.user-chip em {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.top-module-menu {
  margin: 14px var(--density-page-x) 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.top-menu-item {
  border-radius: 0;
}

.top-menu-item.active {
  color: #0b66e4;
  border-bottom: 2px solid #0b66e4;
  background: transparent;
}

.module-header-compact,
.launchpad-hero,
.panel,
.card,
.quick-action-card,
.workspace-action {
  border-radius: 8px;
  border-color: var(--color-border);
  box-shadow: var(--shadow-soft);
  background: #ffffff;
}

.module-header-compact {
  margin-top: 16px;
}

.proposal-page-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.proposal-page-title h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  color: var(--color-text);
}

.proposal-page-title p {
  margin: 0;
  color: var(--color-muted);
}

.proposal-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  border-radius: 8px;
  min-height: 38px;
}

.btn.primary {
  background: #0b66e4;
  border-color: #0b66e4;
}

.proposal-kpi-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.proposal-kpi-grid.four {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.proposal-stat {
  min-height: 128px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: start;
  position: relative;
  overflow: hidden;
}

.stat-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.tone-blue .stat-icon,
.entity-badge.tone-blue {
  background: #e8f1ff;
  color: #0b66e4;
}

.tone-teal .stat-icon,
.entity-badge.tone-teal {
  background: #e5fbfd;
  color: #0f766e;
}

.tone-green .stat-icon,
.entity-badge.tone-green {
  background: #e8f8ef;
  color: #15803d;
}

.tone-orange .stat-icon,
.entity-badge.tone-orange {
  background: #fff1e7;
  color: #c2410c;
}

.tone-purple .stat-icon,
.entity-badge.tone-purple {
  background: #f1ebff;
  color: #7738c4;
}

.stat-value {
  color: var(--color-text);
  font-size: 1.45rem;
}

.stat-note strong {
  color: #13a860;
}

.sparkline {
  grid-column: 1 / -1;
  width: 100%;
  height: 38px;
  margin-top: 2px;
}

.sparkline-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.proposal-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(320px, 1fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.proposal-lower-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.8fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.proposal-chart {
  min-height: 230px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border);
}

.proposal-trend-row {
  flex: 1;
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.proposal-bars {
  height: 122px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.bar {
  width: 10px;
  border-radius: 6px 6px 0 0;
  display: block;
}

.bar.revenue {
  background: #0b66e4;
}

.bar.expense {
  background: #12a9b2;
}

.proposal-chart-legend,
.proposal-total-line,
.statusbar-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.proposal-chart-legend {
  justify-content: start;
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.proposal-chart-legend i,
.business-unit i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-blue {
  background: #0b66e4;
}

.legend-teal {
  background: #12a9b2;
}

.entity-list,
.notification-list,
.adjustment-list {
  display: grid;
  gap: 14px;
}

.entity-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
}

.entity-badge {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.entity-track {
  height: 10px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.entity-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.entity-row em {
  display: grid;
  gap: 3px;
  text-align: right;
  font-style: normal;
  font-weight: 800;
}

.entity-row em span {
  color: #0b66e4;
  font-size: 0.78rem;
}

.notification-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
}

.notification-row > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.notification-row strong,
.notification-row small {
  display: block;
}

.notification-row small {
  color: var(--color-muted);
  margin-top: 4px;
}

.proposal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
}

.proposal-actions.wide {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.proposal-action {
  min-height: 72px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--color-text);
  font-weight: 800;
}

.proposal-action span {
  color: #0b66e4;
  font-weight: 900;
}

.proposal-action strong {
  font-size: 0.78rem;
}

.proposal-finance-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(280px, 0.75fr) minmax(260px, 0.7fr);
  gap: 16px;
}

.proposal-finance-grid .panel:first-child {
  grid-row: span 2;
}

.statement-mini {
  display: grid;
  gap: 12px;
}

.statement-mini div,
.adjustment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding: 8px 0;
}

.statement-mini span,
.adjustment-row span,
.adjustment-row em {
  color: var(--color-muted);
  font-style: normal;
}

.proposal-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  border-radius: 8px;
}

.inventory-proposal-grid {
  display: grid;
  grid-template-columns: minmax(540px, 1.35fr) minmax(310px, 0.65fr);
  gap: 16px;
}

.inventory-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

table {
  font-size: 0.86rem;
}

th {
  color: #243b63;
  background: #f7f9fc;
}

.proposal-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px var(--density-page-x);
  color: var(--color-muted);
  font-size: 0.86rem;
}

.proposal-statusbar > div {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.business-unit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #13a860;
}

@media (max-width: 1180px) {
  .proposal-kpi-grid,
  .proposal-kpi-grid.four {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .proposal-dashboard-grid,
  .proposal-lower-grid,
  .proposal-finance-grid,
  .inventory-proposal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .proposal-page-title,
  .proposal-statusbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar .search-input {
    width: 100%;
  }

  .proposal-kpi-grid,
  .proposal-kpi-grid.four,
  .proposal-filter-bar {
    grid-template-columns: 1fr;
  }

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

body[data-density="comfortable"] {
  --density-page-x: 28px;
  --density-page-y: 18px;
  --density-card-pad: 18px;
  --density-panel-pad-x: 22px;
  --density-panel-pad-y: 18px;
  --density-tab-height: 40px;
  --density-control-height: 34px;
}

body[data-density="dense"] {
  --density-page-x: 16px;
  --density-page-y: 8px;
  --density-card-pad: 10px;
  --density-panel-pad-x: 12px;
  --density-panel-pad-y: 10px;
  --density-tab-height: 30px;
  --density-control-height: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  overflow: auto;
  background:
    radial-gradient(circle at 16% 4%, rgba(31, 143, 118, 0.14), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(241, 180, 52, 0.16), transparent 28%),
    linear-gradient(135deg, #edf5f7 0%, #f8f6ee 48%, #edf4f8 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(18, 60, 105, 0.94), rgba(31, 143, 118, 0.86)),
    radial-gradient(circle at top right, rgba(241, 180, 52, 0.42), transparent 34%);
}

.auth-card {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-card h1 {
  margin: 20px 0 10px;
  font-size: 1.8rem;
}

.auth-note {
  color: var(--muted);
  margin-top: 0;
  line-height: 1.5;
}

.auth-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-all;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 58%, var(--accent-3) 100%);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(18, 60, 105, 0.24);
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.brand-title.dark,
.brand-subtitle.dark {
  color: var(--text);
}

.brand-subtitle {
  color: var(--nav-muted);
  font-size: 0.88rem;
}

.shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(18, 36, 50, 0.98) 0%, rgba(11, 22, 32, 0.98) 100%),
    radial-gradient(circle at 20% 0%, rgba(31, 143, 118, 0.35), transparent 32%);
  color: #ffffff;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 236px;
  height: 100vh;
  max-height: none;
  overflow: hidden;
  transition: width 180ms ease, padding 180ms ease;
  z-index: 20;
}

.sidebar.collapsed {
  width: 76px;
}

.sidebar-brand {
  padding: 6px 6px 10px;
}

.nav-group-label {
  color: var(--nav-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 8px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.nav-list::-webkit-scrollbar {
  width: 6px;
}

.nav-list::-webkit-scrollbar-track {
  background: transparent;
}

.nav-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: #ffffff;
  text-align: left;
  border-radius: 16px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(31, 143, 118, 0.95), rgba(18, 60, 105, 0.92));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
}

.nav-icon svg,
.top-menu-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-weight: 800;
}

.sidebar.collapsed {
  padding-inline: 14px;
  align-items: center;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
}

.sidebar.collapsed .sidebar-brand > div:not(.brand-mark),
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-footer {
  display: none;
}

.sidebar.collapsed .sidebar-toggle {
  width: 100%;
  font-size: 0;
}

.sidebar.collapsed .sidebar-toggle::after {
  content: ">>";
  font-size: 0.9rem;
}

.sidebar.collapsed .nav-list,
.sidebar.collapsed .nav-item {
  width: 100%;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 8px;
}

.sidebar-footer {
  margin-top: auto;
}

.card.dark-card,
.dark-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  color: #ffffff;
}

.footer-card-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.launchpad-hero,
.workspace-hero {
  background:
    linear-gradient(135deg, rgba(18, 60, 105, 0.96), rgba(31, 143, 118, 0.9)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.26), transparent 34%);
  color: #ffffff;
  border-radius: 22px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  box-shadow: 0 24px 60px rgba(12, 24, 35, 0.16);
  margin-bottom: 12px;
}

.launchpad-hero h2,
.workspace-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.42rem, 2.45vw, 2.1rem);
}

.launchpad-hero p,
.workspace-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.launchpad-hero-card {
  min-width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: var(--density-card-pad);
  display: grid;
  gap: 8px;
  align-content: center;
}

.launchpad-hero-card span,
.launchpad-hero-card em {
  color: rgba(255, 255, 255, 0.76);
  font-style: normal;
}

.launchpad-hero-card strong {
  font-size: 1.15rem;
}

.launchpad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.launchpad-tile,
.quick-action-card,
.workspace-action {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
  border-radius: 16px;
  padding: var(--density-card-pad);
  text-align: left;
  color: var(--text);
}

.launchpad-tile {
  min-height: 124px;
  display: grid;
  gap: 10px;
  align-content: start;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.launchpad-tile:hover,
.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 143, 118, 0.45);
  box-shadow: 0 18px 40px rgba(12, 24, 35, 0.12);
}

.launchpad-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(31, 143, 118, 0.11);
  color: var(--accent);
}

.launchpad-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.launchpad-tile span,
.quick-action-card span,
.workspace-action span {
  color: var(--muted);
  line-height: 1.45;
}

.launchpad-tile em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
  font-size: 0.82rem;
}

.quick-action-grid,
.workspace-actions {
  display: grid;
  gap: 12px;
}

.quick-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quick-action-card {
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.workspace-hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  padding: 20px;
}

.module-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: var(--density-page-y) var(--density-page-x) 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.90), rgba(246, 249, 251, 0.78)),
    radial-gradient(circle at 0% 0%, rgba(31, 143, 118, 0.12), transparent 22rem);
  box-shadow: var(--shadow-soft);
}

.module-header-compact h2 {
  margin: 0;
  font-size: clamp(1.02rem, 1.25vw, 1.24rem);
  letter-spacing: -0.03em;
}

.module-header-compact p {
  max-width: 760px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.module-header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.module-header-chips span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

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

.workspace-action {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  display: grid;
  gap: 6px;
}

.workspace-action span {
  color: rgba(255, 255, 255, 0.72);
}

.footer-card-line {
  color: #d8e5ed;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-all;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
  min-height: 100vh;
  margin-left: 0;
  transition: none;
}

.shell.collapsed .workspace {
  margin-left: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px var(--density-page-x);
  background: rgba(238, 244, 248, 0.90);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar > div:first-child {
  min-width: 190px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.08rem, 1.28vw, 1.36rem);
  letter-spacing: -0.04em;
}

.topbar-context {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.topbar-context span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  padding: 0 8px;
  font-size: 0.69rem;
  font-weight: 700;
}

.page-kicker {
  color: var(--muted);
  font-size: 0.64rem;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}

.search-input,
.select-control,
.field input,
.field select,
.field textarea,
.table-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  min-height: var(--density-control-height);
  padding: 0 10px;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-input:focus,
.select-control:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.table-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 143, 118, 0.13);
}

.search-input {
  width: 190px;
}

.topbar-actions .select-control {
  width: 165px;
}

.field textarea {
  min-height: 90px;
  padding: 12px 14px;
}

.table-input {
  min-height: 38px;
  padding: 0 12px;
}

.status-strip { display: none; }

.top-module-menu {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-width: 0 0 1px;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(246, 249, 251, 0.76)),
    radial-gradient(circle at 12% 0%, rgba(31, 143, 118, 0.12), transparent 28rem);
  box-shadow: 0 10px 26px rgba(18, 36, 50, 0.08);
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 12;
}

.top-module-title {
  display: none;
}

.top-module-items {
  min-width: 0;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0 20px;
}

.top-menu-item {
  min-height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
  font-size: 0.9rem;
}

.top-menu-item span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--accent);
  font-size: 0.66rem;
}

.top-menu-item:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.top-menu-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(18, 60, 105, 0.18);
}

.top-menu-item.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.template-customizer {
  align-items: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
  box-shadow: none;
}

.module-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 7px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.module-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: var(--density-tab-height);
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.module-tab:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.module-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(18, 60, 105, 0.18);
}

.view-root {
  overflow: visible;
  padding: var(--density-page-y) var(--density-page-x) 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stat-card {
  padding: 9px 11px;
  position: relative;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.stat-label {
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: clamp(0.96rem, 1.45vw, 1.22rem);
  font-weight: 800;
  margin-top: 5px;
  letter-spacing: -0.04em;
}

.stat-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
}

.content-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.form-and-table {
  align-items: start;
}

.panel {
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: var(--density-panel-pad-y) var(--density-panel-pad-x) 0;
}

.panel h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.panel-body {
  padding: var(--density-panel-pad-y) var(--density-panel-pad-x) var(--density-panel-pad-x);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
}

.compact-table {
  max-height: 260px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.94rem;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  background: #f3f7f8;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.table-wrap tbody tr:hover {
  background: rgba(31, 143, 118, 0.045);
}

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

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

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

.form-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spacious-form {
  gap: 18px;
}

.spacious-form .compact-table {
  max-height: none;
}

.settings-subform {
  margin: 16px 0;
}

.settings-table {
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-weight: 600;
  font-size: 0.92rem;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.layout-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.layout-switcher span {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.layout-pill {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.layout-pill.active,
.layout-pill:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.inline-actions.wrap,
.row-actions,
.pill-row {
  flex-wrap: wrap;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.row-actions-primary {
  margin-bottom: 4px;
}

.row-actions-more {
  position: relative;
}

.row-actions-more > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}

.row-actions-more > summary::-webkit-details-marker {
  display: none;
}

.row-actions-more .row-actions {
  background: #fff;
  border: 1px solid #aeb9c5;
  box-shadow: 0 7px 18px rgba(20, 35, 55, .16);
  flex-direction: column;
  align-items: stretch;
  min-width: 160px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 160;
}

.btn,
.mini-btn,
.toast-close {
  border: none;
  border-radius: 12px;
  min-height: 34px;
  padding: 0 12px;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:hover:not(:disabled),
.mini-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.mini-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.btn.primary,
.mini-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

.btn.secondary,
.mini-btn.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn.ghost,
.mini-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.subtle {
  min-height: 28px;
  padding: 0 9px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 600;
}

.btn.subtle:hover:not(:disabled) {
  color: var(--danger-text);
  background: var(--danger-bg);
  box-shadow: none;
}

.auto-refresh-note {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.btn:disabled,
.mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
}

.badge.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge.neutral {
  background: var(--neutral-bg);
  color: var(--neutral-text);
}

.detail-stack,
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.metric-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.metric-line span {
  color: var(--muted);
}

.list-item {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.list-note {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.chart-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.donut-layout {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: center;
}

.donut {
  width: 150px;
  height: 150px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: inherit;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.donut span {
  position: relative;
  z-index: 1;
  font-weight: 850;
  color: var(--text);
}

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

.legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.legend-row span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.legend-row strong {
  min-width: 0;
}

.legend-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.export-grid,
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr minmax(90px, auto);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.bar-fill.secondary {
  background: var(--success-text);
}

.doc-preview {
  display: flex;
  gap: 18px;
  align-items: center;
}

.statement-document {
  max-width: 980px;
  margin: 14px auto 0;
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 34px;
  box-shadow: var(--shadow-soft);
  color: #112439;
}

.statement-document h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.statement-document h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.statement-company {
  margin-top: 18px;
  font-size: 1.12rem;
  font-weight: 800;
}

.statement-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 28px;
}

.statement-period {
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}

.statement-section {
  margin-top: 24px;
}

.statement-section-title {
  margin-bottom: 12px;
  color: var(--accent-2);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
}

.statement-subtitle {
  margin: 16px 0 8px;
  font-weight: 900;
}

.statement-row,
.statement-total,
.statement-grand-total,
.statement-column-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 148px 148px;
  gap: 20px;
  align-items: baseline;
  padding: 4px 0;
}

.statement-row span:nth-child(n+2),
.statement-total span:nth-child(n+2),
.statement-grand-total span:nth-child(n+2),
.statement-column-head span:nth-child(n+2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.statement-column-head {
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.statement-column-head span:nth-child(n+2) {
  color: var(--text);
  font-weight: 900;
}

.statement-total {
  margin-top: 10px;
  padding-top: 10px;
  font-weight: 900;
  border-top: 1px solid var(--text);
}

.statement-grand-total {
  margin-top: 14px;
  padding-top: 12px;
  font-weight: 950;
  font-size: 1.08rem;
  border-top: 3px double var(--text);
}

.statement-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.statement-empty {
  color: var(--muted);
  font-style: italic;
}

.income-statement-doc {
  background: #ffffff;
  border-radius: 16px;
  border: 5px solid var(--accent-2);
  padding: 0;
  overflow: hidden;
}

.income-statement-doc .statement-title-band {
  background: var(--accent-2);
  color: #ffffff;
  text-align: center;
  padding: 26px 30px 22px;
}

.income-statement-doc h1 {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.income-statement-doc .statement-title-band h2 {
  margin-top: 8px;
  color: #ffffff;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
}

.income-statement-doc .statement-body {
  padding: 28px 32px 34px;
}

.statement-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.statement-table th,
.statement-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.statement-table th {
  background: var(--surface-alt);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.statement-table td:nth-child(n+4),
.statement-table th:nth-child(n+4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.device-compat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.device-compat-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-alt);
  display: grid;
  gap: 6px;
}

.device-compat-card strong {
  color: var(--accent-2);
}

.device-compat-card span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.template-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface-alt);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.template-card:hover,
.template-card.selected {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.template-card h3 {
  margin: 14px 0 8px;
}

.template-card p {
  color: var(--muted);
  line-height: 1.45;
}

.template-preview {
  min-height: 116px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: start;
}

.template-preview.large {
  min-height: 420px;
  grid-template-columns: 72px 1fr;
  align-content: start;
}

.template-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
}

.template-line {
  height: 10px;
  width: 72%;
  border-radius: 999px;
  background: var(--border);
  margin-bottom: 9px;
}

.template-line.wide {
  width: 92%;
  background: var(--accent);
}

.template-line.short {
  width: 48%;
}

.template-table-lines {
  grid-column: 1 / -1;
  height: 170px;
  border-radius: 14px;
  background: repeating-linear-gradient(
    to bottom,
    #f3f7f8 0,
    #f3f7f8 22px,
    #ffffff 22px,
    #ffffff 44px
  );
  border: 1px solid var(--border);
}

.live-doc-preview {
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid color-mix(in srgb, var(--doc-accent, var(--accent)) 34%, var(--border));
  border-radius: 24px;
  background: #ffffff;
  color: var(--text);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.live-doc-preview.modern-compact {
  padding: 22px;
  font-size: 0.94rem;
}

.live-doc-preview.service-letter {
  border-top: 8px solid var(--doc-accent, var(--accent));
}

.preview-stack {
  display: grid;
  gap: 18px;
}

.live-doc-header,
.live-doc-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.live-doc-header {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 2px solid color-mix(in srgb, var(--doc-accent, var(--accent)) 40%, var(--border));
}

.live-doc-header h3,
.live-doc-title-row h2 {
  margin: 0 0 8px;
}

.live-doc-logo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: contain;
}

.live-doc-status {
  border-radius: 999px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--doc-accent, var(--accent)) 12%, #ffffff);
  color: var(--doc-accent, var(--accent));
  font-weight: 800;
  white-space: nowrap;
}

.live-doc-customer {
  margin: 20px 0;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.live-doc-table {
  margin: 20px 0;
}

.live-doc-totals {
  width: min(320px, 100%);
  margin-left: auto;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 16px;
}

.live-doc-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}

.live-doc-totals .grand {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 1.08rem;
}

.live-doc-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

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

.signature {
  min-height: 58px;
  border-top: 1px solid color-mix(in srgb, var(--doc-accent, var(--accent)) 45%, var(--border));
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.builder-canvas {
  display: grid;
  grid-template-columns: minmax(190px, 260px) 1fr;
  gap: 16px;
}

.builder-palette {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.builder-chip {
  min-height: 40px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
}

.builder-chip.active {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.compact-filter {
  width: min(260px, 100%);
}

.builder-page {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 18px;
}

.builder-drop-zone {
  border: 1px dashed var(--accent);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
  background: var(--accent-soft);
  margin-bottom: 16px;
}

.preview-logo {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  object-fit: contain;
  border: 1px solid var(--border);
}

.logo-fallback {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.view-actions {
  margin-bottom: 16px;
}

.totals-card {
  margin-left: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  line-height: 1.6;
}

.toast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 28px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toast.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.toast.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.toast-close {
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}

@media (max-width: 1280px) {
  .sidebar {
    width: 220px;
  }

  .workspace {
    margin-left: 220px;
  }

  .sidebar.collapsed {
    width: 74px;
  }

  .shell.collapsed .workspace {
    margin-left: 74px;
  }

  .card-grid,
  .content-grid.two-col,
  .form-grid.two-col,
  .form-grid.three-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .shell {
    display: block;
  }

  .workspace,
  .shell.collapsed .workspace {
    margin-left: 0;
  }

  .sidebar {
    min-height: auto;
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .card-grid,
  .content-grid.two-col,
  .form-grid.two-col,
  .form-grid.three-col {
    grid-template-columns: 1fr;
  }

  .launchpad-hero,
  .workspace-hero {
    grid-template-columns: 1fr;
  }

  .launchpad-hero-card {
    min-width: 0;
  }

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

  .module-header-compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

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

@media (max-width: 760px) {
  html {
    scroll-padding-bottom: 110px;
  }

  .auth-shell {
    padding: 18px;
  }

  .auth-card {
    padding: 24px;
    border-radius: 24px;
  }

  .shell {
    display: block;
    padding-bottom: 104px;
  }

  .sidebar {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
    height: auto;
    bottom: 12px;
    top: auto;
    z-index: 30;
    padding: 10px;
    border-radius: 24px;
    max-height: none;
    box-shadow: 0 18px 44px rgba(12, 24, 35, 0.28);
  }

  .sidebar-brand,
  .sidebar-toggle,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 78px;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
    font-size: 0.72rem;
    text-align: center;
    justify-content: center;
  }

  .nav-item:hover {
    transform: none;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
    font-size: 0.68rem;
  }

  .topbar {
    padding: 8px 14px 7px;
    align-items: stretch;
    flex-direction: column;
    position: sticky;
    top: 0;
  }

  .top-module-menu {
    margin: 0;
    align-items: center;
    flex-direction: row;
  }

  .top-module-items {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    padding-inline: 8px;
  }

  .top-menu-item {
    flex: 0 0 auto;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions > * {
    flex: 1 1 100%;
  }

  .status-strip { display: none; }

  .status-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view-root {
    padding: 12px 14px;
  }

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

  .panel-header,
  .panel-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .module-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .module-tabs::-webkit-scrollbar {
    display: none;
  }

  .module-tab {
    flex: 0 0 auto;
  }

  .builder-canvas {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    border-radius: 14px;
  }

  .table-wrap table {
    min-width: 680px;
  }

  .metric-line {
    flex-direction: column;
    gap: 4px;
  }

  .donut-layout,
  .chart-row,
  .legend-row {
    grid-template-columns: 1fr;
  }

  .totals-card {
    width: 100%;
    margin-left: 0;
  }

  .doc-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .statement-document {
    padding: 22px;
    border-radius: 18px;
  }

  .income-statement-doc {
    padding: 0;
  }

  .statement-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .statement-period {
    text-align: left;
  }

  .statement-row,
  .statement-total,
  .statement-grand-total,
  .statement-column-head {
    grid-template-columns: 1fr 112px;
  }

  .statement-row span:nth-child(3),
  .statement-total span:nth-child(3),
  .statement-grand-total span:nth-child(3),
  .statement-column-head span:nth-child(3) {
    display: none;
  }
}

/* EOF proposal alignment overrides. */
body {
  background: #f4f7fb;
  color: #10233f;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #d9e2ef;
  box-shadow: 8px 0 28px rgba(15, 35, 66, 0.06);
  color: #10233f;
  padding: 18px 14px;
}

.brand {
  align-items: center;
  border-bottom: 1px solid #e4ebf5;
  color: #10233f;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 8px 16px;
}

.brand-mark,
.avatar {
  background: #0b66e4;
  border-radius: 8px;
  color: #ffffff;
}

.brand-title,
.panel-title,
.card h3,
.proposal-page-title h1,
.stat-value {
  color: #10233f;
  letter-spacing: 0;
}

.brand-subtitle,
.sidebar-section-title,
.panel-subtitle,
.muted,
.stat-note,
.stat-label {
  color: #64748b;
  letter-spacing: 0;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #42526e;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
}

.nav-item:hover,
.nav-item.active,
.module-tab.active {
  background: #eef6ff;
  border-color: #d2e6ff;
  color: #0b66e4;
}

.nav-icon,
.stat-icon,
.proposal-action span {
  background: #eef6ff;
  border-radius: 7px;
  color: #0b66e4;
  font-size: 11px;
  font-weight: 900;
}

.content-area {
  background: #f4f7fb;
  min-width: 0;
  padding-bottom: 42px;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #d9e2ef;
  box-shadow: 0 8px 24px rgba(15, 35, 66, 0.05);
  color: #10233f;
  gap: 12px;
  min-height: 68px;
  padding: 12px 22px;
}

.proposal-search {
  flex: 1 1 320px;
  max-width: 520px;
  min-width: 160px;
}

.proposal-search input,
.entity-select select,
.field input,
.field select,
.field textarea {
  background: #f8fafc;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  color: #10233f;
}

.icon-btn,
.user-chip,
.proposal-action,
.proposal-filter-bar {
  background: #f8fafc;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  color: #10233f;
}

.module-tabs {
  background: #ffffff;
  border-bottom: 1px solid #d9e2ef;
  gap: 6px;
  padding: 10px 22px;
}

.module-tab {
  border-radius: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.page {
  padding: 22px;
}

.panel,
.card,
.stat-card {
  background: #ffffff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 35, 66, 0.06);
  color: #10233f;
}

.panel {
  padding: 18px;
}

.proposal-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.proposal-kpi-grid.four {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.proposal-stat {
  display: grid;
  gap: 10px;
  grid-template-columns: 36px 1fr;
  min-height: 124px;
  padding: 14px;
}

.proposal-dashboard-grid,
.proposal-finance-grid,
.inventory-proposal-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.proposal-dashboard-grid .wide,
.inventory-proposal-grid .wide {
  grid-column: span 2;
}

.proposal-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.table-wrap {
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  overflow: auto;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

th,
td {
  border-bottom: 1px solid #e7edf5;
  padding: 10px 12px;
}

.proposal-statusbar {
  background: #ffffff;
  border-top: 1px solid #d9e2ef;
  bottom: 0;
  color: #64748b;
  display: flex;
  gap: 14px;
  left: 248px;
  min-height: 38px;
  padding: 8px 22px;
  position: fixed;
  right: 0;
  z-index: 25;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 72px 1fr;
  }

  .brand-title,
  .brand-subtitle,
  .sidebar-section-title {
    display: none;
  }

  .proposal-statusbar {
    left: 72px;
  }

  .proposal-kpi-grid,
  .proposal-kpi-grid.four,
  .proposal-dashboard-grid,
  .proposal-finance-grid,
  .inventory-proposal-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    border-bottom: 1px solid #d9e2ef;
    border-right: 0;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .topbar,
  .proposal-page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    margin-left: 0;
  }

  .proposal-kpi-grid,
  .proposal-kpi-grid.four,
  .proposal-dashboard-grid,
  .proposal-finance-grid,
  .inventory-proposal-grid {
    grid-template-columns: 1fr;
  }

  .proposal-dashboard-grid .wide,
  .inventory-proposal-grid .wide {
    grid-column: auto;
  }

  .proposal-statusbar {
    left: 0;
    position: static;
  }
}

/* --------------------------------------------------------------------------
   Mejrkh proposal-aligned Phase 1 interface
   -------------------------------------------------------------------------- */
:root {
  --proposal-navy: #101d2e;
  --proposal-navy-deep: #0b1726;
  --proposal-blue: #0f6fec;
  --proposal-red: #c81f37;
  --proposal-green: #1a7a52;
  --proposal-purple: #7738c4;
  --proposal-orange: #ef9b3b;
  --proposal-page: #f7f9fc;
  --proposal-border: #dfe5ee;
  --proposal-text: #152237;
  --proposal-muted: #6c7788;
}

* { box-sizing: border-box; }
body {
  background: var(--proposal-page);
  color: var(--proposal-text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}
.shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--proposal-page);
}
.sidebar {
  background: var(--proposal-navy);
  border: 0;
  box-shadow: none;
  color: #fff;
  min-height: 100vh;
  padding: 17px 12px 54px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex;
  justify-content: center;
  min-height: 138px;
  margin: -17px -12px 10px;
  padding: 10px 15px 13px;
}
.mejrkh-logo.sidebar-lockup {
  display: block;
  height: auto;
  max-width: 150px;
  width: 100%;
}
.nav-list { display: grid; gap: 2px; }
.nav-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #f2f6fb;
  display: grid;
  grid-template-columns: 26px minmax(0,1fr) auto;
  gap: 9px;
  min-height: 38px;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: var(--proposal-blue);
  border: 0;
  color: #fff;
  box-shadow: 0 5px 12px rgba(15,111,236,.28);
}
.nav-item.disabled {
  color: #9fabb9;
  cursor: not-allowed;
  opacity: .72;
}
.nav-icon {
  align-items: center;
  background: transparent;
  border-radius: 0;
  color: currentColor;
  display: inline-flex;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  width: 20px;
}
.nav-icon svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 18px; height: 18px; }
.nav-label { font-size: 12px; font-weight: 600; white-space: nowrap; }
.nav-phase {
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  color: #b9c5d3;
  font-size:11px;
  line-height: 1;
  padding: 4px 5px;
  white-space: nowrap;
}
.sidebar-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,.16);
  bottom: 10px;
  color: #bdc7d3;
  left: 12px;
  position: fixed;
  width: 190px;
}
.workspace { min-width: 0; padding-bottom: 36px; }
.proposal-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--proposal-border);
  box-shadow: none;
  display: flex;
  gap: 18px;
  min-height: 64px;
  padding: 9px 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.system-title {
  color: #26354b;
  flex: 0 1 auto;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.topbar-actions { align-items: center; display: flex; gap: 8px; margin-left: auto; min-width: 0; }
.global-search-wrap {
  align-items: center;
  border: 0;
  display: flex;
  min-width: 38px;
}
.global-search-wrap > span { color: #33445a; display: inline-flex; width: 22px; }
.global-search-wrap > span svg { fill: none; stroke: currentColor; stroke-width: 1.7; width: 17px; }
.global-search-wrap input {
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  max-width: 180px;
  padding: 6px 5px;
  width: 110px;
}
.global-search-wrap input:focus { border-bottom-color: var(--proposal-blue); outline: 0; width: 180px; }
.icon-button {
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #33445a;
  height: 34px;
  min-width: 34px;
  padding: 7px;
  position: relative;
}
.icon-button svg { fill: none; stroke: currentColor; stroke-width: 1.7; width: 18px; }
.icon-button:hover { background: #f0f4f9; }
.notification-count {
  align-items: center;
  background: var(--proposal-red);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size:11px;
  height: 16px;
  justify-content: center;
  position: absolute;
  right: 0;
  top: 1px;
  width: 16px;
}
.reporting-period {
  align-items: center;
  background: #fff;
  border: 1px solid var(--proposal-border);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 18px minmax(126px,1fr);
  padding: 4px 7px;
  position: relative;
}
.reporting-period > span { color: #5d6a7b; display: inline-flex; grid-row: span 2; }
.reporting-period > span svg { fill: none; stroke: currentColor; stroke-width: 1.7; width: 15px; }
.reporting-period select {
  appearance: none;
  background: transparent;
  border: 0;
  color: #27364b;
  font-size: 10px;
  font-weight: 700;
  height: 18px;
  max-width: 170px;
  padding: 0;
}
.reporting-period small { color: var(--muted); font-size:11px; line-height: 1.1; }
.user-chip {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: 32px auto;
  gap: 8px;
  min-width: 125px;
  padding: 0;
}
.user-chip .avatar {
  align-items: center;
  background: #e9eef6;
  border-radius: 50%;
  color: #2f4259;
  display: flex;
  font-size: 10px;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.user-chip div { display: grid; }
.user-chip strong { color: #26354b; font-size: 10px; }
.user-chip em { color: var(--muted); font-size:11px; font-style: normal; }
.btn.ghost.subtle { font-size:11px; padding: 5px; }
.view-root { padding: 14px 20px 22px; }
.proposal-module-header,
.proposal-page-title {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--proposal-border);
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 15px 20px 12px;
}
.proposal-module-header h2,
.proposal-page-title h2 { color: #1b2b42; font-size: 17px; margin: 0 0 3px; }
.proposal-module-header p,
.proposal-page-title p { color: var(--muted); font-size: 10px; margin: 0; }
.dashboard-title { background: transparent; border: 0; padding: 0 0 12px; }
.dashboard-title .btn,
.proposal-module-header .btn { background: #fff; border: 1px solid #8cb7ed; color: #1768c6; }
.dashboard-title .btn svg { fill: none; stroke: currentColor; stroke-width: 1.6; width: 14px; vertical-align: middle; }
.card,
.panel,
.stat-card {
  background: #fff;
  border: 1px solid var(--proposal-border);
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(27,43,66,.04);
}
.panel { padding: 0; }
.panel-header {
  align-items: flex-start;
  border-bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 13px 14px 6px;
}
.panel-header h2 { color: #1e2e46; font-size: 12px; font-weight: 750; margin: 0; }
.panel-subtitle { color: var(--muted); font-size:11px; margin-top: 3px; }
.panel-body { padding: 8px 14px 13px; }
.entity-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0,1fr));
  margin-bottom: 10px;
}
.entity-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--proposal-border);
  border-radius: 5px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 9px;
  min-height: 56px;
  padding: 9px 12px;
}
.entity-card > span {
  align-items: center;
  border-radius: 50%;
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.entity-card > span svg { fill: none; stroke: currentColor; stroke-width: 1.8; width: 18px; }
.entity-card strong { display: block; font-size: 10px; line-height: 1.15; }
.entity-card small { color: var(--muted); font-size:11px; }
.entity-card.tone-blue > span { background:#e7f0ff;color:var(--proposal-blue); }
.entity-card.tone-red > span { background:#ffe7ea;color:var(--proposal-red); }
.entity-card.tone-green > span { background:#e4f7ef;color:var(--proposal-green); }
.entity-card.tone-purple > span { background:#f2e9ff;color:var(--proposal-purple); }
.executive-kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4,minmax(0,1fr));
  margin-bottom: 9px;
}
.operational-kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3,minmax(0,1fr));
  margin-bottom: 11px;
}
.proposal-stat {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  gap: 9px;
  min-height: 76px;
  padding: 11px 12px;
  position: relative;
}
.proposal-stat .stat-icon {
  align-items: center;
  border-radius: 50%;
  display: flex;
  font-size:11px;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.proposal-stat .stat-label { color: #536174; font-size:11px; font-weight: 700; text-transform: none; }
.proposal-stat .stat-value { color: #123d83; font-size: 16px; font-weight: 800; line-height: 1.25; }
.proposal-stat .stat-note { color: var(--muted); font-size:11px; }
.proposal-stat .sparkline { display: none; }
.proposal-stat.tone-blue .stat-icon { background:#e7f0ff;color:var(--proposal-blue); }
.proposal-stat.tone-red .stat-icon { background:#ffe7ea;color:var(--proposal-red); }
.proposal-stat.tone-green .stat-icon { background:#e4f7ef;color:var(--proposal-green); }
.proposal-stat.tone-purple .stat-icon { background:#f2e9ff;color:var(--proposal-purple); }
.proposal-stat.tone-orange .stat-icon { background:#fff0df;color:var(--proposal-orange); }
.executive-chart-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.2fr .85fr 1.05fr;
  margin-bottom: 10px;
}
.executive-bottom-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.05fr .7fr 1fr;
}
.proposal-line-chart { display:block; height: 154px; width: 100%; }
.proposal-line-chart text { fill:#8190a2; font-size:11px; }
.chart-axis { stroke:#dfe5ed; stroke-width:1; }
.chart-line { fill:none; stroke-linecap:round; stroke-linejoin:round; stroke-width:2.5; }
.revenue-line { stroke:var(--proposal-blue); }
.expense-line { stroke:var(--proposal-red); stroke-dasharray:4 4; }
.revenue-dot { fill:var(--proposal-blue); }
.expense-dot { fill:var(--proposal-red); }
.proposal-chart-legend { align-items:center; color:#657286; display:flex; font-size:11px; gap:14px; margin-top:5px; }
.proposal-chart-legend i { display:inline-block;height:7px;margin-right:4px;width:13px; }
.legend-blue { background:var(--proposal-blue); }
.legend-teal { background:#70addf; }
.legend-red { background:var(--proposal-red); }
.legend-green { background:var(--proposal-green); }
.legend-grey { background:#cad3df; }
.proposal-donut-wrap { align-items:center; display:grid; grid-template-columns:118px minmax(0,1fr); gap:12px; min-height:150px; }
.proposal-donut {
  align-items:center;
  border-radius:50%;
  display:flex;
  height:112px;
  justify-content:center;
  margin:auto;
  position:relative;
  width:112px;
}
.proposal-donut::after { background:#fff;border-radius:50%;content:"";height:58px;position:absolute;width:58px; }
.proposal-donut span { color:#24354b;font-size:11px;font-weight:800;position:relative;text-align:center;z-index:1; }
.proposal-donut-legend { display:grid; gap:6px; }
.proposal-donut-legend > div { align-items:center; display:grid; grid-template-columns:7px minmax(0,1fr) auto; gap:5px; font-size:11px; }
.proposal-donut-legend i { border-radius:50%; height:7px; width:7px; }
.proposal-donut-legend strong { font-size:11px; }
.ageing-chart { align-items:end; display:grid; gap:8px; grid-template-columns:repeat(5,1fr); height:142px; padding-top:4px; }
.ageing-column { align-items:center; display:flex; flex-direction:column; height:100%; justify-content:flex-end; }
.ageing-column > span { color:var(--muted);font-size:10px;margin-top:5px;text-align:center; }
.ageing-bars { align-items:flex-end; display:flex; gap:3px; height:114px; }
.ageing-bars i { border-radius:2px 2px 0 0; display:block; min-height:4px; width:12px; }
.ageing-bars .receivable { background:var(--proposal-blue); }
.ageing-bars .payable { background:var(--proposal-red); }
.activity-list { display:grid; gap:4px; }
.activity-row { align-items:center; border-bottom:1px solid #edf1f5; display:grid; grid-template-columns:24px minmax(0,1fr) auto; gap:7px; padding:5px 0; }
.activity-row:last-child { border:0; }
.activity-icon { align-items:center;border-radius:50%;display:flex;font-size:10px;height:20px;justify-content:center;width:20px; }
.activity-icon.tone-green { background:#e4f7ef;color:var(--proposal-green); }
.activity-icon.tone-red { background:#ffe7ea;color:var(--proposal-red); }
.activity-icon.tone-purple { background:#f2e9ff;color:var(--proposal-purple); }
.activity-icon.tone-orange { background:#fff0df;color:var(--proposal-orange); }
.activity-icon.tone-blue { background:#e7f0ff;color:var(--proposal-blue); }
.activity-row strong { display:block;font-size:11px; }
.activity-row small { color:var(--muted);display:block;font-size:10px; }
.activity-row em { font-size:10px;font-style:normal; }
.panel-link { color:var(--proposal-blue);font-size:11px;margin-top:6px;text-align:right; }
.compliance-row { align-items:center;border-bottom:1px solid #edf1f5;display:flex;font-size:11px;justify-content:space-between;padding:7px 0; }
.compliance-row span { font-size:10px;font-weight:700; }
.compliance-row span.ok { color:var(--proposal-green); }
.compliance-row span.pending { color:var(--proposal-orange); }
.compliance-footer { color:var(--proposal-green);font-size:10px;margin-top:7px; }
.module-summary-grid { display:grid;gap:6px;grid-template-columns:repeat(2,minmax(0,1fr)); }
.module-summary-card { align-items:center;background:#fbfcfe;border:1px solid #e8edf4;border-radius:4px;display:grid;grid-template-columns:24px minmax(0,1fr);gap:6px;min-height:49px;padding:6px;position:relative; }
.module-summary-card > span { align-items:center;background:#e7f0ff;border-radius:4px;color:var(--proposal-blue);display:flex;height:24px;justify-content:center;width:24px; }
.module-summary-card svg { fill:none;stroke:currentColor;stroke-width:1.7;width:14px; }
.module-summary-card strong { display:block;font-size:11px; }
.module-summary-card small { color:var(--muted);display:block;font-size:10px;line-height:1.2; }
.module-summary-card em { color:#a27834;font-size:10px;font-style:normal;position:absolute;right:4px;top:3px; }
.module-summary-card.future { opacity:.72; }
.proposal-statusbar {
  align-items:center;
  background:#fff;
  border-top:1px solid var(--proposal-border);
  bottom:0;
  color: var(--muted);
  display:flex;
  font-size:11px;
  justify-content:space-between;
  left:214px;
  min-height:28px;
  padding:6px 20px;
  position:fixed;
  right:0;
  z-index:30;
}
.status-dot { background:#24b56f;border-radius:50%;display:inline-block;height:6px;margin-right:4px;width:6px; }

/* Financial management dashboard */
.finance-compliance-grid { display:grid;gap:9px;grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:9px; }
.compliance-card { align-items:flex-start;background:#fff;border:1px solid var(--proposal-border);border-radius:5px;display:grid;grid-template-columns:38px minmax(0,1fr);gap:8px;min-height:86px;padding:10px; }
.compliance-card > span { align-items:center;border-radius:50%;display:flex;font-size:11px;font-weight:800;height:34px;justify-content:center;width:34px; }
.compliance-card.tone-blue > span { background:#e7f0ff;color:var(--proposal-blue); }
.compliance-card.tone-purple > span { background:#f2e9ff;color:var(--proposal-purple); }
.compliance-card.tone-green > span { background:#e4f7ef;color:var(--proposal-green); }
.compliance-card.tone-orange > span { background:#fff0df;color:var(--proposal-orange); }
.compliance-card strong { display:block;font-size:11px;margin-bottom:3px; }
.compliance-card small { color:var(--muted);display:flex;font-size:10px;justify-content:space-between;line-height:1.55; }
.compliance-card small b { color:#42516a;font-weight:700; }
.finance-summary-grid { display:grid;gap:9px;grid-template-columns:.8fr 1fr .85fr 1.25fr;margin-bottom:9px; }
.finance-summary-list { display:grid;gap:5px; }
.finance-summary-list > div { align-items:center;display:flex;font-size:11px;justify-content:space-between; }
.finance-summary-list strong { font-size:11px; }
.finance-summary-list.compact { gap:3px; }
.positive { color:var(--proposal-green)!important; }
.negative { color:var(--proposal-red)!important; }
.budget-chart { align-items:end;display:grid;gap:8px;grid-template-columns:repeat(4,1fr);height:105px; }
.budget-group { align-items:center;display:flex;flex-direction:column;justify-content:flex-end;height:100%; }
.budget-bars { align-items:flex-end;display:flex;gap:3px;height:94px; }
.budget-bars i { border-radius:2px 2px 0 0;display:block;min-height:3px;width:12px; }
.budget-bars .budget { background:#cad3df; }
.budget-bars .actual { background:var(--proposal-blue); }
.budget-group span { color:var(--muted);font-size:10px;margin-top:4px;text-align:center; }
.finance-middle-grid { display:grid;gap:9px;grid-template-columns:1.25fr .62fr .95fr;margin-bottom:9px; }
.finance-bottom-grid { display:grid;gap:9px;grid-template-columns:.8fr 1.2fr; }
.bank-recon-list { display:grid;gap:7px; }
.bank-recon-list > div { align-items:center;border-bottom:1px solid #edf1f5;display:flex;font-size:11px;justify-content:space-between;padding-bottom:4px; }
.module-tabs { background:#fff;border-bottom:1px solid var(--proposal-border);gap:4px;padding:7px 20px; }
.module-tab { border-radius:3px;font-size:11px;padding:6px 8px; }
.module-tab.active { background:var(--proposal-blue);border-color:var(--proposal-blue);color:#fff; }
.table-wrap { border:0;border-radius:0; }
th { background:#f7f9fc;color:#68768a;font-size:10px;letter-spacing:0;text-transform:none; }
th,td { border-bottom:1px solid #edf1f5;font-size:10px;padding:6px 7px; }

/* Authentication branding */
.auth-shell { background:linear-gradient(135deg,var(--proposal-navy-deep),#1a2d45); }
.auth-card { border-radius:6px; }
.auth-card .brand-mark { display:none; }
.auth-card .brand-row::before { background:url('mejrkh-logo-transparent.png') center/contain no-repeat;content:"";height:112px;width:150px; }
.auth-card .brand-title { color:#1b2b42!important; }

@media (max-width: 1220px) {
  .shell { grid-template-columns: 190px minmax(0,1fr); }
  .sidebar { padding-left:8px;padding-right:8px; }
  .sidebar-toggle { left:8px;width:174px; }
  .proposal-statusbar { left:190px; }
  .system-title { display:none; }
  .entity-card-grid,.executive-kpi-grid,.finance-compliance-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .executive-chart-grid,.executive-bottom-grid,.finance-summary-grid,.finance-middle-grid,.finance-bottom-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { display:block; }
  .sidebar { height:auto;min-height:0;position:static; }
  .sidebar-brand { min-height:96px; }
  .mejrkh-logo.sidebar-lockup { max-width:120px; }
  .nav-list { display:flex;overflow-x:auto; }
  .nav-item { flex:0 0 auto;min-width:140px; }
  .sidebar-toggle { display:none; }
  .proposal-topbar { align-items:flex-start;flex-direction:column;position:static; }
  .topbar-actions { flex-wrap:wrap;margin:0;width:100%; }
  .reporting-period { flex:1; }
  .entity-card-grid,.executive-kpi-grid,.operational-kpi-grid,.executive-chart-grid,.executive-bottom-grid,.finance-compliance-grid,.finance-summary-grid,.finance-middle-grid,.finance-bottom-grid { grid-template-columns:1fr; }
  .proposal-statusbar { left:0;position:static; }
  .view-root { padding:12px; }
}

/* Phase 1 Accountant responsive, state and print hardening */
.accountant-context-sticky {
  position: sticky;
  top: 58px;
  z-index: 18;
  background: var(--app-bg, #f4f7fb);
  padding-top: 2px;
}
.accountant-context-sticky .panel { box-shadow: 0 4px 14px rgba(20,38,63,.05); }
.accountant-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: #657286;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dfe6ef;
  border-top-color: #2f6fca;
  border-radius: 50%;
  animation: accountant-spin .8s linear infinite;
}
@keyframes accountant-spin { to { transform: rotate(360deg); } }
.loading-inline { position: sticky; top: 60px; z-index: 17; }
.error-state p { margin: 6px 0 10px; white-space: normal; }
.table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { min-width: 100%; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; }
.table-wrap tr { break-inside: avoid; }
.view-actions { row-gap: 6px; }

@media (max-width: 980px) {
  .accountant-context-sticky { top: 0; position: relative; }
  .accountant-context-sticky .form-grid.four-col,
  .accountant-context-sticky .content-grid.three-col { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .view-actions { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .view-actions .layout-pill { flex: 0 0 auto; }
  .table-wrap table { min-width: 760px; }
}

@media (max-width: 640px) {
  .accountant-context-sticky .form-grid.four-col,
  .accountant-context-sticky .content-grid.three-col,
  .form-grid.four-col,
  .form-grid.three-col,
  .form-grid.two-col { grid-template-columns: 1fr; }
  .table-wrap table { min-width: 680px; }
  .panel { padding: 10px; }
  .inline-actions.wrap { gap: 5px; }
}

@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #111 !important; font-size: 10pt; }
  .sidebar,
  .sidebar-toggle,
  .proposal-topbar,
  .proposal-statusbar,
  .module-tabs,
  .toast,
  .btn,
  button,
  input[type="file"],
  .view-actions,
  form:not(.print-include),
  .loading-inline,
  .error-state .btn { display: none !important; }
  .shell,
  .app-shell,
  .main,
  .main-content,
  .view-root { display: block !important; margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: none !important; }
  .accountant-context-sticky { position: static !important; background: #fff !important; padding: 0 !important; }
  .accountant-context-sticky .panel { box-shadow: none !important; border: 1px solid #bbb !important; }
  .panel { break-inside: avoid-page; box-shadow: none !important; }
  .table-wrap { overflow: visible !important; border: 0 !important; }
  .table-wrap table { min-width: 0 !important; width: 100% !important; border-collapse: collapse !important; font-size: 8pt !important; }
  .table-wrap thead { display: table-header-group; }
  .table-wrap thead th { position: static !important; background: #eee !important; color: #111 !important; }
  .table-wrap th,.table-wrap td { padding: 4px !important; border: 1px solid #ccc !important; }
  .metric-card { border: 1px solid #bbb !important; break-inside: avoid; }
  a { color: #111 !important; text-decoration: none !important; }
}

/* v0.11.12 canonical application shell and readable ERP density */
.workspace { margin-left:0 !important; min-width:0; }
.shell.collapsed .workspace { margin-left:0 !important; }
.sidebar { background:var(--company-sidebar-bg,var(--proposal-navy)); color:var(--company-sidebar-fg,#eef5fb); }
.sidebar .nav-item { color:var(--company-sidebar-fg,#eef5fb); }
.sidebar .nav-item:hover,.sidebar .nav-item.active { background:color-mix(in srgb,var(--proposal-blue) 20%,transparent); border-color:color-mix(in srgb,var(--proposal-blue) 42%,transparent); color:#fff; }
.sidebar-logo-fallback { align-items:center;display:flex;justify-content:center;min-height:54px;color:var(--company-sidebar-fg,#fff);font-size:20px;font-weight:800;letter-spacing:.06em; }
.sidebar-logo img,.sidebar-brand img { max-height:62px;max-width:160px;object-fit:contain; }
.proposal-statusbar { left:214px; }
th,td { font-size:11px; line-height:1.35; padding:8px 9px; }
th { font-size:10.5px; }
.activity-row strong,.activity-row small,.activity-row em,.compliance-row,.compliance-row span,.compliance-footer,.finance-summary-list>div,.finance-summary-list strong,.bank-recon-list>div { font-size:10.5px; }
.activity-icon { font-size:10px; }
.module-summary-card strong { font-size:11px; }
.module-summary-card small,.module-summary-card em,.budget-group span { font-size:10px; }
.compliance-card strong { font-size:11px; }
.compliance-card small { font-size:10.5px; }
.ageing-column>span,.proposal-chart-legend,.proposal-donut-legend>div,.proposal-donut-legend strong,.panel-link { font-size:10px; }
.module-tab { font-size:11px; }
.context-strip,.financial-context { display:flex;flex-wrap:wrap;gap:7px;align-items:center; }
.context-chip { display:inline-flex;align-items:center;border:1px solid var(--proposal-border);border-radius:999px;background:#fff;padding:4px 8px;font-size:10.5px;line-height:1.2; }
.help-toolbar { display:flex;gap:8px;align-items:center;margin-bottom:12px; }
.help-toolbar input { min-width:280px; }
.help-topic-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
.help-topic { background:#fff;border:1px solid var(--proposal-border);border-radius:6px;padding:12px; }
.help-topic h4 { margin:0 0 5px;font-size:13px; }
.help-topic p { margin:0;color:#5f6d7d;font-size:11px;line-height:1.5; }
.support-layout { display:grid;grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);gap:12px;align-items:start; }
.support-thread { display:grid;gap:8px;max-height:420px;overflow:auto;padding-right:4px; }
.support-message { border:1px solid var(--proposal-border);border-radius:6px;padding:9px;background:#fbfcfe; }
.support-message header { display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#657286;margin-bottom:4px; }
.support-message p { margin:0;white-space:pre-wrap;font-size:11px;line-height:1.45; }
.link-button { border:0;background:none;color:var(--proposal-blue);padding:0;cursor:pointer;text-align:left;font:inherit; }
@media(max-width:1220px){.proposal-statusbar{left:190px}.support-layout,.help-topic-grid{grid-template-columns:1fr}}
@media(max-width:820px){.proposal-statusbar{left:0}.help-toolbar{align-items:stretch;flex-direction:column}.help-toolbar input{min-width:0;width:100%}}

.environment-banner{position:fixed;top:0;left:0;right:0;z-index:2000;background:#7b1e1e;color:#fff;text-align:center;font-weight:700;font-size:12px;letter-spacing:.08em;padding:5px 10px}.environment-banner + .shell{padding-top:28px}

/* v0.11.16 canonical QuickBooks Desktop-inspired client shell */
:root {
  --qb-menu-h: 40px;
  --qb-sidebar-w: 205px;
  --qb-utility-h: 46px;
  --qb-border: #b8c2ce;
  --qb-soft-border: #d6dde5;
  --qb-surface: #ffffff;
  --qb-workspace: #f3f6fa;
  --qb-text: #17263a;
  --qb-muted: #66758a;
  --qb-font: "Segoe UI", Arial, Helvetica, sans-serif;
}
html, body { min-height:100%; }
body { margin:0; background:var(--qb-workspace); color:var(--qb-text); font-family:var(--qb-font); font-size:13px; line-height:1.35; }
body, button, input, select, textarea { font-family:var(--qb-font); }
.desktop-erp-shell { min-height:100vh; background:var(--qb-workspace); }
.desktop-masterbar {
  align-items:stretch;
  background:linear-gradient(#fdfefe,#e7edf3);
  border-bottom:1px solid #9eabb9;
  box-shadow:0 1px 2px rgba(20,35,55,.12);
  display:flex;
  height:var(--qb-menu-h);
  left:0;
  position:sticky;
  right:0;
  top:0;
  z-index:120;
}
.environment-banner + .desktop-erp-shell .desktop-masterbar { top:28px; }
.master-product {
  align-items:center;
  background:#eef3f7;
  border-right:1px solid #aeb9c5;
  color:#17324c;
  display:flex;
  flex:0 0 96px;
  font-size:13px;
  font-weight:800;
  justify-content:center;
  padding:0 10px;
  white-space:nowrap;
}
.top-module-menu { align-items:stretch; display:flex; flex:1 1 auto; justify-content:center; min-width:0; overflow-x:auto; }
.top-menu-item {
  background:transparent;
  border:0;
  border-right:1px solid transparent;
  color:#24354a;
  cursor:pointer;
  flex:0 0 auto;
  font-size:12.5px;
  font-weight:500;
  height:39px;
  padding:0 12px;
  white-space:nowrap;
}
.top-menu-item:hover { background:#dfe7ef; }
.top-menu-item.active { background:var(--color-primary,#2457c5); box-shadow:none; color:#fff; font-weight:700; }
.master-company {
  align-items:center;
  color:#44566d;
  display:flex;
  flex:0 1 270px;
  font-size:12px;
  font-weight:700;
  justify-content:flex-end;
  min-width:140px;
  overflow:hidden;
  padding:0 12px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.desktop-body { display:grid; grid-template-columns:var(--qb-sidebar-w) minmax(0,1fr); min-height:calc(100vh - var(--qb-menu-h)); }
.desktop-erp-shell.collapsed .desktop-body { grid-template-columns:54px minmax(0,1fr); }
.desktop-erp-shell .sidebar {
  background:var(--company-sidebar-bg,#101d2e);
  border-right:1px solid rgba(0,0,0,.28);
  color:var(--company-sidebar-fg,#eef5fb);
  display:flex;
  flex-direction:column;
  height:auto;
  min-height:calc(100vh - var(--qb-menu-h));
  padding:0;
  position:relative;
  top:auto;
  width:auto;
  z-index:40;
}
.sidebar-company {
  align-items:center;
  border-bottom:1px solid rgba(255,255,255,.12);
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:7px;
  min-height:61px;
  padding:7px 8px;
}
.sidebar-company-logo { align-items:center; display:flex; height:44px; justify-content:center; overflow:hidden; width:44px; }
.sidebar-company-logo img { max-height:42px; max-width:42px; object-fit:contain; }
.sidebar-logo-fallback { font-size:13px; min-height:42px; width:42px; }
.sidebar-company-copy { min-width:0; }
.sidebar-company-copy strong { color:var(--company-sidebar-fg,#fff); display:block; font-size:12.5px; font-weight:800; line-height:1.2; overflow:hidden; text-overflow:ellipsis; }
.sidebar-company-copy span { color:color-mix(in srgb,var(--company-sidebar-fg,#fff) 72%,transparent); display:block; font-size:11.5px; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-list { display:block; flex:1 1 auto; overflow-y:auto; padding:8px 7px 50px; }
.sidebar-section-label {
  color:color-mix(in srgb,var(--company-sidebar-fg,#fff) 58%,transparent);
  font-size:10px;
  font-weight:800;
  letter-spacing:.045em;
  padding:10px 8px 6px;
  text-transform:uppercase;
}
.sidebar-section-label.admin-label { border-top:1px solid rgba(255,255,255,.12); margin-top:10px; padding-top:12px; }
.desktop-erp-shell .nav-item {
  align-items:center;
  background:transparent;
  border:1px solid transparent;
  border-radius:3px;
  color:var(--company-sidebar-fg,#eef5fb);
  cursor:pointer;
  display:grid;
  font-size:12px;
  font-weight:600;
  gap:8px;
  grid-template-columns:19px minmax(0,1fr);
  height:36px;
  margin:1px 0;
  min-height:36px;
  padding:0 8px;
  text-align:left;
  width:100%;
}
.desktop-erp-shell .nav-item:hover { background:rgba(255,255,255,.08); }
.desktop-erp-shell .nav-item.active {
  background:var(--color-primary,#1473e6);
  border-color:color-mix(in srgb,var(--color-primary,#1473e6) 78%,white);
  box-shadow:0 2px 7px rgba(0,0,0,.18);
  color:#fff;
}
.desktop-erp-shell .nav-icon { align-items:center; display:flex; height:18px; justify-content:center; width:18px; }
.desktop-erp-shell .nav-icon svg { fill:none; height:16px; stroke:currentColor; stroke-width:1.7; width:16px; }
.desktop-erp-shell .nav-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-toggle {
  align-items:center;
  background:rgba(0,0,0,.16);
  border:1px solid rgba(255,255,255,.18);
  border-radius:50%;
  bottom:10px;
  color:#fff;
  display:flex;
  font-size:20px;
  height:30px;
  justify-content:center;
  left:auto;
  padding:0;
  position:absolute;
  right:9px;
  width:30px;
}
.desktop-erp-shell.collapsed .sidebar-company { display:block; padding:8px 5px; }
.desktop-erp-shell.collapsed .sidebar-company-copy,
.desktop-erp-shell.collapsed .sidebar-section-label,
.desktop-erp-shell.collapsed .nav-label { display:none; }
.desktop-erp-shell.collapsed .sidebar-company-logo { margin:auto; }
.desktop-erp-shell.collapsed .nav-list { padding:8px 6px 48px; }
.desktop-erp-shell.collapsed .nav-item { grid-template-columns:1fr; justify-items:center; padding:0; }
.desktop-erp-shell.collapsed .sidebar-toggle { right:11px; }
.desktop-erp-shell .workspace { display:flex; flex-direction:column; margin:0!important; min-width:0; padding:0; }
.desktop-utilitybar {
  align-items:center;
  background:linear-gradient(#f7f9fb,#e5eaf0);
  border-bottom:1px solid var(--qb-border);
  display:grid;
  gap:10px;
  grid-template-columns:minmax(180px,1fr) auto auto;
  min-height:var(--qb-utility-h);
  padding:4px 8px 4px 14px;
  position:sticky;
  top:var(--qb-menu-h);
  z-index:90;
}
.environment-banner + .desktop-erp-shell .desktop-utilitybar { top:calc(var(--qb-menu-h) + 28px); }
.desktop-utilitybar .global-search-wrap { align-items:center; display:flex; gap:6px; max-width:330px; }
.desktop-utilitybar .global-search-wrap svg { height:14px; width:14px; }
.desktop-utilitybar .search-input { background:transparent; border:0; border-bottom:1px solid transparent; font-size:12px; height:30px; min-width:0; outline:none; padding:4px 5px; width:100%; }
.desktop-utilitybar .search-input:focus { background:#fff; border-color:#8ba5be; }
.utility-context { align-items:center; display:flex; gap:6px; }
.context-select { align-items:center; display:flex; gap:5px; margin:0; }
.context-select > span { color:var(--muted); font-size:10.5px; font-weight:700; }
.context-select .select-control { background:#fff; border:1px solid #aeb9c5; border-radius:3px; color:#24354a; font-size:11.5px; height:30px; max-width:190px; padding:3px 24px 3px 7px; }
.period-chip { color: var(--muted); font-size:10.5px; white-space:nowrap; }
.utility-actions { align-items:center; display:flex; gap:5px; justify-content:flex-end; }
.desktop-utilitybar .icon-button { background:transparent; border:1px solid #b5bfca; border-radius:0; height:35px; min-width:36px; padding:6px; }
.desktop-utilitybar .user-chip { border-left:1px solid #b7c1cc; gap:6px; margin-left:3px; padding-left:8px; }
.desktop-utilitybar .user-chip strong { font-size:11.5px; line-height:1.2; }
.desktop-utilitybar .user-chip em { color:var(--muted); font-size:10px; }
.desktop-utilitybar .avatar { height:25px; width:25px; font-size:9.5px; }
.desktop-utilitybar .btn.subtle { border-radius:0; font-size:11.5px; height:35px; padding:0 10px; }
.proposal-statusbar { background:#fff; border-top:1px solid var(--qb-soft-border); bottom:auto; font-size:10px; left:auto; min-height:25px; padding:4px 12px; position:static; right:auto; }
.view-root { padding:12px 14px 34px; }
.module-header-compact.proposal-module-header {
  align-items:center;
  background:#f7f9fc;
  border-bottom:1px solid var(--qb-soft-border);
  display:flex;
  justify-content:space-between;
  margin:0;
  min-height:50px;
  padding:7px 14px;
}
.module-header-compact h2 { color:#1b2e43; font-size:18px; margin:0; }
.module-header-compact p { color:var(--muted); font-size:11.5px; margin:2px 0 0; }
.module-header-compact .btn { font-size:11.5px; min-height:30px; padding:5px 9px; }
.qb-dashboard-heading { align-items:start; display:flex; justify-content:space-between; margin:0 0 10px; }
.qb-dashboard-heading h1 { color:#18314d; font-size:20px; line-height:1.2; margin:0; }
.qb-dashboard-heading p { color:var(--muted); font-size:12px; margin:3px 0 0; }
.context-view-pill { background:#f7f9fb; border:1px solid #c9d1db; border-radius:16px; color:#44566b; cursor:pointer; font-size:11px; font-weight:700; padding:7px 12px; }
.qb-kpi-grid { display:grid; gap:10px; grid-template-columns:repeat(4,minmax(0,1fr)); margin-bottom:12px; }
.qb-kpi-grid .stat-card { border:1px solid #d5dce4; border-radius:3px; box-shadow:0 1px 3px rgba(24,48,76,.09); min-height:91px; padding:10px 11px; position:relative; }
.qb-kpi-grid .stat-card::before { background:var(--color-primary,#2457c5); content:""; height:3px; left:0; position:absolute; right:0; top:0; }
.qb-kpi-grid .stat-icon { height:31px; width:31px; font-size:10px; }
.qb-kpi-grid .stat-label { font-size:11px; }
.qb-kpi-grid .stat-value { font-size:20px; line-height:1.1; margin:2px 0; }
.qb-kpi-grid .stat-note { color: var(--muted); font-size:10.5px; }
.qb-action-grid { display:grid; gap:12px; grid-template-columns:repeat(5,minmax(0,1fr)); margin:0 0 12px; }
.qb-action-grid .proposal-action { align-items:center; background:#fff; border:1px solid #d2d9e1; border-radius:10px; box-shadow:none; color:#1d3048; display:flex; gap:10px; justify-content:flex-start; min-height:78px; padding:13px; text-align:left; }
.qb-action-grid .proposal-action:hover { border-color:var(--color-primary,#2457c5); background:#f8fbff; }
.qb-action-grid .proposal-action > span { align-items:center; background:#eef3f8; border-radius:5px; display:flex; font-size:20px; height:36px; justify-content:center; width:36px; }
.qb-action-grid .proposal-action strong { font-size:12.5px; }
.qb-dashboard-grid { display:grid; gap:10px; grid-template-columns:minmax(0,1fr) minmax(320px,.78fr); margin-bottom:10px; }
.panel { border:1px solid #c7d0db; border-radius:0; box-shadow:none; padding:0; }
.panel > .panel-header, .panel-header { background:linear-gradient(#f7f9fb,#e5eaf0); border-bottom:1px solid #b8c3cf; min-height:33px; padding:7px 9px; }
.panel h3, .panel-title { font-size:12px; }
.panel-body { padding:10px; }
.qb-dashboard-grid .panel { min-height:240px; }
.qb-position-list { display:grid; }
.qb-position-list > div { align-items:center; border-bottom:1px solid #e0e5eb; display:flex; font-size:11.5px; justify-content:space-between; min-height:44px; padding:0 8px; }
.qb-position-list strong { color:#142a43; font-size:11.5px; }
.qb-legend { color: var(--muted); font-size:10px; }
.qb-legend i { border-radius:2px; display:inline-block; height:6px; margin:0 3px 0 8px; width:11px; }
.module-tabs { background:#edf2f7; border-bottom:1px solid #c3ccd6; gap:2px; overflow-x:auto; padding:5px 8px; }
.module-tab { background:#f9fbfd; border:1px solid #bdc7d2; border-radius:2px; color:#31465f; font-size:11.5px; min-height:30px; padding:5px 9px; }
.module-tab.active { background:var(--color-primary,#2457c5); color:#fff; }
.table-wrap { border:1px solid #d3dae2; background:#fff; }
table { border-collapse:collapse; width:100%; }
th { background:#e9eef4; color:#31445b; font-size:11.5px; font-weight:700; }
th, td { border-bottom:1px solid #dde3ea; font-size:12px; line-height:1.35; padding:7px 8px; }
tbody tr:hover { background:#f5f9fd; }
.field > span, label.field > span { color:#42546a; font-size:11.5px; font-weight:700; }
.field input, .field select, .field textarea, input, select, textarea { font-size:12px; }
.btn { border-radius:3px; font-size:11.5px; min-height:31px; padding:6px 10px; }
.content-grid { gap:10px; }
.card-grid { gap:10px; }
.workspace-error { background:#fff; border:1px solid #d5dce5; margin:18px; max-width:720px; padding:20px; }
.workspace-error h2 { font-size:18px; margin:0 0 8px; }
.workspace-error p { color:#5d6c7d; font-size:12px; }

@media (max-width: 1120px) {
  :root { --qb-sidebar-w:190px; }
  .master-company { display:none; }
  .desktop-utilitybar { grid-template-columns:minmax(160px,1fr) auto; }
  .utility-actions { grid-column:1/-1; justify-content:flex-end; }
  .qb-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .qb-action-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .desktop-masterbar { position:relative; flex-wrap:wrap; height:auto; min-height:var(--qb-menu-h); }
  .master-product { flex-basis:86px; }
  .top-module-menu { flex-basis:100%; justify-content:flex-start!important; overflow-x:auto; }
  .desktop-body, .desktop-erp-shell.collapsed .desktop-body { display:block; }
  .desktop-erp-shell .sidebar { min-height:0; position:relative; }
  .sidebar-company { min-height:55px; }
  .nav-list { display:flex; gap:4px; overflow-x:auto; padding:6px; }
  .sidebar-section-label, .sidebar-toggle { display:none!important; }
  .desktop-erp-shell .nav-item { flex:0 0 auto; min-width:135px; width:auto; }
  .desktop-utilitybar { grid-template-columns:1fr; position:relative; top:auto; }
  .utility-context, .utility-actions { flex-wrap:wrap; justify-content:flex-start; }
  .qb-kpi-grid, .qb-action-grid, .qb-dashboard-grid { grid-template-columns:1fr; }
  .view-root { padding:10px; }
}
@media print {
  .desktop-masterbar, .desktop-utilitybar, .sidebar { display:none!important; }
  .desktop-body { display:block!important; }
}

/* v0.11.16 runtime/UI remediation — QuickBooks Desktop-inspired navigation polish */
.top-module-menu { overflow:visible; }

.module-tabs { display:none!important; }
.module-section-menu { background:#edf2f7; border:1px solid #c3ccd6; margin:0 0 10px; max-width:330px; position:relative; }
.module-section-menu > summary { cursor:pointer; font-size:12px; list-style:none; padding:7px 10px; }
.module-section-menu > summary::-webkit-details-marker { display:none; }
.module-section-menu > summary span { float:right; }
.module-section-options { background:#fff; border:1px solid #aeb9c5; box-shadow:0 7px 18px rgba(20,35,55,.16); display:grid; left:-1px; min-width:330px; padding:4px; position:absolute; top:100%; z-index:160; }
.module-section-menu:not([open]) .module-section-options { display:none; }
.module-section-options .module-tab { border:0; background:#fff; text-align:left; width:100%; }
.module-section-options .module-tab:hover,.module-section-options .module-tab.active { background:#eaf2fb; color:#0f3155; }

.desktop-body { align-items:start; }
.desktop-erp-shell .sidebar {
  align-self:start; height:calc(100vh - var(--qb-menu-h)); min-height:calc(100vh - var(--qb-menu-h));
  position:sticky; top:var(--qb-menu-h); overflow:hidden;
}
.environment-banner + .desktop-erp-shell .sidebar { height:calc(100vh - var(--qb-menu-h) - 28px); min-height:calc(100vh - var(--qb-menu-h) - 28px); top:calc(var(--qb-menu-h) + 28px); }
.desktop-erp-shell .nav-list { min-height:0; overflow-y:auto; }

/* Consistent data-table typography across inventory/accounting/registers. */
.desktop-erp-shell table th,.desktop-erp-shell table td { font-size:12px!important; line-height:1.4; }
.desktop-erp-shell table th { font-weight:700; }
.desktop-erp-shell .tiny,.desktop-erp-shell small { line-height:1.35; }

/* Accountant workspace: compact grouped navigation instead of the former wall of pills. */
.accountant-workspace-layout { align-items:start; display:grid; gap:12px; grid-template-columns:215px minmax(0,1fr); }
.accountant-section-nav { background:#fff; border:1px solid #bfc9d4; position:sticky; top:150px; }
.accountant-nav-title { background:linear-gradient(#f7f9fb,#e5eaf0); border-bottom:1px solid #b8c3cf; display:flex; flex-direction:column; padding:9px 10px; }
.accountant-nav-title strong { color:#15324f; font-size:13px; }
.accountant-nav-title span { color:#6a788a; font-size:10.5px; }
.accountant-section-nav details { border-bottom:1px solid #e0e5eb; }
.accountant-section-nav details:last-child { border-bottom:0; }
.accountant-section-nav summary { color:#31465f; cursor:pointer; font-size:11.5px; font-weight:800; list-style:none; padding:8px 10px; }
.accountant-section-nav summary::-webkit-details-marker { display:none; }
.accountant-section-nav details > div { display:grid; padding:0 5px 6px; }
.accountant-nav-link { background:transparent; border:0; border-radius:2px; color:#3e526a; cursor:pointer; font-size:11.5px; min-height:28px; padding:5px 7px; text-align:left; }
.accountant-nav-link:hover { background:#eef4fa; }
.accountant-nav-link.active { background:var(--color-primary,#2457c5); color:#fff; font-weight:700; }
.accountant-workspace-main { min-width:0; }
.accountant-primary-filters { display:grid; gap:8px; grid-template-columns:repeat(6,minmax(120px,1fr)); }
.accountant-filter-details { border-top:1px solid #d5dde6; margin-top:8px; padding-top:6px; }
.accountant-filter-details > summary { color:#34516e; cursor:pointer; font-size:11.5px; font-weight:700; padding:4px 0; }
.accountant-context-line { margin-bottom:8px; }
.metric-card { background:#fff; border:1px solid #c7d0db; display:flex; flex-direction:column; gap:5px; min-width:0; padding:10px 11px; }
.metric-card > span { color:#536174; font-size:11px; font-weight:700; line-height:1.25; }
.metric-card > strong { color:#17324f; font-size:16px; line-height:1.2; overflow-wrap:anywhere; }
.metric-card > small { color:#6a788a; font-size:10.5px; line-height:1.35; }

/* QuickBooks-style Report Centre */
.report-centre { display:grid; gap:12px; }
.report-centre-intro { align-items:center; background:#fff; border:1px solid #c5ced8; display:flex; justify-content:space-between; padding:14px 16px; }
.report-centre-intro h2 { margin:0 0 3px; }
.report-centre-intro p { color: var(--muted); margin:0; }
.report-centre-grid { display:grid; gap:10px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.report-group-card { background:#fff; border:1px solid #c9d2dc; min-width:0; }
.report-group-card h3 { background:linear-gradient(#f7f9fb,#e8edf3); border-bottom:1px solid #c9d2dc; color:#243b54; font-size:12px; margin:0; padding:8px 10px; }
.report-link-list { display:grid; padding:4px; }
.report-link-list button { align-items:center; background:#fff; border:0; border-bottom:1px solid #edf0f3; color:#314861; cursor:pointer; display:flex; font-size:11.75px; justify-content:space-between; padding:7px 8px; text-align:left; }
.report-link-list button:last-child { border-bottom:0; }
.report-link-list button:hover { background:#edf5fd; color:#0c4f8f; }

/* Professional Help Centre */
.help-hero { align-items:center; background:linear-gradient(135deg,#173653,#214e75); color:#fff; display:flex; gap:20px; justify-content:space-between; margin:-2px 0 12px; padding:22px 24px; }
.help-hero > div:first-child { max-width:780px; width:100%; }
.help-eyebrow { font-size:10px; font-weight:800; letter-spacing:.12em; opacity:.75; }
.help-hero h1 { color:#fff; font-size:24px; margin:4px 0; }
.help-hero p { margin:0 0 12px; opacity:.86; }
.help-search-box { align-items:center; background:#fff; border-radius:3px; color:#55687d; display:flex; gap:7px; max-width:650px; padding:0 10px; }
.help-search-box svg { height:16px; width:16px; }
.help-search-box input { border:0; min-height:40px; outline:0; width:100%; }
.help-hero-actions { display:flex; flex:0 0 auto; gap:7px; }
.help-hero-actions .btn.secondary { background:#fff; color:#173653; }
.help-hero-actions .btn.secondary:hover { background:#e7edf3; }
.help-hero-actions .btn.ghost { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.55); color:#fff; }
.help-hero-actions .btn.ghost:hover { background:rgba(255,255,255,.22); }
.help-stats { display:grid; gap:8px; grid-template-columns:repeat(3,1fr); margin-bottom:12px; }
.help-stats > div { background:#fff; border:1px solid #cbd4de; padding:10px 12px; }
.help-stats strong { display:block; font-size:18px; }
.help-stats span { color:#6a788a; font-size:11px; }
.help-context { margin-bottom:12px; }
.help-centre-layout { align-items:start; display:grid; gap:12px; grid-template-columns:220px minmax(0,1fr); }
.help-toc { background:#fff; border:1px solid #c8d1db; display:grid; padding:10px; position:sticky; top:105px; }
.help-toc h3 { margin:0 0 6px; }
.help-toc a { color:#3f546d; font-size:11.75px; padding:6px 4px; text-decoration:none; }
.help-toc a:hover { color:#0b5a9c; text-decoration:underline; }
.help-toc hr { border:0; border-top:1px solid #e0e5eb; width:100%; }
.help-support-link { background:transparent; border:0; color:#0b5a9c; cursor:pointer; font-size:11.5px; padding:5px 4px; text-align:left; }
.help-articles { display:grid; gap:12px; min-width:0; }
.help-category { display:grid; gap:6px; }
.help-category-heading { align-items:center; display:flex; justify-content:space-between; }
.help-category-heading h2 { font-size:16px; margin:0; }
.help-category-heading span { color:var(--muted); font-size:11px; }
.help-article { background:#fff; border:1px solid #cad3dd; }
.help-article > summary { align-items:center; cursor:pointer; display:flex; justify-content:space-between; list-style:none; padding:10px 12px; }
.help-article > summary::-webkit-details-marker { display:none; }
.help-article > summary span { display:grid; gap:2px; }
.help-article > summary strong { color:#243b54; font-size:12.5px; }
.help-article > summary small { color:var(--muted); font-size:11px; font-weight:400; }
.help-article > summary b { color:#6c7b8e; font-size:18px; }
.help-article[open] > summary b { transform:rotate(45deg); }
.help-article-body { border-top:1px solid #e2e7ed; padding:12px; }
.help-detail-grid { display:grid; gap:9px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.help-detail-grid section { background:#f8fafc; border:1px solid #e1e6ec; padding:9px; }
.help-detail-grid h3 { font-size:11.5px; margin:0 0 4px; }
.help-detail-grid p,.help-detail-grid li { font-size:11.5px; }

@media (max-width:1200px) {
  .master-company { flex-basis:170px; }
  .top-menu-item { padding:0 8px; font-size:11.5px; }
  .accountant-primary-filters { grid-template-columns:repeat(3,minmax(120px,1fr)); }
  .report-centre-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:980px) {
  .top-module-menu { overflow-x:auto; overflow-y:visible; }
  .accountant-workspace-layout,.help-centre-layout { grid-template-columns:1fr; }
  .accountant-section-nav,.help-toc { position:relative; top:auto; }
  .accountant-section-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .accountant-nav-title { grid-column:1/-1; }
  .desktop-erp-shell .sidebar { height:auto; min-height:0; position:relative; top:auto; }
}
@media (max-width:720px) {
  .report-centre-grid,.help-stats,.help-detail-grid { grid-template-columns:1fr; }
  .help-hero,.report-centre-intro { align-items:stretch; flex-direction:column; }
  .help-hero-actions { flex-wrap:wrap; }
  .accountant-primary-filters { grid-template-columns:1fr; }
  .accountant-section-nav { grid-template-columns:1fr; }
}
