:root {
  color-scheme: light;
  --printed-date: "";
  --ink: #1f2933;
  --muted: #637381;
  --line: #d9e2ec;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --blue: #1f6feb;
  --blue-dark: #144ea3;
  --green: #1f8a5b;
  --amber: #b7791f;
  --red: #c2413b;
  --purple: #6b4bb7;
  --teal: #0f766e;
  --nav: #14213d;
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.10);
  --shadow-raised: 0 16px 34px rgba(15, 23, 42, 0.16), 0 2px 4px rgba(15, 23, 42, 0.08);
  --shadow-pop: 0 30px 90px rgba(15, 23, 42, 0.34), 0 12px 28px rgba(31, 111, 235, 0.12);
  --green-soft: #ddf8e9;
  --green-border: #a9ebc6;
  --blue-soft: #e7f1ff;
  --blue-border: #b7d3fb;
  --amber-soft: #fff1c9;
  --amber-border: #f3cf7d;
  --red-soft: #ffe3e0;
  --red-border: #f2b9b5;
  --purple-soft: #efe9ff;
  --purple-border: #d5c4fb;
  --closed-soft: #edf2f7;
  --closed-border: #cdd8e4;
}

@keyframes modalPopIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.965);
  }
  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menuPopIn {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

* {
  box-sizing: border-box;
}

html {
  overscroll-behavior-x: none;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef2f6;
  font-family: Arial, Helvetica, sans-serif;
  overscroll-behavior-x: none;
  overflow-x: hidden;
}

body.app-busy,
body.app-busy * {
  cursor: progress !important;
}

button,
input,
select {
  font: inherit;
}

button,
.file-btn {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  overscroll-behavior-x: none;
  overflow-x: hidden;
}

.app-locked,
.hidden {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(420px, 620px);
  gap: 28px;
  align-items: stretch;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 88% 14%, rgba(18, 188, 190, 0.18), transparent 30%),
    linear-gradient(135deg, #eef2f6 0%, #e5edf5 100%);
}

.auth-screen.hidden {
  display: none;
}

.auth-panel {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(20, 33, 61, 0.14);
}

.auth-panel .brand-mark {
  margin-bottom: 4px;
  background: var(--nav);
  color: #ffffff;
}

.auth-panel .auth-logo {
  justify-self: center;
  width: min(var(--auth-logo-width, 320px), 92%);
  max-width: 100%;
  max-height: 210px;
  margin: 0 auto 20px;
  object-fit: contain;
}

.auth-marketing-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: 620px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 33, 61, 0.14), rgba(18, 33, 61, 0.82)),
    linear-gradient(135deg, #12213d 0%, #165a71 52%, #12bcbe 100%);
  box-shadow: 0 18px 50px rgba(20, 33, 61, 0.16);
  color: #ffffff;
  padding: 34px;
}

.auth-marketing-panel::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  pointer-events: none;
}

.auth-marketing-panel > div {
  position: relative;
  display: grid;
  gap: 16px;
  max-width: 520px;
}

.auth-marketing-logo {
  width: min(250px, 62%);
  height: auto;
  margin-bottom: 8px;
  object-fit: contain;
}

.auth-marketing-panel h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 550;
}

.auth-marketing-panel h2 span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
  font-weight: 400;
}

.auth-marketing-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 650;
}

.auth-marketing-panel ul {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.auth-marketing-panel li {
  position: relative;
  display: block;
  padding-left: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  line-height: 1.38;
  font-weight: 400;
}

.auth-marketing-panel li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #12bcbe;
}

.auth-marketing-panel li strong {
  color: #ffffff;
  font-weight: 750;
}

.auth-panel h1,
.auth-panel p {
  margin: 0;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.auth-legal-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 650;
}

.auth-legal-links a {
  color: var(--accent);
  text-decoration: none;
}

.auth-legal-links a:hover {
  text-decoration: underline;
}

.legal-page {
  min-height: 100vh;
  background: #eef2f6;
  color: var(--text);
  padding: 32px 18px;
}

.legal-document {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(20, 33, 61, 0.12);
}

.legal-document h1 {
  margin: 8px 0 6px;
  font-size: 36px;
  line-height: 1.12;
}

.legal-document h2 {
  margin: 28px 0 8px;
  font-size: 20px;
}

.legal-document p {
  margin: 0 0 14px;
  color: #344256;
  font-size: 16px;
  line-height: 1.62;
}

.legal-document a {
  color: var(--accent);
  font-weight: 700;
}

.legal-updated {
  color: var(--muted);
  font-weight: 700;
}

.legal-back-link {
  display: inline-flex;
  margin-bottom: 12px;
  text-decoration: none;
}

.auth-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-panel label.hidden {
  display: none;
}

.auth-panel input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
}

.auth-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.reset-link-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  font-size: 13px;
}

.reset-link-box a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.reset-link-box p {
  font-size: 13px;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  align-self: start;
  background: linear-gradient(180deg, #14213d 0%, #101a31 100%);
  color: white;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

.brand {
  position: relative;
  display: grid;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--nav);
  font-weight: 800;
  border-radius: 8px;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  max-width: 220px;
  font-size: 22px;
  line-height: 1.14;
  letter-spacing: 0;
}

.brand p,
.topbar p {
  margin: 4px 0 0;
  color: #dbe7f3;
  font-size: 13px;
}

.brand-subtitle {
  margin-top: 8px !important;
  color: #b9c8d8 !important;
  font-size: 12px !important;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-version {
  display: inline-flex;
  width: max-content;
  margin-top: 10px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe7f3;
  font-size: 11px;
  font-weight: 900;
}

.mobile-menu-toggle {
  display: none;
}

.backup-status,
.connection-status,
.app-version-label {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe7f3;
  font-size: 12px;
  line-height: 1.35;
}

.connection-status.connected {
  border-color: rgba(31, 138, 91, 0.5);
  background: rgba(31, 138, 91, 0.18);
}

.connection-status.failed {
  border-color: rgba(194, 65, 59, 0.55);
  background: rgba(194, 65, 59, 0.2);
}

.app-version-label {
  color: #b9c8d8;
}

.undo-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12px;
}

.undo-box.hidden {
  display: none;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-btn,
.secondary-btn,
.primary-btn,
.danger-btn,
.file-btn {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transform: translateY(0);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--green), var(--blue));
  opacity: 0;
  transform: scaleY(0.55);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.nav-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(71, 185, 129, 0.18), rgba(43, 114, 217, 0));
  opacity: 0;
  transition: opacity 0.16s ease;
}

.nav-btn.active,
.nav-btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #edf6ff 100%);
  color: var(--nav);
  box-shadow: 0 14px 30px rgba(12, 31, 62, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.nav-btn.active::before,
.nav-btn:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-btn.active::after {
  opacity: 1;
}

.nav-btn:hover,
.workflow-btn:hover,
.secondary-btn:hover,
.primary-btn:hover,
.danger-btn:hover,
.file-btn:hover {
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 8px 18px rgba(12, 31, 62, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.nav-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.82);
  outline-offset: 2px;
}

.side-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(16, 26, 49, 0), #101a31 18px, #101a31 100%);
}

.workspace {
  min-width: 0;
  overflow-x: hidden;
  padding: 22px;
}

.topbar {
  position: relative;
  overflow: visible;
  z-index: 20;
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 420px);
  gap: 16px;
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 14px 34px rgba(20, 33, 61, 0.08);
}

.view-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #bfd0e3;
  border-radius: 50%;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.help-trigger:hover {
  border-color: var(--blue);
  background: #eef6ff;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

.topbar h2 {
  font-size: 28px;
  line-height: 1.05;
}

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

.version-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 0 !important;
}

.version-pill,
.version-backup-link {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  background: #f8fbff;
  color: #52616f !important;
  font-size: 11px !important;
  font-weight: 900;
}

.version-backup-link {
  cursor: pointer;
  border-color: #b9d0ee;
  background: #e8f1ff;
  color: var(--blue-dark) !important;
}

.version-backup-link:hover {
  border-color: #9fb7d3;
  background: #ffffff;
}

.global-search-wrap {
  position: relative;
  z-index: 30;
  min-width: 0;
  align-self: center;
}

.global-search-wrap label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.global-search-wrap label > span {
  display: none;
}

.global-search-wrap .search-input-wrap {
  display: block;
}

.global-search-wrap .search-clear-btn {
  display: none;
}

.global-search-wrap input {
  min-height: 46px;
  padding: 10px 14px;
  border-color: #c7d5e4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--nav);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(20, 33, 61, 0.06);
}

.global-search-results {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
  overscroll-behavior-x: contain;
  padding: 8px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(20, 33, 61, 0.18);
}

.global-search-results.hidden {
  display: none !important;
}

.global-search-results button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e1e8f0;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--ink);
  text-align: left;
}

.global-search-results button:hover {
  border-color: #9fb7d3;
  background: #ffffff;
}

.global-result-type {
  min-width: 78px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--blue-dark);
  text-align: center;
}

.global-result-customer .global-result-type {
  background: #dcf7e8;
  color: var(--green);
}

.global-result-agreement .global-result-type {
  background: #e8f1ff;
  color: var(--blue-dark);
}

.global-result-coffee-gear .global-result-type,
.global-result-install .global-result-type,
.global-result-swap-return .global-result-type {
  background: #fff3d8;
  color: var(--amber);
}

.global-result-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.global-search-results small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search-results strong {
  color: var(--nav);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-results small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  font-weight: 750;
}

.global-result-open {
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.workflow-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workflow-btn {
  min-height: 36px;
  border: 0;
  background: #e8f1ff;
  color: var(--blue-dark);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.workflow-btn:hover,
.workflow-btn.active {
  background: var(--blue);
  color: #ffffff;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
  animation: viewFadeLift 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.dashboard-kpi-groups {
  display: grid;
  gap: 10px;
}

.dashboard-kpi-group {
  display: grid;
  gap: 8px;
  padding: 8px 0 10px;
  border-bottom: 1px solid #e4ebf3;
}

.dashboard-kpi-group h3 {
  margin: 0;
  color: var(--nav);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.kpi,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.kpi {
  padding: 12px 14px;
  text-align: left;
}

button.kpi {
  width: 100%;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button.kpi:hover {
  background: #f8fbff;
  border-color: #9fb7d3;
  transform: translateY(-1px);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.kpi strong {
  display: block;
  font-size: 26px;
  color: var(--nav);
  line-height: 1;
}

.kpi small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-kpi {
  position: relative;
  overflow: hidden;
  border-left: 5px solid var(--kpi-accent, var(--blue));
  border-top: 1px solid var(--kpi-border, var(--line));
  background: linear-gradient(180deg, var(--kpi-soft, #f8fbff), #ffffff 64%);
  box-shadow: 0 8px 20px rgba(20, 33, 61, 0.06);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  min-height: 76px;
}

.dashboard-kpi::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--kpi-accent, var(--blue));
  opacity: 0.18;
  pointer-events: none;
}

.dashboard-kpi strong {
  color: var(--kpi-accent, var(--nav));
}

.dashboard-kpi strong.kpi-loading {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.25;
}

.dashboard-kpi[data-kpi-tone="green"] {
  --kpi-accent: var(--green);
  --kpi-soft: #f0faf4;
  --kpi-border: #bee8cf;
}

.dashboard-kpi[data-kpi-tone="amber"] {
  --kpi-accent: var(--amber);
  --kpi-soft: #fff8e8;
  --kpi-border: #f1d69b;
}

.dashboard-kpi[data-kpi-tone="blue"] {
  --kpi-accent: var(--blue-dark);
  --kpi-soft: #edf5ff;
  --kpi-border: #bdd6f7;
}

.dashboard-kpi[data-kpi-tone="red"] {
  --kpi-accent: var(--red);
  --kpi-soft: #fff1f0;
  --kpi-border: #f0bab6;
}

.dashboard-kpi[data-kpi-tone="nav"] {
  --kpi-accent: var(--nav);
  --kpi-soft: #f0f4f8;
  --kpi-border: #c6d3e0;
}

button.dashboard-kpi:hover {
  background: linear-gradient(180deg, var(--kpi-soft, #f8fbff), #ffffff 42%);
  border-color: var(--kpi-accent, #9fb7d3);
  box-shadow: 0 12px 28px rgba(20, 33, 61, 0.12);
}

.agreement-expiry-dashboard {
  border-bottom: 0;
}

.dashboard-expiry-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.expiry-row {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.expiry-row:hover {
  border-color: #9fb7d3;
  background: #f8fbff;
}

.expiry-row strong {
  color: var(--nav);
  font-size: 15px;
}

.expiry-row span,
.expiry-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expiry-row span {
  color: var(--ink);
  font-weight: 800;
}

.expiry-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.dashboard-panel {
  overflow: hidden;
}

.dashboard-command-panel {
  position: relative;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(19, 33, 61, 0.98), rgba(18, 62, 78, 0.94)),
    #13213d;
  border-color: rgba(255, 255, 255, 0.12);
}

.dashboard-command-panel .dashboard-panel-heading h3,
.dashboard-command-panel .dashboard-panel-heading p {
  color: #ffffff;
}

.dashboard-command-panel .dashboard-panel-heading p {
  opacity: 0.78;
}

.dashboard-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.dashboard-panel-heading h3 {
  margin: 0;
}

.dashboard-panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.dashboard-status-card {
  min-height: 158px;
  padding: 16px;
  text-align: left;
  color: #ffffff;
  font: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.dashboard-status-card:hover {
  background: rgba(255, 255, 255, 0.16);
}

.dashboard-status-card span,
.dashboard-status-card small {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  text-transform: uppercase;
}

.dashboard-status-card strong {
  display: block;
  margin: 12px 0;
  color: #ffffff;
  font-size: 40px;
  line-height: 1;
}

.dashboard-status-card small {
  margin-top: 10px;
  text-transform: none;
}

.dashboard-meter {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.dashboard-meter i {
  display: block;
  width: 0%;
  height: 100%;
  background: #7ac143;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.dashboard-meter.warning i {
  background: #f59e0b;
}

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

.dashboard-action-card {
  min-height: 128px;
  padding: 14px;
  text-align: left;
  color: inherit;
  font: inherit;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  cursor: pointer;
}

.dashboard-action-card:hover {
  background: #ffffff;
  border-color: #9fb7d3;
}

.dashboard-action-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-action-card strong {
  display: block;
  margin: 6px 0;
  color: var(--nav);
  font-size: 34px;
  line-height: 1;
}

.dashboard-action-card small {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-card {
  position: relative;
  display: grid;
  gap: 0;
  align-content: start;
  border-left: 5px solid var(--blue-dark);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.05);
  overflow: hidden;
}

.settings-card > .dashboard-panel-heading {
  position: relative;
  cursor: pointer;
  min-height: 104px;
  align-items: center;
  padding: 20px 76px 20px 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.settings-card > .dashboard-panel-heading h3 {
  font-size: 20px;
  line-height: 1.15;
}

.settings-card > .dashboard-panel-heading p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.settings-card > .dashboard-panel-heading::after {
  content: "+";
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4fb;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.settings-card.settings-card-open > .dashboard-panel-heading::after {
  content: "-";
}

.settings-card:not(.settings-card-open) > :not(.dashboard-panel-heading) {
  display: none;
}

.settings-card.settings-card-open > .dashboard-panel-heading {
  border-bottom: 1px solid #e3ebf4;
  margin-bottom: 16px;
}

.settings-card.settings-card-open > :not(.dashboard-panel-heading) {
  margin: 0 20px 20px;
}

.settings-card:nth-child(2) {
  border-left-color: var(--green);
}

.settings-card:nth-child(3) {
  border-left-color: var(--amber);
}

.settings-card:nth-child(4) {
  border-left-color: var(--purple);
}

.settings-card:nth-child(5) {
  border-left-color: var(--blue);
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-card {
  grid-column: 1 / -1;
}

.settings-card-wide > .dashboard-panel-heading {
  min-height: 92px;
}

.settings-card-wide.settings-card-open > .dashboard-panel-heading {
  min-height: 84px;
}

.settings-status-grid {
  display: grid;
  gap: 10px;
}

.settings-card .backup-status,
.settings-card .connection-status,
.settings-card .app-version-label {
  border-color: #d7e2ee;
  background: #f3f7fb;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.backup-progress {
  display: block;
  width: 100%;
  height: 12px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8f5;
  border: 1px solid #c7d8ea;
}

.backup-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dc2626 0%, #f59e0b 35%, #2563eb 70%, #16a34a 100%);
  transition: width 0.35s ease;
}

.backup-progress-complete {
  background: linear-gradient(90deg, var(--success), #12805c);
}

.backup-progress-failed {
  background: linear-gradient(90deg, var(--danger), #7f1d1d);
}

.backup-progress-text {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.backup-download-link {
  display: inline-flex;
  margin-top: 10px;
}

.backup-help-text,
.restore-warning {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.restore-warning {
  border-color: rgba(194, 65, 59, 0.34);
  background: #fff7f6;
  color: #8b2a25;
}

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

.recovery-guide-block,
.recovery-checklist {
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #f7fafc;
  padding: 16px;
}

.recovery-guide-block h4,
.recovery-checklist h4 {
  margin: 0 0 10px;
  color: var(--ink);
}

.recovery-guide-block ul,
.recovery-guide-block ol,
.recovery-checklist ul {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.55;
}

.recovery-checklist {
  margin-top: 16px;
}

.recovery-checklist ul {
  columns: 2;
}

.settings-card .connection-status.connected {
  border-color: rgba(31, 138, 91, 0.36);
  background: #edf9f3;
}

.settings-card .connection-status.failed {
  border-color: rgba(194, 65, 59, 0.36);
  background: #fff1f0;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, max-content));
  gap: 10px;
  align-items: start;
  justify-content: start;
}

.settings-actions .secondary-btn,
.settings-actions .primary-btn,
.settings-actions .danger-btn,
.settings-actions .file-btn {
  min-width: 170px;
  min-height: 42px;
  padding: 10px 14px;
  text-align: center;
}

.business-rules-form {
  display: grid;
  gap: 14px;
}

.business-rule-list {
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px 16px;
}

.business-rule-list h4 {
  margin: 0 0 10px;
  color: var(--nav);
  font-size: 16px;
}

.business-rule-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-weight: 800;
}

.business-rule-list li {
  line-height: 1.35;
}

.settings-template-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px minmax(190px, auto) minmax(150px, auto);
  gap: 10px;
  align-items: end;
}

.backup-settings-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-template-form label,
.settings-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.branding-upload-grid,
.branding-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.branding-upload-grid label {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.branding-preview {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #f8fbff;
}

.branding-preview h4 {
  margin: 0;
  color: var(--nav);
  font-size: 15px;
}

.preview-auth-panel,
.preview-app-header,
.preview-pdf-header,
.preview-pdf-footer {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 92px;
  padding: 14px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
}

.preview-logo {
  max-width: 210px;
  max-height: 78px;
  object-fit: contain;
}

.preview-app-header,
.preview-pdf-header {
  border-top: 6px solid var(--preview-header-colour, var(--branding-header-colour, var(--blue)));
}

@media (max-width: 980px) {
  .auth-screen {
    grid-template-columns: minmax(0, 520px);
    align-items: start;
  }

  .auth-marketing-panel {
    min-height: auto;
    padding: 24px;
  }

  .auth-marketing-panel h2 {
    font-size: 30px;
  }
}

.preview-app-header strong,
.preview-pdf-header strong {
  color: var(--branding-header-colour, var(--nav));
  font-size: 18px;
}

.preview-app-header span,
.preview-pdf-header span,
.preview-pdf-footer span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.preview-pdf-footer {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  min-height: 70px;
  font-size: 12px;
}

.preview-pdf-footer small {
  grid-column: 1 / -1;
  color: #4b5563;
  overflow-wrap: anywhere;
}

.template-list {
  display: grid;
  gap: 8px;
}

.template-field-reference {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
}

.template-field-reference summary {
  cursor: pointer;
  color: var(--nav);
  font-weight: 900;
}

.template-field-reference div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.template-field-reference code {
  padding: 5px 7px;
  border: 1px solid #d7e2ee;
  border-radius: 5px;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.template-section-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.document-builder-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #c9ddf2;
  border-radius: 8px;
  background: #f8fbff;
}

.document-builder-section > .dashboard-panel-heading {
  padding: 0 0 4px;
  border: 0;
  background: transparent;
}

.document-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

.pdf-document-manager table {
  min-width: 900px;
}

.pdf-document-manager th,
.pdf-document-manager td {
  vertical-align: middle;
}

.pdf-document-manager td:first-child {
  min-width: 230px;
}

.pdf-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pdf-table-config-list {
  display: grid;
  gap: 10px;
}

.pdf-table-config-card {
  display: grid;
  grid-template-columns: minmax(84px, auto) minmax(240px, 1fr) minmax(280px, 1.1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
}

.pdf-table-config-card h4 {
  margin: 0 0 4px;
  color: #1f2a37;
  font-size: 16px;
}

.pdf-table-config-card p {
  margin: 0;
  color: #637381;
  font-weight: 700;
  line-height: 1.35;
}

.pdf-table-toggle {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: #1f2a37 !important;
}

.pdf-table-fixed-note {
  color: #637381;
  font-weight: 800;
}

.document-builder-advanced {
  background: #ffffff;
}

.document-block-list {
  display: grid;
  gap: 12px;
}

.document-block-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
}

.document-block-card h4 {
  margin: 0;
  color: #1f2a37;
  font-size: 17px;
}

.document-block-card p {
  margin: 3px 0 10px;
  color: #637381;
  font-size: 13px;
  line-height: 1.35;
}

.document-block-card strong {
  align-self: center;
  color: #637381;
  font-size: 12px;
  text-transform: uppercase;
}

.block-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e9f2ff;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 900;
}

.locked-block {
  background: #f6f8fb;
}

.table-placeholder-block {
  border-style: dashed;
}

.table-block-grid,
.print-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.table-block-card,
.print-mapping-grid .template-link-group {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
}

.table-block-card {
  grid-template-columns: auto 1fr;
  align-items: start;
  cursor: pointer;
}

.table-block-card input {
  margin-top: 3px;
}

.table-block-card input[type="checkbox"],
.print-mapping-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  flex: 0 0 18px;
  margin: 2px 8px 0 0;
  accent-color: #2b73e8;
}

.print-mapping-grid .template-link-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 0;
}

.table-block-card strong,
.table-block-card span {
  grid-column: 2;
}

.table-block-card strong {
  color: #1f2a37;
  font-size: 15px;
}

.table-block-card span {
  color: #637381;
  font-size: 13px;
  line-height: 1.35;
}

.print-mapping-grid .template-link-group h3 {
  margin: 0;
}

.template-document-library {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c9ddf2;
  border-radius: 8px;
  background: #f3f8ff;
}

.template-setup-map,
.template-document-map {
  display: grid;
  gap: 10px;
}

.template-setup-map {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.template-setup-map div,
.template-document-map div {
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.template-setup-map strong,
.template-document-map strong {
  display: block;
  color: #1f2a37;
  font-size: 15px;
  line-height: 1.25;
}

.template-setup-map span,
.template-document-map span {
  display: block;
  margin-top: 5px;
  color: #637381;
  font-size: 13px;
  line-height: 1.35;
}

.template-document-map {
  grid-template-columns: minmax(160px, 0.7fr) minmax(260px, 1.6fr) minmax(120px, 0.4fr);
}

.template-document-library > .dashboard-panel-heading {
  padding: 0 0 4px;
  border: 0;
  background: transparent;
}

.template-advanced-links {
  margin-top: 12px;
}

.template-layout-options[open],
.template-table-options {
  border-color: #c9ddf2;
  background: #f8fbff;
}

.template-table-options {
  grid-template-columns: 1fr;
}

.template-table-hint {
  grid-column: 1 / -1;
  margin: 0;
}

.template-section-editor > .dashboard-panel-heading {
  padding: 0 0 4px;
  border: 0;
  background: transparent;
}

.template-block-order {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.template-block-order div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
}

.template-block-order span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e9f2ff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.template-block-order strong {
  color: #1f2a37;
  font-size: 14px;
  line-height: 1.2;
}

.template-block-order small {
  color: #637381;
  font-size: 12px;
  line-height: 1.25;
}

.template-section-editor textarea,
.legacy-template-grid textarea {
  min-height: 110px;
}

.legacy-template-reference {
  margin-top: 12px;
}

.template-advanced-legal {
  margin-top: 0;
  background: #ffffff;
}

.legacy-template-grid {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.legacy-template-grid.form-grid,
.template-field-reference .legacy-template-grid {
  display: grid;
}

.legacy-template-grid .form-grid {
  display: grid;
  width: 100%;
}

.pdf-template-preview {
  margin-top: 10px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #eef4fb;
  padding: 14px;
}

.template-helper-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9fc;
}

.pdf-template-preview-page {
  max-width: 820px;
  min-height: 420px;
  margin: 0 auto;
  padding: 22px 26px;
  border: 1px solid #d1dbe7;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 31, 54, 0.12);
  color: #1f2a37;
  font-size: 13px;
  line-height: 1.45;
}

.pdf-template-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1f2a37;
}

.pdf-template-preview-header div {
  display: grid;
  gap: 4px;
}

.pdf-template-preview-header div:last-child {
  text-align: right;
}

.pdf-template-preview-header strong {
  color: #0f1f36;
  font-size: 18px;
}

.pdf-template-preview-header span,
.pdf-template-preview-footer {
  color: #657586;
  font-weight: 800;
}

.pdf-template-preview-section {
  margin: 14px 0;
}

.pdf-template-preview-section h4 {
  margin: 0 0 7px;
  color: #0f1f36;
  font-size: 15px;
}

.pdf-template-preview-section p {
  margin: 0 0 8px;
}

.pdf-template-preview-section .signature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.pdf-template-preview-section .signature-row div {
  min-height: 54px;
  border-top: 1px solid #1f2a37;
  padding-top: 8px;
}

.pdf-template-preview-section .signature-row span,
.pdf-template-preview-section .signature-row strong {
  display: block;
}

.pdf-template-preview-footer {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #d8e2ee;
  font-size: 11px;
}

.pdf-template-preview-footer div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pdf-template-preview-footer small {
  display: block;
  overflow-wrap: anywhere;
}

.template-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, auto) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.template-list-row strong,
.template-list-row span {
  overflow-wrap: anywhere;
}

.template-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.template-fields span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-table-wrap {
  overflow: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
}

.dashboard-table {
  min-width: 1080px;
  border-collapse: collapse;
  border-spacing: 0;
}

.dashboard-table col.col-dashboard-id {
  width: 110px;
}

.dashboard-table thead {
  display: table-header-group;
}

.dashboard-table tr {
  display: table-row;
}

.dashboard-table td {
  display: table-cell;
  border-bottom: 1px solid var(--line);
  overflow-wrap: break-word;
}

.dashboard-table td::before {
  content: none;
}

.dashboard-table tr:hover td {
  background: #f8fbff;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel h3 {
  font-size: 18px;
  margin-bottom: 14px;
}

.customer-activity-panel {
  border-left: 5px solid var(--purple);
}

.activity-timeline {
  display: grid;
  gap: 10px;
}

.activity-row {
  display: grid;
  grid-template-columns: 118px minmax(180px, 1fr) auto;
  gap: 8px 14px;
  align-items: baseline;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue-dark);
  border-radius: 7px;
  background: #ffffff;
}

.activity-row[data-activity-tone="green"] {
  border-left-color: var(--green);
}

.activity-row[data-activity-tone="amber"] {
  border-left-color: var(--amber);
}

.activity-row[data-activity-tone="purple"] {
  border-left-color: var(--purple);
}

.activity-row[data-activity-tone="blue"] {
  border-left-color: var(--blue-dark);
}

.activity-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.activity-row strong {
  color: var(--ink);
  font-size: 15px;
}

.activity-row em {
  justify-self: end;
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef4fb;
  color: var(--blue-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.activity-row p {
  grid-column: 2 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  column-gap: 12px;
  row-gap: 8px;
  padding: 2px;
}

.form-grid.hidden,
label.hidden,
.field-note.hidden {
  display: none !important;
}

.form-grid.compact {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  margin-bottom: 8px;
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid #d6e1ed;
  color: var(--nav);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
}

.form-grid > .form-section-title:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

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

.inline-input-action .compact-action-button {
  min-height: 44px;
  padding-inline: 12px;
  white-space: nowrap;
}

.abn-validation-result {
  align-self: end;
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 36px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid #b7dcc8;
  border-radius: 999px;
  background: #f0fbf5;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
}

.abn-validation-result.hidden {
  display: none !important;
}

.abn-validation-result.warning {
  border-color: #f0d293;
  background: #fff8e6;
  color: #92400e;
}

.abn-validation-result.failed {
  border-color: #efb2b2;
  background: #fff1f1;
  color: #991b1b;
}

.field-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.field-note.warning {
  color: #9a6a08;
}

.wdv-input-wrap {
  position: relative;
  display: block;
}

.wdv-input-wrap input {
  padding-right: 210px;
}

.input-inline-note {
  position: absolute;
  right: 48px;
  top: 50%;
  max-width: 152px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  pointer-events: none;
  text-align: right;
  text-overflow: ellipsis;
  transform: translateY(-50%);
  white-space: nowrap;
}

.input-inline-note.warning {
  color: #9a6a08;
}

.input-inline-edit {
  position: absolute;
  right: 10px;
  top: 50%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-decoration: underline;
  transform: translateY(-50%);
  cursor: pointer;
}

.input-inline-edit.hidden {
  display: none !important;
}

.abn-details {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.abn-details summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.abn-details-grid {
  margin-top: 12px;
}

label {
  display: grid;
  gap: 4px;
  align-content: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.date-with-option {
  display: grid;
  gap: 10px;
  align-content: start;
}

.date-with-option .checkbox-label {
  min-height: 28px;
}

.checkbox-label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  min-height: 42px;
  padding-top: 2px;
}

.checkbox-label input {
  width: auto;
  min-height: 0;
}

#equipmentForm .checkbox-label {
  align-self: end;
}

#contractForm .checkbox-label {
  align-self: end;
  min-height: 42px;
  padding-bottom: 3px;
}

#monthToMonthEndDateText {
  display: none;
}

.field-note {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  min-height: 38px;
  width: 100%;
  border: 1px solid #b5c5d5;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), 0 2px 5px rgba(15, 23, 42, 0.08);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border-radius: 3px;
  background: initial;
  box-shadow: none;
  accent-color: var(--blue);
  flex: 0 0 auto;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #5f9df1;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.14), 0 2px 5px rgba(15, 23, 42, 0.07);
  outline: none;
}

input.missing-required,
select.missing-required,
textarea.missing-required,
.table-input.missing-required {
  border-color: #d99a1e;
  background: #fff8e6;
  box-shadow: 0 0 0 2px rgba(217, 154, 30, 0.12);
}

input[readonly] {
  background: #f3f6fa;
  color: var(--muted);
}

textarea {
  min-height: 78px;
  resize: vertical;
  font: inherit;
  line-height: 1.4;
}

.internal-comments {
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px;
  color: var(--ink);
}

.internal-comments:empty {
  display: none;
}

.internal-comments-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.internal-comment-entry {
  border-top: 1px solid #dfe7ef;
  padding-top: 8px;
  margin-top: 8px;
}

.internal-comment-entry:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.internal-comment-meta {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.internal-comment-text {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
}

.customer-sites-panel {
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.customer-sites-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.customer-sites-header h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.customer-sites-list {
  display: grid;
  gap: 8px;
}

.customer-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #dce5ef;
  border-radius: 7px;
  background: #ffffff;
  padding: 10px;
}

.customer-site-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--ink);
  font-weight: 900;
}

.customer-site-details {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.site-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #16825a;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
}

.muted-site-pill {
  background: #e8eef5;
  color: var(--muted);
}

.customer-select-search {
  min-height: 36px;
  font-size: 13px;
  padding-right: 46px;
}

.customer-picker-row {
  position: relative;
}

.customer-picker-clear-btn {
  right: 8px;
}

.search-input-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.search-input-wrap input[type="search"] {
  width: 100%;
  min-width: 0;
  padding-right: 46px;
}

.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5d6b7a;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

label > .search-input-wrap,
.form-grid .search-input-wrap,
.form-grid.compact .search-input-wrap {
  width: 100%;
}

.search-clear-btn:hover {
  background: #e8eef5;
  color: var(--ink);
}

.customer-picker-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: start;
}

.site-picker-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.site-picker-row .compact-action-button {
  min-height: 44px;
  white-space: nowrap;
}

.agreement-customer-site-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ppsr-registration-panel {
  max-width: 900px;
}

.ppsr-warning-stack {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.ppsr-warning {
  padding: 10px 12px;
  border: 1px solid #f0d293;
  border-radius: 8px;
  background: #fff8e6;
  color: #7c4a03;
  font-size: 13px;
  font-weight: 800;
}

#copyAllPpsrDetails:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ppsr-detail-grid {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.ppsr-detail-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.ppsr-detail-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ppsr-detail-value {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.customer-search-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  width: min(520px, 100%);
  max-height: 260px;
  overflow: auto;
  overscroll-behavior-x: contain;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.customer-search-option,
.customer-search-empty {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 9px 11px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}

.customer-search-option:hover,
.customer-search-option:focus {
  background: #eef5ff;
  outline: none;
}

.customer-search-empty {
  color: var(--muted);
}

.bulk-actions .inline-control .customer-select-search {
  padding: 7px 9px;
}

.bulk-actions .inline-control .customer-picker-row {
  width: min(430px, 100%);
}

.bulk-actions .inline-control .customer-picker-row select {
  width: 100%;
}

.wide {
  grid-column: span 2;
}

.form-grid.compact > .customer-search-label {
  grid-column: span 2;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.save-split-control {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  filter: drop-shadow(0 14px 24px rgba(31, 111, 235, 0.20));
}

.save-split-main {
  min-width: 184px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: none;
}

.save-split-toggle {
  width: 58px;
  min-width: 58px;
  padding: 0;
  border-left: 1px solid rgba(17, 82, 176, 0.50);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: none;
}

.save-split-toggle::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #ffffff;
}

.save-split-toggle[aria-expanded="true"] {
  background: linear-gradient(180deg, #2f7beb 0%, #1f66d6 100%);
}

.save-split-menu {
  position: absolute !important;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  display: flex !important;
  flex-direction: column;
  min-width: 320px;
  max-width: min(420px, 92vw);
  overflow: hidden;
  border: 1px solid #d3deea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18), 0 4px 10px rgba(15, 23, 42, 0.08);
}

.save-split-menu.hidden {
  display: none !important;
}

.save-split-menu .save-split-item {
  appearance: none;
  display: block !important;
  width: 100% !important;
  min-height: 46px;
  margin: 0;
  padding: 13px 16px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  color: var(--ink) !important;
  text-align: left !important;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
}

.save-split-menu .save-split-item + .save-split-item {
  border-top: 1px solid #edf2f7 !important;
}

.save-split-menu .save-split-item:hover,
.save-split-menu .save-split-item:focus {
  background: #edf5ff !important;
  color: var(--blue-dark) !important;
  outline: none;
}

.form-grid-button {
  align-self: end;
  min-height: 40px;
}

.form-grid-button.compact-action-button {
  justify-self: start;
  width: auto;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.field-summary {
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  align-content: center;
  gap: 3px;
}

.field-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.allocation-action-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.2fr) minmax(180px, 0.55fr);
  gap: 12px;
  align-items: end;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid #bfd4ee;
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: #f6faff;
}

.allocation-action-panel strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.allocation-action-panel span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.collapsible-form-toggle {
  width: auto;
  min-width: 260px;
  margin-bottom: 12px;
}

.primary-btn {
  background: linear-gradient(180deg, #3c8cff 0%, var(--blue) 78%, #185bc8 100%);
  color: white;
  box-shadow: 0 14px 28px rgba(31, 111, 235, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.secondary-btn,
.file-btn {
  display: inline-grid;
  place-items: center;
  border: 1px solid #d8e3ef;
  background: linear-gradient(180deg, #f8fbff 0%, #e7eef7 100%);
  color: var(--ink);
}

.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled),
.danger-btn:hover:not(:disabled),
.file-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-raised), inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.primary-btn:active:not(:disabled),
.secondary-btn:active:not(:disabled),
.danger-btn:active:not(:disabled),
.file-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12), inset 0 2px 4px rgba(15, 23, 42, 0.10);
}

.report-actions .primary-btn,
.report-actions .secondary-btn,
.report-actions .file-btn {
  font-size: 14px;
  line-height: 1.2;
}

.report-actions {
  display: flex !important;
  flex-wrap: wrap;
  grid-template-columns: repeat(3, max-content);
  justify-content: start;
  align-items: center;
  gap: 10px;
}

.report-actions .primary-btn,
.report-actions .secondary-btn,
.report-actions .file-btn {
  width: auto;
  min-width: 170px;
  max-width: 240px;
  padding-inline: 16px;
}

.report-panel > h3,
.invoice-register-panel > h3,
.depreciation-report-panel > h3 {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 19px;
}

.report-panel .form-grid.compact,
.report-actions,
.depreciation-actions {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f3f7fb;
}

.report-panel .table-wrap {
  border: 1px solid var(--line);
  background: #ffffff;
}

.report-panel .pagination-controls {
  margin-top: 12px;
}

.reports-dashboard-panel {
  display: grid;
  gap: 18px;
  border-left: 5px solid var(--blue-dark);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.report-dashboard-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.report-dashboard-tabs .section-tab {
  min-height: 64px;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue-dark);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #f3f7fb);
  color: var(--ink);
  padding: 14px 16px;
  font-size: 15px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(22, 47, 73, 0.05);
}

.report-dashboard-tabs .section-tab:nth-child(2) {
  border-left-color: var(--amber);
}

.report-dashboard-tabs .section-tab:nth-child(3) {
  border-left-color: var(--purple);
}

.report-dashboard-tabs .section-tab.active {
  border-color: rgba(43, 114, 217, 0.45);
  border-left-color: var(--blue);
  background: #eaf3ff;
  color: var(--blue-dark);
  box-shadow: inset 0 -3px 0 var(--blue), 0 10px 22px rgba(43, 114, 217, 0.12);
}

.reports-landing {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.reports-landing.hidden {
  display: none;
}

.reports-overview-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(22, 47, 73, 0.05);
}

.report-dashboard-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 9px;
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue-dark);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #f3f7fb);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 24px rgba(22, 47, 73, 0.06);
  cursor: pointer;
}

.report-dashboard-card:nth-child(2) {
  border-left-color: var(--amber);
}

.report-dashboard-card:nth-child(3) {
  border-left-color: var(--purple);
}

.report-dashboard-card:hover {
  border-color: rgba(43, 114, 217, 0.42);
  transform: translateY(-1px);
}

.reports-overview-card span,
.report-dashboard-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.reports-overview-card strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.reports-overview-card small {
  max-width: 980px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.report-dashboard-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.report-dashboard-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.report-dashboard-card em {
  align-self: end;
  justify-self: start;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.admin-list-manager {
  grid-column: 1 / -1;
  display: grid;
  border-left-color: var(--teal);
}

.admin-list-manager > div:first-child {
  display: grid;
  gap: 7px;
}

.admin-list-manager span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-list-manager strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.admin-list-manager small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-list-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(180px, 0.9fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-list-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-list-controls input,
.admin-list-controls select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  padding: 9px 11px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.admin-list-controls .primary-btn {
  min-height: 42px;
  padding: 9px 18px;
  white-space: nowrap;
}

.admin-list-rows {
  display: grid;
  gap: 8px;
}

.admin-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbff;
}

.admin-list-row > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-transform: none;
}

.admin-list-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.admin-list-subheading {
  margin: 10px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.muted-admin-list-row {
  background: #f3f6fa;
}

.muted-admin-list-row > span:first-child {
  color: var(--muted);
}

.secondary-btn.hidden,
.primary-btn.hidden,
.danger-btn.hidden,
.file-btn.hidden {
  display: none;
}

.danger-btn {
  background: #ffe8e6;
  color: #9f2d28;
}

.save-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  min-width: 240px;
  max-width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid #cbd8e6;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.save-toast.hidden {
  display: none;
}

.save-toast strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.save-toast span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.save-toast.saved {
  border-left-color: var(--green);
}

.save-toast.failed {
  border-left-color: var(--red);
}

.file-btn input {
  display: none;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 14px;
  min-height: 38px;
}

.bulk-actions .primary-btn,
.bulk-actions .secondary-btn,
.bulk-actions .file-btn,
.equipment-control-card .primary-btn,
.equipment-control-card .secondary-btn,
.equipment-control-card .file-btn {
  min-width: 118px;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.bulk-actions .push-right,
.bulk-actions > .dropdown-control.push-right {
  margin-left: auto;
}

.bulk-actions [data-status-menu$="-bulk"] {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.bulk-actions [data-status-menu$="-bulk"]::after {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: #9fc3f7;
}

.bulk-actions [data-status-menu$="-bulk"] .dropdown-toggle {
  padding-left: 18px;
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
}

.bulk-actions [data-status-menu$="-bulk"] .dropdown-toggle::before {
  content: none;
}

.bulk-actions [data-bulk-delete] {
  color: #8f2f2a;
}

.import-review-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.import-review-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.import-review-header h4 {
  margin: 0 0 4px;
  font-size: 18px;
}

.import-review-actions label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--muted);
}

.import-review-table td {
  vertical-align: top;
}

.import-review-needed {
  background: #fff7dd;
}

.import-serial-warning-cell {
  color: #8a4b00;
  font-weight: 700;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.dropdown-control {
  position: relative;
  min-width: 190px;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  text-align: left;
  gap: 12px;
}

.dropdown-toggle::after {
  content: "⌄";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin-left: auto;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  line-height: 1;
  opacity: 0.65;
}

.dropdown-menu {
  position: absolute;
  z-index: 35;
  top: calc(100% + 5px);
  left: 0;
  min-width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-option {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.dropdown-option:hover,
.dropdown-option:focus,
.dropdown-option.active {
  background: #eef5ff;
  outline: none;
}

.bulk-actions.secondary-action-row {
  margin-top: -4px;
}

.bulk-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bulk-actions .inline-control {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
}

.bulk-actions .inline-control select {
  width: 160px;
  padding: 7px 9px;
}

.bulk-actions .checkbox-control {
  color: var(--ink);
  gap: 6px;
}

.bulk-actions .checkbox-control input {
  width: auto;
  min-height: 0;
}

.equipment-controls {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.equipment-control-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.04);
}

.equipment-allocation-section {
  border-color: #bfd4ee;
  border-left: 5px solid var(--primary);
  background: #f7fbff;
}

.equipment-control-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.equipment-control-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.equipment-filter-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.compact.equipment-filter-controls > .customer-search-label {
  grid-column: span 2;
}

.equipment-filter-controls .customer-picker-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.equipment-allocation-section .allocation-action-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: start;
  max-width: 1120px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.equipment-allocation-section .allocation-action-panel > label {
  grid-column: span 2;
  width: 100%;
}

.equipment-allocation-section .customer-picker-row {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.equipment-allocation-section [data-bulk-allocate="equipment"] {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding-left: 18px;
  padding-right: 18px;
  white-space: nowrap;
}

.equipment-control-card {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 12px;
}

.control-card-title {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.equipment-filter-grid,
.equipment-action-grid,
.equipment-tool-grid {
  display: grid;
  gap: 8px;
  align-items: end;
}

.equipment-filter-grid {
  grid-template-columns: minmax(280px, 1.3fr) minmax(320px, 1fr) minmax(220px, 0.8fr);
}

.equipment-action-grid {
  grid-template-columns: minmax(420px, 1.35fr) minmax(220px, 0.75fr) minmax(390px, 1fr);
  align-items: stretch;
}

.equipment-tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  padding-top: 10px;
}

.equipment-action-section {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.action-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.action-section-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 8px;
}

.action-section-row .inline-control {
  flex: 1 1 180px;
  min-width: 0;
}

.action-section-row .primary-btn,
.action-section-row .secondary-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.equipment-control-card .inline-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.equipment-control-card .inline-control .customer-picker-row,
.equipment-filter-grid .customer-picker-row {
  width: 100%;
}

.equipment-tool-grid > button,
.equipment-tool-grid > .file-btn {
  min-height: 36px;
}

.action-section-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  align-self: center;
  white-space: nowrap;
}

.equipment-admin-tools {
  position: relative;
  width: auto;
  justify-self: auto;
}

.equipment-admin-tools summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: max-content;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: #e8edf3;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.equipment-admin-tools summary::-webkit-details-marker {
  display: none;
}

.equipment-admin-tools summary::after {
  content: "▾";
  font-size: 13px;
  opacity: 0.65;
}

.equipment-admin-tools[open] summary::after {
  content: "▴";
}

.equipment-admin-tools .equipment-tool-grid {
  position: absolute;
  z-index: 35;
  top: calc(100% + 5px);
  right: 0;
  min-width: 240px;
  padding: 10px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pagination-controls div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-controls strong {
  color: var(--ink);
  font-size: 12px;
}

.pagination-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.pagination-controls select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pagination-controls .mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.agreement-history-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.agreement-history-panel h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
}

.agreement-history-summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.agreement-history-summary span {
  color: var(--muted);
}

.compact-table-wrap table {
  min-width: 720px;
}

.agreement-history-table th,
.agreement-history-table td {
  padding: 8px;
  font-size: 12px;
}

.agreement-history-table .history-notes-cell {
  max-width: 34rem;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.selection-col {
  width: 42px;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  background: #f6f9fc;
  color: var(--muted);
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.section-tab.active {
  background: #ffffff;
  border-color: var(--line);
  border-bottom-color: var(--blue);
  color: var(--blue-dark);
  box-shadow: inset 0 -2px 0 var(--blue), 0 4px 12px rgba(22, 47, 73, 0.05);
}

.report-panel .compact-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 820px;
  margin: 0 0 12px;
  padding: 6px;
  border: 1px solid var(--line);
  background: #f3f7fb;
}

.report-panel .compact-tabs .section-tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  white-space: normal;
}

.report-panel .compact-tabs .section-tab.active {
  border-color: rgba(43, 114, 217, 0.32);
  background: #ffffff;
  color: var(--blue-dark);
  box-shadow: 0 4px 10px rgba(22, 47, 73, 0.06);
}

.equipment-tab-panel {
  display: none;
}

.equipment-tab-panel.active,
.report-tab-panel.active {
  display: block;
  animation: tabPanelFadeLift 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.report-tab-panel {
  display: none;
}

.report-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 24px rgba(22, 47, 73, 0.05);
}

.invoice-register-panel {
  border-left-color: var(--amber);
}

.depreciation-report-panel {
  border-left-color: var(--purple);
}

.report-panel.active {
  display: block;
}

.report-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.report-screen-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.report-screen-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
}

.report-control-bar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f3f7fb;
}

.report-control-bar .primary-btn,
.report-control-bar .secondary-btn {
  min-height: 44px;
  padding: 9px 14px;
  white-space: nowrap;
}

th input[type="checkbox"],
td input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.table-input {
  width: 100%;
  min-width: 98px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
  color: var(--ink);
}

.money-input {
  min-width: 86px;
}

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

.report-block h4 {
  margin: 14px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  background: #ffffff;
  color: var(--ink);
}

.report-letterhead {
  display: flex;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  align-items: center;
}

.report-letterhead h2 {
  margin: 0;
  font-size: 18px;
}

.report-letterhead p {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.report-letterhead .document-logo {
  width: 96px;
  max-height: 42px;
  object-fit: contain;
}

.document-classification {
  display: inline-block;
  margin: 4px 0 0;
  padding: 2px 7px;
  border: 1px solid #b8c7d8;
  border-radius: 4px;
  color: #15345a;
  background: #f3f7fb;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.document-classification.internal {
  border-color: #cfb46a;
  color: #5b4200;
  background: #fff7df;
}

.document-classification.draft {
  border-color: #d8a321;
  color: #5b4200;
  background: #fff7d6;
}

.document-classification-draft {
  background: #ffe08a;
  color: #3b2f00;
  padding: 1px 5px;
  border-radius: 3px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.report-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #f3f7fb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-meta strong {
  color: var(--ink);
}

.report-summary div {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  padding: 12px;
  background: #ffffff;
}

.report-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.report-summary strong {
  font-size: 16px;
  color: var(--ink);
}

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

.compact-summary div {
  padding: 10px;
}

.compact-summary strong {
  font-size: 14px;
}

.report-block > .bulk-actions {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: #f3f7fb;
}

.print-footer {
  display: none;
}

.print-footer::after {
  content: attr(data-footer-text);
}

.print-footer.hide-page-numbering .print-footer-top span:last-child {
  display: none;
}

.manual-report-print {
  display: none;
}

.clean-print-page {
  display: none;
}

.document-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.1fr) minmax(0, 0.85fr);
  gap: 18px;
  margin-top: 24px;
  border-top: 1px solid #cfd8e3;
  padding-top: 8px;
  color: #637381;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.document-footer strong {
  color: #374151;
}

.transaction-print {
  display: none;
}

.asset-tag-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10mm;
  color: #111827;
}

.asset-tag {
  min-height: 62mm;
  padding: 8mm;
  border: 1px solid #111827;
  page-break-inside: avoid;
  display: grid;
  gap: 5mm;
}

.asset-tag-header {
  display: flex;
  gap: 5mm;
  align-items: flex-start;
}

.asset-tag-header img {
  width: 44mm;
  height: auto;
  object-fit: contain;
}

.asset-tag-header div {
  display: grid;
  gap: 1mm;
  font-size: 8.5pt;
  line-height: 1.25;
}

.asset-tag-header strong {
  font-size: 10pt;
}

.asset-tag-title {
  font-size: 10pt;
  font-weight: 800;
  line-height: 1.2;
}

.asset-barcode {
  width: 100%;
  height: 18mm;
  display: block;
  fill: #000000;
}

.asset-tag-code {
  text-align: center;
  font-size: 13pt;
  font-weight: 900;
  letter-spacing: 1px;
}

.asset-tag-meta {
  display: flex;
  justify-content: space-between;
  gap: 6mm;
  border-top: 1px solid #cfd8e3;
  padding-top: 3mm;
  font-size: 9pt;
}

.asset-tag-meta span {
  color: #637381;
  font-weight: 800;
}

.transaction-document {
  color: #111827;
  page-break-after: always;
}

.transaction-document:last-child {
  page-break-after: auto;
}

.transaction-summary-document {
  page-break-after: auto;
}

.report-letterhead,
.document-letterhead {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  min-width: 0;
}

.document-logo {
  display: block;
  width: 150px;
  height: auto;
  object-fit: contain;
}

.transaction-header {
  position: relative;
  min-height: 122px;
  padding-bottom: 14px;
  border-bottom: 1px solid #64748b;
}

.transaction-header h2,
.transaction-header p,
.report-letterhead h2,
.report-letterhead p,
.transaction-title strong,
.transaction-title span {
  margin: 0;
}

.transaction-title {
  display: grid;
  gap: 5px;
  position: absolute;
  top: 28px;
  right: 28px;
  width: 420px;
  text-align: right;
}

.transaction-title strong {
  font-size: 18px;
  line-height: 1.12;
}

.transaction-title span {
  font-weight: 800;
  color: #334155;
}

.transaction-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.transaction-meta-grid div,
.transaction-customer,
.transaction-notes {
  border: 1px solid #cfd8e3;
  padding: 12px;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.record-grid div {
  border: 1px solid #cfd8e3;
  padding: 12px;
}

.record-grid span {
  display: block;
  color: #637381;
  font-size: 12px;
  margin-bottom: 4px;
}

.record-grid strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.report-detail-grid {
  margin-top: 0;
}

.report-detail-grid .wide {
  grid-column: 1 / -1;
}

.transaction-meta-grid span {
  display: block;
  color: #637381;
  font-size: 12px;
  margin-bottom: 4px;
}

.transaction-customer h3,
.transaction-notes h3,
.authorisation-block h3,
.accepted-block h3 {
  margin: 18px 0 8px;
  font-size: 15px;
}

.transaction-customer h3 {
  margin-top: 0;
}

.transaction-customer p,
.transaction-notes p,
.authorisation-block p {
  margin: 4px 0;
}

.print-notes-box p {
  min-height: 54px;
}

.accepted-block {
  margin-top: 24px;
}

.authorisation-block {
  margin-top: 24px;
  border: 1px solid #cfd8e3;
  padding: 12px;
}

.authorisation-block p {
  color: #374151;
  font-size: 12px;
  line-height: 1.45;
}

.transaction-table {
  width: 100%;
  min-width: 0;
  margin: 18px 0;
  border-collapse: collapse;
}

.transaction-table th,
.transaction-table td {
  border: 1px solid #cfd8e3;
  padding: 9px;
  text-align: left;
}

.transaction-table th {
  background: #eef4fb;
}

.replacement-cost-note {
  margin: 4px 0 14px;
  color: #52616f;
  font-size: 11px;
  line-height: 1.35;
}

.summary-table {
  font-size: 12px;
}

.agreement-print-page {
  break-after: page;
  page-break-after: always;
  break-inside: avoid;
  page-break-inside: avoid;
}

.agreement-print-page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.agreement-equipment-table {
  font-size: 10px;
}

.agreement-equipment-table th,
.agreement-equipment-table td {
  padding: 6px;
  overflow-wrap: break-word;
  word-break: normal;
}

.agreement-equipment-table th:nth-child(1),
.agreement-equipment-table td:nth-child(1),
.agreement-equipment-table th:nth-child(5),
.agreement-equipment-table td:nth-child(5),
.agreement-equipment-table th:nth-child(6),
.agreement-equipment-table td:nth-child(6),
.agreement-equipment-table th:nth-child(7),
.agreement-equipment-table td:nth-child(7) {
  white-space: nowrap !important;
  overflow-wrap: normal;
  word-break: normal;
}

.agreement-equipment-table th:nth-child(4),
.agreement-equipment-table td:nth-child(4) {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.agreement-equipment-table .nowrap-cell {
  white-space: nowrap !important;
  overflow-wrap: normal;
  word-break: normal;
}

.muted-print-text {
  color: #52616f;
  font-size: 0.88em;
  font-weight: 500;
}

.customer-print-equipment-table th,
.customer-print-equipment-table td {
  font-size: 8.2pt;
  padding: 1.7mm;
}

.customer-print-equipment-table th:nth-child(1),
.customer-print-equipment-table td:nth-child(1) { width: 9% !important; }
.customer-print-equipment-table th:nth-child(2),
.customer-print-equipment-table td:nth-child(2) { width: 11% !important; }
.customer-print-equipment-table th:nth-child(3),
.customer-print-equipment-table td:nth-child(3) { width: 27% !important; }
.customer-print-equipment-table th:nth-child(4),
.customer-print-equipment-table td:nth-child(4) { width: 10% !important; }
.customer-print-equipment-table th:nth-child(5),
.customer-print-equipment-table td:nth-child(5) { width: 16% !important; }
.customer-print-equipment-table th:nth-child(6),
.customer-print-equipment-table td:nth-child(6) { width: 5% !important; }
.customer-print-equipment-table th:nth-child(7),
.customer-print-equipment-table td:nth-child(7) { width: 15% !important; }
.customer-print-equipment-table th:nth-child(8),
.customer-print-equipment-table td:nth-child(8) { width: 8% !important; }

.customer-print-equipment-table th:nth-child(1),
.customer-print-equipment-table td:nth-child(1),
.customer-print-equipment-table th:nth-child(2),
.customer-print-equipment-table td:nth-child(2),
.customer-print-equipment-table th:nth-child(6),
.customer-print-equipment-table td:nth-child(6),
.customer-print-equipment-table th:nth-child(8),
.customer-print-equipment-table td:nth-child(8),
.transaction-table th:last-child,
.transaction-table td:last-child {
  overflow-wrap: normal;
  word-break: normal;
}

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

.clean-detail-grid div {
  border: 1px solid #cfd8e3;
  padding: 8px;
}

.clean-detail-grid .wide {
  grid-column: 1 / -1;
}

.clean-detail-grid span {
  display: block;
  color: #637381;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 3px;
}

.clean-detail-grid strong {
  font-size: 12px;
}

.clean-print-section h3 {
  margin: 10px 0 8px;
}

.summary-table th,
.summary-table td {
  padding: 7px;
  vertical-align: top;
}

.install-summary-table th:last-child,
.install-summary-table td:last-child {
  white-space: nowrap;
}

.transaction-invoice-table th:nth-child(5),
.transaction-invoice-table td:nth-child(5) {
  white-space: nowrap;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.signature-grid div {
  min-height: 64px;
  border-bottom: 1px solid #111827;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
}

.signature-grid strong {
  display: block;
  color: #111827;
  font-size: 13px;
  line-height: 1.2;
  min-height: 18px;
  padding-bottom: 5px;
}

.signature-grid span {
  display: block;
  color: #637381;
  font-size: 12px;
  padding-bottom: 10px;
}

.pdf-text {
  max-height: 260px;
  overflow: auto;
  overscroll-behavior-x: contain;
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: white;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th,
.dashboard-table th,
.screen-table th,
.install-table th,
.equipment-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 44px;
  padding: 11px 12px;
  background: #edf4fb;
  color: #28445f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  vertical-align: middle;
  text-transform: none;
}

tr:hover td {
  background: #f8fbff;
}

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

tbody tr:nth-child(even):hover td {
  background: #f4f9ff;
}

.screen-table,
.install-table {
  table-layout: fixed;
}

.screen-table {
  min-width: 1080px;
}

.forward-forecast-table {
  min-width: 1780px;
}

.forward-forecast-table col.forecast-customer {
  width: 170px;
}

.forward-forecast-table col.forecast-site {
  width: 260px;
}

.forward-forecast-table col.forecast-agreement {
  width: 130px;
}

.forward-forecast-table col.forecast-type {
  width: 150px;
}

.forward-forecast-table col.forecast-status {
  width: 120px;
}

.forward-forecast-table col.forecast-term {
  width: 130px;
}

.forward-forecast-table col.forecast-dates {
  width: 150px;
}

.forward-forecast-table col.forecast-number {
  width: 110px;
}

.forward-forecast-table col.forecast-money {
  width: 130px;
}

.forward-forecast-table th,
.forward-forecast-table td {
  white-space: normal;
}

.forward-forecast-table td:nth-child(n+8),
.forward-forecast-table th:nth-child(n+8) {
  text-align: right;
}

.forward-forecast-table td:nth-child(3) .cell-note {
  margin-top: 4px;
}

.customer-table {
  min-width: 1120px;
}

.customer-table col.col-id {
  width: 112px;
}

.agreement-table {
  min-width: 2020px;
}

.equipment-table {
  min-width: 2520px;
}

.duplicate-table,
.unallocated-table {
  min-width: 1080px;
}

.unallocated-table th:first-child,
.unallocated-table td:first-child,
.unallocated-table th:nth-child(2),
.unallocated-table td:nth-child(2) {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.unallocated-table th:first-child,
.unallocated-table td:first-child {
  width: 48px;
}

.unallocated-table th:nth-child(2),
.unallocated-table td:nth-child(2) {
  width: 50px;
}

.unallocated-table .row-menu-cell {
  width: 50px;
}

.swap-table {
  min-width: 1380px;
}

.depreciation-table {
  min-width: 1780px;
}

.depreciation-table th {
  background: #e9f2fb;
  color: #233f5a;
}

.depreciation-table th,
.depreciation-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.depreciation-table col.col-select {
  width: 52px;
}

.depreciation-table col.col-report-id {
  width: 118px;
}

.depreciation-table col.col-item {
  width: 300px;
}

.depreciation-table col.col-brand,
.depreciation-table col.col-model,
.depreciation-table col.col-serial,
.depreciation-table col.col-funding {
  width: 150px;
}

.depreciation-table col.col-report-date {
  width: 154px;
}

.depreciation-table col.col-customer {
  width: 190px;
}

.depreciation-table .table-input {
  min-height: 38px;
  background: #ffffff;
}

.install-table {
  min-width: 1120px;
}

.current-equipment-table {
  min-width: 1320px;
}

.movement-report-table {
  min-width: 1460px;
}

col.col-select {
  width: 48px;
}

col.col-row-menu {
  width: 50px;
}

col.col-id {
  width: 72px;
}

col.col-lock {
  width: 42px;
}

col.col-report-id {
  width: 96px;
}

col.col-report-date {
  width: 118px;
}

col.col-movement-id {
  width: 118px;
}

col.col-movement-type {
  width: 160px;
}

col.col-agreement-id {
  width: 104px;
}

col.col-agreement-date {
  width: 156px;
}

col.col-swap-id {
  width: 96px;
}

col.col-invoice {
  width: 118px;
}

col.col-customer {
  width: 210px;
}

col.col-staff {
  width: 180px;
}

col.col-name {
  width: 260px;
}

col.col-item,
col.col-gear {
  width: 320px;
}

col.col-date {
  width: 92px;
}

col.col-status {
  width: 112px;
}

col.col-actions {
  width: 180px;
}

col.col-actions-wide {
  width: 160px;
}

col.col-code,
col.col-source,
col.col-funding,
col.col-reason {
  width: 120px;
}

col.col-ppsr {
  width: 260px;
}

col.col-phone,
col.col-type {
  width: 150px;
}

col.col-brand,
col.col-model,
col.col-serial,
col.col-ppsr-status,
col.col-files {
  width: 160px;
}

.agreement-table td:nth-child(2),
.agreement-table td:nth-child(7),
.agreement-table td:nth-child(11),
.agreement-table td:nth-child(12) {
  white-space: nowrap;
}

.agreement-table td:nth-child(4) {
  white-space: normal;
}

.agreement-table td:nth-child(6) {
  white-space: normal;
}

.agreement-table td:nth-child(8),
.agreement-table td:nth-child(9),
.agreement-table td:nth-child(10) {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.agreement-table col.col-customer {
  width: 250px;
}

.agreement-table col.col-agreement-date {
  width: 190px;
}

.agreement-table col.col-status {
  width: 170px;
}

.agreement-table col.col-small {
  width: 150px;
}

.agreement-table col.col-volume {
  width: 190px;
}

.agreement-table col.col-money {
  width: 190px;
}

.agreement-table col.col-ppsr {
  width: 280px;
}

.agreement-table col.col-ppsr-status {
  width: 210px;
}

.agreement-table col.col-files {
  width: 270px;
}

.agreement-table col.col-actions-wide {
  width: 420px;
}

.agreement-table td:last-child {
  max-width: 270px;
  overflow: hidden;
  text-align: left;
  vertical-align: middle;
}

.agreement-table td:last-child .row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.agreement-table td:last-child .mini-btn {
  min-width: 0;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.agreement-table .attachment-list a {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

col.col-dates {
  width: 130px;
}

col.col-small {
  width: 84px;
}

col.col-money {
  width: 116px;
}

col.col-money-wide {
  width: 150px;
}

col.col-notes {
  width: 300px;
}

.dashboard-table th,
.dashboard-table td,
.screen-table th,
.screen-table td,
.install-table th,
.install-table td {
  overflow-wrap: break-word;
  word-break: normal;
}

.screen-table td,
.install-table td {
  vertical-align: middle;
}

.screen-table tfoot td {
  background: #eef5ff;
  border-top: 2px solid #9db7d6;
  color: #17243a;
  font-weight: 800;
}

.screen-table td:first-child,
.screen-table td:nth-child(2),
.install-table td:first-child,
.install-table td:nth-child(2) {
  text-align: center;
}

.screen-table td:first-child input[type="checkbox"],
.install-table td:first-child input[type="checkbox"] {
  display: block;
  margin: 0 auto;
}

.equipment-table col.col-item {
  width: 340px;
}

.equipment-table col.col-brand,
.equipment-table col.col-model {
  width: 170px;
}

.equipment-table col.col-serial {
  width: 210px;
}

.equipment-table col.col-funding {
  width: 150px;
}

.equipment-table col.col-date {
  width: 170px;
}

.equipment-table col.col-money {
  width: 170px;
}

.equipment-table col.col-money-wide {
  width: 190px;
}

.equipment-table col.col-customer {
  width: 230px;
}

.equipment-table col.col-actions-wide {
  width: 340px;
}

.equipment-table th,
.equipment-table td {
  white-space: normal;
}

.equipment-table td {
  padding-top: 7px;
  padding-bottom: 7px;
  vertical-align: middle;
}

.equipment-table .table-input {
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.equipment-table input[type="checkbox"] {
  display: block;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0 auto;
}

.equipment-table .mini-btn {
  min-height: 30px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.equipment-table .lock-mini-btn,
.depreciation-table .lock-mini-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #7a8796;
  font-size: 14px;
  line-height: 1;
}

.equipment-table .lock-mini-btn.locked,
.depreciation-table .lock-mini-btn.locked {
  border-color: #bdd3f2;
  background: #eaf3ff;
  color: #1558b8;
}

.equipment-table .lock-mini-btn:hover,
.equipment-table .lock-mini-btn:focus,
.depreciation-table .lock-mini-btn:hover,
.depreciation-table .lock-mini-btn:focus {
  border-color: #bdd3f2;
  background: #f1f6fd;
}

.equipment-table .row-actions {
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  min-width: 0;
}

.screen-table td:last-child,
.install-table td:last-child {
  white-space: normal;
}

.screen-table .gear-cell,
.install-table .gear-cell {
  overflow-wrap: normal;
  word-break: normal;
}

.gear-reference {
  align-items: baseline;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gear-reference-link {
  color: #1357b8;
  cursor: pointer;
  display: inline;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  margin: 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.gear-reference-link:visited {
  color: #1357b8;
}

.gear-reference-link:hover,
.gear-reference-link:focus {
  color: #0f4694;
  text-decoration: underline;
}

.gear-reference-description {
  color: #1f2933;
  font-weight: 700;
  margin-left: 2px;
}

.screen-table .row-actions,
.install-table .row-actions {
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  min-width: 0;
}

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

.row-menu-cell {
  position: relative;
  overflow: visible;
  width: 52px;
  text-align: center;
  vertical-align: middle;
}

.row-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-menu-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid #b7d2fb;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 72%, #e4f0ff 100%);
  color: #1558b8;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.row-menu-icon {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-menu-btn:hover,
.row-menu-btn:focus {
  border-color: #2f7beb;
  background: linear-gradient(180deg, #ffffff 0%, #e7f1ff 100%);
  color: #0d54b6;
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(39, 115, 226, 0.16), 0 10px 22px rgba(22, 47, 73, 0.16);
}

.row-menu-btn[aria-expanded="true"],
.row-menu:has(.row-action-menu:not(.hidden)) .row-menu-btn {
  border-color: var(--blue);
  background: linear-gradient(180deg, #edf6ff 0%, #dcecff 100%);
  color: var(--blue-dark);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18), 0 12px 26px rgba(18, 54, 100, 0.18);
}

.row-action-menu {
  position: fixed;
  z-index: 45;
  top: 0;
  left: 0;
  display: grid;
  min-width: 148px;
  max-height: calc(100vh - 16px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22), 0 4px 10px rgba(15, 23, 42, 0.08);
  transform-origin: top left;
  animation: menuPopIn 150ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.row-action-menu.open-up {
  transform-origin: bottom left;
}

.row-action-menu.hidden {
  display: none;
}

.row-menu-option {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.row-menu-option:hover,
.row-menu-option:focus {
  background: #eef5ff;
  color: var(--blue-dark);
  outline: none;
}

.row-menu-option.danger-menu-option {
  color: #9f2d28;
}

.row-menu-option.disabled-row-menu-option,
.row-menu-option:disabled {
  color: #7a8795;
  cursor: not-allowed;
  opacity: 0.65;
}

.row-menu-option.disabled-row-menu-option:hover,
.row-menu-option.disabled-row-menu-option:focus,
.row-menu-option:disabled:hover,
.row-menu-option:disabled:focus {
  background: #ffffff;
  color: #7a8795;
}

.row-menu-more {
  display: grid;
}

.row-menu-more-panel {
  display: grid;
  border-top: 1px solid #e2e8f0;
  background: #f8fbff;
}

.row-menu-more-panel.hidden {
  display: none;
}

.row-menu-more-panel .row-menu-option {
  padding-left: 20px;
  background: #f8fbff;
}

.row-menu-more-panel .row-menu-option:hover,
.row-menu-more-panel .row-menu-option:focus {
  background: #e8f2ff;
}

.row-menu-separator {
  height: 1px;
  margin: 4px 0;
  background: #e2e8f0;
}

.row-action-menu .row-menu-separator:first-child,
.row-action-menu .row-menu-separator:last-child,
.row-menu-separator + .row-menu-separator {
  display: none;
}

.bulk-row-menu {
  display: inline-flex;
  align-items: center;
}

.bulk-row-menu .row-menu-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.print-documents-modal {
  max-width: 760px;
}

.print-document-chooser {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.print-document-chooser section {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fbff;
}

.print-document-chooser h3 {
  margin: 0 0 2px;
  color: #304860;
  font-size: 15px;
}

.print-document-chooser label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2a37;
  font-weight: 850;
}

.print-document-chooser input[type="checkbox"],
.print-document-chooser input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  accent-color: #2b73e8;
}

[hidden] {
  display: none !important;
}

.screen-table tbody tr.click-edit-row,
.install-table tbody tr.click-edit-row {
  cursor: pointer;
}

.screen-table tbody tr.click-edit-row:hover > td,
.install-table tbody tr.click-edit-row:hover > td {
  background: #f5f9ff;
}

.screen-table tbody tr.click-edit-row:has([data-select-row]:checked) > td,
.install-table tbody tr.click-edit-row:has([data-select-row]:checked) > td {
  background: #edf5ff;
}

.screen-table tbody tr.click-edit-row:has([data-select-row]:checked):hover > td,
.install-table tbody tr.click-edit-row:has([data-select-row]:checked):hover > td {
  background: #e5f0ff;
}

.screen-table tbody tr.row-return-highlight > td,
.install-table tbody tr.row-return-highlight > td {
  animation: row-return-highlight 4.2s ease-out;
}

@keyframes row-return-highlight {
  0% {
    background: #fff3c4;
  }
  55% {
    background: #fff8df;
  }
  100% {
    background: inherit;
  }
}

.screen-table tr.duplicate-serial-highlight > td {
  background: #fffdf7;
}

.screen-table tr.duplicate-serial-highlight:hover > td {
  background: #fff9eb;
}

.screen-table tr.duplicate-record-highlight > td {
  background: #fffdf7;
}

.screen-table tr.duplicate-record-highlight:hover > td {
  background: #fff9eb;
}

.screen-table tr.duplicate-serial-highlight > td:first-child,
.screen-table tr.duplicate-record-highlight > td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.duplicate-record-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #eed39a;
  background: #fff7dd;
  color: #6f4b12;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 900;
}

.duplicate-reviewed-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef4fb;
  color: #526579;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 900;
}

.duplicate-serial-product,
.duplicate-serial-cell {
  color: var(--ink);
  font-weight: 800;
}

.duplicate-serial-note {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #eed39a;
  background: #fff7dd;
  color: #6f4b12;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 900;
  white-space: normal;
}

.duplicate-serial-note-cell {
  text-align: left;
  vertical-align: middle;
}

.duplicate-table col.col-notes {
  width: 320px;
}

.duplicate-table td.duplicate-serial-note-cell {
  padding-left: 14px;
}

#printEquipmentHistory {
  align-self: end;
  min-height: 38px;
  white-space: nowrap;
}

.duplicate-table .duplicate-serial-group-start > td {
  border-top-width: 4px;
}

.duplicate-serial-group > td {
  border-left: 0;
  border-right: 0;
}

.duplicate-serial-group-1 > td {
  background: #fffdf7;
}

.duplicate-serial-group-2 > td {
  background: #f8fbff;
}

.duplicate-serial-group-3 > td {
  background: #f9fdf9;
}

.duplicate-serial-group-4 > td {
  background: #fbf9ff;
}

.duplicate-serial-group-5 > td {
  background: #fff9f8;
}

.duplicate-serial-group-6 > td {
  background: #eef2f6;
}

.duplicate-serial-group-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(21, 44, 72, 0.12);
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.no-serial-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 7px;
  background: #eef2f6;
  border: 1px solid #cbd7e3;
  color: #526678;
  font-weight: 850;
  white-space: nowrap;
}

.cell-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.agreement-version-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.agreement-version-stack span {
  display: block;
}

.agreement-date-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 150px;
  line-height: 1.18;
  white-space: normal;
}

.agreement-date-stack span {
  display: block;
}

.agreement-term-stack {
  display: inline-grid;
  gap: 2px;
  max-width: 100%;
  line-height: 1.15;
  white-space: normal;
}

.agreement-term-stack span {
  display: block;
}

.agreement-extension-line {
  color: #1556a8;
  font-weight: 800;
}

.site-note {
  color: #1556a8;
  font-weight: 800;
}

.muted-line {
  margin: 0 0 12px;
  color: var(--muted);
}

.mini-btn {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.mini-btn:disabled {
  opacity: 0.45;
}

.danger-mini-btn {
  border-color: #f0b7b2;
  background: #fff5f4;
  color: #9f2d28;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.edit-list-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  text-decoration: underline;
  white-space: nowrap;
}

.text-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
}

.attachment-list {
  display: grid;
  gap: 5px;
  align-items: start;
  max-width: 100%;
  min-width: 0;
}

.attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  width: 100%;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.attachment-file-link {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-delete-link {
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: #9f2d28;
  font-size: 10px;
  font-weight: 900;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  background: var(--soft);
}

.status.available,
.status.active,
.status.completed {
  background: var(--green-soft);
  color: var(--green);
}

.status.installed,
.status.at-customer,
.status.active-fixed-term,
.status.current-active,
.status.returned-installed {
  background: #e8f1ff;
  color: var(--blue-dark);
}

.status.returned,
.status.closed,
.status.ended,
.status.discharged-ended {
  background: var(--closed-soft);
  color: #4b5b6b;
}

.status.allocated,
.status.delivered,
.status.draft,
.status.booked,
.status.ending-soon,
.status.expiring-soon {
  background: var(--amber-soft);
  color: var(--amber);
}

.status.review-needed,
.status.service-due,
.status.active-month-to-month {
  background: var(--purple-soft);
  color: var(--purple);
}

.status.needs-service,
.status.in-workshop,
.status.overdue,
.status.lost,
.status.expired-review-required,
.status.cancelled,
.status.retired,
.status.damaged {
  background: var(--red-soft);
  color: var(--red);
}

.status.status-tone-good {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-border);
}

.status.status-tone-installed {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-border);
}

.status.status-tone-available {
  background: #def7f3;
  color: var(--teal);
  border-color: #99e6dc;
}

.status.status-tone-draft,
.status.status-tone-warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-border);
}

.status.status-tone-bad {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red-border);
}

.status.status-tone-closed {
  background: var(--closed-soft);
  color: #4b5b6b;
  border-color: var(--closed-border);
}

.status.status-tone-neutral {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-color: var(--blue-border);
}

.status.status-tone-sold,
.status.sold,
.status.sold-to-customer {
  background: var(--purple-soft);
  color: var(--purple);
  border-color: var(--purple-border);
}

.id-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 7px;
  font-weight: 800;
  line-height: 1.1;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 2px 5px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

.id-status-pill.status-tone-good {
  background: linear-gradient(180deg, #e9fff2 0%, var(--green-soft) 100%);
  color: var(--green);
  border-color: var(--green-border);
}

.id-status-pill.status-tone-installed {
  background: linear-gradient(180deg, #e9fff2 0%, var(--green-soft) 100%);
  color: var(--green);
  border-color: var(--green-border);
}

.id-status-pill.status-tone-available {
  background: linear-gradient(180deg, #effdfa 0%, #def7f3 100%);
  color: var(--teal);
  border-color: #99e6dc;
}

.id-status-pill.status-tone-draft,
.id-status-pill.status-tone-warn {
  background: linear-gradient(180deg, #fff8df 0%, var(--amber-soft) 100%);
  color: var(--amber);
  border-color: var(--amber-border);
}

.id-status-pill.status-tone-bad {
  background: linear-gradient(180deg, #fff0ef 0%, var(--red-soft) 100%);
  color: var(--red);
  border-color: var(--red-border);
}

.id-status-pill.status-tone-closed {
  background: linear-gradient(180deg, #f7fafc 0%, var(--closed-soft) 100%);
  color: #4b5b6b;
  border-color: var(--closed-border);
}

.id-status-pill.status-tone-neutral {
  background: linear-gradient(180deg, #f3f8ff 0%, var(--blue-soft) 100%);
  color: var(--blue-dark);
  border-color: var(--blue-border);
}

.id-status-pill.status-tone-sold {
  background: linear-gradient(180deg, #f7f2ff 0%, var(--purple-soft) 100%);
  color: var(--purple);
  border-color: var(--purple-border);
}

.review-note {
  max-width: 150px;
}

.agreement-status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.agreement-status-stack .status {
  white-space: nowrap;
}

.agreement-status-stack .review-note {
  display: block;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .recovery-guide-grid {
    grid-template-columns: 1fr;
  }

  .recovery-checklist ul {
    columns: 1;
  }

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    max-height: none;
    gap: 10px;
    padding: 10px 12px 12px;
    overflow: visible;
  }

  .brand {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding-bottom: 10px;
  }

  .brand-logo {
    width: 118px;
  }

  .brand h1 {
    max-width: none;
    font-size: 16px;
    line-height: 1.1;
  }

  .brand-subtitle {
    margin-top: 3px !important;
    font-size: 9px !important;
  }

  .brand-version {
    margin-top: 5px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
  }

  .nav {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow: visible;
    padding: 8px 0 0;
    scroll-snap-type: none;
  }

  .sidebar.mobile-menu-open .nav {
    display: grid;
  }

  .nav-btn {
    min-height: 34px;
    padding: 9px 11px;
    white-space: normal;
    scroll-snap-align: none;
    font-size: 12px;
    justify-content: center;
    text-align: center;
  }

  .side-actions {
    display: none;
    position: static;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
    padding-top: 8px;
    background: none;
  }

  .sidebar.mobile-menu-open .side-actions {
    display: grid;
  }

  .side-actions .secondary-btn {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .undo-box {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 10px;
  }

  .workspace {
    padding: 14px 10px 18px;
  }

  .topbar,
  .split,
  .dashboard-overview-grid,
  .dashboard-status-grid,
  .dashboard-action-cards,
  .settings-grid,
  .settings-template-form,
  .template-list-row,
  .reports-landing,
  .report-dashboard-tabs,
  .admin-list-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-actions {
    grid-template-columns: 1fr;
  }

  .settings-actions .secondary-btn,
  .settings-actions .primary-btn,
  .settings-actions .danger-btn,
  .settings-actions .file-btn {
    width: 100%;
  }

  .view-title-row {
    align-items: flex-start;
  }

  .help-trigger {
    width: 30px;
    height: 30px;
  }

  .activity-row {
    grid-template-columns: 1fr;
  }

  .activity-row em {
    justify-self: start;
  }

  .activity-row p {
    grid-column: 1;
  }

  .kpis,
  .global-search-wrap,
  .report-control-bar,
  .form-grid,
  .form-grid.compact,
  .equipment-filter-controls,
  .equipment-allocation-section .allocation-action-panel,
  .equipment-allocation-section .customer-picker-row,
  .equipment-filter-grid,
  .equipment-action-grid,
  .equipment-tool-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .panel {
    padding: 16px;
  }

  .panel h3 {
    font-size: 20px;
    line-height: 1.15;
  }

  .customer-picker-row {
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    margin: 10px 0 14px;
  }

  .bulk-actions.secondary-action-row {
    margin-top: -2px;
  }

  .bulk-actions .push-right,
  .bulk-actions > .dropdown-control.push-right {
    margin-left: 0;
  }

  .bulk-actions .primary-btn,
  .bulk-actions .secondary-btn,
  .bulk-actions .danger-btn,
  .bulk-actions .file-btn,
  .bulk-actions .dropdown-toggle {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    padding: 10px 12px;
    white-space: normal;
  }

  .bulk-actions > .dropdown-control,
  .bulk-actions > .inline-control {
    width: 100%;
    min-width: 0;
  }

  .bulk-actions > .inline-control {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: stretch;
  }

  .save-split-control {
    width: 100%;
  }

  .save-split-main {
    flex: 1;
    min-width: 0;
  }

  .save-split-menu {
    min-width: 100%;
  }

  .bulk-actions > span {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 2px;
  }

  .bulk-actions .inline-control select,
  .bulk-actions .inline-control .customer-picker-row,
  .bulk-actions .inline-control .customer-picker-row select {
    width: 100%;
  }

  .bulk-actions .dropdown-menu {
    width: 100%;
  }

  .bulk-actions .dropdown-option {
    min-height: 42px;
    font-size: 14px;
  }

  .search-input-wrap .search-clear-btn {
    width: 28px;
    height: 28px;
    min-height: 28px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  html,
  body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.printing-customer-report .sidebar,
  body.printing-customer-report .topbar,
  body.printing-customer-report .view:not(#reports),
  body.printing-customer-report .section-tabs,
  body.printing-customer-report .depreciation-report-panel,
  body.printing-customer-report #printCurrentCustomerReport,
  body.printing-customer-report #printFullCustomerReport,
  body.printing-customer-report #reportCustomer,
  body.printing-customer-report .customer-report-panel .form-grid,
  body.printing-customer-report .customer-report-panel .bulk-actions,
  body.printing-customer-report .customer-report-panel .selection-col,
  body.printing-depreciation-report .sidebar,
  body.printing-depreciation-report .topbar,
  body.printing-depreciation-report .view:not(#reports),
  body.printing-depreciation-report .section-tabs,
  body.printing-depreciation-report .customer-report-panel,
  body.printing-depreciation-report #printDepreciationReport,
  body.printing-depreciation-report .depreciation-report-panel .form-grid,
  body.printing-depreciation-report .depreciation-report-panel .bulk-actions,
  body.printing-depreciation-report .depreciation-report-panel .selection-col,
  body.printing-transaction .sidebar,
  body.printing-transaction .topbar,
  body.printing-transaction .view,
  body.manual-report-active #reports,
  .print-footer {
    display: none !important;
  }

  body.printing-customer-report .app,
  body.printing-customer-report .workspace,
  body.printing-customer-report #reports,
  body.printing-customer-report .view.active,
  body.printing-depreciation-report .app,
  body.printing-depreciation-report .workspace,
  body.printing-depreciation-report #reports,
  body.printing-depreciation-report .view.active,
  body.printing-transaction .app,
  body.printing-transaction .workspace,
  body.printing-transaction #transactionPrint {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.manual-report-active .manual-report-print {
    display: block !important;
  }

  .clean-print-page,
  .manual-report-page,
  .transaction-document {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    min-height: 273mm;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
    color: #111827;
    overflow: visible;
  }

  .clean-print-page:last-child,
  .manual-report-page:last-child,
  .transaction-document:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .clean-print-content,
  .manual-report-content {
    flex: 1 1 auto;
    min-height: 0;
  }

  .clean-print-header,
  .transaction-header {
    position: relative;
    min-height: 32mm;
    border-bottom: 0.9pt solid #64748b;
    padding-bottom: 5mm;
    margin-bottom: 6mm;
  }

  .clean-print-title,
  .transaction-title {
    position: absolute;
    top: 7mm;
    right: 7mm;
    width: 110mm;
    text-align: right;
    display: grid;
    gap: 1.5mm;
  }

  .clean-print-title strong,
  .transaction-title strong {
    font-size: 12.8pt;
    line-height: 1.12;
  }

  .clean-print-title span,
  .transaction-title span {
    color: #334155;
    font-size: 8.6pt;
    font-weight: 800;
  }

  .document-letterhead,
  .report-letterhead {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .document-logo {
    max-width: 42mm;
    height: auto;
  }

  .document-letterhead {
    display: block;
  }

  .document-letterhead h2 {
    margin-top: 2.3mm;
    font-size: 8.5pt;
    line-height: 1.15;
  }

  .document-letterhead p {
    margin-top: 0.9mm;
    font-size: 7.6pt;
    color: #475569;
  }

  .clean-print-footer,
  .manual-report-footer,
  .transaction-page-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 8mm;
    border-top: 1px solid #cfd8e3;
    padding-top: 3mm;
    margin-top: 6mm;
    color: #637381;
    font-size: 8pt;
    line-height: 1.2;
  }

  .clean-detail-grid,
  .record-grid,
  .report-summary,
  .transaction-meta-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 3mm;
    margin: 0 0 5mm;
  }

  .clean-detail-grid div,
  .record-grid div,
  .report-summary div,
  .transaction-meta-grid div {
    border: 1px solid #cfd8e3;
    padding: 3mm;
    background: #ffffff !important;
  }

  .clean-detail-grid .wide,
  .record-grid .wide {
    grid-column: 1 / -1;
  }

  .clean-detail-grid span,
  .record-grid span,
  .report-summary span,
  .transaction-meta-grid span {
    display: block;
    color: #637381;
    font-size: 8.2pt;
    font-weight: 800;
    margin-bottom: 1mm;
  }

  .clean-detail-grid strong,
  .record-grid strong,
  .report-summary strong,
  .transaction-meta-grid strong {
    font-size: 8.2pt;
    font-weight: 400;
  }

  .clean-print-section h3,
  .transaction-section h3,
  .authorisation-block h3,
  .accepted-block h3,
  .report-block h4 {
    margin: 8mm 0 3mm;
    font-size: 12pt;
  }

  .transaction-customer h3 {
    margin-top: 0;
  }

  .transaction-notes h3,
  .authorisation-block h3,
  .accepted-block h3,
  .legal-text h2 {
    margin-top: 8mm !important;
  }

  table,
  .clean-print-table,
  .transaction-table,
  .screen-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 8.2pt;
  }

  th,
  td {
    border: 1px solid #cfd8e3;
    padding: 2mm;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    white-space: normal !important;
    line-height: 1.25;
  }

  th {
    background: #eef4fb !important;
    color: #243b53;
    font-weight: 800;
  }

  col {
    width: auto !important;
  }

  .agreement-equipment-table {
    table-layout: fixed !important;
    font-size: 8.2pt !important;
  }

  .agreement-equipment-table th,
  .agreement-equipment-table td {
    padding: 1.8mm !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  .agreement-equipment-table th:nth-child(1),
  .agreement-equipment-table td:nth-child(1) { width: 10.2% !important; }
  .agreement-equipment-table th:nth-child(2),
  .agreement-equipment-table td:nth-child(2) { width: 29.4% !important; }
  .agreement-equipment-table th:nth-child(3),
  .agreement-equipment-table td:nth-child(3) { width: 12.2% !important; }
  .agreement-equipment-table th:nth-child(4),
  .agreement-equipment-table td:nth-child(4) { width: 11.4% !important; }
  .agreement-equipment-table th:nth-child(5),
  .agreement-equipment-table td:nth-child(5) { width: 4.7% !important; }
  .agreement-equipment-table th:nth-child(6),
  .agreement-equipment-table td:nth-child(6) { width: 10.2% !important; }
  .agreement-equipment-table th:nth-child(7),
  .agreement-equipment-table td:nth-child(7) { width: 7.8% !important; }
  .agreement-equipment-table th:nth-child(8),
  .agreement-equipment-table td:nth-child(8) { width: 14.1% !important; }

  .agreement-equipment-table th:nth-child(5),
  .agreement-equipment-table td:nth-child(5),
  .agreement-equipment-table th:nth-child(6),
  .agreement-equipment-table td:nth-child(6),
  .agreement-equipment-table th:nth-child(7),
  .agreement-equipment-table td:nth-child(7),
  .agreement-equipment-table .nowrap-cell {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .agreement-equipment-table th:nth-child(4),
  .agreement-equipment-table td:nth-child(4) {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .customer-print-equipment-table {
    font-size: 8.2pt !important;
  }

  .customer-print-equipment-table th,
  .customer-print-equipment-table td {
    padding: 1.7mm !important;
    word-break: normal !important;
  }

  .customer-print-equipment-table th:nth-child(1),
  .customer-print-equipment-table td:nth-child(1) { width: 9% !important; }
  .customer-print-equipment-table th:nth-child(2),
  .customer-print-equipment-table td:nth-child(2) { width: 11% !important; }
  .customer-print-equipment-table th:nth-child(3),
  .customer-print-equipment-table td:nth-child(3) { width: 27% !important; }
  .customer-print-equipment-table th:nth-child(4),
  .customer-print-equipment-table td:nth-child(4) { width: 10% !important; }
  .customer-print-equipment-table th:nth-child(5),
  .customer-print-equipment-table td:nth-child(5) { width: 16% !important; }
  .customer-print-equipment-table th:nth-child(6),
  .customer-print-equipment-table td:nth-child(6) { width: 5% !important; }
  .customer-print-equipment-table th:nth-child(7),
  .customer-print-equipment-table td:nth-child(7) { width: 15% !important; }
  .customer-print-equipment-table th:nth-child(8),
  .customer-print-equipment-table td:nth-child(8) { width: 8% !important; }

  .customer-print-equipment-table th:nth-child(2),
  .customer-print-equipment-table td:nth-child(2),
  .customer-print-equipment-table th:nth-child(6),
  .customer-print-equipment-table td:nth-child(6),
  .customer-print-equipment-table th:nth-child(8),
  .customer-print-equipment-table td:nth-child(8),
  .transaction-table th:last-child,
  .transaction-table td:last-child {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .status {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
  }

  .authorisation-block p {
    font-size: 9pt;
    line-height: 1.35;
    margin: 0 0 3mm;
  }

  .signature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5mm;
    margin-top: 12mm;
  }

  .signature-grid div {
    border-bottom: 1px solid #111827;
    min-height: 18mm;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
  }

  .signature-grid strong {
    display: block;
    color: #111827;
    font-size: 9pt;
    line-height: 1.2;
    min-height: 5mm;
    padding-bottom: 1.5mm;
  }

  .signature-grid span {
    display: block;
    color: #637381;
    font-size: 8.5pt;
    padding-bottom: 3mm;
  }

  .document-footer {
    display: grid;
    grid-template-columns: 1.5fr 1fr 0.8fr;
    gap: 5mm;
    margin-top: 8mm;
    border-top: 1px solid #cfd8e3;
    padding-top: 3mm;
    font-size: 7.5pt;
    color: #637381;
  }

  .manual-report-print .selection-col,
  .manual-report-print .bulk-actions,
  .manual-report-print button,
  .manual-report-print input,
  .manual-report-print select {
    display: none !important;
  }

  body.printing-asset-tags .asset-tag-sheet {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8mm;
  }

  body.printing-asset-tags .asset-tag {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  animation: overlayFadeIn 120ms ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  overscroll-behavior-x: contain;
  border: 1px solid #cbd8e6;
  border-top: 6px solid var(--blue);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0, #ffffff 76px);
  box-shadow: var(--shadow-pop);
  padding: 24px;
  transform-origin: center;
  animation: modalPopIn 190ms cubic-bezier(0.2, 1.05, 0.25, 1);
}

.modal-panel.wide-modal {
  width: min(980px, 100%);
}

.modal-panel.compact-modal {
  width: min(560px, 100%);
}

.help-modal {
  width: min(620px, 100%);
}

.help-content {
  display: grid;
  gap: 10px;
  margin: 16px 0 20px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.help-content h4,
.help-content p,
.help-content ul {
  margin: 0;
}

.help-content h4 {
  color: var(--nav);
  font-size: 16px;
  font-weight: 900;
}

.help-content ul {
  display: grid;
  gap: 7px;
  padding-left: 20px;
}

.help-content li {
  padding-left: 2px;
}

.help-guides-form {
  display: grid;
  gap: 14px;
}

.help-guides-form textarea {
  min-height: 220px;
}

.maintenance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.maintenance-card {
  border: 1px solid #d6e2ef;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #f8fbff;
  padding: 12px 14px;
}

.maintenance-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.maintenance-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.25rem;
}

.modal-panel.agreement-extension-modal {
  width: min(760px, 100%);
}

.agreement-extension-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: end;
}

.agreement-extension-grid .wide {
  grid-column: 1 / -1;
}

.agreement-extension-grid .checkbox-label {
  justify-self: start;
  margin-top: 2px;
}

#agreementExtensionForm .form-actions {
  margin-top: 12px;
}

#agreementExtensionForm .primary-btn,
#agreementExtensionForm .secondary-btn {
  min-width: 142px;
}

.modal-top-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: -8px -8px 8px 16px;
  padding: 0;
  border: 1px solid #cbd8e6;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2a37;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.modal-top-close:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.modal-heading-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.modal-warning-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff4d6;
  color: #9a5b00;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.modal-kicker {
  margin: 0 0 2px;
  color: #637381;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

#appMessageText {
  white-space: pre-line;
}

.activity-log-modal {
  width: min(1120px, 96vw);
  max-height: 88vh;
  overflow: auto;
}

.activity-log-content {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.activity-log-content .table-wrap {
  max-height: 48vh;
  overflow: auto;
}

.activity-log-content .report-summary {
  margin-bottom: 4px;
}

.duplicate-serial-modal {
  width: min(640px, 100%);
  padding: 28px;
}

.duplicate-serial-summary {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.serial-card {
  display: grid;
  gap: 4px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px 14px;
}

.serial-card-current {
  border-color: #f2c36b;
  background: #fffaf0;
}

.serial-card span,
.serial-card small {
  color: #637381;
  font-size: 12px;
  font-weight: 800;
}

.serial-card strong {
  color: #1f2a37;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
}

.duplicate-serial-field {
  margin: 0 0 18px;
}

.duplicate-serial-field input {
  min-height: 44px;
  font-size: 16px;
  font-weight: 800;
}

.duplicate-serial-actions {
  justify-content: flex-end;
}

.duplicate-serial-actions button {
  min-width: 140px;
}

.modal-question {
  margin: 10px 0 20px;
  color: #1f2a37;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

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

.template-form label {
  display: grid;
  gap: 7px;
  color: #637381;
  font-weight: 800;
}

.template-form input,
.template-form textarea {
  width: 100%;
  border: 1px solid #cbd7e3;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  color: #1f2a37;
  resize: vertical;
}

.template-form .table-block-card input[type="checkbox"],
.template-form .print-mapping-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  flex: 0 0 18px;
  margin: 2px 8px 0 0;
  padding: 0;
  accent-color: #2b73e8;
}

.template-link-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  padding: 18px;
  background: #f8fbff;
}

.template-link-options.template-link-groups {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: 14px;
}

.template-link-options legend {
  padding: 0 6px;
  color: #637381;
  font-weight: 900;
}

.template-link-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  color: #1f2a37;
  font-size: 15px;
  line-height: 1.2;
}

.template-link-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d9e5f2;
  border-radius: 8px;
  background: #ffffff;
}

.template-link-group h3 {
  margin: 0;
  color: #304860;
  font-size: 14px;
  line-height: 1.2;
}

.template-link-group label {
  min-height: 44px;
  padding: 10px;
  border-radius: 7px;
}

.template-link-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: #2b73e8;
}

@media (max-width: 760px) {
  .template-document-map {
    grid-template-columns: 1fr;
  }

  .pdf-table-config-card {
    grid-template-columns: 1fr;
  }
}

.modal-panel h2 {
  margin: 0 0 6px;
  color: var(--nav);
  font-size: 26px;
}

.modal-subtitle {
  margin: 0 0 18px;
  color: #637381;
  font-weight: 700;
  white-space: pre-line;
}

.modal-checklist-text {
  color: #526678;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.undo-history-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.undo-history-section-title {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.undo-history-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 3px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  background: #f8fafc;
}

.undo-history-item input {
  grid-row: span 2;
  width: auto;
  min-height: 0;
}

.undo-history-item strong {
  color: var(--ink);
  font-size: 14px;
}

.undo-history-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.redo-history-item {
  background: #f7fbf8;
  border-color: #cfe8d8;
}

.redo-history-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #1f8a5b;
  border-radius: 999px;
  grid-row: span 2;
}

.modal-info {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  background: #f4f8fc;
  color: #1f2a37;
  font-weight: 800;
}

.sale-metric {
  display: grid;
  align-content: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #d8e2ee;
  border-radius: 7px;
  background: #f8fafc;
}

.sale-metric span {
  color: #637381;
  font-size: 12px;
  font-weight: 800;
}

.sale-metric strong {
  color: var(--ink);
  font-size: 18px;
}

.sale-metric strong.positive {
  color: #0f8a51;
}

.sale-metric strong.negative {
  color: #b42318;
}

.setup-key-box {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 14px;
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fafc;
}

.setup-key-box span {
  color: #637381;
  font-weight: 700;
}

.setup-key-box strong {
  overflow-wrap: anywhere;
  letter-spacing: 1px;
}

.qr-code {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0 auto 18px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: white;
  padding: 10px;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .report-panel .compact-tabs {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

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

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

html.app-view-transitioning::view-transition-old(root) {
  animation: appViewCrossFadeOut 90ms ease-out both;
}

html.app-view-transitioning::view-transition-new(root) {
  animation: appViewCrossFadeIn 150ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes appViewCrossFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.86;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html.app-view-transitioning::view-transition-old(root),
  html.app-view-transitioning::view-transition-new(root) {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Final split save button: intentionally placed last so generic button styles cannot override it. */
.form-actions .save-split-control {
  position: relative !important;
  display: inline-flex !important;
  align-items: stretch !important;
  flex: 0 0 auto !important;
  width: auto !important;
  overflow: visible !important;
  filter: drop-shadow(0 8px 14px rgba(31, 111, 235, 0.14)) !important;
}

.form-actions:has(.save-split-menu:not(.hidden)) {
  padding-bottom: 130px !important;
}

.form-actions .save-split-control .save-split-main,
.form-actions .save-split-control .save-split-toggle {
  min-height: 42px !important;
  margin: 0 !important;
  border: 0 !important;
  background: linear-gradient(180deg, #3988fb 0%, #2876ea 62%, #2168d8 100%) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -1px 0 rgba(13, 70, 150, 0.14) !important;
  transform: none !important;
}

.form-actions .save-split-control .save-split-main {
  min-width: 158px !important;
  padding: 9px 16px !important;
  border-radius: 8px 0 0 8px !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
}

.form-actions .save-split-control .save-split-toggle {
  width: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  border-left: 1px solid rgba(17, 82, 176, 0.55) !important;
  border-radius: 0 8px 8px 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.form-actions .save-split-control .save-split-toggle::before {
  content: "" !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 5px solid transparent !important;
  border-right: 5px solid transparent !important;
  border-top: 6px solid #ffffff !important;
}

.form-actions .save-split-control .save-split-toggle[aria-expanded="true"] {
  background: linear-gradient(180deg, #347fea 0%, #2168d8 100%) !important;
}

.form-actions .save-split-control .save-split-menu {
  position: absolute !important;
  z-index: 200 !important;
  top: calc(100% + 7px) !important;
  left: 0 !important;
  width: 272px !important;
  min-width: 272px !important;
  padding: 8px 0 !important;
  border: 1px solid #d7dee8 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.15), 0 3px 8px rgba(15, 23, 42, 0.07) !important;
  overflow: hidden !important;
}

.form-actions .save-split-control .save-split-menu.hidden {
  display: none !important;
}

.form-actions .save-split-control .save-split-menu:not(.hidden) {
  display: block !important;
}

.form-actions .save-split-control .save-split-item {
  all: unset !important;
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  min-height: 44px !important;
  padding: 12px 16px !important;
  background: #ffffff !important;
  color: #252b35 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  cursor: pointer !important;
}

.form-actions .save-split-control .save-split-item:hover,
.form-actions .save-split-control .save-split-item:focus {
  background: #edf5ff !important;
  color: #1558b8 !important;
}

@media (max-width: 760px) {
  .form-actions .save-split-control {
    width: 100% !important;
  }

  .form-actions .save-split-control .save-split-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .form-actions .save-split-control .save-split-menu {
    width: 100% !important;
    min-width: 100% !important;
  }
}

#agreementPrintPartDialog .print-documents-modal {
  width: min(680px, calc(100vw - 32px));
  max-width: 680px;
  max-height: calc(100vh - 42px);
  overflow-y: auto;
}

#agreementPrintPartDialog .print-documents-modal h2 {
  margin-top: 0;
  font-size: 34px;
  line-height: 1.08;
}

#agreementPrintPartDialog .print-document-chooser {
  gap: 10px;
  margin: 14px 0;
}

#agreementPrintPartDialog .print-document-chooser section {
  gap: 6px;
  padding: 12px;
}

#agreementPrintPartDialog .print-document-chooser label {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
}

#agreementPrintPartDialog .print-document-chooser input[type="checkbox"],
#agreementPrintPartDialog .print-document-chooser input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
}

#agreementPrintPartDialog .print-scope-help {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

#agreementPrintPartDialog .print-option-controls {
  display: grid;
  grid-template-columns: minmax(210px, 0.55fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

#agreementPrintPartDialog .print-equipment-scope {
  min-height: 46px;
  align-items: center;
  margin: 0;
}

#agreementPrintPartDialog .print-classification-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

#agreementPrintPartDialog .compact-modal {
  width: min(700px, 100%);
}

#agreementPrintPartDialog .print-classification-field select {
  width: 100%;
  min-width: 0;
}

#agreementPrintPartDialog .print-action-group-title {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

#agreementPrintPartDialog .form-actions {
  justify-content: flex-end;
  gap: 10px;
}

#agreementPrintPartDialog .print-document-chooser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

#agreementPrintPartDialog .print-document-chooser label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #d6e2ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 850;
}

#agreementPrintPartDialog .print-document-chooser label.is-disabled {
  opacity: 0.48;
  background: #eef3f8;
  cursor: not-allowed;
}

#agreementPrintPartDialog .print-document-chooser label.is-recommended {
  border-color: #7aa7e8;
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.16);
}

#agreementPrintPartDialog .print-document-chooser label.is-disabled input {
  cursor: not-allowed;
}

@media (max-width: 720px) {
  #agreementPrintPartDialog .print-option-controls {
    grid-template-columns: 1fr;
  }
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  margin: 0;
  border-radius: 3px;
  background: initial !important;
  box-shadow: none !important;
  accent-color: var(--blue);
  vertical-align: middle;
}
