:root {
  --bg: #efe8df;
  --paper: #fffaf4;
  --paper-2: #ffffff;
  --nav: #18304d;
  --nav-2: #24486f;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e8d8c7;
  --accent: #c56b2d;
  --accent-2: #e8b37d;
  --green: #1f8a70;
  --amber: #d98e04;
  --red: #ba3a2f;
  --shadow: 0 18px 44px rgba(24, 48, 77, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(197, 107, 45, 0.14), transparent 22%),
    linear-gradient(135deg, #f7f1ea, #eee4d8 45%, #f5eee6);
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  font-weight: 800;
}

body.page-loaded {
  opacity: 1;
}

body.page-navigating {
  opacity: 0.35;
}

body.nav-open {
  overflow: hidden;
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #07111f;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease-in-out;
}

.auth-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 42px);
  overflow: hidden;
}

.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(8, 17, 31, 0.42), rgba(8, 17, 31, 0.58)),
    url("assets/Sign-in-Background-Image.jpg") center center / cover no-repeat;
}

.auth-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 185, 136, 0.14), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.07), transparent 18%);
  backdrop-filter: blur(2px);
}

.auth-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: calc(100dvh - clamp(32px, 8vw, 84px));
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-visual {
  display: none;
}

.auth-visual-glow {
  display: none;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 480px);
  min-height: 0;
  padding: 0;
  background: transparent;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 500px;
  padding: 46px 34px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 250, 244, 0.12);
  box-shadow: 0 26px 60px rgba(5, 10, 20, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-card:hover {
  border-color: rgba(255, 214, 183, 0.4);
  box-shadow: 0 30px 70px rgba(5, 10, 20, 0.34);
}

.auth-brand {
  margin-bottom: 34px;
  text-align: center;
}

.auth-brand strong {
  display: block;
  margin-bottom: 0;
  color: #ffffff;
  font-size: 36px;
  line-height: 1.05;
}

.app {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
}

body.page-loaded .main,
body.page-loaded .auth-shell {
  transform: translateY(0);
  opacity: 1;
}

body.page-navigating .main,
body.page-navigating .auth-shell {
  transform: translateY(-8px);
  opacity: 0;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 290px;
  height: 100vh;
  padding: 26px 20px;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  color: #f8f5f0;
  overflow-y: auto;
  z-index: 20;
  transition: width 0.22s ease, padding 0.22s ease, transform 0.25s ease;
}

.mobile-topbar,
.sidebar-mobile-head,
.nav-overlay {
  display: none;
}

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-toggle,
.nav-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.sidebar-mobile-head {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-collapse {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.sidebar-collapse:hover,
.sidebar-collapse:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.sidebar-collapse svg,
.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand p,
.sidebar small {
  color: rgba(248, 245, 240, 0.74);
  line-height: 1.5;
}

.nav {
  display: grid;
  gap: 10px;
  margin: 20px 0 26px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-decoration: none;
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.18s ease, color 0.18s ease, padding 0.22s ease;
}

.nav-dropdown {
  display: grid;
  gap: 6px;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  background: linear-gradient(135deg, rgba(197, 107, 45, 0.95), rgba(232, 179, 125, 0.45));
  color: #1a1a1a;
}

.nav-dropdown-chevron {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-dropdown-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-dropdown-toggle:hover .nav-dropdown-chevron,
.nav-dropdown.open .nav-dropdown-chevron {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.22);
}

.nav-dropdown-toggle .nav-label { white-space: nowrap; flex: 1 1 auto; }

.nav-dropdown.open .nav-dropdown-chevron { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  gap: 6px;
  padding-left: 18px;
}

.nav-dropdown.open .nav-dropdown-menu { display: grid; }
.nav-dropdown-menu a { min-height: 42px; padding: 9px 12px; font-size: 13px; }

.sidebar.collapsed .nav-dropdown-toggle { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-dropdown-toggle .nav-label,
.sidebar.collapsed .nav-dropdown-chevron { display: none; }
.sidebar.collapsed .nav-dropdown-menu { padding-left: 0; }

.nav a[hidden] {
  display: none !important;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav a.active,
.nav a:hover,
.nav a:focus {
  background: linear-gradient(135deg, rgba(197, 107, 45, 0.95), rgba(232, 179, 125, 0.45));
  color: #1a1a1a;
}

.tip {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tip [data-software-signout] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  white-space: nowrap;
}

.main {
  padding: 28px;
  min-width: 0;
  margin-left: 290px;
  transition: margin-left 0.22s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease-in-out;
  transform: translateY(8px);
  opacity: 0;
}

.sidebar.collapsed {
  width: 84px;
  padding: 22px 12px;
}

.sidebar.collapsed .brand {
  flex-direction: column;
  gap: 10px;
}

.sidebar.collapsed .brand h1 {
  width: 44px;
  font-size: 0;
  text-align: center;
}

.sidebar.collapsed .brand h1::before {
  content: "GT";
  font-size: 18px;
  letter-spacing: 0;
}

.sidebar.collapsed .nav {
  gap: 8px;
}

.sidebar.collapsed .nav a {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .tip {
  padding: 0;
  border: 0;
  background: transparent;
}

.sidebar.collapsed .tip .actions {
  justify-content: center;
}

.sidebar.collapsed .tip [data-software-signout] {
  width: 48px;
  min-width: 48px;
  height: 44px;
  padding: 0;
}

body.sidebar-collapsed .main {
  margin-left: 84px;
}

.hero,
.screen {
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.97), rgba(252, 241, 227, 0.96));
}

.hero h2 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.1;
  max-width: 840px;
  color: #18304d;
  font-weight: 800;
}

.hero p {
  margin: 0;
  color: #6c7f94;
  max-width: 780px;
}

.dashboard-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: visible;
}

.dashboard-hero h2 {
  margin-bottom: 0;
}

.notification-center {
  position: relative;
  flex: 0 0 auto;
}

.notification-trigger,
.notification-close {
  display: inline-grid;
  place-items: center;
  border: 1px solid #d8bfa8;
  background: #fffaf4;
  color: #173a5e;
  cursor: pointer;
}

.notification-trigger {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(31, 61, 91, 0.1);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.notification-trigger:hover,
.notification-trigger[aria-expanded="true"] {
  transform: translateY(-2px);
  border-color: #c96a28;
  background: #fff3e7;
}

.notification-trigger:focus-visible,
.notification-close:focus-visible {
  outline: 3px solid rgba(201, 106, 40, 0.25);
  outline-offset: 2px;
}

.notification-trigger svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fffaf4;
  border-radius: 10px;
  background: #c9362b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 12px);
  right: 0;
  width: min(430px, calc(100vw - 48px));
  max-height: 440px;
  overflow: hidden;
  border: 1px solid rgba(216, 191, 168, 0.6);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(21, 45, 69, 0.25);
  transform-origin: top right;
}

.notification-panel:not([hidden]) {
  display: block;
  animation: slideDownFade 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #ead8c7;
  background: linear-gradient(135deg, #173a5e, #1f466b);
  color: #fff;
  box-shadow: 0 2px 10px rgba(23, 58, 94, 0.12);
}

.notification-panel-head strong,
.notification-panel-head span {
  display: block;
}

.notification-panel-head strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.notification-panel-head span {
  margin-top: 3px;
  color: #dbe8f3;
  font-size: 12px;
}

.notification-close {
  width: 28px;
  height: 28px;
  border-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(90deg);
}

.notification-list {
  max-height: 360px;
  padding: 8px;
  overflow-y: auto;
  background: #f8f3ed;
}

.payment-notification {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(227, 199, 174, 0.2);
  border-radius: 10px;
  background: #fffcf9;
  color: #173a5e;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(181, 150, 122, 0.05);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.payment-notification+.payment-notification {
  margin-top: 6px;
}

.payment-notification:hover {
  transform: translateX(4px);
  border-color: #c96a28;
  background: #fff;
  box-shadow: 0 6px 16px rgba(201, 106, 40, 0.12);
}

.payment-notification-icon {
  display: grid;
  place-items: center;
  align-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fcece9, #f9e5df);
  border: 1px solid rgba(178, 47, 39, 0.12);
  color: #b22f27;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(178, 47, 39, 0.05);
  transition: transform 0.2s ease, background 0.2s ease;
}

.payment-notification:hover .payment-notification-icon {
  transform: scale(1.06);
  background: linear-gradient(135deg, #f9dfda, #f3ccc3);
}

.payment-notification .payment-notification-icon {
  display: grid;
}

.payment-notification-icon strong,
.payment-notification-icon small {
  display: block;
}

.payment-notification-icon strong {
  font-size: 15px;
  font-weight: 800;
}

.payment-notification-icon small {
  margin-top: 3px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-notification-copy,
.payment-notification-title,
.payment-notification-meta,
.payment-notification-due {
  display: block;
  min-width: 0;
}

.payment-notification-title,
.payment-notification-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payment-notification-title strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-notification-title em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 9px;
  background: #f9e5df;
  color: #b22f27;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-notification-meta {
  margin-top: 6px;
  color: #667b8f;
  font-size: 12px;
}

.payment-notification-meta span:last-child {
  color: #173a5e;
  font-weight: 700;
  white-space: nowrap;
}

.payment-notification-due {
  margin-top: 5px;
  color: #9a4a28;
  font-size: 11px;
  font-weight: 600;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  color: #64748b;
  font-size: 13.5px;
  text-align: center;
}

.notification-empty svg {
  opacity: 0.65;
  color: #94a3b8;
  animation: bounceUpDown 3s ease-in-out infinite;
}

@keyframes bounceUpDown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.screen {
  padding: 22px;
  background: var(--paper);
}

.screen+.screen {
  margin-top: 22px;
}

.screen-head,
.toolbar,
.actions,
.filters,
.stat-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.screen-head {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.screen-head.compact {
  align-items: flex-start;
  margin-bottom: 14px;
}

.screen h3 {
  margin: 0 0 4px;
  font-size: 24px;
  color: #18304d;
  font-weight: 800;
}

.screen p,
.muted {
  color: #6c7f94;
}

.kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

body[data-page="ledger"] .hero .kicker {
  display: block;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 18px;
}

.btn,
.chip {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.btn.danger {
  background: #fff3f2;
  color: var(--red);
}

.btn.small {
  padding: 8px 12px;
  font-size: 13px;
}

.builty-form-actions,
.builty-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.builty-form-actions {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.builty-row-actions .btn {
  min-height: 36px;
}

.builty-row-actions {
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}

body[data-page="builty"] .table-wrap td:last-child {
  min-width: 190px;
  white-space: nowrap;
}

.builty-register-toolbar {
  align-items: center;
  flex-wrap: nowrap;
}

.builty-register-toolbar input {
  width: min(305px, 42vw);
}

.builty-register-toolbar .ledger-count {
  margin: 0;
}

@media (max-width: 680px) {
  .builty-register-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .builty-register-toolbar input {
    width: 100%;
    flex: 1 1 100%;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--paper-2) 0%, #f9ecde 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 2px 6px rgba(29, 51, 73, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.grid > .card:hover,
.grid > .card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(197, 107, 45, 0.48);
  box-shadow: 0 10px 22px rgba(70, 46, 26, 0.1);
}

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.card strong {
  display: block;
  font-size: 20px;
  color: var(--nav);
  margin: 4px 8px 2px;
}

.grid>.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.grid>.card>.badge {
  min-height: 28px;
}

.badge.neutral {
  background: rgba(35, 78, 116, 0.12);
  color: #214c73;
}

body[data-page="dashboard"] .screen:first-of-type {
  padding: 20px 22px 22px;
  border: 1px solid #d4dbe1;
  background: #f4f2ee;
  box-shadow: 0 10px 26px rgba(27, 48, 70, 0.08);
}

body[data-page="dashboard"] .screen:first-of-type>.screen-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #c97937;
}

body[data-page="dashboard"] .screen:first-of-type>.screen-head h3 {
  color: #173b5e;
  letter-spacing: 0;
}

.dashboard-kpi-groups {
  display: grid;
  gap: 18px;
}

.dashboard-kpi-group {
  --kpi-accent: #c47636;
  min-width: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid #cfd7de;
}

.dashboard-kpi-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-kpi-group h4 {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 11px;
  padding: 7px 12px;
  border-left: 0;
  border-bottom: 0;
  border-radius: 6px;
  background: #1d4165;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(25, 55, 84, 0.1);
}

.kpi-module-booking {
  --kpi-accent: #bf6b2d;
}

.kpi-module-truck {
  --kpi-accent: #345f83;
}

.kpi-module-equipment {
  --kpi-accent: #4d796f;
}

.kpi-module-receivable {
  --kpi-accent: #347463;
}

.kpi-module-payable {
  --kpi-accent: #9a574e;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-kpi-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 84px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #fffefd;
  box-shadow: 0 4px 12px rgba(29, 51, 73, 0.055);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

a.dashboard-kpi-card {
  color: inherit;
  text-decoration: none;
}

.booking-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.truck-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.equipment-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.accounts-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-kpi-card {
  min-height: 80px;
  padding: 10px 14px;
}

.compact-kpi-caption {
  display: block;
  margin-top: 3px;
  color: #6b7d8f;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-kpi-card.expiry-due {
  border-color: #e7bf7d;
  background: #fff3dc;
  box-shadow: 0 4px 12px rgba(166, 103, 14, 0.09);
}

.dashboard-kpi-card.expiry-expired {
  border-color: #e59c97;
  background: #fde9e7;
  box-shadow: 0 4px 12px rgba(166, 47, 41, 0.09);
}

.dashboard-kpi-card.expiry-due h5 {
  color: #9b650e;
}

.dashboard-kpi-card.expiry-expired h5,
.dashboard-kpi-card.expiry-expired .compact-kpi-caption {
  color: #a62f29;
}

.dashboard-kpi-card.financial-outstanding {
  border-color: #e7bf7d;
  background: #fff3dc;
  box-shadow: 0 4px 12px rgba(141, 87, 11, 0.09);
}

.dashboard-kpi-card.financial-outstanding h5 {
  color: #8d570b;
}

.dashboard-kpi-card:hover {
  transform: translateY(-3px);
  border-color: #9eafbe;
  box-shadow: 0 11px 22px rgba(24, 48, 77, 0.11);
}

.dashboard-kpi-card.expiry-due:hover,
.dashboard-kpi-card.financial-outstanding:hover {
  border-color: #cf8d27;
}

.dashboard-kpi-card.expiry-expired:hover {
  border-color: #ca5048;
}

a.dashboard-kpi-card:focus-visible {
  outline: 3px solid rgba(198, 105, 36, 0.28);
  outline-offset: 2px;
}

.dashboard-kpi-card strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--nav);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-kpi-card.currency strong {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap !important;
}

.dashboard-kpi-card h5 {
  margin: 0;
  color: #18304d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-height: 28px;
  display: flex;
  align-items: flex-start;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.dashboard-kpi-card .muted {
  font-size: 13px;
  line-height: 1.3;
}

.dashboard-kpi-card .badge {
  padding: 5px 8px;
  font-size: 10px;
}

.compact-kpi-card strong {
  margin-top: 4px;
  font-size: 20px;
  white-space: nowrap !important;
}

.compact-kpi-card.currency strong {
  margin-top: 4px;
  font-size: 16.5px;
  white-space: nowrap !important;
}

/* Small / Standard Laptops (1025px to 1366px, like 1366x768 and 1280x800) */
@media (max-width: 1366px) {
  .sidebar {
    width: 260px;
    padding: 18px 12px;
  }

  .main {
    margin-left: 260px;
    padding: 18px 20px;
  }

  body.sidebar-collapsed .main {
    margin-left: 84px;
  }

  .nav a {
    padding: 10px 12px;
    gap: 10px;
    font-size: 13.5px;
  }

  .hero {
    padding: 14px 20px;
    margin-bottom: 14px;
  }

  .hero h2 {
    font-size: 24px;
  }

  body[data-page="dashboard"] .screen:first-of-type {
    padding: 16px 18px 18px;
  }

  .dashboard-kpi-groups {
    gap: 14px;
  }

  .dashboard-kpi-group {
    padding-bottom: 12px;
  }

  .dashboard-kpi-group h4 {
    min-height: 30px;
    padding: 5px 11px;
    font-size: 11px;
    margin-bottom: 8px;
  }

  .dashboard-kpi-grid {
    gap: 10px;
  }

  .dashboard-kpi-card {
    min-height: 76px;
    padding: 9px 12px;
  }

  .compact-kpi-card {
    min-height: 74px;
    padding: 9px 12px;
  }

  .dashboard-kpi-card h5 {
    font-size: 10.5px;
    min-height: 26px;
  }

  .dashboard-kpi-card strong,
  .compact-kpi-card strong {
    font-size: 18.5px;
    white-space: nowrap !important;
  }

  .dashboard-kpi-card.currency strong,
  .compact-kpi-card.currency strong {
    font-size: 15px;
    letter-spacing: -0.015em;
    white-space: nowrap !important;
  }

  .compact-kpi-caption {
    font-size: 10px;
  }

  .accounts-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Two Pay Stats on laptop */
  .two-pay-stats {
    gap: 10px;
    margin-bottom: 14px;
  }

  .two-pay-stat-card {
    min-height: 78px;
    padding: 10px 14px;
  }

  .two-pay-stat-card strong {
    font-size: 18px;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Form grids on laptop */
  .form-grid {
    gap: 12px;
  }

  .field.quarter {
    grid-column: span 4;
  }
}

/* Tablets and medium screens (721px to 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    width: 235px;
    padding: 18px 12px;
  }

  .main {
    margin-left: 235px;
    padding: 16px;
  }

  body.sidebar-collapsed .main {
    margin-left: 84px;
  }

  .booking-kpi-grid,
  .truck-kpi-grid,
  .equipment-kpi-grid,
  .accounts-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-pay-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-pay-stats .span-3 {
    grid-column: span 1;
  }

  .field,
  .field.quarter {
    grid-column: span 6;
  }
}

/* Mobile screens (up to 720px) */
@media (max-width: 720px) {
  body[data-page="dashboard"] .screen:first-of-type {
    padding: 16px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-kpi-card {
    min-height: 74px;
    padding: 10px 12px;
  }

  .dashboard-kpi-card strong,
  .compact-kpi-card strong {
    margin-top: 6px;
    font-size: 18px;
  }

  .dashboard-kpi-card.currency strong,
  .compact-kpi-card.currency strong {
    font-size: 15px;
  }

  .booking-kpi-grid,
  .truck-kpi-grid,
  .equipment-kpi-grid,
  .accounts-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-kpi-card {
    min-height: 72px;
    padding: 9px 11px;
  }
}

@media (max-width: 480px) {
  .dashboard-kpi-grid,
  .booking-kpi-grid,
  .truck-kpi-grid,
  .equipment-kpi-grid,
  .accounts-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.good {
  background: rgba(31, 138, 112, 0.12);
  color: var(--green);
}

.warn {
  background: rgba(217, 142, 4, 0.14);
  color: var(--amber);
}

.bad {
  background: rgba(186, 58, 47, 0.12);
  color: var(--red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

body[data-page="truck"] .form-grid {
  container-type: inline-size;
}

.field {
  grid-column: span 4;
}

.field.quarter {
  grid-column: span 3;
}

.field.half {
  grid-column: span 6;
}

.field.wide {
  grid-column: span 6;
}

.field.full {
  grid-column: span 12;
}

.truck-financial-fields {
  grid-column: span 12;
  display: grid;
  grid-template-columns: minmax(155px, .88fr) repeat(6, minmax(135px, 1fr));
  gap: 14px;
  min-width: 0;
}

.truck-details-manager {
  grid-column: span 12;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.truck-detail-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line, #ead5c2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.truck-detail-section-head h3 {
  margin: 0 0 14px;
}

.truck-detail-section-head.has-remove-button {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.truck-detail-section-head .truck-detail-remove {
  flex: 0 0 auto;
}

.truck-details-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.truck-details-fields > .field,
.truck-details-fields > .field.quarter,
.truck-details-fields > .field.half,
.truck-details-fields > .field.wide {
  grid-column: span 1;
  min-width: 0;
}

.truck-details-fields > .field.full {
  grid-column: 1 / -1;
}

.truck-detail-add-row {
  display: flex;
  justify-content: flex-start;
}

.truck-detail-extra-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.truck-fuel-section {
  grid-column: span 12;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line, #ead5c2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.truck-fuel-section-head,
.truck-fuel-row-head,
.truck-fuel-totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.truck-fuel-section-head {
  margin-bottom: 14px;
}

.truck-fuel-section-head h3 {
  margin: 0 0 5px;
}

.truck-fuel-section-head p,
.truck-fuel-legacy-note {
  margin: 0;
  color: var(--muted, #60758d);
  font-size: 12px;
  line-height: 1.45;
}

.truck-fuel-refill-list {
  display: grid;
  gap: 10px;
}

.truck-fuel-refill-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line, #ead5c2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.truck-fuel-refill-row-legacy {
  border-style: dashed;
  background: rgba(2, 39, 99, 0.035);
}

.truck-fuel-refill-row-legacy input:disabled {
  color: var(--navy, #18304d);
  opacity: 1;
  background: rgba(255, 255, 255, 0.72);
}

.truck-fuel-row-head {
  margin-bottom: 10px;
  color: var(--navy, #18304d);
  font-size: 13px;
}

.truck-fuel-remove {
  flex: 0 0 auto;
}

.truck-fuel-row-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.truck-fuel-row-fields .field {
  grid-column: auto;
  min-width: 0;
}

.truck-fuel-totals {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted, #60758d);
  font-size: 13px;
}

.truck-fuel-totals strong {
  color: var(--navy, #18304d);
}

.truck-fuel-legacy-note {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(217, 142, 4, 0.1);
  color: #78500a;
}

body[data-page="truck"] .truck-trip-table .table-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 320px;
}

body[data-page="truck"] .truck-trip-table .table-actions .btn {
  width: auto;
  white-space: nowrap;
  flex: 0 0 auto;
  padding: 6px 9px;
  font-size: 11px;
}

body[data-page="truck"] .truck-trip-table tbody td {
  padding-top: 8px;
  padding-bottom: 8px;
}

body[data-page="truck"] .truck-trip-table tbody tr:not(.truck-trip-row-multiple) {
  background: #fffaf4;
}

body[data-page="truck"] .truck-trip-table tbody tr.truck-trip-row-multiple {
  background: #fff3e8;
}

body[data-page="truck"] .truck-trip-table tbody tr.truck-trip-row-multiple:hover {
  background: #ffe8d2;
}

@media (max-width: 900px) {
  .truck-details-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .truck-fuel-row-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .truck-details-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .truck-fuel-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .truck-fuel-row-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container (max-width: 1100px) {
  body[data-page="truck"] .truck-details-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-page="truck"] .truck-fuel-row-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-page="truck"] .truck-financial-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-page="truck"] .truck-financial-image {
    grid-column: span 2;
  }
}

@container (max-width: 850px) {
  body[data-page="truck"] .truck-details-fields,
  body[data-page="truck"] .truck-fuel-row-fields,
  body[data-page="truck"] .truck-financial-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 600px) {
  body[data-page="truck"] .truck-details-fields,
  body[data-page="truck"] .truck-fuel-row-fields,
  body[data-page="truck"] .truck-financial-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="truck"] .truck-financial-image {
    grid-column: auto;
  }

  body[data-page="truck"] .truck-fuel-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* The sidebar reduces usable width on laptops before the viewport reaches tablet breakpoints. */
@media (min-width: 1101px) and (max-width: 1366px) {
  .truck-financial-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.truck-financial-fields > .field {
  grid-column: auto;
  min-width: 0;
}

.truck-financial-image input[type="file"] {
  min-width: 0;
  padding: 5px 38px 5px 5px;
  font-size: 12px;
}

.truck-financial-image input[type="file"]::file-selector-button {
  margin-right: 6px;
  padding: 6px 9px;
}

@media (max-width: 1100px) {
  .truck-details-fields,
  .truck-fuel-row-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .truck-financial-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .truck-details-fields,
  .truck-fuel-row-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .truck-financial-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}

.required-star {
  color: var(--red);
  font-weight: 700;
  margin-left: 2px;
  display: inline-block;
  line-height: 1;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

input[type="file"] {
  min-height: 48px;
  padding: 6px;
  border-color: #d9b99c;
  background: #fffdf9;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  padding: 7px 14px;
  border: 1px solid #d79b68;
  border-radius: 8px;
  background: #fff3e7;
  color: #163a60;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

input[type="file"]:hover {
  border-color: #c96a28;
  background: #fff8f1;
}

input[type="file"]:hover::file-selector-button {
  background: #c96a28;
  color: #fff;
}

input[type="file"]:focus-visible {
  outline: 0;
  border-color: #c96a28;
  box-shadow: 0 0 0 3px rgba(201, 106, 40, 0.16);
}

.file-upload-control {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 48px;
}

.file-upload-control>input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-visual {
  display: grid;
  grid-template-columns: 36px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 14px 6px 7px;
  border: 1px solid #d9b99c;
  border-radius: 8px;
  background: #fffdf9;
  color: #173d63;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.file-upload-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #eef4f8;
  color: #173d63;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.file-upload-action {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.file-upload-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-control:hover .file-upload-visual,
.file-upload-control:focus-within .file-upload-visual {
  border-color: #cb661f;
  background: #fff8f1;
  box-shadow: 0 0 0 3px rgba(203, 102, 31, 0.1);
}

.file-upload-control:hover .file-upload-icon,
.file-upload-control:focus-within .file-upload-icon {
  background: #cb661f;
  color: #fff;
}

.file-upload-control.has-file .file-upload-visual {
  border-color: #7a9b91;
  background: #f7fbf9;
}

.file-upload-control.has-file .file-upload-icon {
  background: #e2f0eb;
  color: #087f6b;
}

.manual-number-input::-webkit-outer-spin-button,
.manual-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.manual-number-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

.date-input-group {
  position: relative;
}

.date-input-group input[name="date"] {
  padding-right: 54px;
}

.password-input-group {
  position: relative;
}

.password-input-group input {
  padding-right: 60px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 1px solid #edd7bf;
  border-radius: 14px;
  background: #fffaf4;
  color: var(--nav);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.password-toggle:hover {
  background: #fff2e2;
  transform: translateY(-50%) scale(1.02);
  box-shadow: 0 10px 18px rgba(197, 107, 45, 0.14);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle.inline {
  position: static;
  transform: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.password-display {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.password-display span {
  font-family: "Segoe UI", Tahoma, sans-serif;
  letter-spacing: 0.08em;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.access-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
  cursor: pointer;
}

.access-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.access-option span {
  font-size: 14px;
  font-weight: 600;
}

.admin-user-table-wrap {
  border-radius: 8px;
  background: #fffdf9;
}

.admin-user-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  font-size: 13px;
}

.admin-user-table col.admin-col-id {
  width: 76px;
}

.admin-user-table col.admin-col-name {
  width: 130px;
}

.admin-user-table col.admin-col-email {
  width: 190px;
}

.admin-user-table col.admin-col-password {
  width: 120px;
}

.admin-user-table col.admin-col-role {
  width: 100px;
}

.admin-user-table col.admin-col-status {
  width: 90px;
}

.admin-user-table col.admin-col-access {
  width: 300px;
}

.admin-user-table col.admin-col-actions {
  width: 130px;
}

.admin-user-table th {
  padding: 12px;
  color: #4d6075;
  background: #f6e9da;
  white-space: nowrap;
}

.admin-user-table td {
  height: 74px;
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #ead9c8;
}

.admin-user-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-user-table tbody tr:hover {
  background: #fff6ec;
}

.admin-access-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.admin-access-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #ead4bd;
  border-radius: 6px;
  color: #40536a;
  background: #fffaf4;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.admin-access-more {
  color: #7a5942;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-display-id {
  color: #173d62;
  font-size: 13px;
  white-space: nowrap;
}

.admin-email-cell {
  overflow-wrap: anywhere;
}

.admin-user-table .table-actions {
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}

.admin-user-table .table-actions .btn {
  min-width: 56px;
  padding-inline: 10px;
  white-space: nowrap;
}

.audit-screen {
  display: grid;
  gap: 18px;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.audit-stat {
  min-height: 88px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.audit-stat span {
  display: block;
  color: #617187;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.audit-stat strong {
  display: block;
  margin-top: 9px;
  color: var(--nav);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.audit-toolbar .field {
  grid-column: auto;
}

.audit-toolbar .record-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7ef;
  color: #5e4b3d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.audit-table-wrap {
  border-radius: 12px;
}

.audit-table {
  width: 100%;
  min-width: 1180px;
  table-layout: auto;
}

.audit-table th {
  background: #f5e6d5;
  color: #3d2d20;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 12px;
  vertical-align: middle;
}

.audit-table td {
  padding: 14px 12px;
  vertical-align: middle;
}

.audit-table tbody tr {
  transition: background-color 0.15s ease;
}

.audit-table tbody tr:hover {
  background: rgba(255, 248, 241, 0.78);
}

/* Distribute column widths proportionally to utilize full table width and space out columns nicely */
.audit-table th:nth-child(1) {
  width: 15%;
}

/* Date & Time */
.audit-table th:nth-child(2) {
  width: 18%;
}

/* User */
.audit-table th:nth-child(3) {
  width: 10%;
}

/* Role */
.audit-table th:nth-child(4) {
  width: 15%;
}

/* Module */
.audit-table th:nth-child(5) {
  width: 10%;
}

/* Action */
.audit-table th:nth-child(6) {
  width: 10%;
}

/* Record */
.audit-table th:nth-child(7) {
  width: 22%;
}

/* Details */

/* Align center for Role, Action, Record columns for balanced structure */
.audit-table th:nth-child(3),
.audit-table td:nth-child(3),
/* Role */
.audit-table th:nth-child(5),
.audit-table td:nth-child(5),
/* Action */
.audit-table th:nth-child(6),
.audit-table td:nth-child(6) {
  /* Record */
  text-align: center;
}

.audit-table td:nth-child(5) .badge {
  display: inline-flex;
  justify-content: center;
}

.audit-table td small {
  display: block;
  margin-top: 4px;
  color: #6b7a8c;
  font-size: 11px;
}

.audit-time {
  min-width: 150px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.audit-details {
  min-width: 260px;
  white-space: normal;
}

.empty-state {
  padding: 34px 16px;
  color: #6b7a8c;
  text-align: center;
}

.native-date-picker {
  position: absolute;
  inset: 0 0 0 auto;
  width: 52px;
  opacity: 0;
  cursor: pointer;
}

.date-picker-btn {
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  pointer-events: none;
}

.container-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.container-table-head,
.container-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.9fr) minmax(0, 1.1fr) minmax(80px, 0.7fr) minmax(100px, 0.9fr) minmax(80px, auto);
  gap: 12px;
  align-items: end;
}

.container-table-head {
  padding: 0 4px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.container-rows {
  display: grid;
  gap: 10px;
}

.container-row {
  padding: 14px;
  border: 1px solid rgba(213, 184, 150, 0.75);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(31, 43, 68, 0.04);
}

.container-row label {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.container-row .field-lite {
  min-width: 0;
}

.container-row .field-lite label {
  display: none;
}

.container-row .row-action {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}

.two-pay-container-block {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.two-pay-container-block::-webkit-scrollbar {
  height: 7px;
}

.two-pay-container-block::-webkit-scrollbar-track {
  background: rgba(24, 48, 77, 0.05);
  border-radius: 8px;
}

.two-pay-container-block::-webkit-scrollbar-thumb {
  background: #dfbea2;
  border-radius: 8px;
}

.two-pay-container-table-head,
.two-pay-container-row {
  min-width: 1120px;
  grid-template-columns: minmax(150px, 1.2fr) minmax(120px, 0.85fr) minmax(130px, 1fr) minmax(90px, 0.65fr) minmax(165px, 1.1fr) minmax(165px, 1.1fr) minmax(78px, 0.55fr);
}

.two-pay-container-rows {
  min-width: 1120px;
}

.two-pay-container-footer {
  min-width: 1120px;
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
  color: var(--muted);
  font-size: 12px;
}

.two-pay-container-footer strong {
  color: var(--ink);
}

[data-add-container-row] {
  margin-top: 14px;
}

.stacked-cell {
  display: grid;
  gap: 6px;
}

.stacked-cell span {
  display: block;
  padding: 7px 10px;
  border-radius: 12px;
  background: #fff8f1;
  border: 1px solid #f4e0ca;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.list {
  display: grid;
  gap: 12px;
}

.item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--nav);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #f1e2d3;
  overflow: hidden;
  margin-top: 8px;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--nav), var(--accent));
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff7ed;
  border: 1px solid #f4d6b7;
  color: #8a4b15;
}

.input-error {
  border-color: #ba3a2f !important;
  box-shadow: 0 0 0 3px rgba(186, 58, 47, 0.18) !important;
}

.table-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.table-actions .btn {
  flex-shrink: 0;
}

.ledger-filter {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.truck-ledger-head {
  display: block;
  margin-bottom: 12px;
  container-type: inline-size;
}

.truck-ledger-head h3 {
  margin-bottom: 10px;
}

.truck-ledger-filter {
  width: 100%;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
}

.truck-ledger-filter > * {
  min-width: 0;
}

.truck-ledger-filter .truck-ledger-search {
  min-width: 170px;
  max-width: 240px;
}

.truck-ledger-filter .ledger-filter-control input,
.truck-ledger-filter .ledger-filter-control select {
  width: 100%;
  height: 38px;
}

.truck-ledger-download,
.truck-ledger-filter .ledger-count {
  min-height: 38px;
  white-space: nowrap;
}

.truck-ledger-download {
  margin-left: auto;
}

@media (min-width: 1600px) {
  .truck-ledger-filter {
    display: grid;
    grid-template-columns: minmax(125px, .85fr) minmax(155px, 1.4fr) repeat(4, minmax(105px, .9fr)) minmax(185px, 1.4fr) auto auto;
    align-items: end;
  }

  .truck-ledger-filter .ledger-filter-control,
  .truck-ledger-filter .truck-ledger-search {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .truck-ledger-filter .ledger-total {
    min-width: 0;
  }

  .truck-ledger-filter .ledger-count,
  .truck-ledger-download {
    justify-self: end;
  }
}

@media (min-width: 1101px) and (max-width: 1366px) {
  .truck-ledger-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .truck-ledger-filter .ledger-total {
    min-width: 0;
  }

  .truck-ledger-filter .truck-ledger-search,
  .truck-ledger-filter .ledger-filter-control-job-order {
    grid-column: span 2;
  }

  .truck-ledger-filter .ledger-filter-control,
  .truck-ledger-filter .truck-ledger-search {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .truck-ledger-download {
    margin-left: 0;
  }
}

@media (max-width: 1100px) {
  .truck-ledger-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .truck-ledger-filter .ledger-total,
  .truck-ledger-filter .ledger-filter-control,
  .truck-ledger-filter .truck-ledger-search,
  .truck-ledger-filter .ledger-filter-control-job-order {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .truck-ledger-filter .truck-ledger-search,
  .truck-ledger-filter .ledger-filter-control-job-order {
    grid-column: span 2;
  }

  .truck-ledger-download {
    margin-left: 0;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .truck-ledger-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .truck-ledger-filter .truck-ledger-search,
  .truck-ledger-filter .ledger-filter-control-job-order {
    grid-column: auto;
  }
}

@container (max-width: 1100px) {
  .truck-ledger-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .truck-ledger-filter .ledger-total {
    min-width: 0;
  }

  .truck-ledger-filter .ledger-filter-control,
  .truck-ledger-filter .truck-ledger-search {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .truck-ledger-filter .truck-ledger-search,
  .truck-ledger-filter .ledger-filter-control-job-order {
    grid-column: span 2;
  }

  .truck-ledger-download {
    margin-left: 0;
  }
}

@container (max-width: 850px) {
  .truck-ledger-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 600px) {
  .truck-ledger-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .truck-ledger-filter .truck-ledger-search,
  .truck-ledger-filter .ledger-filter-control-job-order {
    grid-column: auto;
  }
}

.booking-ledger-screen-head {
  margin-bottom: 12px;
}

.booking-ledger-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  width: 100%;
}

.booking-ledger-filters {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 540px;
  min-width: 0;
}

.booking-ledger-stats {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 1280px) {
  .booking-ledger-toolbar {
    flex-wrap: wrap;
  }
}

.broker-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.broker-block::-webkit-scrollbar {
  height: 7px;
}

.broker-block::-webkit-scrollbar-track {
  background: rgba(24, 48, 77, 0.05);
  border-radius: 8px;
}

.broker-block::-webkit-scrollbar-thumb {
  background: #dfbea2;
  border-radius: 8px;
}

.broker-block::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.booking-summary-download {
  white-space: nowrap;
  min-height: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.broker-table-head,
.broker-row {
  display: grid;
  grid-template-columns: minmax(125px, 1.25fr) minmax(105px, 0.95fr) minmax(95px, 0.85fr) minmax(85px, 0.8fr) minmax(80px, 0.75fr) minmax(120px, 1.05fr) minmax(110px, 0.95fr) minmax(92px, 0.85fr) minmax(68px, auto);
  gap: 8px;
  align-items: end;
}

.broker-table-head {
  min-width: 980px;
  padding: 0 4px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.broker-table-head span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.broker-rows {
  min-width: 980px;
  display: grid;
  gap: 10px;
}

.broker-row {
  padding: 10px 12px;
  border: 1px solid rgba(213, 184, 150, 0.75);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(31, 43, 68, 0.04);
}

.broker-row .field-lite { min-width: 0; }
.broker-row .field-lite label { display: none; }
.broker-row input,
.broker-row select {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  min-height: 38px;
  height: 38px;
}
.broker-row .row-action { display: flex; align-items: center; justify-content: center; min-height: 100%; }
.broker-row .row-action .btn {
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

.broker-footer {
  min-width: 980px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.two-pay-broker-remarks {
  margin-top: 14px;
}

.two-pay-broker-remarks label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.two-pay-broker-remarks textarea {
  display: block;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.broker-summary {
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf5;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.broker-summary strong { color: var(--nav); }
.broker-summary strong.positive { color: var(--green); }
.broker-summary strong.negative { color: var(--red); }

.broker-summary-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.broker-summary-kpis .ledger-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf5;
}

.broker-summary-download { align-self: center; white-space: nowrap; }

.broker-summary-notice { margin-bottom: 14px; }
.broker-summary-tabs { margin-top: 2px; }
.broker-summary-panel { min-width: 0; }
.broker-summary-table-wrap { margin-top: 16px; }
.broker-summary-table { min-width: 1280px; }
.two-pay-broker-summary-table { min-width: 2380px; }
.two-pay-broker-summary-table td:nth-child(2),
.two-pay-broker-summary-table td:nth-child(3) { min-width: 180px; }
.two-pay-broker-summary-table td:nth-child(5),
.two-pay-broker-summary-table td:nth-child(7),
.two-pay-broker-summary-table td:nth-child(8),
.two-pay-broker-summary-table td:nth-child(12),
.two-pay-broker-summary-table td:nth-child(15) { white-space: normal; min-width: 125px; }
.broker-summary-record-id { display: block; color: var(--nav); font: 11px/1.45 Consolas, "Courier New", monospace; overflow-wrap: anywhere; }
.broker-summary-id-help { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.broker-payment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.broker-payment-status.is-paid { color: #087f67; background: rgba(8, 127, 103, 0.12); }
.broker-payment-status.is-payable { color: #a85c18; background: rgba(197, 107, 45, 0.14); }
.employee-register-table { min-width: 1980px; }
.employee-register-table th, .employee-register-table td { white-space: nowrap; }
.muted-cell { color: var(--muted); font-size: 12px; }

@media (max-width: 1000px) {
  .broker-summary-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .broker-table-head { display: none; }
  .broker-rows, .broker-footer { min-width: 0; }
  .broker-row { grid-template-columns: 1fr; }
  .broker-row .field-lite label { display: block; }
  .broker-row .row-action { justify-content: flex-start; }
  .broker-footer { align-items: stretch; flex-direction: column; }
  .two-pay-broker-remarks { margin-top: 12px; }
  .broker-summary { justify-content: space-between; flex-wrap: wrap; }
  .broker-summary-kpis { grid-template-columns: 1fr; }
}

.ledger-filter-control {
  min-width: 115px;
  max-width: 175px;
  flex: 1 1 auto;
}

.ledger-filter-control-job-order {
  min-width: 175px;
  max-width: 215px;
}

.ledger-filter-control label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ledger-filter-control select,
.ledger-filter-control input {
  min-height: 38px;
  padding: 5px 10px;
  font-size: 12.5px;
}

.truck-summary-screen-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: nowrap;
  width: 100%;
}

.truck-summary-stats {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1.15;
  min-width: 0;
}

.truck-summary-stats .ledger-total {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid #dfbea2;
  border-radius: 8px;
  background: #f8eadc;
  color: var(--nav);
  flex-direction: column;
  justify-content: center;
}

.truck-summary-stats .ledger-total.ledger-total-trucks {
  flex: 0.75;
}

.truck-summary-stats .ledger-total span {
  color: #18304d;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-summary-stats .ledger-total strong {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  margin-top: 2px;
}

.truck-summary-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.truck-summary-controls .ledger-filter-control {
  flex: 1;
  min-width: 0;
}

.truck-summary-controls .ledger-filter-control label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.truck-summary-controls .ledger-filter-control select {
  width: 100%;
  min-height: 38px;
  height: 38px;
  padding: 5px 8px;
  font-size: 12.5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: #ffffff;
}

.clear-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #dfbea2;
  border-radius: 8px;
  background: #fbf1e7;
  color: #734526;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.clear-filter-btn svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.clear-filter-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

.clear-filter-btn:hover svg {
  transform: rotate(-90deg);
}

.ledger-total {
  display: flex;
  min-width: 130px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #dfbea2;
  border-radius: 8px;
  background: #f8eadc;
  color: var(--nav);
  flex-direction: column;
  justify-content: center;
}

.ledger-total span {
  color: #18304d;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
}

.ledger-total strong {
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  margin: 2px 0 0;
}

/* Shared KPI card treatment: soft tinted surface, accent rail, and subtle corner glow. */
.dashboard-kpi-card,
.ledger-total {
  position: relative;
  overflow: hidden;
  border-left: 5px solid #18304d;
  background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%);
  box-shadow: 0 4px 14px rgba(24, 48, 77, 0.08);
}

.dashboard-kpi-card::after,
.ledger-total::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -42px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(24, 48, 77, 0.08);
  pointer-events: none;
}

.dashboard-kpi-card:nth-child(4n + 2),
.ledger-total:nth-child(4n + 2) {
  border-left-color: #0d7a6e;
  background: linear-gradient(135deg, #ffffff 0%, #edf9f7 100%);
}

.dashboard-kpi-card:nth-child(4n + 2)::after,
.ledger-total:nth-child(4n + 2)::after {
  background: rgba(13, 122, 110, 0.08);
}

.dashboard-kpi-card:nth-child(4n + 3),
.ledger-total:nth-child(4n + 3) {
  border-left-color: #c85a17;
  background: linear-gradient(135deg, #ffffff 0%, #fff6e8 100%);
}

.dashboard-kpi-card:nth-child(4n + 3)::after,
.ledger-total:nth-child(4n + 3)::after {
  background: rgba(200, 90, 23, 0.08);
}

.dashboard-kpi-card:nth-child(4n),
.ledger-total:nth-child(4n) {
  border-left-color: #ba3a2f;
  background: linear-gradient(135deg, #ffffff 0%, #fdf0ee 100%);
}

.dashboard-kpi-card:nth-child(4n)::after,
.ledger-total:nth-child(4n)::after {
  background: rgba(186, 58, 47, 0.08);
}

.dashboard-kpi-card > *,
.ledger-total > * {
  position: relative;
  z-index: 1;
}

/* Summary cards used by Equipment, Maintenance, and Employees. */
.grid > .card {
  border-left: 5px solid #18304d;
  background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%);
  box-shadow: 0 4px 14px rgba(24, 48, 77, 0.08);
}

.grid > .card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -42px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(24, 48, 77, 0.08);
  pointer-events: none;
}

.grid > .card:nth-child(4n + 2) {
  border-left-color: #0d7a6e;
  background: linear-gradient(135deg, #ffffff 0%, #edf9f7 100%);
}

.grid > .card:nth-child(4n + 2)::after {
  background: rgba(13, 122, 110, 0.08);
}

.grid > .card:nth-child(4n + 3) {
  border-left-color: #c85a17;
  background: linear-gradient(135deg, #ffffff 0%, #fff6e8 100%);
}

.grid > .card:nth-child(4n + 3)::after {
  background: rgba(200, 90, 23, 0.08);
}

.grid > .card:nth-child(4n) {
  border-left-color: #ba3a2f;
  background: linear-gradient(135deg, #ffffff 0%, #fdf0ee 100%);
}

.grid > .card:nth-child(4n)::after {
  background: rgba(186, 58, 47, 0.08);
}

.grid > .card > * {
  position: relative;
  z-index: 1;
}

/* Preserve the dashboard's expiry and outstanding alert semantics over shared card colors. */
.dashboard-kpi-card.expiry-due {
  border-left-color: #cf8d27;
  background: #fff3dc;
}

.dashboard-kpi-card.expiry-expired {
  border-left-color: #ca5048;
  background: #fde9e7;
}

.dashboard-kpi-card.financial-outstanding {
  border-left-color: #cf8d27;
  background: #fff3dc;
}

/* Shared card badges use the same high-contrast treatment as Two Pay Records. */
.grid > .card > .badge {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  min-height: 0;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  text-transform: uppercase;
}
.grid > .card:nth-child(4n + 1) > .badge { background: #18304d; }
.grid > .card:nth-child(4n + 2) > .badge { background: #0d7a6e; }
.grid > .card:nth-child(4n + 3) > .badge { background: #c85a17; }
.grid > .card:nth-child(4n) > .badge { background: #ba3a2f; }

.dashboard-kpi-card h5 {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  min-height: 0;
  padding: 5px 9px;
  border-radius: 6px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  text-transform: uppercase;
}
.dashboard-kpi-card:nth-child(4n + 1) h5 { background: #18304d; }
.dashboard-kpi-card:nth-child(4n + 2) h5 { background: #0d7a6e; }
.dashboard-kpi-card:nth-child(4n + 3) h5 { background: #c85a17; }
.dashboard-kpi-card:nth-child(4n) h5 { background: #ba3a2f; }
.dashboard-kpi-card.expiry-due h5,
.dashboard-kpi-card.financial-outstanding h5 { background: #c98b20; color: #fff; }
.dashboard-kpi-card.expiry-expired h5 { background: #ba3a2f; color: #fff; }

/* Apply the same Two Pay Records typography and spacing to every summary card. */
.card,
.ledger-total,
.dashboard-kpi-card,
.two-pay-stat-card {
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.card > strong,
.ledger-total strong,
.dashboard-kpi-card strong,
.two-pay-stat-card strong {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.card > .badge,
.ledger-total .badge,
.dashboard-kpi-card h5,
.two-pay-stat-card .badge {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
  letter-spacing: .03em;
}

.ledger-count {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff7ef;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.bilty-input-group {
  position: relative;
}

.bilty-upload-field input[type="file"] {
  min-height: 48px;
  padding: 6px 48px 6px 6px;
  cursor: pointer;
}

.bilty-upload-field input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7ef;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bilty-clear {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #eccfc7;
  border-radius: 50%;
  background: #fff7f4;
  color: var(--red);
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.bilty-clear:hover,
.bilty-clear:focus-visible {
  background: #fde9e4;
  border-color: var(--red);
  transform: translateY(-50%) scale(1.04);
  outline: none;
}

.bilty-clear[hidden],
.bilty-modal[hidden] {
  display: none;
}

.bilty-thumbnail {
  width: 58px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.bilty-thumbnail:hover,
.bilty-thumbnail:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 6px 14px rgba(84, 55, 34, 0.16);
  transform: translateY(-1px);
  outline: none;
}

.bilty-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bilty-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 24, 35, 0.82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.bilty-modal img {
  display: block;
  max-width: min(1080px, 92vw);
  max-height: 88vh;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.bilty-modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(17, 34, 53, 0.88);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.bilty-modal-close:hover,
.bilty-modal-close:focus-visible {
  background: var(--accent);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.bilty-modal-open {
  overflow: hidden;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(11, 24, 39, 0.68);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.confirm-dialog {
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid #ead4bf;
  border-radius: 18px;
  background: #fffaf4;
  box-shadow: 0 28px 70px rgba(15, 30, 48, 0.3);
  text-align: center;
  animation: confirm-dialog-in 0.18s ease-out;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: #a84b28;
  background: #fde9dc;
}

.confirm-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-dialog h2 {
  margin: 0 0 9px;
  color: #17365d;
  font-size: 26px;
}

.confirm-dialog p {
  margin: 0;
  color: #6c7f94;
  line-height: 1.55;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
}

body.confirm-modal-open {
  overflow: hidden;
}

@keyframes confirm-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.table-wrap {
  overflow: auto;
  max-height: 72vh;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fffdf9;
}

.table-wrap > table {
  width: max-content;
  min-width: 100%;
}

.table-wrap > table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.table-wrap thead th {
  background-color: #fffdf9;
}

.equipment-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.equipment-search {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
}

.equipment-search span {
  color: #5f7185;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.equipment-search input {
  min-height: 44px;
}

.equipment-search select {
  height: 44px;
  min-height: 44px;
}

.equipment-summary-download,
.maintenance-summary-download {
  height: 44px;
  min-height: 44px;
  white-space: nowrap;
}

.equipment-table {
  min-width: 2200px;
  table-layout: auto;
  font-size: 12.5px;
}

.two-pay-table {
  min-width: 3740px;
}

.two-pay-table th,
.two-pay-table td {
  white-space: nowrap;
}

.two-pay-table th:nth-child(4),
.two-pay-table td:nth-child(4) {
  min-width: 220px;
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.two-pay-title {
  margin-bottom: 14px;
}

.two-pay-title p {
  margin: 4px 0 0;
}

.two-pay-stats {
  margin-bottom: 18px;
}

.two-pay-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 88px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(24, 48, 77, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.two-pay-stat-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -42px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
}

.two-pay-stat-card:hover,
.two-pay-stat-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(24, 48, 77, 0.12);
}

.two-pay-stat-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 7px 0 2px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.two-pay-stat-card small {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}

.two-pay-stat-card .badge {
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 6px;
  text-transform: uppercase;
}

/* Card 1: Billing Amount (Navy / Slate Blue) */
.two-pay-stat-card.billing {
  background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%);
  border: 1.5px solid #b9cee5;
  border-left: 5px solid #18304d;
}
.two-pay-stat-card.billing::after {
  background: rgba(24, 48, 77, 0.08);
}
.two-pay-stat-card.billing .badge {
  background: #18304d;
  color: #ffffff;
}
.two-pay-stat-card.billing strong {
  color: #12243a;
}
.two-pay-stat-card.billing small {
  color: #475e77;
}

/* Card 2: Global / Receivable (Teal / Emerald) */
.two-pay-stat-card.receivable {
  background: linear-gradient(135deg, #ffffff 0%, #edf9f7 100%);
  border: 1.5px solid #a3ded7;
  border-left: 5px solid #0d7a6e;
}
.two-pay-stat-card.receivable::after {
  background: rgba(13, 122, 110, 0.08);
}
.two-pay-stat-card.receivable .badge {
  background: #0d7a6e;
  color: #ffffff;
}
.two-pay-stat-card.receivable strong {
  color: #09544c;
}
.two-pay-stat-card.receivable small {
  color: #316861;
}

/* Card 3: Receivable Balance (Vibrant Amber / Warm Tangerine) */
.two-pay-stat-card.balance {
  background: linear-gradient(135deg, #ffffff 0%, #fff6e8 100%);
  border: 1.5px solid #f6cca0;
  border-left: 5px solid #c85a17;
}
.two-pay-stat-card.balance::after {
  background: rgba(200, 90, 23, 0.08);
}
.two-pay-stat-card.balance .badge {
  background: #c85a17;
  color: #ffffff;
}
.two-pay-stat-card.balance strong {
  color: #933d06;
}
.two-pay-stat-card.balance small {
  color: #7b4f2c;
}

/* Card 4: Party Collection Pending (Crimson Coral / Danger) */
.two-pay-stat-card.party-pending {
  background: linear-gradient(135deg, #ffffff 0%, #fdf0ee 100%);
  border: 1.5px solid #f5c4be;
  border-left: 5px solid #ba3a2f;
}
.two-pay-stat-card.party-pending::after {
  background: rgba(186, 58, 47, 0.08);
}
.two-pay-stat-card.party-pending .badge {
  background: #ba3a2f;
  color: #ffffff;
}
.two-pay-stat-card.party-pending strong {
  color: #8a2219;
}
.two-pay-stat-card.party-pending small {
  color: #7c413c;
}

.two-pay-download-summary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.two-pay-download-summary:hover,
.two-pay-download-summary:focus-visible {
  background: #a95120;
  color: #fff;
}

.two-pay-toolbar {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf4;
}

.two-pay-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(145px, 1.3fr) minmax(120px, .9fr) repeat(2, minmax(118px, .8fr)) minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.two-pay-filter-toolbar .equipment-search {
  min-width: 0;
}

.two-pay-filter-toolbar select,
.two-pay-filter-toolbar input {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 8px 12px;
  line-height: 22px;
  font-size: 12px;
}

.two-pay-filter-toolbar .ledger-count {
  align-self: center;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  justify-self: stretch;
  padding: 0 10px;
  font-size: 10px;
}

.two-pay-filter-toolbar .equipment-search span {
  font-size: 10px;
  letter-spacing: 0.02em;
}

.two-pay-filter-toolbar .two-pay-download-summary {
  align-self: center;
  min-height: 40px;
  height: 40px;
  padding: 8px 12px;
  font-size: 11px;
}

.equipment-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  min-width: 112px;
  background: #f2e2d1;
  color: #3f3025;
  white-space: normal;
  text-align: center;
}

.equipment-table th:first-child {
  min-width: 58px;
}

.equipment-table th:nth-child(2),
.equipment-table th:nth-child(5),
.equipment-table th:nth-child(6) {
  min-width: 88px;
}

.equipment-table th:nth-child(15) {
  min-width: 160px;
}

.equipment-table th:nth-child(16) {
  min-width: 240px;
}

.equipment-table th,
.equipment-table td {
  text-align: center;
}

.equipment-table td {
  vertical-align: middle;
}

.equipment-table .table-actions {
  justify-content: center;
  flex-wrap: nowrap;
}

.equipment-table tbody tr:hover {
  background: #fff5ea;
}

.equipment-docs {
  min-width: 220px;
  line-height: 1.45;
}

.maintenance-register-head {
  display: block !important;
  margin-bottom: 16px;
}

.maintenance-register-head h3 {
  margin: 0 0 12px;
}

.maintenance-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.equipment-toolbar .ledger-count,
.maintenance-toolbar .ledger-count {
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf5;
}

.maintenance-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 160px;
  flex: 1 1 auto;
  margin: 0;
}

.maintenance-toolbar .maintenance-search {
  min-width: 240px;
  flex: 2 1 auto;
}

.maintenance-toolbar label input,
.maintenance-toolbar label select {
  height: 38px;
  min-height: 38px;
  padding: 8px 12px;
}

.maintenance-summary-download {
  height: 38px;
  min-height: 38px;
  white-space: nowrap;
}

@media (min-width: 1161px) {
  .equipment-register-head {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .equipment-register-head .equipment-toolbar {
    flex-wrap: nowrap;
    flex: 0 1 auto;
  }

  .equipment-register-head .equipment-search {
    min-width: min(300px, 28vw);
  }
}

@media (max-width: 1160px) {
  .equipment-register-head {
    align-items: flex-start;
  }

  .equipment-register-head .equipment-toolbar {
    width: 100%;
    justify-content: flex-end;
  }
}

.maintenance-toolbar label span {
  color: #5f7185;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.maintenance-table {
  width: 2180px;
  min-width: 2180px;
  table-layout: fixed;
  font-size: 12.5px;
}

.maintenance-table col.maintenance-col-job,
.maintenance-table col.maintenance-col-truck {
  width: 110px;
}

.maintenance-table col.maintenance-col-date {
  width: 125px;
}

.maintenance-table col.maintenance-col-part {
  width: 180px;
}

.maintenance-table col.maintenance-col-serial,
.maintenance-table col.maintenance-col-cost {
  width: 130px;
}

.maintenance-table col.maintenance-col-warranty {
  width: 140px;
}

.maintenance-table col.maintenance-col-status {
  width: 150px;
}

.maintenance-table col.maintenance-col-actions {
  width: 280px;
}

.maintenance-table col.maintenance-col-driver {
  width: 170px;
}

.maintenance-table col.maintenance-col-image {
  width: 100px;
}

.maintenance-table col.maintenance-col-approved {
  width: 160px;
}

.maintenance-table th {
  background: #f2e2d1;
  color: #3f3025;
  text-align: center;
  white-space: normal;
}

.maintenance-table th,
.maintenance-table td {
  box-sizing: border-box;
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.maintenance-table thead th {
  border-bottom: 1px solid #cfab86;
}

.maintenance-table td:nth-child(5),
.maintenance-table td:nth-child(12),
.maintenance-table td:nth-child(14) {
  text-align: center;
}

.maintenance-table .table-actions {
  justify-content: center;
  flex-wrap: nowrap;
}

.maintenance-table tbody tr:hover {
  background: #fff5ea;
}

.maintenance-image-field {
  position: relative;
  max-width: 100%;
}

.attachment-file-name {
  margin-top: 7px;
  padding: 7px 10px;
  border: 1px solid #ead3be;
  border-radius: 8px;
  background: #fff8f1;
  color: #36536e;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.attachment-file-name[hidden] {
  display: none;
}

.maintenance-image-field input[type="file"] {
  padding-right: 54px;
}

.maintenance-image-remove {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #efc4be;
  border-radius: 50%;
  color: var(--red);
  background: #fff3f2;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.maintenance-image-remove[hidden],
.maintenance-image-preview[hidden],
.maintenance-image-modal[hidden] {
  display: none;
}

.maintenance-image-preview {
  margin-top: 10px;
}

.maintenance-image-preview button,
.maintenance-thumbnail,
.equipment-thumbnail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--nav);
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.maintenance-image-preview img,
.maintenance-thumbnail img,
.equipment-thumbnail img {
  display: block;
  width: 58px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
}

.maintenance-thumbnail,
.equipment-thumbnail {
  padding: 3px;
}

.maintenance-thumbnail img,
.equipment-thumbnail img {
  width: 52px;
  height: 38px;
}

.employee-register-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.employee-register-table {
  width: 100%;
  min-width: 1980px;
  table-layout: auto;
  border-collapse: collapse;
}

.employee-register-table th,
.employee-register-table td {
  white-space: nowrap;
  padding: 10px 14px;
  vertical-align: middle;
  text-align: left;
}

.employee-register-table th {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fffdf9;
}

.employee-register-table td {
  vertical-align: middle;
}

.employee-register-table td:last-child .table-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.employee-register-table td:last-child .table-actions .btn {
  min-width: 122px;
  justify-content: center;
}

.maintenance-image-modal .bilty-modal-dialog {
  max-width: min(960px, 92vw);
}

.notice.error {
  color: var(--red);
  border-color: #efc4be;
  background: #fff3f2;
}

.expiry-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.expiry-status.valid {
  color: #176f5b;
  background: #e4f4ee;
  border-color: #c6e9dd;
}

.expiry-status.due {
  color: #9b6500;
  background: #fff2d9;
  border-color: #f0d69e;
}

.expiry-status.expired {
  color: #ad3328;
  background: #fde8e5;
  border-color: #efc4be;
}

.expiry-status.na {
  color: #68778a;
  background: #f1f4f7;
  border-color: #dce3e9;
}

.ledger-table {
  min-width: 1320px;
  background: transparent;
  font-size: 13px;
}

.ledger-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff7ef;
  white-space: nowrap;
  font-size: 12px;
  padding: 10px 10px;
}

.ledger-table td {
  padding: 10px 10px;
  line-height: 1.45;
}

.ledger-table .stacked-cell {
  gap: 4px;
}

.ledger-table .stacked-cell span {
  padding: 5px 9px;
  border-radius: 11px;
  font-size: 12px;
}

.ledger-table .badge {
  padding: 5px 10px;
  font-size: 11px;
}

.ledger-table tbody tr:hover {
  background: rgba(255, 248, 241, 0.78);
}

body[data-page="booking"] .table-wrap,
body[data-page="truck"] .table-wrap,
body[data-page="truck-summary"] .table-wrap,
body[data-page="completed-truck-summary"] .table-wrap {
  overflow: auto;
  max-height: 72vh;
  position: relative;
}

.table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f6eee4;
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #c9a788;
  border-radius: 8px;
  border: 2px solid #f6eee4;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #9d7553;
}

body[data-page="booking"] .ledger-table thead th,
body[data-page="truck"] .truck-trip-table thead th,
body[data-page="truck-summary"] .truck-summary-table thead th,
body[data-page="completed-truck-summary"] .truck-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(24, 48, 77, 0.08);
}

body[data-page="booking"] .ledger-table {
  min-width: 4100px;
  width: max-content;
  table-layout: auto;
  font-size: 11.5px;
}

body[data-page="truck"] .truck-trip-table {
  min-width: 7700px;
  width: max-content;
  table-layout: auto;
  font-size: 11.5px;
}

body[data-page="truck-summary"] .truck-summary-table {
  min-width: 1650px;
}

body[data-page="truck-summary"] .truck-summary-table th {
  white-space: nowrap;
  background: #b8dce7;
  color: #0b1f33;
  border-color: #18304d;
}

body[data-page="completed-truck-summary"] .truck-summary-table th {
  white-space: nowrap;
  background: #b8dce7;
  color: #0b1f33;
  border-color: #18304d;
}

body[data-page="truck-summary"] .truck-summary-table th,
body[data-page="truck-summary"] .truck-summary-table td {
  vertical-align: middle;
}

.truck-summary-groups {
  display: grid;
  gap: 18px;
}

.truck-summary-download {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.truck-summary-download-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.truck-summary-download .btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.truck-job-group {
  overflow: hidden;
  border: 2px solid #a98468;
  border-radius: 12px;
  background: #fffaf4;
  box-shadow: 0 7px 18px rgba(95, 68, 47, 0.09);
}

.truck-job-header {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 62px;
  padding: 11px 16px;
  border-bottom: 2px solid #18304d;
  background: #dceef3;
}

.truck-job-meta {
  display: grid;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.truck-job-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #102a44;
  font-size: 15px;
  font-weight: 700;
}

.truck-job-broker {
  min-width: 0;
}

.truck-job-broker span {
  overflow-wrap: anywhere;
}

.truck-job-meta-item strong {
  color: #102a44;
  font-size: inherit;
  font-weight: 700;
}

.truck-job-count {
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid #ceb49d;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.92);
  color: #7b604c;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.truck-job-group .table-wrap {
  border: 0;
  border-radius: 0;
}

.truck-job-group .truck-summary-table {
  margin: 0;
  border: 0;
}

.truck-job-group .truck-summary-table tbody tr+tr td {
  border-top-color: #d7bfaa;
}

.truck-leg-type {
  display: inline-flex;
  min-width: 62px;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.truck-leg-type.import {
  color: #0b6f63;
  background: #e2f2ef;
}

.truck-leg-type.export {
  color: #9a5b00;
  background: #fff0d5;
}

.truck-leg-type.mty {
  color: #4f5261;
  background: #ececf2;
}

.truck-summary-empty {
  padding: 28px;
  border: 1px dashed #aab8c4;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

body[data-page="ledger"] .statement-table th {
  white-space: nowrap;
  background: #b7dce8;
  color: #111;
  border-color: #222;
}

body[data-page="ledger"] .statement-table th,
body[data-page="ledger"] .statement-table td {
  vertical-align: middle;
}

/* Customer Summary Box-Wise Layout (ledger.html) */
.customer-summary-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 14px;
}

.customer-summary-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(24, 48, 77, 0.05);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.customer-summary-box:hover {
  box-shadow: 0 6px 24px rgba(24, 48, 77, 0.08);
}

.customer-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: linear-gradient(135deg, #f7eee4, #f2e3d3);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
}

.customer-box-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.customer-box-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--nav);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.customer-box-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-box-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--nav);
  letter-spacing: -0.01em;
}

.customer-box-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(24, 48, 77, 0.08);
  color: var(--nav);
  font-size: 11.5px;
  font-weight: 600;
}

.customer-box-actions .customer-box-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 12px;
}

.customer-summary-box .table-wrap {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: auto;
  max-height: 60vh;
  position: relative;
}

.customer-summary-box .statement-table {
  margin: 0;
  width: 100%;
}

.customer-summary-box .statement-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #b7dce8;
  box-shadow: 0 1px 3px rgba(24, 48, 77, 0.08);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.customer-summary-box .statement-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(232, 216, 199, 0.6);
}

.customer-summary-box .statement-table tfoot tr {
  background: #fdf5ec;
  border-top: 2px solid #dfbea2;
}

.customer-summary-box .statement-table tfoot td {
  padding: 11px 14px;
  border-bottom: none;
}

.customer-summary-box .foot-label {
  text-align: right;
  font-weight: 700;
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.customer-summary-box .foot-value {
  font-weight: 800;
  color: var(--nav);
  font-size: 14px;
}

.summary-remarks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 260px;
}

body[data-page="truck"] .truck-trip-table th,
body[data-page="truck"] .truck-trip-table td {
  white-space: nowrap;
  vertical-align: top;
}

body[data-page="truck"] .truck-trip-table th:nth-child(27),
body[data-page="truck"] .truck-trip-table td:nth-child(27),
body[data-page="truck"] .truck-trip-table th:nth-child(52),
body[data-page="truck"] .truck-trip-table td:nth-child(52) {
  border-right: 1px solid #d6b08f;
}

body[data-page="truck"] .truck-trip-table td.remarks-cell {
  min-width: 260px;
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

body[data-page="truck"] .truck-trip-table td:nth-child(5),
body[data-page="truck"] .truck-trip-table td:nth-child(6),
body[data-page="truck"] .truck-trip-table td:nth-child(7),
body[data-page="truck"] .truck-trip-table td:nth-child(10),
body[data-page="truck"] .truck-trip-table td:nth-child(12),
body[data-page="truck"] .truck-trip-table td:nth-child(16),
body[data-page="truck"] .truck-trip-table td:nth-child(18),
body[data-page="truck"] .truck-trip-table td:nth-child(19),
body[data-page="truck"] .truck-trip-table td:nth-child(26),
body[data-page="truck"] .truck-trip-table td:nth-child(30),
body[data-page="truck"] .truck-trip-table td:nth-child(31),
body[data-page="truck"] .truck-trip-table td:nth-child(32),
body[data-page="truck"] .truck-trip-table td:nth-child(35),
body[data-page="truck"] .truck-trip-table td:nth-child(37),
body[data-page="truck"] .truck-trip-table td:nth-child(41),
body[data-page="truck"] .truck-trip-table td:nth-child(43),
body[data-page="truck"] .truck-trip-table td:nth-child(44),
body[data-page="truck"] .truck-trip-table td:nth-child(51) {
  min-width: 105px;
  max-width: 210px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

body[data-page="truck"] .truck-trip-table td:nth-child(10),
body[data-page="truck"] .truck-trip-table td:nth-child(35) {
  min-width: 170px;
  max-width: 240px;
}

body[data-page="truck"] .truck-trip-table td:nth-child(55) {
  min-width: 145px;
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
}

body[data-page="truck"] .truck-trip-table td:nth-child(n+56):nth-child(-n+62) {
  min-width: 105px;
}

body[data-page="truck"] .truck-trip-table td.truck-expense-missing {
  background: #fff0ee;
  color: #b42318;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #eab3ab;
}

body[data-page="booking"] .ledger-table thead th {
  white-space: nowrap;
  word-break: normal;
  line-height: 1.2;
  padding: 10px 10px;
}

body[data-page="booking"] .ledger-table td {
  padding: 10px;
  vertical-align: top;
  white-space: nowrap;
}

body[data-page="booking"] .ledger-table th,
body[data-page="booking"] .ledger-table td {
  word-break: normal;
  overflow-wrap: normal;
}

body[data-page="booking"] .ledger-table .table-actions {
  flex-wrap: wrap;
  min-width: 74px;
}

.summary {
  font-size: 15px;
  line-height: 1.7;
}

.statement-shell {
  background: linear-gradient(180deg, #fffdf9, #fff8f1);
}

.statement-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.statement-brand {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}

.statement-title {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--nav);
}

.statement-sub {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.statement-range {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.statement-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.statement-actions select {
  width: min(100%, 460px);
}

.statement-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.khata-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(24, 48, 77, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.khata-mini:hover {
  transform: translateY(-1px);
  border-color: #dfc3a5;
  box-shadow: 0 4px 10px rgba(24, 48, 77, 0.08);
}

.khata-mini-label {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.khata-mini-value {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--nav);
}

.statement-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.statement-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 1px 4px rgba(24, 48, 77, 0.03);
}

.statement-stat span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.statement-stat small {
  font-size: 10.5px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

.statement-stat strong {
  display: block;
  font-size: 15px;
  margin: 2px 0 1px;
  color: var(--nav);
}

.statement-stat.negative strong {
  color: var(--red);
}

.statement-stat.positive strong {
  color: var(--green);
}

.unified-statement-screen {
  background: linear-gradient(180deg, #fffdf9, #fff8f1);
  padding: 24px;
}

.khata-sub-block {
  position: relative;
}

.khata-sub-block .screen-head {
  margin-bottom: 12px;
}

.khata-section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
  margin: 20px 0;
}

.statement-table th {
  white-space: nowrap;
}

.account-overview-table tbody tr[data-overview-account] {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.account-overview-table tbody tr[data-overview-account]:hover,
.account-overview-table tbody tr[data-overview-account]:focus-visible {
  background: #fff5ea;
  outline: none;
  box-shadow: inset 3px 0 0 #c97937;
}

body[data-page="khata"] .account-overview-table,
body[data-page="accounts-payable"] .account-overview-table {
  width: 100%;
}

body[data-page="khata"] .account-overview-table thead th[colspan="2"],
body[data-page="accounts-payable"] .account-overview-table thead th[colspan="2"] {
  text-align: center;
  width: 200px;
}

body[data-page="khata"] .account-overview-table th:nth-child(2),
body[data-page="accounts-payable"] .account-overview-table th:nth-child(2),
body[data-page="khata"] .account-overview-table td:nth-child(2),
body[data-page="accounts-payable"] .account-overview-table td:nth-child(2) {
  width: 220px;
  text-align: left;
}

body[data-page="khata"] .account-overview-table tbody td:nth-child(3),
body[data-page="accounts-payable"] .account-overview-table tbody td:nth-child(3) {
  width: 100px;
  text-align: right;
  padding-right: 4px;
}

body[data-page="khata"] .account-overview-table tbody td:nth-child(4),
body[data-page="accounts-payable"] .account-overview-table tbody td:nth-child(4) {
  width: 100px;
  text-align: left;
  padding-left: 4px;
}

body[data-page="khata"] .account-overview-table .overview-action-button,
body[data-page="accounts-payable"] .account-overview-table .overview-action-button {
  min-width: 82px;
  padding: 6px 12px;
  font-size: 12.5px;
}

.account-overview-table .amount-cell .muted {
  display: inline-block;
  margin-left: 5px;
  font-size: 12px;
  font-weight: 500;
}

.amount-cell {
  font-variant-numeric: tabular-nums;
}

.debit-text {
  color: var(--red);
}

.credit-text {
  color: var(--green);
}

.auth-form {
  gap: 16px;
  align-content: start;
}

.auth-form label {
  margin-bottom: 10px;
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.92);
}

.auth-form input {
  height: 58px;
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(245, 249, 255, 0.12);
  color: #ffffff;
  padding-inline: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  caret-color: #ffffff;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;
  box-shadow: 0 0 0 1000px rgba(24, 36, 52, 0.92) inset;
  transition: background-color 9999s ease-out 0s;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.auth-form input:hover,
.auth-form input:focus {
  border-color: rgba(255, 190, 142, 0.78);
  box-shadow: 0 0 0 4px rgba(255, 154, 88, 0.14);
  outline: none;
}

.auth-submit {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a2f 0%, #ff4c4c 100%);
  box-shadow: 0 16px 30px rgba(255, 102, 59, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit:hover,
.auth-submit:focus {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(255, 102, 59, 0.34);
  filter: saturate(1.03);
}

.auth-submit:active {
  transform: translateY(1px) scale(0.995);
  box-shadow: 0 10px 22px rgba(255, 102, 59, 0.26);
}

.auth-form input:focus-visible,
.auth-submit:focus-visible,
.auth-card .password-toggle:focus-visible {
  outline: 3px solid rgba(255, 190, 142, 0.5);
  outline-offset: 2px;
}

.auth-card .notice {
  background: rgba(255, 247, 237, 0.16);
  border-color: rgba(255, 205, 160, 0.32);
  color: #fff2e5;
}

@media (max-width: 1160px) {

  .mobile-topbar,
  .sidebar-mobile-head,
  .nav-overlay {
    display: flex;
  }

  .app {
    width: 100%;
  }

  .main {
    padding: 16px;
    width: 100%;
    overflow-x: hidden;
    margin-left: 0;
  }

  body.sidebar-collapsed .main {
    margin-left: 0;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(320px, 86vw);
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  .sidebar.collapsed {
    width: min(320px, 86vw);
    padding: 26px 20px;
  }

  .sidebar.collapsed .brand {
    flex-direction: row;
  }

  .sidebar.collapsed .brand h1 {
    width: auto;
    font-size: 24px;
  }

  .sidebar.collapsed .brand h1::before {
    content: none;
  }

  .sidebar.collapsed .nav a {
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .sidebar.collapsed .nav-label {
    display: inline;
  }

  .sidebar.collapsed .tip {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
  }

  .sidebar.collapsed .tip [data-software-signout] {
    width: auto;
    min-width: 0;
    height: auto;
    padding: 8px 12px;
  }

  .sidebar-collapse {
    display: none;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.38);
    display: none;
  }

  body.nav-open .nav-overlay {
    display: block;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12,
  .field,
  .field.quarter,
  .field.half,
  .field.wide,
  .field.full {
    grid-column: span 12;
  }

  .audit-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-toolbar .field,
  .audit-toolbar .record-count {
    grid-column: auto;
  }

  .container-table-head {
    display: none;
  }

  .container-row {
    grid-template-columns: 1fr;
  }

  .container-row .field-lite label {
    display: block;
  }

  .container-row .row-action {
    justify-content: flex-start;
  }

  body[data-page="two-pay-records"] .two-pay-container-block {
    overflow-x: visible;
  }

  body[data-page="two-pay-records"] .two-pay-container-table-head {
    display: none;
  }

  body[data-page="two-pay-records"] .two-pay-container-rows,
  body[data-page="two-pay-records"] .two-pay-container-row,
  body[data-page="two-pay-records"] .two-pay-container-footer {
    min-width: 0;
  }

  .broker-table-head {
    display: none;
  }

  .broker-rows,
  .broker-footer {
    min-width: 0;
  }

  .broker-row {
    grid-template-columns: 1fr;
  }

  .broker-row .field-lite label {
    display: block;
  }

  .broker-row .row-action {
    justify-content: flex-start;
  }

  .broker-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .broker-total-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .hero h2,
  .statement-title {
    font-size: 22px;
  }

  .screen,
  .hero,
  .panel {
    border-radius: 16px;
  }

  .card,
  .statement-stat {
    border-radius: 10px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .screen-head,
  .statement-topbar,
  .statement-sub,
  .actions,
  .table-actions {
    gap: 10px;
  }

  .screen {
    padding: 18px;
  }

  .khata-mini {
    min-width: 0;
    width: 100%;
  }

  .statement-actions>* {
    width: 100%;
  }

  .statement-actions .btn,
  .statement-actions select {
    justify-content: center;
  }

  .statement-action-buttons {
    justify-content: flex-end;
  }

  .statement-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .table-wrap {
    margin-inline: -4px;
  }

  .ledger-table {
    min-width: 1080px;
  }

  .statement-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
  }

  .statement-stat {
    padding: 5px 6px;
    border-radius: 6px;
  }

  .statement-stat span {
    font-size: 9px;
  }

  .statement-stat strong {
    font-size: 12px;
    margin: 1px 0;
  }

  .statement-stat small {
    font-size: 8.5px;
  }

  .unified-statement-screen {
    padding: 16px;
  }

  .khata-section-divider {
    margin: 16px 0;
  }

  .auth-stage {
    padding: 20px;
  }

  .auth-frame {
    min-height: calc(100dvh - 40px);
  }

  .auth-panel {
    width: min(100%, 460px);
    min-height: 0;
    padding: 0;
  }

  .auth-card {
    width: 100%;
    min-height: min(500px, calc(100dvh - 40px));
    padding: clamp(30px, 5vw, 42px) clamp(24px, 5vw, 34px);
  }
}

@media (max-width: 720px) {
  .auth-stage {
    align-items: center;
    padding: 12px;
  }

  .auth-frame {
    min-height: calc(100dvh - 24px);
  }

  .auth-panel {
    width: 100%;
    padding: 0;
  }

  .auth-card {
    min-height: auto;
    padding: 32px 22px;
    border-radius: 22px;
  }

  .auth-brand strong {
    font-size: 30px;
  }

  .auth-form input {
    height: 54px;
    border-radius: 16px;
  }

  .auth-submit {
    min-height: 52px;
  }
}

@media (max-height: 650px) {
  .auth-stage {
    align-items: flex-start;
    padding-block: 12px;
  }

  .auth-frame {
    min-height: calc(100dvh - 24px);
  }

  .auth-card {
    min-height: auto;
    padding-block: 26px;
  }

  .auth-brand {
    margin-bottom: 22px;
  }

  .auth-brand strong {
    font-size: 30px;
  }

  .auth-form input {
    height: 52px;
  }

  .auth-submit {
    min-height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .auth-card,
  .auth-form input,
  .auth-submit,
  .password-toggle {
    transition: none;
  }
}

/* --- Dynamic Routing & Skeleton Loader System --- */

/* Thin Top Progress Indicator */
.nav-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  z-index: 9999;
  width: 0;
  opacity: 0;
  transition: width 0.25s ease-out, opacity 0.15s linear;
  pointer-events: none;
}

/* Pulse shimmer effect */
.skeleton-shimmer {
  background: linear-gradient(90deg,
      rgba(240, 230, 218, 0.4) 25%,
      rgba(255, 250, 244, 0.75) 50%,
      rgba(240, 230, 218, 0.4) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer-animation 1.5s infinite linear;
}

@keyframes skeleton-shimmer-animation {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 760px) {

  /* ==========================================================================
     STATEMENT REGISTER (MOBILE CARDS)
     ========================================================================== */
  body[data-page="khata"] .statement-table:not(.account-overview-table),
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) {
    display: block;
    width: 100%;
    overflow: visible;
    white-space: normal;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) thead,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) thead {
    display: none;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px 8px;
    padding: 14px 15px 12px;
    border: 1px solid #e3d8cc;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(24, 48, 77, 0.05);
    position: relative;
    box-sizing: border-box;
    width: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.is-debit-card,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.is-debit-card {
    border-left: 4.5px solid #ba3a2f !important;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.is-credit-card,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.is-credit-card {
    border-left: 4.5px solid #1f8a70 !important;
  }

  /* Empty state row */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr:not(.statement-card-row),
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr:not(.statement-card-row) {
    display: block;
    padding: 24px 16px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #fffdf9;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr:not(.statement-card-row) td,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr:not(.statement-card-row) td {
    display: block;
    padding: 0;
    border: 0;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr:not(.statement-card-row) td::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr:not(.statement-card-row) td::before {
    display: none !important;
    content: none !important;
  }

  /* Date row (Header of Card) */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-date,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-date,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Date"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Date"] {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 2px;
    border: 0;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-date::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-date::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Date"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Date"]::before {
    display: none !important;
    content: none !important;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-date .st-date-badge,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-date .st-date-badge,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Date"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Date"] {
    font-size: 12.5px;
    font-weight: 600;
    color: #556475;
  }

  /* Status / Type pill on top-right of the card */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.is-debit-card td.st-cell-date::after {
    content: "Debit (-)";
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #fef2f2;
    color: #ba3a2f;
    border: 1px solid rgba(186, 58, 47, 0.22);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.is-credit-card td.st-cell-date::after {
    content: "Credit (+)";
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #ecfdf5;
    color: #1f8a70;
    border: 1px solid rgba(31, 138, 112, 0.22);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.is-debit-card td.st-cell-date::after {
    content: "Payable";
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #fef2f2;
    color: #ba3a2f;
    border: 1px solid rgba(186, 58, 47, 0.22);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.is-credit-card td.st-cell-date::after {
    content: "Paid";
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #ecfdf5;
    color: #1f8a70;
    border: 1px solid rgba(31, 138, 112, 0.22);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  /* Description Row (Full Width Headline) */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-desc,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-desc,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Description"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Description"] {
    grid-column: 1 / -1;
    display: block;
    padding: 3px 0 6px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.45;
    color: #18283d;
    word-break: break-word;
    border: 0;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-desc::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-desc::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Description"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Description"]::before {
    display: none !important;
    content: none !important;
  }

  /* Financial Metric Boxes (Debit, Credit, Balance) */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Debit"],
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Credit"],
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Balance"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Payable"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Paid"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Outstanding"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    min-height: 52px;
    box-sizing: border-box;
    border: 0;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Debit"]::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Credit"]::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Balance"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Payable"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Paid"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Outstanding"]::before {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    content: attr(data-label);
  }

  /* Specific styles for Debit / Payable Box */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Debit"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Payable"] {
    background: rgba(186, 58, 47, 0.05);
    border: 1px solid rgba(186, 58, 47, 0.18);
    color: #ba3a2f;
    font-size: 13.5px;
    font-weight: 700;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Debit"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Payable"]::before {
    color: #a12b21;
  }

  /* Specific styles for Credit / Paid Box */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Credit"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Paid"] {
    background: rgba(31, 138, 112, 0.05);
    border: 1px solid rgba(31, 138, 112, 0.18);
    color: #1f8a70;
    font-size: 13.5px;
    font-weight: 700;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Credit"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Paid"]::before {
    color: #156d58;
  }

  /* Specific styles for Balance / Outstanding Box */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Balance"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Outstanding"] {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Balance"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Outstanding"]::before {
    color: #475569;
  }

  /* Image Attachment Cell */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.no-attachment td.st-cell-image,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.no-attachment td.st-cell-image {
    display: none !important;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.has-attachment td.st-cell-image,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.has-attachment td.st-cell-image {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fffaf5;
    border: 1px solid #f0dfce;
    border-radius: 8px;
    margin-top: 2px;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.has-attachment td.st-cell-image::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.has-attachment td.st-cell-image::before {
    display: block;
    content: "Attachment:";
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  /* Actions Cell */
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.no-actions td.st-cell-actions,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.no-actions td.st-cell-actions {
    display: none !important;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.has-actions td.st-cell-actions,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.has-actions td.st-cell-actions,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"] {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 10px;
    margin-top: 3px;
    border-top: 1px dashed rgba(232, 216, 199, 0.8);
    border-bottom: 0;
    border-left: 0;
    border-right: 0;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr.has-actions td.st-cell-actions::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr.has-actions td.st-cell-actions::before,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"]::before,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"]::before {
    display: none !important;
    content: none !important;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-actions .table-actions,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-actions .table-actions,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"] .table-actions,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"] .table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-actions .btn,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-actions .btn,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"] .btn,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Actions"] .btn {
    min-height: 35px;
    padding: 6px 15px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 7px;
  }

  /* ==========================================================================
     ACCOUNT OVERVIEW TABLE (100% RESTORED TO ORIGINAL)
     ========================================================================== */
  body[data-page="khata"] .account-overview-table tbody tr,
  body[data-page="accounts-payable"] .account-overview-table tbody tr {
    cursor: pointer;
  }

  body[data-page="khata"] .account-overview-table,
  body[data-page="accounts-payable"] .account-overview-table {
    display: table;
    width: 100%;
    table-layout: fixed;
    box-sizing: border-box;
    overflow: visible;
    white-space: normal;
  }

  body[data-page="khata"] .account-overview-screen,
  body[data-page="accounts-payable"] .account-overview-screen {
    padding: 16px 7px 18px;
  }

  body[data-page="khata"] .account-overview-screen .screen-head,
  body[data-page="accounts-payable"] .account-overview-screen .screen-head {
    padding-inline: 7px;
    margin-bottom: 14px;
  }

  body[data-page="khata"] .account-overview-screen .table-wrap,
  body[data-page="accounts-payable"] .account-overview-screen .table-wrap {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  body[data-page="khata"] .account-overview-table thead,
  body[data-page="accounts-payable"] .account-overview-table thead {
    display: table-header-group;
  }

  body[data-page="khata"] .account-overview-table tbody,
  body[data-page="accounts-payable"] .account-overview-table tbody {
    display: table-row-group;
  }

  body[data-page="khata"] .account-overview-table tbody tr,
  body[data-page="accounts-payable"] .account-overview-table tbody tr {
    display: table-row;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body[data-page="khata"] .account-overview-table th,
  body[data-page="accounts-payable"] .account-overview-table th,
  body[data-page="khata"] .account-overview-table td,
  body[data-page="accounts-payable"] .account-overview-table td {
    display: table-cell;
    padding: 10px 4px;
    font-size: 10px;
    line-height: 1.25;
    vertical-align: middle;
    overflow-wrap: anywhere;
  }

  body[data-page="khata"] .account-overview-table tbody tr:not(:last-child) td,
  body[data-page="accounts-payable"] .account-overview-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid rgba(211, 184, 153, 0.48);
  }

  body[data-page="khata"] .account-overview-table th,
  body[data-page="accounts-payable"] .account-overview-table th {
    font-size: 10px;
    line-height: 1.2;
  }

  body[data-page="khata"] .account-overview-table td::before,
  body[data-page="accounts-payable"] .account-overview-table td::before {
    display: none;
    content: none;
  }

  body[data-page="khata"] .account-overview-table tbody td::before,
  body[data-page="accounts-payable"] .account-overview-table tbody td::before {
    display: none !important;
    content: none !important;
  }

  body[data-page="khata"] .account-overview-table thead th[colspan="2"],
  body[data-page="accounts-payable"] .account-overview-table thead th[colspan="2"] {
    text-align: center;
    width: 34%;
  }

  body[data-page="khata"] .account-overview-table th:nth-child(1),
  body[data-page="accounts-payable"] .account-overview-table th:nth-child(1),
  body[data-page="khata"] .account-overview-table td:nth-child(1),
  body[data-page="accounts-payable"] .account-overview-table td:nth-child(1) {
    width: 41%;
    padding-left: 10px;
    text-align: left;
  }

  body[data-page="khata"] .account-overview-table th:nth-child(2),
  body[data-page="accounts-payable"] .account-overview-table th:nth-child(2),
  body[data-page="khata"] .account-overview-table td:nth-child(2),
  body[data-page="accounts-payable"] .account-overview-table td:nth-child(2) {
    width: 25%;
    padding-left: 7px;
    text-align: left;
  }

  body[data-page="khata"] .account-overview-table th:nth-child(3),
  body[data-page="accounts-payable"] .account-overview-table th:nth-child(3),
  body[data-page="khata"] .account-overview-table td:nth-child(3),
  body[data-page="accounts-payable"] .account-overview-table td:nth-child(3) {
    width: 18%;
    padding-right: 3px;
    text-align: center;
  }

  body[data-page="khata"] .account-overview-table th:nth-child(4),
  body[data-page="accounts-payable"] .account-overview-table th:nth-child(4),
  body[data-page="khata"] .account-overview-table td:nth-child(4),
  body[data-page="accounts-payable"] .account-overview-table td:nth-child(4) {
    width: 16%;
    padding-left: 3px;
    text-align: center;
  }

  body[data-page="khata"] .account-overview-table .overview-action-button,
  body[data-page="accounts-payable"] .account-overview-table .overview-action-button {
    width: auto;
    min-height: 24px;
    min-width: 0;
    margin: 2px auto;
    padding: 3px 7px;
    font-size: 8.5px;
    line-height: 1;
    white-space: nowrap;
  }
}

@media (max-width: 400px) {

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody tr,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody tr {
    padding: 12px 11px 10px;
    gap: 7px 6px;
  }

  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-debit,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-credit,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance,
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td.st-cell-balance,
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Debit"],
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Credit"],
  body[data-page="khata"] .statement-table:not(.account-overview-table) tbody td[data-label*="Balance"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Payable"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Paid"],
  body[data-page="accounts-payable"] .statement-table:not(.account-overview-table) tbody td[data-label="Outstanding"] {
    padding: 6px 3px;
    min-height: 48px;
    font-size: 12.5px;
  }
}

.skeleton-text {
  height: 16px;
  border-radius: 4px;
  background-color: #ebdccb;
  margin-bottom: 8px;
}

.skeleton-text.title {
  height: 28px;
  width: 250px;
  margin-bottom: 24px;
}

.skeleton-text.subtitle {
  height: 14px;
  width: 180px;
  margin-bottom: 16px;
}

.skeleton-card {
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
}

.skeleton-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.skeleton-form {
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.skeleton-form-field {
  grid-column: span 4;
}

.skeleton-form-field.full {
  grid-column: span 12;
}

.skeleton-table-wrap {
  border-radius: 12px;
  background: #fffdf9;
  border: 1px solid var(--line);
  padding: 16px;
}

.skeleton-table-header {
  height: 38px;
  border-radius: 6px;
  background-color: #f5e6d5;
  margin-bottom: 12px;
}

.skeleton-table-row {
  height: 48px;
  border-radius: 6px;
  background-color: rgba(240, 230, 218, 0.35);
  margin-bottom: 8px;
}

@media (max-width: 1400px) {
  .two-pay-filter-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-pay-filter-toolbar .equipment-search:first-child {
    grid-column: span 2;
  }

  .two-pay-filter-toolbar .ledger-count {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .two-pay-filter-toolbar {
    grid-template-columns: 1fr;
  }

  .two-pay-filter-toolbar .equipment-search:first-child,
  .two-pay-filter-toolbar .ledger-count {
    grid-column: auto;
  }

  .two-pay-filter-toolbar .ledger-count {
    width: 100%;
  }

  .two-pay-download-summary {
    width: 100%;
  }

  .two-pay-stat-card {
    min-height: 96px;
  }
}

/* ==========================================================================
   Payment Voucher Module
   ========================================================================== */

.voucher-tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 24px;
  padding-bottom: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.voucher-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.voucher-tab:hover {
  background: rgba(24, 48, 77, 0.05);
  color: var(--ink);
}

.voucher-tab.is-active {
  border-color: var(--line);
  background: var(--paper-2);
  color: var(--nav);
  box-shadow: inset 0 -2px 0 #c56b2d;
}

.voucher-tab:focus-visible {
  outline: 3px solid rgba(1, 155, 208, 0.45);
  outline-offset: 2px;
}

.voucher-tab-panel[hidden] {
  display: none !important;
}

.voucher-tab-panel > .screen-head {
  margin-top: 4px;
  margin-bottom: 20px;
}

.voucher-tab-panel > .screen-head h3 {
  margin-top: 0;
}

.voucher-register-block {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.voucher-fund-history-head {
  margin-top: 30px !important;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.voucher-stats {
  margin-bottom: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.voucher-stats .span-3 {
  grid-column: span 1;
}

.voucher-fund-form {
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.voucher-form-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.voucher-bank-account-panel {
  padding: 16px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
}

.voucher-bank-account-panel > .screen-head {
  margin-bottom: 10px;
}

.voucher-bank-account-panel h4 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 15px;
}

.voucher-bank-account-form {
  padding: 0;
  margin-bottom: 12px;
}

.voucher-bank-account-table-wrap {
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}

.voucher-bank-account-table {
  min-width: 700px;
}

.voucher-bank-account-table th,
.voucher-bank-account-table td {
  white-space: nowrap;
}

.voucher-fund-scope {
  margin: 18px 0 10px;
  font-size: 12px;
}

.voucher-fund-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.voucher-fund-stats .span-3 {
  grid-column: span 1;
}

.voucher-fund-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}

.voucher-fund-table {
  min-width: 900px;
}

.voucher-fund-table th,
.voucher-fund-table td {
  white-space: nowrap;
}

.voucher-fund-table td:nth-child(5) {
  max-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.voucher-fund-stats [data-voucher-bank-available].negative-balance {
  color: #b42318;
}

@media (max-width: 1024px) {
  .voucher-stats,
  .voucher-fund-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .voucher-stats,
  .voucher-fund-stats {
    grid-template-columns: 1fr;
  }

  .voucher-tabs {
    gap: 6px;
    margin-bottom: 18px;
  }

  .voucher-tab {
    flex: 1 0 auto;
    padding-inline: 12px;
    font-size: 12px;
  }
}

.voucher-items-section {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-top: 6px;
}

.voucher-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.voucher-items-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(213, 184, 150, 0.45);
  background: #fff;
}

.voucher-items-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.voucher-items-table th {
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  background: #faf6f0;
  border-bottom: 1px solid var(--line);
}

.voucher-items-table td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid #f2e9de;
}

.voucher-items-table td input,
.voucher-items-table td select {
  height: 38px;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.voucher-clearance-editor {
  display: grid;
  gap: 4px;
  min-width: 165px;
}

.voucher-clearance-editor[hidden],
.voucher-clearance-na[hidden] {
  display: none;
}

.voucher-clearance-editor small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.voucher-clearance-status-list {
  display: grid;
  gap: 5px;
  min-width: 145px;
}

.voucher-clearance-status-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.voucher-item-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #eecbc6;
  background: #fff3f1;
  color: #c9362b;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.voucher-item-remove-btn:hover {
  background: #c9362b;
  color: #fff;
  border-color: #c9362b;
  transform: scale(1.08);
}

.voucher-summary-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffaf4, #fbf2e7);
  border: 1px solid #dfc6b0;
  margin-top: 6px;
  flex-wrap: wrap;
}

.voucher-summary-left {
  flex: 1 1 300px;
}

.voucher-summary-left span {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.voucher-words {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: #173a5e;
  font-style: italic;
}

.voucher-summary-right {
  text-align: right;
  flex: 0 0 auto;
}

.voucher-summary-right span {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.voucher-total {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #c56b2d;
  font-variant-numeric: tabular-nums;
}

.voucher-register-head {
  display: block !important;
  margin-bottom: 16px;
}

.voucher-register-head h3 {
  margin: 0 0 12px;
}

.voucher-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.voucher-bank-filter-control {
  min-width: 210px;
  max-width: 300px;
}

.voucher-summary-download {
  height: 38px;
  min-height: 38px;
  white-space: nowrap;
}

.payment-voucher-table {
  width: 100%;
  min-width: 2150px;
  table-layout: auto;
  border-collapse: collapse;
}

.payment-voucher-table th,
.payment-voucher-table td {
  white-space: nowrap;
  padding: 10px 14px;
  vertical-align: middle;
  text-align: left;
}

.payment-voucher-table td:last-child .table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

