:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #f2f5f9;
  --text: #18212f;
  --text-2: #4c596b;
  --muted: #7d8898;
  --line: #dfe5ed;
  --line-strong: #cfd7e2;
  --brand: #9f1f36;
  --brand-2: #c82f4c;
  --brand-soft: #fff0f3;
  --success: #1b7f5f;
  --success-soft: #e9f7f2;
  --warning: #a56500;
  --warning-soft: #fff7e3;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --info: #245bb3;
  --info-soft: #edf4ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 70px rgba(16, 24, 40, .18);
  --radius: 12px;
  --row: 42px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -20%, rgba(159, 31, 54, .055), transparent 38%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

svg.icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

body.command-open {
  overflow: hidden;
}

.brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #fff;
  background: linear-gradient(145deg, #cb3b55, #8f172d);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 6px 16px rgba(0,0,0,.22);
}

.command-trigger {
  height: 38px;
  padding: 0 10px 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #687588;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.command-trigger:hover {
  color: var(--text);
  border-color: #c9d3df;
  background: #fff;
}

.command-trigger span:nth-child(2) {
  flex: 1;
  text-align: left;
  font-size: 11.5px;
}

kbd {
  min-width: 34px;
  padding: 2px 6px;
  color: #798596;
  background: #fff;
  border: 1px solid #d9e0e9;
  border-bottom-color: #c8d0db;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 1px 1px rgba(16,24,40,.04);
}

.connection {
  max-width: 230px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.connection.connected i {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(27,127,95,.11);
}

.connection.demo i {
  background: #8b96a6;
  box-shadow: 0 0 0 4px rgba(125,136,152,.1);
}

.avatar {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #7a1b2e;
  background: var(--brand-soft);
  border: 1px solid #f2cbd2;
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #657286;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.workspace {
  width: min(100%, 1780px);
  margin: 0 auto;
  padding: 22px 24px 16px;
}

.page-head {
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-title-block {
  min-width: 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.page-head h1 {
  margin: 5px 0 3px;
  font-size: clamp(22px, 2.2vw, 31px);
  line-height: 1.16;
  letter-spacing: -.035em;
  font-weight: 750;
}

.page-head p {
  max-width: 880px;
  margin: 0;
  color: var(--text-2);
  font-size: 11.5px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
}

.safety-chip,
.protect-chip {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.safety-chip {
  color: #6a4a16;
  background: #fff9ed;
  border: 1px solid #efe2c6;
}

.protect-chip {
  min-height: 23px;
  color: #6b3f14;
  background: #fff8ea;
  border: 1px solid #edd7ad;
}

.safety-chip .icon,
.protect-chip .icon {
  width: 13px;
  height: 13px;
}

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

.kpi-card {
  min-height: 88px;
  padding: 14px 15px;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 70px;
  transform: translate(35px, -35px);
  border-radius: 50%;
  background: rgba(159,31,54,.045);
}

.kpi-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 6px;
  font-size: 21px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -.025em;
}

.kpi-note {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 9.5px;
}

.tabs {
  height: 41px;
  margin: 0 0 -1px;
  padding: 0 5px;
  display: flex;
  align-items: end;
  gap: 2px;
  position: relative;
  z-index: 2;
}

.tab {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 8px 8px 0 0;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 700;
}

.tab:hover {
  color: var(--text);
  background: rgba(255,255,255,.6);
}

.tab.active {
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-color: var(--surface);
}

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

.tabs + .workbench {
  border-radius: 0 var(--radius) var(--radius) var(--radius);
}

.toolbar {
  min-height: 52px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.search-form {
  min-width: 0;
}

.search-box {
  height: 36px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: border .14s ease, background .14s ease, box-shadow .14s ease;
}

.search-box:focus-within {
  background: #fff;
  border-color: #d4a4ad;
  box-shadow: 0 0 0 3px rgba(159,31,54,.07);
}

.search-box .icon {
  width: 15px;
  height: 15px;
  color: #8b97a7;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11.5px;
}

.search-box input::placeholder {
  color: #9aa5b3;
}

.search-clear {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
}

.search-clear:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.search-clear .icon {
  width: 13px;
  height: 13px;
}

.toolbar-meta,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions {
  justify-content: flex-end;
}

.result-count {
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.result-count strong {
  color: var(--text-2);
}

.size-control {
  height: 30px;
  padding-left: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9.5px;
}

.size-control select {
  height: 28px;
  padding: 0 20px 0 4px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  outline: 0;
  font-weight: 700;
}

.button {
  min-height: 32px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .1s ease, border .12s ease, background .12s ease;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  color: #fff;
  background: linear-gradient(180deg, #b52943, #961b32);
  border: 1px solid #8f192f;
  box-shadow: 0 1px 2px rgba(117,18,38,.14);
}

.button.primary:hover {
  background: linear-gradient(180deg, #c02b48, #a11e36);
}

.button.secondary {
  color: #4a586a;
  background: #fff;
  border: 1px solid var(--line-strong);
}

.button.secondary:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f2c9c4;
}

.button:disabled {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
}

.inline-form {
  display: inline;
  margin: 0;
}

.table-shell {
  width: 100%;
  overflow: auto;
  max-height: calc(100vh - 285px);
  min-height: 220px;
  outline: 0;
  scrollbar-width: thin;
  scrollbar-color: #cbd4df #f7f9fb;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

.data-table th {
  height: 34px;
  padding: 0 12px;
  color: #6c7888;
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .045em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  height: var(--row);
  padding: 5px 12px;
  color: #344054;
  border-bottom: 1px solid #edf0f4;
  font-size: 10.5px;
  vertical-align: middle;
}

.data-table tbody tr {
  background: #fff;
  transition: background .1s ease;
}

.data-table tbody tr:hover {
  background: #fafbfd;
}

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

.align-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.align-center {
  text-align: center;
}

.cell-text {
  display: inline-block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-link {
  color: #244e86;
  font-weight: 700;
}

.cell-link:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.row-actions .button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 9px;
}

.badge {
  min-height: 22px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .015em;
  white-space: nowrap;
}

.badge.success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #c9e9dd;
}

.badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #f2dfae;
}

.badge.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f0cdc8;
}

.badge.info {
  color: var(--info);
  background: var(--info-soft);
  border-color: #cdddf7;
}

.badge.neutral {
  color: #596678;
  background: #f3f5f8;
  border-color: #e0e5ec;
}

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

.pager {
  min-height: 48px;
  padding: 7px 10px 7px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.pager-summary {
  color: var(--muted);
  font-size: 9.5px;
}

.pager-summary strong {
  color: var(--text-2);
}

.pager-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pager-button {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #536174;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9.5px;
  font-weight: 700;
}

.pager-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.pager-button.disabled {
  color: #a9b2bf;
  background: #f8f9fb;
  cursor: default;
}

.pager-button .icon {
  width: 13px;
  height: 13px;
}

.page-number {
  min-width: 68px;
  color: var(--muted);
  font-size: 9.5px;
  text-align: center;
}

.empty-row td {
  height: 220px;
}

.empty-state {
  min-height: 170px;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
}

.empty-state .empty-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #8794a4;
  background: #f4f6f9;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.empty-state strong {
  font-size: 12px;
}

.empty-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.components,
.component-strip {
  display: grid;
  gap: 10px;
}

.components {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 12px;
}

.component-strip {
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.component-card {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.component-head {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.component-head strong {
  font-size: 10.5px;
}

.component-type {
  color: var(--brand);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.property-grid {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(120px, 1.2fr);
  gap: 5px 10px;
}

.property-grid dt {
  color: var(--muted);
  font-size: 9px;
}

.property-grid dd {
  margin: 0;
  color: var(--text-2);
  font-size: 9px;
  font-weight: 650;
  text-align: right;
}

.workspace-foot {
  min-height: 40px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #8994a3;
  font-size: 8.5px;
}

.workspace-foot > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.foot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.foot-sep {
  color: #c2c9d2;
}

.workspace-foot code {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 8px;
}

.command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: min(14vh, 120px) 20px 20px;
  display: grid;
  justify-items: center;
  align-items: start;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(4px);
}

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

.command-palette {
  width: min(660px, calc(100vw - 30px));
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.command-search {
  height: 56px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.command-search > .icon {
  color: #7d8999;
}

.command-search input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
}

.command-results {
  max-height: min(56vh, 520px);
  overflow: auto;
  padding: 7px;
}

.command-results a {
  min-height: 47px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
}

.command-results a:hover,
.command-results a.selected {
  background: #f7f9fc;
}

.command-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #5c6878;
  background: #f2f5f8;
  border-radius: 8px;
}

.command-icon .icon {
  width: 16px;
  height: 16px;
}

.command-results a > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.command-results strong {
  font-size: 10.5px;
}

.command-results small {
  color: var(--muted);
  font-size: 8.5px;
}

.command-enter {
  color: #9aa5b3;
  font-size: 11px;
}

.command-foot {
  min-height: 34px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #929dac;
  background: #fafbfd;
  border-top: 1px solid var(--line);
  font-size: 8.5px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 7px;
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  color: #fff;
  background: #202a38;
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  font-size: 10px;
  animation: toast-in .18s ease both;
}

.toast.success {
  background: #17684f;
}

.toast.warning {
  background: #805317;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-frame].refreshing {
  opacity: .7;
  transition: opacity .12s ease;
}

[data-frame].refreshed {
  animation: frame-flash .45s ease;
}

@keyframes frame-flash {
  0% { box-shadow: inset 0 0 0 9999px rgba(36,91,179,.035); }
  100% { box-shadow: inset 0 0 0 9999px rgba(36,91,179,0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: .01ms;
    animation-duration: .01ms;
    animation-iteration-count: 1;
  }
}


/* --- Rust top-navigation application shell ---------------------------------
   One shell, one cascade. No legacy sidebar or versioned override stack. */
.topnav-app {
  display: block;
  min-height: 100vh;
}

.topbar-wide {
  position: sticky;
  top: 0;
  z-index: 70;
  height: 58px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.top-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.top-brand .brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.top-brand-copy {
  min-width: 0;
  display: grid;
  gap: 0;
}

.top-brand-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-brand-copy small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.top-modules {
  min-width: 0;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: visible;
}

.module-link,
.module-menu > summary {
  height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #526071;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.module-menu {
  position: relative;
}

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

.module-link .icon,
.module-summary-icon .icon {
  width: 14px;
  height: 14px;
  color: #7a8797;
}

.module-caret .icon {
  width: 10px;
  height: 10px;
  transform: rotate(90deg);
}

.module-link:hover,
.module-menu > summary:hover {
  color: var(--text);
  background: #f6f8fb;
  border-color: var(--line);
}

.module-link.active,
.module-menu.active > summary,
.module-menu[open] > summary {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #f2ccd4;
}

.module-menu[open] {
  z-index: 90;
}

.module-dropdown {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: 330px;
  max-height: calc(100vh - 76px);
  padding: 7px;
  display: grid;
  gap: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.module-option {
  min-height: 44px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
}

.module-option > span {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 1px;
}

.module-option strong {
  color: #334155;
  font-size: 10px;
}

.module-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-option > .icon {
  width: 12px;
  height: 12px;
  color: #a3adba;
}

.module-option:hover {
  background: #f7f9fc;
}

.module-option.active {
  background: var(--brand-soft);
}

.module-option.active strong {
  color: var(--brand);
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.command-trigger.compact {
  width: auto;
  min-width: 116px;
  max-width: 150px;
  height: 34px;
}

.command-trigger.compact span:nth-child(2) {
  min-width: 42px;
}

.topnav-app + .command-backdrop {
  z-index: 120;
}

.topnav-app .workspace {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 18px;
}

.topnav-app .page-head {
  min-height: 68px;
}

.topnav-app .page-head h1 {
  margin-top: 0;
  font-size: clamp(20px, 1.75vw, 28px);
}

.topnav-app .page-head p {
  max-width: 1100px;
}

.topnav-app .workbench {
  border-radius: 10px;
}

.topnav-app .table-shell {
  max-height: calc(100vh - 246px);
}

/* Order entry -------------------------------------------------------------- */
.order-workbench {
  position: relative;
  overflow: visible;
}

.order-commandbar {
  min-height: 74px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(300px, 1.4fr) minmax(380px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.order-customer-block,
.order-meta-fields label,
.field {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.order-customer-block > label,
.order-meta-fields label > span,
.field > span {
  color: #667386;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.lookup-field {
  position: relative;
  min-width: 0;
}

.lookup-field > .icon {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: #8b97a7;
  transform: translateY(-50%);
  pointer-events: none;
}

.lookup-field > input[type="text"] {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 33px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
}

.lookup-field > input[type="text"]:focus {
  border-color: #d4a4ad;
  box-shadow: 0 0 0 3px rgba(159,31,54,.07);
}

.lookup-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 95;
  max-height: 350px;
  overflow: auto;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.lookup-panel[hidden],
.lookup-rail[hidden] {
  display: none;
}

.lookup-option {
  width: 100%;
  min-height: 46px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: 90px minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
}

.lookup-option:hover,
.lookup-option.active {
  background: #f5f8fc;
}

.lookup-option strong {
  color: #334155;
  font-size: 9.5px;
}

.lookup-option span {
  overflow: hidden;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-option small {
  color: var(--muted);
  font-size: 8px;
}

.order-meta-fields {
  display: grid;
  grid-template-columns: 145px minmax(190px, 1fr);
  gap: 8px;
}

.order-meta-fields select,
.order-meta-fields input,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  font-size: 10px;
}

.field textarea {
  height: auto;
  padding: 8px 9px;
  resize: vertical;
}

.order-meta-fields select:focus,
.order-meta-fields input:focus,
.field input:focus,
.field textarea:focus {
  border-color: #d4a4ad;
  box-shadow: 0 0 0 3px rgba(159,31,54,.06);
}

.order-save-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.order-hintbar {
  min-height: 32px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #778496;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 8.5px;
}

.order-hintbar span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.order-hintbar .icon {
  width: 12px;
  height: 12px;
}

.order-sheet-shell {
  max-height: calc(100vh - 330px);
}

.order-sheet {
  min-width: 980px;
}

.order-sheet .line-no {
  width: 36px;
  color: #99a4b2;
  text-align: center;
}

.order-sheet td {
  padding: 3px 7px;
}

.order-sheet input[data-order-field] {
  width: 100%;
  height: 31px;
  padding: 0 7px;
  color: #2f3d50;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  outline: 0;
  font-size: 10px;
}

.order-sheet input[data-order-field]:focus {
  background: #fff;
  border-color: #d4a4ad;
  box-shadow: 0 0 0 2px rgba(159,31,54,.06);
}

.order-sheet .item-cell input {
  font-weight: 650;
}

.order-sheet .numeric-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.readonly-cell {
  display: block;
  min-height: 28px;
  padding: 6px 4px;
  color: #647184;
  font-size: 9.5px;
  white-space: nowrap;
}

.amount-cell .readonly-cell {
  color: #273548;
  font-weight: 750;
}

.order-sheet tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 0;
  background: #fafbfd;
  border-top: 1px solid var(--line);
}

.order-totals {
  min-height: 38px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  color: var(--muted);
  font-size: 9px;
}

.order-totals strong {
  margin-left: 3px;
  color: #273548;
  font-size: 10px;
}

.lookup-rail {
  position: fixed;
  z-index: 100;
  top: 93px;
  right: 0;
  bottom: 0;
  width: min(430px, 42vw);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 42px rgba(16,24,40,.12);
}

.lookup-rail-head {
  min-height: 58px;
  padding: 9px 10px 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.lookup-rail-head > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.lookup-rail-head strong {
  font-size: 11px;
}

.lookup-rail-head span {
  color: var(--muted);
  font-size: 8.5px;
}

.lookup-rail-list {
  overflow: auto;
  padding: 7px;
}

.product-result {
  width: 100%;
  min-height: 70px;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--text-2);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.product-result:hover,
.product-result.active {
  background: #f7f9fc;
  border-color: var(--line);
}

.product-result-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.product-result strong {
  overflow: hidden;
  color: #253347;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-result span {
  color: #5d6a7c;
  font-size: 9px;
}

.product-result small {
  color: var(--muted);
  font-size: 8px;
}

.product-result-side {
  min-width: 88px;
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 2px;
}

.product-result-side b {
  color: #273548;
  font-size: 9.5px;
}

.product-result-side em {
  color: var(--success);
  font-size: 8px;
  font-style: normal;
}

.order-statusbar {
  min-height: 36px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #788597;
  background: #fbfcfd;
  border-top: 1px solid var(--line);
  font-size: 8.5px;
}

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

.order-statusbar .icon {
  width: 12px;
  height: 12px;
}

/* Product editor ----------------------------------------------------------- */
.product-editor {
  overflow: hidden;
}

.editor-commandbar {
  min-height: 62px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  border-bottom: 1px solid var(--line);
}

.editor-commandbar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.editor-commandbar strong {
  font-size: 12px;
}

.editor-commandbar small {
  color: var(--muted);
  font-size: 8.5px;
}

.product-edit-form {
  display: grid;
  gap: 0;
}

.editor-section {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.editor-section:last-child {
  border-bottom: 0;
}

.section-head {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head > div {
  display: grid;
  gap: 1px;
}

.section-head strong {
  color: #2d3a4c;
  font-size: 10.5px;
}

.section-head small {
  color: var(--muted);
  font-size: 8.5px;
}

.form-grid {
  display: grid;
  gap: 8px 10px;
}

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

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

.image-editor-grid {
  display: grid;
  grid-template-columns: 150px minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
}

.product-image-preview {
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed #ccd5e1;
  border-radius: 9px;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.product-image-preview span {
  display: grid;
  place-items: center;
  gap: 5px;
  font-size: 8.5px;
}

.field-stack {
  display: grid;
  gap: 6px;
}

.field-note {
  color: #7f8998;
  font-size: 8.5px;
}

@media (max-width: 1220px) {
  .topbar-wide {
    grid-template-columns: 160px minmax(0, 1fr) auto;
  }

  .module-link,
  .module-menu > summary {
    padding-inline: 7px;
  }

  .module-summary-icon,
  .module-link > .icon {
    display: none;
  }

  .connection-text {
    display: none;
  }

  .order-commandbar {
    grid-template-columns: minmax(280px, 1.2fr) minmax(340px, 1fr);
  }

  .order-save-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

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

@media (max-width: 900px) {
  .topbar-wide {
    height: auto;
    min-height: 58px;
    grid-template-columns: 160px minmax(0, 1fr) auto;
  }

  .top-modules {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
  }

  .top-modules::-webkit-scrollbar {
    display: none;
  }

  .module-dropdown {
    position: fixed;
    top: 58px;
    left: 10px;
    right: 10px;
    width: auto;
  }

  .order-commandbar {
    grid-template-columns: 1fr;
  }

  .order-meta-fields {
    grid-template-columns: 150px 1fr;
  }

  .order-save-actions {
    grid-column: auto;
  }

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

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

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

  .toolbar-meta,
  .toolbar-actions {
    justify-content: space-between;
  }

  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .pager-buttons {
    justify-content: space-between;
  }

  .workspace-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 10px 3px;
  }

  .tabs {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .topbar-wide {
    padding: 5px 8px;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .top-brand-copy {
    display: none;
  }

  .top-modules {
    order: 4;
    grid-column: 1 / -1;
    width: 100%;
    height: 38px;
    border-top: 1px solid #edf0f4;
  }

  .top-tools .connection,
  .command-trigger.compact kbd {
    display: none;
  }

  .command-trigger.compact {
    min-width: 76px;
  }

  .topnav-app .workspace {
    padding: 12px 9px 8px;
  }

  .order-meta-fields {
    grid-template-columns: 1fr;
  }

  .order-hintbar {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 6px;
  }

  .lookup-rail {
    top: 0;
    width: 100%;
  }

  .form-grid.four-col,
  .form-grid.two-col,
  .image-editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-commandbar {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* --- Readable ERP typography ------------------------------------------------
   Deliberately larger than the earlier compact candidate. Keep print-preview
   typography separate because it represents physical paper scale. */
html {
  font-size: 16px;
}

.top-brand-copy strong { font-size: 14px; }
.top-brand-copy small { font-size: 10.5px; }
.module-link,
.module-menu > summary { font-size: 12.5px; font-weight: 750; }
.module-option strong { font-size: 12.5px; }
.module-option small { font-size: 11px; }
.command-trigger.compact span:nth-child(2) { font-size: 12.5px; }
.connection { font-size: 11.5px; }
.page-head .eyebrow,
.editor-commandbar .eyebrow,
.account-title .eyebrow { font-size: 11px; }
.topnav-app .page-head h1 { font-size: clamp(28px, 2vw, 34px); }
.topnav-app .page-head p { font-size: 14px; line-height: 1.5; }
.button,
.pager-button { min-height: 36px; font-size: 12.5px; }
.search-box input,
.size-control select,
.order-meta-fields select,
.order-meta-fields input,
.field input,
.field textarea,
.field select,
.lookup-field > input[type="text"] { font-size: 13px; }
.toolbar-meta,
.result-count,
.size-control,
.pager-summary,
.page-number { font-size: 12px; }
.data-table th { font-size: 11.5px; letter-spacing: .045em; }
.data-table td,
.cell-text,
.cell-link { font-size: 13px; line-height: 1.4; }
.badge { font-size: 11.5px; }
.kpi-label { font-size: 11.5px; }
.kpi-value { font-size: 26px; }
.kpi-note { font-size: 11px; }
.tab { font-size: 12.5px; }
.workspace-foot { font-size: 10.5px; }
.order-customer-block > label,
.order-meta-fields label > span,
.field > span { font-size: 11px; }
.order-hintbar,
.order-statusbar { font-size: 11px; }
.order-sheet input[data-order-field],
.readonly-cell { font-size: 13px; }
.order-totals { font-size: 11.5px; }
.order-totals strong { font-size: 13px; }
.lookup-option strong { font-size: 12.5px; }
.lookup-option span { font-size: 12px; }
.lookup-option small { font-size: 11px; }
.product-result strong { font-size: 13px; }
.product-result span { font-size: 11.5px; }
.product-result small,
.product-result-side em { font-size: 10.5px; }
.product-result-side b { font-size: 12.5px; }
.editor-commandbar strong { font-size: 15px; }
.editor-commandbar small { font-size: 11px; }
.section-head strong { font-size: 13px; }
.section-head small,
.field-note { font-size: 11px; }

/* --- Finance & CRM --------------------------------------------------------- */
.finance-dashboard,
.crm-dashboard {
  display: grid;
  gap: 14px;
}

.module-filterbar {
  min-height: 68px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.crm-dashboard .module-filterbar {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

.module-filterbar label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.module-filterbar label > span {
  color: #617084;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.module-filterbar select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 112px;
  padding: 14px 15px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid #cbd5e1;
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.metric-card.success { border-top-color: var(--success); }
.metric-card.warning { border-top-color: #d9971a; }
.metric-card.danger { border-top-color: var(--danger); }
.metric-card.info { border-top-color: var(--info); }

.metric-card > span {
  color: #68778a;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric-card strong {
  color: #1f2b3a;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.metric-card small {
  color: var(--muted);
  font-size: 11.5px;
}

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

.dashboard-card {
  min-width: 0;
  min-height: 260px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  min-height: 44px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.card-head strong {
  color: #2b384a;
  font-size: 14px;
}

.card-head span {
  color: var(--muted);
  font-size: 11.5px;
}

.card-head a {
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
}

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

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sales-dot { background: #9f1f36; }
.purchase-dot { background: #8796aa; }

.dual-bar-chart {
  height: 180px;
  padding: 16px 10px 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(36px, 1fr));
  gap: 9px;
  align-items: end;
  border-top: 1px solid #eef1f5;
  background:
    linear-gradient(to top, transparent 24%, #eef2f6 25%, transparent 26%),
    linear-gradient(to top, transparent 49%, #eef2f6 50%, transparent 51%),
    linear-gradient(to top, transparent 74%, #eef2f6 75%, transparent 76%);
}

.bar-month {
  height: 160px;
  display: grid;
  grid-template-rows: 1fr 24px;
  gap: 4px;
  align-items: end;
}

.bar-pair {
  height: 136px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
}

.bar {
  width: min(22px, 38%);
  min-height: 8px;
  border-radius: 5px 5px 2px 2px;
}

.bar.sales { background: linear-gradient(180deg, #c54860, #9f1f36); }
.bar.purchase { background: linear-gradient(180deg, #a8b3c3, #75859a); }
.bar.h38 { height: 38%; } .bar.h44 { height: 44%; } .bar.h49 { height: 49%; }
.bar.h52 { height: 52%; } .bar.h53 { height: 53%; } .bar.h57 { height: 57%; }
.bar.h58 { height: 58%; } .bar.h61 { height: 61%; } .bar.h64 { height: 64%; }
.bar.h66 { height: 66%; } .bar.h68 { height: 68%; } .bar.h72 { height: 72%; }
.bar.h78 { height: 78%; } .bar.h84 { height: 84%; }

.bar-month > span {
  color: #6c798b;
  font-size: 11px;
  text-align: center;
}

.rank-list,
.alert-stack,
.activity-list,
.history-list {
  display: grid;
  gap: 6px;
}

.rank-row {
  min-height: 47px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid #edf0f4;
  border-radius: 8px;
}

.rank-indicator {
  width: 4px;
  height: 28px;
  border-radius: 4px;
  background: #a9b3c1;
}
.rank-indicator.success { background: var(--success); }
.rank-indicator.warning { background: #d9971a; }
.rank-indicator.danger { background: var(--danger); }

.rank-row > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.rank-row strong,
.rank-row b {
  color: #334155;
  font-size: 12.5px;
}

.rank-row small {
  color: var(--muted);
  font-size: 11px;
}

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

.tax-summary-grid > div {
  min-height: 72px;
  padding: 10px;
  display: grid;
  gap: 4px;
  align-content: center;
  background: #f8fafc;
  border: 1px solid #edf1f5;
  border-radius: 8px;
}

.tax-summary-grid span {
  color: #6c798b;
  font-size: 11px;
}

.tax-summary-grid strong {
  color: #2b384a;
  font-size: 16px;
}

.tax-summary-grid .accent {
  background: var(--brand-soft);
  border-color: #efccd4;
}

.tax-summary-grid .accent strong { color: var(--brand); }

.alert-row {
  min-height: 44px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #edf0f4;
  border-radius: 8px;
}

.alert-row strong { font-size: 11.5px; }
.alert-row span { color: #536174; font-size: 12px; }
.alert-row b { color: var(--brand); font-size: 11px; }
.alert-row.warning { background: #fffaf0; }
.alert-row.danger { background: #fff5f4; }
.alert-row.info { background: #f5f8ff; }

.quick-module-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.quick-module-row a {
  min-height: 76px;
  padding: 11px;
  display: grid;
  gap: 4px;
  align-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.quick-module-row a:hover {
  border-color: #d3a8b1;
  box-shadow: var(--shadow-sm);
}

.quick-module-row strong {
  color: #334155;
  font-size: 12.5px;
}

.quick-module-row span {
  color: var(--muted);
  font-size: 10.8px;
  line-height: 1.35;
}

/* Voucher studio */
.voucher-type-strip {
  min-height: 52px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.voucher-type {
  min-height: 36px;
  padding: 0 13px;
  color: #526074;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 720;
}

.voucher-type.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #efcbd3;
}

.voucher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 590px;
}

.voucher-main {
  min-width: 0;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.voucher-head-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px 170px;
  gap: 10px;
}

.voucher-entry-card,
.journal-grid-card,
.rule-card {
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.finance-form {
  margin-bottom: 11px;
}

.journal-grid-card {
  overflow: auto;
}

.balance-chip {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.balance-chip.success {
  color: var(--success);
  background: var(--success-soft);
}

.allocation-toolbar {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.allocation-toolbar .field {
  min-width: 180px;
  margin: 0;
}

.bill-allocation-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e4e9f0;
  border-radius: 8px;
  background: #fff;
}

.bill-allocation-grid {
  min-width: 860px;
}

.bill-allocation-grid th:first-child,
.bill-allocation-grid td:first-child,
.bill-allocation-grid th:last-child,
.bill-allocation-grid td:last-child {
  width: 52px;
  text-align: center;
}

.bill-allocation-grid td:nth-child(2) {
  min-width: 190px;
}

.bill-allocation-grid td:nth-child(3) {
  min-width: 145px;
}

.bill-allocation-grid td:nth-child(5) {
  min-width: 130px;
}

.entry-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.entry-grid th,
.entry-grid td {
  padding: 9px 8px;
  border-bottom: 1px solid #e7ebf1;
  text-align: left;
}

.entry-grid th {
  color: #647184;
  background: #f7f9fb;
  font-size: 11px;
  text-transform: uppercase;
}

.entry-grid th:nth-last-child(-n+2),
.entry-grid td:nth-last-child(-n+2) {
  text-align: right;
}

.entry-grid tfoot td {
  font-weight: 800;
  background: #fbfcfd;
}

.entry-new-row td {
  color: var(--brand);
  font-weight: 700;
  text-align: center;
}

.voucher-side {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: #f7f9fc;
  border-left: 1px solid var(--line);
}

.rule-card strong { font-size: 13px; }
.rule-card p {
  margin: 8px 0 0;
  color: #5f6d7f;
  font-size: 11.5px;
  line-height: 1.55;
}

.upload-box {
  width: 100%;
  min-height: 76px;
  margin-top: 8px;
  padding: 10px;
  color: #778496;
  background: #fbfcfd;
  border: 1px dashed #c8d2de;
  border-radius: 8px;
  font-size: 11.5px;
}

.voucher-actions {
  display: grid;
  gap: 7px;
}

.voucher-actions small {
  color: var(--muted);
  font-size: 10.8px;
  text-align: center;
}

/* Financial statements */
.statement-toolbar {
  min-height: 66px;
  padding: 10px 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.period-controls {
  display: flex;
  gap: 10px;
}

.period-controls .field { min-width: 220px; }

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

.statement-panel {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.statement-title {
  min-height: 48px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
}

.statement-title strong { font-size: 14px; }
.statement-title span { color: var(--muted); font-size: 11px; }

.statement-line,
.statement-total,
.profit-strip {
  min-height: 46px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 120px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #edf0f4;
}

.statement-line span {
  color: #3f4d60;
  font-size: 12.5px;
}

.statement-line strong,
.statement-total strong,
.profit-strip strong {
  color: #253347;
  font-size: 12.5px;
  text-align: right;
}

.statement-line em,
.statement-total em,
.profit-strip em {
  color: #7a8797;
  font-size: 11.5px;
  font-style: normal;
  text-align: right;
}

.statement-line:hover {
  background: #fafbfd;
}

.statement-total,
.profit-strip {
  background: #f5f7fa;
  font-weight: 800;
}

.statement-total span,
.profit-strip span {
  color: #2e3b4d;
  font-size: 12.5px;
}

.profit-strip {
  margin-top: 10px;
  border-top: 1px solid #dfe5ed;
}

.profit-strip.net {
  color: var(--success);
  background: var(--success-soft);
}

.statement-footnote {
  min-height: 48px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #69778a;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}

/* CRM */
.pipeline-funnel {
  min-height: 174px;
  display: grid;
  gap: 7px;
  align-content: center;
}

.pipeline-funnel .stage {
  min-height: 34px;
  margin-inline: auto;
  padding: 0 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  gap: 8px;
  align-items: center;
  color: #344154;
  background: #f8fafc;
  border: 1px solid #e5eaf0;
  border-radius: 7px;
}

.pipeline-funnel .lead { width: 100%; }
.pipeline-funnel .qualified { width: 84%; background: #f6f8fb; }
.pipeline-funnel .quote { width: 68%; background: #fdf7f8; border-color: #efdce0; }
.pipeline-funnel .won { width: 52%; color: var(--brand); background: var(--brand-soft); border-color: #efcbd3; }

.pipeline-funnel span { font-size: 11.5px; font-weight: 700; }
.pipeline-funnel strong { font-size: 12.5px; }
.pipeline-funnel em { font-size: 11px; font-style: normal; text-align: right; }

.credit-health {
  display: grid;
  gap: 10px;
}

.credit-health > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.credit-health span {
  color: #566477;
  font-size: 12px;
}

.credit-health strong {
  color: #334155;
  font-size: 12px;
}

.health-bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 99px;
  background: #dfe5ec;
}
.health-bar.good { background: linear-gradient(90deg, var(--success) 72%, #edf1f5 72%); }
.health-bar.watch { background: linear-gradient(90deg, #d5a23a 56%, #edf1f5 56%); }
.health-bar.warn { background: linear-gradient(90deg, #d17a28 38%, #edf1f5 38%); }
.health-bar.bad { background: linear-gradient(90deg, var(--danger) 22%, #edf1f5 22%); }

.activity-row {
  min-height: 48px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border-bottom: 1px solid #edf0f4;
}

.activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: #aab4c2;
}
.activity-dot.success { background: var(--success); }
.activity-dot.warning { background: #d9971a; }
.activity-dot.danger { background: var(--danger); }
.activity-dot.info { background: var(--info); }

.activity-row > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.activity-row small { color: var(--muted); font-size: 10.5px; }
.activity-row strong { color: #334155; font-size: 12px; }
.activity-row em { color: #647184; font-size: 11.5px; font-style: normal; }

.account-hero {
  min-height: 92px;
  padding: 14px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.account-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #bd3d56, #8e1c31);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 850;
}

.account-title h2 {
  margin: 1px 0 2px;
  color: #202c3c;
  font-size: 22px;
}

.account-title p {
  margin: 0;
  color: #6b788b;
  font-size: 12px;
}

.account-hero-actions {
  display: flex;
  gap: 7px;
}

.account-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

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

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

.detail-item {
  min-height: 54px;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  align-content: center;
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 7px;
}

.detail-item span {
  color: #7a8797;
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-item strong {
  overflow-wrap: anywhere;
  color: #344154;
  font-size: 12px;
}

.ageing-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.ageing-grid > div {
  min-height: 68px;
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 7px;
}

.ageing-grid > div.good { background: var(--success-soft); }
.ageing-grid > div.watch { background: var(--warning-soft); }

.ageing-grid span { color: #6d7a8d; font-size: 10.5px; }
.ageing-grid strong { color: #2f3d50; font-size: 13px; }

.limit-meter {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.limit-meter > span {
  height: 9px;
  overflow: hidden;
  background: #edf1f5;
  border-radius: 999px;
}

.limit-meter > span i {
  width: 68%;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #2d7f65, #56a489);
}

.limit-meter small {
  color: #6d7a8d;
  font-size: 11px;
}

.history-row {
  min-height: 46px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 74px 100px minmax(0, 1fr) 100px 72px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #edf0f4;
}

.history-row span,
.history-row em,
.history-row small {
  color: #6b788b;
  font-size: 11px;
  font-style: normal;
}

.history-row strong,
.history-row b {
  color: #334155;
  font-size: 11.5px;
}

@media (max-width: 1220px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-module-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-filterbar,
  .crm-dashboard .module-filterbar { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .voucher-layout { grid-template-columns: 1fr; }
  .voucher-side { border-left: 0; border-top: 1px solid var(--line); grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .metric-grid,
  .account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid,
  .statement-columns,
  .account-360-grid { grid-template-columns: 1fr; }
  .module-filterbar,
  .crm-dashboard .module-filterbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voucher-head-grid { grid-template-columns: 1fr; }
  .voucher-side { grid-template-columns: 1fr; }
  .quick-module-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-hero { grid-template-columns: 48px minmax(0, 1fr); }
  .account-hero-actions { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .metric-grid,
  .account-metrics,
  .quick-module-row,
  .module-filterbar,
  .crm-dashboard .module-filterbar,
  .detail-grid { grid-template-columns: 1fr; }
  .ageing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statement-line,
  .statement-total,
  .profit-strip { grid-template-columns: minmax(0, 1fr) 100px; }
  .statement-line em,
  .statement-total em,
  .profit-strip em { display: none; }
}


/* Party / ledger master editor */
.party-editor {
  overflow: hidden;
}

.party-master-form {
  display: grid;
}

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

.checkbox-field em {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4e5c6f;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  font-style: normal;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.document-drop {
  min-height: 86px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f8fafc;
  border: 1px dashed #c8d2de;
  border-radius: 9px;
}

.document-drop > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.document-drop strong {
  color: #344154;
  font-size: 13px;
}

.document-drop span {
  color: var(--muted);
  font-size: 11.5px;
}

/* Monthly stock chart required by the finance FRD */
.stock-monthly-workbench {
  overflow: hidden;
}

.stock-monthly-chart-card {
  margin: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.inward-dot { background: var(--success); }
.outward-dot { background: var(--brand); }

.stock-monthly-chart {
  height: 190px;
  padding: 14px 10px 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 10px;
  align-items: end;
  background:
    linear-gradient(to top, transparent 24%, #eef2f6 25%, transparent 26%),
    linear-gradient(to top, transparent 49%, #eef2f6 50%, transparent 51%),
    linear-gradient(to top, transparent 74%, #eef2f6 75%, transparent 76%);
  border-top: 1px solid #eef1f5;
}

.stock-chart-month {
  height: 168px;
  display: grid;
  grid-template-rows: 1fr 24px;
  align-items: end;
}

.stock-bars {
  height: 142px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 6px;
}

.stock-bars .bar {
  width: min(24px, 40%);
}

.bar.inward { background: linear-gradient(180deg, #4ba285, #1b7f5f); }
.bar.outward { background: linear-gradient(180deg, #c94a61, #9f1f36); }
.bar.h48 { height: 48%; }
.bar.h50 { height: 50%; }
.bar.h54 { height: 54%; }
.bar.h56 { height: 56%; }
.bar.h62 { height: 62%; }
.bar.h70 { height: 70%; }
.bar.h76 { height: 76%; }

.stock-chart-month > span {
  color: #6c798b;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 680px) {
  .span-two { grid-column: auto; }
  .document-drop {
    align-items: flex-start;
    flex-direction: column;
  }
  .stock-monthly-chart {
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(54px, 1fr));
  }
}


/* Finance / CRM persistent module tabs */
.module-tabs {
  margin: 0 0 12px;
  padding: 5px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.module-tab {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #59677a;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 760;
  white-space: nowrap;
}

.module-tab:hover {
  color: var(--brand);
  background: #faf5f6;
}

.module-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #b22a45, #8e1d33);
  box-shadow: 0 4px 10px rgba(159, 31, 54, .18);
}

/* Customer-control CRM */
.customer-op-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.customer-op-grid a {
  min-height: 70px;
  padding: 10px;
  display: grid;
  gap: 3px;
  align-content: center;
  background: #f8fafc;
  border: 1px solid #e8edf3;
  border-radius: 8px;
}

.customer-op-grid a:hover {
  border-color: #d7aeb7;
  background: #fffafa;
}

.customer-op-grid strong {
  color: #354255;
  font-size: 12.5px;
}

.customer-op-grid span {
  color: #7a8798;
  font-size: 11px;
}

.b2b-note {
  margin-top: 12px;
  padding: 10px;
  display: grid;
  gap: 3px;
  color: #536174;
  background: #f5f8ff;
  border: 1px solid #dbe6f8;
  border-radius: 8px;
}

.b2b-note strong { color: #315b9a; font-size: 11.5px; }
.b2b-note span { font-size: 11px; line-height: 1.45; }

.document-status-list {
  display: grid;
  gap: 7px;
}

.document-status-row {
  min-height: 48px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #fafbfd;
}

.document-status-row > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.document-status-row strong {
  color: #344154;
  font-size: 12px;
}

.document-status-row span {
  color: #7a8797;
  font-size: 10.8px;
}

.doc-state {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
}

.doc-state.success {
  color: var(--success);
  background: var(--success-soft);
}

.doc-state.warning {
  color: #9b6300;
  background: var(--warning-soft);
}

/* Full document / PDF designer */
.print-designer-grid {
  display: grid;
  grid-template-columns: 290px minmax(620px, 1fr) 300px;
  min-height: 720px;
  border-top: 1px solid var(--line);
}

.designer-left,
.designer-inspector {
  min-width: 0;
  padding: 12px;
  background: #f8fafc;
  overflow-y: auto;
}

.designer-left {
  border-right: 1px solid var(--line);
}

.designer-inspector {
  border-left: 1px solid var(--line);
}

.config-section,
.inspector-section {
  padding: 11px;
  display: grid;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 10px;
}

.config-section > strong,
.inspector-section > strong {
  color: #334155;
  font-size: 12.5px;
}

.config-note,
.inspector-section > small,
.pdf-output-panel p {
  margin: 0;
  color: #7a8797;
  font-size: 10.8px;
  line-height: 1.45;
}

.designer-element-list {
  display: grid;
  gap: 6px;
}

.designer-element-button {
  min-height: 52px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  color: #435166;
  background: #fafbfd;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.designer-element-button:hover,
.designer-element-button.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #efcbd3;
}

.designer-element-button > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.designer-element-button strong { font-size: 11.5px; }
.designer-element-button small { color: #8793a3; font-size: 9.8px; }
.designer-element-button b {
  min-width: 26px;
  color: var(--success);
  font-size: 9.5px;
  text-align: right;
}

.element-grip {
  color: #9ba6b5;
  font-weight: 900;
}

.designer-center {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at 30% 20%, rgba(159,31,54,.025), transparent 30%),
    #edf1f5;
}

.canvas-toolbar {
  min-height: 52px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.canvas-toolbar > div:first-child {
  display: grid;
  gap: 1px;
}

.canvas-toolbar strong { color: #334155; font-size: 12.5px; }
.canvas-toolbar span { color: #7a8797; font-size: 10.5px; }

.designer-paper-wrap {
  min-height: 660px;
  padding: 24px;
  display: grid;
  place-items: start center;
  overflow: auto;
}

.designer-paper {
  position: relative;
  width: min(720px, 100%);
  min-height: 1px;
  margin: 0 auto;
  overflow: hidden;
  transform-origin: top center;
  background: #fff;
  box-shadow: 0 18px 50px rgba(29, 41, 57, .17);
  border: 1px solid #d8dee7;
}

.margin-guide {
  position: absolute;
  z-index: 1;
  border: 1px dashed rgba(184, 45, 70, .35);
  pointer-events: none;
}

.doc-element {
  position: absolute;
  z-index: 2;
  min-height: 22px;
  padding: 4px;
  color: #222b37;
  cursor: move;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 3px;
  touch-action: none;
}

.doc-element:hover {
  border-color: rgba(159,31,54,.22);
  background: rgba(255, 248, 249, .55);
}

.doc-element.selected {
  border-color: #c13650;
  box-shadow: 0 0 0 2px rgba(193,54,80,.12);
  background: rgba(255, 248, 249, .8);
}

.doc-element.dragging {
  z-index: 20;
  box-shadow: 0 8px 20px rgba(16,24,40,.16);
}

.doc-company-copy {
  display: inline-grid;
  gap: 1px;
  margin-left: 7px;
  vertical-align: top;
}

.doc-company-copy strong,
.doc-element > strong {
  display: block;
  font-size: 1em;
}

.doc-company-copy span,
.doc-element > span {
  display: block;
  color: #667085;
  font-size: .82em;
}

.party-element {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid #dfe5ed;
  border-bottom: 1px solid #dfe5ed;
}

.party-element > div {
  display: grid;
  gap: 1px;
}

.party-element small {
  color: #7c8898;
  font-size: .75em;
  text-transform: uppercase;
}

.line-element {
  padding: 0;
}

.line-element .paper-lines {
  width: 100%;
  margin: 0;
  font-size: inherit;
}

.summary-element {
  display: grid;
  gap: 3px;
}

.summary-element > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.qr-placeholder {
  width: 42px;
  height: 42px;
  margin-top: 5px;
  display: grid;
  place-items: center;
  color: #647184;
  border: 1px dashed #aab5c2;
  font-size: .75em;
}

.signature-element {
  min-height: 48px;
  display: grid;
  align-content: end;
  gap: 3px;
  border-top: 1px solid #cfd7e2;
}

.footer-element {
  padding-top: 4px;
  border-top: 1px solid #dfe5ed;
  color: #788496;
}

.inspector-actions {
  display: grid;
  gap: 6px;
}

.pdf-output-panel {
  background: #fff7f8;
  border-color: #efcbd3;
}

.pdf-output-panel .button {
  width: 100%;
}

@media (max-width: 1320px) {
  .print-designer-grid {
    grid-template-columns: 260px minmax(560px, 1fr) 280px;
  }
}

@media (max-width: 1080px) {
  .print-designer-grid {
    grid-template-columns: 240px minmax(520px, 1fr);
  }
  .designer-inspector {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .inspector-section { margin-bottom: 0; }
}

@media (max-width: 760px) {
  .print-designer-grid {
    grid-template-columns: 1fr;
  }
  .designer-left,
  .designer-inspector {
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .designer-inspector {
    display: block;
  }
  .designer-paper-wrap {
    padding: 12px;
  }
  .customer-op-grid {
    grid-template-columns: 1fr;
  }
}

[data-doc-element][hidden] {
  display: none;
}

/* Print designer primitives retained as one semantic layer */
.print-studio {
  overflow: hidden;
}

.form-grid.four-mini {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.paper-logo {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 7px;
  font-weight: 850;
}

.paper-lines {
  width: 100%;
  border-collapse: collapse;
}

.paper-lines th,
.paper-lines td {
  padding: 7px 6px;
  border-bottom: 1px solid #e1e6ec;
  text-align: left;
}

.paper-lines th {
  color: #687588;
  background: #f6f8fa;
  font-size: .86em;
  text-transform: uppercase;
}

.paper-lines th:nth-child(n+3),
.paper-lines td:nth-child(n+3) {
  text-align: right;
}

.paper-total {
  padding-top: 5px;
  border-top: 1px solid #293648;
  font-weight: 800;
}


/* Exact print/PDF output + CI logo */
.paper-logo-image {
  width: 64px;
  height: 32px;
  padding: 2px;
  background: #fff;
  border-radius: 3px;
  overflow: hidden;
}

.paper-logo-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.document-print-window {
  margin: 0;
  padding: 0;
  background: #fff;
}

.document-print-window .designer-paper {
  margin: 0;
  max-width: none;
  min-height: 0;
  box-shadow: none;
  border: 0;
}

.document-print-window .doc-element {
  border-color: transparent;
  background: transparent;
}

@page {
  margin: 0;
}

@media print {
  body:not(.document-print-window) > * {
    visibility: hidden;
  }

  body:not(.document-print-window) .statement-workbench,
  body:not(.document-print-window) .statement-workbench *,
  body:not(.document-print-window) .catalogue-studio,
  body:not(.document-print-window) .catalogue-studio * {
    visibility: visible;
  }

  body:not(.document-print-window) .statement-workbench,
  body:not(.document-print-window) .catalogue-studio {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: 0;
  }

  .catalogue-toolbar,
  .catalogue-fields,
  .module-tabs,
  .page-head,
  .workspace-foot {
    display: none;
  }

  .catalogue-layout {
    grid-template-columns: 1fr;
  }

  .catalogue-main {
    padding: 0;
  }

  .catalogue-product-grid {
    gap: 10px;
  }
}

/* Product catalogue studio */
.catalogue-studio {
  overflow: hidden;
}

.catalogue-toolbar {
  min-height: 68px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) minmax(150px, .7fr) minmax(150px, .7fr) 110px auto auto;
  gap: 9px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.catalogue-search {
  height: 40px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.catalogue-search svg {
  width: 16px;
  color: #7d8999;
}

.catalogue-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2d394b;
  font-size: 13px;
}

.compact-field > span {
  font-size: 10px;
}

.catalogue-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 650px;
}

.catalogue-fields {
  padding: 12px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}

.catalogue-field-toggle {
  min-height: 38px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #435166;
  background: #fff;
  border: 1px solid #e6ebf1;
  border-radius: 7px;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

.catalogue-field-toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.catalogue-info-box {
  margin-top: 12px;
  padding: 10px;
  display: grid;
  gap: 3px;
  background: #fff8f9;
  border: 1px solid #efd5db;
  border-radius: 8px;
}

.catalogue-info-box strong {
  color: var(--brand);
  font-size: 11px;
}

.catalogue-info-box span {
  color: #667487;
  font-size: 10.5px;
  line-height: 1.45;
}

.catalogue-main {
  min-width: 0;
  padding: 14px;
  background: #f3f6fa;
}

.catalogue-head {
  min-height: 76px;
  margin-bottom: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.catalogue-head h2 {
  margin: 1px 0 3px;
  color: #263345;
  font-size: 20px;
}

.catalogue-head p {
  margin: 0;
  color: #718094;
  font-size: 11.5px;
}

.catalogue-result-meta {
  display: grid;
  gap: 2px;
  text-align: right;
}

.catalogue-result-meta strong {
  color: #29374a;
  font-size: 14px;
}

.catalogue-result-meta span {
  color: #7b8797;
  font-size: 10.5px;
}

.catalogue-product-grid {
  display: grid;
  gap: 10px;
}

.catalogue-product-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalogue-product-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.catalogue-product-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.catalogue-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(40, 54, 75, .05);
}

.catalogue-image {
  height: 150px;
  padding: 12px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(164, 28, 51, .06), transparent 32%),
    linear-gradient(180deg, #fbfcfe, #f1f4f8);
  border-bottom: 1px solid #e7ecf2;
}

.catalogue-image-placeholder {
  min-width: 140px;
  min-height: 96px;
  padding: 10px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: #718094;
  border: 1px dashed #c9d3df;
  border-radius: 9px;
  text-align: center;
}

.catalogue-image-placeholder span {
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
}

.catalogue-image-placeholder strong {
  color: #344154;
  font-size: 13px;
}

.catalogue-image-placeholder small {
  max-width: 160px;
  color: #8a96a5;
  font-size: 9px;
  line-height: 1.3;
}

.catalogue-card-body {
  padding: 12px;
}

.catalogue-part {
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
}

.catalogue-card h3 {
  min-height: 38px;
  margin: 3px 0 7px;
  color: #2b384a;
  font-size: 14px;
  line-height: 1.3;
}

.catalogue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.catalogue-tags span {
  padding: 4px 6px;
  color: #5e6c80;
  background: #f3f6f9;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
}

.catalogue-card p {
  min-height: 34px;
  margin: 8px 0;
  color: #677588;
  font-size: 10.5px;
  line-height: 1.45;
}

.catalogue-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.catalogue-prices > div {
  padding: 7px;
  display: grid;
  gap: 2px;
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 7px;
}

.catalogue-prices span {
  color: #8792a2;
  font-size: 9px;
}

.catalogue-prices strong {
  color: #2f3d50;
  font-size: 12px;
}

.catalogue-card-foot {
  min-height: 29px;
  margin-top: 9px;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: #6d7a8d;
  border-top: 1px solid #edf0f4;
  font-size: 9.5px;
}

.catalogue-empty {
  padding: 50px 18px;
  display: grid;
  gap: 4px;
  place-items: center;
  color: #6f7c8f;
  background: #fff;
  border: 1px dashed #cdd6e1;
  border-radius: 10px;
}

.catalogue-empty strong {
  color: #344154;
  font-size: 14px;
}

.catalogue-empty span {
  font-size: 11px;
}

.catalogue-card[hidden],
.catalogue-empty[hidden],
[data-catalogue-value][hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .catalogue-toolbar {
    grid-template-columns: 1fr 1fr 1fr 100px;
  }
  .catalogue-toolbar .button {
    grid-column: auto;
  }
  .catalogue-product-grid.cols-4,
  .catalogue-product-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .catalogue-toolbar,
  .catalogue-layout {
    grid-template-columns: 1fr;
  }
  .catalogue-fields {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .catalogue-product-grid.cols-2,
  .catalogue-product-grid.cols-3,
  .catalogue-product-grid.cols-4 {
    grid-template-columns: 1fr;
  }
}


.safety-chip.sandbox-chip {
  color: #176147;
  background: #effaf5;
  border-color: #cde9dc;
}

/* Compact page title row */
.page-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-heading-row h1 {
  min-width: 0;
}

/* Keep the right-side module menus inside the viewport on desktop.
   Mobile/tablet menus use the full-width fixed dropdown rule below 900px. */
@media (min-width: 901px) {
  .module-menu[data-menu-id="finance"] .module-dropdown,
  .module-menu[data-menu-id="crm"] .module-dropdown,
  .module-menu[data-menu-id="admin"] .module-dropdown {
    left: auto;
    right: 0;
  }
}

@media (max-width: 1100px) {
  .command-trigger.compact {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    padding: 0;
  }

  .command-trigger.compact span:nth-child(2),
  .command-trigger.compact kbd {
    display: none;
  }
}


/* Keyboard-first sales order entry */
.lookup-option.active {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}

.product-result.active {
  background: var(--brand-soft);
  border-color: #e5b9c3;
  box-shadow: inset 3px 0 0 var(--brand);
}

.order-sheet tbody tr:focus-within {
  background: #fffafb;
  box-shadow: inset 3px 0 0 rgba(159, 31, 54, .38);
}

.keyboard-hintbar {
  font-weight: 650;
}

.order-save-actions .button.primary {
  min-width: 148px;
}

.sandbox-order-chip {
  color: #176147;
  background: #effaf5;
  border-color: #cde9dc;
}


/* Sales order register/edit/print */
.order-list-keyboard-hint {
  min-height: 34px;
  margin-bottom: 10px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #6f7d8f;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}

tr.keyboard-row-active td {
  background: #fff9fa;
}

tr.keyboard-row-active td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.row-actions .button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 10.5px;
}

.order-print-workbench {
  padding: 12px;
  background: #eef2f6;
}

.order-print-actions {
  max-width: 980px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.sales-order-paper {
  width: min(980px, 100%);
  min-height: 680px;
  margin: 0 auto;
  padding: 24px 28px;
  color: #202b39;
  background: #fff;
  border: 1px solid #d9e0e8;
  box-shadow: 0 18px 45px rgba(34, 48, 67, .11);
}

.sales-order-print-head {
  min-height: 84px;
  padding-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid #293647;
}

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

.sales-order-brand img {
  width: 150px;
  max-height: 58px;
  object-fit: contain;
}

.sales-order-brand > div {
  display: grid;
  gap: 2px;
}

.sales-order-brand strong {
  font-size: 15px;
}

.sales-order-brand span {
  color: #778496;
  font-size: 10.5px;
}

.sales-order-doc-title {
  display: grid;
  gap: 3px;
  text-align: right;
}

.sales-order-doc-title span {
  color: #7f8b9b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}

.sales-order-doc-title strong {
  color: var(--brand);
  font-size: 24px;
}

.sales-order-meta-grid {
  margin: 14px 0;
  display: grid;
  grid-template-columns: 1.5fr .8fr .8fr 1.2fr;
  gap: 8px;
}

.sales-order-meta-grid > div {
  min-height: 72px;
  padding: 9px 10px;
  display: grid;
  gap: 2px;
  align-content: start;
  background: #f8fafc;
  border: 1px solid #e6ebf1;
  border-radius: 7px;
}

.sales-order-meta-grid small {
  color: #8995a4;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.sales-order-meta-grid strong {
  color: #314055;
  font-size: 12px;
}

.sales-order-meta-grid span {
  color: #718094;
  font-size: 10px;
}

.sales-order-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.sales-order-print-table th {
  padding: 8px 7px;
  color: #687588;
  background: #f5f7fa;
  border-top: 1px solid #dfe5ed;
  border-bottom: 1px solid #dfe5ed;
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
}

.sales-order-print-table td {
  padding: 9px 7px;
  border-bottom: 1px solid #e7ebf0;
}

.sales-order-print-table tfoot td {
  padding-top: 13px;
  border-bottom: 0;
  border-top: 2px solid #293647;
}

.sales-order-print-foot {
  margin-top: 48px;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid #e0e5eb;
}

.sales-order-print-foot > div:first-child {
  display: grid;
  gap: 2px;
  max-width: 62%;
}

.sales-order-print-foot strong {
  font-size: 10px;
}

.sales-order-print-foot span {
  color: #7a8797;
  font-size: 9.5px;
  line-height: 1.4;
}

.signature-box {
  min-width: 180px;
  min-height: 70px;
  display: grid;
  align-content: end;
  text-align: center;
  border-top: 1px solid #7e8997;
}

@media print {
  body:has([data-order-print]) > * {
    visibility: hidden;
  }

  body:has([data-order-print]) [data-order-print],
  body:has([data-order-print]) [data-order-print] * {
    visibility: visible;
  }

  body:has([data-order-print]) [data-order-print] {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    background: #fff;
  }

  body:has([data-order-print]) .order-print-actions,
  body:has([data-order-print]) .module-tabs,
  body:has([data-order-print]) .page-head,
  body:has([data-order-print]) .workspace-foot {
    display: none;
  }

  body:has([data-order-print]) .sales-order-paper {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 12mm;
    border: 0;
    box-shadow: none;
  }
}

/* Strong keyboard focus for order operators */
.order-sheet input[data-order-field]:focus,
.order-customer-block input:focus,
.order-commandbar select:focus,
.order-commandbar textarea:focus {
  outline: 2px solid rgba(159, 31, 54, .42);
  outline-offset: 1px;
  background: #fff8fa;
}

.order-sheet tr:focus-within .line-no {
  color: var(--brand);
  font-weight: 850;
}

.keyboard-hintbar {
  position: sticky;
  bottom: 0;
  z-index: 8;
}


/* Finance FRD completion pass */
.finance-controlbar {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.finance-controlbar .compact-field {
  min-width: 150px;
  margin: 0;
}

.finance-controlbar .grow-field {
  min-width: 230px;
  flex: 1 1 230px;
}

.finance-control-note {
  align-self: center;
  color: #758294;
  font-size: 10.5px;
  font-weight: 650;
}

.check-control {
  min-height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
}

.finance-detail-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.finance-detail-card {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.finance-detail-card.span-two {
  grid-column: 1 / -1;
}

.mini-finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.mini-finance-table th,
.mini-finance-table td {
  padding: 8px;
  border-bottom: 1px solid #e6ebf1;
  text-align: left;
  vertical-align: middle;
}

.mini-finance-table th {
  color: #687588;
  background: #f6f8fb;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.mini-finance-table input[type="date"],
.mini-finance-table input[type="text"],
.mini-finance-table input[type="number"] {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #d7dee7;
  border-radius: 6px;
  background: #fff;
}

.finance-grand-total {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
}

.finance-grand-total span {
  margin-right: auto;
  color: #657387;
  font-weight: 750;
}

.finance-grand-total strong {
  color: var(--brand);
}

.master-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.voucher-context-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.voucher-context-panel[hidden],
.journal-grid-card[hidden] {
  display: none;
}

.impact-strip {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.impact-strip span,
.journal-use-grid span {
  padding: 5px 8px;
  color: #667587;
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 999px;
  font-size: 10px;
}

.journal-use-grid {
  margin-top: 9px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.entry-grid input {
  width: 100%;
  min-height: 31px;
  padding: 5px 7px;
  border: 1px solid #d7dee7;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.voucher-validation ul {
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.voucher-validation li {
  padding-left: 18px;
  position: relative;
  color: #728093;
  font-size: 10.5px;
}

.voucher-validation li::before {
  content: "•";
  position: absolute;
  left: 5px;
}

.voucher-validation li.ok {
  color: #176147;
}

.voucher-validation li.ok::before {
  content: "✓";
}

.voucher-validation li.bad {
  color: #a4253b;
}

.voucher-validation li.bad::before {
  content: "!";
}

.balance-chip.danger {
  color: #9b263c;
  background: #fff1f3;
  border-color: #efccd3;
}

.operator-hintbar {
  margin-top: 8px;
  min-height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #647287;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 650;
}

.workflow-steps {
  margin: 8px 0 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.workflow-steps span {
  min-height: 38px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  border: 1px solid #e1e6ed;
  border-radius: 7px;
  background: #f8fafc;
  color: #69788a;
  font-size: 10px;
  font-weight: 700;
}

.workflow-steps span.active {
  color: #8f1d33;
  background: #fff4f6;
  border-color: #e9bcc6;
}

.align-end {
  align-self: end;
}

.statement-line button,
.statement-line a {
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.statement-line button:hover,
.statement-line button:focus-visible,
.statement-line a:hover,
.statement-line a:focus-visible,
.report-breadcrumbs a:hover,
.report-breadcrumbs a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.report-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.statement-drill-panel {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.statement-drill-panel[hidden] {
  display: none;
}

.document-action-stack {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.brs-entry-table tr[data-state="Bounced"] {
  background: #fff8f8;
}

@media (max-width: 1100px) {
  .finance-detail-grid {
    grid-template-columns: 1fr;
  }

  .finance-detail-card.span-two {
    grid-column: auto;
  }

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

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

@media print {
  .finance-controlbar,
  .operator-hintbar,
  .toolbar-actions,
  .button,
  .topbar-wide,
  .module-tabs,
  .workspace-foot {
    display: none;
  }

  .finance-feature-workbench,
  .statement-workbench,
  .stock-monthly-workbench {
    border: 0;
    box-shadow: none;
  }
}


.voucher-register-preview {
  margin-top: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.segmented-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: #f3f6f9;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
}

.segmented-control button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #667487;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(36, 48, 66, .12);
}

[data-receipt-report-table][hidden] {
  display: none;
}


/* CRM full-solution + built-in documentation */
.crm-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

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

.crm-operator-workspace,
.crm-import-workbench,
.docs-home,
.docs-guide {
  padding: 10px;
}

.crm-controlbar {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.crm-controlbar .compact-field {
  min-width: 150px;
  margin: 0;
}

.crm-controlbar .grow-field {
  min-width: 250px;
  flex: 1 1 320px;
}

.crm-entry-panel {
  margin: 0 0 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(36,48,67,.06);
}

.crm-entry-panel[hidden] {
  display: none;
}

.crm-entry-panel .form-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.compact-panel {
  max-width: 1180px;
}

.funnel-stage-strip {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.funnel-stage-strip > div {
  min-height: 74px;
  padding: 10px;
  display: grid;
  gap: 2px;
  align-content: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.funnel-stage-strip > div.good {
  background: #f2faf6;
}

.funnel-stage-strip span,
.funnel-stage-strip small {
  color: #718094;
  font-size: 10px;
}

.funnel-stage-strip strong {
  font-size: 17px;
  color: #253247;
}

.crm-flow-strip {
  margin-bottom: 10px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff7f8;
  border: 1px solid #efd6dc;
  border-radius: 9px;
  color: #5f6d80;
  font-size: 10.5px;
  font-weight: 700;
}

.crm-flow-strip b {
  color: var(--brand);
}

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

.crm-import-card {
  min-height: 220px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.crm-import-card input[type="file"] {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.import-rule-list,
.import-mode-list {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.import-rule-list span,
.import-mode-list label {
  color: #68778b;
  font-size: 10.5px;
  line-height: 1.4;
}

.match-priority {
  margin: 10px 0;
  padding-left: 22px;
  color: #5f6d80;
  font-size: 10.5px;
  line-height: 1.7;
}

.import-preview-tabs {
  margin-top: 10px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.import-preview-tabs button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #6a788c;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.import-preview-tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.import-preview {
  min-height: 260px;
  padding: 12px 0;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 10.5px;
}

.import-preview-table th,
.import-preview-table td {
  padding: 8px;
  border-bottom: 1px solid #e6ebf1;
  text-align: left;
}

.import-preview-table th {
  color: #687588;
  background: #f6f8fb;
  font-size: 9px;
  text-transform: uppercase;
}

.docs-hero {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg,#fff 0%,#fff6f8 100%);
  border: 1px solid #ead9de;
  border-radius: 12px;
}

.docs-hero h2 {
  margin: 3px 0 4px;
  font-size: 24px;
}

.docs-hero p {
  margin: 0;
  color: #69778b;
  font-size: 11px;
}

.docs-kicker {
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.docs-card {
  min-height: 170px;
  padding: 16px;
  display: grid;
  gap: 7px;
  align-content: start;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.docs-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(36,48,67,.08);
}

.docs-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #fff2f5;
  border-radius: 9px;
}

.docs-card p {
  margin: 0;
  color: #68778b;
  line-height: 1.5;
  font-size: 10.5px;
}

.docs-card em {
  margin-top: 6px;
  color: var(--brand);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 750;
}

.docs-note-card {
  margin-top: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.docs-note-card p {
  margin: 4px 0 0;
  color: #6c7a8d;
  font-size: 10.5px;
}

.docs-flow {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 7px;
}

.docs-flow-step {
  min-height: 86px;
  padding: 9px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.docs-flow-step > b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  font-size: 10px;
}

.docs-flow-step span {
  display: grid;
  gap: 3px;
}

.docs-flow-step strong {
  font-size: 11px;
}

.docs-flow-step small {
  color: #728093;
  line-height: 1.35;
  font-size: 9.5px;
}

.docs-guide-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}

.docs-guide-card {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.docs-guide-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.docs-guide-row {
  padding: 8px 0;
  border-top: 1px solid #eef1f5;
}

.docs-guide-row:first-of-type {
  border-top: 0;
}

.docs-guide-row strong {
  display: block;
  margin-bottom: 2px;
  color: #344256;
  font-size: 10.5px;
}

.docs-guide-row p {
  margin: 0;
  color: #6c7a8d;
  line-height: 1.45;
  font-size: 10px;
}

.docs-checklist {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: #f2faf6;
  border: 1px solid #d6ebe0;
  border-radius: 9px;
}

.docs-checklist strong {
  margin-right: 6px;
  font-size: 10.5px;
}

.docs-checklist span {
  padding: 5px 8px;
  background: #fff;
  border: 1px solid #dbe8df;
  border-radius: 999px;
  color: #426b59;
  font-size: 9.5px;
  font-weight: 650;
}

@media (min-width: 901px) {
  .module-menu[data-menu-id="docs"] .module-dropdown {
    left: auto;
    right: 0;
  }
}

@media (max-width: 1100px) {
  .docs-flow {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .docs-guide-grid,
  .crm-import-grid {
    grid-template-columns: 1fr;
  }

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


/* Keep nine top-level modules collision-free after adding Documentation. */
@media (max-width: 1420px) and (min-width: 901px) {
  .command-trigger.compact {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    padding: 0;
  }

  .command-trigger.compact span:nth-child(2),
  .command-trigger.compact kbd {
    display: none;
  }
}

@media (max-width: 1060px) and (min-width: 901px) {
  .module-caret {
    display: none;
  }

  .module-link,
  .module-menu > summary {
    padding-inline: 5px;
    gap: 3px;
  }

  .top-modules {
    gap: 0;
  }
}


@media (max-width: 1420px) and (min-width: 901px) {
  .top-tools .connection {
    display: none;
  }
}


/* Authoritative connected ERP workspaces */
.authoritative-workbench {
  padding: 10px;
}

.authoritative-strip {
  margin-bottom: 10px;
  min-height: 38px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #f2faf6;
  border: 1px solid #d7eadf;
  border-radius: 9px;
  color: #526579;
  font-size: 10.5px;
}

.authoritative-strip .status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #2b805e;
  box-shadow: 0 0 0 3px rgba(43, 128, 94, .12);
}

.authoritative-strip strong {
  color: #285e49;
}

.authoritative-strip em {
  margin-left: auto;
  color: #668072;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 650;
}

@media (max-width: 760px) {
  .authoritative-strip em {
    width: 100%;
    margin-left: 16px;
  }
}

/* Finance keyboard-first typeahead: lightweight browser adapter, no accounting logic. */
.finance-typeahead {
  position: fixed;
  z-index: 5000;
  max-height: 280px;
  overflow: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(27, 39, 56, 0.16);
}

.finance-typeahead[hidden] {
  display: none;
}

.finance-typeahead-option {
  width: 100%;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #253448;
  cursor: pointer;
}

.finance-typeahead-option strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.finance-typeahead-option small {
  flex: 0 0 auto;
  color: #78879a;
  font-size: 9px;
}

.finance-typeahead-option:hover,
.finance-typeahead-option.active {
  background: #eef4fb;
  color: #173f6d;
}

.finance-form input[list]:focus,
.journal-grid-card input[list]:focus {
  border-color: #8eaccb;
  box-shadow: 0 0 0 2px rgba(71, 116, 159, 0.10);
}

/* Smart Finance Entry */
.smart-finance-entry {
  background: #f6f8fb;
}

.smart-finance-titlebar {
  padding: 14px 16px 10px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.smart-finance-titlebar > div:first-child {
  display: grid;
  gap: 3px;
}

.smart-finance-titlebar strong {
  font-size: 20px;
  color: #223146;
}

.smart-finance-titlebar small {
  color: #69788b;
  font-size: 11px;
}

.smart-entry-status {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 7px;
  padding: 7px 10px;
  background: #f3f8f5;
  border: 1px solid #d9e9df;
  border-radius: 9px;
}

.smart-entry-status small {
  grid-column: 2;
  color: #66796f;
  font-size: 9px;
}

.smart-status-dot {
  width: 8px;
  height: 8px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: #3f9568;
}

.smart-action-strip {
  padding: 9px 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 7px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.smart-action {
  min-height: 48px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #dce3ec;
  border-radius: 9px;
}

.smart-action strong {
  color: #334155;
  font-size: 11.5px;
}

.smart-action small {
  color: #7a8798;
  font-size: 9.5px;
}

.smart-action:hover {
  background: #f2f6fa;
  border-color: #c6d2df;
}

.smart-action.active {
  background: #fdf3f5;
  border-color: #d9a8b3;
  box-shadow: inset 3px 0 0 var(--brand);
}

.smart-action.active strong {
  color: var(--brand);
}

.smart-voucher-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.smart-entry-meta {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 145px 145px;
  gap: 8px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid #e0e6ee;
  border-radius: 9px;
}

.smart-entry-meta .field {
  margin: 0;
}

.smart-entry-meta .field > span {
  font-size: 9.5px;
  color: #6d7989;
}

.smart-entry-meta input,
.smart-entry-meta select {
  min-height: 34px;
}

.smart-flow-label {
  display: grid;
  grid-template-columns: 24px auto 1fr;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: #4c5a6c;
}

.smart-flow-label > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #586a80;
  font-size: 10px;
  font-weight: 800;
}

.smart-flow-label strong {
  font-size: 11px;
}

.smart-flow-label small {
  color: #8792a0;
  font-size: 9.5px;
}

.smart-entry-card {
  padding: 12px;
  border-color: #dce3ec;
  box-shadow: 0 2px 8px rgba(40, 52, 69, 0.04);
}

.smart-entry-card .finance-form {
  margin-bottom: 8px;
}

.smart-entry-card .field > span {
  font-weight: 700;
}

.smart-advanced {
  padding: 0;
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 8px;
}

.smart-advanced > summary {
  padding: 9px 11px;
  color: #657487;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
}

.smart-advanced[open] > summary {
  border-bottom: 1px solid #e6ebf1;
}

.smart-advanced .voucher-context-panel {
  margin: 0;
  border: 0;
  border-radius: 0 0 8px 8px;
}

.smart-context-card {
  background: #fff;
}

.smart-context-card .card-head {
  margin-bottom: 9px;
}

.smart-context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.smart-context-grid > div {
  padding: 7px 8px;
  display: grid;
  gap: 2px;
  background: #f7f9fb;
  border-radius: 7px;
}

.smart-context-grid span {
  color: #7a8796;
  font-size: 9px;
}

.smart-context-grid b {
  overflow: hidden;
  color: #344255;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button.primary.subtle {
  color: #3e5571;
  background: #edf3f9;
  border-color: #cbd8e5;
}

.button.primary.subtle:hover {
  background: #e4edf6;
}

@media (max-width: 1100px) {
  .smart-action-strip {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .smart-voucher-layout {
    grid-template-columns: 1fr;
  }

  .voucher-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .smart-finance-titlebar {
    align-items: start;
    flex-direction: column;
  }

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

  .smart-entry-meta {
    grid-template-columns: 1fr 1fr;
  }

  .smart-entry-meta .voucher-type-select {
    grid-column: 1 / -1;
  }

  .smart-context-grid {
    grid-template-columns: 1fr;
  }
}

.smart-side-more {
  padding: 0;
}

.smart-side-more > summary {
  padding: 11px 12px;
  color: #59697c;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 750;
}

.smart-side-more[open] > summary {
  border-bottom: 1px solid #e4e9ef;
}

.smart-side-more-body {
  padding: 11px 12px 12px;
  display: grid;
  gap: 8px;
}

.smart-side-more-body hr {
  width: 100%;
  height: 1px;
  margin: 2px 0;
  background: #e8edf2;
  border: 0;
}

.smart-context-link {
  display: inline-flex;
  margin-top: 8px;
  color: #4d6784;
  font-size: 9.5px;
  font-weight: 700;
  text-decoration: none;
}

.smart-context-link:hover {
  text-decoration: underline;
}

/* Finance report explorer — Tally-style depth with simplified controls */
.statement-period-panel,
.statement-config-panel {
  margin: 10px 12px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.statement-period-panel[hidden],
.statement-config-panel[hidden] {
  display: none;
}

.statement-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px 12px;
  margin: 10px 0 12px;
}

.report-explorer {
  margin: 12px 14px 14px;
  padding: 0;
  overflow: hidden;
}

.report-explorer-head {
  min-height: 46px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
}

.report-explorer-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: #69788a;
  font-size: 10.5px;
  white-space: nowrap;
}

.report-breadcrumbs span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-breadcrumbs b {
  color: #a0a9b6;
}

.report-explorer-title {
  padding: 10px 12px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.report-explorer-table-wrap {
  overflow-x: auto;
}

.report-explorer-table {
  width: 100%;
}

.report-explorer-table th,
.report-explorer-table td {
  min-width: 115px;
}

.report-explorer-table th:first-child,
.report-explorer-table td:first-child {
  min-width: 270px;
}

.report-row-link {
  width: 100%;
  padding: 5px 0;
  display: grid;
  gap: 2px;
  color: #344255;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.report-row-link strong {
  font-size: 11px;
}

.report-row-link small {
  color: #8290a0;
  font-size: 9px;
}

.report-row-link:hover strong,
.report-row-link:focus-visible strong {
  color: var(--brand);
  text-decoration: underline;
}

.report-explorer-table.stripe-view tbody tr:nth-child(even),
.report-striped-row:nth-child(even) {
  background: #f8fafc;
}

.voucher-source-card {
  margin: 12px;
  padding: 12px;
  background: #fffafb;
  border: 1px solid #eadde1;
  border-radius: 9px;
}

.voucher-source-card[hidden] {
  display: none;
}

.voucher-source-card .detail-grid {
  margin: 8px 0 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button.compact {
  min-height: 30px;
  padding: 0 9px;
  font-size: 10px;
}

@media (max-width: 980px) {
  .statement-config-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .report-explorer-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 640px) {
  .statement-config-grid,
  .voucher-source-card .detail-grid {
    grid-template-columns: 1fr;
  }
}


/* --------------------------------------------------------------------------
   2026 Finance UI visibility & usability pass
   Purpose: one readable visual system across entry, reports, controls and tables.
   No accounting/business behavior lives here.
   -------------------------------------------------------------------------- */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #f1f5f9;
  --text: #172033;
  --text-2: #3d4a5d;
  --muted: #667386;
  --line: #d8e0e9;
  --line-strong: #c4ceda;
  --brand: #9a1f39;
  --brand-2: #be3650;
  --brand-soft: #fff2f5;
  --success: #166b50;
  --warning: #956000;
  --danger: #b42318;
  --info: #2458a6;
  --shadow-sm: 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 10px 28px rgba(16,24,40,.08);
  --radius: 12px;
  --row: 48px;
  --font: Inter, "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 78% -20%, rgba(154,31,57,.045), transparent 38%),
    linear-gradient(180deg, #f7f9fc 0, #f3f6fa 100%);
}

button,
input,
select,
textarea {
  font-family: var(--font);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(36,88,166,.18);
  outline-offset: 2px;
}

.workspace {
  width: min(100%, 1860px);
  padding: 24px 28px 22px;
}

.topbar-wide {
  height: 64px;
  grid-template-columns: 205px minmax(0, 1fr) auto;
  padding: 0 18px;
  background: rgba(255,255,255,.98);
  border-bottom-color: #d8e0e8;
}

.top-modules {
  height: 64px;
  gap: 4px;
}

.top-brand-copy strong {
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -.01em;
}

.top-brand-copy small {
  font-size: 11px;
  color: #687487;
}

.module-link,
.module-menu > summary {
  min-height: 40px;
  height: 40px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 720;
  border-radius: 9px;
}

.module-option {
  min-height: 50px;
  padding: 8px 10px;
}

.module-option strong {
  font-size: 13.5px;
}

.module-option small {
  font-size: 11.5px;
  line-height: 1.35;
}

.connection {
  font-size: 12px;
}

.page-head {
  min-height: 102px;
}

.topnav-app .page-head h1 {
  font-size: clamp(30px, 2vw, 38px);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 780;
}

.topnav-app .page-head p {
  max-width: 980px;
  color: #526074;
  font-size: 14.5px;
  line-height: 1.55;
}

.page-head .eyebrow,
.editor-commandbar .eyebrow,
.account-title .eyebrow,
.smart-finance-titlebar .eyebrow {
  font-size: 11.5px;
  letter-spacing: .11em;
}

.button,
.pager-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 730;
}

.button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-button {
  width: 40px;
  height: 40px;
}

.field {
  gap: 6px;
}

.order-customer-block > label,
.order-meta-fields label > span,
.field > span,
.smart-entry-meta .field > span {
  color: #526074;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .015em;
  text-transform: none;
}

.field input,
.field textarea,
.field select,
.order-meta-fields input,
.order-meta-fields select,
.lookup-field > input[type="text"],
.search-box input {
  min-height: 40px;
  height: 40px;
  padding: 0 11px;
  color: #172033;
  background: #fff;
  border-color: #cfd8e3;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.field textarea {
  min-height: 78px;
  height: auto;
  padding: 10px 11px;
}

.field input::placeholder,
.field textarea::placeholder,
.search-box input::placeholder {
  color: #98a2b3;
  opacity: 1;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.order-meta-fields input:focus,
.order-meta-fields select:focus,
.lookup-field > input[type="text"]:focus {
  border-color: #8fa8c5;
  box-shadow: 0 0 0 3px rgba(36,88,166,.11);
}

.field-note,
.finance-control-note,
.operator-hintbar,
.order-hintbar,
.order-statusbar {
  color: #667386;
  font-size: 12px;
  line-height: 1.45;
}

.data-table {
  min-width: 900px;
}

.data-table th {
  height: 42px;
  padding: 0 14px;
  color: #526074;
  background: #f6f8fb;
  border-bottom: 1px solid #cfd8e3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .025em;
}

.data-table td {
  min-height: 48px;
  height: auto;
  padding: 10px 14px;
  color: #2f3c50;
  border-bottom-color: #e7ecf2;
  font-size: 14px;
  line-height: 1.42;
}

.data-table tbody tr:hover {
  background: #f6f9fc;
}

.data-table td strong,
.data-table .cell-link {
  font-size: 14px;
  font-weight: 740;
}

.cell-link {
  color: #244e86;
}

.align-right,
.data-table td:nth-last-child(-n+4),
.statement-line strong,
.statement-line em,
.statement-total strong,
.statement-total em,
.finance-grand-total b,
.finance-grand-total strong {
  font-variant-numeric: tabular-nums;
}

.badge,
.balance-chip,
.safety-chip,
.protect-chip {
  font-size: 12px;
}

.card-head strong,
.section-head strong {
  color: #253347;
  font-size: 14px;
  font-weight: 770;
}

.card-head span,
.section-head small {
  color: #687588;
  font-size: 12px;
  line-height: 1.4;
}

/* Smart Finance Entry */
.smart-finance-entry {
  background: #f4f7fa;
  border: 1px solid #dce3eb;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(16,24,40,.045);
  overflow: hidden;
}

.smart-finance-titlebar {
  min-height: 84px;
  padding: 16px 18px 14px;
  align-items: center;
  border-bottom-color: #dce3eb;
}

.smart-finance-titlebar strong {
  color: #1f2b3d;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 780;
  letter-spacing: -.02em;
}

.smart-finance-titlebar small {
  max-width: 850px;
  color: #5f6c7e;
  font-size: 13px;
  line-height: 1.45;
}

.smart-entry-status {
  min-width: 132px;
  padding: 9px 12px;
  border-radius: 10px;
}

.smart-entry-status b {
  font-size: 13px;
}

.smart-entry-status small {
  font-size: 11px;
}

.smart-action-strip {
  padding: 12px 14px;
  gap: 9px;
  background: #fff;
}

.smart-action {
  min-height: 64px;
  padding: 10px 12px;
  border-color: #d7dfe8;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16,24,40,.025);
}

.smart-action strong {
  color: #2a374a;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 760;
}

.smart-action small {
  color: #6d7a8c;
  font-size: 11.5px;
}

.smart-action:hover {
  background: #f7f9fc;
  border-color: #bfcbd8;
  box-shadow: 0 2px 6px rgba(16,24,40,.05);
}

.smart-action.active {
  background: #fff4f6;
  border-color: #d8a6b1;
  box-shadow: inset 4px 0 0 var(--brand), 0 1px 3px rgba(154,31,57,.06);
}

.smart-voucher-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.voucher-main {
  padding: 18px;
  gap: 14px;
}

.voucher-side {
  padding: 18px;
  gap: 12px;
  background: #f7f9fc;
}

.smart-entry-meta {
  grid-template-columns: minmax(220px, 1fr) 170px 170px;
  gap: 10px;
  padding: 12px;
  border-color: #d9e1ea;
  border-radius: 10px;
}

.smart-entry-meta input,
.smart-entry-meta select {
  min-height: 40px;
}

.smart-flow-label {
  grid-template-columns: 30px auto minmax(0,1fr);
  gap: 9px;
  min-height: 34px;
}

.smart-flow-label > span {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.smart-flow-label strong {
  color: #334155;
  font-size: 13px;
}

.smart-flow-label small {
  color: #718095;
  font-size: 11.5px;
}

.smart-entry-card,
.voucher-entry-card,
.journal-grid-card,
.rule-card,
.voucher-context-panel,
.finance-detail-card {
  border-color: #dbe2ea;
  border-radius: 11px;
  box-shadow: 0 1px 3px rgba(16,24,40,.035);
}

.smart-entry-card {
  padding: 15px;
}

.rule-card {
  padding: 14px;
}

.rule-card strong {
  font-size: 14px;
}

.rule-card p {
  color: #566477;
  font-size: 12.5px;
  line-height: 1.55;
}

.smart-context-grid {
  gap: 9px;
}

.smart-context-grid > div {
  min-height: 58px;
  padding: 9px 10px;
  background: #f5f8fb;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
}

.smart-context-grid span {
  color: #6a7789;
  font-size: 11px;
  font-weight: 650;
}

.smart-context-grid b {
  color: #26364b;
  font-size: 13px;
}

.smart-context-link,
.smart-advanced > summary,
.smart-side-more > summary {
  font-size: 12px;
}

.smart-advanced > summary,
.smart-side-more > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.check-control {
  min-height: 42px;
  padding: 0 11px;
  font-size: 12.5px;
}

.balance-chip {
  padding: 6px 10px;
  font-size: 12px;
}

.bill-allocation-table-wrap {
  border-color: #d8e0e9;
  border-radius: 9px;
}

.entry-grid {
  font-size: 13.5px;
}

.entry-grid th {
  padding: 10px 9px;
  color: #566477;
  font-size: 11.5px;
  font-weight: 800;
}

.entry-grid td {
  padding: 10px 9px;
}

.entry-grid input {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 13px;
}

.voucher-validation li {
  padding-left: 20px;
  color: #5f6d80;
  font-size: 12px;
  line-height: 1.45;
}

.upload-box {
  min-height: 84px;
  font-size: 12.5px;
}

.voucher-actions small {
  font-size: 11.5px;
}

/* Finance typeahead */
.finance-typeahead {
  max-height: 340px;
  padding: 6px;
  border-color: #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(15,23,42,.16);
}

.finance-typeahead-option {
  min-height: 44px;
  padding: 9px 11px;
}

.finance-typeahead-option strong {
  color: #243247;
  font-size: 13px;
}

.finance-typeahead-option small {
  color: #728095;
  font-size: 11px;
}

/* Finance controls & compact reports */
.finance-controlbar {
  gap: 10px;
  padding: 12px;
  background: #f7f9fc;
  border-color: #d8e0e9;
}

.finance-controlbar .compact-field {
  min-width: 168px;
}

.finance-controlbar .grow-field {
  min-width: 280px;
}

.mini-finance-table {
  font-size: 13px;
}

.mini-finance-table th {
  padding: 10px;
  color: #536174;
  background: #f5f8fb;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .025em;
}

.mini-finance-table td {
  padding: 10px;
  color: #314055;
  line-height: 1.4;
}

.mini-finance-table input[type="date"],
.mini-finance-table input[type="text"],
.mini-finance-table input[type="number"] {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 13px;
}

.finance-grand-total {
  padding: 12px 14px;
  background: #f6f8fb;
  font-size: 13px;
}

.finance-grand-total span {
  color: #536174;
}

.finance-grand-total b,
.finance-grand-total strong {
  font-size: 13px;
}

/* Balance Sheet / P&L / report explorer */
.statement-toolbar {
  min-height: 78px;
  padding: 12px 14px;
  align-items: end;
  background: #fff;
}

.period-controls {
  gap: 12px;
}

.period-controls .field {
  min-width: 240px;
}

.statement-columns {
  padding: 16px;
  gap: 14px;
}

.statement-panel {
  border-color: #d8e0e9;
  border-radius: 11px;
  box-shadow: 0 1px 3px rgba(16,24,40,.03);
}

.statement-title {
  min-height: 56px;
  padding: 0 14px;
  background: #f5f8fb;
}

.statement-title strong {
  font-size: 15px;
  font-weight: 780;
}

.statement-title span {
  color: #667386;
  font-size: 12px;
}

.statement-line,
.statement-total,
.profit-strip {
  min-height: 52px;
  padding: 0 14px;
  grid-template-columns: minmax(0, 1fr) 150px 145px;
  gap: 12px;
}

.statement-line span,
.statement-line a,
.statement-total span,
.profit-strip span {
  color: #334155;
  font-size: 13.5px;
}

.statement-line strong,
.statement-total strong,
.profit-strip strong {
  color: #1f2e43;
  font-size: 13.5px;
  font-weight: 760;
}

.statement-line em,
.statement-total em,
.profit-strip em {
  color: #667386;
  font-size: 12.5px;
}

.statement-line:hover {
  background: #f6f9fc;
}

.statement-footnote {
  min-height: 54px;
  padding: 10px 16px;
  color: #5f6d80;
  font-size: 12px;
  line-height: 1.45;
}

.statement-period-panel,
.statement-config-panel {
  margin: 12px 14px 0;
  padding: 14px;
  border-color: #d7dfe8;
  box-shadow: 0 4px 12px rgba(16,24,40,.045);
}

.statement-config-grid {
  grid-template-columns: repeat(4, minmax(175px, 1fr));
  gap: 10px 14px;
}

.report-explorer {
  margin: 14px 16px 16px;
  border: 1px solid #d7dfe8;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(16,24,40,.045);
}

.report-explorer-head {
  min-height: 54px;
  padding: 9px 12px;
  background: #f6f8fb;
}

.report-breadcrumbs {
  gap: 7px;
  color: #536174;
  font-size: 12.5px;
}

.report-breadcrumbs a {
  font-weight: 650;
}

.report-explorer-title {
  padding: 12px 14px;
}

.report-explorer-table th,
.report-explorer-table td {
  min-width: 125px;
}

.report-explorer-table th:first-child,
.report-explorer-table td:first-child {
  min-width: 320px;
}

.report-row-link {
  min-height: 36px;
  padding: 7px 0;
  align-content: center;
}

.report-row-link strong {
  color: #2d3b50;
  font-size: 13.5px;
  font-weight: 720;
}

.report-row-link small {
  color: #718095;
  font-size: 11px;
}

.voucher-source-card {
  margin: 14px;
  padding: 14px;
  border-color: #e0d4d8;
  border-radius: 10px;
}

.voucher-source-card .detail-grid {
  gap: 10px;
}

/* Dense information should still be legible on ordinary laptops */
@media (max-width: 1260px) {
  .workspace {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar-wide {
    grid-template-columns: 175px minmax(0,1fr) auto;
    padding: 0 12px;
  }

  .module-link,
  .module-menu > summary {
    padding: 0 8px;
    font-size: 12.5px;
  }

  .smart-action-strip {
    grid-template-columns: repeat(4, minmax(135px,1fr));
  }

  .smart-voucher-layout {
    grid-template-columns: minmax(0,1fr) 320px;
  }

  .statement-config-grid {
    grid-template-columns: repeat(3, minmax(170px,1fr));
  }
}

@media (max-width: 1080px) {
  .smart-action-strip {
    grid-template-columns: repeat(3, minmax(145px,1fr));
  }

  .smart-voucher-layout,
  .voucher-layout {
    grid-template-columns: 1fr;
  }

  .voucher-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .statement-config-grid {
    grid-template-columns: repeat(2, minmax(170px,1fr));
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 14px 10px 18px;
  }

  .topbar-wide {
    height: auto;
    min-height: 62px;
  }

  .smart-finance-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .smart-entry-meta {
    grid-template-columns: 1fr;
  }

  .smart-entry-meta .voucher-type-select {
    grid-column: auto;
  }

  .finance-detail-grid,
  .smart-context-grid,
  .statement-config-grid,
  .voucher-source-card .detail-grid {
    grid-template-columns: 1fr;
  }

  .statement-toolbar,
  .finance-controlbar {
    align-items: stretch;
    flex-direction: column;
  }

  .period-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .period-controls .field,
  .finance-controlbar .compact-field,
  .finance-controlbar .grow-field {
    min-width: 0;
    width: 100%;
  }

  .statement-line,
  .statement-total,
  .profit-strip {
    grid-template-columns: minmax(0,1fr) 110px 100px;
    padding: 0 10px;
  }
}


/* Laptop-width navigation: preserve readable labels instead of overflowing or hiding them. */
@media (max-width: 1500px) and (min-width: 761px) {
  .topbar-wide {
    height: auto;
    min-height: 72px;
    grid-template-columns: minmax(180px,1fr) auto;
    grid-template-areas:
      "brand tools"
      "modules modules";
    gap: 4px 12px;
    padding: 8px 14px;
  }

  .top-brand {
    grid-area: brand;
  }

  .top-tools {
    grid-area: tools;
    justify-self: end;
  }

  .top-modules {
    grid-area: modules;
    width: 100%;
    height: auto;
    min-height: 42px;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: 4px;
    overflow: visible;
  }

  .module-link,
  .module-menu > summary {
    min-height: 36px;
    height: 36px;
    padding: 0 9px;
    font-size: 12.5px;
  }

  .module-dropdown {
    top: calc(100% + 5px);
  }
}


/* Finance sub-navigation remains readable and easy to scan. */
.module-tabs {
  min-height: 50px;
  padding: 6px;
  gap: 5px;
  border-color: #d8e0e9;
  border-radius: 11px;
}

.module-tab {
  min-height: 38px;
  padding: 0 13px;
  color: #4e5c70;
  font-size: 13px;
  font-weight: 730;
}

.module-tab.active {
  box-shadow: 0 3px 9px rgba(154,31,57,.16);
}


/* GSTR-1 return control and deep-drill workflow */
.gst-return-status-grid {
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.gst-return-status-grid > a {
  min-height: 96px;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 5px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.gst-return-status-grid > a:hover,
.gst-return-status-grid > a:focus-visible {
  border-color: #aebdce;
  background: #f8fafc;
  box-shadow: 0 6px 18px rgba(15,23,42,.07);
}

.gst-return-status-grid > a.warning {
  border-color: #e6c66e;
  background: #fffaf0;
}

.gst-return-status-grid span {
  color: #5a687c;
  font-size: 12px;
  font-weight: 720;
}

.gst-return-status-grid strong {
  color: #1f2d42;
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.gst-return-status-grid small {
  color: #738095;
  font-size: 11.5px;
}

.gst-control-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gst-drill-explorer {
  margin-top: 2px;
  overflow: hidden;
}

.gst-drill-explorer[hidden],
.gst-voucher-card[hidden] {
  display: none;
}

.gst-drill-head {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.gst-breadcrumbs {
  min-height: 42px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.gst-breadcrumbs a {
  color: #3f5572;
  font-weight: 680;
}

.gst-breadcrumbs a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.gst-drill-table {
  min-width: 980px;
}

.gst-drill-table td,
.gst-drill-table th {
  font-variant-numeric: tabular-nums;
}

.gst-voucher-card {
  margin: 14px 0 0;
}

.compact-table-shell {
  max-height: 360px;
  min-height: 0;
}

@media (max-width: 1050px) {
  .gst-return-status-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .gst-return-status-grid {
    grid-template-columns: 1fr;
  }
}


/* --------------------------------------------------------------------------
   Responsive application + login polish for ci.erp.aiotor.com
   -------------------------------------------------------------------------- */
.logout-form {
  margin: 0;
}

.login-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(154,31,57,.10), transparent 34%),
    radial-gradient(circle at 82% 4%, rgba(36,88,166,.08), transparent 31%),
    linear-gradient(145deg, #f7f9fc, #eef3f8);
}

.login-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(380px,.85fr);
  overflow: hidden;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(197,208,220,.88);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(16,24,40,.14);
}

.login-brand-panel {
  min-width: 0;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 44px;
  background:
    linear-gradient(155deg, rgba(255,255,255,.98), rgba(248,244,246,.96)),
    #fff;
  border-right: 1px solid var(--line);
}

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

.login-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 15px;
  box-shadow: 0 7px 18px rgba(154,31,57,.18);
}

.login-brand-lockup > div {
  display: grid;
  gap: 2px;
}

.login-brand-lockup strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.login-brand-lockup span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.login-brand-copy {
  max-width: 560px;
}

.login-brand-copy .eyebrow,
.login-card-head .eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-brand-copy h1 {
  margin: 10px 0 16px;
  max-width: 560px;
  color: #172033;
  font-size: clamp(38px,4vw,58px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 820;
}

.login-brand-copy p {
  margin: 0;
  max-width: 520px;
  color: #59687c;
  font-size: 16px;
  line-height: 1.65;
}

.login-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: #637186;
  font-size: 12px;
  font-weight: 680;
}

.login-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-trust-row svg {
  width: 15px;
  height: 15px;
}

.login-card-wrap {
  padding: 42px;
  display: grid;
  place-items: center;
  background: #fbfcfe;
}

.login-card {
  width: min(100%, 390px);
  display: grid;
  gap: 18px;
}

.login-card-head {
  margin-bottom: 4px;
}

.login-card-head h2 {
  margin: 8px 0 6px;
  color: #1b2738;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 800;
}

.login-card-head p {
  margin: 0;
  color: #687588;
  font-size: 14px;
  line-height: 1.5;
}

.login-field {
  gap: 7px;
}

.login-field > span {
  color: #46556a;
  font-size: 12.5px;
  font-weight: 760;
}

.login-field input {
  min-height: 48px;
  height: 48px;
  padding: 0 13px;
  font-size: 15px;
  border-radius: 10px;
}

.login-submit {
  min-height: 48px;
  height: 48px;
  margin-top: 2px;
  font-size: 14px;
  border-radius: 10px;
}

.login-error {
  padding: 11px 12px;
  color: #9f1c18;
  background: #fff3f2;
  border: 1px solid #f2c6c3;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
}

.login-footnote {
  margin: 2px 0 0;
  color: #8490a0;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}

.table-shell,
.report-explorer-table-wrap,
.bill-allocation-table-wrap,
.compact-table-shell {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.module-tabs {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.module-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .login-shell {
    width: min(720px, calc(100% - 24px));
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    padding: 28px 30px;
    gap: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-brand-copy h1 {
    max-width: 650px;
    font-size: clamp(30px,7vw,42px);
  }

  .login-brand-copy p {
    font-size: 14px;
  }

  .login-trust-row {
    display: none;
  }

  .login-card-wrap {
    padding: 30px;
  }
}

@media (max-width: 760px) {
  body:not(.login-body) {
    overflow-x: hidden;
  }

  .topbar-wide {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 0;
    padding: 8px 10px 7px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
      "brand tools"
      "modules modules";
    gap: 7px 8px;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(14px);
  }

  .top-brand {
    grid-area: brand;
    min-width: 0;
  }

  .top-brand-copy small {
    display: none;
  }

  .top-tools {
    grid-area: tools;
    gap: 6px;
  }

  .command-trigger.compact {
    width: 38px;
    min-width: 38px;
    padding: 0;
    justify-content: center;
  }

  .command-trigger.compact > span:not(.search-glyph),
  .command-trigger.compact kbd,
  .connection-text {
    display: none;
  }

  .connection {
    min-width: 28px;
    justify-content: center;
    padding: 0 8px;
  }

  .top-modules {
    grid-area: modules;
    width: 100%;
    min-height: 42px;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    padding-bottom: 1px;
  }

  .top-modules::-webkit-scrollbar {
    display: none;
  }

  .module-link,
  .module-menu {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .module-link,
  .module-menu > summary {
    min-height: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .module-dropdown {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 92px;
    width: auto;
    max-height: min(66vh, 520px);
    overflow-y: auto;
    border-radius: 12px;
  }

  .workspace {
    width: 100%;
    padding: 12px 10px 20px;
  }

  .page-head {
    min-height: 0;
    margin-bottom: 12px;
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav-app .page-head h1 {
    font-size: 28px;
  }

  .topnav-app .page-head p {
    font-size: 13px;
  }

  .head-actions,
  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .finance-controlbar,
  .statement-toolbar {
    padding: 10px;
    border-radius: 10px;
  }

  .smart-action-strip {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    scroll-snap-type: x proximity;
  }

  .smart-action {
    flex: 0 0 min(72vw, 240px);
    scroll-snap-align: start;
  }

  .smart-finance-titlebar strong {
    font-size: 21px;
  }

  .voucher-main,
  .voucher-side {
    padding: 12px;
  }

  .data-table {
    min-width: 780px;
  }

  .data-table th,
  .data-table td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .statement-line,
  .statement-total,
  .profit-strip {
    min-height: 58px;
    grid-template-columns: minmax(0,1fr) 112px;
    gap: 8px;
  }

  .statement-line em,
  .statement-total em,
  .profit-strip em {
    display: none;
  }

  .statement-line strong,
  .statement-total strong,
  .profit-strip strong {
    text-align: right;
  }

  .report-explorer {
    margin-left: 0;
    margin-right: 0;
  }

  .report-explorer-head,
  .gst-drill-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .report-explorer-nav,
  .report-explorer-head .toolbar-actions,
  .gst-drill-head .toolbar-actions {
    width: 100%;
  }

  .gst-return-status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gst-return-status-grid > a {
    min-height: 88px;
  }

  .gst-return-status-grid strong {
    font-size: 22px;
  }
}

@media (max-width: 520px) {
  .login-body {
    place-items: stretch;
    background: #f6f8fb;
  }

  .login-shell {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand-panel {
    padding: 22px 20px 20px;
  }

  .login-brand-copy h1 {
    margin-top: 8px;
    font-size: 30px;
  }

  .login-brand-copy p {
    display: none;
  }

  .login-card-wrap {
    padding: 26px 20px 34px;
    align-items: start;
  }

  .login-card {
    width: 100%;
  }

  .gst-return-status-grid {
    grid-template-columns: 1fr;
  }

  .smart-action {
    flex-basis: 82vw;
  }
}
