:root {
  --ink: #26343a;
  --muted: #718086;
  --line: #dce5e2;
  --soft: #f1f7f4;
  --page: #f8faf7;
  --panel: #ffffff;
  --teal: #4f7f7a;
  --teal-dark: #315f5d;
  --navy: #243d43;
  --aqua: #b8d9d4;
  --mint: #e7f3ed;
  --blue: #e7f0f3;
  --orange: #f4e7d8;
  --red: #a8555f;
  --shadow: 0 18px 46px rgba(38, 52, 58, 0.09);
  --shadow-soft: 0 10px 28px rgba(38, 52, 58, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden],
.legacy-nav {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(238, 246, 241, 0.9), rgba(250, 251, 248, 0.96) 45%, rgba(232, 241, 239, 0.9)),
    radial-gradient(circle at 78% 0%, rgba(184, 217, 212, 0.22), transparent 34%);
  font-family: "Segoe UI Variable", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(35, 61, 67, 0.82), rgba(232, 241, 239, 0.72)),
    linear-gradient(120deg, #eef5f0, #f8faf7);
}

.login-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(300px, 1fr);
  width: min(920px, 100%);
  min-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 70px rgba(4, 21, 27, 0.24);
}

.login-panel {
  display: grid;
  align-content: center;
  padding: clamp(28px, 4vw, 48px);
}

.login-panel-form {
  gap: 18px;
  color: #eef8f6;
  background:
    linear-gradient(160deg, rgba(35, 61, 67, 0.98), rgba(49, 95, 93, 0.96)),
    #243d43;
}

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

.login-card .brand-mark {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
}

.login-brand-row strong,
.login-brand-row span {
  display: block;
}

.login-brand-row span {
  margin-top: 3px;
  color: rgba(238, 248, 246, 0.72);
  font-size: 12px;
}

/* Flat ivory artwork has its own green background and readable negative space. */
.login-brand-row.login-product-brand {
  gap: 20px;
  justify-content: space-between;
  padding-bottom: 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e6e5dc;
}
.login-product-logo {
  position: relative;
  order: 2;
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border: 1px solid #164e3d;
  border-radius: 20px;
  background: #103f35;
  box-shadow: 0 5px 14px rgba(16, 63, 53, .10);
  overflow: hidden;
}
.login-product-logo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}
.login-product-name { min-width: 0; }
.login-product-brand .login-product-name strong {
  color: #123f32;
  font-size: clamp(25px, 2.4vw, 32px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.045em;
}
.login-product-brand .login-product-name span {
  margin-top: 9px;
  color: #67796e;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .015em;
}
@media (max-width: 480px) {
  .login-brand-row.login-product-brand { gap: 14px; padding-bottom: 20px; }
  .login-product-logo { width: 64px; height: 64px; flex-basis: 64px; border-radius: 17px; }
  .login-product-brand .login-product-name strong { font-size: 25px; }
  .login-product-brand .login-product-name span { font-size: 11px; }
}

.login-copy {
  margin-bottom: 6px;
}

.login-card h1 {
  margin-top: 8px;
  color: #fff;
  font-size: 32px;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: rgba(238, 248, 246, 0.78);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-card input {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.login-card input:focus {
  border-color: rgba(184, 217, 212, 0.82);
  background: rgba(255, 255, 255, 0.12);
}

.login-note {
  margin-top: 8px;
  color: rgba(238, 248, 246, 0.76);
  line-height: 1.5;
}

.login-panel-info {
  position: relative;
  align-content: center;
  min-height: 420px;
  color: #152c33;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.58)),
    linear-gradient(135deg, rgba(184, 217, 212, 0.52), rgba(248, 250, 247, 0.92));
}

.login-panel-info h2 {
  position: relative;
  max-width: 360px;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.08;
}

.login-panel-info p {
  position: relative;
  max-width: 390px;
  margin-top: 12px;
  color: #52666d;
  line-height: 1.55;
}

.login-insight-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 390px;
  margin-top: 26px;
}

.login-insight-grid span {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(49, 95, 93, 0.14);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(38, 52, 58, 0.06);
}

.login-insight-grid span::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #4f7f7a;
  box-shadow: 0 0 0 4px rgba(79, 127, 122, 0.12);
}

body.logged-in .login-screen {
  display: none;
}

body.logged-out .app-shell {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(29, 93, 109, 0.22);
  outline-offset: 2px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 26px 20px;
  color: #f3f8f5;
  background: linear-gradient(180deg, #2f4b50 0%, #385f5d 58%, #2b454a 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

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

.brand-mark,
.paper-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: #324b50;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
}

.brand strong,
.profile strong {
  display: block;
}

.brand span,
.profile span {
  display: block;
  margin-top: 3px;
  color: #c6d9d4;
  font-size: 12px;
}

.profile {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.profile-action {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #c6d9d4;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.profile-action:hover {
  color: #f3f8f5;
  background: rgba(243, 248, 245, 0.1);
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f8faf7;
  color: var(--teal);
  font-weight: 800;
}

.nav {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: rgba(233, 247, 248, 0.58) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.nav::-webkit-scrollbar {
  width: 8px;
}

.nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(233, 247, 248, 0.58);
  border-radius: 999px;
}

.nav-item,
.nav-group-toggle,
.logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 11px;
  color: #f3f8f5;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-toggle {
  justify-content: flex-start;
}

.nav-group-toggle .chevron {
  margin-left: auto;
  color: #c6d9d4;
  font-weight: 900;
}

.nav-item.active,
.nav-item:hover,
.nav-group-toggle.active,
.nav-group-toggle:hover {
  background: #e9f7f8;
  color: var(--teal-dark);
}

.nav-group-toggle.active .chevron,
.nav-group-toggle:hover .chevron {
  color: var(--teal-dark);
}

.nav-submenu {
  display: none;
  gap: 4px;
  padding-left: 14px;
}

.nav-submenu.is-open {
  display: grid;
}

.nav-submenu .nav-item {
  min-height: 32px;
  padding-left: 12px;
  color: #dcebe7;
  font-size: 13px;
}

.nav-submenu .nav-item.active,
.nav-submenu .nav-item:hover {
  color: var(--teal-dark);
}

.nav-focus-hidden {
  display: none !important;
}

.icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-weight: 800;
}

.brand-mark img,
.po-logo img,
.paper-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logout {
  margin-top: auto;
  color: #dcebe7;
}

.account-actions {
  display: grid;
  gap: 4px;
  margin-top: auto;
}

.account-actions .logout {
  margin-top: 0;
}

.main {
  padding: 28px 32px;
  overflow: hidden;
}

.topbar,
.section-head,
.panel-title,
.top-actions,
.split-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

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

h1 {
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search {
  display: flex;
  align-items: center;
  width: min(360px, 36vw);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.primary-action,
.secondary-action,
.icon-button,
.mini-button,
.chip,
.report-grid button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.primary-action {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-action:hover,
.secondary-action:hover,
.icon-button:hover,
.mini-button:hover,
.chip:hover,
.report-grid button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(29, 48, 56, 0.12);
}

.icon-button,
.mini-button {
  width: 40px;
  padding: 0;
}

.danger-mini {
  width: auto;
  min-width: 58px;
  border-color: #efc7ac;
  color: #8f2d36;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  min-height: auto;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
}

.sort-header::after {
  content: "sort";
  color: var(--muted);
  font-size: 11px;
}

.sort-header.is-sorted-asc::after {
  content: "asc";
}

.sort-header.is-sorted-desc::after {
  content: "desc";
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  margin-bottom: 18px;
}

.section-head.section-head-title-hidden {
  justify-content: flex-end;
}

.compact-section-head {
  margin-top: 6px;
  margin-bottom: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric,
.panel,
.data-panel,
.customer-card,
.master-card,
.receipt-form,
.receipt-preview,
.settings-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 148px;
  margin-bottom: 18px;
  border: 1px solid rgba(29, 93, 109, 0.16);
  border-radius: 8px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 249, 250, 0.94) 62%),
    linear-gradient(120deg, rgba(29, 93, 109, 0.13), rgba(137, 215, 223, 0.18));
  box-shadow: var(--shadow);
}

.dashboard-hero-copy h2 {
  margin-top: 6px;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.03em;
}

.dashboard-hero-copy p:last-child {
  max-width: 560px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.metric {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 100px;
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.metric span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  color: var(--teal);
  background: var(--mint);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.metric-icon.available {
  background: #e5f6e6;
  color: #268143;
}

.metric-icon.rented {
  background: var(--blue);
}

.metric-icon.warning {
  color: #985b18;
  background: var(--orange);
}

.metric.alert {
  border-color: #efc7ac;
}

.alert-panel {
  border-color: #efc7ac;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-list-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.alert-list-item:hover {
  border-color: rgba(29, 93, 109, 0.38);
  background: #f8fcfd;
}

.alert-list-item.overdue {
  border-color: #efc7ac;
  background: #fff9f5;
}

.alert-list-item small {
  color: var(--muted);
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.quick-action-grid button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 1px solid rgba(29, 93, 109, 0.14);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.quick-action-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 93, 109, 0.26);
  box-shadow: var(--shadow);
}

.quick-action-grid span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e5f6f8;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.quick-action-grid strong {
  font-size: 14px;
}

.executive-dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-title-row h2 {
  margin-top: 4px;
  color: #1f2f35;
  font-size: 28px;
  letter-spacing: 0;
}

.finance-card-grid,
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.finance-card,
.compact-kpi,
.insight-panel {
  border: 1px solid rgba(165, 184, 183, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(250, 253, 251, 0.95)),
    var(--panel);
  box-shadow: 0 14px 34px rgba(42, 62, 66, 0.07);
}

.finance-card {
  display: grid;
  gap: 13px;
  min-height: 132px;
  padding: 16px;
}

.finance-card-head,
.compact-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
}

.finance-card-head {
  justify-content: space-between;
}

.finance-card h3,
.compact-kpi h3,
.insight-panel h3 {
  color: #213139;
  font-size: 14px;
  font-weight: 800;
}

.finance-card button,
.compact-kpi button,
.period-button,
.segmented-control button {
  min-height: 26px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #2c6b82;
  background: #e7f2f8;
  font-size: 12px;
  font-weight: 800;
}

.finance-card strong {
  color: #17242a;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.finance-card footer {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.finance-card footer button {
  margin-left: auto;
  color: #14705c;
  background: transparent;
  padding: 0;
}

.trend {
  font-weight: 900;
}

.trend.up {
  color: #16865d;
}

.trend.down {
  color: #bd3658;
}

.finance-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #27424a;
  background: #eef5f3;
  font-size: 12px;
  font-weight: 900;
}

.finance-card.rose .finance-icon,
.compact-kpi.rose .finance-icon {
  color: #a94e65;
  background: #fdeef2;
}

.finance-card.gold .finance-icon {
  color: #a07412;
  background: #fff6dc;
}

.finance-card.mint .finance-icon,
.compact-kpi.mint .finance-icon {
  color: #2f8b67;
  background: #e8f7ef;
}

.finance-card.violet .finance-icon,
.compact-kpi.violet .finance-icon {
  color: #7356b5;
  background: #f0eaff;
}

.compact-kpi.blue .finance-icon {
  color: #3d7394;
  background: #e9f3fb;
}

.compact-kpi {
  min-height: 72px;
  padding: 14px 16px;
}

.compact-kpi div {
  min-width: 0;
}

.compact-kpi button {
  margin-top: 4px;
}

.compact-kpi strong {
  margin-left: auto;
  color: #17242a;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(280px, 0.95fr);
  gap: 18px;
}

.insight-panel {
  padding: 16px;
}

.segmented-control {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: #f1f5f5;
}

.segmented-control button {
  color: #6f7c80;
  background: transparent;
}

.segmented-control button.active,
.period-button {
  color: #fff;
  background: #347eea;
  box-shadow: 0 8px 18px rgba(52, 126, 234, 0.22);
}

.cash-flow-chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  align-items: end;
  gap: 28px;
  min-height: 226px;
  margin-top: 12px;
  padding: 34px 22px 26px 54px;
  overflow: hidden;
}

.chart-grid-lines {
  position: absolute;
  inset: 34px 22px 50px 54px;
  background:
    linear-gradient(to bottom, rgba(33, 49, 57, 0.08) 1px, transparent 1px) 0 0 / 100% 33.33%;
  pointer-events: none;
}

.axis-label {
  position: absolute;
  left: 0;
  color: #4d5c61;
  font-size: 12px;
  font-weight: 700;
}

.axis-label.top {
  top: 27px;
}

.axis-label.mid {
  top: 95px;
}

.axis-label.low {
  bottom: 50px;
}

.cash-bar {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: end;
  min-height: 178px;
  gap: 10px;
  color: #273940;
  font-size: 12px;
  font-weight: 800;
}

.cash-bar i {
  display: block;
  width: min(38px, 70%);
  height: var(--bar-height);
  min-height: 42px;
  border-radius: 16px 16px 4px 4px;
  background: linear-gradient(180deg, #2f7f83, #1d5f64);
  box-shadow: 0 12px 22px rgba(29, 95, 100, 0.16);
}

.expense-donut-wrap {
  display: grid;
  justify-items: center;
  gap: 20px;
  min-height: 226px;
  padding-top: 10px;
}

.expense-donut {
  display: grid;
  place-items: center;
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 48%, transparent 49%),
    conic-gradient(#347eea 0 64%, #23c5d2 64% 78%, #bed9f0 78% 100%);
  box-shadow: inset 0 0 0 1px rgba(52, 126, 234, 0.08), 0 16px 34px rgba(42, 62, 66, 0.08);
}

.expense-donut span {
  color: #324248;
  font-size: 12px;
  font-weight: 900;
}

.expense-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.expense-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 10px;
  color: #5b6d73;
  background: #edf3f5;
  font-size: 12px;
  font-weight: 800;
}

.expense-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #347eea;
}

.expense-legend i.salary {
  background: #23c5d2;
}

.expense-legend i.other {
  background: #bed9f0;
}

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

.operations-mini {
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.snapshot-grid span {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(165, 184, 183, 0.28);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #f8fbfa;
  font-size: 12px;
  font-weight: 800;
}

.snapshot-grid strong {
  color: #17242a;
  font-size: 24px;
}

.workflow-note,
.review-warning {
  border: 1px solid #efc7ac;
  border-radius: 8px;
  padding: 12px;
  background: #fff7f1;
  color: #7b4817;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: none;
}

.locked-field-label {
  color: #6d7779;
}

.locked-field-label input:disabled,
.locked-field-label select:disabled,
.locked-field-label button:disabled {
  cursor: not-allowed;
  border-color: rgba(103, 125, 124, 0.24);
  color: #637071;
  background: #f4f7f6;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.7fr 1.25fr;
  gap: 18px;
  align-items: stretch;
}

.panel {
  padding: 24px;
}

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

.tall-panel {
  grid-row: span 2;
}

.panel-title {
  margin-bottom: 18px;
}

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

.large-stat {
  margin-top: 24px;
  font-size: 44px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.status-line {
  margin-top: 20px;
  font-weight: 800;
}

.good {
  color: #268143;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  min-height: 180px;
}

.donut {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 0 68%, #d9e9ed 68% 100%);
}

.donut span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #fff;
  color: var(--teal);
  font-size: 24px;
  font-weight: 850;
}

.legend {
  display: grid;
  gap: 14px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend i {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.legend-sold {
  background: var(--teal);
}

.legend-total {
  background: #d9e9ed;
}

.bar-list {
  display: grid;
  gap: 16px;
}

.bar-list div {
  display: grid;
  grid-template-columns: 120px 1fr 42px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-list b {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: var(--teal);
}

.bar-list em {
  color: var(--muted);
  font-style: normal;
}

.line-chart svg {
  width: 100%;
  height: 230px;
}

.grid-line {
  fill: none;
  stroke: #d9e5e8;
  stroke-dasharray: 3 6;
}

.expense-fill {
  fill: rgba(29, 93, 109, 0.09);
}

.expense-line {
  fill: none;
  stroke: #b58968;
  stroke-width: 4;
}

.profit-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 4;
}

.months {
  fill: var(--muted);
  font-size: 14px;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.accounting-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.accounting-tab-group {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid rgba(29, 48, 56, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.accounting-tab-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accounting-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accounting-tab-row .chip {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  box-shadow: none;
}

.accounting-tab-row .chip.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.accounting-readiness {
  display: grid;
  gap: 16px;
}

.accounting-readiness-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.accounting-readiness-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.accounting-readiness-score {
  display: grid;
  gap: 2px;
  min-width: 150px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.accounting-readiness-score strong {
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.accounting-readiness-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.accounting-readiness-metrics {
  margin-bottom: 0;
}

.accounting-readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.accounting-readiness-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 16px;
  box-shadow: var(--shadow);
}

.accounting-readiness-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.accounting-readiness-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.accounting-readiness-card .status-pill {
  justify-self: start;
}

.accounting-readiness-card .secondary-action,
.accounting-readiness-card .split-actions {
  align-self: end;
  justify-self: start;
  margin-top: auto;
}

.accounting-control-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.accounting-posting-control {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(29, 93, 109, 0.16);
  border-radius: 8px;
  background: rgba(244, 250, 248, 0.86);
  padding: 14px;
  margin-bottom: 16px;
}

.accounting-posting-control h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.accounting-posting-control p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.accounting-posting-control table,
[data-accounting-panel="periods"] table {
  background: #fff;
}

.accounting-period-note {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.accounting-amount {
  text-align: right;
  white-space: nowrap;
}

.accounting-action-cell {
  min-width: 120px;
}

.chip.active {
  background: var(--teal);
  color: #fff;
}

.po-tabs {
  margin-bottom: 16px;
}

.po-edit-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(29, 93, 109, 0.22);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.po-edit-context h3 {
  margin: 2px 0 4px;
  font-size: 18px;
}

.po-edit-context span {
  color: var(--muted);
}

.po-tab-panel.is-hidden {
  display: none;
}

.transaction-tab-panel.is-hidden {
  display: none;
}

.inventory-history-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.inventory-history-tools label {
  min-width: 220px;
  margin: 0;
}

.stock-summary-panel {
  margin-bottom: 16px;
}

.transaction-filters { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; }
.transaction-filter-fields { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(120px, 1fr)); gap: 14px; align-items: end; }
.transaction-filter-fields label { margin: 0; min-width: 0; }
.transaction-filter-fields input, .transaction-filter-fields select { width: 100%; min-width: 0; }
.transaction-filter-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.transaction-filter-footer button { width: auto; white-space: nowrap; }
.transaction-reference-link { appearance: none; background: none; border: 0; padding: 4px 0; color: #11634f; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.transaction-reference-link:hover { color: #083e32; }
.transaction-reference-link:focus-visible, .inventory-history-summary:focus-visible { outline: 2px solid #267d64; outline-offset: 3px; border-radius: 4px; }
.inventory-history-summary { display: flex; align-items: center; gap: 14px; padding: 20px; cursor: pointer; list-style: none; }
.inventory-history-summary::-webkit-details-marker { display: none; }
.inventory-history-summary::before { content: "›"; font-size: 24px; color: #11634f; transition: transform 150ms ease; }
.inventory-history-panel[open] > .inventory-history-summary::before { transform: rotate(90deg); }
.inventory-history-summary strong { display: block; font-size: 16px; }
.inventory-history-summary small { display: block; color: var(--muted); margin-top: 4px; }
@media (max-width: 1200px) {
  .transaction-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transaction-search { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .transaction-filter-fields { grid-template-columns: minmax(0, 1fr); }
  .transaction-filter-footer { flex-wrap: wrap; }
}

.expense-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.4fr);
  gap: 18px;
  align-items: start;
}

.expense-form {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.report-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.report-filter-row label {
  margin: 0;
}

.expense-report-panel {
  margin-top: 18px;
}

.expense-report-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(29, 93, 109, 0.18);
  border-radius: 8px;
  background: #f3fbfc;
}

.expense-report-total span {
  color: var(--muted);
  font-weight: 800;
}

.expense-report-total strong {
  color: var(--teal);
  font-size: 22px;
}

.data-panel {
  overflow: auto;
}

.data-panel tbody tr,
.customer-card {
  cursor: pointer;
}

.data-panel tbody tr:hover,
.customer-card:hover {
  background: #f4fbfc;
}

.customer-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29, 93, 109, 0.16), var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

mark {
  border-radius: 999px;
  padding: 5px 10px;
  background: #dff5ed;
  color: #16613c;
  font-weight: 800;
}

mark.warn {
  background: #f9e6d8;
  color: #965a18;
}

.customer-grid,
.report-grid,
.master-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.customer-card,
.master-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.master-card {
  grid-template-rows: auto 1fr auto;
}

.master-card > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e5f6f8;
  color: var(--teal);
  font-weight: 900;
}

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

.customer-card > span,
.customer-card p {
  color: var(--muted);
}

.customer-card div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.return-browser {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.return-browser .panel-title {
  align-items: center;
}

.return-browser .panel-title p {
  margin-top: 4px;
  color: var(--muted);
}

.return-browser table {
  table-layout: fixed;
}

.return-browser th:last-child,
.return-browser td:last-child {
  width: 160px;
  text-align: right;
}

.pullout-action {
  min-width: 132px;
  min-height: 40px;
  padding-inline: 14px;
  white-space: nowrap;
}

.return-item-editor {
  overflow: auto;
}

.return-item-editor table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.return-item-editor input {
  min-width: 82px;
}

.return-line-input {
  min-height: 38px;
  padding: 0 8px;
}

.receipt-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(430px, 0.92fr) minmax(560px, 1.08fr);
  gap: 24px;
  align-items: start;
}

.procurement-workflow {
  display: grid;
  grid-template-columns: minmax(460px, 0.9fr) minmax(520px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.receipt-form,
.receipt-preview,
.purchase-form,
.po-preview,
.settings-form {
  padding: 18px;
}

.purchase-form,
.po-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.ap-voucher-workspace {
  display: grid;
  gap: 16px;
}

.ap-voucher-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(49, 95, 93, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.ap-voucher-toolbar .split-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.ap-voucher-toolbar select {
  width: min(240px, 100%);
}

.ap-voucher-metrics {
  margin-bottom: 0;
}

.ap-voucher-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.45fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.ap-voucher-form,
.ap-voucher-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.ap-voucher-form {
  padding: 18px;
}

.ap-voucher-summary {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.ap-voucher-title-row,
.ap-voucher-source-row {
  margin-bottom: 14px;
}

.ap-voucher-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ap-voucher-title-row h3 {
  margin: 0;
  font-size: 20px;
}

.ap-voucher-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ap-voucher-status-strip > div {
  border: 1px solid rgba(49, 95, 93, 0.14);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px 12px;
}

.ap-voucher-status-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ap-voucher-status-strip strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
}

.apv-lifecycle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.apv-lifecycle span {
  border: 1px solid rgba(49, 95, 93, 0.16);
  border-radius: 999px;
  background: #f4f7f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
}

.apv-lifecycle span.is-done {
  background: #e8f6ed;
  border-color: rgba(42, 136, 87, 0.2);
  color: #2c7a4b;
}

.apv-lifecycle span.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ap-voucher-source-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.ap-voucher-main-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.ap-voucher-map {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ap-voucher-detail-tabs {
  margin-top: 4px;
  margin-bottom: 0;
}

.ap-voucher-detail-panel {
  max-width: 100%;
}

.ap-voucher-table {
  min-width: 2680px;
}

.ap-voucher-table th,
.ap-voucher-table td {
  white-space: nowrap;
}

.ap-voucher-table input,
.ap-voucher-table select {
  min-width: 118px;
  min-height: 34px;
  padding: 0 8px;
}

.ap-voucher-table .apv-line-invoice-no,
.ap-voucher-table .apv-line-rr-no,
.ap-voucher-table .apv-line-po-no {
  min-width: 132px;
}

.ap-voucher-table .apv-line-dr-acct,
.ap-voucher-table .apv-line-rc-desc {
  min-width: 210px;
}

.ap-voucher-table td:nth-child(16),
.ap-voucher-table td:nth-child(19),
.ap-voucher-table td:nth-child(23),
.ap-voucher-table td:nth-child(24),
.ap-voucher-table td:nth-child(25) {
  text-align: right;
}

.ap-voucher-split-tables {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1fr);
  gap: 16px;
  min-width: 980px;
}

.ap-voucher-gl-table {
  min-width: 920px;
}

.ap-voucher-gl-table td:nth-child(3),
.ap-voucher-gl-table td:nth-child(4),
.ap-voucher-gl-table th:nth-child(3),
.ap-voucher-gl-table th:nth-child(4) {
  text-align: right;
}

.ap-voucher-gl-total td {
  border-top: 2px solid rgba(49, 95, 93, 0.22);
  background: #f6fbfc;
}

.check-voucher-main-grid {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
}

.check-voucher-table {
  min-width: 1840px;
}

.check-voucher-table th,
.check-voucher-table td {
  white-space: nowrap;
}

.payee-master-workspace {
  gap: 14px;
}

.payee-master-tabs {
  margin-bottom: 0;
}

.payee-master-toolbar {
  justify-content: flex-start;
}

.payee-master-toolbar > label {
  min-width: 220px;
}

.payee-master-toolbar .payee-search-field {
  min-width: min(420px, 100%);
  flex: 1;
}

.payee-master-metrics {
  margin-bottom: 0;
}

.payee-master-layout {
  grid-template-columns: minmax(560px, 1.45fr) minmax(320px, 0.7fr);
}

.payee-master-form-grid {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
}

.payee-master-form-grid .span-2 {
  grid-column: span 2;
}

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

.payee-module-flags label {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
}

.payee-module-flags input {
  width: auto;
  min-height: auto;
  margin: 0 10px 0 0;
}

.payee-master-form-actions {
  margin-top: 14px;
  justify-content: flex-start;
}

.payee-master-table {
  min-width: 2140px;
}

.payee-master-table th,
.payee-master-table td {
  white-space: nowrap;
  vertical-align: top;
}

.payee-master-table td:nth-child(8) {
  min-width: 260px;
  white-space: normal;
}

.payee-master-table td:nth-child(16) {
  min-width: 150px;
}

.payee-reference-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1fr);
  gap: 16px;
}

.check-voucher-table input {
  min-width: 112px;
  min-height: 34px;
  padding: 0 8px;
}

.check-voucher-table .check-voucher-line-dr-acct {
  min-width: 220px;
}

.check-voucher-table td:nth-child(8),
.check-voucher-table td:nth-child(10),
.check-voucher-table td:nth-child(11),
.check-voucher-table td:nth-child(12),
.check-voucher-table td:nth-child(13),
.check-voucher-source-table td:nth-child(4),
.check-voucher-history-table td:nth-child(4),
.check-voucher-history-table td:nth-child(5),
.check-voucher-gl-table td:nth-child(3),
.check-voucher-gl-table td:nth-child(4),
.check-voucher-gl-table th:nth-child(3),
.check-voucher-gl-table th:nth-child(4) {
  text-align: right;
}

.check-voucher-source-table,
.check-voucher-history-table,
.check-voucher-gl-table {
  min-width: 980px;
}

.ap-query-workspace {
  gap: 14px;
}

.ap-query-tabs {
  margin-bottom: 0;
}

.ap-query-toolbar {
  justify-content: flex-start;
  align-items: end;
}

.ap-query-toolbar > label {
  min-width: 178px;
}

.ap-query-toolbar select,
.ap-query-toolbar input {
  min-height: 42px;
}

.ap-query-metrics {
  margin-bottom: 0;
}

.ap-query-group-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(49, 95, 93, 0.16);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ap-query-group-bar b {
  border: 1px solid rgba(49, 95, 93, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  padding: 6px 10px;
}

.ap-query-group-bar small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
}

.ap-query-panel {
  max-width: 100%;
}

.ap-query-table {
  min-width: 1760px;
}

.ap-query-advance-table {
  min-width: 1420px;
}

.ap-query-aging-table {
  min-width: 2180px;
}

.ap-query-table th,
.ap-query-table td {
  white-space: nowrap;
  vertical-align: top;
}

.ap-query-table td:nth-child(11),
.ap-query-table td:nth-child(12),
.ap-query-table td:nth-child(13),
.ap-query-advance-table td:nth-child(9),
.ap-query-advance-table td:nth-child(10),
.ap-query-advance-table td:nth-child(11),
.ap-query-aging-table td:nth-child(10),
.ap-query-aging-table td:nth-child(11),
.ap-query-aging-table td:nth-child(12),
.ap-query-aging-table td:nth-child(13),
.ap-query-aging-table td:nth-child(14),
.ap-query-aging-table td:nth-child(15),
.ap-query-aging-table td:nth-child(16) {
  text-align: right;
}

.ap-query-group-row td {
  background: #eef7f5;
  border-top: 1px solid rgba(49, 95, 93, 0.18);
  color: var(--accent);
  font-weight: 900;
}

.ap-query-total-row td {
  background: #f6fbfc;
  border-top: 2px solid rgba(49, 95, 93, 0.24);
  font-weight: 900;
}

.vat-report-workspace {
  gap: 14px;
}

.vat-report-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.55fr) minmax(620px, 1fr);
  gap: 16px;
  align-items: start;
}

.vat-report-selector {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.vat-report-option {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.vat-report-option strong {
  color: var(--ink);
  font-size: 14px;
}

.vat-report-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.vat-report-option.active {
  border-color: rgba(49, 95, 93, 0.38);
  background: #eef7f5;
  box-shadow: inset 4px 0 0 var(--accent);
}

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

.vat-report-filter-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.vat-report-actions {
  justify-content: flex-start;
}

.vat-report-metrics {
  margin-bottom: 0;
}

.vat-report-group-bar {
  margin-top: -2px;
}

.vat-report-panel {
  max-width: 100%;
}

.vat-report-table {
  min-width: 2100px;
}

.vat-report-summary-table {
  min-width: 1320px;
}

.vat-report-table th,
.vat-report-table td {
  white-space: nowrap;
  vertical-align: top;
}

.vat-report-table td:nth-child(8) {
  min-width: 240px;
  white-space: normal;
}

.vat-report-detail-table td:nth-child(13),
.vat-report-detail-table td:nth-child(14),
.vat-report-detail-table td:nth-child(15),
.vat-report-detail-table td:nth-child(16),
.vat-report-detail-table td:nth-child(17),
.vat-report-detail-table td:nth-child(18),
.vat-report-summary-table td:nth-child(6),
.vat-report-summary-table td:nth-child(7),
.vat-report-summary-table td:nth-child(8),
.vat-report-summary-table td:nth-child(9),
.vat-report-summary-table td:nth-child(10),
.vat-report-summary-table td:nth-child(11) {
  text-align: right;
}

.ewt-report-workspace {
  gap: 14px;
}

.ewt-report-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.55fr) minmax(620px, 1fr);
  gap: 16px;
  align-items: start;
}

.ewt-report-selector {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.ewt-report-option {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.ewt-report-option strong {
  color: var(--ink);
  font-size: 14px;
}

.ewt-report-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ewt-report-option.active {
  border-color: rgba(49, 95, 93, 0.38);
  background: #eef7f5;
  box-shadow: inset 4px 0 0 var(--accent);
}

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

.ewt-report-filter-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.ewt-report-actions {
  justify-content: flex-start;
}

.ewt-report-metrics {
  margin-bottom: 0;
}

.ewt-report-group-bar {
  margin-top: -2px;
}

.ewt-report-panel {
  max-width: 100%;
}

.ewt-report-table {
  min-width: 1980px;
}

.ewt-report-summary-table {
  min-width: 1320px;
}

.ewt-report-table th,
.ewt-report-table td {
  white-space: nowrap;
  vertical-align: top;
}

.ewt-report-table td:nth-child(8) {
  min-width: 240px;
  white-space: normal;
}

.ewt-report-detail-table td:nth-child(11),
.ewt-report-detail-table td:nth-child(12),
.ewt-report-detail-table td:nth-child(13),
.ewt-report-detail-table td:nth-child(14),
.ewt-report-detail-table td:nth-child(15),
.ewt-report-summary-table td:nth-child(3),
.ewt-report-summary-table td:nth-child(4),
.ewt-report-summary-table td:nth-child(5),
.ewt-report-summary-table td:nth-child(6),
.ewt-report-summary-table td:nth-child(7),
.ewt-report-summary-table td:nth-child(8),
.ewt-report-summary-table td:nth-child(9) {
  text-align: right;
}

.ar-service-workspace {
  display: grid;
  gap: 16px;
}

.ar-document-tabs {
  margin-bottom: 0;
}

.ar-document-panel {
  display: grid;
  gap: 16px;
}

.ar-service-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.ar-service-metrics {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.ar-service-layout {
  display: grid;
  grid-template-columns: minmax(680px, 1.45fr) minmax(340px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.ar-service-form,
.ar-service-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.ar-service-main-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.ar-service-tabs {
  margin-bottom: 0;
}

.ar-service-detail-panel {
  max-width: 100%;
}

.ar-service-table {
  min-width: 2100px;
}

.ar-service-table input,
.ar-service-table select {
  min-width: 112px;
  min-height: 34px;
  padding: 0 8px;
}

.ar-service-table .ar-service-description,
.ar-service-table .ar-service-revenue-account {
  min-width: 230px;
}

.ar-service-table td:nth-child(7),
.ar-service-table td:nth-child(9),
.ar-service-table td:nth-child(10),
.ar-service-table td:nth-child(13),
.ar-service-table td:nth-child(16) {
  text-align: right;
}

.ar-service-gl-table {
  min-width: 920px;
}

.ar-service-gl-table td:nth-child(3),
.ar-service-gl-table td:nth-child(4),
.ar-service-gl-table th:nth-child(3),
.ar-service-gl-table th:nth-child(4) {
  text-align: right;
}

.ar-receipt-main-grid {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
}

.ar-receipt-gl-table {
  min-width: 1380px;
}

.ar-receipt-application-table {
  min-width: 980px;
}

.ar-receipt-gl-table td:nth-child(10),
.ar-receipt-gl-table td:nth-child(11),
.ar-receipt-gl-table th:nth-child(10),
.ar-receipt-gl-table th:nth-child(11),
.ar-receipt-application-table td:nth-child(4),
.ar-receipt-application-table td:nth-child(5),
.ar-receipt-application-table th:nth-child(4),
.ar-receipt-application-table th:nth-child(5) {
  text-align: right;
}

.ar-receipt-gl-table td:nth-child(5) {
  min-width: 260px;
}

.ar-memo-main-grid {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
}

.ar-memo-table {
  min-width: 1780px;
}

.ar-memo-table input,
.ar-memo-table select {
  min-width: 112px;
  min-height: 34px;
  padding: 0 8px;
}

.ar-memo-table .ar-memo-reason-text,
.ar-memo-table .ar-memo-account {
  min-width: 220px;
}

.ar-memo-table td:nth-child(4),
.ar-memo-table td:nth-child(5),
.ar-memo-table td:nth-child(8),
.ar-memo-table td:nth-child(11),
.ar-memo-source-table td:nth-child(4),
.ar-memo-source-table td:nth-child(5),
.ar-memo-gl-table td:nth-child(3),
.ar-memo-gl-table td:nth-child(4),
.ar-memo-gl-table th:nth-child(3),
.ar-memo-gl-table th:nth-child(4) {
  text-align: right;
}

.ar-memo-gl-table {
  min-width: 980px;
}

.ar-memo-source-table {
  min-width: 980px;
}

.secondary-action:disabled,
.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.admin-home-grid {
  margin-bottom: 18px;
}

.admin-setup-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1.28fr);
  gap: 18px;
  align-items: start;
}

.company-registry-form textarea {
  min-height: 88px;
  resize: vertical;
}

.company-registry-panel {
  margin-top: 18px;
  overflow-x: auto;
}

.company-registry-panel table {
  min-width: 980px;
}

.company-registry-panel td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.8fr) minmax(520px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.audit-filter-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 12px;
  margin-bottom: 14px;
}

.danger-action {
  background: #8f2d36;
}

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

.permission-grid label {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
}

.permission-grid input {
  width: auto;
  min-height: auto;
  margin: 0 10px 0 0;
}

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

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

.customer-picker {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.supplier-picker {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

.line-editor {
  margin-top: 20px;
  overflow: hidden;
}

.line-editor table {
  border: 1px solid var(--line);
  border-radius: 8px;
  table-layout: fixed;
  overflow: hidden;
}

.line-editor th,
.line-editor td {
  padding: 10px 8px;
}

.line-editor th:nth-child(1),
.line-editor td:nth-child(1) {
  width: 88px;
}

.line-editor th:nth-child(2),
.line-editor td:nth-child(2) {
  width: 76px;
}

.line-editor th:nth-child(3),
.line-editor td:nth-child(3) {
  width: auto;
}

.line-editor th:nth-child(4),
.line-editor td:nth-child(4) {
  width: 104px;
}

.line-editor th:nth-child(5),
.line-editor td:nth-child(5) {
  width: 88px;
  text-align: right;
}

.line-editor th:nth-child(6),
.line-editor td:nth-child(6) {
  width: 72px;
  text-align: right;
}

.receipt-line-input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border-radius: 6px;
  padding: 0 8px;
}

.receipt-qty,
.receipt-price {
  min-width: 0;
}

.receipt-item,
.receipt-custom-item {
  min-width: 0;
}

.receipt-custom-item {
  margin-top: 6px;
}

.receipt-line-total {
  font-weight: 800;
}

.receipt-items-editor { container-type: inline-size; }
.receipt-items-editor .panel-title { gap: 12px; }
.receipt-items-editor .panel-title .mini-button { width: auto; padding: 0 14px; white-space: nowrap; flex-shrink: 0; }
.receipt-master-status, .receipt-items-help { color: var(--muted); font-size: 13px; line-height: 1.5; }
.receipt-master-status { margin: 0 0 8px; }
.receipt-item-setup { margin-bottom: 12px; padding: 12px; border: 1px solid #e3dccb; border-radius: 10px; background: #fcfaf4; font-size: 12px; }
.receipt-item-setup summary { cursor: pointer; color: #75572b; font-weight: 650; }
.receipt-item-setup ul { list-style: none; padding: 0; margin: 12px 0; }
.receipt-item-setup li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #e8e2d6; }
.receipt-item-setup li > div { flex: 1 1 220px; min-width: 0; }
.receipt-item-setup strong, .receipt-item-setup span, .receipt-item-setup small { display: block; overflow-wrap: anywhere; }
.receipt-item-setup span { margin: 5px 0; color: #75572b; }
.receipt-item-setup small, .receipt-item-setup p { color: var(--muted); line-height: 1.5; }
.receipt-item-setup p { margin-bottom: 0; }
.receipt-item-setup .mini-button { width: auto; padding: 8px 12px; }
.stock-adjustment-table { overflow-x: auto; }
#stock-adjustments .section-note { margin: 8px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
#stock-adjustments .primary-action { flex-shrink: 0; }
#adjust-preview { margin-top: 18px; background: #eff6f0; border-color: #d2e2d5; color: #285443; }
.stock-adjustment-table table { min-width: 720px; }
.stock-adjustment-table .mini-button { white-space: nowrap; width: auto; padding: 8px 12px; }
.stock-adjustment-history-title { margin-top: 28px; }
.stock-adjustment-review { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; line-height: 1.6; text-transform: none; }
.stock-adjustment-review input { width: 18px; height: 18px; min-height: 18px; margin-top: 4px; flex-shrink: 0; }
.receipt-items-help { margin-bottom: 16px; }
.receipt-items-help summary { cursor: pointer; width: fit-content; }
.receipt-items-help p { margin: 8px 0; }
.receipt-items-editor table, .receipt-items-editor tbody { display: block; width: 100%; border: 0; overflow: visible; }
.receipt-items-editor thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.receipt-items-editor tr[data-line-id] {
  display: grid;
  grid-template-columns: minmax(60px, .7fr) minmax(70px, .8fr) minmax(90px, 1fr) minmax(95px, 1fr) auto;
  grid-template-areas: "item item item item item" "quantity unit price amount action";
  gap: 14px 12px; padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff);
}
.receipt-items-editor table td:nth-child(n) { display: block; width: auto; height: auto; min-width: 0; padding: 0; border: 0; text-align: left; }
.receipt-items-editor td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; color: var(--muted); }
.receipt-item-cell { grid-area: item; }
.receipt-quantity-cell { grid-area: quantity; }
.receipt-unit-cell { grid-area: unit; }
.receipt-price-cell { grid-area: price; }
.receipt-amount-cell { grid-area: amount; }
.receipt-action-cell { grid-area: action; align-self: end; }
.receipt-action-cell .mini-button { min-height: 42px; padding: 0 10px; }
.receipt-items-editor .receipt-line-input { min-height: 42px; }
.receipt-items-editor .receipt-unit { background: #f4f6f2; color: #526459; }
.receipt-items-editor .receipt-line-total { display: flex; align-items: center; min-height: 42px; margin: 0; font-size: 15px; color: var(--teal); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.receipt-stock-info { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.receipt-stock-info.is-warning { color: #a44b19; }
.receipt-rate-info { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.receipt-rate-info.is-warning { color: #a44b19; }
.receipt-master-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.receipt-master-actions button { width: auto; }
.receipt-master-actions button[hidden] { display: none; }
.receipt-items-editor .empty-row td:nth-child(n) { padding: 16px; border: 1px dashed var(--line); border-radius: 10px; }
@container (max-width: 520px) {
  .receipt-items-editor tr[data-line-id] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "item item" "quantity unit" "price amount" "action action"; }
  .receipt-action-cell { justify-self: end; }
}

.purchase-lines {
  overflow-x: auto;
}

.purchase-lines .panel-title .mini-button {
  width: auto;
  min-width: 86px;
  padding: 0 12px;
}

.purchase-lines table {
  min-width: 760px;
}

.purchase-lines th:nth-child(1),
.purchase-lines td:nth-child(1) {
  width: 118px;
}

.purchase-lines th:nth-child(2),
.purchase-lines td:nth-child(2) {
  width: auto;
}

.purchase-lines th:nth-child(3),
.purchase-lines td:nth-child(3) {
  width: 92px;
}

.purchase-lines th:nth-child(4),
.purchase-lines td:nth-child(4) {
  width: 110px;
}

.purchase-lines th:nth-child(5),
.purchase-lines td:nth-child(5) {
  width: 110px;
  text-align: left;
}

.purchase-lines th:nth-child(6),
.purchase-lines td:nth-child(6) {
  width: 104px;
  text-align: right;
}

.purchase-review-panel {
  padding: 18px;
}

.po-review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.po-review-summary div {
  border: 1px solid rgba(29, 93, 109, 0.18);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f7fcfd;
}

.po-review-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.po-review-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 26px;
}

.purchase-review-panel .po-review-table {
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.po-review-table th {
  border-bottom: 0;
  padding-bottom: 8px;
}

.po-review-table td {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.po-review-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.po-review-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.po-review-table th:last-child,
.po-review-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
}

.po-review-table th:last-child {
  background: #fff;
}

.po-review-row.is-open td {
  border-color: rgba(29, 93, 109, 0.26);
}

.po-review-row.is-locked td {
  background: #fbfafa;
}

.po-review-row.is-approved td {
  border-color: rgba(29, 93, 109, 0.18);
  background: #fdfefe;
}

.po-review-id strong,
.po-review-amount strong {
  display: block;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef4f5;
  color: #52666d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: normal;
}

.status-pill + .status-pill {
  margin-top: 6px;
}

.status-pill.success,
.status-pill.approved,
.status-pill.unpaid {
  background: #dff5ed;
  color: #0d6840;
}

.status-pill.warning,
.status-pill.pending-approval,
.status-pill.partial,
.status-pill.paid,
.status-pill.received {
  background: #f9e6d8;
  color: #965a18;
}

.status-pill.danger,
.status-pill.cancelled,
.status-pill.rejected {
  background: #fde1df;
  color: #9d2720;
}

.status-pill.muted,
.status-pill.draft,
.status-pill.pending {
  background: #edf3f5;
  color: #52666d;
}

.po-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 168px;
}

.purchase-review-panel .secondary-action,
.purchase-review-panel .primary-action,
.purchase-review-panel .mini-button {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
}

.procurement-tabs {
  margin: 0 0 16px;
}

.procurement-queue-panel {
  padding: 18px;
}

.procurement-queue-panel .panel-title {
  margin-bottom: 12px;
}

.procurement-queue-panel .panel-title p {
  color: var(--muted);
}

.procurement-queue-table {
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.procurement-queue-table th {
  border-bottom: 0;
  padding-bottom: 8px;
}

.procurement-queue-table td {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.procurement-queue-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.procurement-queue-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  text-align: right;
}

.procurement-queue-table .primary-action {
  min-height: 36px;
  padding: 0 12px;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef6f7;
  color: var(--teal);
  font-weight: 800;
  font-size: 12px;
}

.approver-tag {
  background: #f6e4d6;
  color: #8a4a00;
}

.account-status {
  display: grid;
  gap: 4px;
}

.account-status span {
  color: var(--muted);
  font-size: 12px;
}

.password-status {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef6f7;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.password-status.warning {
  background: #f6e4d6;
  color: #8a4a00;
}

.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-row-actions .mini-button,
.user-row-actions .secondary-action {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
}

.po-item-cell {
  display: grid;
  gap: 8px;
}

.receipt-paper {
  min-width: 500px;
  border: 2px solid #1b1b1b;
  background: #fff;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
}

.po-paper {
  min-width: 560px;
  border: 1px solid #bdd0d8;
  border-radius: 6px;
  background: #fff;
  color: #111;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 43, 54, 0.12);
}

.po-brand {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #c7d8de;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  text-align: center;
}

.po-logo {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  background: #123f4c;
  color: #fff;
  border: 1px solid #d6eef3;
  font-weight: 900;
  line-height: 1.05;
}

.po-brand h3 {
  color: #0b2a5b;
  font-size: 28px;
  letter-spacing: 0.04em;
}

.po-brand strong,
.po-brand p {
  display: block;
  margin-top: 3px;
}

.po-meta {
  display: grid;
  grid-template-columns: 100px 1fr 100px 1fr;
  border-bottom: 1px solid #c7d8de;
  font-size: 12px;
}

.po-meta span,
.po-meta b {
  min-height: 28px;
  padding: 6px 8px;
  border-right: 1px solid #d9e4e8;
  border-bottom: 1px solid #e6eef1;
}

.po-meta span {
  font-weight: 800;
  text-transform: uppercase;
  background: #f6fafb;
}

.receipt-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px;
  text-align: center;
}

.receipt-brand-blank {
  display: none;
}

.paper-logo {
  width: 64px;
  height: 64px;
  font-family: Arial, sans-serif;
}

.receipt-brand h3 {
  color: #0b2a5b;
  font-size: 22px;
  letter-spacing: 0.04em;
}

.receipt-brand p {
  font-size: 12px;
  font-weight: 700;
}

.receipt-title-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
  padding: 4px 8px;
  font-size: 18px;
}

.receipt-title-row span {
  font-size: 12px;
  font-weight: 400;
}

.paper-fields {
  display: grid;
  grid-template-columns: 130px 1fr 120px 150px;
  border-bottom: 1px solid #111;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.paper-fields span,
.paper-fields b {
  min-height: 22px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  padding: 3px 5px;
}

.paper-fields span {
  font-weight: 800;
}

.paper-fields b {
  color: #144b74;
  font-style: italic;
}

.paper-fields .red {
  color: #cf2133;
}

.paper-table th,
.paper-table td {
  height: 25px;
  border-right: 1px solid #111;
  border-bottom: 1px dotted #777;
  padding: 3px 6px;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.paper-table th {
  border-bottom: 1px solid #111;
  text-align: center;
  text-transform: none;
}

.po-paper .paper-table th,
.po-paper .paper-table td {
  border-right: 1px solid #d9e4e8;
  border-bottom: 1px solid #e8eef1;
}

.po-paper .paper-table th {
  border-bottom: 1px solid #c7d8de;
  background: #f6fafb;
  color: #253f4a;
}

.paper-table td:first-child,
.paper-table td:nth-child(2),
.paper-table td:nth-child(4),
.paper-table td:nth-child(5) {
  text-align: right;
}

.paper-table tfoot td {
  border-bottom: 0;
  font-weight: 800;
}

.paper-table tfoot .bond-row td:last-child {
  color: #cf2133;
}

.paper-table tfoot .grand-total-row td {
  border-top: 1px solid #111;
  color: #0b2a5b;
}

.po-paper .paper-table tfoot .grand-total-row td {
  border-top: 1px solid #b5cbd3;
}

.po-paper .paper-table th:nth-child(2),
.po-paper .paper-table td:nth-child(2) {
  width: 42%;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.po-paper .paper-table th:nth-child(1),
.po-paper .paper-table td:nth-child(1) {
  width: 17%;
}

.po-paper .paper-table th:nth-child(3),
.po-paper .paper-table td:nth-child(3) {
  width: 10%;
}

.po-protection {
  padding: 12px 16px;
  border-top: 1px solid #d7e0e5;
  background: #fbfdfe;
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1.35;
}

.po-protection strong {
  display: block;
  margin-bottom: 4px;
  color: #0b2a5b;
}

.po-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 26px 14px 12px;
  border-top: 1px solid #d7e0e5;
  font-family: Arial, sans-serif;
  text-align: center;
}

.po-signatures span {
  display: block;
  padding-top: 8px;
  border-top: 1px solid #8ea4ad;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.po-signatures b {
  display: block;
  min-height: 18px;
  margin-bottom: 18px;
  color: #144b74;
  font-size: 12px;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.report-grid button {
  min-height: 90px;
  text-align: left;
  background: #fff;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  border: 1px solid rgba(29, 93, 109, 0.28);
  border-radius: 8px;
  padding: 14px 16px;
  background: #123f4b;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  width: min(920px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(12, 35, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-body {
  margin: 18px 0;
  overflow-x: hidden;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.nested-modal-grid {
  margin-top: 0;
}

.item-master-grid {
  gap: 16px 18px;
}

.item-master-workspace {
  display: grid;
  gap: 14px;
}

.item-master-card,
.item-master-advanced {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.item-master-card .form-section-title {
  margin-bottom: 12px;
}

.item-master-advanced {
  padding: 0;
  overflow: hidden;
}

.item-master-advanced summary {
  cursor: pointer;
  padding: 14px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style-position: inside;
}

.item-master-advanced .modal-grid {
  padding: 0 14px 14px;
}

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

.input-with-button input {
  min-width: 0;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.custom-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px 18px;
}

.custom-field-checkbox {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-transform: none;
}

.custom-field-list {
  margin-top: 16px;
}

.module-placeholder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-height: 320px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.module-placeholder article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.module-placeholder h3 {
  margin-bottom: 10px;
  color: var(--brand);
}

.module-placeholder p {
  color: var(--muted);
  line-height: 1.5;
}

.ai-control-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ai-control-strip article,
.ai-provision-grid article {
  min-width: 0;
}

.ai-control-strip article {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.ai-control-strip span,
.ai-step {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ai-control-strip strong {
  color: var(--brand);
  font-size: 18px;
}

.ai-control-strip small {
  color: var(--muted);
  line-height: 1.45;
}

.ai-provision-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  min-height: 0;
  margin-bottom: 18px;
}

.ai-provision-grid article {
  display: grid;
  gap: 8px;
}

.ai-step {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--soft);
}

.ai-provision-grid ul {
  display: grid;
  gap: 5px;
  margin: 4px 0 0;
  padding-left: 18px;
  color: #405052;
  font-size: 13px;
  line-height: 1.35;
}

.ai-operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}

.required-field-label {
  position: relative;
  color: var(--teal);
}

.required-field-label::after {
  content: "*";
  position: absolute;
  top: 0;
  right: 0;
  color: #a33b00;
  font-size: 16px;
  line-height: 1;
}

.required-field-label input,
.required-field-label select,
.required-field-label textarea {
  border-color: rgba(163, 59, 0, 0.42);
}

.item-master-workspace label {
  position: relative;
}

.customer-profile-form label {
  position: relative;
}

.customer-field-status {
  position: absolute;
  top: 0;
  right: 0;
  color: #954000;
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
}

.customer-field-status.optional { color: #62716a; }

.customer-field-help {
  margin: 0 0 18px;
  color: #62716a;
}

.customer-field-help summary {
  width: fit-content;
  cursor: pointer;
  color: var(--teal);
  font-size: 12px;
  font-weight: 500;
}

.customer-field-help summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  border-radius: 3px;
}

.customer-field-help .help-hide-label,
.customer-field-help[open] .help-show-label { display: none; }
.customer-field-help[open] .help-hide-label { display: inline; }

.customer-field-help-content {
  margin-top: 10px;
  padding: 10px 14px;
  border-left: 2px solid #d0dfd5;
  border-radius: 0 8px 8px 0;
  background: #f5f8f5;
  color: #62716a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
}

.customer-field-help-content p { margin: 5px 0; }

.customer-profile-form input::placeholder,
.customer-profile-form textarea::placeholder {
  color: #849088;
  font-weight: 400;
  opacity: 1;
}

.customer-profile-form textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
}

.customer-profile-form textarea[readonly] { background: #edf4ef; }

.customer-profile-form .customer-address-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.customer-profile-form .customer-address-copy input {
  width: 17px;
  height: 17px;
  margin: 0;
  padding: 0;
  min-height: 0;
  accent-color: var(--teal);
}

.item-master-workspace .required-field-label::after {
  content: none;
}

.item-field-status {
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f0f3ef;
  color: #5b695f;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}

.item-field-status[data-status="required"] {
  background: #fff0e6;
  color: #954000;
}

.item-field-status[data-status="automatic"] {
  background: #e7f3ed;
  color: #14654c;
}

.item-master-workspace label .item-field-help {
  display: block;
  color: #62716a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 600px) {
  .item-master-workspace .item-field-status {
    position: static;
    justify-self: start;
  }
}

.item-master-grid .span-2 select,
.item-master-grid .span-2 input {
  min-width: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px 14px;
}

.compact-checkbox-grid {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-grid input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.span-2,
.form-section-title {
  grid-column: 1 / -1;
}

.form-section-title {
  padding-top: 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-section-title:not(:first-child) {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modal-note {
  color: var(--muted);
  line-height: 1.5;
}

.is-hidden {
  display: none !important;
}

.record-summary {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
}

.record-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.record-summary b {
  color: var(--ink);
}

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

.profile-detail-group {
  min-width: 0;
}

.profile-detail-group h3 {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-detail-group.span-2 {
  grid-column: 1 / -1;
}

.item-profile-state {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfd;
}

.item-profile-state.editable {
  border-color: #b8e7d9;
  background: #ecfbf5;
}

.item-profile-state.locked {
  border-color: #f1d3bd;
  background: #fff5ee;
}

.item-profile-state p {
  color: var(--muted);
  font-size: 14px;
}

.review-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.review-table th,
.review-table td {
  padding: 10px;
}

.dr-preview {
  display: grid;
  gap: 14px;
}

.dr-preview-lines {
  overflow-x: auto;
}

.dr-preview-lines table {
  min-width: 620px;
}

.dr-preview-lines th:nth-child(3),
.dr-preview-lines td:nth-child(3) {
  min-width: 260px;
}

.dr-preview-total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Refined finance workspace polish */
body {
  background:
    linear-gradient(135deg, rgba(246, 249, 247, 0.96), rgba(250, 251, 249, 0.98) 46%, rgba(238, 244, 242, 0.92)),
    linear-gradient(180deg, rgba(240, 245, 242, 0.9), rgba(250, 251, 249, 0.92));
}

.sidebar {
  background: linear-gradient(180deg, #253f45 0%, #2f5654 48%, #274247 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 12px 0 36px rgba(22, 41, 45, 0.08);
}

.brand-mark,
.paper-logo {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.profile {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-item,
.nav-group-toggle,
.logout {
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-item.active,
.nav-item:hover,
.nav-group-toggle.active,
.nav-group-toggle:hover {
  background: rgba(233, 247, 248, 0.96);
  box-shadow: inset 3px 0 0 #78a7a0;
  transform: translateX(1px);
}

.main {
  padding: 30px 34px 42px;
}

.topbar {
  align-items: flex-start;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: 0;
}

.search {
  min-height: 46px;
  border-color: rgba(39, 66, 71, 0.1);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(33, 52, 57, 0.05);
}

.accounting-tabs {
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.accounting-tab-group {
  position: relative;
  min-height: 150px;
  gap: 10px;
  border-color: rgba(45, 79, 82, 0.1);
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 252, 250, 0.92)),
    #fff;
  box-shadow: 0 14px 34px rgba(35, 55, 59, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.accounting-tab-group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #4f7f7a, #98b9a9 52%, #c9b28f);
  opacity: 0;
  transition: opacity 160ms ease;
}

.accounting-tab-group:hover {
  border-color: rgba(45, 79, 82, 0.18);
  box-shadow: 0 18px 42px rgba(35, 55, 59, 0.09);
  transform: translateY(-1px);
}

.accounting-tab-group:hover::before,
.accounting-tab-group:has(.chip.active)::before {
  opacity: 1;
}

.accounting-tab-group > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6e7b75;
  letter-spacing: 0.09em;
}

.accounting-tab-group > span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9eb6a9;
  box-shadow: 0 0 0 4px rgba(158, 182, 169, 0.14);
}

.accounting-tab-row {
  gap: 9px;
}

.accounting-tab-row .chip,
.chip {
  border-color: rgba(39, 66, 71, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.accounting-tab-row .chip {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 13px;
}

.accounting-tab-row .chip.active,
.chip.active {
  border-color: #3f7470;
  background: linear-gradient(180deg, #54877f, #3f7470);
  color: #fff;
  box-shadow: 0 10px 22px rgba(52, 104, 100, 0.18);
}

.accounting-panel:not(.is-hidden),
.data-panel.accounting-panel:not(.is-hidden) {
  animation: panelFadeIn 180ms ease both;
}

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

.metric,
.panel,
.data-panel,
.receipt-form,
.receipt-preview,
.settings-form,
.accounting-readiness-card {
  border-color: rgba(39, 66, 71, 0.11);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(35, 55, 59, 0.06);
}

.data-panel table {
  background: rgba(255, 255, 255, 0.86);
}

th,
td {
  border-bottom-color: rgba(39, 66, 71, 0.1);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #74817d;
  background: rgba(248, 250, 248, 0.96);
  backdrop-filter: blur(8px);
  font-size: 11px;
  letter-spacing: 0.04em;
}

td {
  color: #26343a;
}

.data-panel tbody tr {
  transition: background 120ms ease, box-shadow 120ms ease;
}

.data-panel tbody tr:hover {
  background: #f6fbf9;
  box-shadow: inset 3px 0 0 rgba(79, 127, 122, 0.38);
}

mark,
.status-pill {
  border: 1px solid rgba(41, 112, 84, 0.1);
  background: #e5f5ee;
  color: #1d6442;
}

.status-pill.warning,
mark.warn {
  border-color: rgba(166, 107, 42, 0.12);
  background: #f7eadb;
  color: #8a5a20;
}

.status-pill.muted,
.status-pill.draft,
.status-pill.pending {
  border-color: rgba(98, 116, 122, 0.12);
  background: #eef3f2;
  color: #58676b;
}

.primary-action {
  border-color: #3f7470;
  background: linear-gradient(180deg, #5a8d85, #3f7470);
  box-shadow: 0 10px 22px rgba(52, 104, 100, 0.16);
}

.secondary-action,
.mini-button,
.icon-button {
  border-color: rgba(39, 66, 71, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.ap-voucher-form,
.ap-voucher-summary,
.vat-report-selector,
.ewt-report-selector {
  border-color: rgba(39, 66, 71, 0.11);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 36px rgba(35, 55, 59, 0.06);
}

.section-heading {
  gap: 18px;
  padding-bottom: 2px;
}

.section-heading p:not(.eyebrow),
.ap-voucher-title-row p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

.metric {
  min-height: 92px;
  padding: 18px;
}

/* Executive shell refresh */
:root {
  --page: #f5f8f6;
  --sidebar-1: #203a40;
  --sidebar-2: #2f625a;
  --accent: #3f7470;
  --accent-strong: #285e59;
  --warm-line: #d8d0bf;
}

body {
  background:
    linear-gradient(180deg, #f8faf8 0%, #f2f7f5 58%, #eef5f3 100%);
}

.app-shell {
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  gap: 18px;
  padding: 24px 18px 18px;
  background:
    linear-gradient(180deg, rgba(32, 58, 64, 0.98) 0%, rgba(41, 82, 78, 0.98) 54%, rgba(31, 62, 66, 0.98) 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 18px 0 44px rgba(32, 58, 64, 0.1);
}

.brand {
  min-height: 58px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

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

.brand span {
  color: rgba(233, 244, 241, 0.72);
}

.profile {
  padding: 14px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 28px rgba(12, 31, 35, 0.12);
}

.avatar {
  width: 42px;
  height: 42px;
  color: var(--accent-strong);
  background: #f2faf7;
}

.nav {
  gap: 5px;
}

.nav-item,
.nav-group-toggle,
.logout {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(241, 249, 246, 0.9);
  font-size: 13px;
}

.nav-submenu {
  gap: 3px;
  padding-left: 16px;
}

.nav-submenu .nav-item {
  min-height: 30px;
  color: rgba(241, 249, 246, 0.82);
}

.nav-item.active,
.nav-item:hover,
.nav-group-toggle.active,
.nav-group-toggle:hover {
  background: #edf8f6;
  color: var(--accent-strong);
  box-shadow: inset 3px 0 0 #87aaa1, 0 8px 18px rgba(14, 39, 43, 0.08);
}

.main {
  padding: 26px 32px 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  align-items: center;
  min-height: 58px;
  margin: -26px -32px 22px;
  padding: 20px 32px 8px;
  background: linear-gradient(180deg, rgba(248, 250, 248, 0.96), rgba(248, 250, 248, 0.78));
  backdrop-filter: blur(14px);
}

.topbar h1 {
  color: #172d34;
  font-size: clamp(30px, 2.7vw, 40px);
  font-weight: 800;
  letter-spacing: 0;
}

.search {
  width: min(420px, 34vw);
  min-height: 44px;
  border-color: rgba(25, 48, 54, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(30, 55, 59, 0.06);
}

.search input::placeholder {
  color: #7b8a88;
}

.topbar .icon-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: rgba(25, 48, 54, 0.1);
  background: rgba(255, 255, 255, 0.94);
}

.accounting-tabs {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.accounting-tab-group {
  min-height: 118px;
  gap: 10px;
  border-color: rgba(37, 69, 71, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 253, 251, 0.94)),
    #fff;
  box-shadow: 0 12px 30px rgba(33, 55, 59, 0.055);
}

.accounting-tab-group:has(.chip.active) {
  border-color: rgba(63, 116, 112, 0.2);
  box-shadow: 0 15px 34px rgba(41, 88, 84, 0.09);
}

.accounting-tab-group::before {
  height: 2px;
  background: linear-gradient(90deg, #6d9991, #d4c0a0);
}

.accounting-tab-group > span {
  color: #667875;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.accounting-tab-group > span::before {
  width: 7px;
  height: 7px;
  background: #adc4bb;
  box-shadow: 0 0 0 4px rgba(93, 139, 132, 0.1);
}

.accounting-tab-row {
  gap: 8px;
}

.accounting-tab-row .chip {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(35, 60, 65, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: #26343a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.accounting-tab-row .chip:hover {
  border-color: rgba(63, 116, 112, 0.22);
  background: #f8fbfa;
  transform: translateY(-1px);
}

.accounting-tab-row .chip.active,
.chip.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #4d827a, #3f7470);
  color: #fff;
  box-shadow: 0 9px 20px rgba(44, 98, 92, 0.18);
}

.data-panel,
.metric,
.panel,
.receipt-form,
.receipt-preview,
.settings-form {
  border-radius: 8px;
  border-color: rgba(37, 69, 71, 0.1);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(33, 55, 59, 0.055);
}

th {
  height: 42px;
  background: #f8faf8;
}

td {
  height: 44px;
}

@media (max-width: 1320px) {
  .accounting-tabs {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .accounting-tabs {
    grid-template-columns: 1fr;
  }
}

/* 2026 command workspace refresh */
:root {
  --page: #eef4f2;
  --ink: #152a30;
  --muted-ink: #637570;
  --sidebar-1: #122b31;
  --sidebar-2: #214c49;
  --sidebar-3: #18373d;
  --accent: #2f756d;
  --accent-strong: #1f5f57;
  --accent-soft: #e2f2ee;
  --gold: #c3a05d;
  --gold-soft: #f3ecdc;
  --line: #dce5e1;
}

body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.58) 0 1px, transparent 1px 96px),
    linear-gradient(180deg, #f8faf8 0%, #eef4f2 48%, #eaf2ef 100%);
}

.app-shell {
  grid-template-columns: 258px minmax(0, 1fr);
}

.sidebar {
  padding: 26px 20px 20px;
  background:
    linear-gradient(180deg, var(--sidebar-1) 0%, var(--sidebar-2) 58%, var(--sidebar-3) 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.09), 24px 0 60px rgba(18, 43, 49, 0.18);
}

.brand {
  min-height: 64px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.01em;
}

.profile {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  box-shadow: 0 16px 36px rgba(7, 26, 30, 0.18);
}

.avatar {
  color: var(--accent-strong);
  background: #f5fbf8;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.nav {
  gap: 7px;
  padding-right: 2px;
}

.nav-group {
  gap: 7px;
}

.nav-item,
.nav-group-toggle,
.logout,
.profile-action {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
}

.nav-group-toggle {
  color: rgba(245, 251, 248, 0.94);
}

.nav-item.active,
.nav-item:hover,
.nav-group-toggle.active,
.nav-group-toggle:hover {
  background: #f4fbf8;
  color: var(--accent-strong);
  box-shadow: inset 4px 0 0 var(--gold), 0 10px 22px rgba(8, 30, 34, 0.16);
}

.nav-submenu {
  padding: 5px 0 5px 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.nav-submenu .nav-item {
  min-height: 32px;
}

.main {
  padding: 0 32px 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 14;
  min-height: 88px;
  margin: 0 -32px 18px;
  padding: 22px 32px 14px;
  border-bottom: 1px solid rgba(35, 66, 70, 0.08);
  background: rgba(248, 251, 249, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 42px rgba(22, 48, 52, 0.07);
}

.topbar h1 {
  color: var(--ink);
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 850;
}

.top-actions {
  align-items: center;
}

.search {
  width: min(440px, 36vw);
  min-height: 46px;
  border: 1px solid rgba(28, 55, 61, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(24, 49, 54, 0.07);
}

.search span {
  color: var(--accent-strong);
}

.topbar .icon-button {
  min-width: 46px;
  min-height: 46px;
  border: 1px solid rgba(28, 55, 61, 0.12);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  box-shadow: 0 12px 28px rgba(24, 49, 54, 0.07);
}

.accounting-tabs {
  gap: 14px;
  margin-bottom: 18px;
}

.accounting-tab-group {
  position: relative;
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(38, 72, 74, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 248, 0.96));
  box-shadow: 0 18px 36px rgba(25, 51, 55, 0.08);
}

.accounting-tab-group::before {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0.7;
}

.accounting-tab-group:has(.chip.active) {
  border-color: rgba(47, 117, 109, 0.34);
  background:
    linear-gradient(180deg, #ffffff, #f3faf7);
  box-shadow: 0 20px 44px rgba(31, 95, 87, 0.14);
}

.accounting-tab-group:has(.chip.active)::before {
  opacity: 1;
}

.accounting-tab-group > span {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px 4px 0;
  color: #536865;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.accounting-tab-row {
  gap: 9px;
}

.accounting-tab-row .chip {
  min-height: 36px;
  border: 1px solid rgba(36, 65, 68, 0.12);
  background: #fff;
  box-shadow: 0 8px 16px rgba(24, 49, 54, 0.045);
}

.accounting-tab-row .chip:hover {
  border-color: rgba(47, 117, 109, 0.28);
  background: var(--accent-soft);
}

.accounting-tab-row .chip.active,
.chip.active {
  border-color: var(--accent-strong);
  background: linear-gradient(180deg, #3f827a, var(--accent-strong));
  color: #fff;
  box-shadow: 0 12px 24px rgba(31, 95, 87, 0.24);
}

.data-panel,
.metric,
.panel,
.receipt-form,
.receipt-preview,
.settings-form {
  border: 1px solid rgba(38, 72, 74, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(25, 51, 55, 0.075);
}

th {
  color: #5f706c;
  background: #f5f8f6;
}

tbody tr:hover {
  background: #f8fbfa;
}

.metric strong {
  font-size: clamp(20px, 1.8vw, 28px);
}

.metric-icon {
  width: 48px;
  height: 48px;
  background: #e8f3ee;
  color: #3f7470;
}

@supports not selector(:has(*)) {
  .accounting-tab-group::before {
    opacity: 0.55;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .section-head,
  .receipt-form,
  .preview-actions,
  .toast,
  .modal {
    display: none !important;
  }

  .app-shell,
  .main,
  .receipt-layout,
  .purchase-layout,
  .procurement-workflow {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #receipts {
    display: block !important;
  }

  body.print-po #receipts {
    display: none !important;
  }

  body.print-po #purchase-orders {
    display: block !important;
  }

  body.print-po .purchase-form {
    display: none !important;
  }

  .receipt-preview {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.print-po .po-preview {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .receipt-paper {
    width: 100%;
    min-width: 0;
  }

  .po-paper {
    width: 100%;
    min-width: 0;
    border: 2px solid #123f4c;
    border-radius: 0;
    box-shadow: none;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-right: 0;
  }

  .grouped-nav {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .finance-card-grid,
  .dashboard-kpi-grid,
  .dashboard-insight-grid,
  .dashboard-operations-grid,
  .quick-action-grid,
  .dashboard-grid,
  .customer-grid,
  .master-grid,
  .receipt-layout,
  .purchase-layout,
  .procurement-workflow,
  .ap-voucher-layout,
  .ap-voucher-split-tables,
  .payee-reference-grid,
  .expense-layout,
  .admin-setup-grid,
  .admin-layout,
  .report-grid,
  .ai-control-strip,
  .ai-provision-grid,
  .ai-operations-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tall-panel,
  .wide-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .receipt-preview,
  .po-preview {
    overflow: auto;
  }

  .po-review-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  .purchase-layout,
  .ap-voucher-layout,
  .payee-master-layout,
  .vat-report-layout,
  .ewt-report-layout {
    grid-template-columns: 1fr;
  }

  .ap-query-toolbar > label {
    flex: 1 1 220px;
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 16px;
  }

  .login-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-panel {
    padding: 26px;
  }

  .login-panel-info {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .accounting-readiness-hero,
  .dashboard-hero,
  .dashboard-title-row,
  .top-actions,
  .split-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .ai-control-strip,
  .ai-provision-grid,
  .ai-operations-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-actions {
    justify-content: flex-start;
  }

  .nav,
  .metric-grid,
  .finance-card-grid,
  .dashboard-kpi-grid,
  .dashboard-insight-grid,
  .dashboard-operations-grid,
  .quick-action-grid,
  .dashboard-grid,
  .customer-grid,
  .master-grid,
  .receipt-layout,
  .expense-layout,
  .admin-setup-grid,
  .admin-layout,
  .audit-filter-bar,
  .report-filter-row,
  .report-grid,
  .form-grid,
  .ap-voucher-main-grid,
  .ap-voucher-source-row,
  .ap-voucher-split-tables,
  .payee-master-form-grid,
  .payee-module-flags,
  .payee-reference-grid,
  .ap-query-toolbar,
  .vat-report-filter-grid,
  .ewt-report-filter-grid,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .ap-query-toolbar {
    display: grid;
  }

  .ap-query-group-bar small {
    margin-left: 0;
  }

  .accounting-readiness-score {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 14px;
  }

  .paper-fields {
    grid-template-columns: 120px 1fr;
  }

  .customer-picker,
  .supplier-picker,
  .record-summary {
    grid-template-columns: 1fr;
  }

  .checkbox-grid,
  .custom-field-grid,
  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-detail-group.span-2 {
    grid-column: auto;
  }

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

  .cash-flow-chart {
    gap: 12px;
    padding-left: 42px;
  }

  .chart-grid-lines {
    left: 42px;
  }

  .finance-card,
  .compact-kpi,
  .insight-panel {
    padding: 14px;
  }
}

/* Payroll visual language, adapted to ERP. Screen-only: document print styles stay intact. */
@media screen {
  :root {
    --ink: #1d2c26;
    --muted: #69766f;
    --muted-ink: #69766f;
    --line: #e3e2dc;
    --page: #f6f5f1;
    --panel: #fffefb;
    --soft: #f5f7f3;
    --teal: #0d624a;
    --teal-dark: #073d30;
    --navy: #073d30;
    --aqua: #c4e0d2;
    --mint: #e0f1e9;
    --accent: #0d624a;
    --accent-strong: #073d30;
    --accent-soft: #e0f1e9;
    --gold: #c7a269;
    --gold-soft: #f4ead9;
    --sidebar-1: #093e31;
    --sidebar-2: #07382d;
    --sidebar-3: #062f26;
    --shadow: 0 18px 48px rgba(17, 45, 34, .09);
    --shadow-soft: 0 10px 28px rgba(23, 54, 43, .05);
  }

  body {
    background: var(--page);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  }

  .main {
    background: radial-gradient(circle at 92% 2%, rgba(183, 211, 198, .16), transparent 24%), var(--page);
  }

  .sidebar {
    background: radial-gradient(circle at 15% -8%, rgba(133, 211, 179, .16), transparent 28%),
      linear-gradient(180deg, #093e31, #062f26);
    box-shadow: 10px 0 32px rgba(8, 52, 40, .1);
  }

  .sidebar .brand { color: #e7c98f; border-bottom-color: rgba(231, 201, 143, .16); }
  .sidebar .brand strong { color: #e7c98f; letter-spacing: .035em; }
  .sidebar .brand-mark {
    border: 1px solid rgba(231, 201, 143, .48);
    border-radius: 12px;
    color: #e7c98f;
    background: rgba(231, 201, 143, .06);
    box-shadow: none;
  }
  .sidebar .brand span, .sidebar .profile span { color: #afc8be; }
  .sidebar .profile {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(1, 27, 21, .2);
    box-shadow: none;
  }
  .sidebar .avatar { color: #ecd3a2; background: rgba(199, 162, 105, .15); }
  .sidebar .nav { scrollbar-color: rgba(230, 205, 161, .32) transparent; }
  .sidebar .nav::-webkit-scrollbar-thumb { background: rgba(230, 205, 161, .32); }
  .sidebar :is(.nav-item, .nav-group-toggle, .logout, .profile-action) {
    color: #c1d5cb;
    border-radius: 9px;
    font-weight: 600;
    font-size: 13px;
    transition: color .16s ease, background .16s ease;
  }
  .sidebar :is(.nav-item, .nav-group-toggle, .logout, .profile-action):hover {
    color: #fff;
    background: rgba(255, 255, 255, .065);
    transform: none;
  }
  .sidebar :is(.nav-item.active, .nav-group-toggle.active) {
    color: #fff;
    background: linear-gradient(90deg, rgba(230, 205, 161, .18), rgba(166, 231, 203, .08));
    box-shadow: inset 3px 0 #d3b77f;
  }
  .sidebar .nav-group-toggle .chevron { color: #d3b77f; }
  .sidebar .icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(154, 207, 184, .2);
    border-radius: 8px;
    color: #d9bf8b;
    background: transparent;
    font-size: 10px;
  }

  .topbar {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 245, 241, .94);
    box-shadow: none;
  }
  .executive-dashboard { grid-template-columns: minmax(0, 1fr); }
  .executive-dashboard > *, .finance-card, .compact-kpi, .insight-panel { min-width: 0; }
  .main h1 { font-size: clamp(24px, 2.3vw, 30px); font-weight: 650; letter-spacing: -.035em; }
  .main h2 { font-weight: 650; letter-spacing: -.025em; }
  .section-head h2 { font-size: 24px; }
  .top-actions button { white-space: nowrap; }
  .eyebrow { color: var(--teal); font-size: 11px; letter-spacing: .1em; }
  .search, .topbar .icon-button { border-color: var(--line); border-radius: 10px; box-shadow: none; }

  .primary-action, .secondary-action, .icon-button, .mini-button, .chip, .report-grid button {
    border-radius: 10px;
    font-weight: 650;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
  }
  .primary-action {
    border-color: var(--teal);
    color: #fff;
    background: linear-gradient(135deg, #117254, #0d624a);
    box-shadow: 0 6px 16px rgba(13, 96, 72, .16);
  }
  .primary-action:hover { background: linear-gradient(135deg, #0d624a, #073d30); }
  .secondary-action, .icon-button, .mini-button, .chip, .report-grid button {
    border-color: var(--line);
    background: var(--panel);
    box-shadow: none;
  }
  .secondary-action:hover, .icon-button:hover, .mini-button:hover, .chip:hover, .report-grid button:hover {
    border-color: #abc5b8;
    background: #f0f7f2;
    transform: none;
    box-shadow: none;
  }
  .accounting-tab-row .chip.active, .chip.active {
    border-color: var(--teal);
    color: #fff;
    background: var(--teal);
    box-shadow: 0 4px 12px rgba(13, 96, 72, .14);
  }
  button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
  :is(button, input, select, textarea, summary, a):focus-visible {
    outline: 3px solid rgba(17, 114, 84, .48);
    outline-offset: 3px;
  }
  .sidebar :is(button, a):focus-visible { outline-color: #e7c98f; }

  .metric, .panel, .data-panel, .customer-card, .master-card, .receipt-form,
  .receipt-preview, .settings-form, .finance-card, .compact-kpi, .insight-panel,
  .accounting-readiness-card, .accounting-tab-group {
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
  }
  .finance-card strong, .compact-kpi strong { color: var(--ink); font-weight: 650; letter-spacing: -.035em; }
  .finance-card h3, .compact-kpi h3, .insight-panel h3 { color: #53645b; font-weight: 600; }
  .finance-icon, .metric-icon { border-radius: 12px; }
  .finance-card.gold .finance-icon { color: #8b6936; background: var(--gold-soft); }
  .finance-card.mint .finance-icon, .compact-kpi.mint .finance-icon, .metric-icon {
    color: var(--teal); background: var(--mint);
  }
  .finance-card button, .compact-kpi button, .period-button, .segmented-control button {
    color: var(--teal); background: #edf5ef; font-weight: 650;
  }
  .segmented-control button.active { color: #fff; background: var(--teal); box-shadow: 0 4px 12px rgba(13, 96, 72, .14); }
  .period-button { box-shadow: none; }
  .cash-bar i { background: linear-gradient(180deg, #28866a, #0d624a); box-shadow: 0 8px 18px rgba(13, 96, 72, .12); }
  .expense-donut {
    background: radial-gradient(circle, var(--panel) 0 48%, transparent 49%),
      conic-gradient(#0d624a 0 64%, #c7a269 64% 78%, #c4e0d2 78% 100%);
    box-shadow: inset 0 0 0 1px rgba(13, 96, 72, .08);
  }
  .expense-legend span { color: #53645b; background: #f1f4ee; font-weight: 600; }
  .expense-legend i { background: #0d624a; }
  .expense-legend i.salary { background: #c7a269; }
  .expense-legend i.other { background: #c4e0d2; }
  .dashboard-hero {
    border-color: #d9ddcf;
    border-radius: 16px;
    background: linear-gradient(115deg, #eef5ee, #fffaf0);
    box-shadow: none;
  }
  .accounting-tab-group { min-height: 0; padding: 14px; }
  .accounting-tab-group::before { height: 2px; background: linear-gradient(90deg, var(--teal), var(--gold)); }
  .accounting-tab-group:has(.chip.active) { border-color: #adcbbb; background: #f6faf5; box-shadow: none; }
  .accounting-tab-row .chip { box-shadow: none; }

  .data-panel table { background: var(--panel); }
  .data-panel th, .main th { color: #637267; background: #f3f5ef; font-weight: 650; }
  .data-panel td, .main td { border-bottom-color: #e8ece5; }
  .data-panel tbody tr:hover { background: #f2f8f2; box-shadow: inset 3px 0 0 #abc5b8; }
  label { color: #5c6b61; font-weight: 650; letter-spacing: .025em; }
  input, select, textarea { border-color: #d9dfd5; border-radius: 9px; background: #fffefb; }
  input:focus, select:focus, textarea:focus { border-color: #45886d; }
  .status-pill, mark { border-radius: 999px; }
  .status-pill.warning, mark.warn { color: #8a5418; background: #fff3df; border-color: #f0dab6; }
  .modal { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
  .modal::backdrop { background: rgba(4, 33, 25, .5); backdrop-filter: blur(4px); }
  .modal-card { background: var(--panel); }

  .login-screen { overflow-y: auto; background: radial-gradient(circle at 10% 10%, rgba(23, 77, 64, .05), transparent 45%), #f6f5f0; }
  .login-card { border: 1px solid #e3e2dc; border-radius: 22px; box-shadow: 0 24px 65px rgba(17, 45, 34, .13); }
  .login-panel-form { order: 2; color: var(--ink); background: #fffefb; }
  .login-panel-info {
    order: 1;
    color: #fffefb;
    background: linear-gradient(155deg, #174d40, #0b3028);
  }
  .login-panel-info h2 { color: #fffefb; font-size: 34px; font-weight: 600; line-height: 1.12; letter-spacing: -.035em; }
  .login-panel-info p { color: #c1d5cb; }
  .login-panel-info .eyebrow { color: #d6b875; }
  .login-card h1 { color: var(--ink); font-size: 30px; font-weight: 650; }
  .login-card .brand-mark { border: 1px solid #c7a269; border-radius: 12px; color: var(--teal); background: var(--gold-soft); }
  .login-brand-row strong { color: var(--teal-dark); }
  .login-brand-row span, .login-note { color: var(--muted); }
  .login-card label { color: #53645b; font-size: 11px; }
  .login-card input { border-color: #d9dfd5; color: var(--ink); background: #fff; }
  .login-card input:focus { border-color: #45886d; background: #fff; }
  .login-insight-grid span { border-color: rgba(231, 201, 143, .22); border-radius: 10px; color: #e2ebe3; background: rgba(255, 255, 255, .055); box-shadow: none; font-weight: 600; }
  .login-insight-grid span::before { background: #d3b77f; box-shadow: 0 0 0 4px rgba(199, 162, 105, .12); }
}

@media screen and (min-width: 1101px) {
  .app-shell { grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar { padding: 24px 16px 18px; }
}

@media screen and (max-width: 720px) {
  .login-panel-form { order: 0; }
  .login-card { border-radius: 16px; }
  .topbar { position: static; margin: 0 0 18px; padding: 0 0 18px; }
  .main .top-actions { flex-wrap: wrap; }
  .insight-panel .panel-title { flex-wrap: wrap; }
  .cash-flow-chart { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding-right: 8px; }
}

/* Sidebar refinement and the standalone Payroll landing page. */
@media screen {
  .sidebar { gap: 18px; background: radial-gradient(ellipse at 0 0, rgba(110, 183, 146, .16), transparent 45%), linear-gradient(165deg, #103f33, #062e25 75%); }
  .sidebar .brand { min-height: 66px; gap: 13px; }
  .sidebar .brand-mark { padding: 0; flex-shrink: 0; cursor: pointer; border-radius: 16px; background: linear-gradient(145deg, rgba(232, 204, 151, .16), rgba(255, 255, 255, .025)); }
  .sidebar .profile { padding: 12px; border-color: rgba(178, 216, 196, .12); background: rgba(0, 22, 17, .18); }
  .sidebar .avatar { width: 38px; height: 38px; flex-shrink: 0; box-shadow: 0 0 0 4px rgba(199, 162, 105, .055); }
  .sidebar .profile strong { font-size: 13px; }
  .sidebar .profile span { font-size: 11px; line-height: 1.45; }
  .sidebar-caption { margin: 2px 10px -8px; color: #90afa0; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; }
  .sidebar .nav { gap: 7px; }
  .sidebar .nav-group { gap: 3px; }
  .sidebar :is(.nav-item, .nav-group-toggle) {
    position: relative; min-height: 42px; padding: 7px 10px; gap: 10px;
    border: 1px solid transparent; border-radius: 11px; color: #c1d6ca;
    font-size: 12px; font-weight: 550; line-height: 1.35;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
  }
  .sidebar .nav-label { min-width: 0; flex: 1; }
  .sidebar .icon { width: 26px; height: 26px; border: 0; border-radius: 8px; color: #9bbfab; background: rgba(182, 212, 194, .05); transition: background .18s ease, color .18s ease; }
  .sidebar .icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
  .sidebar :is(.nav-item, .nav-group-toggle):hover { transform: translateX(2px); background: rgba(192, 225, 203, .08); border-color: rgba(192, 225, 203, .1); box-shadow: none; }
  .sidebar :is(.nav-item, .nav-group-toggle):hover .icon { color: #e4c992; background: rgba(226, 199, 150, .1); }
  .sidebar .nav-item.active { color: #fffaf0; border-color: rgba(211, 183, 127, .27); background: linear-gradient(105deg, rgba(211, 183, 127, .19), rgba(134, 208, 170, .07)); box-shadow: inset 3px 0 #ddbf82, 0 5px 15px rgba(0, 15, 11, .12); }
  .sidebar .nav-item.active .icon { color: #edce93; background: rgba(227, 198, 148, .1); }
  .sidebar .nav-group-toggle.active { color: #e4ede6; border-color: rgba(183, 219, 197, .09); background: rgba(155, 208, 178, .055); box-shadow: none; }
  .sidebar .nav-group-toggle .chevron { width: 12px; height: 12px; font-size: 0; flex-shrink: 0; display: grid; place-items: center; }
  .sidebar .nav-group-toggle .chevron::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid #a1b9a9; border-bottom: 1.5px solid #a1b9a9; transform: rotate(-45deg); transition: transform .18s ease; }
  .sidebar .nav-group-toggle.active .chevron::after { transform: rotate(45deg); }
  .sidebar .nav-submenu { margin-left: 12px; padding: 3px 0 3px 8px; border-left: 1px solid rgba(172, 213, 186, .15); }
  .sidebar .nav-submenu .nav-item { padding-left: 9px; min-height: 38px; }
  .sidebar .nav-submenu .nav-submenu { margin-left: 5px; padding-left: 5px; }
  .sidebar .account-actions { flex-shrink: 0; border-top: 1px solid rgba(183, 219, 197, .12); padding-top: 12px; gap: 3px; }
  .sidebar .account-actions .profile { margin-bottom: 8px; }
  .sidebar .account-actions button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; min-height: 38px; font-size: 12px; }
  .sidebar .account-actions .icon { width: 22px; height: 22px; background: transparent; }
  .sidebar .account-actions .logout:hover { background: rgba(238, 193, 177, .08); color: #f0d5c8; }
  .sidebar .nav-submenu.is-open { animation: navReveal .2s ease both; }
  @keyframes navReveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

  #payroll { max-width: 1240px; margin-inline: auto; }
  .payroll-launchpad { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .7fr); border: 1px solid #e2e4da; border-radius: 22px; overflow: hidden; background: #fffefb; box-shadow: 0 14px 42px rgba(29, 57, 42, .055); }
  .payroll-welcome { padding: clamp(28px, 3.6vw, 56px); align-self: center; }
  .payroll-module-tag { display: inline-flex; flex-wrap: wrap; gap: 9px; color: #6b7569; font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
  .payroll-module-tag > span { color: #c7a269; }
  .payroll-welcome h2 { margin: 20px 0 14px; font-size: clamp(28px, 2.7vw, 40px); line-height: 1.12; letter-spacing: -.04em; color: #143e30; }
  .payroll-welcome > p { max-width: 470px; color: #677568; font-size: 14px; line-height: 1.75; }
  .payroll-launch-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 48px; padding: 12px 20px; margin-top: 28px; border-radius: 11px; font-size: 13px; }
  .payroll-launch-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .payroll-launch-note { display: block; margin-top: 12px; color: #728071; font-size: 11px; line-height: 1.5; }
  .payroll-module-art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 36px 24px; overflow: hidden; color: #edf3eb; background: radial-gradient(ellipse at 80% 0, rgba(206, 178, 124, .21), transparent 65%), #103f33; }
  .payroll-module-art::before { content: ""; position: absolute; width: 330px; height: 330px; border: 1px solid rgba(219, 224, 193, .1); border-radius: 50%; top: -170px; right: -190px; box-shadow: 0 0 0 32px rgba(219, 224, 193, .035), 0 0 0 65px rgba(219, 224, 193, .025); }
  .payroll-art-label { font-size: 9px; letter-spacing: .18em; color: #c5cbaa; }
  .payroll-art-emblem { display: grid; place-items: center; margin: 18px 0 8px; width: 118px; height: 130px; border: 1px solid rgba(231, 204, 153, .27); border-radius: 25px; background: linear-gradient(140deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02)); box-shadow: 0 18px 25px rgba(0, 22, 14, .15); transform: rotate(-5deg); }
  .payroll-art-emblem svg { width: 80px; height: 80px; fill: none; stroke: #e1c38d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .payroll-module-art > strong { font-size: 26px; font-weight: 550; letter-spacing: -.035em; }
  .payroll-module-art > span:last-child { color: #b9cdbd; font-size: 11px; text-align: center; }
  .payroll-entry-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 28px 0 0; padding: 0; }
  .payroll-entry-steps li { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
  .payroll-step-number { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #e1dac9; border-radius: 10px; color: #8a7144; background: #f4eedf; font-size: 10px; font-weight: 700; }
  .payroll-entry-steps h3 { margin: 2px 0 7px; color: #304c3c; font-size: 13px; font-weight: 650; }
  .payroll-entry-steps p { color: #6b786d; font-size: 12px; line-height: 1.65; }
  .payroll-connection-note { margin-top: 26px; border-top: 1px solid #e0e3d9; color: #6b786d; font-size: 12px; }
  .payroll-connection-note summary { width: fit-content; padding: 18px 0; color: #4b6653; font-weight: 600; cursor: pointer; }
  .payroll-connection-note p { max-width: 740px; padding-bottom: 18px; line-height: 1.7; }
}
@media screen and (min-width: 1101px) {
  .app-shell { grid-template-columns: 264px minmax(0, 1fr); }
}
@media screen and (max-width: 720px) {
  .payroll-launchpad { grid-template-columns: minmax(0, 1fr); border-radius: 16px; }
  .payroll-module-art { display: none; }
  .payroll-welcome { padding: 26px 22px; }
  .payroll-launch-button { width: 100%; gap: 12px; padding-inline: 10px; }
  .payroll-entry-steps { grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
  .sidebar .nav-submenu { margin-left: 6px; }
}

/* ERP overview: scoped to the dashboard; document print layouts are unchanged. */
@media screen {
  #dashboard { --dash-muted: #6c7a70; --dash-border: #e0e5dc; }
  #dashboard .executive-dashboard { gap: 20px; max-width: 1540px; margin-inline: auto; }
  .erp-overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 2px 0 4px; }
  #dashboard .dashboard-eyebrow { margin: 0 0 7px; color: #8b744b; font-size: 9px; line-height: 1.4; font-weight: 700; letter-spacing: .14em; }
  .erp-overview-heading h2 { margin: 0 0 8px; color: #173d2f; font-size: clamp(23px, 2vw, 31px); letter-spacing: -.035em; line-height: 1.2; }
  .erp-overview-heading > div > p:last-child { font-size: 12px; color: var(--dash-muted); }
  .dashboard-context { display: grid; gap: 7px; text-align: right; flex-shrink: 0; }
  .dashboard-context time { color: #304b3b; font-size: 12px; font-weight: 600; }
  .dashboard-context span { color: #6c7a70; font-size: 10px; }
  #dashboard .finance-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  #dashboard .finance-card { gap: 0; min-height: 170px; padding: 20px 20px 0; overflow: hidden; border: 1px solid var(--dash-border); border-radius: 15px; background: #fffefb; box-shadow: 0 3px 12px rgba(25, 48, 32, .025); }
  #dashboard .finance-card-head { gap: 10px; margin-bottom: 15px; }
  #dashboard .finance-card h3 { color: #56695c; font-size: 12px; font-weight: 600; line-height: 1.5; }
  #dashboard .finance-icon { display: grid; place-items: center; flex-shrink: 0; width: 31px; height: 31px; border-radius: 9px; color: #638273; background: #edf3ee; }
  #dashboard svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  #dashboard .finance-card > strong { color: #193c2e; font-size: clamp(19px, 1.8vw, 28px); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.3; overflow-wrap: anywhere; }
  #dashboard .finance-context { margin: 6px 0 16px; color: var(--dash-muted); font-size: 10px; line-height: 1.5; }
  #dashboard .finance-card footer { margin: 0 -20px; padding: 10px 20px; border-top: 1px solid #eef0e9; background: #fcfcf8; }
  #dashboard .finance-card footer button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; margin: 0; text-align: left; color: #4e715c; font-size: 10px; font-weight: 600; line-height: 1.5; min-height: 22px; }
  #dashboard .finance-card footer button:hover { color: #073d30; text-decoration: underline; background: transparent; }
  #dashboard .balance-estimate { background: #123f32; border-color: #123f32; }
  #dashboard .balance-estimate h3 { color: #cad9cf; }
  #dashboard .balance-estimate > strong { color: #fff9e9; }
  #dashboard .balance-estimate .finance-icon { background: rgba(241, 213, 158, .09); color: #e2c590; }
  #dashboard .balance-estimate .finance-context { color: #c6d4c7; }
  #dashboard .balance-estimate footer { background: rgba(0, 0, 0, .07); border-color: rgba(255, 255, 255, .1); }
  #dashboard .balance-estimate footer button, #dashboard .balance-estimate footer button:hover { color: #e4cb9c; }
  .dashboard-metric-note { margin-top: -12px; color: #738073; font-size: 10px; line-height: 1.7; }
  .dashboard-metric-note summary { cursor: pointer; width: fit-content; padding: 4px 0; }
  .dashboard-metric-note p { max-width: 1040px; padding: 7px 0; }
  #dashboard .dashboard-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 17px 0; border: 1px solid var(--dash-border); border-radius: 14px; background: #fffefb; }
  #dashboard .compact-kpi { min-height: 46px; gap: 11px; padding: 0 18px; border: 0; border-right: 1px solid #e8ece4; border-radius: 0; box-shadow: none; background: transparent; }
  #dashboard .compact-kpi:last-child { border-right: 0; }
  #dashboard .compact-kpi h3 { font-size: 11px; font-weight: 550; color: #637369; }
  #dashboard .compact-kpi button { display: block; margin: 4px 0 0; padding: 0; min-height: 18px; font-size: 9px; color: #466c55; background: transparent; font-weight: 600; text-align: left; }
  #dashboard .compact-kpi button:hover { text-decoration: underline; }
  #dashboard .compact-kpi > strong { margin-left: auto; color: #204a35; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .dashboard-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: -4px; }
  .dashboard-shortcuts > span { color: #7a8377; font-size: 10px; margin-right: 5px; }
  .dashboard-shortcuts button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 11px; color: #496452; background: #eeefe7; border: 1px solid #e0e4d8; border-radius: 8px; font-size: 10px; font-weight: 550; }
  .dashboard-shortcuts button:hover { background: #e4ece1; border-color: #b7cbbb; }
  #dashboard .dashboard-shortcuts svg { width: 14px; height: 14px; }
  .erp-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
  #dashboard .insight-panel { min-width: 0; padding: 23px; border: 1px solid var(--dash-border); border-radius: 15px; background: #fffefb; box-shadow: 0 3px 12px rgba(25, 48, 32, .025); }
  #dashboard .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
  #dashboard .panel-title h3 { color: #244732; font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
  #dashboard .panel-title .dashboard-eyebrow { font-size: 8px; margin-bottom: 6px; }
  #dashboard .dashboard-text-link { padding: 5px 0; border: 0; background: transparent; color: #60795f; font-size: 10px; font-weight: 550; white-space: nowrap; }
  #dashboard .dashboard-text-link:hover { text-decoration: underline; }
  .stock-summary { display: flex; align-items: center; gap: 16px; margin-top: 23px; }
  .stock-summary > strong { font-size: 39px; font-weight: 550; letter-spacing: -.055em; line-height: 1; color: #185c41; }
  .stock-summary > div { display: grid; gap: 6px; }
  .stock-summary span { color: #405e49; font-size: 11px; }
  .stock-summary small { color: #7a867a; font-size: 10px; }
  .stock-distribution { display: flex; height: 12px; border-radius: 5px; overflow: hidden; background: #e9ede4; margin-top: 21px; }
  .stock-distribution > span { height: 100%; width: 0; }
  .stock-available { background: #287355; }
  .stock-rented { background: #c7a269; }
  .stock-legend { display: flex; flex-wrap: wrap; gap: 19px; margin-top: 12px; }
  .stock-legend span { display: flex; gap: 6px; align-items: center; font-size: 9px; color: #748071; }
  .stock-legend i { display: block; width: 6px; height: 6px; border-radius: 2px; background: #e1e6da; }
  .stock-legend .available { background: #287355; }
  .stock-legend .rented { background: #c7a269; }
  .stock-status-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 24px; padding-top: 18px; border-top: 1px solid #e8ece3; gap: 20px; }
  .stock-status-grid > div { display: grid; gap: 5px; }
  .stock-status-grid span { font-size: 10px; color: #697b6b; }
  .stock-status-grid strong { color: #34573e; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .stock-status-grid small { color: #7c8777; font-size: 9px; }
  .expense-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px 14px; margin: 3px 0 20px; }
  .expense-total strong { color: #244732; font-size: 26px; font-weight: 600; letter-spacing: -.03em; overflow-wrap: anywhere; }
  .expense-total > span { font-size: 9px; color: #748071; }
  .expense-breakdown { display: grid; gap: 17px; }
  .expense-category > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: #68796b; font-size: 10px; margin-bottom: 7px; }
  .expense-category strong { color: #3e6149; font-size: 10px; font-weight: 600; flex-shrink: 0; }
  .expense-track { height: 5px; background: #eff0e9; border-radius: 3px; overflow: hidden; }
  .expense-track span { display: block; height: 100%; background: #bb9b65; border-radius: 3px; }
  .dashboard-empty { display: grid; justify-items: center; align-content: center; min-height: 169px; gap: 8px; border: 1px dashed #dfe4d6; border-radius: 10px; background: #f8f9f3; text-align: center; padding: 16px; }
  #dashboard .dashboard-empty > svg, .empty-ledger { width: 30px; height: 30px; color: #99ab92; font-size: 30px; line-height: 24px; }
  .dashboard-empty > strong { color: #4e6951; font-size: 12px; font-weight: 550; }
  .dashboard-empty > p { color: #7e8b77; font-size: 10px; line-height: 1.6; max-width: 250px; }
  .dashboard-section-label { display: flex; justify-content: space-between; align-items: end; margin: 7px 0 -5px; gap: 16px; }
  .dashboard-section-label h2 { color: #284933; font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
  .dashboard-section-label > span { color: #788471; font-size: 10px; }
  #dashboard .dashboard-operations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  #dashboard .attention-title { display: flex; align-items: center; gap: 11px; }
  #dashboard .attention-title h3 { font-size: 13px; }
  #dashboard .attention-title p { color: #7b8878; font-size: 10px; margin-top: 5px; }
  .attention-symbol { display: grid; place-items: center; width: 32px; height: 32px; background: #f2eedf; color: #9c804c; border-radius: 10px; flex-shrink: 0; }
  .attention-symbol.overdue { background: #faeee7; color: #ad684d; font-size: 16px; }
  #dashboard .dashboard-count { background: #f1f3eb; color: #6c7b5f; border-radius: 7px; padding: 5px 8px; font-size: 11px; min-width: 26px; text-align: center; }
  #dashboard .overdue-panel .dashboard-count { background: #fbf0e9; color: #a96b4e; }
  #dashboard .alert-list { max-height: 270px; overflow-y: auto; }
  #dashboard .alert-list .empty-state { text-align: left; padding: 17px; border: 1px dashed #e1e6d9; border-radius: 9px; background: #f8f9f4; color: #778672; font-size: 11px; }
  #dashboard .alert-list-item { border-radius: 9px; padding: 12px; background: #f8faf5; font-size: 11px; }
  #dashboard .alert-list-item.overdue { background: #fdf6f0; }
  #dashboard .alert-list-item small { font-size: 10px; }
}
@media screen and (min-width: 1101px) and (max-width: 1280px) {
  #dashboard .finance-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashboard .compact-kpi { padding-inline: 10px; gap: 6px; }
  #dashboard .compact-kpi .finance-icon { display: none; }
}
@media screen and (max-width: 720px) {
  .erp-overview-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .dashboard-context { text-align: left; gap: 5px; }
  #dashboard .finance-card-grid, .erp-analysis-grid, #dashboard .dashboard-operations-grid { grid-template-columns: minmax(0, 1fr); }
  #dashboard .finance-card > strong { font-size: 27px; }
  #dashboard .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 19px; }
  #dashboard .compact-kpi { padding-inline: 12px; gap: 9px; }
  #dashboard .compact-kpi:nth-child(2) { border-right: 0; }
  #dashboard .compact-kpi .finance-icon { display: none; }
  #dashboard .compact-kpi > strong { font-size: 20px; }
  #dashboard .insight-panel { padding: 19px; }
  .dashboard-shortcuts { gap: 7px; }
  .dashboard-shortcuts > span { width: 100%; }
  .dashboard-section-label { align-items: flex-start; flex-direction: column; gap: 8px; }
  #dashboard .panel-title { flex-wrap: wrap; }
}

/* Business-neutral Item Master with optional rental columns. */
@media screen {
  #inventory .item-master-intro { margin: -2px 0 22px; max-width: 850px; color: #6e7d70; font-size: 13px; line-height: 1.7; }
  #inventory .item-master-filters { display: flex; flex-wrap: wrap; gap: 9px; }
  #inventory .item-master-list-options { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 4px 0 14px; color: #758171; font-size: 11px; }
  #inventory .item-master-list-options label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; text-transform: none; letter-spacing: 0; }
  #inventory .item-master-list-options input { width: 15px; height: 15px; margin: 0; accent-color: #0d624a; }
  #inventory:not(.show-rental-details) tr > :nth-child(5), #inventory:not(.show-rental-details) tr > :nth-child(7) { display: none; }
  #inventory .item-class-label { display: block; width: fit-content; margin-top: 6px; padding: 3px 7px; border-radius: 5px; background: #edf2e8; color: #58704f; font-size: 10px; }
  .item-business-profile { padding: 18px; border: 1px solid #ccd9c5; border-radius: 13px; background: #f3f7ee; }
  .item-business-profile strong { color: #234d38; font-size: 14px; }
  .item-business-profile p { margin: 6px 0 0; color: #6a7c60; font-size: 11px; line-height: 1.7; }
  .item-profile-controls { display: flex; align-items: end; gap: 12px; margin-top: 14px; }
  .item-profile-controls label { flex: 1; }
  .item-profile-controls button { flex-shrink: 0; min-height: 40px; }
}
@media screen and (max-width: 720px) {
  #inventory .item-master-list-options { align-items: flex-start; flex-direction: column; gap: 12px; }
  .item-profile-controls { align-items: stretch; flex-direction: column; }
}

@media screen and (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Keep sign-in feedback visible while the authenticated workspace loads. */
#login-submit { display: flex; align-items: center; justify-content: center; gap: 10px; }
#login-submit:disabled { cursor: wait; opacity: .85; }
.login-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: login-spin .8s linear infinite; }
#login-form[aria-busy="true"] .login-spinner { display: inline-block; }
.login-status { min-height: 1.5em; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-status.is-error { color: #a33131; }
@keyframes login-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-spinner { animation: none; } }

/* Selected-system entry and compact workspace switcher. */
.login-insight-grid button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 14px; border: 1px solid rgba(214,184,117,.25); border-radius: 10px; background: rgba(255,255,255,.06); color: #e2ebe3; text-align: left; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .18s, border-color .18s; }
.login-insight-grid button::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #d6b875; box-shadow: 0 0 0 4px rgba(214,184,117,.10); }
.login-insight-grid button:hover { background: rgba(255,255,255,.10); border-color: #d6b875; }
.login-insight-grid button[aria-pressed="true"] { border-color: #d6b875; background: rgba(214,184,117,.10); color: #fff; box-shadow: inset 3px 0 #d6b875; }
.login-insight-grid button[aria-pressed="true"]::before { background: #f3e7c7; }
.login-insight-grid button:focus-visible, .login-more-systems summary:focus-visible { outline: 2px solid #f3e7c7; outline-offset: 4px; }
#login-submit { background: #174d40; box-shadow: 0 5px 14px rgba(16,63,53,.12); }
#login-submit:hover:not(:disabled) { background: #103f35; }
#login-submit:focus-visible { outline: 2px solid #103f35; outline-offset: 3px; }
.login-insight-grid button:disabled { cursor: wait; opacity: .7; }
.login-more-systems { position: relative; max-width: 390px; margin-top: 14px; color: #c1d5cb; font-size: 12px; }
.login-more-systems summary { cursor: pointer; }
.login-more-systems .login-insight-grid { margin-top: 12px; }
.system-workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 10px 6px; }
.system-workspace-header span, .system-workspace-header strong { display: block; }
.system-workspace-header span { color: #9bb8aa; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.system-workspace-header strong { color: #f2dfb7; font-size: 14px; margin-top: 5px; }
.system-workspace-header button { padding: 8px 10px; border: 1px solid #426e5e; border-radius: 8px; background: #ffffff0b; color: #e2ebe3; font-size: 11px; cursor: pointer; }
.system-workspace-header button:hover { background: #ffffff15; }
.system-workspace-header button:focus-visible { outline: 2px solid #e7c98f; outline-offset: 2px; }
/* User access management: one clear editor, followed by a contained directory. */
@media screen {
  #user-manager { min-width: 0; }
  #user-manager-note:empty { display: none; }
  .user-profile-error { margin: 16px 0 0; padding: 14px 16px; border: 1px solid #dfb5a1; border-radius: 10px; background: #fff2eb; color: #8b3e22; font-size: 13px; line-height: 1.6; }
  .user-profile-error:focus { outline: 2px solid #b66c44; outline-offset: 2px; }
  .user-manager-intro { margin: -8px 0 22px; color: #65796d; font-size: 14px; line-height: 1.6; }
  #user-manager .user-access-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  #user-manager .user-form { padding: 26px; min-width: 0; border: 1px solid #dce4db; border-radius: 18px; background: #fffefb; }
  .user-form-heading { margin-bottom: 20px; }
  .user-form-heading h3 { margin: 5px 0 7px; color: #173f30; font-size: 20px; }
  .user-form-heading p, .access-section-heading p { margin: 0; color: #6c7e72; font-size: 12px; line-height: 1.6; }
  #user-manager .user-form .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 28px; }
  .module-access-editor { min-width: 0; }
  .access-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 20px 0 14px; }
  .access-section-heading h3 { margin: 0 0 5px; color: #244c37; font-size: 15px; }
  .access-count { flex-shrink: 0; padding: 7px 11px; border-radius: 20px; background: #edf3ed; color: #376348; font-size: 11px; }
  .module-access-grid, .module-access-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .module-access-editor .module-access-card { display: flex; align-items: flex-start; gap: 11px; margin: 0; padding: 16px; min-width: 0; border: 1px solid #dce3d8; border-radius: 11px; background: #fff; cursor: pointer; text-transform: none; letter-spacing: 0; }
  .module-access-editor .module-access-card:has(input:checked) { background: #eef6ef; border-color: #86ad91; box-shadow: inset 3px 0 #27724f; }
  .module-access-editor .module-access-card:focus-within { outline: 2px solid #bda06b; outline-offset: 2px; }
  .module-access-editor .module-access-card input { flex: 0 0 auto; width: 17px; height: 17px; margin: 2px 0 0; accent-color: #0d624a; }
  .module-access-card strong { display: block; color: #274b36; font-size: 13px; line-height: 1.5; }
  .module-access-card small { display: block; color: #728271; font-size: 11px; line-height: 1.6; margin-top: 4px; font-weight: 400; }
  .module-access-card:has(input:disabled) { cursor: default; }
  .module-access-card:has(input:disabled:not(:checked)) { opacity: .55; }
  .access-admin-note, .access-footnote { margin-top: 12px; color: #75816e; font-size: 11px; line-height: 1.7; }
  .access-admin-note { padding: 12px; color: #795d2e; background: #f8f1e1; border-radius: 9px; }
  #user-manager .workflow-note { margin-top: 20px; padding: 0; background: transparent; border: 0; color: #748071; font-size: 11px; font-weight: 400; }
  #user-manager .user-directory { min-width: 0; overflow: hidden; border-radius: 18px; }
  .user-directory > .user-form-heading { padding: 24px 24px 0; }
  .user-table-scroll { overflow-x: auto; max-width: 100%; }
  .user-directory table { width: 100%; min-width: 800px; }
  .user-directory td { vertical-align: top; }
  .user-module-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 180px; max-width: 300px; }
  .user-module-tags span { display: inline-block; padding: 4px 7px; border-radius: 6px; color: #52715b; background: #eef3ea; font-size: 10px; white-space: nowrap; }
  .user-account-actions summary { cursor: pointer; color: #56705e; padding: 9px 0; font-size: 11px; white-space: nowrap; }
  .user-account-actions > div { display: grid; gap: 5px; }
  .user-directory .user-row-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
  dialog .module-access-grid, dialog .module-access-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 1100px) {
  #user-manager .user-form .form-grid, .module-access-grid, .module-access-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 600px) {
  #user-manager .user-form { padding: 18px; }
  #user-manager .user-form .form-grid, .module-access-grid, .module-access-options, dialog .module-access-grid, dialog .module-access-options { grid-template-columns: minmax(0, 1fr); }
}
/* The selected workspace replaces the former all-module wrapper levels. */
.grouped-nav [data-nav-group="enterprise"], .grouped-nav [data-nav-group="inventory-root"] { display: none; }
.grouped-nav [data-nav-submenu="enterprise"], .grouped-nav [data-nav-submenu="inventory-root"] { display: block; margin: 0; padding: 0; border: 0; }
.system-switch-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.system-choice { padding: 18px; text-align: left; color: var(--ink); background: #fff; border: 1px solid #d9dfd5; border-radius: 12px; cursor: pointer; }
.system-choice strong, .system-choice span { display: block; }
.system-choice span { margin-top: 8px; color: var(--muted); font-size: 12px; }
.system-choice:hover, .system-choice[aria-pressed="true"] { background: #edf5ef; border-color: #45886d; }
@media (max-width: 480px) { .system-switch-grid { grid-template-columns: 1fr; } }

/* Keep receipt recovery readable beside its action at desktop and mobile widths. */
#receipt-posting-status:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
#receipt-posting-status > span { flex: 1 1 260px; }
#receipt-posting-status > button {
  width: auto;
  flex: 0 0 auto;
  padding: 10px 14px;
  white-space: nowrap;
  line-height: 1.4;
}
.receipt-field-error {
  color: #b42318;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: none;
  line-height: 1.45;
}

/* Formal DR export. Scoped to its separate print window. */
@page drReceipt { size: A4; margin: 14mm; }
body.dr-export * { box-sizing: border-box; }
body.dr-export { margin: 24px auto; max-width: 820px; color: #111; background: white; font: 10pt Arial, sans-serif; }
body.dr-export .receipt-document { border: 1.5pt solid #111; }
body.dr-export .receipt-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 5px 7px; font-family: Georgia, "Times New Roman", serif; }
body.dr-export h1 { margin: 0; font-size: 15pt; }
body.dr-export .receipt-heading span { text-align: right; font-size: 10pt; overflow-wrap: anywhere; }
body.dr-export table { display: table; width: 100%; border-collapse: collapse; table-layout: fixed; }
body.dr-export th, body.dr-export td { height: auto; padding: 3px 5px; border: 0; color: inherit; background: transparent; font: inherit; line-height: 1.2; letter-spacing: normal; text-transform: none; vertical-align: top; overflow-wrap: anywhere; }
body.dr-export tbody tr:hover { background: transparent; }
body.dr-export th { position: static; backdrop-filter: none; }
body.dr-export .receipt-fields { border-top: 1px solid #111; border-bottom: 1px solid #111; }
body.dr-export .receipt-fields th, body.dr-export .receipt-fields td { border-right: 1px solid #111; border-bottom: 1px solid #111; text-align: left; }
body.dr-export .receipt-fields th { font-weight: 700; }
body.dr-export .receipt-fields td { color: #144b74; font-style: italic; font-weight: 600; white-space: pre-wrap; }
body.dr-export .receipt-fields .red { color: #cf2133; }
body.dr-export .receipt-fields tr > :last-child, body.dr-export .receipt-lines tr > :last-child { border-right: 0; }
body.dr-export .receipt-fields tr:last-child > * { border-bottom: 0; }
body.dr-export .receipt-lines th { background: #f3f4ef; color: #52615d; border-bottom: 1px solid #111; font-weight: 600; text-align: center; }
body.dr-export .receipt-lines th, body.dr-export .receipt-lines td { border-right: 1px solid #111; }
body.dr-export .receipt-lines tbody td { border-bottom: 1px dotted #ccc; }
body.dr-export .receipt-lines tbody td:nth-child(3) { white-space: pre-wrap; }
body.dr-export .receipt-lines tbody td:not(:nth-child(3)), body.dr-export .receipt-lines tfoot td { text-align: right; font-variant-numeric: tabular-nums; }
body.dr-export .receipt-lines .empty-items { color: #144b74; text-align: right; }
body.dr-export .receipt-lines tfoot { display: table-row-group; break-inside: avoid; }
body.dr-export .receipt-lines tfoot td { font-weight: 700; }
body.dr-export .bond-row td:last-child { color: #cf2133; }
body.dr-export .grand-total-row td { border-top: 1px solid #111; color: #0b2a5b; }
body.dr-export thead { display: table-header-group; }body.dr-export tr { break-inside: avoid; }
body.dr-export .receipt-heading, body.dr-export .receipt-fields { break-inside: avoid; break-after: avoid; }
body.dr-export .export-help { padding: 14px; margin-bottom: 24px; background: #edf3ef; line-height: 1.6; }
body.dr-export button { padding: 8px 14px; cursor: pointer; }
@media print { body.dr-export { margin: 0; max-width: none; font-size: 9pt; } body.dr-export .export-help { display: none; } body.dr-export * { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

body.dr-export .receipt-fields col:nth-child(1) { width: 16%; }
body.dr-export .receipt-fields col:nth-child(2) { width: 47%; }
body.dr-export .receipt-fields col:nth-child(3) { width: 15%; }
body.dr-export .receipt-fields col:nth-child(4) { width: 22%; }
body.dr-export .receipt-lines col:nth-child(1), body.dr-export .receipt-lines col:nth-child(2) { width: 10%; }
body.dr-export .receipt-lines col:nth-child(3) { width: 40%; }
body.dr-export .receipt-lines col:nth-child(4), body.dr-export .receipt-lines col:nth-child(5) { width: 20%; }
body.dr-export { page: drReceipt; min-width: 0; }

/* Shared issuing-company header for operational report previews and printing. */
.company-report-header, body.dr-export .company-report-header {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid #263d34; color: #142e24;
  background: white; break-inside: avoid; break-after: avoid; font-family: Arial, sans-serif;
}
.company-report-header img, body.dr-export .company-report-header img { display: block; width: 48px; height: 48px; object-fit: contain; flex: 0 0 48px; }
.company-report-header div, body.dr-export .company-report-header div { min-width: 0; text-align: left; }
.company-report-header h2, body.dr-export .company-report-header h2 { margin: 0 0 3px; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.company-report-header p, body.dr-export .company-report-header p { margin: 2px 0 0; font-size: 11px; line-height: 1.25; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Keep operational exports compact without shrinking the application preview. */
body.dr-export .company-report-header { gap: 10px; padding: 6px 10px; }
body.dr-export .company-report-header img { width: 40px; height: 40px; flex-basis: 40px; }
.company-header-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: white; }
.company-header-preview > p { padding: 16px; color: var(--muted); }
.company-logo-editor { padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.company-logo-editor input { max-width: 100%; }
.company-logo-editor p, #company-profile-status { font-size: 13px; line-height: 1.5; }
.company-logo-editor button { margin-top: 10px; }
body.dr-export .report-content { padding: 14px; }
body.dr-export .report-content .record-summary { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 12px 0; }
body.dr-export .report-content .record-summary b { white-space: pre-wrap; overflow-wrap: anywhere; }
body.dr-export .report-content table th, body.dr-export .report-content table td { border: 1px solid #333; }
body.dr-export .report-content .review-table { overflow: visible; }

/* Sales: compact document journey, readable line entry and shared reports. */
.sales-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.sales-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:20px 0; }
.sales-metrics article { background:white; border:1px solid var(--line); border-radius:14px; padding:18px; }
.sales-metrics span,.sales-table small { display:block; color:var(--muted); font-size:12px; margin-top:5px; }
.sales-metrics strong { display:block; font-size:24px; margin-top:8px; font-variant-numeric:tabular-nums; }
.sales-stages { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:24px 0; }
.sales-stages button { display:flex; align-items:center; justify-content:flex-start; gap:10px; padding:14px; border:1px solid var(--line); border-radius:10px; background:white; color:var(--ink); }
.sales-stages button[aria-pressed="true"] { background:#103f35; color:#fff; border-color:#103f35; }
.sales-stages button span { width:24px; height:24px; border-radius:50%; background:#f3e7c7; color:#103f35; display:grid; place-items:center; flex-shrink:0; }
.sales-stages small { margin-left:auto; }
.sales-filters { display:grid; grid-template-columns:minmax(200px,2fr) repeat(3,minmax(130px,1fr)); gap:12px; margin-bottom:18px; }
.sales-filters label,.sales-editor label { display:grid; gap:8px; font-size:12px; font-weight:600; }
.sales-table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:white; }
.sales-table { width:100%; border-collapse:collapse; }
.sales-table th,.sales-table td { padding:14px; vertical-align:middle; }
.sales-link { border:0; padding:0; background:transparent; color:#11634d; text-align:left; font-weight:650; text-decoration:underline; text-underline-offset:3px; }
.sales-badge { display:inline-block; padding:5px 10px; border-radius:20px; background:#edf3ef; font-size:12px; white-space:nowrap; }
.sales-empty { padding:45px 20px; text-align:center; background:white; border:1px solid var(--line); border-radius:14px; }
.sales-help { margin-top:22px; font-size:13px; color:var(--muted); }
.sales-help summary,.sales-editor summary { cursor:pointer; }
.sales-editor { display:grid; gap:18px; }
.sales-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.sales-editor textarea { min-height:70px; resize:vertical; }
.sale-entry-line { display:grid; grid-template-columns:minmax(190px,2.5fr) minmax(75px,1fr) minmax(90px,1fr) auto; align-items:start; gap:10px; padding:14px; border:1px solid var(--line); border-radius:12px; margin-bottom:10px; }
.sale-entry-line button { align-self:center; }
.sale-entry-line small { font-weight:400; color:var(--muted); }
.sales-total { text-align:right; font-weight:700; font-size:18px; }
.sales-lineage { display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:12px; margin:12px 0 18px; }
.sales-document-actions { justify-content:flex-start; margin-bottom:18px; }
.sales-report .record-summary { display:grid; grid-template-columns:140px 1fr; gap:8px 14px; }
.sales-report dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.sales-report dt { color:var(--muted); font-size:12px; }
.sales-note { white-space:pre-wrap; overflow-wrap:anywhere; }
.sales-error { color:#9a3027; font-size:14px; }
.sales-error:empty,#sales-status:empty { display:none; }
.sales-notice { padding:12px; background:#f7f3e9; color:#625238; border-radius:8px; font-size:12px; }
#sales-pos button:focus-visible,.sales-editor button:focus-visible { outline:2px solid #11634d; outline-offset:3px; }
body.dr-export .sales-table-wrap { overflow:visible; }
body.dr-export .sales-report .record-summary { grid-template-columns:120px 1fr; }
body.dr-export .sales-report th,body.dr-export .sales-report td { border:1px solid #333; padding:5px; }
body.dr-export .sales-report small { display:block; font-size:8pt; color:#53645b; }
body.dr-export .sales-report { color:#142e24; font-family:Arial,sans-serif; }
@media(max-width:1000px) { .sales-stages { grid-template-columns:repeat(3,minmax(0,1fr)); } .sales-metrics,.sales-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .sales-stages,.sales-form-grid,.sales-filters { grid-template-columns:1fr; } .sale-entry-line { grid-template-columns:1fr 1fr; } .sale-item-label { grid-column:1/-1; } .sales-form-grid .span-2 { grid-column:auto; } .sales-table { min-width:620px; } .sales-metrics strong { font-size:18px; } }
.sales-editor button { padding:8px 12px; border:1px solid var(--line); border-radius:8px; background:white; color:var(--ink); font:inherit; cursor:pointer; }
.sales-editor button:hover { background:#edf3ef; }

/* Shared Inventory catalogue setup within Sales quotations. */
.sales-master-summary { color: var(--muted, #62736b); font-size: 13px; margin: 0 0 12px; }
.sales-master-items { list-style: none; padding: 0; }
.sales-master-items li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #dce4dc; }
.sales-master-items small { display: block; margin-top: 4px; }
.sales-master-items button { flex-shrink: 0; }
@media(max-width:600px) { .sales-master-items li { align-items: flex-start; flex-direction: column; } }

/* Core ERP modules share a workspace, with Inventory retaining its own menu. */
body[data-system="erp"] .grouped-nav [data-nav-group="inventory-root"] { display: flex; }
body[data-system="erp"] .grouped-nav [data-nav-submenu="inventory-root"] { display: none; margin-left: 12px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.1); }
body[data-system="erp"] .grouped-nav [data-nav-submenu="inventory-root"].is-open { display: block; }

/* Accounting: everyday work first, supporting tools on demand. */
.ar-register-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ar-register-heading h3 { margin: 0 0 6px; }
.ar-register-heading p { margin: 0; font-size: 13px; color: var(--muted); }
.ar-register-filters { display: grid; grid-template-columns: minmax(210px, 1.5fr) repeat(3,minmax(140px,1fr)); gap: 12px; align-items: end; }
.ar-register-filters label { min-width: 0; }
.ar-register-filters :is(input,select) { width: 100%; min-width: 0; }
.ar-register-filters button { justify-self: start; }
.ar-register-table { overflow-x: auto; }
.ar-register-table table { min-width: 940px; }
.ar-register-table small { display: block; color: var(--muted); margin-top: 5px; }
.ar-register-table .ar-document-link { padding: 0; border: 0; background: transparent; color: var(--teal); text-align: left; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ar-register-amount { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
#ar-register-error:empty { display: none; }
#ar-register-error { color: #a33421; }
@media(max-width:1100px) { .ar-register-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .ar-register-filters { grid-template-columns: minmax(0,1fr); } }
.accounting-navigation { margin-bottom: 20px; }
.accounting-primary, .financial-report-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.accounting-primary .chip { padding: 11px 16px; }
.accounting-more { margin-top: 12px; }
.accounting-more > summary, .receipt-extra > summary, .financial-overview > summary { cursor: pointer; color: var(--muted); padding: 10px 0; font-size: 13px; }
.accounting-more > summary:focus-visible, .receipt-extra > summary:focus-visible, .financial-overview > summary:focus-visible { outline: 2px solid var(--accent, #126650); outline-offset: 3px; }
#accounting-tool-context { color: var(--ink); font-weight: 600; }
.accounting-more .accounting-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: start; gap: 12px; margin: 6px 0 0; }
.accounting-more .accounting-tab-group { min-height: 0; box-shadow: none; }
.accounting-more .accounting-tab-row { display: flex; flex-wrap: wrap; }
.financial-reports { display: block; }
.report-intro h3, .report-heading h3 { margin: 0; }
.report-intro p, .report-heading p, .report-unavailable p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.financial-report-picker { margin: 16px 0 8px; }
.financial-report-panel { margin-top: 12px; width: 100%; overflow-x: auto; }
.financial-report-panel[hidden], #receipt-bank-fields[hidden], #receipt-check-fields[hidden] { display: none !important; }
.report-heading, .report-unavailable { padding: 18px; }
.financial-overview .metric-grid { margin: 10px 0; }
.receipt-field-section { margin: 20px 0; }
.receipt-field-section h4 { margin: 0 0 12px; font-size: 14px; }
.ar-receipt-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ar-receipt-fields > label { min-width: 0; }
.ar-receipt-fields input, .ar-receipt-fields select, .ar-receipt-fields textarea { width: 100%; min-width: 0; }
.receipt-extra { border-top: 1px solid var(--line); padding: 2px 0; }
.receipt-extra > summary { font-weight: 600; color: var(--ink); }
.receipt-extra .ar-receipt-fields { padding: 10px 0 16px; }
.receipt-overview { margin: 0 0 16px; }
.receipt-overview > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 8px 0; }
.receipt-overview .ar-receipt-metrics { margin-top: 10px; }
.ar-receipt-toolbar [data-ar-receipt-command="get-soa"] { min-width: 150px; }
.ar-document-panel { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.ar-document-tabs, .ar-receipt-tabs { flex-wrap: wrap; }
.ar-receipt-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, .38fr); }
.ar-receipt-form, .ar-receipt-summary { min-width: 0; }
.ar-receipt-toolbar { flex-wrap: wrap; }
.ar-receipt-toolbar .split-actions { flex-wrap: wrap; min-width: 0; }
.ar-receipt-toolbar select { min-width: 0; max-width: 100%; }
.ar-receipt-fields .span-2 { grid-column: 1 / -1; }
@media (max-width: 1150px) { .ar-receipt-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1200px) {
  .ar-receipt-layout { grid-template-columns: minmax(0, 1fr); }
  .ar-receipt-form .ap-voucher-status-strip { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .receipt-overview .ar-receipt-metrics { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (max-width: 650px) {
  .ar-receipt-fields { grid-template-columns: minmax(0, 1fr); }
  .accounting-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-primary .chip { white-space: normal; }
  .accounting-more .accounting-tabs { grid-template-columns: minmax(0, 1fr); }
}

/* Account catalogue: compact filters, grouped rows, optional guidance. */
.account-chart-filters { display:grid; grid-template-columns:2fr 1fr 1fr; gap:14px; margin-bottom:12px; }
.account-chart-filters label { display:grid; gap:6px; min-width:0; }
.account-chart-help { margin:12px 0; color:var(--muted, #63756d); }
.account-chart-help summary { cursor:pointer; padding:6px 0; }
.account-chart-help p, .account-chart-help li { line-height:1.6; }
.account-chart-help .table-scroll { max-height:320px; overflow:auto; margin:10px 0; }
.account-chart-group th { background:#e9f1ed; color:#164d3f; padding:10px 14px; text-align:left; }
@media(max-width:700px) { .account-chart-filters { grid-template-columns:1fr; } }

.accounting-panel[data-accounting-panel="chart"] > .section-heading { padding:20px 20px 0; }
.accounting-panel[data-accounting-panel="chart"] > .account-chart-filters { margin:14px 20px; }
.accounting-panel[data-accounting-panel="chart"] > #account-chart-count,
.accounting-panel[data-accounting-panel="chart"] > .account-chart-help { margin-left:20px; margin-right:20px; }
/* Source reviews reuse Accounting controls while keeping the worklist compact. */
.connected-filters { display:grid; grid-template-columns:2fr 1fr 1fr; gap:14px; margin:20px 0; }
.connected-help { margin:12px 0; color:var(--muted, #62706b); }
#connected-body small { display:block; font-size:12px; margin-top:5px; }
.accounting-panel[data-accounting-panel="connected"] > .section-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.accounting-panel[data-accounting-panel="connected"] .table-wrap { overflow-x:auto; background:#fff; border:1px solid var(--line); border-radius:12px; }
#connected-body .text-button { padding:0; border:0; background:transparent; color:var(--teal-dark); text-align:left; font:inherit; font-weight:700; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
#connected-body td { padding:14px 16px; }
#connected-dialog { width:min(900px, calc(100vw - 32px)); max-height:90vh; box-sizing:border-box; padding:24px; border:1px solid #d8ded7; border-radius:18px; color:#243b32; background:#fffefa; }
#connected-dialog::backdrop { background:rgba(8,37,29,.5); }
#connected-dialog fieldset { border:0; padding:0; margin:16px 0; min-width:0; }
#connected-dialog .connected-valuation { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:16px; border:1px solid #d8ded7; border-radius:12px; }
#connected-dialog label,.connected-filters label { display:grid; gap:8px; }
#connected-dialog input,#connected-dialog select,#connected-dialog textarea,.connected-filters input,.connected-filters select { width:100%; min-width:0; box-sizing:border-box; padding:12px; border:1px solid #d8ded7; border-radius:9px; background:white; color:inherit; }
#connected-dialog .connected-confirm { display:flex; align-items:flex-start; gap:10px; margin:16px 0; text-transform:none; }
#connected-dialog .connected-confirm input { width:18px; height:18px; flex-shrink:0; }
.connected-actions { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin-top:16px; }
#connected-error { color:#a43322; }
#connected-dialog [hidden] { display:none!important; }
@media(max-width:700px) { .connected-filters,#connected-dialog .connected-valuation { grid-template-columns:1fr; } #connected-dialog { padding:16px; } }

.financial-period-bar { margin: 18px 0; align-items: end; grid-template-columns: minmax(140px,1fr) minmax(140px,1fr) auto auto; }
.financial-table-scroll { overflow-x: auto; max-width: 100%; }
.financial-table-scroll td { white-space: normal; overflow-wrap: anywhere; }
.financial-checks { padding: 12px; background: #fff4df; border-radius: 10px; margin-bottom: 16px; }
#cashflow-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
#cashflow-dialog::backdrop { background: #123b3166; }
#cashflow-dialog label { display: grid; gap: 6px; }
#cashflow-error { color: #a62b20; }
@media(max-width: 640px) { .financial-period-bar { grid-template-columns: 1fr 1fr; } .financial-period-bar button { width: 100%; } }

/* Rental renewals use the existing modal and document controls. */
.rental-row-actions, .renewal-draft-actions { display:flex; flex-wrap:wrap; gap:8px; }
.rental-row-actions button { width:auto; white-space:nowrap; }
.renewal-intro { color:var(--muted); font-size:13px; line-height:1.5; }
.renewal-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:16px 0; }
.renewal-lines { overflow:auto; }
.renewal-draft-actions button { width:auto; white-space:nowrap; padding:10px 14px; }
.renewal-draft-actions { margin-top:12px; }
.renewal-lines input { min-width:90px; max-width:150px; }
.renewal-lines small { display:block; white-space:normal; font-size:11px; margin-top:4px; }
.renewal-total { text-align:right; font-weight:700; }
.renewal-agreement { display:flex; align-items:flex-start; gap:10px; margin-top:16px; text-transform:none; }
.renewal-agreement input { width:18px; min-height:18px; flex-shrink:0; }
#renewal-error { color:#b42318; font-size:13px; }
@media(max-width:650px) { .renewal-fields { grid-template-columns:minmax(0,1fr); } }
/* Vehicle operations: responsive toolbars and compact financial tables. */
.delivery-tabs,.delivery-toolbar,.delivery-filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:18px 0}
.delivery-toolbar{justify-content:space-between}
.delivery-toolbar p{flex:1;min-width:220px;margin:0}
.delivery-filters{align-items:flex-end}
.delivery-filters label{flex:1;min-width:160px}
#delivery-workspace .review-table{overflow-x:auto}
#delivery-workspace table small{display:block;color:var(--muted,#60716a);font-size:12px;margin-top:4px}
#delivery-workspace td{vertical-align:middle}
#delivery-workspace td:last-child .mini-button{margin:3px}
.delivery-number{text-align:right;white-space:nowrap}
.delivery-check{display:flex;gap:10px;align-items:center;margin:16px 0}
.delivery-check input{width:18px;flex:none}
#delivery-form details{margin-bottom:16px}
#delivery-form-error{color:#a1271d;margin-top:12px}
#delivery-form .form-grid{margin-bottom:16px}
#delivery-workspace .mini-button{width:auto;min-height:38px;padding:8px 12px;white-space:nowrap;flex-shrink:0}

/* Connected-record review: readable source guidance and balanced entry totals. */
#connected-dialog > .section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
#connected-dialog > .section-heading h2,#connected-dialog > .section-heading p { margin:0 0 6px; }
#connected-dialog #connected-close { flex-shrink:0; }
#connected-dialog .connected-confirm { align-items:flex-start; line-height:1.5; }
#connected-dialog .connected-confirm input { margin:2px 0 0; padding:0; }
#connected-gl table { width:100%; border-collapse:collapse; }
#connected-gl td:nth-child(n+2),#connected-gl th:nth-child(n+2) { text-align:right; white-space:nowrap; }
#connected-gl tfoot { font-weight:700; border-top:2px solid #b9c9c0; background:#f1f6f2; }
#connected-gl tfoot th,#connected-gl tfoot td { padding:12px 16px; }
#connected-gl .connected-balance { margin:10px 0 0; font-size:13px; }

/* POS entry page: scoped to keep other ERP modules unchanged. */
#point-of-sale .pos-launchpad{max-width:1420px;margin:0 auto;color:#213d32}
#point-of-sale .pos-launch-hero{display:grid;grid-template-columns:1.1fr 1fr;gap:52px;align-items:center;padding:48px;border:1px solid #d8e2d7;border-radius:22px;background:linear-gradient(120deg,#113f32 0%,#174e3e 54%,#205844 100%);box-shadow:0 12px 32px #173e3210;overflow:hidden}
#point-of-sale .pos-launch-kicker{color:#e6cd95;font-size:11px;letter-spacing:.16em;font-weight:750;margin:0 0 20px}
#point-of-sale #point-of-sale-title{font-size:clamp(30px,3vw,44px);line-height:1.15;letter-spacing:-1.2px;color:#fffef8;margin:0 0 20px;font-weight:750}
#point-of-sale .pos-launch-intro{font-size:15px;line-height:1.75;color:#dae8dc;max-width:440px;margin:0 0 26px}
#point-of-sale .pos-launch-actions{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
#point-of-sale .pos-launch-open{display:inline-flex;align-items:center;justify-content:space-between;gap:30px;min-height:50px;padding:12px 22px;border:1px solid #ebd9af;border-radius:10px;background:#efdeb5;color:#173d2f;text-decoration:none;font-weight:750;box-shadow:0 5px 16px #001c2520;transition:background .15s,transform .15s}
#point-of-sale .pos-launch-open:hover{background:#fff0c9;transform:translateY(-1px)}
#point-of-sale .pos-launch-open:focus-visible{outline:3px solid #fff;outline-offset:4px}
#point-of-sale .pos-launch-actions>span{font-size:12px;color:#d5e4d7}
#point-of-sale .pos-launch-caption{font-size:11px;color:#bdd0c1;margin:14px 0 0}
#point-of-sale .pos-launch-flow{background:#fffef9;border:1px solid #e6ebdf;border-radius:16px;padding:24px;box-shadow:0 12px 30px #03281f20;min-width:0}
#point-of-sale .pos-flow-heading{display:flex;align-items:center;gap:14px;padding-bottom:20px;border-bottom:1px solid #e5e8de;margin-bottom:4px}
#point-of-sale .pos-launch-symbol{display:grid;place-items:center;background:#eaf0e3;border-radius:12px;width:52px;height:52px;flex-shrink:0;color:#34614b}
#point-of-sale .pos-launch-symbol svg{width:35px;height:35px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#point-of-sale .pos-flow-heading strong{display:block;font-size:19px}
#point-of-sale .pos-flow-heading div>span{display:block;font-size:12px;color:#6b7c6e;margin-top:4px}
#point-of-sale .pos-flow-row{display:flex;align-items:center;gap:12px;padding:17px 0;border-bottom:1px solid #e9ece4}
#point-of-sale .pos-flow-number{display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:#f0eadb;color:#887345;font-size:11px;font-weight:750;flex-shrink:0}
#point-of-sale .pos-flow-row strong{font-size:13px}#point-of-sale .pos-flow-row p{font-size:11px;color:#6b7c6e;margin:4px 0 0;line-height:1.5}
#point-of-sale .pos-flow-source{margin-left:auto;font-size:10px;font-weight:650;border:1px solid #dce5d6;background:#eff4e9;border-radius:6px;padding:5px 8px;color:#507249;white-space:nowrap}
#point-of-sale .pos-flow-footnote{font-size:11px;color:#687a6c;line-height:1.6;margin:16px 0 0}
#point-of-sale .pos-launch-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin:30px 0 16px}
#point-of-sale .pos-launch-section-head h3{font-size:18px;margin:0;letter-spacing:-.3px}
#point-of-sale .pos-launch-section-head p{font-size:12px;color:#687a6b;margin:0}
#point-of-sale .pos-launch-features{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
#point-of-sale .pos-launch-features article{padding:24px;background:#fffefb;border:1px solid #e0e5db;border-radius:14px}
#point-of-sale .pos-feature-icon{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#eaf0e4;color:#5f7951;font-size:11px;font-weight:750;margin-bottom:16px}
#point-of-sale .pos-launch-features h3{font-size:16px;margin:0 0 9px}
#point-of-sale .pos-launch-features p{font-size:13px;color:#65796b;line-height:1.7;margin:0}
#point-of-sale .pos-launch-help{display:flex;align-items:center;justify-content:space-between;gap:24px;background:#eeefe6;border:1px solid #e0e3d5;border-radius:12px;padding:20px 24px;margin-top:22px}
#point-of-sale .pos-launch-help h3{font-size:14px;margin:0 0 6px}
#point-of-sale .pos-launch-help p{font-size:12px;color:#607461;line-height:1.6;margin:0}
#point-of-sale .pos-launch-help button{flex-shrink:0;font-size:12px;background:#fffef9}
@media(max-width:1200px){#point-of-sale .pos-launch-hero{padding:32px;gap:28px}#point-of-sale .pos-flow-source{display:none}}
@media(max-width:950px){#point-of-sale .pos-launch-hero{grid-template-columns:1fr;padding:28px;gap:28px}#point-of-sale .pos-launch-intro{max-width:600px}#point-of-sale .pos-flow-source{display:block}#point-of-sale .pos-launch-features{grid-template-columns:1fr}#point-of-sale .pos-launch-features article{padding:20px}#point-of-sale .pos-feature-icon{float:left;margin:0 16px 45px 0}#point-of-sale .pos-launch-section-head{display:block}#point-of-sale .pos-launch-section-head p{margin-top:6px}}
@media(max-width:550px){#point-of-sale .pos-launch-hero{padding:24px 20px;border-radius:16px}#point-of-sale .pos-launch-flow{padding:18px}#point-of-sale .pos-flow-source{display:none}#point-of-sale .pos-launch-actions{gap:14px}#point-of-sale .pos-launch-help{align-items:flex-start;flex-direction:column;padding:20px;gap:16px}#point-of-sale .pos-launch-kicker{font-size:10px}#point-of-sale .pos-launch-intro{font-size:14px}#point-of-sale .pos-launch-features p{font-size:12px}}

/* Keep the product mark crisp in the sidebar and preserve the home button. */
@media screen {
  .sidebar .brand-mark { overflow: hidden; background: #103f35; border-color: rgba(247, 245, 234, .18); }
  .sidebar .brand-mark img { display: block; border-radius: inherit; }
}
