/* WARISHA ERP premium UI — textile factory look.
   Sirf CSS variables + local styles; koi CDN/image URL nahi. */

:root {
  /* Palette — navy/charcoal, teal accent, sand/copper highlight. */
  --navy-950: #0b1220;
  --navy-900: #111b2e;
  --navy-800: #18263d;
  --navy-700: #243552;
  --teal-500: #1f8a86;
  --teal-400: #2aa8a2;
  --teal-100: #d8f1ef;
  --sand-100: #f6f1e8;
  --sand-50: #fbf8f3;
  --copper-500: #c47a3a;
  --copper-600: #a8642c;
  --ink: #152033;
  --muted: #5c6b80;
  --line: rgba(21, 32, 51, 0.12);
  --line-strong: rgba(21, 32, 51, 0.2);
  --danger: #a33b3b;
  --ok: #1f7a4d;
  --surface: var(--sand-50);
  --surface-2: #ffffff;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.06);
  --shadow-md: 0 10px 30px rgba(11, 18, 32, 0.14);
  --shadow-lg: 0 24px 60px rgba(11, 18, 32, 0.22);
  --radius-sm: 0.45rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --sidebar-w: 16.5rem;
  /* Local font stack — CDN fonts avoid; industrial + readable. */
  --font-display: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

/* Unified Finance workspace — list aur hierarchy aik connected surface mein. */
.coa-workspace {
  min-width: 0;
}

.coa-workspace-header {
  align-items: center;
}

.coa-print-notice {
  margin-top: -0.35rem;
}

.coa-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 1 auto;
  min-width: 0;
}

.coa-print-chart-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: right;
}

.btn.coa-print-chart-btn {
  flex: 0 0 auto;
}

.btn.coa-hierarchy-toggle {
  display: none;
}

.coa-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.erp-subnav-link.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
}

.coa-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
  gap: 1rem;
  align-items: start;
  min-width: 0;
}

.coa-workspace-main {
  min-width: 0;
}

.coa-content-card,
.coa-hierarchy-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.coa-content-card {
  overflow: hidden;
}

.coa-content-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.coa-content-toolbar h3,
.coa-hierarchy-head h3,
.coa-form-sheet-head h3 {
  margin: 0;
  color: var(--navy-900);
}

.coa-content-toolbar p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.coa-compact-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  background: var(--sand-100);
  border-bottom: 1px solid var(--line);
}

.coa-compact-search .erp-search-combo {
  flex: 1 1 18rem;
}

.coa-search-combo {
  width: min(100%, 30rem);
  max-width: 30rem;
}

.coa-inline-empty {
  margin: 1rem;
}

.coa-hierarchy-panel {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 10rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.coa-hierarchy-head,
.coa-form-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.coa-hierarchy-kicker,
.coa-form-sheet-kicker {
  margin: 0 0 0.15rem;
  color: var(--teal-500);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.erp-btn-icon.coa-hierarchy-close {
  display: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
}

.coa-hierarchy-clear {
  display: block;
  margin: 0.7rem 0.8rem 0;
  color: var(--teal-500);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.coa-tree {
  min-width: 0;
  padding: 0.65rem;
  overflow-x: hidden;
}

.coa-tree-list,
.coa-tree-children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.coa-tree-list {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.coa-tree-item,
.coa-tree-branch {
  min-width: 0;
}

.coa-tree-branch {
  border-radius: var(--radius-sm);
}

.coa-tree-row,
.coa-tree-branch > summary {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 2.75rem;
  list-style: none;
}

.coa-tree-branch > summary::-webkit-details-marker {
  display: none;
}

.coa-tree-toggle,
.coa-tree-toggle-spacer {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
}

.coa-tree-toggle {
  color: var(--muted);
  cursor: pointer;
}

.coa-tree-toggle svg {
  box-sizing: content-box;
  width: 0.8rem;
  height: 0.8rem;
  padding: 0.08rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.2rem;
  background: var(--surface-2);
}

.coa-tree-minus {
  display: none;
}

.coa-tree-branch[open] > summary .coa-tree-plus {
  display: none;
}

.coa-tree-branch[open] > summary .coa-tree-minus {
  display: block;
}

.coa-tree-node {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) 0.45rem;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.35rem 0.55rem 0.35rem 0.2rem;
  border-radius: var(--radius-sm);
  color: var(--navy-800);
  text-decoration: none;
}

.coa-tree-node:hover,
.coa-tree-node.is-selected {
  background: rgb(31 138 134 / 9%);
  color: var(--teal-500);
}

.coa-tree-node.is-selected {
  box-shadow: inset 2px 0 0 var(--teal-500);
}

.coa-tree-icon {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--copper-500);
}

.coa-tree-icon--document {
  color: var(--muted);
}

.coa-tree-node-copy {
  display: grid;
  min-width: 0;
}

.coa-tree-label {
  overflow: hidden;
  font-size: 0.81rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coa-tree-node.is-selected .coa-tree-label {
  font-weight: 700;
}

.coa-tree-node-copy small {
  margin-top: 0.05rem;
  color: var(--muted);
  font-size: 0.66rem;
}

.coa-tree-status {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--line-strong);
}

.coa-tree-status.is-active {
  background: var(--teal-500);
}

.coa-tree-children {
  position: relative;
  display: grid;
  gap: 0.05rem;
  margin: 0 0 0.25rem 1.375rem;
  padding-left: 0.85rem;
}

.coa-tree-children::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 1.38rem;
  left: 0;
  border-left: 1px solid var(--line-strong);
}

.coa-tree-child {
  position: relative;
  display: grid;
  grid-template-columns: 0.7rem minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.coa-tree-child::before {
  content: "";
  position: absolute;
  top: 1.38rem;
  left: -0.85rem;
  width: 1rem;
  border-top: 1px solid var(--line-strong);
}

.coa-tree-child > .coa-tree-toggle-spacer {
  width: 0.7rem;
  height: 2.75rem;
}

.coa-tree-child--expandable {
  display: block;
}

.coa-tree-child--expandable > .coa-tree-branch {
  min-width: 0;
}

.coa-tree-row--nested {
  grid-template-columns: 0.7rem minmax(0, 1fr);
}

.coa-tree-row--nested .coa-tree-toggle {
  width: 0.7rem;
  height: 2.75rem;
}

.coa-tree-row--nested .coa-tree-toggle svg {
  width: 0.72rem;
  height: 0.72rem;
  padding: 0.05rem;
}

.coa-tree-node--child {
  padding-left: 0.1rem;
}

.coa-tree-empty,
.coa-tree-empty-state {
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.coa-drawer-backdrop,
.coa-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgb(7 20 38 / 52%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
}

/*
  Author `display: block` [hidden] UA rule ko override na kare —
  warna mobile pe closed drawer backdrop bhi tap intercept karta hai.
*/
.coa-drawer-backdrop[hidden],
.coa-sheet-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.coa-form-sheet {
  position: fixed;
  z-index: 150;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(40rem, calc(100vw - var(--sidebar-w)));
  height: 100dvh;
  background: var(--surface);
  box-shadow: -18px 0 48px rgb(7 20 38 / 22%);
  transform: translateX(105%);
  transition: transform 200ms ease;
  pointer-events: auto;
}

.coa-form-sheet.is-open {
  transform: translateX(0);
}

.coa-form-sheet-head {
  padding: 1rem 1.2rem;
}

.coa-form-sheet-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1.1rem 1.2rem;
}

.coa-sheet-form-row {
  align-content: start;
}

/* Account Head sheet — Account Type guide (form fields ke neeche compact help). */
.coa-type-guide {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    165deg,
    rgb(31 138 134 / 6%) 0%,
    var(--surface-2) 55%
  );
}

.coa-type-guide-title {
  margin: 0 0 0.65rem;
  color: var(--navy-800);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.coa-type-guide-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.coa-type-guide-item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.coa-type-guide-icon {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 0.05rem;
  border-radius: 0.35rem;
  background: rgb(31 138 134 / 10%);
  color: var(--teal-500);
}

.coa-type-guide-copy strong {
  display: block;
  color: var(--navy-800);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
}

.coa-type-guide-copy p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* Account Type LOV — short labels; selected bold teal; trigger truncate nahi. */
.coa-account-type-lov .erp-lov-trigger-value {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.coa-account-type-lov .erp-lov-option {
  color: var(--navy-800);
  font-weight: 500;
}

.coa-account-type-lov .erp-lov-option[aria-selected="true"] {
  color: var(--teal-500);
  font-weight: 700;
}

.coa-account-type-lov .erp-lov-option[aria-selected="true"] .erp-lov-option-description {
  overflow: visible;
  text-overflow: clip;
  font-weight: 700;
}

.coa-party-details {
  display: grid;
  gap: 1rem;
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.coa-party-details[hidden] {
  display: none;
}

.coa-party-section {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.coa-party-section-title {
  margin: 0;
  color: var(--navy-800);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.coa-form-sheet-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

body.coa-overlay-open {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 960px) {
  .coa-workspace-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .btn.coa-hierarchy-toggle,
  .erp-btn-icon.coa-hierarchy-close {
    display: inline-flex;
  }

  .coa-hierarchy-panel {
    position: fixed;
    /* Form sheet (200) se neeche — warna mobile pe sheet taps block. */
    z-index: 180;
    top: 0;
    right: 0;
    width: min(22rem, 92vw);
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform 200ms ease;
    pointer-events: auto;
  }

  .coa-hierarchy-panel.is-open {
    transform: translateX(0);
  }

  /* Sirf jab drawer open ho — [hidden] pe force display:block mat do. */
  .coa-drawer-backdrop:not([hidden]) {
    display: block;
    z-index: 170;
  }

  /*
    Mobile/tablet: backdrop-filter stacking (Safari) sheet ke upar paint kar sakti thi.
    Sheet clearly above sheet-backdrop; backdrop only closes on outside tap.
  */
  .coa-sheet-backdrop {
    z-index: 190;
  }

  .coa-form-sheet {
    z-index: 200;
    width: min(40rem, 100vw);
    pointer-events: auto;
  }
}

@media (max-width: 640px) {
  .coa-workspace-header {
    align-items: stretch;
  }

  .coa-workspace-header .oracle-conn-card {
    width: 100%;
    flex: 1 1 auto;
    max-width: none;
  }

  .coa-hierarchy-toggle {
    width: 100%;
    justify-content: center;
  }

  .coa-tabs {
    margin-inline: -0.15rem;
    padding-bottom: 0.25rem;
  }

  .coa-tabs .erp-subnav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .coa-content-toolbar,
  .coa-compact-search {
    align-items: stretch;
    flex-direction: column;
  }

  .coa-toolbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .coa-toolbar-actions .btn,
  .coa-content-toolbar .btn,
  .coa-compact-search .erp-search-combo {
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  .coa-form-sheet {
    width: 100vw;
  }

  .coa-form-sheet-body {
    padding: 1rem;
  }

  .coa-form-sheet-actions {
    position: sticky;
    bottom: -1rem;
    flex-wrap: wrap;
    margin-inline: -1rem;
    padding: 0.8rem 1rem 1rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .coa-form-sheet-actions .btn,
  .coa-form-sheet-actions .erp-inline-form {
    flex: 1 1 8rem;
  }

  .coa-form-sheet-actions .erp-inline-form .btn {
    width: 100%;
  }

  .coa-type-guide {
    margin-top: 0.85rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--navy-950);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

/* Subtle woven grid — pure CSS texture, no images. */
.weave-bg {
  background-color: var(--navy-900);
  background-image:
    linear-gradient(rgba(42, 168, 162, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 122, 58, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
    radial-gradient(ellipse at 20% 10%, rgba(42, 168, 162, 0.18), transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(196, 122, 58, 0.12), transparent 45%);
  background-size:
    22px 22px,
    22px 22px,
    44px 44px,
    100% 100%,
    100% 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.eyebrow,
.brand-mark,
.meta-label,
.nav-label,
.topbar-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--teal-400);
}

.lede {
  color: var(--muted);
  font-size: 0.95rem;
}

.flash-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff8f0;
  font-size: 0.92rem;
}

.flash-error {
  color: var(--danger);
  border-color: rgba(163, 59, 59, 0.25);
  background: #fff1f0;
}

.flash-success {
  color: var(--ok);
  border-color: rgba(31, 122, 77, 0.25);
  background: #effaf3;
}

/* Reusable buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--teal-400), var(--teal-500));
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 138, 134, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #33b3ad, #1a7c78);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: rgba(21, 32, 51, 0.04);
}

/* Secondary — Cancel/Back; primary se quieter (shadcn-style quiet action). */
.btn-secondary {
  background: #fff;
  border-color: rgba(21, 32, 51, 0.16);
  color: var(--navy-700);
  box-shadow: none;
  font-weight: 650;
}

.btn-secondary:hover {
  background: rgba(21, 32, 51, 0.04);
  border-color: rgba(21, 32, 51, 0.28);
  color: var(--ink);
}

.btn-block {
  width: 100%;
}

.btn-compact {
  min-height: 2.35rem;
  padding-inline: 0.9rem;
}

/* ---------- Login ---------- */
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-hero {
  display: grid;
  place-items: center;
  padding: var(--space-7) var(--space-6);
  color: #e8eef7;
}

.login-hero-inner {
  width: min(100%, 28rem);
  text-align: left;
}

.hero-brand {
  margin: 0.3rem 0 0;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.hero-tag {
  color: rgba(232, 238, 247, 0.78);
  max-width: 22rem;
}

.hero-points {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.375rem;
}

.hero-points li {
  position: relative;
  padding-left: 1.2rem;
  color: rgba(232, 238, 247, 0.88);
  font-size: 0.95rem;
}

.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--copper-500);
  box-shadow: 0 0 0 3px rgba(196, 122, 58, 0.25);
}

.login-main {
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background:
    linear-gradient(160deg, rgba(246, 241, 232, 0.96), rgba(251, 248, 243, 0.98));
}

.login-card {
  width: min(100%, 22.5rem);
  padding: var(--space-5) var(--space-5) var(--space-6);
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-card-head {
  margin-bottom: var(--space-4);
}

.login-card-head h1 {
  margin-top: 0.3rem;
  font-size: 1.65rem;
}

.login-card-head .lede {
  font-size: 0.88rem;
}

.login-form {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

/* Strong label — saari forms (login + masters) ek hi system. */
.field-label,
.ui-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--navy-800);
  line-height: 1.3;
}

/* Shared premium input — WARISHA teal focus; black shadcn theme nahi. */
.field-input,
.ui-input,
select.field-input,
select.ui-input,
textarea.field-input,
textarea.ui-input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(21, 32, 51, 0.16);
  border-radius: 0.55rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
  line-height: 1.35;
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field-input::placeholder,
.ui-input::placeholder {
  color: rgba(92, 107, 128, 0.75);
}

.field-input:hover:not(:disabled):not([readonly]),
.ui-input:hover:not(:disabled):not([readonly]) {
  border-color: rgba(31, 138, 134, 0.35);
}

.field-input:focus,
.ui-input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(31, 138, 134, 0.16);
  background: #fff;
}

.field-input:disabled,
.ui-input:disabled {
  background: #eef2f6;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.92;
}

/* Login — shared ui-input use; pehle alag compact override ab unify. */
.page-login .field-input,
.page-login .ui-input {
  min-height: 2.55rem;
  background: var(--sand-50);
}

.page-login .field-input:focus,
.page-login .ui-input:focus {
  background: #fff;
}

/* Financial Period — premium row; sirf FY code, dates nahi. */
.period-field {
  display: grid;
  gap: 0.35rem;
}

.period-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.55rem;
  padding: 0.2rem 0.55rem 0.2rem 0.7rem;
  border: 1px solid rgba(26, 54, 93, 0.14);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 241, 232, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.period-control:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(31, 138, 134, 0.16);
}

.period-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.4rem;
  color: var(--teal-700, #1f6f6c);
  background: rgba(31, 138, 134, 0.1);
}

.period-select {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.15rem;
  padding: 0.35rem 1.6rem 0.35rem 0.15rem;
  border: none;
  background: transparent;
  color: var(--navy-800);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  appearance: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231a365d' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
}

.period-select:focus {
  outline: none;
}

/*
  Shared LOV — source <select> sirf option data ke liye hai; UI hamesha custom
  trigger/listbox use karti hai (native select fallback nahi).
*/
.erp-lov {
  position: relative;
  width: 100%;
  min-width: 0;
}

/* Native OS select kabhi interactive UI ke tor pe nahi dikhe. */
.erp-lov .erp-lov-source {
  display: none !important;
}

.erp-lov[data-lov-searchable="false"] .erp-lov-search-wrap {
  display: none !important;
}

.erp-lov-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem 0.55rem 0.8rem;
  border: 1px solid rgba(21, 32, 51, 0.16);
  border-radius: 0.55rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  /* Native blue highlight / OS grey popup feel avoid karo. */
  -webkit-tap-highlight-color: transparent;
}

.erp-lov.is-enhanced .erp-lov-trigger {
  display: flex;
}

.erp-lov-trigger:hover:not(:disabled) {
  border-color: rgba(31, 138, 134, 0.38);
}

.erp-lov-trigger:focus-visible,
.erp-lov.is-open .erp-lov-trigger {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(31, 138, 134, 0.16);
}

.erp-lov-trigger[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(180 52 52 / 13%);
}

.erp-lov-trigger:disabled,
.erp-lov-trigger[aria-readonly="true"] {
  background: #eef2f6;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.92;
}

.erp-lov-trigger-copy {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.erp-lov-trigger-value {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-lov-trigger-value.is-placeholder {
  color: rgba(92, 107, 128, 0.78);
}

.erp-lov-trigger-code {
  flex: 0 0 auto;
  color: var(--teal-500);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.erp-lov-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 150ms ease;
}

.erp-lov.is-open .erp-lov-chevron {
  transform: rotate(180deg);
}

.erp-lov-popup {
  position: fixed;
  /* Body portal — COA sheet (z 150) aur topbar overlays se upar. */
  z-index: 2600;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.35rem;
  border: 1px solid rgba(21, 32, 51, 0.16);
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 18px 45px rgb(7 20 38 / 20%), 0 3px 10px rgb(7 20 38 / 10%);
  overflow: hidden;
}

.erp-lov-popup[hidden] {
  display: none;
}

.erp-lov-search-wrap {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  align-items: center;
  min-height: 2.65rem;
  margin-bottom: 0.3rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.48rem;
  color: var(--muted);
  background: var(--sand-50);
}

.erp-lov-search-wrap[hidden] {
  display: none;
}

.erp-lov-search {
  width: 100%;
  min-width: 0;
  height: 2.55rem;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
}

.erp-lov-search::placeholder {
  color: rgba(92, 107, 128, 0.78);
}

.erp-lov-list {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.erp-lov-option {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.15rem;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.48rem 0.65rem;
  border: 0;
  border-radius: 0.42rem;
  background: transparent;
  color: var(--navy-800);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.erp-lov-option:hover:not(:disabled),
.erp-lov-option.is-active:not(:disabled) {
  outline: none;
  background: rgb(31 138 134 / 9%);
  color: var(--teal-500);
}

.erp-lov-option[aria-selected="true"] {
  background: rgb(31 138 134 / 12%);
  color: var(--teal-500);
}

.erp-lov-option:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.58;
}

.erp-lov-option-copy {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.erp-lov-option-code {
  flex: 0 0 auto;
  color: var(--teal-500);
  font-size: 0.72rem;
  font-weight: 750;
}

.erp-lov-option-description {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-lov-check {
  visibility: hidden;
  color: var(--teal-500);
}

.erp-lov-option[aria-selected="true"] .erp-lov-check {
  visibility: visible;
}

.erp-lov-empty {
  margin: 0;
  padding: 0.9rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/*
  Multi-column grid LOV — Oracle Forms-style Account/Party picker.
  Reusable: data-lov-layout="grid" + data-lov-columns="account-hierarchy".
*/
.erp-lov-popup.is-grid {
  padding: 0.4rem;
}

.erp-lov-list--grid {
  overflow: hidden;
}

.erp-lov-grid-scroll {
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: #fff;
  max-height: 18rem;
}

.erp-lov-grid {
  /*
    Column widths — single source for header/data alignment (table-layout: fixed).
    Sum must fit longest header ("Account Category · Level 1") on one line.
  */
  --erp-lov-col-code: 4.5rem;
  --erp-lov-col-description: 12.5rem;
  --erp-lov-col-head: 11.75rem;
  --erp-lov-col-group: 12.25rem;
  --erp-lov-col-category: 14.25rem;
  width: max(
    100%,
    calc(
      var(--erp-lov-col-code) + var(--erp-lov-col-description) +
        var(--erp-lov-col-head) + var(--erp-lov-col-group) +
        var(--erp-lov-col-category)
    )
  );
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.8rem;
}

.erp-lov-grid thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: #f3f0ea;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
}

.erp-lov-grid-row {
  cursor: pointer;
  color: var(--navy-800);
}

.erp-lov-grid-row td {
  padding: 0.42rem 0.55rem;
  border-bottom: 1px solid rgba(21, 32, 51, 0.06);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-lov-grid thead th:first-child,
.erp-lov-grid-row td:first-child {
  padding-left: 0.65rem;
}

.erp-lov-grid thead th:last-child,
.erp-lov-grid-row td:last-child {
  padding-right: 1rem;
}

.erp-lov-grid-row:hover td,
.erp-lov-grid-row.is-active td {
  background: rgb(31 138 134 / 8%);
  color: var(--navy-900);
}

.erp-lov-grid-row[aria-selected="true"] td {
  background: rgb(31 138 134 / 12%);
  color: var(--teal-500);
  font-weight: 650;
}

.erp-lov-grid-row[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.erp-lov-grid-col-code {
  width: var(--erp-lov-col-code);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--teal-500);
}

.erp-lov-grid-col-description {
  width: var(--erp-lov-col-description);
}

.erp-lov-grid-col-head {
  width: var(--erp-lov-col-head);
}

.erp-lov-grid-col-group {
  width: var(--erp-lov-col-group);
}

.erp-lov-grid-col-category {
  width: var(--erp-lov-col-category);
}

@media (max-width: 700px) {
  .erp-lov-grid {
    --erp-lov-col-code: 4.25rem;
    --erp-lov-col-description: 10.5rem;
    --erp-lov-col-head: 10.5rem;
    --erp-lov-col-group: 11rem;
    --erp-lov-col-category: 12.75rem;
    font-size: 0.76rem;
  }
}

.period-control .erp-lov {
  flex: 1 1 auto;
}

.period-control .erp-lov-trigger {
  min-height: 2.75rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--navy-800);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.period-control .erp-lov-trigger:focus-visible,
.period-control .erp-lov.is-open .erp-lov-trigger {
  box-shadow: none;
}

@media (max-width: 640px) {
  .erp-lov-trigger,
  .erp-lov-search-wrap,
  .erp-lov-option {
    min-height: 2.75rem;
  }

  .erp-lov-popup {
    max-width: calc(100vw - 1rem);
  }
}

/* Login flash — compact/clean. */
.page-login .flash-list {
  margin: 0 0 var(--space-3);
  gap: 0.4rem;
}

.page-login .flash {
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

.login-foot {
  margin-top: var(--space-4);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Branch select ---------- */
.auth-frame {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
}

.auth-panel {
  width: min(100%, 34rem);
  padding: var(--space-6);
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-panel-head {
  margin-bottom: var(--space-5);
}

.auth-panel-head h1 {
  margin-top: 0.35rem;
  font-size: 1.75rem;
}

.branch-form {
  display: grid;
  gap: var(--space-5);
}

.branch-grid {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: var(--space-3);
}

.branch-option {
  display: block;
  cursor: pointer;
}

.branch-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.branch-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--sand-50);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.branch-icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--teal-100);
  color: var(--teal-500);
}

.branch-text {
  display: grid;
  gap: 0.15rem;
}

.branch-text strong {
  font-size: 1rem;
}

.branch-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.9rem;
}

.branch-check {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.branch-option input:checked + .branch-card {
  border-color: var(--teal-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 138, 134, 0.14);
}

.branch-option input:checked + .branch-card .branch-check {
  border-color: var(--teal-500);
  background: var(--teal-500);
  box-shadow: inset 0 0 0 3px #fff;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- Main menu dashboard ---------- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  background: #e9eef5;
}

.sidebar {
  display: flex;
  flex-direction: column;
  /* Padding brand/content/footer pe — taake scroll scrollbar outer edge pe rahe. */
  padding: 0;
  gap: 0;
  background:
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #d7e0ee;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/*
  Desktop (≥961px): sidebar viewport pe fixed-height pane;
  andar alag scroll — main dashboard saath nahi hilta.
*/
@media (min-width: 961px) {
  body.page-menu {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar {
    align-self: stretch;
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  /*
    Sirf yeh region scroll.
    margin-right ~10px — scrollbar border se chipki nahi, balanced gutter mein.
  */
  .sidebar-scroll-region {
    flex: 1 1 auto;
    min-height: 0;
    margin-right: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 168, 162, 0.45) transparent;
  }

  .sidebar-scroll-region::-webkit-scrollbar {
    width: 6px;
  }

  .sidebar-scroll-region::-webkit-scrollbar-track {
    background: transparent;
  }

  .sidebar-scroll-region::-webkit-scrollbar-thumb {
    background: rgba(42, 168, 162, 0.42);
    border-radius: 999px;
  }

  .sidebar-scroll-region::-webkit-scrollbar-thumb:hover {
    background: rgba(42, 168, 162, 0.58);
  }

  /* Content ↔ scrollbar safe gap — chevron/row overlap nahi. */
  .sidebar-nav-content {
    padding-right: calc(var(--space-4) + 0.25rem);
  }

  .sidebar-foot {
    flex: 0 0 auto;
  }

  /* Main content apni jagah scroll — sidebar se independent. */
  .app-main {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex: 0 0 auto;
  /* Horizontal pad brand pe — scroll region full-bleed rehti hai. */
  padding: var(--space-5) var(--space-4) var(--space-3);
}

.sidebar-brand-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Drawer close — desktop pe hide; mobile drawer mein dikhe. */
.nav-drawer-close {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  place-items: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef7;
  cursor: pointer;
}

.nav-drawer-close:focus-visible {
  outline: 2px solid rgba(42, 168, 162, 0.7);
  outline-offset: 2px;
}

.mobile-appbar {
  display: none;
}

.nav-backdrop {
  display: none;
}

.context-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.sidebar-logo {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
  background:
    linear-gradient(135deg, var(--teal-400), var(--navy-700) 55%, var(--copper-500));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.sidebar-title {
  margin: 0;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-sub {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: rgba(215, 224, 238, 0.65);
}

/*
  Scroll region — base (desktop media pe overflow + flex).
  Mobile pe overflow visible; poora drawer scroll karta hai.
*/
.sidebar-scroll-region {
  min-width: 0;
}

/* Menu rows — padding yahan; overflow-y bilkul nahi. */
.sidebar-nav-content {
  display: grid;
  /* Main Menu → Finance jaisi compact rhythm — sab parent rows ke liye. */
  gap: 0.15rem;
  align-content: start;
  /* Left/right pad — icons/chevrons scrollbar se alag. */
  padding: 0.1rem var(--space-4) var(--space-3);
  /* Overlay scrollbar (macOS) ke liye thoda extra right breathing room. */
  padding-right: calc(var(--space-4) + 0.35rem);
  box-sizing: border-box;
  overflow: visible;
}

.nav-label {
  margin: 0 0 0.45rem 0.35rem;
  color: rgba(42, 168, 162, 0.9);
}

/* Main Menu row — Finance/Store jaisi flat height; touch ≥44px. */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem; /* 44px touch target */
  padding: 0.55rem 0.7rem;
  border-radius: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: rgba(215, 224, 238, 0.9);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-item.is-disabled {
  cursor: default;
  opacity: 0.72;
}

/* Home icon — module icons ke size/align ke saath. */
.nav-item-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--teal-400);
}

.nav-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(196, 122, 58, 0.85);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 0 0 auto;
  /* Footer pad — scroll region ke bahar, bottom pin desktop pe. */
  padding: var(--space-3) var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(31, 138, 134, 0.16);
  color: #9fe4df;
}

/* Footer gear — browser default button bilkul override. */
button.settings-gear-btn {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.55rem;
  background: rgba(11, 18, 32, 0.35);
  color: rgba(159, 228, 223, 0.95);
  font: inherit;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

button.settings-gear-btn:hover {
  background: rgba(42, 168, 162, 0.22);
  border-color: rgba(42, 168, 162, 0.45);
  color: #fff;
}

button.settings-gear-btn:focus-visible {
  outline: 2px solid rgba(42, 168, 162, 0.75);
  outline-offset: 2px;
}

button.settings-gear-btn:active {
  transform: scale(0.96);
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #3dd6b0;
  box-shadow: 0 0 0 3px rgba(61, 214, 176, 0.2);
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: rgba(251, 248, 243, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar-title {
  font-size: 1.25rem;
  margin-top: 0.15rem;
}

.topbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.meta-chip {
  display: grid;
  gap: 0.1rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  min-width: 7.5rem;
}

.meta-chip strong {
  font-size: 0.9rem;
}

.dashboard {
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
}

/* Main Menu home only — fill main pane so footer credit sits at bottom edge. */
.dashboard:has(> .erp-dashboard-home) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.erp-dashboard-home {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: var(--space-4);
  min-width: 0;
}

/*
  Page-footer credit — “Powered by” | RTA logo, main content bottom-centre
  (sidebar exclude). Flex pin via margin-top: auto; absolute/fixed nahi.
*/
.erp-brand-mark {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.65rem;
  margin-top: auto;
  margin-bottom: 0;
  padding: 0.35rem 1rem 28px;
  background: transparent;
  border: 0;
}

.erp-brand-mark-caption {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  color: rgb(21 32 51 / 45%);
  line-height: 1.2;
  white-space: nowrap;
}

.erp-brand-mark-divider {
  flex: 0 0 auto;
  align-self: center;
  width: 1px;
  height: 1.85rem;
  background: rgb(21 32 51 / 16%);
}

.erp-brand-mark-logo {
  display: block;
  width: auto;
  max-width: 240px;
  height: auto;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
  user-select: none;
}

@media (min-width: 961px) {
  .erp-brand-mark {
    padding: 0.4rem 1.25rem 28px;
    gap: 0.7rem;
  }

  .erp-brand-mark-logo {
    max-width: 240px;
  }
}

@media (max-width: 960px) {
  /* Parent height often indefinite — fill under chrome so footer pins low. */
  .erp-dashboard-home {
    min-height: calc(100dvh - 10rem);
  }

  .erp-brand-mark {
    padding: 0.3rem 1rem 28px;
    gap: 0.6rem;
  }

  .erp-brand-mark-logo {
    max-width: 200px;
  }

  .erp-brand-mark-divider {
    height: 1.65rem;
  }
}

@media (max-width: 640px) {
  .erp-dashboard-home {
    min-height: calc(100dvh - 11rem);
  }

  .erp-brand-mark {
    flex-direction: column;
    flex-wrap: wrap;
    padding: 0.25rem 0.75rem 28px;
    gap: 0.35rem;
  }

  .erp-brand-mark-caption {
    font-size: 0.72rem;
  }

  .erp-brand-mark-divider {
    display: none;
  }

  .erp-brand-mark-logo {
    max-width: 180px;
  }
}

.welcome-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, #122036 0%, #1a3350 55%, #164844 100%);
  color: #eaf0f8;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Welcome panel pe halka weave overlay. */
.welcome-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.welcome-panel > * {
  position: relative;
}

.welcome-copy {
  flex: 1 1 14rem;
  min-width: 0;
}

.welcome-panel h2 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  color: #fff;
}

.welcome-panel .lede {
  color: rgba(234, 240, 248, 0.78);
}

/*
  Oracle connection glass card — hero right pe;
  secrets (SID/host/password) kabhi display nahi.
*/
.oracle-conn-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 1 15.5rem;
  max-width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(159, 228, 223, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(11, 18, 32, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.oracle-conn-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.65rem;
  color: #9fe4df;
  background: rgba(42, 168, 162, 0.22);
  border: 1px solid rgba(42, 168, 162, 0.28);
}

.oracle-conn-text {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.oracle-conn-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.oracle-conn-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #9fe4df;
}

.oracle-conn-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #3dd6b0;
  box-shadow: 0 0 0 3px rgba(61, 214, 176, 0.22);
}

.oracle-conn-sub {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(234, 240, 248, 0.68);
  line-height: 1.3;
}

.module-section {
  display: grid;
  gap: var(--space-4);
}

.section-head h3 {
  font-size: 1.1rem;
}

.section-head p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  min-width: 0;
}

/* Module card — base flat; lift sirf hover-capable devices pe. */
.module-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: start;
  min-width: 0;
  padding: 1.05rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-height: 6.5rem;
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.module-card.is-placeholder {
  opacity: 0.96;
}

/* Icon tile — soft gradient + micro-motion hover pe. */
.module-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--teal-100), #eef6f5 55%, var(--sand-100));
  color: var(--teal-500);
  transition: transform 200ms ease;
}

.module-icon svg {
  display: block;
}

/* Soft textile gradients — navy/teal/sand family, contrast safe. */
.module-icon--finance {
  background: linear-gradient(145deg, #e7f6f5 0%, var(--teal-100) 48%, #eef4f8 100%);
  color: var(--teal-500);
}

.module-icon--store {
  background: linear-gradient(150deg, var(--sand-100) 0%, #eef6f5 52%, var(--teal-100) 100%);
  color: var(--teal-500);
}

.module-icon--inventory {
  background: linear-gradient(145deg, #eef4f8 0%, var(--teal-100) 55%, var(--sand-50) 100%);
  color: var(--teal-500);
}

.module-icon--production {
  background: linear-gradient(160deg, #e4ebf3 0%, #e0f0ee 50%, #edf2f7 100%);
  color: var(--navy-700);
}

.module-icon--purchase {
  background: linear-gradient(145deg, #f8f4ec 0%, #e8f5f3 55%, var(--teal-100) 100%);
  color: var(--teal-500);
}

.module-icon--sales {
  background: linear-gradient(145deg, var(--teal-100) 0%, #e8f6f5 42%, var(--sand-100) 100%);
  color: var(--teal-500);
}

.module-icon--payroll {
  background: linear-gradient(150deg, #edf2f7 0%, #e2f0ee 58%, var(--sand-50) 100%);
  color: var(--navy-700);
}

.module-icon--reports {
  background: linear-gradient(145deg, var(--sand-100) 0%, #e4f3f1 52%, #dce8f0 100%);
  color: var(--teal-500);
}

/*
  Hover polish — sirf real hover devices (desktop/trackpad).
  Touch/mobile pe hover stick/jump avoid.
*/
@media (hover: hover) {
  .module-card:hover {
    transform: translateY(-4px);
    border-color: rgba(42, 168, 162, 0.38);
    box-shadow:
      0 14px 32px rgba(11, 18, 32, 0.11),
      0 3px 8px rgba(11, 18, 32, 0.05);
  }

  .module-card:hover .module-icon {
    transform: translateY(-2px) scale(1.04);
  }
}

/* Accessibility — motion kam / band. */
@media (prefers-reduced-motion: reduce) {
  .module-card,
  .module-icon {
    transition: none;
  }

  @media (hover: hover) {
    .module-card:hover {
      transform: none;
    }

    .module-card:hover .module-icon {
      transform: none;
    }
  }
}

.module-body {
  min-width: 0;
}

.module-body h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.module-body p {
  color: var(--muted);
  font-size: 0.84rem;
}

.module-badge {
  align-self: start;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--copper-600);
  background: rgba(196, 122, 58, 0.12);
}

/* ---------- Responsive foundation ---------- */
@media (max-width: 1100px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Login stack — shell drawer se alag. */
@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding: var(--space-6) var(--space-5) var(--space-4);
  }
}

/*
  Tablet + mobile shell (≤960px):
  - Desktop sidebar hide / off-canvas drawer
  - Kabhi horizontal wrap buttons nahi
*/
@media (max-width: 960px) {
  html,
  body {
    overflow-x: hidden;
  }

  /* Drawer open — background page scroll lock + overscroll chain band. */
  html.nav-drawer-open,
  body.nav-drawer-open {
    overflow: hidden;
    overscroll-behavior: none;
    height: 100%;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .app-main {
    min-width: 0;
    width: 100%;
  }

  .mobile-appbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.55rem 0.85rem;
    background:
      linear-gradient(180deg, var(--navy-900), var(--navy-950));
    color: #e8eef7;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .mobile-nav-toggle {
    appearance: none;
    -webkit-appearance: none;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
  }

  .mobile-nav-toggle:focus-visible {
    outline: 2px solid rgba(42, 168, 162, 0.75);
    outline-offset: 2px;
  }

  .mobile-appbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .mobile-appbar-logo {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
  }

  .mobile-appbar-text {
    min-width: 0;
  }

  .mobile-appbar-product {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(159, 228, 223, 0.9);
  }

  .mobile-appbar-page {
    margin: 0.1rem 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Desktop fixed sidebar → off-canvas drawer. */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(19rem, 88vw);
    max-width: 19rem;
    height: 100vh;
    height: 100dvh;
    gap: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: none;
    /* Poora drawer scroll — footer menu ke baad normal flow. */
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 168, 162, 0.45) rgba(11, 18, 32, 0.28);
  }

  .sidebar::-webkit-scrollbar {
    width: 7px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: rgba(11, 18, 32, 0.28);
  }

  .sidebar::-webkit-scrollbar-thumb {
    background: rgba(42, 168, 162, 0.42);
    border-radius: 999px;
  }

  .sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(42, 168, 162, 0.58);
  }

  .nav-drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: 16px 0 40px rgba(11, 18, 32, 0.35);
  }

  .nav-drawer-close {
    display: grid;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(11, 18, 32, 0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .nav-drawer-open .nav-backdrop:not([hidden]) {
    display: block;
  }

  .sidebar-brand {
    padding: var(--space-4) var(--space-4) var(--space-3);
  }

  /*
    Mobile: scroll-region flex-grow band / nested scroll nahi —
    warna footer pin/overlay ho sakti. Content height grow; drawer scroll.
  */
  .sidebar-scroll-region {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }

  .sidebar-nav-content {
    padding: 0.1rem var(--space-4) var(--space-2);
    padding-right: calc(var(--space-4) + 0.35rem);
  }

  /* Footer — fixed/sticky/absolute bilkul nahi; document flow. */
  .sidebar-foot {
    flex: 0 0 auto;
    position: static;
    margin-top: 0;
    padding: var(--space-3) var(--space-4) var(--space-4);
  }

  .nav-item {
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
  }

  .nav-group-toggle {
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
  }

  .nav-subitem {
    min-height: 2.75rem;
    padding: 0.55rem 0.55rem 0.55rem 0.35rem;
  }

  .nav-tree-item {
    padding-left: 1.45rem;
  }

  .topbar {
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }

  .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-kicker {
    font-size: 0.72rem;
  }

  .topbar-title {
    font-size: 1.1rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.65rem;
  }

  .context-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    flex: 1 1 100%;
    width: 100%;
  }

  .meta-chip {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .meta-chip strong {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.3;
  }

  .meta-chip-user {
    grid-column: 1 / -1;
  }

  .topbar-logout {
    min-height: 2.75rem;
    padding-inline: 1rem;
    margin-left: auto;
  }

  .dashboard {
    padding: var(--space-4);
    gap: var(--space-4);
    min-width: 0;
  }

  .welcome-panel {
    padding: var(--space-4);
    gap: var(--space-3);
    flex-direction: column;
  }

  .welcome-panel h2 {
    font-size: 1.35rem;
  }

  .welcome-panel .lede {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  /* Mobile/tablet — connection card welcome text ke neeche full width. */
  .oracle-conn-card {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .module-card {
    min-height: 5.5rem;
    padding: 0.9rem;
    grid-template-columns: auto 1fr;
  }

  .module-badge {
    grid-column: 2;
    justify-self: start;
  }

  .btn,
  .btn-compact,
  a.btn {
    min-height: 2.75rem;
  }
}

/* Main Menu link — flat row; active pe koi rounded rectangle/block nahi. */
a.nav-item {
  text-decoration: none;
}

/* Hover — module toggles jaisa subtle (Finance CSS touch nahi). */
a.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

a.nav-item.is-active {
  background: transparent;
  color: #fff;
  font-weight: 650;
  /* Left soft glow — solid fill box / card look nahi. */
  box-shadow: inset 6px 0 14px -10px rgba(42, 168, 162, 0.45);
}

/* Far-left slim teal line — sirf yeh primary active cue. */
a.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  border-radius: 1px;
  background: var(--teal-400);
}

a.nav-item.is-active .nav-item-icon {
  color: var(--teal-400);
}

/*
  Enterprise module groups (Finance, Store, …) —
  Parent: icon + title + chevron; children: tree spine + branch + line icons.
*/
/* Collapsed parents — extra vertical margin hatao (pehle gaps zyada the). */
.nav-group {
  margin: 0;
  border-radius: var(--radius-sm);
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  list-style: none;
  min-height: 2.75rem; /* 44px — cramped nahi, touch-friendly */
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 650;
  color: rgba(215, 224, 238, 0.9);
  cursor: pointer;
  user-select: none;
}

.nav-group-toggle::-webkit-details-marker {
  display: none;
}

.nav-group-toggle::marker {
  content: "";
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-group-toggle:focus-visible {
  outline: 2px solid rgba(42, 168, 162, 0.65);
  outline-offset: 2px;
}

.nav-group[open] > .nav-group-toggle {
  background: rgba(42, 168, 162, 0.12);
  color: #fff;
}

.nav-group-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--teal-400);
}

.nav-group-label {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-group-chevron {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: rgba(215, 224, 238, 0.55);
  transition: transform 0.18s ease;
}

.nav-group[open] > .nav-group-toggle .nav-group-chevron {
  transform: rotate(180deg);
  color: rgba(159, 228, 223, 0.9);
}

/* Tree submenu — expand pe readable spacing; collapsed parents compact rehte. */
.nav-group-menu.nav-tree {
  list-style: none;
  margin: 0.2rem 0 0.35rem;
  padding: 0.2rem 0 0.25rem 0;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.nav-tree-item {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.55rem;
}

/* Vertical connector spine. */
.nav-tree-item::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(42, 168, 162, 0.32);
}

/* Pehli row — spine center se start. */
.nav-tree-item:first-child::before {
  top: 50%;
}

/* Last item — spine half height tak. */
.nav-tree-item:last-child::before {
  bottom: 50%;
}

/* Horizontal branch toward icon. */
.nav-tree-item::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 50%;
  width: 0.55rem;
  height: 1px;
  background: rgba(42, 168, 162, 0.32);
  transform: translateY(-50%);
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 2.5rem;
  padding: 0.4rem 0.55rem 0.4rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: rgba(215, 224, 238, 0.82);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.nav-subitem.is-disabled {
  cursor: default;
  opacity: 0.72;
  color: rgba(215, 224, 238, 0.72);
}

.nav-subitem-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  color: rgba(159, 228, 223, 0.75);
}

.nav-subitem-label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live link active state (baad mein real screens). */
a.nav-subitem.is-active {
  background: rgba(42, 168, 162, 0.2);
  color: #fff;
  font-weight: 650;
  opacity: 1;
}

a.nav-subitem.is-active .nav-subitem-icon {
  color: #9fe4df;
}

a.nav-subitem:not(.is-disabled):hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Nested Finance → Financial Reports submenu. */
.nav-tree-nested {
  list-style: none;
}

.nav-nested {
  border: 0;
}

.nav-nested > summary {
  list-style: none;
  cursor: pointer;
}

.nav-nested > summary::-webkit-details-marker {
  display: none;
}

.nav-nested-toggle {
  width: 100%;
}

.nav-nested-chevron {
  display: grid;
  place-items: center;
  margin-left: auto;
  color: rgba(159, 228, 223, 0.55);
  transition: transform 0.15s ease;
}

.nav-nested[open] > .nav-nested-toggle .nav-nested-chevron {
  transform: rotate(180deg);
}

.nav-nested-menu {
  list-style: none;
  margin: 0.15rem 0 0.35rem;
  padding: 0 0 0 1.55rem;
  display: grid;
  gap: 0.15rem;
}

.nav-nested-link {
  min-height: 2.15rem;
  padding-left: 0.55rem;
  font-size: 0.82rem;
}

/*
  Settings modal — UA <dialog> defaults fully override.
  Dialog fullscreen flex shell; visual card = .settings-dialog-panel.
  App-shell grid child hone se layout spoil na ho.
*/
dialog.settings-dialog {
  position: fixed;
  inset: 0;
  z-index: 4000;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.5rem;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  overflow: auto;
}

dialog.settings-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: settings-dialog-in 0.18s ease-out;
}

dialog.settings-dialog::backdrop {
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: settings-backdrop-in 0.18s ease-out;
}

@keyframes settings-dialog-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes settings-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.settings-dialog-panel {
  width: min(30rem, 100%);
  max-width: 30rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(26, 54, 93, 0.14);
  border-radius: 1.25rem;
  background: #fbf8f3;
  box-shadow:
    0 24px 60px rgba(11, 18, 32, 0.28),
    0 0 0 1px rgba(31, 138, 134, 0.06);
  overflow: hidden;
  animation: settings-panel-in 0.2s ease-out;
}

@keyframes settings-panel-in {
  from {
    opacity: 0;
    transform: translateY(0.45rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.settings-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.5rem 1.5rem 1.15rem;
  border-bottom: 1px solid rgba(21, 32, 51, 0.08);
  background:
    linear-gradient(135deg, rgba(26, 54, 93, 0.05), rgba(31, 138, 134, 0.07));
}

.settings-dialog-brand {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
}

.settings-dialog-gear {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  color: var(--teal-500);
  background: rgba(31, 138, 134, 0.12);
  border: 1px solid rgba(31, 138, 134, 0.2);
}

.settings-dialog-titles {
  min-width: 0;
  padding-top: 0.1rem;
}

.settings-dialog-titles h2,
#settings-dialog-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-800);
  line-height: 1.25;
}

.settings-dialog-sub {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.35;
}

button.settings-dialog-close {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font: inherit;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

button.settings-dialog-close:hover {
  background: #fff;
  border-color: rgba(26, 54, 93, 0.18);
  color: var(--navy-800);
}

button.settings-dialog-close:focus-visible {
  outline: 2px solid rgba(31, 138, 134, 0.55);
  outline-offset: 1px;
}

.settings-dialog-body {
  padding: 1.25rem 1.5rem 1.6rem;
  display: block;
}

.settings-section {
  display: block;
  width: 100%;
}

.settings-section-label {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-500);
}

/* Cards MUST stack — kabhi side-by-side merge nahi. */
.settings-link-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
}

a.settings-link-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 0.85rem;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

a.settings-link-card:hover {
  border-color: rgba(31, 138, 134, 0.4);
  box-shadow: 0 8px 20px rgba(11, 18, 32, 0.1);
  background: rgba(31, 138, 134, 0.03);
  transform: translateY(-1px);
}

a.settings-link-card:focus-visible {
  outline: 2px solid rgba(31, 138, 134, 0.55);
  outline-offset: 1px;
}

.settings-link-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.65rem;
  color: var(--navy-800);
  background: rgba(26, 54, 93, 0.07);
}

.settings-link-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.settings-link-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-800);
  line-height: 1.25;
}

.settings-link-help {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.settings-link-chevron {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: rgba(92, 107, 128, 0.65);
}

a.settings-link-card:hover .settings-link-chevron {
  color: var(--teal-500);
}

/* Future categories reserved — abhi height/space nahi. */
.settings-future-slot {
  display: none;
}

@media (max-width: 640px) {
  dialog.settings-dialog[open] {
    align-items: flex-end;
    padding: 0.75rem;
  }

  .settings-dialog-panel {
    width: 100%;
    max-width: none;
    border-radius: 1.15rem 1.15rem 0.85rem 0.85rem;
    animation: settings-sheet-in 0.2s ease-out;
  }

  .settings-dialog-head,
  .settings-dialog-body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  a.settings-link-card {
    min-height: 3.5rem;
  }

  @keyframes settings-sheet-in {
    from {
      opacity: 0;
      transform: translateY(1rem);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

.btn-danger {
  background: linear-gradient(180deg, #c45a5a, #a33b3b);
  color: #fff;
  border: 0;
}

.btn-danger:hover {
  background: linear-gradient(180deg, #d06666, #8f2d2d);
}

/* ---------- Reusable ERP master form/table components ---------- */
/* Future masters (Users etc.) inhi classes ko reuse kar sakte hain. */

.erp-page {
  display: grid;
  gap: var(--space-4);
}

.master-page {
  gap: var(--space-5);
}

.master-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(18, 32, 54, 0.96), rgba(26, 51, 80, 0.94) 55%, rgba(22, 72, 68, 0.92));
  color: #eaf0f8;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.master-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.master-header > * {
  position: relative;
}

.erp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(234, 240, 248, 0.72);
  margin-bottom: 0.45rem;
}

.erp-breadcrumb a {
  color: #9fe4df;
  text-decoration: none;
}

.erp-breadcrumb a:hover {
  text-decoration: underline;
}

.erp-breadcrumb-sep {
  opacity: 0.55;
}

.erp-breadcrumb strong {
  color: #fff;
  font-weight: 700;
}

.erp-page-title {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin: 0;
  color: #fff;
}

.master-header .erp-page-sub {
  color: rgba(234, 240, 248, 0.75);
}

.erp-page-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 40rem;
}

.erp-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.btn-with-icon {
  gap: 0.45rem;
}

/* Search card — list screens ke liye. */
.erp-search-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.erp-search-copy {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.erp-search-icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--teal-100);
  color: var(--teal-500);
}

.erp-search-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.erp-search-hint {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.erp-search-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  min-width: 16rem;
}

.erp-search-field {
  flex: 1;
  min-width: 12rem;
  max-width: 22rem;
}

/*
  Shared list search — LOV search jaisa: left icon andar, Enter submit.
  Alag teal search button nahi; styling sirf erp.css mein.
*/
.erp-search-combo {
  position: relative;
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  align-items: center;
  flex: 1 1 16rem;
  min-width: 12rem;
  max-width: 26rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(21, 32, 51, 0.16);
  border-radius: 0.55rem;
  color: var(--muted);
  background: #fff;
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.erp-search-combo:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(31, 138, 134, 0.16);
}

.erp-search-cue {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  color: rgba(92, 107, 128, 0.9);
  pointer-events: none;
}

.erp-search-cue svg {
  display: block;
}

.erp-search-combo .erp-search-field {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.erp-search-combo .field-input,
.erp-search-combo .ui-input {
  width: 100%;
  min-width: 0;
  min-height: 2.55rem;
  height: 100%;
  padding: 0 0 0 0.55rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.3;
}

.erp-search-combo .field-input::placeholder,
.erp-search-combo .ui-input::placeholder {
  color: rgba(92, 107, 128, 0.78);
}

.erp-search-combo .field-input:focus,
.erp-search-combo .ui-input:focus {
  border: 0;
  box-shadow: none;
  outline: none;
  background: transparent;
}

/* Table card */
.erp-table-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.erp-table-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbf8f3, #f3f6fa);
}

.erp-table-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.erp-count-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-500);
  background: var(--teal-100);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.erp-table-wrap {
  overflow: auto;
}

/*
  Reusable fixed-height table scroll — sticky header + themed scrollbar.
  Chart of Accounts lists: `.erp-table-scroll--coa` (all four tabs).
*/
.erp-table-scroll {
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(31 138 134 / 42%) rgb(21 32 51 / 5%);
}

.erp-table-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.erp-table-scroll::-webkit-scrollbar-track {
  background: rgb(21 32 51 / 4%);
  border-radius: 999px;
}

.erp-table-scroll::-webkit-scrollbar-thumb {
  background: rgb(31 138 134 / 42%);
  border-radius: 999px;
}

.erp-table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgb(31 138 134 / 58%);
}

.erp-table-scroll .erp-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}

/* Chart of Accounts — 4 complete rows visible on desktop (all four tabs). */
.erp-table-scroll--coa {
  --erp-table-scroll-rows: 4;
  /* Matches td padding + action-row min-height (2.15rem btn + 0.9rem×2 pad). */
  --erp-table-scroll-row: 3.95rem;
  --erp-table-scroll-head: 2.9rem;
  max-height: calc(
    var(--erp-table-scroll-head) +
    (var(--erp-table-scroll-row) * var(--erp-table-scroll-rows))
  );
}

@media (max-width: 960px) {
  .erp-table-scroll--coa {
    --erp-table-scroll-rows: 3;
  }
}

@media (max-width: 640px) {
  .erp-table-scroll--coa {
    --erp-table-scroll-rows: 2;
    -webkit-overflow-scrolling: touch;
  }
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.erp-table th,
.erp-table td {
  padding: 0.9rem 1.05rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.erp-table th {
  background: #eef3f7;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--navy-700);
}

.erp-table tbody tr:hover {
  background: rgba(31, 138, 134, 0.04);
}

.erp-table tr:last-child td {
  border-bottom: 0;
}

.erp-code-chip {
  display: inline-flex;
  min-width: 2rem;
  justify-content: center;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(18, 32, 54, 0.06);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.erp-row-title {
  font-size: 0.95rem;
}

/*
  Actions cell table-cell hi rahe — display:flex yahan row borders todta hai.
  Layout erp-action-group (inline-flex) pe hai, User/Branch jaisa.
*/
.erp-actions {
  white-space: nowrap;
}

/* Edit + Close aik compact action group — list rows ke liye. */
.erp-action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
}

.erp-action-group .btn-compact {
  min-height: 2.15rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 650;
}

.erp-inline-form {
  display: inline;
  margin: 0;
}

.erp-action-group .erp-inline-form {
  display: inline-flex;
  margin: 0;
}

/*
  Icon-only buttons — Search / Close (circle-x) shared.
  Trash/archive icon nahi — close = status Closed, hard delete nahi.
*/
.erp-btn-icon {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
  min-height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.erp-btn-icon:focus-visible {
  outline: 2px solid rgba(31, 138, 134, 0.55);
  outline-offset: 1px;
}

.erp-btn-icon-primary {
  background: linear-gradient(180deg, var(--teal-400), var(--teal-500));
  color: #fff;
}

.erp-btn-icon-primary:hover {
  background: linear-gradient(180deg, #33b3ad, #1a7c78);
}

.erp-btn-icon-danger {
  background: rgba(163, 59, 59, 0.08);
  border-color: rgba(163, 59, 59, 0.22);
  color: #a33b3b;
}

.erp-btn-icon-danger:hover {
  background: rgba(163, 59, 59, 0.14);
  border-color: rgba(163, 59, 59, 0.4);
  color: #8f2d2d;
}

/* Circle outline danger — row remove / soft-close; trash icon nahi. */
.erp-btn-icon-circle {
  border-radius: 999px;
}

.erp-btn-icon-danger.erp-btn-icon-circle {
  background: transparent;
  border-color: rgba(163, 59, 59, 0.55);
  color: #a33b3b;
}

.erp-btn-icon-danger.erp-btn-icon-circle:hover {
  background: rgba(163, 59, 59, 0.08);
  border-color: #a33b3b;
  color: #8f2d2d;
}

@media (max-width: 640px) {
  .erp-btn-icon {
    width: 2.45rem;
    height: 2.45rem;
    min-width: 2.45rem;
    min-height: 2.45rem;
  }

  /* Mobile — full width + min 44px touch height. */
  .erp-search-combo {
    max-width: none;
    width: 100%;
    min-height: 2.75rem;
  }

  .erp-search-combo .field-input,
  .erp-search-combo .ui-input {
    min-height: 2.75rem;
  }
}

.erp-badge {
  display: inline-flex;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(21, 32, 51, 0.08);
}

.erp-badge-ok {
  color: var(--ok);
  background: rgba(31, 122, 77, 0.12);
}

.erp-badge-muted {
  color: var(--muted);
  background: rgba(92, 107, 128, 0.12);
}

/* Account Type badges — text + soft color (color-only meaning nahi). */
.erp-badge-ledger {
  color: #1d4f91;
  background: rgba(37, 99, 235, 0.12);
}

.erp-badge-customer {
  color: #8a6412;
  background: rgba(212, 168, 45, 0.18);
}

.erp-badge-supplier {
  color: #9b2c2c;
  background: rgba(185, 48, 48, 0.12);
}

/* Shared read-only Record Information (audit) — Edit forms. */
.erp-record-info {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    165deg,
    rgb(24 54 98 / 4%) 0%,
    var(--surface-2) 60%
  );
}

.erp-record-info-title {
  margin: 0 0 0.7rem;
  color: var(--navy-800);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.erp-record-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0;
}

.erp-record-info-item {
  min-width: 0;
}

.erp-record-info-item dt {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.erp-record-info-item dd {
  margin: 0;
  color: var(--navy-800);
  font-size: 0.82rem;
  font-weight: 550;
  line-height: 1.35;
  word-break: break-word;
}

@media (max-width: 640px) {
  .erp-record-info {
    margin-top: 0.85rem;
    padding: 0.75rem 0.8rem;
  }

  .erp-record-info-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
}

/* Shared compact enterprise pagination — all ERP data lists. */
.erp-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.7rem 0 0.2rem;
  border-top: 1px solid var(--line);
}

.erp-pagination-range {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
}

.erp-pagination-range-mobile {
  display: none;
}

.erp-pagination-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-width: 0;
}

.erp-pagination-btn,
.erp-pagination-chip {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid rgb(21 32 51 / 12%);
  border-radius: 0.4rem;
  background: #fff;
  color: var(--navy-800);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(21 32 51 / 5%);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.erp-pagination-btn-icon {
  min-width: 2rem;
  padding: 0;
}

.erp-pagination-btn-label {
  min-width: 0;
  padding-inline: 0.6rem;
}

.erp-pagination-btn:hover {
  border-color: rgb(21 32 51 / 22%);
  background: #f7f9fc;
  color: var(--navy-900);
  box-shadow: 0 1px 3px rgb(21 32 51 / 8%);
}

.erp-pagination-chip {
  min-width: 2rem;
  padding: 0 0.45rem;
  font-variant-numeric: tabular-nums;
}

.erp-pagination-chip.is-active {
  border-color: rgb(100 116 139 / 28%);
  background: #e8eef6;
  color: var(--navy-900);
  box-shadow: none;
  pointer-events: none;
}

.erp-pagination-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
  box-shadow: none;
  background: #fff;
  color: var(--muted);
}

@media (max-width: 640px) {
  .erp-pagination {
    gap: 0.45rem;
  }

  .erp-pagination-range-desktop {
    display: none;
  }

  .erp-pagination-range-mobile {
    display: inline;
  }

  .erp-pagination-nav {
    width: 100%;
    gap: 0.3rem;
  }

  .erp-pagination-btn-label {
    padding-inline: 0.5rem;
  }
}

/* Very narrow: keep Prev / current / Next; hide First / Last. */
@media (max-width: 420px) {
  .erp-pagination-first,
  .erp-pagination-last {
    display: none;
  }
}

/* Empty state */
.erp-empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.erp-empty-icon {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 0.85rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal-100);
  color: var(--teal-500);
}

.erp-empty-state h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.erp-empty-state p {
  margin: 0 auto;
  max-width: 26rem;
  color: var(--muted);
}

.erp-empty-actions {
  margin-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

/* Form cards + sticky action bar — shared ui-form design system. */
/*
  Semantic aliases (templates inhein use karen):
  .ui-form | .ui-form-section | .ui-form-row | .ui-field | .ui-label |
  .ui-input | .ui-hint | .ui-form-actions
  Legacy .erp-* classes same rules pe map — future change ek jagah se.
*/

.erp-master-form,
.ui-form {
  display: grid;
  gap: var(--space-4);
}

/*
  Constrained enterprise workspace — wide monitor pe form phailta nahi.
  Header, cards, tabs aur action bar aik hi centred alignment mein rehte hain.
*/
.ui-form-workspace {
  width: min(100%, 69rem); /* 1104px */
  margin-inline: auto;
}

.ui-form-workspace.master-page {
  gap: 1rem;
}

.erp-form-stack,
.ui-form-stack {
  display: grid;
  gap: var(--space-4);
  padding-bottom: 5.25rem; /* sticky action bar ke neeche space */
}

.erp-card,
.ui-form-section {
  background: var(--surface-2);
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04);
  overflow: hidden;
}

.erp-card-head,
.ui-form-section-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(21, 32, 51, 0.08);
  background: linear-gradient(180deg, #fbf8f3, #f4f7fb);
}

.erp-card-head h3,
.ui-form-section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: -0.01em;
}

.erp-card-head p,
.ui-form-section-head p,
.ui-form-helper {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  max-width: 40rem;
}

.erp-card-icon,
.ui-form-section-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--teal-100);
  color: var(--teal-500);
  flex-shrink: 0;
}

.erp-card > .erp-form-grid,
.ui-form-section > .ui-form-row,
.ui-form-section > .erp-form-grid {
  padding: 1rem 1.15rem 1.1rem;
}

/*
  Compact enterprise body — aik card mein logical rows.
  Padding body pe hai, har row pe nahi; is se extra white space kam rehti hai.
*/
.ui-form-body {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem 1rem 1rem;
}

.ui-form-body .ui-form-row,
.ui-form-body .erp-form-grid {
  padding: 0;
}

/* Do logical groups — desktop/tablet pe balanced, narrow mobile pe stack. */
.ui-form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.ui-form-split--one-third {
  grid-template-columns: minmax(14rem, 0.34fr) minmax(0, 0.66fr);
}

.ui-form-group {
  min-width: 0;
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.ui-form-group + .ui-form-group {
  padding-left: 1rem;
  border-left: 1px solid rgba(21, 32, 51, 0.09);
}

.ui-form-group-title {
  margin: 0;
  color: var(--navy-700);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Group ke andar repeatable two-column field grid. */
.ui-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 0.85rem;
  align-items: start;
}

.ui-field-grid > .ui-field,
.ui-field-grid > .erp-field {
  width: 100%;
  max-width: none;
}

.ui-field-span-2 {
  grid-column: 1 / -1;
}

/* Compact card headers — hierarchy clear, lekin card unnecessarily tall nahi. */
.ui-form-stack--compact,
.erp-form-stack.ui-form-stack--compact {
  gap: 0.85rem;
}

.ui-form-section--compact .ui-form-section-head,
.ui-form-section--compact .erp-card-head {
  gap: 0.65rem;
  padding: 0.75rem 1rem;
}

.ui-form-section--compact .ui-form-section-icon,
.ui-form-section--compact .erp-card-icon {
  width: 2rem;
  height: 2rem;
}

.ui-form-section--compact .ui-form-section-head h3,
.ui-form-section--compact .erp-card-head h3 {
  font-size: 0.95rem;
}

.ui-form-section--compact .ui-form-section-head p,
.ui-form-section--compact .erp-card-head p {
  margin-top: 0.15rem;
  font-size: 0.79rem;
}

/* Security jaisi chhoti section ko giant full-width card banne se roko. */
.ui-form-section--narrow {
  width: min(100%, 36rem);
}

/* Compact ERP form rows — fields data size ke hisab se. */
.erp-form-grid,
.ui-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: flex-start;
}

.erp-field,
.ui-field {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  min-width: 0;
}

/* Reusable field widths — codes chhote, names wider, address full. */
.erp-field.field-xs,
.ui-field.field-xs {
  flex: 0 1 7.5rem;
  max-width: 8.5rem;
  width: 100%;
}

.erp-field.field-sm,
.ui-field.field-sm {
  flex: 0 1 11rem;
  max-width: 13rem;
  width: 100%;
}

.erp-field.field-md,
.ui-field.field-md {
  flex: 0 1 15.5rem;
  max-width: 18rem;
  width: 100%;
}

.erp-field.field-lg,
.ui-field.field-lg {
  flex: 1 1 17rem;
  max-width: 24rem;
  width: 100%;
}

/* Enterprise practical widths — compact forms mein reusable. */
.erp-field.field-code,
.ui-field.field-code {
  flex: 0 0 7.5rem;
  max-width: 7.5rem;
  width: 100%;
}

.erp-field.field-status,
.ui-field.field-status {
  flex: 0 0 8.5rem;
  max-width: 8.5rem;
  width: 100%;
}

.erp-field.field-compact,
.ui-field.field-compact {
  flex: 0 1 13rem;
  max-width: 15rem;
  width: 100%;
}

.erp-field.field-wide,
.ui-field.field-wide {
  flex: 1 1 18rem;
  max-width: 25rem;
  width: 100%;
}

.erp-field.field-grow,
.ui-field.field-grow {
  flex: 1 1 24rem;
  max-width: none;
  width: 100%;
}

/* Identity / name — desktop pe full-width row. */
.erp-field.field-xl,
.ui-field.field-xl,
.erp-field.field-name,
.ui-field.field-name {
  flex: 1 1 100%;
  max-width: 100%;
  width: 100%;
}

/* Purana span helper — ab full-row / xl ke barabar. */
.erp-field-span-2,
.erp-field.field-row,
.ui-field.field-row {
  flex: 1 1 100%;
  max-width: 100%;
}

.field-hint,
.ui-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.field-textarea,
.ui-input.field-textarea {
  min-height: 4.75rem;
  resize: vertical;
  line-height: 1.45;
  padding-top: 0.7rem;
}

/* Readonly / disabled — clear but quiet. */
.erp-field.is-readonly .field-input,
.ui-field.is-readonly .ui-input,
.ui-field.is-readonly .field-input,
.field-input[readonly],
.ui-input[readonly] {
  background: #eef2f6;
  color: var(--navy-700);
  border-style: dashed;
  border-color: rgba(21, 32, 51, 0.14);
  cursor: not-allowed;
  box-shadow: none;
}

/* Validation error state — flash ke ilawa field-level CSS ready. */
.erp-field.is-invalid .field-input,
.ui-field.is-invalid .ui-input,
.ui-field.is-invalid .field-input,
.field-input.is-invalid,
.ui-input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(163, 59, 59, 0.14);
}

.ui-field-error,
.field-error {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--danger);
  line-height: 1.35;
}

.erp-action-bar,
.ui-form-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(251, 248, 243, 0.94);
  border: 1px solid rgba(21, 32, 51, 0.12);
  box-shadow: 0 10px 28px rgba(11, 18, 32, 0.1);
  backdrop-filter: blur(10px);
}

.erp-action-bar-note,
.ui-form-actions-note {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 28rem;
}

.erp-action-bar-buttons,
.ui-form-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

/* Primary action visual weight — secondary se clear farq. */
.ui-form-actions-buttons .btn-primary,
.erp-action-bar-buttons .btn-primary {
  min-width: 8.5rem;
  box-shadow: 0 8px 18px rgba(31, 138, 134, 0.28);
}

.ui-form-actions-buttons .btn-secondary,
.erp-action-bar-buttons .btn-secondary {
  min-width: 6.5rem;
}

/* Validation / flash — master pages pe zyada clear. */
.dashboard > .flash-list {
  margin-bottom: 0;
}

.dashboard > .flash-list .flash {
  border-left: 4px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.dashboard > .flash-list .flash-error {
  border-left-color: var(--danger);
}

.dashboard > .flash-list .flash-success {
  border-left-color: var(--ok);
}

/* User Management tabs + Branch Access cards */
.erp-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.erp-subnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft, var(--navy-700));
}

.erp-subnav-link:hover {
  background: rgba(31, 138, 134, 0.08);
}

.erp-subnav-link.is-active {
  background: linear-gradient(180deg, var(--teal-400), var(--teal-500));
  color: #fff;
}

.branch-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--space-3);
  padding: 1.15rem;
}

.branch-access-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--sand-50);
  cursor: pointer;
}

.branch-access-card input {
  margin-top: 0.2rem;
}

.branch-access-body {
  display: grid;
  gap: 0.25rem;
}

.branch-access-body em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.88rem;
}

.branch-access-card.is-checked {
  border-color: var(--teal-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 138, 134, 0.12);
}

.branch-access-card.is-default {
  border-color: var(--copper-500);
}

/* Permissions grid — compact checkboxes. */
.perm-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.perm-table th,
.perm-table td {
  text-align: center;
  white-space: nowrap;
}

.perm-table th:first-child,
.perm-table td:first-child {
  text-align: left;
  min-width: 10rem;
}

.perm-check {
  width: 3.2rem;
}

.perm-check input {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
}

/* Compact phones / narrow tablets — logical groups aik column mein. */
@media (max-width: 700px) {
  .ui-form-split,
  .ui-form-split--one-third {
    grid-template-columns: minmax(0, 1fr);
  }

  .ui-form-group + .ui-form-group {
    padding-top: 0.8rem;
    padding-left: 0;
    border-top: 1px solid rgba(21, 32, 51, 0.09);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .login-main,
  .auth-frame,
  .dashboard {
    padding: var(--space-3);
  }

  .login-card,
  .auth-panel {
    padding: var(--space-5);
  }

  .topbar {
    padding: var(--space-3);
  }

  /* Narrow phones — module cards single column. */
  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    grid-template-columns: auto 1fr auto;
  }

  .module-badge {
    grid-column: auto;
    justify-self: auto;
  }

  .context-chip-grid {
    grid-template-columns: 1fr;
  }

  .meta-chip-user {
    grid-column: auto;
  }

  .topbar-logout {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .erp-form-grid,
  .ui-form-row,
  .erp-field-span-2 {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  /* Mobile — saari field sizes full width, practical touch targets. */
  .erp-field.field-xs,
  .erp-field.field-sm,
  .erp-field.field-md,
  .erp-field.field-lg,
  .erp-field.field-xl,
  .erp-field.field-name,
  .erp-field.field-code,
  .erp-field.field-status,
  .erp-field.field-compact,
  .erp-field.field-wide,
  .erp-field.field-grow,
  .ui-field.field-xs,
  .ui-field.field-sm,
  .ui-field.field-md,
  .ui-field.field-lg,
  .ui-field.field-xl,
  .ui-field.field-name,
  .ui-field.field-code,
  .ui-field.field-status,
  .ui-field.field-compact,
  .ui-field.field-wide,
  .ui-field.field-grow {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .ui-form-body {
    gap: 0.75rem;
    padding: 0.85rem;
  }

  /* 390px mobile — tamam fields full width, koi horizontal overflow nahi. */
  .ui-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ui-field-span-2 {
    grid-column: auto;
  }

  .erp-search-controls {
    width: 100%;
    justify-content: stretch;
  }

  .erp-search-field {
    max-width: none;
  }

  .erp-action-bar,
  .ui-form-actions {
    bottom: 0.4rem;
  }

  .erp-action-bar-buttons,
  .ui-form-actions-buttons {
    width: 100%;
  }

  .erp-action-bar-buttons .btn,
  .ui-form-actions-buttons .btn {
    flex: 1;
    min-height: 2.75rem;
  }
}

/* ---- Transaction voucher page (reusable full-page entry layout) ---- */
.erp-txn-page {
  display: grid;
  gap: 0.75rem;
  max-width: min(100%, 88rem);
  min-width: 0;
}

/*
  Light page head — pale surface pe navy/ink text.
  Dark master-header ke white titles yahan inherit nahi hote.
*/
.erp-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.1rem;
  padding: 0.15rem 0.1rem 0.35rem;
  color: var(--ink);
}

.erp-page-head-text {
  min-width: 0;
  flex: 1 1 16rem;
}

.erp-page-head .erp-breadcrumb {
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.erp-page-head .erp-breadcrumb a {
  color: var(--teal-500);
  font-weight: 650;
}

.erp-page-head .erp-breadcrumb a:hover {
  color: var(--navy-800);
}

.erp-page-head .erp-breadcrumb strong {
  color: var(--navy-800);
}

.erp-page-head .erp-page-title {
  color: var(--navy-900);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  margin: 0;
}

.erp-context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.erp-context-chip {
  display: grid;
  gap: 0.05rem;
  min-width: 5.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}

.erp-context-chip-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1.2;
}

.erp-context-chip strong {
  color: var(--navy-800);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

.erp-txn-form {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.erp-txn-header-card,
.erp-txn-grid-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.erp-txn-header-card {
  padding: 0.65rem 0.8rem;
}

.erp-txn-grid-card {
  padding: 0.7rem 0.8rem 0.75rem;
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.erp-txn-header-fields {
  display: grid;
  grid-template-columns:
    minmax(5.5rem, 7rem)
    minmax(8.25rem, 10rem)
    minmax(12rem, 1.55fr)
    minmax(5.75rem, 7.5rem)
    minmax(8.25rem, 10rem)
    minmax(5.5rem, 7.25rem);
  gap: 0.45rem 0.7rem;
  align-items: end;
}

/* Page-head voucher tools: New + Find + First/Prev/Next/Last. */
.erp-txn-voucher-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.5rem;
  flex: 0 1 auto;
  max-width: min(100%, 42rem);
}

.erp-txn-voucher-toolbar--inline {
  flex-wrap: nowrap;
  max-width: min(100%, 52rem);
}

.cash-receipt-print-btn,
.voucher-print-btn {
  min-height: 2.75rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.erp-txn-toolbar-new {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding-inline: 0.9rem;
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.08), 0 2px 6px rgba(31, 138, 134, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.erp-txn-toolbar-new:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 0 rgba(11, 18, 32, 0.06), 0 4px 10px rgba(31, 138, 134, 0.28);
}

.erp-txn-toolbar-new:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 rgba(11, 18, 32, 0), 0 1px 2px rgba(31, 138, 134, 0.18);
}

.erp-txn-find {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.15rem 0.2rem 0.15rem 0.45rem;
  border: 1px solid rgba(21, 32, 51, 0.12);
  border-radius: 0.65rem;
  background: var(--surface-2);
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.04);
}

.erp-txn-find-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--navy-800);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.erp-txn-find-input {
  width: 4.75rem;
  min-width: 3.75rem;
  max-width: 6rem;
  min-height: 2.4rem;
  height: 2.4rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.84rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  border-color: rgba(21, 32, 51, 0.14);
  background: #fbfcfd;
}

.erp-txn-find-input:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(31, 138, 134, 0.16);
  outline: none;
}

/* Square tool buttons — Search + voucher nav (44px touch target). */
.erp-txn-tool-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(21, 32, 51, 0.14);
  border-radius: 0.65rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%);
  color: var(--navy-800);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.06), 0 2px 5px rgba(11, 18, 32, 0.06);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
}

.erp-txn-tool-btn svg {
  display: block;
  pointer-events: none;
}

.erp-txn-tool-btn:hover:not(:disabled):not(.is-loading) {
  border-color: rgba(31, 138, 134, 0.55);
  background: linear-gradient(180deg, #f3fbfb 0%, #e7f6f5 100%);
  color: var(--teal-500);
  transform: translateY(-1px);
  box-shadow: 0 2px 0 rgba(11, 18, 32, 0.05), 0 4px 10px rgba(31, 138, 134, 0.16);
}

.erp-txn-tool-btn:active:not(:disabled):not(.is-loading),
.erp-txn-tool-btn.is-pressed:not(:disabled) {
  transform: translateY(1px);
  border-color: rgba(31, 138, 134, 0.65);
  background: linear-gradient(180deg, #e8f4f3 0%, #dcefec 100%);
  color: #176f6b;
  box-shadow: inset 0 1px 2px rgba(11, 18, 32, 0.12), 0 0 0 rgba(11, 18, 32, 0);
}

.erp-txn-tool-btn:focus-visible {
  outline: 2px solid rgba(31, 138, 134, 0.55);
  outline-offset: 2px;
}

.erp-txn-tool-btn-search {
  border-color: rgba(31, 138, 134, 0.35);
  background: linear-gradient(180deg, var(--teal-400), var(--teal-500));
  color: #fff;
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.08), 0 2px 6px rgba(31, 138, 134, 0.22);
}

.erp-txn-tool-btn-search:hover:not(:disabled):not(.is-loading) {
  border-color: rgba(26, 124, 120, 0.7);
  background: linear-gradient(180deg, #33b3ad, #1a7c78);
  color: #fff;
}

.erp-txn-tool-btn-search:active:not(:disabled):not(.is-loading),
.erp-txn-tool-btn-search.is-pressed:not(:disabled) {
  background: linear-gradient(180deg, #1a7c78, #166966);
  color: #fff;
}

.erp-txn-tool-btn:disabled,
.erp-txn-tool-btn.is-loading,
.erp-txn-voucher-toolbar.is-busy .erp-txn-tool-btn,
.erp-txn-voucher-toolbar.is-busy .erp-txn-toolbar-new {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.erp-txn-tool-btn.is-loading {
  position: relative;
  color: transparent;
}

.erp-txn-tool-btn.is-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(31, 138, 134, 0.25);
  border-top-color: var(--teal-500);
  animation: erp-txn-tool-spin 0.7s linear infinite;
}

.erp-txn-tool-btn-search.is-loading::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes erp-txn-tool-spin {
  to {
    transform: rotate(360deg);
  }
}

.erp-txn-vno-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  padding: 0.12rem;
  border-radius: 0.75rem;
  background: rgba(21, 32, 51, 0.03);
  border: 1px solid rgba(21, 32, 51, 0.06);
}

.erp-txn-vno-hint {
  margin: 0.18rem 0 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Loaded voucher badge — page title ke neeche; Last Voucher se alag. */
.erp-txn-viewing-vno {
  margin: 0.28rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 138, 134, 0.28);
  background: rgba(31, 138, 134, 0.08);
  color: var(--navy-800);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

@media (max-width: 640px) {
  .erp-txn-viewing-vno {
    font-size: 0.68rem;
    padding: 0.16rem 0.48rem;
  }
}

@media (max-width: 1100px) {
  .erp-txn-voucher-toolbar {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .erp-txn-voucher-toolbar {
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
  }

  .erp-txn-voucher-toolbar--inline {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .erp-txn-find {
    flex: 1 1 auto;
  }

  .erp-txn-find-input {
    flex: 1 1 5rem;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .erp-txn-toolbar-new {
    width: 100%;
    justify-content: center;
  }

  .erp-txn-find {
    flex: 1 1 100%;
    width: 100%;
  }

  .erp-txn-find-input {
    flex: 1 1 auto;
  }

  .erp-txn-vno-nav {
    width: 100%;
    justify-content: space-between;
  }

  .erp-txn-vno-nav .erp-txn-tool-btn {
    flex: 1 1 0;
  }
}

@media (max-width: 390px) {
  .erp-txn-find-label {
    font-size: 0.66rem;
  }

  .erp-txn-tool-btn {
    width: 2.75rem;
    height: 2.75rem;
  }
}

.erp-txn-header-fields .field {
  margin: 0;
  min-width: 0;
}

.erp-txn-header-fields .field-label {
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-weight: 650;
}

.erp-txn-header-fields .ui-input {
  min-height: 2.15rem;
  font-size: 0.82rem;
}

/* Readonly value + muted code badge inside the control. */
.erp-input-with-badge {
  position: relative;
  display: grid;
  min-width: 0;
}

.erp-input-with-badge .ui-input {
  padding-right: 3.6rem;
}

.erp-input-badge {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  max-width: 3.2rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(21, 32, 51, 0.06);
  border: 1px solid rgba(21, 32, 51, 0.1);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bank Receipt/Payment header — Bank Account LOV + readonly code same row. */
.erp-txn-bank-account-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  min-width: 0;
}

.erp-txn-bank-account-row .erp-lov-bank-header {
  flex: 1 1 auto;
  min-width: 0;
}

.erp-txn-bank-code-read {
  flex: 0 0 4.25rem;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0 0.45rem;
  border-radius: var(--radius-sm, 0.35rem);
  border: 1px solid var(--border-soft, rgba(11, 18, 32, 0.12));
  background: rgba(11, 18, 32, 0.03);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--navy-700, #1e293b);
}

/* Bank voucher — form-only notice (flash/session messages se alag). */
.erp-voucher-form-notice {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm, 0.35rem);
  border: 1px solid rgba(185, 28, 28, 0.28);
  background: rgba(185, 28, 28, 0.06);
  color: #991b1b;
  font-size: 0.84rem;
  line-height: 1.4;
}

.erp-voucher-form-notice--info {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
  color: #1e40af;
}

/* Voucher form body — wrapper only; no fieldset border/frame. */
.erp-txn-form-body {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.erp-txn-page--readonly .erp-txn-col-actions {
  display: none;
}

.erp-txn-page--readonly .erp-txn-form-body input:not([type="hidden"]),
.erp-txn-page--readonly .erp-txn-form-body select,
.erp-txn-page--readonly .erp-txn-form-body textarea,
.erp-txn-page--readonly .erp-txn-form-body [data-lov-trigger],
.erp-txn-page--readonly .erp-txn-form-body [data-crv-remove-row],
.erp-txn-page--readonly .erp-txn-form-body [data-cpv-remove-row],
.erp-txn-page--readonly .erp-txn-form-body [data-brv-remove-row],
.erp-txn-page--readonly .erp-txn-form-body [data-bpv-remove-row],
.erp-txn-page--readonly .erp-txn-form-body [data-jv-remove-row] {
  pointer-events: none;
  cursor: default;
}

.erp-txn-page--readonly .erp-txn-form-body .ui-input,
.erp-txn-page--readonly .erp-txn-form-body .field-input,
.erp-txn-page--readonly .erp-txn-form-body .erp-lov-trigger {
  opacity: 1;
  color: var(--navy-900, #0f172a);
}

.erp-txn-page--readonly .erp-txn-field-status .field-input {
  color: var(--navy-700, #334155);
  border-color: var(--border-soft, rgba(11, 18, 32, 0.12));
  background: rgba(11, 18, 32, 0.03);
}

.erp-txn-page--readonly .erp-action-bar-note {
  display: none;
}

.erp-txn-page--readonly .erp-txn-grid,
.erp-txn-page--readonly .erp-txn-grid-card {
  --erp-txn-visible-rows: var(--erp-txn-readonly-rows, 1);
}

.erp-txn-grid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.erp-txn-grid-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy-900);
}

/*
  Reusable transaction data-entry grid.
  Exactly 5 full rows visible (no half-cut); extra rows scroll inside.
*/
.erp-txn-grid,
.erp-txn-grid-card {
  /* Measured JS inhe overwrite kar sakta hai — fallback pehle. */
  --erp-txn-row-h: 3.5rem; /* 56px: padding + 40px action + borders */
  --erp-txn-head-h: 2.25rem;
  --erp-txn-visible-rows: 5;
  /*
    Y chrome fallback = scrollport top/bottom border only.
    Classic OS h-scrollbar space JS `syncTxnGridViewport` measure karke add karta hai
    (overlay scrollbars par fake reserve partial 6th dikhata hai — avoid).
  */
  --erp-txn-grid-border-y: 2px;
  --erp-txn-grid-y-chrome: var(--erp-txn-grid-border-y);
}

.erp-txn-grid-scroll {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-sizing: border-box;
  /* Exact viewport: sticky head + 5 complete body rows + chrome. */
  height: calc(
    var(--erp-txn-head-h)
      + (var(--erp-txn-visible-rows) * var(--erp-txn-row-h))
      + var(--erp-txn-grid-y-chrome)
  );
  max-height: calc(
    var(--erp-txn-head-h)
      + (var(--erp-txn-visible-rows) * var(--erp-txn-row-h))
      + var(--erp-txn-grid-y-chrome)
  );
  min-height: calc(
    var(--erp-txn-head-h)
      + (var(--erp-txn-visible-rows) * var(--erp-txn-row-h))
      + var(--erp-txn-grid-y-chrome)
  );
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.erp-txn-lines-table,
.erp-txn-grid .erp-table {
  /* Horizontal scroll pehle clip se — Action column kabhi shrink na ho. */
  min-width: 52rem;
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.erp-txn-lines-table th,
.erp-txn-lines-table td {
  vertical-align: middle;
  padding: 0.28rem 0.4rem;
  box-sizing: border-box;
}

.erp-txn-lines-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: var(--erp-txn-head-h);
  min-height: var(--erp-txn-head-h);
  max-height: var(--erp-txn-head-h);
  padding: 0.35rem 0.4rem;
  background: #f3f0ea;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 750;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(21, 32, 51, 0.04);
}

.erp-txn-grid-row td {
  height: var(--erp-txn-row-h);
  min-height: var(--erp-txn-row-h);
  max-height: var(--erp-txn-row-h);
  overflow: hidden;
  border-bottom: 1px solid rgba(21, 32, 51, 0.06);
  background: #fff;
  transition: background 0.12s ease;
}

/* Active / focused data-entry row — pale teal. */
.erp-txn-grid-row:focus-within td,
.erp-txn-grid-row.is-active td {
  background: rgba(31, 138, 134, 0.07);
}

.erp-txn-col-sr {
  width: 2.75rem;
  text-align: center;
}

.erp-txn-col-title {
  width: 300px;
}

.erp-txn-col-code {
  width: 5.5rem;
}

.erp-txn-col-narr {
  width: auto;
}

.erp-txn-col-amt {
  width: 6.75rem;
}

.erp-txn-col-chqno {
  width: 6.25rem;
}

.erp-txn-col-chqdate {
  width: 7.25rem;
}

.erp-txn-grid-bank .erp-txn-lines-table {
  min-width: 58rem;
}

.erp-txn-grid-jv .erp-txn-lines-table {
  min-width: 64rem;
}

/* Journal Voucher — seven-field header row (desktop single line). */
.erp-txn-header-fields-jv {
  grid-template-columns:
    minmax(4.25rem, 5.25rem)
    minmax(4.25rem, 5.25rem)
    minmax(9rem, 10.25rem)
    minmax(8.5rem, 1.55fr)
    minmax(5.25rem, 6.75rem)
    minmax(8.75rem, 10rem)
    minmax(4rem, 5rem);
  gap: 0.4rem 0.55rem;
}

.erp-txn-header-fields-jv .field-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.erp-txn-header-fields-jv .erp-lov,
.erp-txn-header-fields-jv .erp-lov-trigger,
.erp-txn-header-fields-jv .ui-input {
  min-width: 0;
  max-width: 100%;
}

.erp-txn-header-fields-jv .erp-lov-trigger {
  width: 100%;
}

@media (max-width: 1100px) {
  .erp-txn-header-fields-jv {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .erp-txn-header-fields-jv .erp-txn-field-header-acc {
    grid-column: span 2;
  }
}

@media (max-width: 960px) {
  .erp-txn-header-fields-jv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .erp-txn-header-fields-jv .erp-txn-field-header-acc {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .erp-txn-header-fields-jv {
    grid-template-columns: minmax(0, 1fr);
  }

  .erp-txn-header-fields-jv .erp-txn-field-header-acc {
    grid-column: auto;
  }
}

.erp-jv-totals {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.25rem 2rem;
}

.erp-jv-total-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.erp-jv-diff.is-balanced {
  color: var(--accent, #1f8a86);
}

.erp-jv-diff.is-unbalanced {
  color: #b45309;
}

.erp-jv-row-error {
  display: block;
  margin-top: 0.15rem;
  line-height: 1.25;
}

.erp-jv-row-error[hidden],
.erp-jv-form-error[hidden] {
  display: none !important;
}

/* Action — fixed right column; kabhi clip/shrink nahi. */
.erp-txn-col-actions {
  width: 4.5rem; /* 72px */
  min-width: 4.5rem;
  max-width: 4.5rem;
  padding-left: 0.35rem;
  padding-right: 0.45rem;
  text-align: center;
  overflow: visible;
}

.erp-txn-lines-table thead th.erp-txn-col-actions {
  padding-left: 0.35rem;
  padding-right: 0.45rem;
}

.erp-txn-lines-table .erp-lov {
  min-width: 0;
}

/* Compact controls — grid cells ke andar clean inputs. */
.erp-txn-lines-table .ui-input,
.erp-txn-lines-table .erp-lov-trigger {
  min-height: 2.25rem;
  height: 2.25rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
  width: 100%;
  box-shadow: none;
  border-radius: 0.4rem;
}

/* Title field mein code duplicate nahi — Code column alag hai. */
.erp-txn-lines-table .erp-lov-trigger-code {
  display: none !important;
}

.erp-txn-code-read {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  max-width: 100%;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(21, 32, 51, 0.1);
  background: rgba(21, 32, 51, 0.04);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
}

.erp-txn-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.erp-txn-srno {
  display: inline-flex;
  min-width: 1.35rem;
  justify-content: center;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}

.erp-txn-lines-table .erp-btn-icon {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
}

/* Remove — full circle visible, min 40×40 touch. */
.erp-txn-lines-table .erp-txn-col-actions .erp-btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  margin: 0 auto;
}

/* Total — grid scroll ke bahar fixed summary. */
.erp-txn-total-bar {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.15rem;
  padding: 0.55rem 0.35rem 0.1rem;
  border-top: 1px solid rgba(21, 32, 51, 0.08);
}

.erp-txn-total-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
}

.erp-txn-total-value {
  min-width: 7rem;
  text-align: right;
  font-size: 1.05rem;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .erp-txn-header-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .erp-txn-field-cash {
    grid-column: span 2;
  }
}

@media (max-width: 960px) {
  .erp-txn-header-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .erp-txn-field-cash {
    grid-column: 1 / -1;
  }

  .erp-txn-col-title {
    width: 16.5rem;
  }
}

@media (max-width: 640px) {
  .erp-page-head {
    align-items: stretch;
  }

  .erp-context-chips {
    justify-content: stretch;
  }

  .erp-context-chip {
    flex: 1 1 auto;
    min-width: 0;
  }

  .erp-txn-header-fields {
    grid-template-columns: 1fr;
  }

  .erp-txn-field-cash {
    grid-column: auto;
  }

  .erp-txn-lines-table {
    min-width: 48rem;
  }

  .erp-txn-lines-table .ui-input,
  .erp-txn-lines-table .erp-lov-trigger {
    min-height: 2.45rem;
    height: 2.45rem;
  }

  .erp-txn-col-actions {
    width: 4.75rem;
    min-width: 4.75rem;
    max-width: 4.75rem;
  }

  .erp-txn-lines-table .erp-txn-col-actions .erp-btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
  }
}

/* ============================================================
   Chart of Accounts — premium ERP financial report
   ============================================================ */

.coa-print-sheet {
  display: none;
  color: #1f2937;
  font-family: var(--font-sans, "Segoe UI", "Helvetica Neue", Helvetica, sans-serif);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

.coa-print-doc {
  width: 100%;
  border-collapse: collapse;
}

.coa-print-doc > thead > tr > td,
.coa-print-doc > tbody > tr > td,
.coa-print-doc > tfoot > tr > td {
  padding: 0;
  vertical-align: top;
}

.coa-print-header {
  margin: 0 0 10pt;
  padding: 12pt 14pt 11pt;
  background: #eef4ff;
  border: 0.75pt solid #d6e2f0;
  border-radius: 6pt;
  box-shadow: 0 1pt 3pt rgba(30, 58, 138, 0.06);
}

.coa-print-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 10pt 14pt;
  align-items: start;
}

.coa-print-header-brand {
  display: flex;
  gap: 10pt;
  align-items: flex-start;
  min-width: 0;
}

.coa-print-logo {
  flex: 0 0 34pt;
  width: 34pt;
  height: 34pt;
  border-radius: 6pt;
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 100%);
  box-shadow: 0 2pt 4pt rgba(30, 58, 138, 0.18);
  display: grid;
  place-items: center;
}

.coa-print-logo-text {
  color: #fff;
  font-size: 11pt;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.coa-print-brand-text {
  min-width: 0;
}

.coa-print-company {
  margin: 0;
  font-size: 14pt;
  font-weight: 700;
  line-height: 1.25;
  color: #1e3a8a;
}

.coa-print-contact {
  margin: 2pt 0 0;
  font-size: 8.5pt;
  line-height: 1.35;
  color: #6b7280;
}

.coa-print-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 2pt;
}

.coa-print-title {
  margin: 0;
  font-size: 13pt;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e3a8a;
  line-height: 1.2;
}

.coa-print-title::after {
  content: "";
  display: block;
  width: 100%;
  max-width: 9rem;
  height: 2pt;
  margin: 5pt auto 0;
  background: #2563eb;
  border-radius: 2pt;
}

.coa-print-header-meta {
  justify-self: end;
}

.coa-print-meta-list {
  margin: 0;
  display: grid;
  gap: 3pt;
}

.coa-print-meta-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6pt;
  justify-items: end;
  font-size: 8.5pt;
  line-height: 1.35;
}

.coa-print-meta-row dt {
  margin: 0;
  font-weight: 700;
  color: #6b7280;
}

.coa-print-meta-row dd {
  margin: 0;
  color: #1f2937;
  text-align: right;
}

.coa-print-col-headers {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  gap: 16pt;
  margin: 0 0 6pt;
  padding: 0 2pt 5pt;
  border-bottom: 0.75pt solid #d6e2f0;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}

.coa-print-col-code {
  text-align: right;
}

.coa-print-hierarchy {
  display: block;
}

.coa-print-category {
  margin: 0 0 12pt;
}

.coa-print-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  column-gap: 16pt;
  align-items: baseline;
}

.coa-print-desc {
  min-width: 0;
  overflow-wrap: anywhere;
}

.coa-print-display-code {
  font-size: 10pt;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #2563eb;
  text-align: right;
  white-space: nowrap;
}

.coa-print-band {
  position: relative;
  padding: 7pt 10pt 7pt 12pt;
  margin: 0 0 7pt;
  background: #eef4ff;
  border: 0.75pt solid #d6e2f0;
  border-radius: 5pt;
  box-shadow: 0 1pt 2pt rgba(30, 58, 138, 0.05);
  page-break-after: avoid;
  break-after: avoid;
}

.coa-print-band::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3.5pt;
  background: #1e3a8a;
  border-radius: 5pt 0 0 5pt;
}

.coa-print-band .coa-print-desc {
  font-size: 11.5pt;
  font-weight: 700;
  color: #1f2937;
}

.coa-print-band .coa-print-display-code {
  font-size: 11.5pt;
  font-weight: 700;
  color: #1e3a8a;
}

.coa-print-group {
  padding-left: 8pt;
  margin-bottom: 4pt;
  page-break-inside: avoid;
  break-inside: avoid;
}

.coa-print-group-row {
  padding: 4pt 0 5pt;
  border-bottom: 0.5pt solid #d6e2f0;
  page-break-after: avoid;
  break-after: avoid;
}

.coa-print-group-row .coa-print-desc {
  font-size: 10.5pt;
  font-weight: 700;
  color: #1f2937;
}

.coa-print-head {
  padding-left: 10pt;
}

.coa-print-head-row {
  padding: 3pt 0;
  page-break-after: avoid;
  break-after: avoid;
}

.coa-print-head-row .coa-print-desc {
  font-size: 10pt;
  font-weight: 650;
  color: #1f2937;
}

.coa-print-account-row {
  padding: 3pt 0 3pt 12pt;
  line-height: 1.42;
  border-radius: 3pt;
  page-break-inside: avoid;
  break-inside: avoid;
}

.coa-print-account-row.is-stripe {
  background: #f8fafc;
}

.coa-print-account-row .coa-print-desc {
  font-size: 10pt;
  font-weight: 400;
  color: #6b7280;
}

.coa-print-empty-note {
  padding-left: 22pt;
  font-size: 8pt;
  color: #94a3b8;
  font-style: italic;
}

.coa-print-empty {
  margin: 14pt 0;
  text-align: center;
  font-size: 10pt;
  color: #6b7280;
}

.coa-print-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8pt;
  margin-top: 12pt;
  padding-top: 7pt;
  border-top: 0.75pt solid #2563eb;
  font-size: 8pt;
  color: #6b7280;
}

.coa-print-footer-center {
  text-align: center;
}

.coa-print-footer-right {
  text-align: right;
}

.coa-report-page {
  margin: 0;
  min-height: 100vh;
  background: #f8fafc;
  color: #1f2937;
}

.coa-report-page .coa-print-sheet {
  display: block;
  max-width: 210mm;
  margin: 0 auto 1.5rem;
  padding: 12mm 14mm 14mm;
  background: #fff;
  box-shadow: 0 2pt 8pt rgba(15, 23, 42, 0.06);
}

@page {
  size: A4 portrait;
  margin: 12mm 14mm 14mm;

  @bottom-left {
    content: "WARISHA ERP";
    font-size: 8pt;
    color: #6b7280;
  }

  @bottom-center {
    content: "Confidential Financial Report";
    font-size: 8pt;
    color: #6b7280;
  }

  @bottom-right {
    content: "Page " counter(page);
    font-size: 8pt;
    color: #6b7280;
  }
}

@media (max-width: 768px) {
  .coa-print-header-grid {
    grid-template-columns: 1fr;
  }

  .coa-print-header-center {
    order: -1;
  }

  .coa-print-header-meta {
    justify-self: start;
  }

  .coa-print-meta-row {
    justify-items: start;
  }

  .coa-print-meta-row dd {
    text-align: left;
  }

  .coa-report-page .coa-print-sheet {
    padding: 1rem;
    margin: 0 0 1rem;
    box-shadow: none;
    border: 1px solid #d6e2f0;
  }

  .coa-print-line,
  .coa-print-col-headers {
    grid-template-columns: minmax(0, 1fr) 5.5rem;
    column-gap: 10pt;
  }
}

@media print {
  html,
  body {
    background: #fff !important;
    color: #1f2937 !important;
  }

  .coa-report-page {
    background: #fff !important;
  }

  .coa-report-page .coa-print-sheet,
  .coa-workspace > .coa-print-sheet {
    display: block !important;
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .app-shell,
  .app-main {
    display: block !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .sidebar,
  .nav-backdrop,
  .mobile-appbar,
  .topbar,
  .erp-messages,
  .no-print,
  .coa-report-toolbar {
    display: none !important;
  }

  .erp-page,
  .coa-report-page {
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    min-height: 0 !important;
  }

  .coa-workspace > *:not(.coa-print-sheet) {
    display: none !important;
  }

  .coa-print-doc {
    width: 100%;
  }

  .coa-print-doc > thead {
    display: table-header-group;
  }

  .coa-print-doc > tbody {
    display: table-row-group;
  }

  .coa-print-header,
  .coa-print-band,
  .coa-print-account-row.is-stripe {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .coa-print-category,
  .coa-print-group,
  .coa-print-head-row,
  .coa-print-account-row {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .coa-print-band,
  .coa-print-group-row {
    page-break-after: avoid;
    break-after: avoid;
  }
}

/* Finance Reports — parameter screen (selector + dynamic params). */

/* Reusable parameter form layout (Financial Reports and future filter screens) */
:root {
  --erp-param-label-height: 1.05rem;
  --erp-param-control-height: 2.75rem;
  --erp-param-field-gap: 0.2rem;
  --erp-param-grid-gap-x: 0.65rem;
  --erp-param-grid-gap-y: 0.45rem;
}

.erp-param-field {
  display: flex;
  flex-direction: column;
  gap: var(--erp-param-field-gap);
  min-width: 0;
  align-self: stretch;
}

.erp-param-field > .field-label,
.erp-param-field > .field-label:first-child {
  min-height: var(--erp-param-label-height);
  display: flex;
  align-items: flex-end;
  margin-bottom: 0;
  line-height: 1.25;
}

.erp-param-option-cell {
  display: flex;
  flex-direction: column;
  gap: var(--erp-param-field-gap);
  align-self: stretch;
  min-width: 0;
}

.erp-param-option-cell::before {
  content: '';
  display: block;
  min-height: var(--erp-param-label-height);
  flex-shrink: 0;
}

.erp-param-option-cell > .erp-check-control,
.erp-param-option-cell > .erp-fin-segmented {
  flex: 1 1 auto;
  min-height: var(--erp-param-control-height);
  align-items: center;
}

.erp-param-option-cell > .erp-check-control {
  align-self: stretch;
}

.erp-param-field > .ui-input,
.erp-param-field > .field-input,
.erp-param-field > .erp-lov,
.erp-param-field > .erp-fin-acc-field,
.erp-param-field > select.field-input,
.erp-param-field > .erp-fin-segmented {
  min-height: var(--erp-param-control-height);
}

.erp-param-field > .erp-lov {
  display: flex;
  align-items: center;
}

.erp-param-field > .erp-fin-segmented {
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
}

/* Shared checkbox + label — flex row, wrapped labels stay vertically centered, 44px touch target. */
.erp-check-control {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.3125rem 0.375rem 0.3125rem 0;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.erp-check-control:focus-within {
  outline: 2px solid rgba(31, 138, 134, 0.35);
  outline-offset: 2px;
}

.erp-check-control input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--accent, #1f8a86);
  cursor: pointer;
}

.erp-check-control__text {
  flex: 1 1 auto;
  min-width: 0;
  text-wrap: pretty;
}

/* Financial report previews — keep formatted amounts on one line without obsolete <nobr>. */
.erp-report-nowrap {
  white-space: nowrap;
}

.erp-fin-reports-page {
  min-width: 0;
}

.erp-page-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 42rem;
}

.erp-fin-reports-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 17.5rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  min-width: 0;
}

.erp-fin-reports-panel-title {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--navy-700, #334155);
}

.erp-fin-reports-selector,
.erp-fin-reports-param-card {
  background: #fff;
  border: 1px solid rgba(21, 32, 51, 0.08);
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-fin-reports-selector {
  padding: 0.85rem 0.75rem 0.95rem;
  position: sticky;
  top: 0.75rem;
}

.erp-fin-report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.erp-fin-report-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(21, 32, 51, 0.08);
  border-radius: 0.7rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.erp-fin-report-card:hover {
  border-color: rgba(31, 138, 134, 0.35);
  background: rgba(31, 138, 134, 0.03);
}

.erp-fin-report-card.is-active {
  border-color: rgba(31, 138, 134, 0.65);
  background: rgba(31, 138, 134, 0.07);
  box-shadow: 0 0 0 1px rgba(31, 138, 134, 0.12);
}

.erp-fin-report-card:focus-visible {
  outline: 2px solid rgba(31, 138, 134, 0.55);
  outline-offset: 2px;
}

.erp-fin-report-card-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: rgba(31, 138, 134, 0.1);
  color: var(--accent, #1f8a86);
}

.erp-fin-report-card-text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.erp-fin-report-card-name {
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--navy-900, #0f172a);
}

.erp-fin-report-card-desc {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.erp-fin-reports-params {
  min-width: 0;
}

.erp-fin-reports-param-card {
  padding: 0.95rem 1rem 1rem;
}

.erp-fin-reports-page.is-abs-report .erp-fin-reports-param-card,
.erp-fin-reports-page.is-gl-report .erp-fin-reports-param-card,
.erp-fin-reports-page.is-tb-report .erp-fin-reports-param-card,
.erp-fin-reports-page.is-pl-report .erp-fin-reports-param-card,
.erp-fin-reports-page.is-bs-report .erp-fin-reports-param-card {
  padding: 0.65rem 0.85rem 0.7rem;
}

.erp-fin-reports-page.is-abs-report .erp-fin-reports-panel-title,
.erp-fin-reports-page.is-gl-report .erp-fin-reports-panel-title,
.erp-fin-reports-page.is-tb-report .erp-fin-reports-panel-title,
.erp-fin-reports-page.is-pl-report .erp-fin-reports-panel-title,
.erp-fin-reports-page.is-bs-report .erp-fin-reports-panel-title {
  margin-bottom: 0.45rem;
}

.erp-fin-reports-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--erp-param-grid-gap-y) var(--erp-param-grid-gap-x);
  align-items: stretch;
}

/* Financial Reports fields — reuse shared param layout primitives */
.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check),
.erp-fin-reports-fields .erp-fin-field-balance-nature {
  display: flex;
  flex-direction: column;
  gap: var(--erp-param-field-gap);
  min-width: 0;
  align-self: stretch;
}

.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check) > .field-label,
.erp-fin-reports-fields .erp-fin-field-balance-nature > .field-label,
.erp-fin-reports-fields .erp-fin-field-compare-with > .field-label,
.erp-fin-reports-fields .erp-fin-field-detail-level > .field-label {
  min-height: var(--erp-param-label-height);
  display: flex;
  align-items: flex-end;
  margin-bottom: 0;
  line-height: 1.25;
}

.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check) > .ui-input,
.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check) > .field-input,
.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check) > .erp-lov,
.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check) > .erp-fin-acc-field,
.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check) > select.field-input,
.erp-fin-reports-fields .erp-fin-field-balance-nature > .erp-fin-segmented {
  min-height: var(--erp-param-control-height);
}

.erp-fin-reports-fields .field.erp-fin-field:not(.erp-fin-abs-section-heading):not(.erp-fin-field-check) > .erp-lov {
  display: flex;
  align-items: center;
}

.erp-fin-reports-fields .erp-fin-field-check {
  display: flex;
  flex-direction: column;
  gap: var(--erp-param-field-gap);
  align-self: stretch;
  min-width: 0;
}

.erp-fin-reports-fields .erp-fin-field-check::before {
  content: '';
  display: block;
  min-height: var(--erp-param-label-height);
  flex-shrink: 0;
}

.erp-fin-reports-fields .erp-fin-field-check > .erp-check-control {
  flex: 1 1 auto;
  min-height: var(--erp-param-control-height);
  align-self: stretch;
}

.erp-fin-reports-fields .erp-fin-field-balance-nature {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
}

.erp-fin-reports-fields .erp-fin-field-balance-nature > .erp-fin-segmented {
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  flex-wrap: nowrap;
}

.erp-fin-reports-fields .erp-fin-field-compare-with > .erp-fin-segmented,
.erp-fin-reports-fields .erp-fin-field-detail-level > .erp-fin-segmented {
  min-height: var(--erp-param-control-height);
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  flex-wrap: nowrap;
}

.erp-fin-abs-section-heading {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
}

.erp-fin-abs-section-heading:first-child {
  margin-top: 0;
}

.erp-fin-abs-section-title {
  margin: 0;
  padding: 0.35rem 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-700, #334155);
  border-bottom: 1px solid rgba(21, 32, 51, 0.08);
}

.erp-fin-reports-page.is-abs-report .erp-fin-abs-section-heading,
.erp-fin-reports-page.is-gl-report .erp-fin-abs-section-heading,
.erp-fin-reports-page.is-tb-report .erp-fin-abs-section-heading,
.erp-fin-reports-page.is-bs-report .erp-fin-abs-section-heading {
  margin-top: 0;
}

.erp-fin-reports-page.is-abs-report .erp-fin-abs-section-heading + .erp-fin-field,
.erp-fin-reports-page.is-abs-report .erp-fin-abs-section-heading + .erp-fin-field + .erp-fin-field,
.erp-fin-reports-page.is-gl-report .erp-fin-abs-section-heading + .erp-fin-field,
.erp-fin-reports-page.is-gl-report .erp-fin-abs-section-heading + .erp-fin-field + .erp-fin-field,
.erp-fin-reports-page.is-tb-report .erp-fin-abs-section-heading + .erp-fin-field,
.erp-fin-reports-page.is-tb-report .erp-fin-abs-section-heading + .erp-fin-field + .erp-fin-field,
.erp-fin-reports-page.is-bs-report .erp-fin-abs-section-heading + .erp-fin-field,
.erp-fin-reports-page.is-bs-report .erp-fin-abs-section-heading + .erp-fin-field + .erp-fin-field,
.erp-fin-reports-page.is-bs-report .erp-fin-field-detail-level,
.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="show_zero_balances"],
.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="include_closed"] {
  margin-top: 0;
}

.erp-fin-reports-page.is-pl-report .erp-fin-abs-section-heading {
  margin-top: 0;
}

.erp-fin-reports-page.is-pl-report .erp-fin-abs-section-heading + .erp-fin-field,
.erp-fin-reports-page.is-pl-report .erp-fin-abs-section-heading + .erp-fin-field + .erp-fin-field {
  margin-top: 0;
}

.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="bs_section_report_options"] {
  display: none !important;
}

.erp-fin-reports-page.is-abs-report .erp-fin-abs-section-title,
.erp-fin-reports-page.is-gl-report .erp-fin-abs-section-title,
.erp-fin-reports-page.is-tb-report .erp-fin-abs-section-title,
.erp-fin-reports-page.is-pl-report .erp-fin-abs-section-title,
.erp-fin-reports-page.is-bs-report .erp-fin-abs-section-title {
  padding: 0.1rem 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: none;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-reports-fields {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--erp-param-grid-gap-y) var(--erp-param-grid-gap-x);
  align-items: stretch;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field .field-label {
  margin-bottom: 0;
  font-size: 0.78rem;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="financial_year"] {
  grid-column: span 2;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="from_date"],
.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="to_date"] {
  grid-column: span 2;
}

.erp-fin-reports-page.is-tb-report .erp-fin-field[data-fr-param="as_at_date"],
.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="as_at_date"] {
  grid-column: span 2;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="branch"] {
  grid-column: span 6;
}

.erp-fin-reports-page.is-tb-report .erp-fin-field[data-fr-param="branch"] {
  grid-column: span 8;
}

.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="branch"] {
  grid-column: span 6;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-bs-report) .erp-fin-field[data-fr-param="account_category"],
.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-bs-report) .erp-fin-field[data-fr-param="account_group"],
.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-bs-report) .erp-fin-field[data-fr-param="account_head"] {
  grid-column: span 4;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report) .erp-fin-field[data-fr-param="account_from"],
.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report) .erp-fin-field[data-fr-param="account_to"] {
  grid-column: span 6;
}

.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="account_from"],
.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="account_to"] {
  grid-column: span 4;
  max-width: none;
  justify-self: stretch;
}

/* Display Options row — compact Balance Nature + checkboxes (ABS/TB) */
.erp-fin-reports-page:is(.is-abs-report, .is-tb-report) .erp-fin-field-balance-nature {
  grid-column: span 4;
}

.erp-fin-reports-page:is(.is-abs-report, .is-tb-report) .erp-fin-field[data-fr-param="show_zero_balances"],
.erp-fin-reports-page:is(.is-abs-report, .is-tb-report) .erp-fin-field[data-fr-param="include_closed"] {
  grid-column: span 4;
}

/* Report Options row — Voucher Type LOV + checkboxes (GL) */
.erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="voucher_type"] {
  grid-column: span 4;
  max-width: 18rem;
}

.erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="include_opening_balance"],
.erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="include_closed"] {
  grid-column: span 3;
}

.erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="show_zero_activity"] {
  grid-column: span 2;
}

/* Profit & Loss — Date Range + Group/Head filters + Report Options */
.erp-fin-reports-page.is-pl-report .erp-fin-field[data-fr-param="account_group"],
.erp-fin-reports-page.is-pl-report .erp-fin-field[data-fr-param="account_head"] {
  grid-column: span 6;
}

.erp-fin-reports-fields .erp-fin-field-compare-with,
.erp-fin-reports-fields .erp-fin-field-detail-level {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
}

.erp-fin-reports-page.is-pl-report .erp-fin-field-compare-with {
  grid-column: span 4;
}

.erp-fin-reports-page.is-pl-report .erp-fin-field-detail-level {
  grid-column: span 4;
}

.erp-fin-reports-page.is-pl-report .erp-fin-field[data-fr-param="show_zero_balances"],
.erp-fin-reports-page.is-pl-report .erp-fin-field[data-fr-param="include_closed"] {
  grid-column: span 2;
}

/* Balance Sheet — Detail Level + Account range + display toggles (GL-aligned compact rows) */
.erp-fin-reports-page.is-bs-report .erp-fin-field-detail-level {
  grid-column: span 4;
}

.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="show_zero_balances"],
.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="include_closed"] {
  grid-column: span 3;
}

/* Practical compact widths — desktop grid cells, content-sized where appropriate */
.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="financial_year"] {
  max-width: 8.5rem;
  justify-self: start;
}

.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="from_date"],
.erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="to_date"],
.erp-fin-reports-page.is-tb-report .erp-fin-field[data-fr-param="as_at_date"],
.erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="as_at_date"] {
  max-width: 13rem;
  justify-self: start;
}

.erp-fin-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.15rem;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 0.5rem;
  background: rgba(21, 32, 51, 0.02);
  width: fit-content;
  max-width: 100%;
}

.erp-fin-reports-page.is-abs-report .erp-fin-segmented,
.erp-fin-reports-page.is-gl-report .erp-fin-segmented,
.erp-fin-reports-page.is-tb-report .erp-fin-segmented,
.erp-fin-reports-page.is-bs-report .erp-fin-segmented {
  gap: 0.2rem;
  padding: 0.12rem;
}

.erp-fin-segment {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.erp-fin-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.erp-fin-segment span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.86rem;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.erp-fin-reports-page.is-abs-report .erp-fin-segment span,
.erp-fin-reports-page.is-gl-report .erp-fin-segment span,
.erp-fin-reports-page.is-tb-report .erp-fin-segment span {
  min-height: 1.75rem;
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
}

.erp-fin-segment input:checked + span {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.erp-fin-segment input:focus-visible + span {
  outline: 2px solid rgba(31, 138, 134, 0.45);
  outline-offset: 1px;
}

.erp-fin-field.field-full,
.erp-fin-field.field-lg {
  grid-column: 1 / -1;
}

.erp-fin-reports-page .erp-check-control {
  font-size: 0.8125rem;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem 0.25rem 0;
}

.erp-fin-reports-page.is-abs-report .erp-fin-reports-action-bar,
.erp-fin-reports-page.is-gl-report .erp-fin-reports-action-bar,
.erp-fin-reports-page.is-tb-report .erp-fin-reports-action-bar,
.erp-fin-reports-page.is-bs-report .erp-fin-reports-action-bar {
  margin-top: 0.55rem;
}

.erp-fin-acc-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.erp-fin-acc-lov {
  min-width: 0;
}

.erp-fin-acc-code {
  min-width: 3.25rem;
  text-align: right;
  white-space: nowrap;
}

.erp-fin-reports-action-bar {
  margin-top: 0.85rem;
}

.erp-fin-print-feedback {
  flex: 1 1 100%;
  margin: 0;
  min-height: 0;
}

.erp-fin-reports-action-bar .erp-fin-print-feedback:not([hidden]) {
  display: block;
  width: 100%;
}

.erp-fin-field.is-hidden,
.erp-fin-field[hidden] {
  display: none !important;
}

@media (max-width: 960px) {
  .erp-fin-reports-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .erp-fin-reports-selector {
    position: static;
  }

  .erp-fin-reports-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-reports-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--erp-param-grid-gap-y) var(--erp-param-grid-gap-x);
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="financial_year"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="from_date"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="to_date"],
  .erp-fin-reports-page.is-tb-report .erp-fin-field[data-fr-param="as_at_date"],
  .erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="as_at_date"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-bs-report) .erp-fin-field[data-fr-param="account_category"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="account_group"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="account_head"],
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="voucher_type"],
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="include_opening_balance"],
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="include_closed"],
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="show_zero_activity"],
  .erp-fin-reports-page:is(.is-abs-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="show_zero_balances"],
  .erp-fin-reports-page:is(.is-abs-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="include_closed"],
  .erp-fin-reports-page.is-pl-report .erp-fin-field-compare-with,
  .erp-fin-reports-page.is-pl-report .erp-fin-field-detail-level,
  .erp-fin-reports-page.is-bs-report .erp-fin-field-detail-level {
    grid-column: auto;
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="financial_year"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="from_date"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="to_date"],
  .erp-fin-reports-page.is-tb-report .erp-fin-field[data-fr-param="as_at_date"],
  .erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="as_at_date"],
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="voucher_type"] {
    max-width: none;
    justify-self: stretch;
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-pl-report) .erp-fin-field[data-fr-param="branch"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-bs-report) .erp-fin-field[data-fr-param="account_from"],
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-bs-report) .erp-fin-field[data-fr-param="account_to"],
  .erp-fin-reports-page.is-tb-report .erp-fin-field[data-fr-param="branch"],
  .erp-fin-reports-page.is-bs-report .erp-fin-field[data-fr-param="branch"],
  .erp-fin-reports-page.is-pl-report .erp-fin-field[data-fr-param="account_group"],
  .erp-fin-reports-page.is-pl-report .erp-fin-field[data-fr-param="account_head"] {
    grid-column: 1 / -1;
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-tb-report) .erp-fin-field-balance-nature {
    grid-column: 1 / -1;
    width: auto;
    max-width: none;
    justify-self: stretch;
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="show_zero_balances"],
  .erp-fin-reports-page:is(.is-abs-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param="include_closed"] {
    grid-column: span 1;
  }

  .erp-fin-reports-page.is-pl-report .erp-fin-field-compare-with,
  .erp-fin-reports-page.is-pl-report .erp-fin-field-detail-level,
  .erp-fin-reports-page.is-bs-report .erp-fin-field-detail-level {
    grid-column: 1 / -1;
    width: auto;
    max-width: none;
    justify-self: stretch;
  }

  /* Report Options — full-width Voucher Type, three equal checkboxes */
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="voucher_type"] {
    grid-column: 1 / -1;
  }

  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="include_opening_balance"],
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="include_closed"],
  .erp-fin-reports-page.is-gl-report .erp-fin-field[data-fr-param="show_zero_activity"] {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .erp-fin-reports-fields,
  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-reports-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--erp-param-grid-gap-y);
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-gl-report, .is-tb-report, .is-pl-report, .is-bs-report) .erp-fin-field[data-fr-param] {
    grid-column: 1 / -1;
    max-width: none;
    justify-self: stretch;
  }

  .erp-fin-reports-page:is(.is-abs-report, .is-tb-report) .erp-fin-field-balance-nature {
    width: auto;
    max-width: none;
  }

  .erp-fin-acc-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .erp-fin-acc-code {
    text-align: left;
  }

  .erp-fin-reports-page.is-abs-report .erp-fin-segmented,
  .erp-fin-reports-page.is-gl-report .erp-fin-segmented,
  .erp-fin-reports-page.is-tb-report .erp-fin-segmented,
  .erp-fin-reports-page.is-bs-report .erp-fin-segmented {
    width: 100%;
  }

  .erp-fin-reports-page.is-abs-report .erp-fin-segment,
  .erp-fin-reports-page.is-gl-report .erp-fin-segment,
  .erp-fin-reports-page.is-tb-report .erp-fin-segment,
  .erp-fin-reports-page.is-bs-report .erp-fin-segment {
    flex: 1 1 auto;
  }

  .erp-fin-reports-page.is-abs-report .erp-fin-segment span,
  .erp-fin-reports-page.is-gl-report .erp-fin-segment span,
  .erp-fin-reports-page.is-tb-report .erp-fin-segment span,
  .erp-fin-reports-page.is-bs-report .erp-fin-segment span {
    justify-content: center;
    width: 100%;
    min-height: 2.35rem;
  }

  .erp-fin-reports-page .erp-check-control {
    padding: 0.375rem 0.5rem 0.375rem 0;
  }
}

/* ==========================================================================
   Voucher Approval & Posting workspace
   ========================================================================== */

.vap-workspace {
  --vap-gap: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.vap-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.vap-title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--ink);
  font-family: var(--font-display);
}

.vap-subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.vap-policy-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--teal-100);
  color: var(--teal-500);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.vap-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(10rem, 0.9fr);
  gap: var(--space-3);
  align-items: stretch;
}

.vap-summary-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}

.vap-summary-icon {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--teal-500);
  flex: 0 0 auto;
}

.vap-summary-d .vap-summary-icon { background: #3b82f6; }
.vap-summary-p .vap-summary-icon { background: var(--ok); }
.vap-summary-c .vap-summary-icon { background: var(--copper-500); }

.vap-summary-label {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vap-summary-value {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.vap-summary-help {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.vap-summary-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.25rem;
}

.vap-period-note,
.vap-refresh,
.vap-muted,
.vap-capability-note,
.vap-return-note,
.vap-post-hint,
.vap-post-blockers,
.vap-posted-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.vap-refresh-link {
  margin-left: 0.35rem;
  color: var(--teal-500);
  text-decoration: none;
}

.vap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(20rem, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.vap-queue-pane,
.vap-review-pane {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.vap-queue-pane {
  padding: var(--space-3);
}

.vap-review-pane {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding: var(--space-3);
}

.vap-filters {
  margin-bottom: var(--space-3);
}

.vap-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.vap-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.vap-field span {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

.vap-field input,
.vap-field select,
.vap-remarks textarea {
  width: 100%;
  min-height: 2.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.vap-field input:focus,
.vap-field select:focus,
.vap-remarks textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--teal-500) 35%, transparent);
  border-color: var(--teal-500);
}

.vap-field-search {
  grid-column: span 2;
}

.vap-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.vap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--space-3);
  align-items: center;
}

.vap-chip {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--ink);
  font-size: 0.72rem;
}

.vap-chip-clear {
  font-size: 0.72rem;
  color: var(--teal-500);
}

.vap-queue-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.vap-queue-totals {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.vap-tool-btn,
.vap-nav-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
}

.vap-nav-btn.is-disabled {
  opacity: 0.45;
  cursor: default;
}

.vap-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.vap-queue-table,
.vap-mini-lines,
.vap-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.vap-queue-table th,
.vap-queue-table td,
.vap-mini-lines th,
.vap-mini-lines td,
.vap-lines-table th,
.vap-lines-table td {
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.vap-workspace.is-compact .vap-queue-table th,
.vap-workspace.is-compact .vap-queue-table td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.vap-queue-table th {
  background: #f4f7fa;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.vap-queue-table .is-num,
.vap-mini-lines .is-num,
.vap-lines-table .is-num,
.vap-recon-value.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vap-queue-row {
  cursor: pointer;
}

.vap-queue-row:hover {
  background: #f7fbfb;
}

.vap-queue-row.is-selected {
  background: color-mix(in srgb, var(--teal-100) 70%, #fff);
  box-shadow: inset 3px 0 0 var(--teal-500);
}

.vap-type-badge {
  display: inline-flex;
  min-width: 2.1rem;
  justify-content: center;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.vap-type-cr { background: #dbeafe; color: #1d4ed8; }
.vap-type-cp { background: #dcfce7; color: #166534; }
.vap-type-br { background: #ede9fe; color: #5b21b6; }
.vap-type-bp { background: #ffedd5; color: #9a3412; }
.vap-type-jv { background: #e0f2fe; color: #075985; }

.vap-status-pill,
.vap-control-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #eef2f6;
  color: var(--ink);
}

.vap-status-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.vap-status-d { color: #1d4ed8; background: #dbeafe; }
.vap-status-s { color: #92400e; background: #fef3c7; }
.vap-status-r { color: #9f1239; background: #ffe4e6; }
.vap-status-p { color: #166534; background: #dcfce7; }
.vap-status-c { color: #9a3412; background: #ffedd5; }

.vap-summary-pending_review .vap-summary-icon,
.vap-summary-ready_to_post .vap-summary-icon { background: #d97706; }
.vap-summary-exceptions .vap-summary-icon { background: var(--danger); }
.vap-summary-returned .vap-summary-icon { background: #e11d48; }

.vap-evidence-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.vap-evidence-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.vap-evidence-item p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.vap-upload-form {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.vap-action-forms {
  display: grid;
  gap: var(--space-4);
}
.vap-return-form {
  display: grid;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.vap-audit-transition {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}
.erp-txn-submit-form {
  display: inline-flex;
}
.erp-txn-readonly-notice {
  margin: 0 var(--space-2) 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 22rem;
}
.erp-txn-return-banner,
.erp-txn-submitted-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 var(--space-2) 0 0;
  max-width: 28rem;
  font-size: 0.9rem;
}
.erp-txn-return-banner {
  color: #9f1239;
}
.erp-txn-return-banner p {
  margin: 0;
  width: 100%;
  color: var(--muted);
}
.erp-txn-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.erp-txn-status-submitted {
  color: #92400e;
  background: #fef3c7;
}
.erp-txn-approval-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vap-control-pill.is-ok { color: var(--ok); background: #e8f6ee; }
.vap-control-pill.is-warn { color: #9a3412; background: #ffedd5; }
.vap-control-pill.is-fail { color: var(--danger); background: #fdecec; }

.vap-vno-link {
  color: var(--teal-500);
  font-weight: 600;
  text-decoration: none;
}

.vap-vno-link:hover,
.vap-vno-link:focus-visible {
  text-decoration: underline;
}

.vap-empty,
.vap-empty-panel {
  color: var(--muted);
  text-align: center;
  padding: 1.25rem 0.75rem;
}

.vap-pagination {
  margin-top: var(--space-3);
}

.vap-review-mobile-bar {
  display: none;
  margin-bottom: 0.75rem;
}

.vap-review-header {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.vap-review-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.vap-review-vno {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.vap-review-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.vap-review-count {
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.vap-open-full {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--teal-500);
  font-weight: 600;
}

.vap-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.85rem;
  margin: 0 0 0.85rem;
}

.vap-meta-grid dt,
.vap-summary-fields dt {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0 0 0.1rem;
}

.vap-meta-grid dd,
.vap-summary-fields dd {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink);
  font-weight: 600;
}

.vap-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.85rem;
}

.vap-tab {
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.vap-tab.is-active {
  color: var(--teal-500);
  border-bottom-color: var(--teal-500);
  font-weight: 700;
}

.vap-summary-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.vap-recon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  margin-bottom: 0.85rem;
}

.vap-recon-label {
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
}

.vap-recon-value {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.vap-recon-status {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.vap-preview-block,
.vap-controls-block {
  margin-bottom: 0.9rem;
}

.vap-preview-head,
.vap-controls-block h4,
.vap-preview-block h4 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
}

.vap-preview-head a {
  font-size: 0.75rem;
  color: var(--teal-500);
}

.vap-controls-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.vap-controls-list li {
  display: flex;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.vap-controls-list li p {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.vap-controls-list .vap-control-icon {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.vap-controls-list .is-pass .vap-control-icon {
  background: #e8f6ee;
  color: var(--ok);
}

.vap-controls-list .is-neutral .vap-control-icon {
  background: #f3f4f6;
  color: var(--muted);
}

.vap-controls-list .is-fail .vap-control-icon {
  background: #fdecec;
  color: var(--danger);
}

.vap-audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.vap-audit-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  display: grid;
  gap: 0.15rem;
}

.vap-audit-list time,
.vap-audit-list span {
  font-size: 0.75rem;
  color: var(--muted);
}

.vap-actions {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.vap-remarks {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.vap-remarks span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.vap-action-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vap-post-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.vap-post-btn {
  min-width: 9.5rem;
}

.vap-post-hint kbd {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.25rem;
  background: #f4f7fa;
  font-size: 0.7rem;
}

.vap-post-blockers {
  color: var(--danger);
}

@media (max-width: 1100px) {
  .vap-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vap-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vap-field-search {
    grid-column: span 2;
  }

  .vap-layout {
    grid-template-columns: 1fr;
  }

  .vap-review-pane {
    position: static;
    max-height: none;
  }

  .vap-recon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .vap-summary-strip,
  .vap-filter-grid,
  .vap-meta-grid,
  .vap-recon {
    grid-template-columns: 1fr;
  }

  .vap-field-search {
    grid-column: auto;
  }

  .vap-review-mobile-bar {
    display: block;
  }

  .vap-queue-pane.is-hidden-mobile,
  .vap-review-pane.is-hidden-mobile {
    display: none;
  }

  .vap-open-full {
    margin-left: 0;
  }
}
