:root,
[data-theme="blue"] {
  --menu-bg: #1e4b8e;
  --menu-bg-hover: #163a6e;
  --menu-active: #0f2d58;
  --menu-text: #e8eef8;
  --submenu-bg: #fff;
  --submenu-w: 220px;
  --submenu-w-sm: 76px;
  --menu-w: 76px;
  --header-h: 56px;
  --body-bg: #d6dbe3;
  --content-bg: #fff;
  --surface: #fff;
  --header-bg: #fff;
  --hover: #f3f6fa;
  --active-tint: #e8eef8;
  --table-head: #f8fafc;
  --input-bg: #fff;
  --text: #1a2332;
  --muted: #5c6b7a;
  --line: #d8dee6;
  --primary: #1e4b8e;
  --primary-hover: #163a6e;
  --on-primary: #fff;
  --danger: #b42318;
  --ok: #067647;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  --busy-overlay: rgba(255, 255, 255, 0.78);
  --busy-primary: rgba(30, 75, 142, 0.88);
  --mask: rgba(16, 24, 40, 0.35);
  /* File-type icons: base = label/stroke, -bg = sheet fill, -fold = folded corner */
  --ft-sheet: #e8eef5;
  --ft-fold: #d5deea;
  --ft-stroke: #8a9bb0;
  --ft-label: #64748b;
  --ft-pdf: #dc2626;
  --ft-pdf-bg: #fee2e2;
  --ft-pdf-fold: #fecaca;
  --ft-doc: #2563eb;
  --ft-doc-bg: #dbeafe;
  --ft-doc-fold: #bfdbfe;
  --ft-xls: #15803d;
  --ft-xls-bg: #dcfce7;
  --ft-xls-fold: #bbf7d0;
  --ft-ppt: #c2410c;
  --ft-ppt-bg: #ffedd5;
  --ft-ppt-fold: #fed7aa;
  --ft-zip: #7c3aed;
  --ft-txt: #475569;
}

[data-theme="teal"] {
  --menu-bg: #0f766e;
  --menu-bg-hover: #115e59;
  --menu-active: #134e4a;
  --menu-text: #ecfdf5;
  --submenu-bg: #fff;
  --body-bg: #d5e5e3;
  --content-bg: #fff;
  --surface: #fff;
  --header-bg: #fff;
  --hover: #f0fdfa;
  --active-tint: #ccfbf1;
  --table-head: #f0fdfa;
  --input-bg: #fff;
  --text: #134e4a;
  --muted: #5b7471;
  --line: #cde4df;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --on-primary: #fff;
  --busy-primary: rgba(15, 118, 110, 0.88);
}

[data-theme="forest"] {
  --menu-bg: #14532d;
  --menu-bg-hover: #166534;
  --menu-active: #052e16;
  --menu-text: #ecfdf3;
  --submenu-bg: #fff;
  --body-bg: #d7ddd8;
  --content-bg: #fff;
  --surface: #fff;
  --header-bg: #fff;
  --hover: #f0fdf4;
  --active-tint: #dcfce7;
  --table-head: #f3faf4;
  --input-bg: #fff;
  --text: #14532d;
  --muted: #5c6b62;
  --line: #d0dbd3;
  --primary: #15803d;
  --primary-hover: #166534;
  --on-primary: #fff;
  --busy-primary: rgba(21, 128, 61, 0.88);
}

[data-theme="indigo"] {
  --menu-bg: #3730a3;
  --menu-bg-hover: #312e81;
  --menu-active: #1e1b4b;
  --menu-text: #eef2ff;
  --submenu-bg: #fff;
  --body-bg: #d8dbe8;
  --content-bg: #fff;
  --surface: #fff;
  --header-bg: #fff;
  --hover: #eef2ff;
  --active-tint: #e0e7ff;
  --table-head: #eef2ff;
  --input-bg: #fff;
  --text: #1e1b4b;
  --muted: #5c647a;
  --line: #d4d8e8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --on-primary: #fff;
  --busy-primary: rgba(79, 70, 229, 0.88);
}

[data-theme="sunset"] {
  --menu-bg: #9a3412;
  --menu-bg-hover: #7c2d12;
  --menu-active: #431407;
  --menu-text: #fff7ed;
  --submenu-bg: #fff;
  --body-bg: #e4dcd6;
  --content-bg: #fff;
  --surface: #fff;
  --header-bg: #fff;
  --hover: #fff7ed;
  --active-tint: #ffedd5;
  --table-head: #fff7ed;
  --input-bg: #fff;
  --text: #431407;
  --muted: #7a655c;
  --line: #e4d5c8;
  --primary: #c2410c;
  --primary-hover: #9a3412;
  --on-primary: #fff;
  --busy-primary: rgba(194, 65, 12, 0.88);
}

[data-theme="slate"] {
  --menu-bg: #334155;
  --menu-bg-hover: #1e293b;
  --menu-active: #0f172a;
  --menu-text: #f1f5f9;
  --submenu-bg: #fff;
  --body-bg: #d5d9e0;
  --content-bg: #fff;
  --surface: #fff;
  --header-bg: #fff;
  --hover: #f1f5f9;
  --active-tint: #e2e8f0;
  --table-head: #f8fafc;
  --input-bg: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #d8dee6;
  --primary: #334155;
  --primary-hover: #1e293b;
  --on-primary: #fff;
  --busy-primary: rgba(51, 65, 85, 0.88);
}

[data-theme="dark"] {
  --menu-bg: #0b1220;
  --menu-bg-hover: #111827;
  --menu-active: #1e293b;
  --menu-text: #e5e7eb;
  --submenu-bg: #1f2937;
  --body-bg: #030712;
  --content-bg: #111827;
  --surface: #1f2937;
  --header-bg: #111827;
  --hover: #374151;
  --active-tint: #1e3a5f;
  --table-head: #1f2937;
  --input-bg: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #374151;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --on-primary: #fff;
  --danger: #f87171;
  --ok: #34d399;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --busy-overlay: rgba(17, 24, 39, 0.82);
  --busy-primary: rgba(37, 99, 235, 0.9);
  --mask: rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--body-bg);
  color: var(--text);
}

/* Hide page body until layout.js wraps it in .app — header, left nav, and content appear together */
body > #pageContent {
  visibility: hidden;
}
.app #pageContent {
  visibility: visible;
}

.ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* --- Shell --- */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.app-nav {
  display: flex;
  flex-shrink: 0;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  position: relative;
  z-index: 8;
}
.app-menu {
  width: var(--menu-w);
  flex-shrink: 0;
  background: var(--menu-bg);
  color: var(--menu-text);
  display: flex;
  flex-direction: column;
  overflow: auto;
  z-index: 4;
}
.app-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 68px;
  padding: 0.45rem 0.3rem;
  color: var(--menu-text);
  text-decoration: none;
  font-size: 0.68rem;
  line-height: 1.15;
  text-align: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.app-menu-item:hover { background: var(--menu-bg-hover); }
.app-menu-item.is-active {
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
  box-shadow: inset 4px 0 0 #fff;
}
.menu-key {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.app-submenu {
  width: var(--submenu-w);
  flex-shrink: 0;
  height: 100%;
  min-height: 0;
  background: var(--submenu-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.22s ease;
  z-index: 7;
  position: relative;
}
.app-submenu.is-shrunk { width: var(--submenu-w-sm); }
.app-submenu-head {
  flex-shrink: 0;
  padding: 0.7rem 0.9rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  background: var(--active-tint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-submenu-head .short { display: none; }
.app-submenu.is-shrunk .app-submenu-head {
  padding: 0.5rem 0.2rem;
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.15;
}
.app-submenu.is-shrunk .app-submenu-head .label { display: none; }
.app-submenu.is-shrunk .app-submenu-head .short { display: block; }
.app-submenu-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.25rem 0 0.85rem;
  overscroll-behavior: contain;
}
.app-submenu-group { margin-bottom: 0.35rem; }
.app-submenu-group-title {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.4rem 0.7rem 0.4rem 0.65rem;
  white-space: nowrap;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.app-submenu-group-title:hover { color: var(--text); background: var(--hover); }
.app-submenu-group-caret {
  display: flex;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}
.app-submenu-group-caret .ico {
  width: 12px;
  height: 12px;
}
.app-submenu-group.is-collapsed .app-submenu-group-caret { transform: rotate(180deg); }
.app-submenu-group.is-collapsed .app-submenu-group-items { display: none; }
.app-submenu-group-title .label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-submenu.is-shrunk .app-submenu-group-title {
  justify-content: center;
  padding: 0.35rem 0.15rem;
  font-size: 0.58rem;
}
.app-submenu.is-shrunk .app-submenu-group-caret { display: none; }
.app-submenu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  min-height: 40px;
}
.app-submenu-item:hover { background: var(--hover); }
.app-submenu-item.is-active {
  background: var(--active-tint);
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}
.app-submenu-item .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-submenu-item .short { display: none; font-size: 0.68rem; line-height: 1.1; text-align: center; }
.app-submenu.is-shrunk .app-submenu-item {
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.4rem 0.25rem;
  min-height: 52px;
}
.app-submenu.is-shrunk .app-submenu-item .label { display: none; }
.app-submenu.is-shrunk .app-submenu-item .short { display: block; }

.app-submenu-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 0 4px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.35);
}
.app-submenu-toggle:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}
.app-submenu-toggle .ico {
  width: 12px;
  height: 12px;
  fill: currentColor;
  stroke: none;
}
.app-submenu.is-shrunk .app-submenu-toggle .ico { transform: rotate(180deg); }

.app-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-header {
  height: var(--header-h);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 0 1.1rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  gap: 0.75rem;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.app-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.app-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
}
.page-back {
  flex-shrink: 0;
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.page-back:hover { background: var(--hover); }
.page-back .ico {
  width: 22px;
  height: 22px;
}
.page-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--busy-overlay);
  color: var(--muted);
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 8px;
}
.page-loading-msg {
  margin: 1.5rem 0;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}
.table-loading-row td {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  padding: 1.75rem 1rem !important;
}
/*
  Name links (ledger / group). Underlines are off by default.
  Restore them by adding class name-link-underline on <html> or <body>.
*/
a.led-link,
a.led-link:link,
a.led-link:visited,
a.led-link:hover,
a.led-link:active,
a.rpt-link,
a.rpt-link:link,
a.rpt-link:visited,
a.rpt-link:hover,
a.rpt-link:active {
  color: #000;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.name-link-underline a.led-link,
.name-link-underline a.led-link:link,
.name-link-underline a.led-link:visited,
.name-link-underline a.led-link:hover,
.name-link-underline a.led-link:active,
.name-link-underline a.rpt-link,
.name-link-underline a.rpt-link:link,
.name-link-underline a.rpt-link:visited,
.name-link-underline a.rpt-link:hover,
.name-link-underline a.rpt-link:active,
.name-link-underline .rpt-crumbs a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.app-header-fy {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.35rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.app-header-fy .btn-fy-switch {
  padding: 0.2rem;
}
.fy-switch-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}
.hdr-item { position: relative; }
.hdr-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.hdr-btn:hover, .hdr-item.is-open .hdr-btn { background: var(--hover); }
.hdr-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem 0.25rem 0.35rem;
  width: auto !important;
  min-width: 0;
}
.hdr-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hdr-drop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.35rem 0;
  display: none;
  z-index: 20;
}
.hdr-item.is-open .hdr-drop { display: block; }
.hdr-drop a, .hdr-drop button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.85rem;
  font: inherit;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.hdr-drop a:hover, .hdr-drop button:hover { background: var(--hover); }
.hdr-drop .drop-muted {
  padding: 0.4rem 0.85rem 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
}

.app-body {
  flex: 1;
  overflow: auto;
  background: var(--body-bg);
  padding: 16px;
}
.app-content {
  position: relative;
  background: var(--content-bg);
  min-height: 100%;
  border-radius: 8px;
  padding: 1.15rem 1.25rem 1.5rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.page-head h1 { margin: 0; font-size: 1.35rem; }
.muted-line { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  position: relative;
}
.btn:hover { background: var(--hover); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { border: none; background: transparent; font-size: 1.4rem; line-height: 1; }
.btn.danger { color: var(--danger); border-color: #f3c4c0; }
.btn.danger.primary { background: var(--danger); border-color: var(--danger); color: var(--on-primary); }
.btn.ok { color: var(--ok); border-color: #abefc6; }
.btn.sm { padding: 0.25rem 0.55rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.actions { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.icon-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-act .ico { width: 1.05rem; height: 1.05rem; }
.icon-act:hover { background: var(--hover); color: var(--primary); }
.icon-act.is-danger { color: var(--danger); border-color: #f3c4c0; }
.icon-act.is-danger:hover { background: #fdecec; color: var(--danger); }
.icon-act.is-ok { color: var(--ok); border-color: #abefc6; }
.icon-act.is-ok:hover { color: var(--ok); }

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.list-toolbar input,
.list-toolbar select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--input-bg);
  color: var(--text);
}
.list-toolbar .search-sm {
  width: 14rem;
  max-width: 100%;
}

.table-wrap {
  position: relative;
  background: var(--content-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  min-height: 6.5rem;
}
.table-wrap.is-loading { overflow: hidden; }
.table-wrap.is-loading .table-loading { display: flex; }
.table-loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: var(--busy-overlay);
  color: var(--muted);
  font-weight: 600;
  z-index: 2;
  pointer-events: none;
}
.isha-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem;
  background: var(--content-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.isha-pager .pager-info { margin-right: auto; }
.isha-pager .pager-size {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 500;
}
.isha-pager .pager-size select {
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}
.isha-pager .pager-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
th { background: var(--table-head); color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.amt-dr { color: var(--ok); }
.amt-cr { color: var(--danger); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  font-family: inherit;
}
button.badge { cursor: pointer; }
.badge.on { background: #dcfae6; color: var(--ok); }
.badge.off { background: #fee4e2; color: var(--danger); }
.badge.wait { background: #fff4e5; color: var(--warn); }

.alert {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: #eff8ff;
  border: 1px solid #b2ddff;
  color: #175cd3;
}
.alert.error { background: #fef3f2; border-color: #fecdca; color: var(--danger); }

form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}
form input:not([type="checkbox"]):not([type="radio"]),
form select,
form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: var(--input-bg);
}
form label.inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}
.badge.print {
  background: #eff8ff;
  color: #175cd3;
}

.isha-combo {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 0.3rem;
}
.isha-combo > select {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.isha-combo-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--input-bg);
  cursor: pointer;
}
.isha-combo-btn::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.isha-combo.is-empty .isha-combo-value { color: var(--muted); }
.isha-combo-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.isha-combo-pop {
  display: none;
  z-index: 80;
  overflow: hidden;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.16);
}
.isha-combo-pop.is-open { display: flex; flex-direction: column; }
.isha-combo-q {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
  color: var(--text);
  background: var(--input-bg);
  flex: 0 0 auto;
}
.isha-combo-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 2.5rem;
}
.isha-combo-opt,
.isha-combo-empty,
.isha-combo-group {
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.isha-combo-group {
  cursor: default;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-top: 0.5rem;
  padding-bottom: 0.15rem;
}
.isha-combo-empty { color: var(--muted); cursor: default; }
.isha-combo-opt.is-selected { font-weight: 600; }
.isha-combo-opt.is-hi,
.isha-combo-opt:hover { background: var(--table-head); }
.isha-lp { display: block; position: relative; width: 100%; }
.isha-lp > select { display: none !important; }
form .isha-lp-q { width: 100%; }
.pay-ledger-ctrl .isha-lp,
.pay-ledger-cell .isha-lp { flex: 1 1 0; min-width: 0; }
.pay-ledger-ctrl .isha-lp-q,
.pay-ledger-cell .isha-lp-q { margin-top: 0; }
.isha-lp-list {
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.isha-lp-opt,
.isha-lp-empty {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.isha-lp-opt small { display: block; color: var(--muted); font-size: 0.75rem; }
.isha-lp-bal { font-size: 0.85rem; white-space: nowrap; }
.isha-lp-empty { color: var(--muted); cursor: default; }
.isha-lp-opt.is-hi,
.isha-lp-opt:hover { background: var(--table-head); }
.acct-toolbar .isha-lp { width: auto; min-width: 14rem; max-width: 22rem; }
.acct-toolbar .isha-combo {
  width: auto;
  min-width: 12rem;
  max-width: 22rem;
  margin-top: 0;
}
.bank-pick .isha-combo {
  flex: 1;
  min-width: 10rem;
  margin-top: 0;
}

/* --- Busy / processing --- */
.is-busy {
  position: relative !important;
  pointer-events: none !important;
  opacity: 0.85;
}
.is-busy::after {
  content: "Processing";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--busy-overlay);
  color: var(--primary);
  border-radius: inherit;
  z-index: 2;
}
.btn.primary.is-busy::after {
  background: var(--busy-primary);
  color: var(--on-primary);
}

/* --- Drawer (right → left) --- */
.drawer-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.drawer-root.is-open { pointer-events: auto; }
.drawer-mask {
  position: absolute;
  inset: 0;
  background: var(--mask);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.drawer-root.is-open .drawer-mask { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  z-index: 1;
}
.drawer-panel.is-in { transform: translateX(0); }
.drawer-panel.size-sm { width: 30%; min-width: 280px; }
.drawer-panel.size-md { width: 50%; min-width: 360px; }
.drawer-panel.size-lg { width: 90%; min-width: 480px; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-head h2 { margin: 0; font-size: 1.05rem; }
.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
}

/* --- Confirm --- */
.confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 24, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.confirm-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 10px;
  padding: 1.1rem 1.2rem 1.15rem;
  box-shadow: var(--shadow);
}
.confirm-card h3 { margin: 0 0 0.45rem; font-size: 1.05rem; }
.confirm-card .confirm-body,
.confirm-card p { margin: 0 0 1rem; color: var(--muted); font-size: 0.92rem; }
.confirm-card .confirm-body p { margin: 0 0 0.5rem; }
.confirm-card .confirm-body p:last-child { margin-bottom: 0; }
.confirm-card .confirm-body ul { margin: 0.35rem 0 0.75rem; padding-left: 1.2rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.confirm-card.popup-card { max-width: 520px; }
.confirm-card.popup-card.is-wide { max-width: 760px; }
.confirm-card.popup-card.is-fmt-preview { max-width: 900px; }
.popup-card.is-fmt-preview .popup-body { max-height: 78vh; }
.qf-preview { margin-top: 0.65rem; }
.qf-preview .vprint { max-width: none; }
.popup-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.popup-head h3 { margin: 0; }
.popup-card .popup-body { color: var(--text); max-height: 65vh; overflow: auto; margin-top: 0.6rem; }
.popup-card table { width: 100%; }

/* --- Pay / sale / invoice status --- */
.pay-status {
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--surface);
  background: var(--muted);
  vertical-align: middle;
}
.pay-status.is-done { background: var(--ok); }
.pay-status.is-part { background: linear-gradient(90deg, var(--muted) 50%, var(--ok) 50%); }
.pay-status svg { width: 0.95rem; height: 0.95rem; }
.doc-status {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}
.doc-status.is-part { color: var(--primary); border-color: var(--primary); }
.doc-status.is-full { color: var(--surface); background: var(--ok); border-color: var(--ok); }
.icon-act.has-rev { color: var(--primary); }

/* --- Voucher view / print sheet --- */
.vt-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.vt-sheet { background: var(--body-bg); padding: 0.75rem; border-radius: 8px; }
.vt-links { background: var(--surface); padding: 0.5rem 0.75rem; margin-bottom: 0.6rem; border-radius: 6px; }
.vt-bar label.inline { display: inline-flex; align-items: center; gap: 0.4rem; }
.vprint {
  background: var(--surface);
  color: var(--text);
  max-width: 210mm;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
}
.vprint.page-a4 { max-width: 210mm; }
.vprint.page-a4_half { max-width: 148mm; padding: 0.9rem 1rem; font-size: 0.82rem; }
.vprint.page-a4_landscape { max-width: 297mm; }
.vprint.page-letter { max-width: 216mm; }
.vprint.page-legal { max-width: 216mm; }
.vprint.page-thermal_80 { max-width: 80mm; }
.vprint.page-thermal_58 { max-width: 58mm; }
.vprint.is-compact { font-size: 0.8rem; padding: 0.75rem 1rem; }
.vprint.is-compact .vp-title { margin: 0.4rem 0; font-size: 1rem; }
.vprint.is-modern .vp-title {
  background: var(--primary);
  color: #fff;
  padding: 0.45rem 0.6rem;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 4px;
}
.vprint.is-boxed .vp-bank,
.vprint.is-boxed .vp-parties,
.vprint.is-boxed .vp-meta,
.vprint.is-boxed .vp-einvoice {
  border: 1px solid var(--line);
  padding: 0.55rem;
  border-radius: 4px;
}
.vprint.is-formal { font-family: Georgia, "Times New Roman", serif; padding: 1.8rem 2rem; }
.vprint.is-formal .vp-title {
  letter-spacing: 0.14em;
  border-bottom: 2px solid currentColor;
  padding-bottom: 0.35rem;
}
.vprint img.vp-header, .vprint img.vp-footer { display: block; width: 100%; height: auto; }
.vprint img.vp-footer { margin-top: 1rem; }
.vp-company { display: flex; gap: 0.9rem; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.vp-logo { max-height: 70px; max-width: 160px; }
.vp-cname { font-size: 1.2rem; font-weight: 700; }
.vp-slogan { font-style: italic; color: var(--muted); }
.vp-title { text-align: center; margin: 0.8rem 0 0.6rem; font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; }
.vp-title.is-left { text-align: left; }
.vp-title.is-right { text-align: right; }
.vp-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; margin-bottom: 0.7rem; }
.vp-meta span, .vp-bank span { color: var(--muted); }
.vp-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 0.8rem; }
.vp-parties h4, .vp-bank h4 { margin: 0 0 0.25rem; font-size: 0.8rem; text-transform: uppercase; color: var(--muted); }
.vp-table { width: 100%; border-collapse: collapse; margin-bottom: 0.6rem; }
.vp-table th, .vp-table td,
.vp-table tr:last-child td { border: 1px solid var(--line); padding: 0.3rem 0.45rem; vertical-align: top; }
.vp-table th { background: var(--table-head); text-align: left; }
.vp-table .num, .vp-sums .num { text-align: right; white-space: nowrap; }
.vp-item { font-weight: 600; }
.vp-desc { color: var(--muted); font-size: 0.8rem; white-space: pre-line; }
.vp-sums { margin-left: auto; min-width: 280px; border-collapse: collapse; }
.vp-sums td { padding: 0.28rem 0.45rem; text-align: right; border-top: 1px solid var(--line); }
.vp-sums tr:first-child td { border-top: 0; }
.vp-sums td:first-child { color: var(--muted); }
.vp-sums td.num { width: 1%; padding-left: 0.8rem; }
.vp-sums .vp-grand td { font-weight: 700; color: var(--text); border-top: 1px solid var(--text); }
.vp-words { font-weight: 600; margin: 0.6rem 0; }
.vp-words.is-left { text-align: left; }
.vp-words.is-center { text-align: center; }
.vp-words.is-right { text-align: right; }
.vp-kv {
  display: inline-flex;
  gap: 0.4rem;
  align-items: baseline;
  max-width: 100%;
}
.vp-kv span { color: var(--muted); flex: none; }
.vp-frow.is-center .vp-kv { justify-content: center; }
.vp-frow.is-right .vp-kv { justify-content: flex-end; }
.vp-note { margin: 0.4rem 0; }
.vp-frow { display: flex; width: 100%; gap: 0; align-items: flex-start; box-sizing: border-box; }
.vp-frow.is-center { justify-content: center; text-align: center; }
.vp-frow.is-right { justify-content: flex-end; text-align: right; }
.vp-frow.is-left { text-align: left; }
.vp-frow > [class*="vp-u"] { box-sizing: border-box; min-width: 0; }
.vp-frow.is-center > [class*="vp-u"],
.vp-frow.is-center > [class*="vp-u"] *,
.vp-frow.is-center .vp-cname,
.vp-frow.is-center .vp-title,
.vp-frow.is-center .vp-slogan,
.vp-frow.is-center .vp-sign { text-align: center; }
.vp-frow.is-right > [class*="vp-u"],
.vp-frow.is-right > [class*="vp-u"] *,
.vp-frow.is-right .vp-cname,
.vp-frow.is-right .vp-title,
.vp-frow.is-right .vp-slogan,
.vp-frow.is-right .vp-sign { text-align: right; }
.vp-frow.is-left .vp-title,
.vp-frow.is-left .vp-sign { text-align: left; }
.vp-frow.is-center .vp-meta,
.vp-frow.is-center .vp-sign-row,
.vp-frow.is-center .vp-qr-row { justify-content: center; }
.vp-frow.is-right .vp-meta,
.vp-frow.is-right .vp-sign-row,
.vp-frow.is-right .vp-qr-row { justify-content: flex-end; }
[class*="vp-u"].is-center,
[class*="vp-u"].is-center * { text-align: center; }
[class*="vp-u"].is-right,
[class*="vp-u"].is-right * { text-align: right; }
.vprint .vp-frow > .vp-u3 { flex: 0 0 25%; max-width: 25%; }
.vprint .vp-frow > .vp-u4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.vprint .vp-frow > .vp-u6 { flex: 0 0 50%; max-width: 50%; }
.vprint .vp-frow > .vp-u8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
.vprint .vp-frow > .vp-u12 { flex: 0 0 100%; max-width: 100%; }
.vp-frow > .vp-fgap { min-height: 0; padding: 0; border: 0; }
.vp-row { display: flex; gap: 1rem; align-items: stretch; width: 100%; }
.vp-u3 { flex: 3 1 0; min-width: 0; }
.vp-u4 { flex: 4 1 0; min-width: 0; }
.vp-u6 { flex: 6 1 0; min-width: 0; }
.vp-u8 { flex: 8 1 0; min-width: 0; }
.vp-u12 { flex: 12 1 0; min-width: 0; width: 100%; }
.vp-stack { display: flex; flex-direction: column; gap: 0.5rem; height: 100%; }
.vprint.has-boxes .vp-sheet {
  border: 1px solid var(--text);
  box-sizing: border-box;
}
.vprint.has-boxes .vp-row {
  gap: 0;
  margin: 0;
  align-items: stretch;
}
.vprint.has-boxes .vp-u3 { flex: 0 0 25%; max-width: 25%; }
.vprint.has-boxes .vp-u4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.vprint.has-boxes .vp-u6 { flex: 0 0 50%; max-width: 50%; }
.vprint.has-boxes .vp-u8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
.vprint.has-boxes .vp-u12 { flex: 0 0 100%; max-width: 100%; width: 100%; }
.vprint.has-boxes .vp-sheet > .vp-row:not(:last-child):not(.is-break) {
  border-bottom: 1px solid var(--text);
}
.vprint.has-boxes .vp-row.is-break { border: 0; margin: 0; }
.vprint.has-boxes .vp-row > [class*="vp-u"] {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  box-sizing: border-box;
}
.vprint.has-boxes .vp-row > [class*="vp-u"]:not(:last-child):not(.vp-gap) {
  border-right: 1px solid var(--text);
}
.vprint.has-boxes .vp-gap,
.vprint.has-boxes .vp-fgap { border: 0; padding: 0; min-height: 0; }
.vprint.has-boxes .vp-cell {
  border: 0;
  padding: 0.5rem 0.65rem;
  box-sizing: border-box;
  min-width: 0;
}
.vprint.has-boxes .vp-stack {
  gap: 0;
  height: 100%;
  flex: 1;
}
.vprint.has-boxes .vp-stack > .vp-cell {
  margin: 0;
  flex: 1;
  height: auto;
}
.vprint.has-boxes .vp-stack > .vp-cell:not(:last-child) {
  border-bottom: 1px solid var(--text);
}
.vprint.has-boxes .vp-cell.is-fill {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.vprint.has-boxes .vp-cell.is-fill .vp-table {
  flex: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
}
.vprint.has-boxes .vp-cell.is-fill .vp-group,
.vprint.has-boxes .vp-cell.is-fill > .vp-rich {
  padding: 0.35rem 0.65rem;
}
.vprint.has-boxes .vp-cell.is-fill .vp-table th,
.vprint.has-boxes .vp-cell.is-fill .vp-table td {
  border-color: var(--text);
}
.vprint.has-boxes .vp-cell.is-fill .vp-table:first-of-type thead tr:first-child th { border-top: 0; }
.vprint.has-boxes .vp-cell.is-fill .vp-table:last-of-type tbody tr:last-child td,
.vprint.has-boxes .vp-cell.is-fill .vp-table:last-of-type tfoot tr:last-child th,
.vprint.has-boxes .vp-cell.is-fill .vp-table:last-of-type tfoot tr:last-child td { border-bottom: 0; }
.vprint.has-boxes .vp-cell.is-fill .vp-table th:first-child,
.vprint.has-boxes .vp-cell.is-fill .vp-table td:first-child { border-left: 0; }
.vprint.has-boxes .vp-cell.is-fill .vp-table th:last-child,
.vprint.has-boxes .vp-cell.is-fill .vp-table td:last-child { border-right: 0; }
.vprint.has-boxes .vp-company { border-bottom: 0; padding-bottom: 0; }
.vprint.has-boxes .vp-title { margin: 0.35rem 0; }
.vprint.has-boxes .vp-meta { margin-bottom: 0; }
.vprint.has-boxes .vp-parties { margin-bottom: 0; gap: 0.5rem; }
.vprint.has-boxes .vp-table { margin-bottom: 0; }
.vprint.has-boxes .vp-bank { margin-top: 0; }
.vprint.has-boxes .vp-banks { margin-top: 0; }
.vprint.has-boxes .vp-qr-row { margin-top: 0.2rem; }
.vprint.has-boxes .vp-sign,
.vprint.has-boxes .vp-sign-row { margin-top: 0.35rem; }
.vprint.has-boxes .vp-words { margin: 0.2rem 0 0; }
.vprint.has-boxes .vp-terms { margin-top: 0.2rem; }
@media print {
  .vprint.has-boxes .vp-sheet,
  .vprint.has-boxes .vp-sheet > .vp-row:not(:last-child):not(.is-break),
  .vprint.has-boxes .vp-row > [class*="vp-u"]:not(:last-child):not(.vp-gap),
  .vprint.has-boxes .vp-stack > .vp-cell:not(:last-child),
  .vprint.has-boxes .vp-cell.is-fill .vp-table th,
  .vprint.has-boxes .vp-cell.is-fill .vp-table td { border-color: #111; }
}
.vp-sep { border: 0; border-top: 1px solid var(--line); margin: 0.45rem 0; }
.vp-sep.is-space { border: 0; height: 0.7rem; margin: 0; }
.vp-sep.is-dots { border-top: 1px dotted var(--line); }
.vp-break { border: 0; border-top: 1px solid var(--text); margin: 0.85rem 0; opacity: 0.35; }
.vp-spacer { height: 1.5rem; }
.vprint.is-thermal .vp-break { margin: 0.4rem 0; }
.vprint.is-thermal .vp-spacer { height: 0.55rem; }
.vprint.is-thermal .vp-frow,
.vprint.is-thermal .vp-row { display: block; }
.vp-sec.vp-full { width: 100%; }
.vp-sec.vp-half { flex: 1; min-width: 0; }
.vp-bank { margin-top: 0.7rem; }
.vp-banks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem 1.2rem;
  margin-top: 0.7rem;
}
.vp-banks .vp-bank { margin-top: 0; }
.vp-qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  align-items: flex-end;
  margin-top: 0.9rem;
}
.vp-qr { text-align: center; }
.vp-qr-img, .vp-qr svg, .vp-qr-slot svg { width: 120px; height: 120px; display: block; margin: 0 auto; }
.vp-qr-empty {
  width: 120px;
  height: 120px;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.vp-qr-cap { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.vp-einvoice { display: flex; gap: 0.8rem; align-items: flex-end; }
@media (max-width: 640px) {
  .vp-banks { grid-template-columns: 1fr; }
}
.vp-sign { text-align: right; margin-top: 1.2rem; }
.vp-sign img { max-height: 60px; max-width: 180px; }
.vp-sign-row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 1.4rem;
  align-items: flex-end;
}
.vp-sign-row .vp-sign { margin-top: 0; }
.vp-accept { min-width: 40%; }
.vp-copy { font-size: 0.75em; font-weight: 500; text-transform: none; letter-spacing: 0; }
.vp-paid { font-weight: 700; margin: 0.45rem 0; font-size: 0.95rem; }
.vprint.is-thermal {
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.25;
}
.vprint.is-thermal .vp-company { display: block; text-align: center; border-bottom: 1px dashed var(--text); padding-bottom: 4px; }
.vprint.is-thermal .vp-logo { max-height: 36px; max-width: 100%; margin: 0 auto 2px; display: block; }
.vprint.is-thermal .vp-cname { font-size: 13px; font-weight: 800; }
.vprint.is-thermal .vp-title { font-size: 12px; margin: 4px 0 3px; letter-spacing: 0.02em; }
.vprint.is-thermal .vp-meta { display: block; margin-bottom: 4px; }
.vprint.is-thermal .vp-meta > div { display: flex; justify-content: space-between; gap: 4px; }
.vprint.is-thermal .vp-parties { display: block; border-top: 1px dashed var(--text); border-bottom: 1px dashed var(--text); padding: 4px 0; margin-bottom: 4px; }
.vprint.is-thermal .vp-table th,
.vprint.is-thermal .vp-table td { padding: 1px 2px; font-size: 10px; }
.vprint.is-thermal .vp-table.is-grid th,
.vprint.is-thermal .vp-table.is-grid td { border-left: 0; border-right: 0; }
.vprint.is-thermal .vp-sums { min-width: 0; width: 100%; margin: 2px 0; }
.vprint.is-thermal .vp-banks { grid-template-columns: 1fr; font-size: 10px; gap: 2px; }
.vprint.is-thermal .vp-bank h4 { display: none; }
.vprint.is-thermal .vp-qr-row { justify-content: center; margin-top: 6px; gap: 0.6rem; }
.vprint.is-thermal .vp-qr-img,
.vprint.is-thermal .vp-qr svg,
.vprint.is-thermal .vp-qr-slot svg { width: 72px; height: 72px; }
.vprint.is-thermal .vp-qr-empty { width: 72px; height: 72px; }
.vprint.is-thermal .vp-qr-cap { font-weight: 800; color: var(--text); letter-spacing: 0.04em; }
.vprint.is-thermal .vp-sign-row { font-size: 10px; margin-top: 8px; gap: 0.5rem; }
.vprint.is-thermal .vp-accept { min-width: 0; }
.vprint.is-thermal .vp-terms { font-size: 9px; }
.vprint.is-thermal .vp-words { font-size: 10px; margin: 4px 0; }
.vprint.page-thermal_58.is-thermal { font-size: 10px; padding: 3px 4px; }
.vprint.page-thermal_58.is-thermal .vp-cname { font-size: 12px; }
.vprint.page-thermal_58.is-thermal .vp-qr-img,
.vprint.page-thermal_58.is-thermal .vp-qr svg,
.vprint.page-thermal_58.is-thermal .vp-qr-slot svg { width: 56px; height: 56px; }
.vp-group { margin: 0.9rem 0 0.35rem; font-size: 0.95rem; }
.vp-table .vp-subtotal td { font-weight: 700; background: var(--table-head); }
.vp-rich { margin: 0.55rem 0; }
.vp-rich p { margin: 0.35rem 0; }
.vp-terms { margin-top: 0.9rem; }
.vp-terms h4 { margin: 0 0 0.3rem; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); }
.vp-thumb { max-height: 40px; max-width: 60px; object-fit: contain; }
.vp-desc.is-compact {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}
.vp-table.is-none th,
.vp-table.is-none td,
.vp-table.is-none tr:last-child td { border: 0; }
.vp-table.is-horizontal th,
.vp-table.is-horizontal td,
.vp-table.is-horizontal tr:last-child td {
  border-left: 0;
  border-right: 0;
}
.vp-table.is-zebra tbody tr:nth-child(even) { background: color-mix(in srgb, var(--table-head) 55%, transparent); }

/* --- Login (no shell) --- */
.login-page { min-height: 100vh; background: var(--body-bg); }
.login-top {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.login-wrap {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 10px;
  padding: 1.35rem 1.35rem 1.4rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.login-card h1 { margin: 0 0 1rem; font-size: 1.2rem; }
.login-by {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  font-size: 0.9rem;
}
.login-by > span { color: var(--muted); font-size: 0.85rem; }
.login-by label.inline { margin-bottom: 0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: var(--table-head);
}
.kpi .kpi-label { color: var(--muted); font-size: 0.8rem; }
.kpi .kpi-value { font-size: 1.35rem; font-weight: 700; margin-top: 0.2rem; }

.app-nav-toggle { display: none; }
.app-nav-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--mask);
  z-index: 18;
}

.theme-opt {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
}
.theme-opt.is-on { font-weight: 700; background: var(--hover); }
.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.theme-dot-blue { background: #1e4b8e; }
.theme-dot-teal { background: #0f766e; }
.theme-dot-forest { background: #15803d; }
.theme-dot-indigo { background: #4f46e5; }
.theme-dot-sunset { background: #c2410c; }
.theme-dot-slate { background: #334155; }
.theme-dot-dark { background: #111827; border-color: #6b7280; }

@media (max-width: 900px) {
  .drawer-panel.size-sm,
  .drawer-panel.size-md,
  .drawer-panel.size-lg { width: 92%; min-width: 0; }
  .hdr-user-name { max-width: 90px; }
}

@media (max-width: 768px) {
  .app-nav-toggle { display: flex; }
  .app-header { z-index: 22; padding-left: 0.5rem; }
  .app-submenu-toggle { display: none; }

  .app-nav-mask { display: block; opacity: 0; pointer-events: none; transition: opacity 0.28s ease; }
  .app.is-nav-open .app-nav-mask { opacity: 1; pointer-events: auto; }

  .app-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 20;
    width: auto;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: var(--shadow);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
  }
  .app.is-nav-open .app-nav {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .app-menu,
  .app-submenu {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    height: 100%;
    transform: none;
  }
  .app-submenu {
    width: min(var(--submenu-w), calc(100vw - var(--menu-w) - 12px));
  }
  .app-submenu.is-shrunk {
    width: min(var(--submenu-w), calc(100vw - var(--menu-w) - 12px));
  }
  .app-submenu.is-shrunk .app-submenu-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.5rem 0.85rem;
    min-height: 40px;
  }
  .app-submenu.is-shrunk .app-submenu-item .label { display: inline; }
  .app-submenu.is-shrunk .app-submenu-item .short { display: none; }
  .app-submenu.is-shrunk .app-submenu-group-title {
    justify-content: flex-start;
    padding: 0.4rem 0.7rem 0.4rem 0.65rem;
    font-size: 0.68rem;
  }
  .app-submenu.is-shrunk .app-submenu-group-caret { display: flex; }

  .app-body { padding: 10px; }
  .hdr-user-name { display: none; }
}

.settings-acc {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 0.55rem;
  background: var(--surface);
}
.settings-acc > summary.form-section-title {
  cursor: pointer;
  list-style: none;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
}
.settings-acc > summary.form-section-title::-webkit-details-marker { display: none; }
.settings-acc > summary.form-section-title::marker { content: ''; }
.settings-acc > summary.form-section-title::before {
  content: '▸';
  display: inline-block;
  width: 1rem;
  color: var(--muted);
}
.settings-acc[open] > summary.form-section-title::before { content: '▾'; }
.settings-acc[open] > summary.form-section-title { border-bottom-color: var(--line); }
.settings-acc .settings-section {
  padding: 0.55rem 0.75rem 0.75rem;
  margin-top: 0;
}
.settings-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 0.55rem;
}
.setting-item {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.35rem 0.45rem;
  background: var(--surface);
}
.setting-item.is-wide { grid-column: 1 / -1; }
.setting-item > label {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.setting-item .setting-help {
  font-size: 0.7rem;
  margin-top: 0.25rem;
  line-height: 1.35;
}
.setting-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.setting-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.setting-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.55rem;
  font-size: 0.8rem;
  color: var(--text);
}

/* Date box (IshaUi date inputs in the user's date format) */
.isha-date-wrap {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 10.5rem;
  max-width: 100%;
}
label .isha-date-wrap,
td .isha-date-wrap {
  display: block;
  width: 100%;
}
form .isha-date-wrap input.isha-date,
.isha-date-wrap input.isha-date {
  width: 100%;
  margin-top: 0;
  padding-right: 2rem;
}
form .isha-date-wrap {
  margin-top: 0.3rem;
}
.isha-date-wrap input.isha-date.is-invalid {
  border-color: var(--danger);
}
.isha-date-btn {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  display: inline-flex;
  padding: 0.15rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
}
.isha-date-btn:hover {
  color: var(--text);
}
.isha-date-btn .ico {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
form .isha-date-wrap input.isha-date-pick,
.isha-date-pick {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
