:root {
  --bg: #eef5ff;
  --panel: rgba(255, 255, 255, 0.94);
  --line: rgba(19, 56, 118, 0.12);
  --text: #0f1f3a;
  --ink: #0f1f3a;
  --muted: #64748b;
  --primary: #075ed8;
  --primary-dark: #061f62;
  --primary-deep: #041347;
  --accent: #16a34a;
  --info: #2563eb;
  --purple: #6d5dfc;
  --orange: #f59e0b;
  --danger: #df3b32;
  --radius: 8px;
  --shadow: 0 18px 46px rgba(14, 44, 97, 0.12);
  --card-shadow: 0 10px 28px rgba(15, 35, 74, 0.1);
}

/* Unified print-document refresh: quotation, delivery note, and receipt */
.preview-option-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.document-modern.document-quotation_cash,
.document-modern.document-quotation_credit,
.document-modern.document-delivery_cash,
.document-modern.document-delivery_credit,
.document-modern.document-receipt_cash {
  color: #0b1f3f;
  font-size: 14px;
  line-height: 1.34;
  min-height: 0;
  overflow: visible;
  padding-bottom: 12mm;
}

.document-modern.document-quotation_cash::before,
.document-modern.document-quotation_cash::after,
.document-modern.document-quotation_credit::before,
.document-modern.document-quotation_credit::after,
.document-modern.document-delivery_cash::before,
.document-modern.document-delivery_cash::after,
.document-modern.document-delivery_credit::before,
.document-modern.document-delivery_credit::after,
.document-modern.document-receipt_cash::before,
.document-modern.document-receipt_cash::after {
  content: none;
  display: none;
}

.document-modern.document-quotation_cash .modern-doc-header,
.document-modern.document-quotation_credit .modern-doc-header,
.document-modern.document-delivery_cash .modern-doc-header,
.document-modern.document-delivery_credit .modern-doc-header,
.document-modern.document-receipt_cash .modern-doc-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(62mm, 74mm);
  gap: 8mm;
  align-items: start;
  padding-bottom: 6mm;
  border-bottom: 4px solid #0b63ce;
  text-align: left;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand {
  display: grid;
  grid-template-columns: 42mm minmax(0, 1fr);
  gap: 5mm;
  align-items: center;
  justify-content: start;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand img,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand img,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand img,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand img,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand img {
  width: 40mm;
  height: auto;
  max-height: 22mm;
  object-fit: contain;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand strong,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand strong,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand strong,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand strong,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand strong {
  max-width: none;
  color: #0d1b2f;
  font-size: 22px;
  line-height: 1.08;
  white-space: normal;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand span,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand span,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand span,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand span,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand span {
  max-width: none;
  color: #5b6778;
  font-size: 13px;
  line-height: 1.15;
}

.document-modern.document-quotation_cash .doc-title,
.document-modern.document-quotation_credit .doc-title,
.document-modern.document-delivery_cash .doc-title,
.document-modern.document-delivery_credit .doc-title,
.document-modern.document-receipt_cash .doc-title {
  grid-column: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #075ed8;
  background: transparent;
  text-align: right;
}

.document-modern.document-quotation_cash .doc-title h1,
.document-modern.document-quotation_credit .doc-title h1,
.document-modern.document-delivery_cash .doc-title h1,
.document-modern.document-delivery_credit .doc-title h1,
.document-modern.document-receipt_cash .doc-title h1 {
  display: block;
  margin: 0;
  padding: 0 0 2mm;
  border: 0;
  border-bottom: 2px solid #075ed8;
  border-radius: 0;
  color: #075ed8;
  background: transparent;
  font-size: 32px;
  line-height: 1.04;
}

.document-modern.document-quotation_cash .doc-title span,
.document-modern.document-quotation_credit .doc-title span,
.document-modern.document-delivery_cash .doc-title span,
.document-modern.document-delivery_credit .doc-title span,
.document-modern.document-receipt_cash .doc-title span {
  display: inline-block;
  margin-top: 1mm;
  padding: 0 0 1.2mm;
  border: 0;
  border-bottom: 2px solid #075ed8;
  color: #1f2d3b;
  font-size: 13px;
  font-weight: 900;
}

.document-modern .doc-info-row,
.document-modern.document-delivery_cash .doc-info-row,
.document-modern.document-delivery_credit .doc-info-row,
.document-modern.document-receipt_cash .doc-info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(74mm, 86mm);
  gap: 8mm;
  margin-top: 6mm;
  padding: 0;
  border: 0;
}

.document-modern .document-card,
.document-modern .doc-customer-box,
.document-modern .doc-terms-box {
  border-color: #0b63ce;
}

.document-modern .doc-info-card h2,
.document-modern .doc-customer-box h2,
.document-modern .doc-summary h2,
.document-modern .doc-terms-box h2 {
  font-size: 16px;
}

.document-modern .doc-info-card p,
.document-modern .doc-customer-box p,
.document-modern .doc-summary p,
.document-modern .doc-terms-box li,
.document-modern .doc-field-line,
.document-modern .modern-doc-table td {
  font-size: 13px;
}

.document-modern .modern-doc-table th {
  font-size: 13px;
}

.document-modern .doc-col-no {
  width: 7%;
}

.document-modern .doc-col-item {
  width: 34%;
}

.document-modern .doc-col-qty,
.document-modern .doc-col-delivered {
  width: 10%;
}

.document-modern .doc-col-unit {
  width: 10%;
}

.document-modern .doc-col-price,
.document-modern .doc-col-total {
  width: 13%;
}

.document-modern .doc-col-delivery-note {
  width: 13%;
}

.document-modern.document-prices-hidden .doc-col-item {
  width: 43%;
}

.document-modern.document-prices-hidden .doc-col-delivery-note {
  width: 20%;
}

.document-modern .modern-doc-table small {
  color: #334155;
  font-size: 12px;
  line-height: 1.24;
}

.document-page {
  break-after: page;
  page-break-after: always;
}

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

.document-page + .document-page {
  margin-top: 28px;
}

.doc-continuation-header {
  display: table;
  width: 100%;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 3px solid #0b63ce;
  color: #0b1f3f;
}

.doc-continuation-header > div {
  display: table-cell;
  width: 50%;
  vertical-align: bottom;
}

.doc-continuation-header > div:last-child {
  text-align: right;
}

.doc-continuation-header strong,
.doc-continuation-header span {
  display: block;
}

.doc-continuation-header strong {
  color: #075ed8;
  font-size: 18px;
  line-height: 1.15;
}

.doc-attachment-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #8cbcff;
  border-radius: 8px;
  background: #f8fbff;
}

.doc-attachment-note h2 {
  margin: 0 0 6px;
  color: #06306d;
  font-size: 16px;
}

.doc-attachment-note p {
  margin: 0;
}

.document-modern .modern-doc-table thead {
  display: table-header-group;
}

.document-modern .modern-doc-table tbody {
  display: table-row-group;
}

.document-modern .modern-doc-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.document-modern .modern-doc-table td,
.document-modern .modern-doc-table .doc-blank-row td {
  height: auto;
}

.doc-final-block {
  break-inside: avoid;
  page-break-inside: avoid;
}

.doc-page-number {
  margin-top: 10px;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

.receipt-total-box .grand-total {
  color: #075ed8;
  font-size: 22px;
}

.receipt-total-box .receipt-status strong {
  color: #c2410c;
}

@media print {
  .document-modern.document-quotation_cash,
  .document-modern.document-quotation_credit,
  .document-modern.document-delivery_cash,
  .document-modern.document-delivery_credit,
  .document-modern.document-receipt_cash {
    font-size: 12px;
    line-height: 1.28;
  }

  .document-modern .doc-info-card p,
  .document-modern .doc-customer-box p,
  .document-modern .doc-summary p,
  .document-modern .doc-terms-box li,
  .document-modern .doc-field-line,
  .document-modern .modern-doc-table th,
  .document-modern .modern-doc-table td {
    font-size: 12px;
  }

  .document-modern .modern-doc-table small {
    font-size: 11px;
  }

  .receipt-total-box .grand-total {
    font-size: 18px;
  }

  body.preview-body {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .document-page {
    break-after: page;
    page-break-after: always;
  }

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

  .document-page + .document-page {
    margin-top: 0;
  }

  .doc-continuation-header {
    margin-bottom: 3mm;
    padding-bottom: 2mm;
  }

  .doc-continuation-header strong {
    font-size: 14px;
  }

  .doc-continuation-header span {
    font-size: 11px;
  }

  .doc-attachment-note {
    margin-top: 3mm;
    padding: 3mm 4mm;
    border-radius: 5px;
  }

  .doc-attachment-note h2 {
    font-size: 13px;
  }

  .document-modern .modern-doc-table thead {
    display: table-header-group;
  }

  .document-modern .modern-doc-table tbody {
    display: table-row-group;
  }

  .document-modern .modern-doc-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .document-modern .modern-doc-table td,
  .document-modern .modern-doc-table .doc-blank-row td {
    height: auto;
  }

  .doc-final-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .doc-page-number {
    margin-top: 3mm;
    font-size: 10px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.13), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, var(--bg) 58%, #e6efff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
}

.glass,
.panel,
.auth-panel,
.error-panel {
  border: 1px solid rgba(198, 213, 239, 0.72);
  background: var(--panel);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 88% 10%, rgba(37, 99, 235, 0.16), transparent 24%),
    radial-gradient(circle at 78% 82%, rgba(125, 176, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #edf5ff 48%, #e4eeff 100%);
  overflow-x: hidden;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(380px, 0.92fr);
  width: min(1120px, 100%);
  height: min(680px, calc(100vh - 56px));
  min-height: 620px;
  border-radius: 20px;
  overflow: visible;
  filter: drop-shadow(0 26px 54px rgba(15, 35, 74, 0.16));
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 54px 58px 44px;
  color: white;
  border-radius: 20px 0 0 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 46% 48%, rgba(0, 174, 255, 0.42), transparent 2px, transparent 78px),
    radial-gradient(circle at 72% 16%, rgba(63, 138, 255, 0.36), transparent 28%),
    linear-gradient(150deg, #05206b 0%, #073da0 52%, #03113f 100%);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14px 14px, rgba(255, 255, 255, 0.16) 1px, transparent 1.4px) 0 0 / 18px 18px,
    linear-gradient(130deg, transparent 0 54%, rgba(28, 150, 255, 0.18) 54% 55%, transparent 55%),
    linear-gradient(158deg, transparent 0 67%, rgba(54, 169, 255, 0.22) 67% 68%, transparent 68%);
  opacity: 0.58;
}

.auth-brand::after {
  content: "";
  position: absolute;
  left: 48px;
  right: 48px;
  top: 52%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(80, 190, 255, 0.88), transparent);
  box-shadow: 0 0 24px rgba(74, 190, 255, 0.8);
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-brand-mark {
  width: 244px;
  height: 132px;
  display: grid;
  place-items: center;
  margin: 24px auto 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    0 24px 46px rgba(0, 0, 0, 0.18);
}

.auth-logo {
  width: 218px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(15, 35, 74, 0.16));
}

.auth-brand-copy {
  margin: auto 0 78px;
}

.auth-brand h1 {
  margin: 0 0 16px;
  max-width: 500px;
  font-size: 38px;
  line-height: 1.18;
  letter-spacing: 0;
}

.auth-brand p,
.auth-brand span {
  color: rgba(255, 255, 255, 0.78);
}

.auth-brand p {
  max-width: 520px;
  margin: 0;
  font-weight: 650;
}

.auth-brand span {
  font-size: 14px;
  font-weight: 700;
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  margin: 0 0 0 -14px;
  padding: 54px 58px;
  border-radius: 20px;
  border-color: rgba(255, 255, 255, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: 0 30px 68px rgba(15, 35, 74, 0.18);
}

.auth-panel h2 {
  margin: 0 0 8px;
  font-size: 34px;
  text-align: center;
}

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

.auth-title {
  margin-bottom: 18px;
  text-align: center;
}

.auth-title p {
  margin: 0;
  font-weight: 600;
}

.auth-lock-badge {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 50%;
  color: #075ed8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(237, 245, 255, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(74, 144, 255, 0.14),
    0 16px 30px rgba(7, 94, 216, 0.14);
}

.auth-lock-badge svg,
.auth-input-wrap svg,
.auth-submit svg,
.auth-version svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.auth-input-wrap {
  position: relative;
  color: #2b78f2;
}

.auth-input-wrap > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-input-wrap input {
  min-height: 58px;
  padding-left: 52px;
  padding-right: 52px;
  border-radius: 10px;
  border-color: rgba(19, 56, 118, 0.16);
  background: rgba(255, 255, 255, 0.98);
  font-size: 16px;
  font-weight: 650;
  box-shadow: 0 9px 20px rgba(15, 35, 74, 0.06);
}

.auth-input-wrap input:focus {
  box-shadow:
    0 0 0 4px rgba(7, 94, 216, 0.12),
    0 14px 26px rgba(15, 35, 74, 0.1);
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #7b8aa4;
  background: transparent;
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: #075ed8;
  background: rgba(7, 94, 216, 0.08);
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  margin-top: 26px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #0b8cff 0%, #075ed8 56%, #034ec4 100%);
  font-size: 17px;
  box-shadow: 0 18px 34px rgba(7, 94, 216, 0.28);
}

.auth-submit:hover {
  filter: brightness(1.04);
}

.auth-version {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  color: #8a99ae;
  text-align: center;
  font-size: 12px;
}

.auth-version::before,
.auth-version::after {
  content: "";
  height: 1px;
  background: rgba(19, 56, 118, 0.12);
}

.auth-version span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0 auto 4px;
  color: #9dafc7;
}

.auth-version p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

label {
  display: block;
  margin: 16px 0 7px;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 86px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(7, 94, 216, 0.55);
  box-shadow: 0 0 0 3px rgba(7, 94, 216, 0.12);
  outline: 0;
}

select {
  appearance: none;
}

.primary-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 22px;
  border: 0;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, #0d7cf2, #075ed8);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(7, 94, 216, 0.24);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.alert {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--radius);
  color: var(--danger);
  background: rgba(194, 65, 63, 0.1);
}

.version {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
  background:
    radial-gradient(circle at 85% 92%, rgba(37, 99, 235, 0.42), transparent 28%),
    linear-gradient(180deg, #073b96 0%, #062a78 42%, #041347 100%);
  backdrop-filter: blur(22px);
  box-shadow: 12px 0 32px rgba(4, 19, 71, 0.18);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 6px 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-brand img {
  width: 64px;
  height: 64px;
  padding: 8px;
  object-fit: contain;
  border: 1px solid rgba(226, 236, 255, 0.82);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(2, 8, 28, 0.22);
}

.side-brand strong {
  display: block;
  font-size: 13px;
  color: white;
}

.side-brand span {
  color: rgba(226, 236, 255, 0.76);
  font-size: 11px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: rgba(239, 246, 255, 0.86);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.sidebar nav a::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar nav a.active {
  color: white;
  background: linear-gradient(135deg, #1593ff, #3155ff);
  box-shadow: 0 12px 28px rgba(20, 91, 255, 0.3);
}

.sidebar nav a.active::before {
  border-color: white;
  background: white;
}

.main {
  position: relative;
  min-width: 0;
  padding: 90px 24px 24px;
}

.main::before {
  content: "BM SHOP MANAGER";
  position: fixed;
  top: 0;
  right: 0;
  left: 236px;
  z-index: 20;
  display: grid;
  place-items: center;
  height: 60px;
  color: white;
  background:
    radial-gradient(circle at 72% 24%, rgba(37, 99, 235, 0.34), transparent 24%),
    linear-gradient(90deg, #061c58, #073b96 48%, #061c58);
  box-shadow: 0 8px 22px rgba(4, 19, 71, 0.18);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  color: #071b46;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(147, 178, 230, 0.45);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(15, 35, 74, 0.08);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at 24% 18%, rgba(35, 134, 255, 0.2), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(99, 102, 241, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.9));
  box-shadow: 0 18px 42px rgba(15, 35, 74, 0.12);
  overflow: hidden;
}

.dashboard-hero h2 {
  margin: 6px 0 8px;
  color: #071b46;
  font-size: 34px;
  line-height: 1.15;
}

.dashboard-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-eyebrow {
  color: #075ed8;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 18px;
  padding: 0 8px 0 16px;
  border: 1px solid rgba(187, 205, 236, 0.75);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 35, 74, 0.08);
}

.dashboard-search svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #2b78f2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard-search input {
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-search input:focus {
  box-shadow: none;
}

.dashboard-search button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b8cff, #075ed8);
  box-shadow: 0 10px 20px rgba(7, 94, 216, 0.22);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-hero-side {
  display: grid;
  gap: 12px;
}

.dashboard-date-card {
  padding: 16px;
  border: 1px solid rgba(7, 94, 216, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  box-shadow: 0 12px 24px rgba(15, 35, 74, 0.08);
}

.dashboard-date-card span,
.focus-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-date-card strong {
  display: block;
  margin-top: 6px;
  color: #061c58;
  font-size: 24px;
}

.dashboard-date-card small {
  display: block;
  margin-top: 8px;
  color: #16a34a;
  font-weight: 900;
}

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

.focus-card {
  min-height: 90px;
  padding: 14px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 35, 74, 0.08);
  text-decoration: none;
}

.focus-card strong {
  display: block;
  margin-top: 8px;
  color: #071b46;
  font-size: 22px;
}

.focus-blue {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), #ffffff);
}

.focus-purple {
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.12), #ffffff);
}

.focus-orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), #ffffff);
}

.focus-green {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), #ffffff);
}

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

.stat,
.panel {
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 255, 0.9));
  box-shadow: var(--card-shadow);
}

.stat {
  position: relative;
  min-height: 112px;
  padding: 18px 18px 18px 92px;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #2f7dff, #314dff);
  box-shadow: 0 12px 26px rgba(49, 77, 255, 0.28);
}

.stat::after {
  position: absolute;
  left: 18px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: white;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stat:nth-child(1)::after {
  content: "👥";
}

.stat:nth-child(2)::before {
  background: linear-gradient(135deg, #4ade80, #16a34a);
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.24);
}

.stat:nth-child(2)::after {
  content: "▣";
}

.stat:nth-child(3)::before {
  background: linear-gradient(135deg, #8b5cf6, #5b41e8);
  box-shadow: 0 12px 26px rgba(91, 65, 232, 0.24);
}

.stat:nth-child(3)::after {
  content: "▤";
}

.stat:nth-child(4)::before {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.24);
}

.stat:nth-child(4)::after {
  content: "฿";
}

.stat:nth-child(5)::before {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  box-shadow: 0 12px 26px rgba(14, 165, 233, 0.24);
}

.stat:nth-child(5)::after {
  content: "!";
}

.stat:nth-child(6)::before {
  background: linear-gradient(135deg, #fb923c, #ef4444);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.22);
}

.stat:nth-child(6)::after {
  content: "●";
}

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

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: #081b45;
}

.stat small {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-page .dashboard-stat {
  min-height: 126px;
  padding: 18px 18px 18px 96px;
  border-radius: 14px;
}

.dashboard-page .dashboard-stat::before,
.dashboard-page .dashboard-stat::after {
  display: none;
}

.dashboard-stat .stat-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  color: #ffffff;
  transform: translateY(-50%);
  box-shadow: 0 14px 28px rgba(15, 35, 74, 0.18);
}

.dashboard-stat .stat-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard-stat.stat-blue .stat-icon {
  background: linear-gradient(135deg, #4f8cff, #3155ff);
}

.dashboard-stat.stat-green .stat-icon {
  background: linear-gradient(135deg, #4ade80, #16a34a);
}

.dashboard-stat.stat-purple .stat-icon {
  background: linear-gradient(135deg, #8b5cf6, #5b41e8);
}

.dashboard-stat.stat-gold .stat-icon {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.dashboard-stat.stat-cyan .stat-icon {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.dashboard-stat.stat-red .stat-icon {
  background: linear-gradient(135deg, #fb923c, #ef4444);
}

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

.quick-actions a,
.secondary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(187, 205, 236, 0.8);
  border-radius: var(--radius);
  color: #0b367a;
  background: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 35, 74, 0.08);
}

.quick-actions a:hover,
.secondary-btn:hover {
  border-color: rgba(7, 94, 216, 0.34);
  color: #075ed8;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(7, 94, 216, 0.13);
}

.danger-btn {
  border-color: rgba(185, 28, 28, 0.24);
  color: #ffffff;
  background: #b91c1c;
}

.danger-btn:hover {
  background: #991b1b;
}

.dashboard-actions {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard-actions a {
  gap: 8px;
  min-height: 48px;
  border-radius: 12px;
}

.dashboard-actions a span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #075ed8;
  background: rgba(7, 94, 216, 0.08);
  font-weight: 900;
}

.dashboard-page .panel {
  border-radius: 14px;
}

.report-filter {
  margin-bottom: 14px;
}

.report-filter .form-body {
  padding-bottom: 14px;
}

.report-filter-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.filter-actions .primary-btn,
.filter-actions .secondary-btn {
  width: auto;
  min-width: 112px;
  min-height: 40px;
  margin-top: 0;
  padding: 0 16px;
}

.backup-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -2px 0 14px;
}

.backup-complete-actions .secondary-btn {
  width: auto;
  min-width: 130px;
  padding: 0 16px;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
}

.notice.success {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.notice.danger {
  color: var(--danger);
  background: rgba(194, 65, 63, 0.1);
  border: 1px solid rgba(194, 65, 63, 0.18);
}

.notice.warning {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.notice.info {
  color: #075ed8;
  background: rgba(7, 94, 216, 0.1);
  border: 1px solid rgba(7, 94, 216, 0.2);
}

.preview-notice {
  margin: 12px auto 0;
  width: min(210mm, calc(100% - 56px));
}

.action-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.action-notice .secondary-btn {
  min-width: 124px;
  min-height: 34px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mini-stats.status-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-stats.report-insights {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.due-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-stats div {
  min-height: 76px;
  padding: 14px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(15, 35, 74, 0.08);
}

.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  color: #071b46;
}

.due-overview .due-danger {
  border-color: rgba(194, 65, 63, 0.24);
  background: rgba(194, 65, 63, 0.08);
}

.due-overview .due-warning {
  border-color: rgba(234, 179, 8, 0.26);
  background: rgba(234, 179, 8, 0.1);
}

.due-overview .due-info {
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.08);
}

.report-insights .due-danger {
  border-color: rgba(194, 65, 63, 0.24);
  background: rgba(194, 65, 63, 0.08);
}

.report-insights .due-warning {
  border-color: rgba(234, 179, 8, 0.26);
  background: rgba(234, 179, 8, 0.1);
}

.report-insights .due-info {
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.08);
}

.due-panel {
  margin-bottom: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.ok {
  color: #0f766e;
  background: rgba(15, 159, 154, 0.12);
}

.status-badge.info {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}

.status-badge.neutral {
  color: #475569;
  background: rgba(100, 116, 139, 0.12);
}

.status-badge.warning {
  color: #a16207;
  background: rgba(234, 179, 8, 0.16);
}

.status-badge.done {
  color: #166534;
  background: rgba(34, 197, 94, 0.14);
}

.status-badge.danger {
  color: var(--danger);
  background: rgba(194, 65, 63, 0.12);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0;
}

.search-input {
  max-width: 420px;
}

.job-filter {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.job-filter .search-input {
  flex: 1 1 300px;
}

.job-filter select {
  width: auto;
  min-width: 150px;
}

.job-filter .secondary-btn {
  width: auto;
  min-width: 100px;
  padding: 0 14px;
}

.global-search {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.global-search .search-input {
  flex: 1 1 520px;
  max-width: none;
}

.global-search .secondary-btn {
  width: auto;
  min-width: 110px;
  padding: 0 16px;
}

.search-section {
  margin-bottom: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.job-entry-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at 16% 14%, rgba(14, 140, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.9));
  box-shadow: 0 18px 42px rgba(15, 35, 74, 0.1);
}

.job-entry-hero span {
  color: #075ed8;
  font-size: 12px;
  font-weight: 900;
}

.job-entry-hero h2 {
  margin: 6px 0 8px;
  color: #071b46;
  font-size: 28px;
  line-height: 1.18;
}

.job-entry-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.job-entry-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.job-entry-hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(7, 94, 216, 0.2);
  border-radius: 11px;
  color: #075ed8;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 35, 74, 0.08);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.job-entry-grid {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
}

.job-side-stack {
  position: sticky;
  top: 78px;
}

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

.detail-panel {
  align-self: start;
}

.side-stack {
  display: grid;
  gap: 14px;
  align-self: start;
}

.profile-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.profile-list div,
.empty-state {
  padding: 13px;
  border: 1px solid rgba(187, 205, 236, 0.62);
  border-radius: var(--radius);
  background: rgba(248, 251, 255, 0.92);
}

.profile-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-list strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.settings-check-option {
  align-items: flex-start;
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(187, 205, 236, 0.62);
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  padding: 13px;
}

.settings-check-option input {
  accent-color: var(--blue);
  flex: 0 0 auto;
  height: 18px;
  margin-top: 2px;
  width: 18px;
}

.settings-check-option span,
.settings-check-option strong,
.settings-check-option small {
  display: block;
}

.settings-check-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  margin-top: 4px;
}

.profile-action,
.profile-actions {
  margin-top: 10px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-panel {
  scroll-margin-top: 18px;
}

.form-body {
  padding: 16px;
}

.job-entry-form .form-body {
  display: grid;
  gap: 14px;
}

.form-body label:first-child {
  margin-top: 0;
}

.job-form-section {
  padding: 14px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
}

.job-form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.job-form-section-title > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b8cff, #075ed8);
  box-shadow: 0 10px 20px rgba(7, 94, 216, 0.22);
  font-weight: 900;
}

.job-form-section-title h3 {
  margin: 0;
  color: #071b46;
  font-size: 16px;
}

.job-form-section-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 18px 0 10px;
}

.section-head h3 {
  margin: 0;
  font-size: 15px;
}

.section-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.job-items-builder {
  padding: 14px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.92));
}

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

.job-item-row {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(15, 35, 74, 0.06);
}

.job-item-row label {
  margin-top: 10px;
}

.job-item-row label:first-child {
  margin-top: 0;
}

.item-source-field[hidden] {
  display: none;
}

.remove-job-item {
  margin-top: 10px;
}

.job-live-summary {
  overflow: hidden;
}

.job-live-summary .panel-head {
  background:
    radial-gradient(circle at 88% 0%, rgba(49, 85, 255, 0.2), transparent 32%),
    linear-gradient(135deg, #ffffff, #eff6ff);
}

.job-live-summary .panel-head span {
  color: #075ed8;
  font-weight: 900;
}

.job-summary-body {
  padding: 16px;
}

.job-summary-total {
  padding: 16px;
  border-radius: 14px;
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.24), transparent 32%),
    linear-gradient(135deg, #0b8cff, #075ed8);
  box-shadow: 0 14px 26px rgba(7, 94, 216, 0.22);
}

.job-summary-total span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.84;
}

.job-summary-total strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.job-summary-lines {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.job-summary-lines div,
.job-summary-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(187, 205, 236, 0.64);
}

.job-summary-lines span,
.job-summary-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.job-summary-lines strong,
.job-summary-note strong {
  color: #071b46;
  font-size: 14px;
  text-align: right;
}

.job-summary-lines .balance strong {
  color: #075ed8;
  font-size: 18px;
}

.job-summary-note {
  margin-top: 8px;
  border-bottom: 0;
}

.choice-grid {
  display: grid;
  gap: 8px;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.form-body > .choice-option {
  margin-top: 10px;
}

.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-option span {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(36, 56, 74, 0.38);
  border-radius: 999px;
}

.choice-option:has(input:checked) {
  border-color: rgba(7, 94, 216, 0.48);
  background: rgba(7, 94, 216, 0.08);
  color: var(--primary);
}

.choice-option:has(input:checked) span {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 3px white;
  background: var(--primary);
}

.form-divider {
  margin: 18px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
}

.settings-preview {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: var(--radius);
  background: rgba(248, 251, 255, 0.92);
}

.settings-preview span,
.settings-preview small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-preview strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
}

.backup-summary {
  display: grid;
  gap: 10px;
}

.backup-summary div {
  padding: 13px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: var(--radius);
  background: rgba(248, 251, 255, 0.92);
}

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

.backup-summary strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.form-body > .secondary-btn {
  margin-top: 10px;
}

.security-tips {
  margin-top: 14px;
}

.settings-save {
  max-width: 420px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 220px;
}

.logout-inline-form {
  display: inline;
  margin: 0;
}

.logout-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.compact-action {
  display: inline-flex;
  min-width: 0;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 270px;
}

.document-actions .compact-action,
.document-actions .table-link {
  margin: 0;
}

.document-actions .table-link,
.document-actions .small-btn {
  min-height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.service-price-form {
  grid-template-columns: minmax(150px, 1.4fr) 92px 76px auto auto;
  min-width: 500px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
}

.inline-check input {
  width: auto;
  min-height: 0;
}

.payment-check {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: var(--radius);
  background: rgba(248, 251, 255, 0.92);
}

.inline-form select {
  min-height: 36px;
}

.small-btn {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, #0d7cf2, #075ed8);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 12px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.document-helper {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(240, 247, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.document-helper strong {
  color: #073d8f;
  font-size: 13px;
}

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

.document-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.document-helper-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(7, 94, 216, 0.24);
  border-radius: 999px;
  color: #075ed8;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.document-helper-btn:hover {
  color: white;
  background: linear-gradient(135deg, #0d7cf2, #075ed8);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(187, 205, 236, 0.62);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.78));
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  color: #071b46;
}

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

.checklist-note {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.checklist-note p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.help-hero {
  align-items: stretch;
  background:
    radial-gradient(circle at top left, rgba(7, 94, 216, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 243, 255, 0.88));
  border: 1px solid rgba(126, 167, 238, 0.42);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 300px;
  margin-bottom: 16px;
  padding: 22px;
}

.help-hero h2 {
  color: #071b46;
  font-size: 30px;
  line-height: 1.2;
  margin: 8px 0;
}

.help-hero p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

.help-hero-card {
  background: linear-gradient(135deg, #075ed8, #07225d);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(7, 94, 216, 0.26);
  color: #fff;
  display: grid;
  gap: 8px;
  padding: 20px;
}

.help-hero-card strong {
  font-size: 18px;
}

.help-hero-card span {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.help-flow {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.guide-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(12, 34, 73, 0.08);
  display: grid;
  gap: 14px;
  min-height: 210px;
  padding: 16px;
}

.guide-card h2 {
  color: #071b46;
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 8px;
}

.guide-card p {
  color: var(--muted);
  line-height: 1.58;
  margin: 0;
}

.guide-card .table-link {
  align-self: end;
  justify-self: start;
}

.guide-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.guide-list div {
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(187, 205, 236, 0.62);
  border-radius: var(--radius);
  padding: 13px;
}

.guide-list strong,
.guide-list span {
  display: block;
}

.guide-list strong {
  color: #071b46;
  font-size: 14px;
  margin-bottom: 5px;
}

.guide-list span {
  color: var(--muted);
  line-height: 1.5;
}

.help-training {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 16px;
}

.help-training a {
  background: linear-gradient(180deg, #fff, #f6f9ff);
  border: 1px solid rgba(126, 167, 238, 0.52);
  border-radius: var(--radius);
  color: #073f91;
  font-weight: 900;
  padding: 13px 12px;
  text-align: center;
  text-decoration: none;
}

.health-hero {
  align-items: stretch;
  background:
    radial-gradient(circle at top left, rgba(33, 199, 107, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 243, 255, 0.9));
  border: 1px solid rgba(126, 167, 238, 0.42);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 330px;
  margin-bottom: 16px;
  padding: 22px;
}

.health-hero h2 {
  color: #071b46;
  font-size: 30px;
  line-height: 1.2;
  margin: 8px 0;
}

.health-hero p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

.health-score {
  background: linear-gradient(135deg, #075ed8, #062466);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(7, 94, 216, 0.26);
  color: #fff;
  display: grid;
  gap: 8px;
  padding: 20px;
}

.health-score span,
.health-score small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.health-score strong {
  font-size: 24px;
}

.health-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.health-business-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.health-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(187, 205, 236, 0.72);
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(12, 34, 73, 0.08);
  display: grid;
  gap: 8px;
  min-height: 132px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.health-card::before,
.health-action::before {
  border-radius: 999px;
  content: "";
  height: 11px;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 11px;
}

.health-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding-right: 22px;
}

.health-card strong {
  color: #071b46;
  font-size: 25px;
  line-height: 1.15;
}

.health-card small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.health-status-link {
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.health-status-link:hover {
  box-shadow: 0 20px 40px rgba(12, 34, 73, 0.13);
  transform: translateY(-2px);
}

.health-core-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .health-core-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .health-core-grid { grid-template-columns: 1fr; }
}

.health-ok {
  border-color: rgba(33, 199, 107, 0.28);
}

.health-ok::before {
  background: #21c76b;
}

.health-info {
  border-color: rgba(7, 94, 216, 0.28);
}

.health-info::before {
  background: #075ed8;
}

.health-warning {
  border-color: rgba(255, 179, 31, 0.38);
}

.health-warning::before {
  background: #ffb31f;
}

.health-danger {
  border-color: rgba(223, 59, 50, 0.34);
}

.health-danger::before {
  background: var(--danger);
}

.health-lower-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.health-actions {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.health-action {
  align-items: center;
  background: rgba(248, 251, 255, 0.94);
  border: 1px solid rgba(187, 205, 236, 0.62);
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px 44px 13px 13px;
  position: relative;
}

.health-action strong,
.health-action span {
  display: block;
}

.health-action strong {
  color: #071b46;
  font-size: 14px;
  margin-bottom: 4px;
}

.health-action span {
  color: var(--muted);
  line-height: 1.45;
}

.health-action .table-link {
  flex: 0 0 auto;
}

.daily-close-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(126, 167, 238, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 241, 255, 0.78)),
    radial-gradient(circle at top right, rgba(13, 124, 242, 0.14), transparent 38%);
  box-shadow: 0 20px 46px rgba(18, 45, 90, 0.12);
}

.daily-close-hero .eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: #075ed8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-close-hero h2 {
  margin: 0;
  color: #071b46;
  font-size: 26px;
  letter-spacing: 0;
}

.daily-close-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.daily-close-status {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #071b46;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(126, 167, 238, 0.46);
}

.daily-close-status span {
  font-size: 13px;
  font-weight: 900;
}

.daily-close-status strong {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #fff;
  font-size: 22px;
}

.daily-close-status.is-ready strong {
  background: linear-gradient(135deg, #18b875, #0a8f59);
  box-shadow: 0 12px 22px rgba(10, 143, 89, 0.22);
}

.daily-close-status.is-warning strong {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 12px 22px rgba(217, 119, 6, 0.22);
}

.close-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.close-check {
  min-height: 118px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(187, 205, 236, 0.76);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(18, 45, 90, 0.1);
}

.close-check span,
.close-check small {
  display: block;
}

.close-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.close-check strong {
  display: block;
  margin-top: 8px;
  color: #071b46;
  font-size: 24px;
}

.close-check small {
  margin-top: 8px;
  color: #496178;
  font-weight: 750;
  line-height: 1.45;
}

.close-check-ok {
  border-color: rgba(16, 185, 129, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.8));
}

.close-check-warn {
  border-color: rgba(245, 158, 11, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 235, 0.84));
}

.close-check-info {
  border-color: rgba(13, 124, 242, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.84));
}

.daily-close-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.daily-close-backup-actions .secondary-btn,
.daily-close-backup-actions .table-link {
  width: auto;
  min-width: 150px;
  min-height: 38px;
  justify-content: center;
}

.quick-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(7, 94, 216, 0.22);
  border-radius: var(--radius);
  color: #075ed8;
  background: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 35, 74, 0.08);
}

.daily-close-print-sheet {
  display: none;
}

.daily-close-print-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12mm;
  padding-bottom: 5mm;
  border-bottom: 2px solid #0b4f97;
}

.daily-close-print-head > div {
  display: flex;
  align-items: center;
  gap: 5mm;
}

.daily-close-print-head img {
  width: 30mm;
  height: auto;
}

.daily-close-print-head strong,
.daily-close-print-head span {
  display: block;
}

.daily-close-print-head strong {
  color: #071b46;
  font-size: 18px;
}

.daily-close-print-head span,
.daily-close-print-head p {
  margin: 0;
  color: #496178;
  font-size: 12px;
  font-weight: 800;
}

.daily-close-print-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3mm;
  margin: 6mm 0;
}

.daily-close-print-grid article {
  padding: 3mm;
  border: 1px solid #9fc2ff;
  border-radius: 4px;
}

.daily-close-print-grid span,
.daily-close-print-grid small {
  display: block;
  color: #496178;
  font-size: 10px;
  font-weight: 800;
}

.daily-close-print-grid strong {
  display: block;
  margin: 1mm 0;
  color: #071b46;
  font-size: 16px;
}

.daily-close-print-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm;
  margin-bottom: 6mm;
}

.daily-close-print-sheet h2 {
  margin: 0 0 2.5mm;
  color: #0b4f97;
  font-size: 14px;
}

.daily-close-print-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.daily-close-print-sheet th,
.daily-close-print-sheet td {
  padding: 2mm 2.4mm;
  border: 1px solid #9fc2ff;
  color: #071b46;
}

.daily-close-print-sheet th {
  color: white;
  background: #0b4f97;
  text-align: left;
}

.daily-close-print-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18mm;
  margin-top: 18mm;
}

.daily-close-print-sign div {
  text-align: center;
}

.daily-close-print-sign span {
  display: block;
  height: 12mm;
  border-bottom: 1px dotted #071b46;
}

.daily-close-print-sign strong {
  display: block;
  margin-top: 2mm;
  color: #071b46;
}

.checklist-actions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid rgba(34, 45, 58, 0.08);
}

.checklist-actions form {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(187, 205, 236, 0.5);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #49617f;
  font-size: 11px;
  text-transform: uppercase;
  background: rgba(248, 251, 255, 0.72);
}

tbody tr:hover {
  background: rgba(7, 94, 216, 0.035);
}

.error-panel {
  width: min(760px, 100%);
  padding: 28px;
  border-radius: 12px;
}

.error-panel pre {
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.table-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, #0d7cf2, #075ed8);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(7, 94, 216, 0.18);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  min-width: 116px;
}

.table-action-form {
  margin: 0;
}

.table-link-success {
  background: linear-gradient(135deg, #15b66f, #0a8f59);
  box-shadow: 0 8px 16px rgba(10, 143, 89, 0.18);
}

.preview-body {
  background: #dfe8ed;
}

.preview-body,
.document-paper,
.document-paper * {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.preview-toolbar strong,
.preview-toolbar span {
  display: block;
}

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

.preview-toolbar nav {
  display: flex;
  gap: 10px;
}

.preview-toolbar .secondary-btn {
  min-width: 112px;
}

.preview-option-form {
  margin-left: auto;
}

.preview-invoice-date-options {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-left: auto;
}

.preview-invoice-date-options .preview-date-toggle {
  min-width: 190px;
  padding: 7px 10px;
}

.preview-invoice-date-options .preview-date-toggle small {
  max-width: 180px;
}

.preview-date-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(15, 98, 254, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  cursor: pointer;
}

.preview-date-toggle input {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  accent-color: #0f62fe;
}

.preview-toolbar .preview-date-toggle span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.preview-date-toggle small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.doc-date-value {
  display: inline-block;
  min-width: 84px;
  min-height: 1em;
}

.doc-date-placeholder {
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.doc-date-blank-line {
  display: inline-block;
  width: 155px;
  height: 0.9em;
  margin-left: 4px;
  vertical-align: baseline;
  border-bottom: 2px dotted #64748b;
}

.paper-wrap {
  padding: 28px;
}

.document-paper {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 15mm 18mm;
  color: #111827;
  background: white;
  box-shadow: 0 30px 90px rgba(20, 36, 52, 0.22);
  font-size: 15px;
}

.document-paper.paper-a5 {
  width: 148mm;
  min-height: 210mm;
  padding: 13mm;
  font-size: 13px;
}

.document-paper.paper-thermal-80mm {
  width: 80mm;
  min-height: 180mm;
  padding: 7mm;
  font-size: 11px;
}

.doc-header {
  display: grid;
  grid-template-columns: minmax(112mm, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 5px solid #0b63ce;
}

.doc-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.doc-brand img {
  width: 188px;
  height: 86px;
  object-fit: contain;
}

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

.doc-brand strong {
  font-size: 23px;
  white-space: nowrap;
}

.doc-brand span {
  color: #536170;
  font-size: 17px;
  line-height: 1.18;
  max-width: 180px;
}

.doc-title {
  text-align: right;
}

.doc-title h1 {
  margin: 0;
  color: #0b63ce;
  font-size: 42px;
  white-space: nowrap;
}

.doc-title span {
  color: #536170;
  font-weight: 800;
}

.doc-company-grid,
.doc-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.doc-company-grid h2,
.doc-customer-box h2,
.doc-summary h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.doc-company-grid p,
.doc-customer-box p,
.doc-summary p {
  margin: 4px 0;
}

.doc-customer-box {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #8cbcff;
  border-radius: 8px;
}

.doc-table {
  display: table;
  overflow: visible;
  margin-top: 16px;
  border: 1px solid #d9e2ec;
  table-layout: fixed;
}

.doc-table .doc-col-item {
  width: 34%;
}

.doc-table .doc-col-no {
  width: 9%;
}

.doc-table .doc-col-qty {
  width: 14%;
}

.doc-table .doc-col-unit {
  width: 13%;
}

.doc-table .doc-col-price,
.doc-table .doc-col-total {
  width: 15%;
}

.doc-table th {
  color: white;
  background: #0b63ce !important;
}

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

.doc-table th:nth-child(1),
.doc-table th:nth-child(3),
.doc-table th:nth-child(5),
.doc-table th:nth-child(6),
.doc-table td:nth-child(1),
.doc-table td:nth-child(3),
.doc-table td:nth-child(5),
.doc-table td:nth-child(6) {
  text-align: right;
}

.document-modern {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(11, 99, 206, 0.18);
}

.document-modern::before,
.document-modern::after {
  position: absolute;
  z-index: 0;
  width: 92mm;
  height: 20mm;
  content: "";
  background: linear-gradient(135deg, #06306d, #0b63ce);
  transform: skewX(-28deg);
}

.document-modern::before {
  top: -11mm;
  left: -24mm;
}

.document-modern::after {
  right: -28mm;
  bottom: -12mm;
}

.document-modern > * {
  position: relative;
  z-index: 1;
}

.modern-doc-header {
  border-bottom: 6px solid #0b63ce;
}

.modern-doc-header .doc-brand img {
  width: 210px;
  height: 92px;
}

.modern-doc-header .doc-title h1 {
  color: #075ed8;
  font-size: 38px;
}

.modern-doc-header .doc-title span {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 28px;
  border-top: 2px solid #075ed8;
  border-bottom: 2px solid #075ed8;
  color: #1f2d3b;
  font-size: 22px;
  letter-spacing: 0;
}

.modern-doc-meta {
  align-items: start;
  padding: 8px 0 2px;
}

.doc-section-ribbon {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  color: white;
  background: linear-gradient(135deg, #06306d, #0b63ce);
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

.modern-doc-table {
  margin-top: 8px;
}

.doc-terms-box {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid #8cbcff;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(247, 251, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.doc-terms-box h2 {
  margin: 0 0 8px;
  color: #06306d;
  font-size: 16px;
}

.doc-terms-box ol {
  margin: 0;
  padding-left: 20px;
}

.doc-terms-box li {
  margin: 3px 0;
}

.form-section-title {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(187, 205, 236, 0.55);
  color: #06306d;
  font-weight: 900;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #172232;
  font-weight: 800;
}

.checkbox-line input {
  width: 17px;
  height: 17px;
}

.doc-total-box {
  justify-self: end;
  width: min(320px, 100%);
  padding: 12px;
  border: 2px solid #8cbcff;
  border-radius: 8px;
}

.doc-total-box p {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.doc-total-box .grand-total {
  padding-top: 10px;
  border-top: 1px solid #d9e2ec;
  font-size: 16px;
}

.amount-text {
  font-size: 18px;
  font-weight: 800;
}

.doc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 52px;
  text-align: center;
}

.doc-signatures.single-signature {
  grid-template-columns: 1fr;
  margin-left: auto;
  width: min(380px, 46%);
}

.doc-signatures span {
  display: block;
  height: 38px;
  border-bottom: 1px dotted #111827;
}

.doc-signatures p {
  margin: 8px 0 0;
  font-weight: 800;
}

.doc-signatures .signature-name {
  margin-top: 12px;
  color: #111827;
  font-size: 16px;
}

.doc-signatures .signature-role {
  margin-top: 2px;
  color: #111827;
  font-size: 16px;
}

.paper-thermal-80mm .doc-header,
.paper-thermal-80mm .doc-company-grid,
.paper-thermal-80mm .doc-summary,
.paper-thermal-80mm .doc-signatures {
  grid-template-columns: 1fr;
}

.paper-thermal-80mm .doc-header,
.paper-thermal-80mm .doc-title {
  text-align: center;
}

.paper-thermal-80mm .doc-brand {
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.paper-thermal-80mm .doc-brand img {
  width: 72mm;
  height: auto;
}

.paper-thermal-80mm .doc-title h1 {
  font-size: 20px;
}

.paper-thermal-80mm .doc-brand strong {
  font-size: 15px;
}

.paper-thermal-80mm .doc-brand span {
  font-size: 11px;
}

.paper-thermal-80mm .doc-signatures.single-signature {
  width: 100%;
}

.document-modern {
  padding: 13mm 13mm 11mm;
  border: 2px solid rgba(4, 63, 135, 0.12);
  font-size: 14px;
}

.document-modern::before {
  top: -8mm;
  left: -18mm;
  width: 76mm;
  height: 16mm;
  border-bottom: 2mm solid rgba(135, 190, 255, 0.92);
}

.document-modern::after {
  right: -22mm;
  bottom: -9mm;
  width: 92mm;
  height: 16mm;
  border-top: 2mm solid rgba(135, 190, 255, 0.92);
}

.modern-doc-header {
  grid-template-columns: minmax(0, 1fr) minmax(74mm, auto);
  gap: 12mm;
  align-items: start;
  padding-bottom: 8mm;
}

.modern-doc-header .doc-brand {
  align-items: flex-start;
  gap: 8mm;
}

.modern-doc-header .doc-brand img {
  width: 54mm;
  height: 26mm;
}

.modern-doc-header .doc-brand strong {
  color: #0d1b2f;
  font-size: 26px;
  line-height: 1.12;
  white-space: normal;
}

.modern-doc-header .doc-brand span {
  max-width: 62mm;
  color: #5b6778;
  font-size: 18px;
}

.modern-doc-header .doc-title h1 {
  font-size: 42px;
  line-height: 1.05;
}

.doc-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10mm;
  margin-top: 8mm;
}

.doc-info-card {
  padding: 0;
}

.doc-info-card h2 {
  margin: 0 0 4mm;
  color: #0a326c;
  font-size: 19px;
}

.doc-info-card p {
  margin: 1.7mm 0;
}

.doc-info-card span {
  display: inline-block;
  min-width: 29mm;
  color: #41526a;
  font-weight: 800;
}

.document-card {
  padding: 5mm 6mm;
  border: 1.5px solid #0b63ce;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(244, 249, 255, 0.98), #fff);
}

.document-card p {
  display: grid;
  grid-template-columns: 34mm minmax(0, 1fr);
  align-items: baseline;
  column-gap: 2mm;
}

.document-card p > span:first-child {
  min-width: 0;
}

.document-card .doc-date-blank-line {
  width: 100%;
  max-width: 42mm;
  margin-left: 0;
}

.doc-customer-box {
  margin-top: 7mm;
  padding: 6mm 7mm;
  border: 1.8px solid #0b63ce;
  border-radius: 8px;
}

.doc-customer-box h2 {
  display: inline-block;
  margin: -1mm 0 4mm;
  padding: 1.5mm 6mm 1.5mm 0;
  color: #0a326c;
  font-size: 19px;
}

.doc-field-line {
  display: grid;
  grid-template-columns: 38mm minmax(0, 1fr);
  gap: 4mm;
  min-height: 7mm;
  align-items: baseline;
}

.doc-field-line strong {
  color: #0d1b2f;
}

.doc-field-line span {
  border-bottom: 1px dotted rgba(15, 31, 58, 0.48);
}

.doc-section-ribbon {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 7px 7px 0 0;
  margin-top: 6mm;
  padding: 2.7mm 12px;
  background: linear-gradient(135deg, #053273, #0b63ce);
  color: #ffffff;
  text-align: left;
}

.modern-doc-table {
  width: 100%;
  margin-top: 0;
  border: 1.5px solid #0b63ce;
  border-collapse: collapse;
}

.modern-doc-table th {
  padding: 3mm 2mm;
  border-right: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(180deg, #074b9d, #06306d) !important;
  font-size: 14px;
}

.modern-doc-table td {
  height: 11mm;
  padding: 2.4mm 2mm;
  border-color: rgba(11, 99, 206, 0.45);
  vertical-align: top;
}

.modern-doc-table .doc-blank-row td {
  color: transparent;
}

.doc-summary {
  gap: 10mm;
  margin-top: 6mm;
  align-items: start;
}

.doc-summary > div:first-child {
  padding-top: 1mm;
}

.doc-summary h2 {
  color: #0a326c;
  font-size: 18px;
}

.amount-text {
  margin-top: 2mm;
  color: #0d1b2f;
  font-size: 20px;
  line-height: 1.35;
}

.payment-checks {
  display: flex;
  gap: 8mm;
  margin-top: 4mm;
  color: #0a326c;
  font-weight: 900;
}

.doc-total-box {
  width: 100%;
  max-width: 88mm;
  padding: 4mm 6mm;
  border: 2px solid #86b9ff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
}

.doc-total-box p {
  margin: 1.7mm 0;
  font-size: 15px;
}

.doc-total-box .grand-total {
  margin-top: 2.5mm;
  padding-top: 3mm;
  font-size: 19px;
}

.doc-terms-box {
  margin-top: 7mm;
  padding: 5mm 6mm;
  border: 1.7px solid #0b63ce;
  border-radius: 8px;
}

.doc-terms-box h2 {
  color: #0a326c;
  font-size: 18px;
}

.doc-terms-box li {
  margin: 1.4mm 0;
  line-height: 1.35;
}

.doc-signatures {
  gap: 12mm;
  margin-top: 13mm;
}

.doc-signatures span {
  height: 12mm;
}

.doc-signatures p {
  margin-top: 2mm;
}

.doc-signatures .signature-name,
.doc-signatures .signature-role {
  font-size: 15px;
}

.document-quotation_credit .doc-header {
  grid-template-columns: minmax(0, 0.9fr) minmax(82mm, 1.1fr);
  border-bottom: 0;
}

.document-quotation_credit .doc-title {
  margin: -13mm -13mm 0 0;
  padding: 12mm 13mm 18mm 22mm;
  border-bottom-left-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #043273, #0d5fc9 62%, #05245a);
}

.document-quotation_credit .doc-title h1,
.document-quotation_credit .doc-title span {
  color: white;
}

.document-quotation_credit .doc-title span {
  border-color: rgba(255, 255, 255, 0.82);
}

.document-quotation_cash .document-card {
  border-radius: 8px 0 8px 8px;
}

.document-quotation_cash .doc-title h1 {
  font-size: 43px;
}

.document-delivery_cash .modern-doc-header,
.document-cash_bill .modern-doc-header {
  grid-template-columns: 1fr 1fr;
}

.document-delivery_cash .doc-title,
.document-cash_bill .doc-title {
  grid-column: 1 / -1;
  align-self: end;
  text-align: center;
}

.document-delivery_cash .doc-title h1,
.document-delivery_credit .doc-title h1,
.document-cash_bill .doc-title h1 {
  display: inline-block;
  padding: 3mm 10mm;
  border: 2px solid #0b63ce;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, #053273, #0d5fc9);
  font-size: 34px;
}

.document-delivery_cash .doc-info-row,
.document-delivery_credit .doc-info-row {
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid #0b63ce;
  border-radius: 9px;
  padding: 5mm 6mm;
}

.document-delivery_cash .doc-info-card,
.document-delivery_credit .doc-info-card {
  padding: 0;
  border: 0;
  background: transparent;
}

.document-delivery_cash .doc-customer-box,
.document-delivery_credit .doc-customer-box {
  display: block;
  margin-top: 4mm;
  padding: 4mm 5mm;
}

.document-delivery_cash .doc-field-line,
.document-delivery_credit .doc-field-line {
  grid-template-columns: 34mm minmax(0, 1fr);
  gap: 3mm;
  min-height: 6mm;
}

.document-delivery_cash .doc-customer-address span,
.document-delivery_credit .doc-customer-address span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.document-delivery_credit .modern-doc-header {
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
  border-bottom: 0;
}

.document-delivery_credit .doc-brand {
  justify-content: center;
}

.document-delivery_credit .doc-title {
  text-align: center;
}

.document-delivery_credit .doc-section-ribbon,
.document-delivery_cash .doc-section-ribbon {
  width: 100%;
}

.document-delivery_cash .doc-total-box,
.document-delivery_credit .doc-total-box {
  max-width: 100%;
}

.document-delivery_cash .doc-terms-box,
.document-cash_bill .doc-terms-box {
  color: #e61919;
  border: 0;
  background: transparent;
}

.document-delivery_cash .doc-terms-box h2,
.document-cash_bill .doc-terms-box h2 {
  color: #e61919;
  font-size: 21px;
}

.document-cash_bill .doc-customer-box,
.document-receipt_cash .doc-customer-box {
  border-radius: 0;
}

.document-cash_bill .doc-total-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 100%;
  padding: 0;
  border-color: #0b63ce;
}

.document-cash_bill .doc-total-box p {
  display: none;
}

.document-cash_bill .doc-total-box .grand-total {
  display: flex;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
}

.document-cash_bill .doc-total-box .grand-total span {
  display: grid;
  place-items: center;
  min-height: 16mm;
  width: 38mm;
  color: white;
  background: linear-gradient(135deg, #053273, #0d5fc9);
}

.document-cash_bill .doc-total-box .grand-total strong {
  display: grid;
  flex: 1;
  place-items: center end;
  padding-right: 8mm;
}

.document-receipt_cash .doc-title h1 {
  font-size: 44px;
}

.document-receipt_cash .doc-section-ribbon {
  border-radius: 0;
}

.document-receipt_cash .doc-terms-box {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.document-receipt_cash .doc-summary {
  grid-template-columns: 1fr;
}

.document-receipt_cash .doc-total-box {
  justify-self: stretch;
  max-width: none;
}

.document-receipt_cash .doc-signatures.single-signature,
.document-cash_bill .doc-signatures.single-signature {
  width: min(430px, 52%);
}

.document-receipt_cash.document-modern {
  padding: 9mm 12mm 9mm;
  font-size: 12.5px;
}

.document-receipt_cash.document-modern::before {
  width: 60mm;
  height: 12mm;
}

.document-receipt_cash.document-modern::after {
  width: 58mm;
  height: 9mm;
}

.document-receipt_cash .modern-doc-header {
  grid-template-columns: minmax(0, 104mm) minmax(0, 1fr);
  gap: 8mm;
  align-items: center;
  padding-bottom: 5mm;
}

.document-receipt_cash .modern-doc-header .doc-brand {
  display: grid;
  grid-template-columns: 54mm minmax(0, 1fr);
  gap: 6mm;
  align-items: center;
}

.document-receipt_cash .modern-doc-header .doc-brand img {
  width: 52mm;
  height: 24mm;
}

.document-receipt_cash .modern-doc-header .doc-brand strong {
  display: block;
  max-width: 44mm;
  font-size: 20px;
  line-height: 1.08;
  word-break: keep-all;
}

.document-receipt_cash .modern-doc-header .doc-brand span {
  max-width: 44mm;
  font-size: 15px;
  line-height: 1.08;
}

.document-receipt_cash .doc-title {
  text-align: right;
}

.document-receipt_cash .doc-title h1 {
  font-size: 34px;
  line-height: 1;
}

.document-receipt_cash .doc-title span {
  margin-top: 1.5mm;
  padding-bottom: 1.5mm;
  font-size: 16px;
}

.document-receipt_cash .doc-info-row {
  grid-template-columns: minmax(0, 1fr) 86mm;
  gap: 8mm;
  margin-top: 5mm;
}

.document-receipt_cash .doc-info-card h2 {
  margin-bottom: 2.5mm;
  font-size: 16px;
}

.document-receipt_cash .doc-info-card p {
  margin: 1.15mm 0;
  line-height: 1.28;
}

.document-receipt_cash .document-card {
  padding: 4mm 5mm;
}

.document-receipt_cash .document-card p {
  display: grid;
  grid-template-columns: 28mm minmax(0, 1fr);
  gap: 2mm;
}

.document-receipt_cash .document-card span {
  min-width: 0;
}

.document-receipt_cash .doc-customer-box {
  margin-top: 5mm;
  padding: 4.5mm 5.5mm;
  border-radius: 5px;
}

.document-receipt_cash .doc-customer-box h2 {
  margin-bottom: 3mm;
  font-size: 16px;
}

.document-receipt_cash .doc-field-line {
  grid-template-columns: 34mm minmax(0, 1fr);
  gap: 3mm;
  min-height: 6mm;
}

.document-receipt_cash .doc-field-line span {
  overflow-wrap: anywhere;
}

.document-receipt_cash .doc-section-ribbon {
  margin-top: 5mm;
  padding: 2.3mm 12px;
  font-size: 15px;
}

.document-receipt_cash .modern-doc-table th {
  padding: 2.3mm 1.7mm;
  font-size: 12.5px;
}

.document-receipt_cash .modern-doc-table td {
  height: 8mm;
  padding: 1.8mm 1.7mm;
  line-height: 1.22;
}

.document-receipt_cash .modern-doc-table .doc-blank-row td {
  height: 6.5mm;
}

.document-receipt_cash .doc-summary {
  grid-template-columns: minmax(0, 1fr) 82mm;
  gap: 8mm;
  margin-top: 5mm;
}

.document-receipt_cash .doc-summary h2 {
  font-size: 16px;
}

.document-receipt_cash .amount-text {
  font-size: 18px;
}

.document-receipt_cash .payment-checks {
  margin-top: 3mm;
}

.document-receipt_cash .doc-total-box {
  justify-self: end;
  max-width: 82mm;
  padding: 3.5mm 5mm;
}

.document-receipt_cash .doc-total-box p {
  margin: 1.35mm 0;
  font-size: 13.5px;
}

.document-receipt_cash .doc-total-box .grand-total {
  margin-top: 2mm;
  padding-top: 2.4mm;
  font-size: 16px;
}

.document-receipt_cash .doc-terms-box {
  margin-top: 5mm;
  padding: 0;
  border: 0;
  background: transparent;
}

.document-receipt_cash .doc-terms-box h2 {
  font-size: 15px;
}

.document-receipt_cash .doc-terms-box li {
  margin: 0.9mm 0;
  line-height: 1.25;
}

.document-receipt_cash .doc-signatures.single-signature {
  width: 58%;
  margin-top: 10mm;
  margin-left: auto;
}

.document-receipt_cash .doc-signatures span {
  height: 9mm;
}

.document-receipt_cash .doc-signatures .signature-name,
.document-receipt_cash .doc-signatures .signature-role {
  font-size: 13.5px;
}

.document-quotation_credit .modern-doc-header {
  grid-template-columns: 92mm minmax(0, 1fr);
  gap: 6mm;
}

.document-quotation_cash .modern-doc-header {
  grid-template-columns: minmax(0, 104mm) minmax(0, 1fr);
  gap: 7mm;
}

.document-quotation_credit .modern-doc-header .doc-brand,
.document-quotation_cash .modern-doc-header .doc-brand {
  display: grid;
  grid-template-columns: 47mm minmax(0, 1fr);
  gap: 4mm;
  align-items: center;
}

.document-quotation_credit .modern-doc-header .doc-brand img,
.document-quotation_cash .modern-doc-header .doc-brand img {
  width: 46mm;
  height: 23mm;
}

.document-quotation_credit .modern-doc-header .doc-brand strong,
.document-quotation_cash .modern-doc-header .doc-brand strong {
  max-width: 42mm;
  font-size: 20px;
  line-height: 1.08;
  white-space: normal;
  word-break: keep-all;
}

.document-quotation_credit .modern-doc-header .doc-brand span,
.document-quotation_cash .modern-doc-header .doc-brand span {
  max-width: 42mm;
  font-size: 14px;
  line-height: 1.08;
}

.document-quotation_credit .doc-title h1,
.document-quotation_cash .doc-title h1 {
  font-size: 37px;
}

.document-quotation_credit .doc-title {
  padding-left: 16mm;
}

.document-delivery_credit .modern-doc-header .doc-brand,
.document-delivery_cash .modern-doc-header .doc-brand {
  display: grid;
  grid-template-columns: 52mm minmax(0, 1fr);
  gap: 6mm;
  align-items: center;
}

.document-delivery_credit .modern-doc-header .doc-brand strong,
.document-delivery_cash .modern-doc-header .doc-brand strong {
  max-width: 64mm;
  white-space: normal;
  word-break: keep-all;
}

.work-order-paper {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 8mm 9mm;
  color: #05070a;
  background: white;
  box-shadow: 0 30px 90px rgba(20, 36, 52, 0.22);
}

.work-order-paper,
.work-order-paper * {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.work-order-copy {
  min-height: 136mm;
  font-size: 17px;
}

.work-order-copy.copy {
  color: #05070a;
}

.work-order-header {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.work-order-brand {
  width: 72%;
  vertical-align: top;
  white-space: nowrap;
}

.work-order-brand-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.work-order-logo-cell {
  width: 52mm;
  vertical-align: top;
}

.work-order-header-side {
  width: 28%;
  text-align: right;
  vertical-align: top;
}

.work-order-shop-text {
  width: auto;
  vertical-align: top;
  white-space: normal;
}

.work-order-logo-cell img {
  display: inline-block;
  width: 46mm;
  height: auto;
  margin-right: 16px;
  object-fit: contain;
  vertical-align: top;
}

.work-order-shop-title,
.work-order-shop-line {
  display: block;
}

.work-order-shop-title {
  font-size: 31px;
  font-weight: 900;
  line-height: 1.28;
  padding-top: 2px;
  white-space: nowrap;
}

.work-order-shop-line {
  font-size: 14px;
  line-height: 1.25;
}

.work-order-copy-label {
  color: #155285;
  font-size: 24px;
  font-weight: 850;
  text-align: right;
}

.work-order-copy.copy .work-order-copy-label {
  color: #68b5ee;
}

.work-order-number {
  display: inline-table;
  width: 36mm;
  margin-top: 16px;
  border-collapse: separate;
  border-spacing: 0;
  color: white;
  text-align: center;
}

.work-order-number td {
  padding: 8px 12px;
  border-radius: 14px;
  color: white;
  background: #155285 !important;
  text-align: center;
}

.work-order-copy.copy .work-order-number td {
  background: #68b5ee !important;
}

.work-order-number-label,
.work-order-number-code {
  color: white;
  line-height: 1.16;
}

.work-order-number-label {
  font-size: 21px;
  font-weight: 850;
}

.work-order-number-code {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 900;
}

.work-order-title {
  width: fit-content;
  margin: 4px auto 8px;
  padding: 4px 22px 6px;
  border-radius: 12px;
  color: white;
  background: #155285 !important;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.12;
}

.work-order-copy.copy .work-order-title {
  background: #68b5ee !important;
}

.work-order-info {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 3px solid #155285;
}

.work-order-info > div:last-child {
  justify-self: end;
  min-width: 74mm;
  text-align: left;
}

.work-order-copy.copy .work-order-info {
  border-top-color: #68b5ee;
}

.work-order-info p {
  margin: 2px 0;
  line-height: 1.28;
}

.work-order-table {
  display: table;
  overflow: visible;
  table-layout: fixed;
  margin-top: 10px;
  border: 2px solid #155285;
  font-size: 16px;
}

.work-order-copy.copy .work-order-table {
  border-color: #68b5ee;
}

.work-order-table th {
  color: white;
  background: #155285 !important;
  border-color: white;
  font-size: 21px;
  text-align: center;
  text-transform: none;
}

.work-order-copy.copy .work-order-table th {
  background: #68b5ee !important;
}

.work-order-table th,
.work-order-table td {
  padding: 7px 10px;
  border: 1px solid #155285;
  white-space: normal;
}

.work-order-copy.copy .work-order-table th,
.work-order-copy.copy .work-order-table td {
  border-color: #68b5ee;
}

.work-order-table th:nth-child(1),
.work-order-table td:nth-child(1) {
  width: 58%;
}

.work-order-table.work-order-line-table th:nth-child(1),
.work-order-table.work-order-line-table td:nth-child(1) {
  width: 76%;
}

.work-order-table.work-order-line-table th:nth-child(2),
.work-order-table.work-order-line-table td:nth-child(2) {
  width: 24%;
  text-align: right;
}

.work-order-table th:nth-child(2),
.work-order-table th:nth-child(3),
.work-order-table th:nth-child(4),
.work-order-table td:nth-child(2),
.work-order-table td:nth-child(3),
.work-order-table td:nth-child(4) {
  width: 14%;
  text-align: right;
}

.work-order-table td span {
  color: #334155;
  font-size: 12px;
}

.work-order-bottom {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 14px;
}

.work-order-notes,
.work-order-right-column {
  vertical-align: top;
}

.work-order-notes {
  width: 58%;
  padding-right: 12px;
}

.work-order-right-column {
  width: 42%;
  padding-left: 12px;
  text-align: right;
}

.work-order-right-column .work-order-signatures {
  margin-top: 12px;
}

.work-order-total-summary {
  width: 100%;
  border: 2px solid #8bbdff;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
  text-align: left;
}

.work-order-total-summary td {
  padding: 3px 9px;
  line-height: 1.3;
}

.work-order-total-summary td:first-child {
  color: #1f2933;
}

.work-order-total-summary td:last-child {
  text-align: right;
  white-space: nowrap;
  font-weight: 850;
}

.work-order-total-summary tr.net td {
  padding-top: 5px;
  border-top: 1px solid rgba(34, 45, 58, 0.14);
  font-weight: 850;
}

.work-order-total-summary .balance {
  font-weight: 850;
}

.work-order-notes {
  color: red;
}

.work-order-notes h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.work-order-notes ol {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.25;
}

.work-order-signatures {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: center;
}

table.work-order-signatures {
  display: table;
  margin-top: 12px;
  border-collapse: collapse;
  table-layout: fixed;
}

.work-order-signatures.single-signature {
  width: 44%;
  margin-left: 0;
}

.work-order-signatures.two-signatures {
  grid-template-columns: 1fr 1fr;
}

table.work-order-signatures.two-signatures {
  width: 76%;
  margin-right: auto;
  margin-left: auto;
}

table.work-order-signatures td {
  text-align: center;
  vertical-align: bottom;
}

.work-order-signatures span {
  display: block;
  height: 26px;
  border-bottom: 1px dotted #111827;
}

.work-order-signatures strong,
.work-order-signatures b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.work-order-cut {
  margin: 5mm -9mm;
  border-top: 2px dashed #111827;
}

@media (max-width: 900px) {
  .auth-shell,
  .app-shell,
  .grid,
  .stats,
  .mini-stats,
  .mini-stats.status-overview,
  .close-checklist,
  .quick-actions,
  .report-filter-row,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .auth-body {
    padding: 14px;
  }

  .auth-shell {
    min-height: auto;
  }

  .auth-brand {
    min-height: 420px;
    border-radius: 18px 18px 0 0;
    padding: 34px 28px;
  }

  .auth-brand-mark {
    margin-top: 10px;
  }

  .auth-brand-copy {
    margin: 44px 0 28px;
  }

  .auth-brand h1 {
    font-size: 30px;
  }

  .auth-panel {
    min-height: auto;
    margin: -8px 0 0;
    padding: 36px 24px;
    border-radius: 18px;
  }

  .dashboard-hero,
  .dashboard-stats,
  .dashboard-focus-grid,
  .help-hero,
  .help-flow,
  .help-training,
  .health-hero,
  .health-grid,
  .health-business-grid,
  .health-lower-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    padding: 18px;
  }

  .dashboard-hero h2 {
    font-size: 28px;
  }

  .help-hero {
    padding: 18px;
  }

  .help-hero h2 {
    font-size: 25px;
  }

  .guide-card {
    min-height: auto;
  }

  .health-hero {
    padding: 18px;
  }

  .health-hero h2 {
    font-size: 25px;
  }

  .health-card {
    min-height: auto;
  }

  .health-action {
    align-items: stretch;
    flex-direction: column;
    padding-right: 36px;
  }

  .health-action .table-link {
    align-self: flex-start;
  }

  .daily-close-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .daily-close-hero h2 {
    font-size: 24px;
  }

  .daily-close-status {
    min-width: 0;
  }

  .dashboard-search {
    grid-template-columns: auto minmax(0, 1fr);
    padding-right: 12px;
  }

  .dashboard-search button {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 8px;
  }

  .job-entry-hero,
  .job-entry-grid {
    grid-template-columns: 1fr;
  }

  .job-entry-hero {
    padding: 18px;
  }

  .job-entry-hero h2 {
    font-size: 24px;
  }

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

  .job-side-stack {
    position: static;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .main {
    padding: 78px 14px 18px;
  }

  .main::before {
    position: absolute;
    left: 0;
    height: 52px;
    font-size: 13px;
  }

  .stat {
    padding-left: 82px;
  }

  .stat::before {
    width: 48px;
    height: 48px;
  }

  .stat::after {
    width: 48px;
    height: 48px;
    font-size: 21px;
  }

  .topbar {
    flex-direction: column;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-input {
    max-width: none;
  }

  .job-filter select,
  .job-filter .secondary-btn {
    width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .doc-table {
    display: table;
    overflow: visible;
  }

  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-toolbar nav {
    flex-direction: column;
  }

  .paper-wrap {
    padding: 14px;
    overflow-x: auto;
  }

  .action-notice {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm;
    height: 297mm;
    overflow: hidden;
    background: white;
    margin: 0;
  }

  body.daily-close-page {
    height: auto;
    min-height: 297mm;
    overflow: visible;
  }

  body.daily-close-page .app-shell {
    display: block;
    min-height: auto;
  }

  body.daily-close-page .sidebar,
  body.daily-close-page .main::before,
  body.daily-close-page .main > :not(.daily-close-print-sheet) {
    display: none !important;
  }

  body.daily-close-page .main {
    display: block;
    padding: 0;
    background: white;
  }

  body.daily-close-page .daily-close-print-sheet {
    display: block;
    width: 210mm;
    min-height: 297mm;
    padding: 10mm 11mm;
    color: #071b46;
    background: white;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.daily-close-page .daily-close-print-sheet section {
    margin-bottom: 6mm;
  }

  .preview-toolbar {
    display: none;
  }

  .paper-wrap {
    width: 210mm;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: visible;
  }

  .document-paper {
    width: 210mm;
    height: auto;
    min-height: 0;
    padding: 7mm 11mm 8mm;
    box-shadow: none;
    margin: 0;
    overflow: visible;
  }

  .document-paper.paper-a5 {
    width: 148mm;
    height: 210mm;
    min-height: 210mm;
  }

  .document-paper.paper-thermal-80mm {
    width: 80mm;
    min-height: auto;
  }

  .document-modern {
    border: 0;
    font-size: 11px;
  }

  .document-modern::before {
    content: none;
    display: none;
  }

  .document-modern::after {
    content: none;
    display: none;
  }

  .modern-doc-header {
    gap: 4mm;
    padding-bottom: 3.5mm;
    border-bottom-width: 3px;
  }

  .modern-doc-header .doc-brand {
    gap: 4mm;
  }

  .modern-doc-header .doc-brand img {
    width: 42mm;
    height: 20mm;
  }

  .modern-doc-header .doc-brand strong {
    font-size: 17px;
    line-height: 1.08;
  }

  .modern-doc-header .doc-brand span {
    font-size: 12px;
    line-height: 1.08;
  }

  .modern-doc-header .doc-title h1 {
    font-size: 28px;
  }

  .modern-doc-header .doc-title span {
    margin-top: 1mm;
    padding: 0.8mm 12mm;
    font-size: 13px;
  }

  .doc-info-row {
    gap: 5mm;
    margin-top: 4mm;
  }

  .doc-info-card h2,
  .doc-customer-box h2,
  .doc-summary h2,
  .doc-terms-box h2 {
    margin-bottom: 2mm;
    font-size: 13px;
  }

  .doc-info-card p,
  .doc-customer-box p,
  .doc-summary p {
    margin: 0.8mm 0;
    line-height: 1.18;
  }

  .document-card,
  .doc-customer-box,
  .doc-terms-box {
    padding: 3mm 4mm;
    border-width: 1px;
    border-radius: 5px;
  }

  .doc-customer-box {
    margin-top: 4mm;
  }

  .doc-field-line {
    grid-template-columns: 30mm minmax(0, 1fr);
    min-height: 4.8mm;
  }

  .doc-section-ribbon {
    margin-top: 4mm;
    padding: 1.8mm 12px;
    font-size: 13px;
  }

  .modern-doc-table th {
    padding: 1.7mm 1.3mm;
    font-size: 10.5px;
  }

  .modern-doc-table td {
    height: 6.4mm;
    padding: 1.2mm 1.3mm;
    line-height: 1.12;
  }

  .modern-doc-table .doc-blank-row td {
    height: 5.7mm;
  }

  .doc-summary {
    gap: 5mm;
    margin-top: 4mm;
  }

  .doc-total-box {
    max-width: 76mm;
    padding: 2.7mm 4mm;
    border-width: 1.4px;
    border-radius: 5px;
  }

  .doc-total-box p {
    margin: 0.8mm 0;
    font-size: 11px;
  }

  .doc-total-box .grand-total {
    margin-top: 1.4mm;
    padding-top: 1.8mm;
    font-size: 13px;
  }

  .amount-text {
    margin-top: 1mm;
    font-size: 13px;
    line-height: 1.2;
  }

  .doc-terms-box {
    margin-top: 3mm;
    padding: 2.5mm 4mm;
  }

  .doc-terms-box ol {
    padding-left: 15px;
  }

  .doc-terms-box li {
    margin: 0.6mm 0;
    line-height: 1.15;
  }

  .doc-signatures,
  .doc-signatures.single-signature {
    gap: 6mm;
    margin-top: 4mm;
    page-break-before: avoid;
    page-break-inside: auto;
    break-inside: auto;
  }

  .doc-signatures span {
    height: 6mm;
  }

  .doc-signatures p {
    margin-top: 1mm;
    font-size: 11px;
    line-height: 1.12;
  }

  .doc-signatures .signature-name,
  .doc-signatures .signature-role {
    margin-top: 1mm;
    font-size: 11px;
  }

  .document-quotation_credit .doc-title {
    margin-top: -8mm;
    margin-right: -11mm;
    padding: 8mm 9mm 12mm 12mm;
  }

  .document-quotation_credit .modern-doc-header,
  .document-quotation_cash .modern-doc-header {
    grid-template-columns: 86mm minmax(0, 1fr);
  }

  .document-quotation_credit .modern-doc-header .doc-brand,
  .document-quotation_cash .modern-doc-header .doc-brand {
    grid-template-columns: 38mm minmax(0, 1fr);
  }

  .document-quotation_credit .modern-doc-header .doc-brand img,
  .document-quotation_cash .modern-doc-header .doc-brand img {
    width: 37mm;
    height: 18mm;
  }

  .document-quotation_credit .modern-doc-header .doc-brand strong,
  .document-quotation_cash .modern-doc-header .doc-brand strong {
    max-width: 40mm;
    font-size: 16px;
  }

  .document-quotation_credit .modern-doc-header .doc-brand span,
  .document-quotation_cash .modern-doc-header .doc-brand span {
    max-width: 40mm;
    font-size: 11px;
  }

  .document-delivery_cash .doc-title h1,
  .document-delivery_credit .doc-title h1,
  .document-cash_bill .doc-title h1 {
    padding: 2mm 7mm;
    font-size: 24px;
  }

  .document-delivery_cash .doc-title,
  .document-delivery_credit .doc-title {
    margin-top: 1mm;
  }

  .document-delivery_cash .doc-info-row,
  .document-delivery_credit .doc-info-row {
    padding: 3mm 4mm;
  }

  .document-receipt_cash.document-modern {
    padding: 8mm 11mm 7mm;
    font-size: 11px;
  }

  .document-receipt_cash .modern-doc-header {
    grid-template-columns: 96mm minmax(0, 1fr);
    gap: 5mm;
    padding-bottom: 3.5mm;
  }

  .document-receipt_cash .modern-doc-header .doc-brand {
    grid-template-columns: 44mm minmax(0, 1fr);
    gap: 4mm;
  }

  .document-receipt_cash .modern-doc-header .doc-brand img {
    width: 43mm;
    height: 20mm;
  }

  .document-receipt_cash .modern-doc-header .doc-brand strong {
    max-width: 42mm;
    font-size: 17px;
  }

  .document-receipt_cash .modern-doc-header .doc-brand span {
    max-width: 42mm;
    font-size: 12px;
  }

  .document-receipt_cash .doc-title h1 {
    font-size: 27px;
  }

  .document-receipt_cash .doc-info-row {
    grid-template-columns: minmax(0, 1fr) 78mm;
    gap: 5mm;
    margin-top: 4mm;
  }

  .document-receipt_cash .doc-customer-box,
  .document-receipt_cash .doc-section-ribbon,
  .document-receipt_cash .doc-summary,
  .document-receipt_cash .doc-terms-box {
    margin-top: 3.5mm;
  }

  .document-receipt_cash .doc-total-box {
    max-width: 75mm;
    padding: 2.7mm 4mm;
  }

  .document-receipt_cash .doc-signatures.single-signature {
    width: 52%;
    margin-top: 6mm;
  }

  .work-order-paper {
    width: 210mm;
    height: 297mm;
    min-height: 0;
    margin: 0;
    padding: 4mm 8mm;
    overflow: hidden;
    page-break-after: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    break-inside: avoid;
    box-shadow: none;
  }

  .work-order-copy {
    height: 140mm;
    min-height: 0;
    overflow: hidden;
    font-size: 13px;
  }

  .work-order-header {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .work-order-brand {
    width: 72%;
    vertical-align: top;
  }

  .work-order-logo-cell {
    width: 50mm;
  }

  .work-order-header-side {
    width: 28%;
    text-align: right;
    vertical-align: top;
  }

  .work-order-logo-cell img {
    width: 46mm;
    height: auto;
    margin-right: 7px;
  }

  .work-order-shop-text {
    width: auto;
  }

  .work-order-shop-title {
    font-size: 23px;
    line-height: 1.32;
    padding-top: 1mm;
  }

  .work-order-shop-line {
    font-size: 11px;
    line-height: 1.12;
  }

  .work-order-copy-label {
    font-size: 17px;
  }

  .work-order-number {
    display: inline-table;
    width: 27mm;
    margin-top: 2px;
  }

  .work-order-number td {
    padding: 4px 8px;
    border-radius: 9px;
  }

  .work-order-number-label {
    font-size: 14px;
  }

  .work-order-number-code {
    font-size: 12px;
  }

  .work-order-title {
    margin: 1mm auto 2mm;
    padding: 1px 14px 3px;
    border-radius: 8px;
    font-size: 22px;
  }

  .work-order-info {
    grid-template-columns: 1fr 0.9fr;
    gap: 6px;
    padding-top: 4px;
    border-top-width: 2px;
  }

  .work-order-info > div:last-child {
    min-width: 70mm;
  }

  .work-order-info p {
    margin: 0;
    line-height: 1.15;
  }

  .work-order-table {
    margin-top: 5px;
    border-width: 1px;
    font-size: 11px;
  }

  .work-order-table th {
    font-size: 15px;
  }

  .work-order-table th,
  .work-order-table td {
    padding: 4px 6px;
  }

  .work-order-table td span {
    font-size: 9px;
  }

  .work-order-table.work-order-line-table th:nth-child(1),
  .work-order-table.work-order-line-table td:nth-child(1) {
    width: 76%;
  }

  .work-order-table.work-order-line-table th:nth-child(2),
  .work-order-table.work-order-line-table td:nth-child(2) {
    width: 24%;
    text-align: right;
  }

  .work-order-bottom {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 7px;
  }

  .work-order-notes {
    width: 58%;
    padding-right: 8px;
  }

  .work-order-right-column {
    width: 42%;
    padding-left: 8px;
    text-align: right;
  }

  .work-order-right-column .work-order-signatures {
    margin-top: 7mm;
  }

  .work-order-total-summary {
    width: 100%;
    border-width: 1px;
    font-size: 9px;
    text-align: left;
  }

  .work-order-total-summary td {
    padding: 2px 5px;
    line-height: 1.2;
  }

  .work-order-total-summary tr.net td {
    padding-top: 3px;
  }

  .work-order-notes h2 {
    margin-bottom: 2px;
    font-size: 18px;
  }

  .work-order-notes ol {
    padding-left: 15px;
    font-size: 11px;
    line-height: 1.22;
  }

  .work-order-signatures {
    gap: 6px;
  }

  table.work-order-signatures {
    margin-top: 7px;
  }

  .work-order-signatures.single-signature {
    width: 44%;
  }

  .work-order-signatures span {
    height: 18px;
  }

  .work-order-signatures strong,
  .work-order-signatures b {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.15;
  }

  .work-order-cut {
    margin: 1.5mm -8mm;
    border-top-width: 1px;
  }

  body.report-page {
    width: auto;
    height: auto;
    overflow: visible;
    background: #ffffff;
  }

  body.report-page .app-shell {
    display: block;
    min-height: auto;
    background: #ffffff;
  }

  body.report-page .sidebar,
  body.report-page .user-pill,
  body.report-page .report-filter {
    display: none;
  }

  body.report-page .main {
    width: auto;
    min-height: auto;
    padding: 8mm;
    overflow: visible;
    background: #ffffff;
  }

  body.report-page .main::before {
    display: none;
  }

  body.report-page .topbar {
    margin-bottom: 6mm;
    padding: 0 0 4mm;
    border-bottom: 2px solid #0d66d0;
  }

  body.report-page .topbar h1 {
    font-size: 22px;
  }

  body.report-page .topbar p {
    font-size: 12px;
  }

  body.report-page .stats,
  body.report-page .mini-stats.report-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4mm;
  }

  body.report-page .grid {
    grid-template-columns: 1fr;
    gap: 4mm;
  }

  body.report-page .stat,
  body.report-page .mini-stats div,
  body.report-page .panel {
    border: 1px solid #cbd5e1;
    box-shadow: none;
    break-inside: avoid;
  }

  body.report-page .panel {
    margin-bottom: 4mm;
  }

  body.report-page table {
    font-size: 10px;
  }

  body.report-page th,
  body.report-page td {
    padding: 5px 6px;
  }
}

/* Final document overrides: keep quotation, delivery note, and receipt consistent. */
.preview-option-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.document-modern.document-quotation_cash,
.document-modern.document-quotation_credit,
.document-modern.document-delivery_cash,
.document-modern.document-delivery_credit,
.document-modern.document-receipt_cash {
  color: #0b1f3f;
  font-size: 14px;
  line-height: 1.34;
  min-height: 0;
  overflow: visible;
  padding-bottom: 12mm;
}

.document-modern.document-quotation_cash::before,
.document-modern.document-quotation_cash::after,
.document-modern.document-quotation_credit::before,
.document-modern.document-quotation_credit::after,
.document-modern.document-delivery_cash::before,
.document-modern.document-delivery_cash::after,
.document-modern.document-delivery_credit::before,
.document-modern.document-delivery_credit::after,
.document-modern.document-receipt_cash::before,
.document-modern.document-receipt_cash::after {
  content: none;
  display: none;
}

.document-modern.document-quotation_cash .modern-doc-header,
.document-modern.document-quotation_credit .modern-doc-header,
.document-modern.document-delivery_cash .modern-doc-header,
.document-modern.document-delivery_credit .modern-doc-header,
.document-modern.document-receipt_cash .modern-doc-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(62mm, 74mm);
  gap: 8mm;
  align-items: start;
  padding-bottom: 6mm;
  border-bottom: 4px solid #0b63ce;
  text-align: left;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand {
  display: grid;
  grid-template-columns: 42mm minmax(0, 1fr);
  gap: 5mm;
  align-items: center;
  justify-content: start;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand img,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand img,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand img,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand img,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand img {
  width: 40mm;
  height: auto;
  max-height: 22mm;
  object-fit: contain;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand strong,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand strong,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand strong,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand strong,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand strong {
  max-width: none;
  color: #0d1b2f;
  font-size: 22px;
  line-height: 1.08;
  white-space: normal;
}

.document-modern.document-quotation_cash .modern-doc-header .doc-brand span,
.document-modern.document-quotation_credit .modern-doc-header .doc-brand span,
.document-modern.document-delivery_cash .modern-doc-header .doc-brand span,
.document-modern.document-delivery_credit .modern-doc-header .doc-brand span,
.document-modern.document-receipt_cash .modern-doc-header .doc-brand span {
  max-width: none;
  color: #5b6778;
  font-size: 13px;
  line-height: 1.15;
}

.document-modern.document-quotation_cash .doc-title,
.document-modern.document-quotation_credit .doc-title,
.document-modern.document-delivery_cash .doc-title,
.document-modern.document-delivery_credit .doc-title,
.document-modern.document-receipt_cash .doc-title {
  grid-column: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #075ed8;
  background: transparent;
  text-align: right;
}

.document-modern.document-quotation_cash .doc-title h1,
.document-modern.document-quotation_credit .doc-title h1,
.document-modern.document-delivery_cash .doc-title h1,
.document-modern.document-delivery_credit .doc-title h1,
.document-modern.document-receipt_cash .doc-title h1 {
  display: block;
  margin: 0;
  padding: 0 0 2mm;
  border: 0;
  border-bottom: 2px solid #075ed8;
  border-radius: 0;
  color: #075ed8;
  background: transparent;
  font-size: 32px;
  line-height: 1.04;
}

.document-modern.document-quotation_cash .doc-title span,
.document-modern.document-quotation_credit .doc-title span,
.document-modern.document-delivery_cash .doc-title span,
.document-modern.document-delivery_credit .doc-title span,
.document-modern.document-receipt_cash .doc-title span {
  display: inline-block;
  margin-top: 1mm;
  padding: 0 0 1.2mm;
  border: 0;
  border-bottom: 2px solid #075ed8;
  color: #1f2d3b;
  font-size: 13px;
  font-weight: 900;
}

.document-modern .doc-info-row,
.document-modern.document-delivery_cash .doc-info-row,
.document-modern.document-delivery_credit .doc-info-row,
.document-modern.document-receipt_cash .doc-info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(74mm, 86mm);
  gap: 8mm;
  margin-top: 6mm;
  padding: 0;
  border: 0;
}

.document-modern .document-card,
.document-modern .doc-customer-box,
.document-modern .doc-terms-box {
  border-color: #0b63ce;
}

.document-modern .doc-info-card h2,
.document-modern .doc-customer-box h2,
.document-modern .doc-summary h2,
.document-modern .doc-terms-box h2 {
  font-size: 16px;
}

.document-modern .doc-info-card p,
.document-modern .doc-customer-box p,
.document-modern .doc-summary p,
.document-modern .doc-terms-box li,
.document-modern .doc-field-line,
.document-modern .modern-doc-table td,
.document-modern .modern-doc-table th {
  font-size: 13px;
}

.document-modern .doc-col-no {
  width: 7%;
}

.document-modern .doc-col-item {
  width: 34%;
}

.document-modern .doc-col-qty,
.document-modern .doc-col-delivered {
  width: 10%;
}

.document-modern .doc-col-unit {
  width: 10%;
}

.document-modern .doc-col-price,
.document-modern .doc-col-total {
  width: 13%;
}

.document-modern .doc-col-delivery-note {
  width: 13%;
}

.document-modern.document-prices-hidden .doc-col-item {
  width: 43%;
}

.document-modern.document-prices-hidden .doc-col-delivery-note {
  width: 20%;
}

.document-modern .modern-doc-table small {
  color: #334155;
  font-size: 12px;
  line-height: 1.24;
}

.receipt-total-box .grand-total {
  color: #075ed8;
  font-size: 22px;
}

.receipt-total-box .receipt-status strong {
  color: #c2410c;
}

@media print {
  .document-modern.document-quotation_cash,
  .document-modern.document-quotation_credit,
  .document-modern.document-delivery_cash,
  .document-modern.document-delivery_credit,
  .document-modern.document-receipt_cash {
    font-size: 12px;
    line-height: 1.28;
  }

  .document-modern .doc-info-card p,
  .document-modern .doc-customer-box p,
  .document-modern .doc-summary p,
  .document-modern .doc-terms-box li,
  .document-modern .doc-field-line,
  .document-modern .modern-doc-table th,
  .document-modern .modern-doc-table td {
    font-size: 12px;
  }

  .document-modern .modern-doc-table small {
    font-size: 11px;
  }

  .receipt-total-box .grand-total {
    font-size: 18px;
  }
}

/* Multipage document flow for quotation, delivery note, and receipt. */
.document-modern.document-receipt_cash .doc-summary {
  grid-template-columns: minmax(0, 1fr) minmax(76mm, 82mm);
  gap: 7mm;
  align-items: center;
  margin-top: 4mm;
}

.document-modern.document-receipt_cash .receipt-amount-words {
  width: min(100%, 102mm);
  margin-left: auto;
  padding: 2.5mm 4mm;
  text-align: center;
}

.document-modern.document-receipt_cash .receipt-amount-words h2 {
  margin-bottom: 1.5mm;
}

.document-modern .amount-text {
  margin: 0;
  font-size: 18px !important;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.document-modern.document-receipt_cash .receipt-amount-words .amount-text {
  text-align: center;
}

@media print {
  .document-modern .amount-text {
    font-size: 16px !important;
  }
}

.document-modern.document-receipt_cash .doc-terms-box {
  margin-top: 3.5mm;
}

.document-modern.document-receipt_cash .doc-signatures.single-signature {
  width: min(76mm, 46%);
  margin-top: 6mm;
  margin-right: 8mm;
  margin-left: auto;
}

@media print {
  .document-modern.document-receipt_cash .doc-summary {
    gap: 5mm;
    margin-top: 3mm;
  }

  .document-modern.document-receipt_cash .receipt-amount-words {
    padding: 2mm 3mm;
  }

  .document-modern.document-receipt_cash .doc-terms-box {
    margin-top: 2.5mm;
  }

  .document-modern.document-receipt_cash .doc-signatures.single-signature {
    margin-top: 4mm;
  }
}

.preview-body .document-page {
  overflow: visible;
  break-after: page;
  page-break-after: always;
}

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

.preview-body .document-page + .document-page {
  margin-top: 28px;
}

.preview-body .doc-continuation-header {
  display: table;
  width: 100%;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 3px solid #0b63ce;
  color: #0b1f3f;
}

.preview-body .doc-continuation-header > div {
  display: table-cell;
  width: 50%;
  vertical-align: bottom;
}

.preview-body .doc-continuation-header > div:last-child {
  text-align: right;
}

.preview-body .doc-continuation-header strong,
.preview-body .doc-continuation-header span {
  display: block;
}

.preview-body .doc-continuation-header strong {
  color: #075ed8;
  font-size: 18px;
  line-height: 1.15;
}

.preview-body .doc-continuation-header span {
  font-size: 12px;
}

.preview-body .doc-attachment-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #8cbcff;
  border-radius: 8px;
  background: #f8fbff;
}

.preview-body .doc-attachment-note h2 {
  margin: 0 0 6px;
  color: #06306d;
  font-size: 16px;
}

.preview-body .doc-attachment-note p {
  margin: 0;
}

.preview-body .document-modern .modern-doc-table thead {
  display: table-header-group;
}

.preview-body .document-modern .modern-doc-table tbody {
  display: table-row-group;
}

.preview-body .document-modern .modern-doc-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.preview-body .document-modern .modern-doc-table td,
.preview-body .document-modern .modern-doc-table .doc-blank-row td {
  height: auto;
}

.preview-body .doc-final-block {
  break-inside: avoid;
  page-break-inside: avoid;
}

.preview-body .doc-page-number {
  margin-top: 10px;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

@media print {
  body.preview-body {
    width: 210mm;
    height: auto;
    min-height: 0;
    overflow: visible;
    background: white;
  }

  .preview-body .document-page {
    break-after: page;
    page-break-after: always;
  }

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

  .preview-body .document-page + .document-page {
    margin-top: 0;
  }

  .preview-body .doc-continuation-header {
    margin-bottom: 3mm;
    padding-bottom: 2mm;
  }

  .preview-body .doc-continuation-header strong {
    font-size: 14px;
  }

  .preview-body .doc-continuation-header span {
    font-size: 11px;
  }

  .preview-body .doc-attachment-note {
    margin-top: 3mm;
    padding: 3mm 4mm;
    border-radius: 5px;
  }

  .preview-body .doc-attachment-note h2 {
    font-size: 13px;
  }

  .preview-body .document-modern .modern-doc-table thead {
    display: table-header-group;
  }

  .preview-body .document-modern .modern-doc-table tbody {
    display: table-row-group;
  }

  .preview-body .document-modern .modern-doc-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .preview-body .document-modern .modern-doc-table td,
  .preview-body .document-modern .modern-doc-table .doc-blank-row td {
    height: auto;
  }

  .preview-body .doc-final-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .preview-body .doc-page-number {
    margin-top: 3mm;
    font-size: 10px;
  }
}

@media print {
  .preview-notice {
    display: none !important;
  }
}

/* Digital signature controls for quotation, delivery note, and receipt */
.preview-signature-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}
.preview-signature-form .preview-date-toggle { min-width: 250px; }
.preview-payer-mode-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-payer-mode-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(15,98,254,.18);
  border-radius: 8px;
}
.preview-payer-mode-form legend {
  padding: 0 4px;
  color: #315b8f;
  font-size: 11px;
  font-weight: 800;
}
.preview-payer-mode-form label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.preview-signature-pin {
  width: 82px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(15,98,254,.22);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.signature-slot { position: relative; display: block; height: 50px !important; overflow: visible; }
.digital-signature-image {
  display: block;
  width: 150px;
  height: 38px;
  max-width: 92%;
  margin: 0 auto;
  object-fit: fill;
  transform: translateY(6px);
}
.doc-page-digital-signature {
  width: 180px;
  margin: 10mm 0 0 auto;
  text-align: center;
  break-inside: avoid;
}
.doc-page-digital-signature img { display:block; max-width:145px; max-height:42px; margin:0 auto 2px; object-fit:contain; }
.doc-page-digital-signature small { font-size:10px; color:#475569; }
@media print {
  .preview-signature-form { display:none !important; }
  .digital-signature-image, .doc-page-digital-signature img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* Document governance: issue history and cancellation */
.document-governance-panel {
  width: min(980px, calc(100% - 32px));
  margin: 16px auto 4px;
  padding: 14px 16px;
  border: 1px solid #d7e3f2;
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 24px rgba(15,35,74,.08);
}
.document-governance-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.document-governance-head > div { display:grid; gap:2px; }
.document-governance-head strong { color:#173b6c; font-size:14px; }
.document-governance-head small { color:#718096; font-size:11px; }
.document-history-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.document-history-row { min-width:205px; display:grid; gap:2px; padding:8px 10px; border:1px solid #e2e8f0; border-radius:8px; background:#f8fbff; }
.document-history-row span { color:#315b8f; font-size:11px; font-weight:800; }
.document-history-row b { color:#172b4d; font-size:12px; }
.document-history-row small { color:#64748b; font-size:10px; }
.document-history-issued { background:#f1f8f4; border-color:#cce8d7; }
.document-history-empty { margin:4px 0; color:#718096; font-size:12px; }
.document-cancel-button { border-color:#ef9a9a !important; color:#b42318 !important; }
.document-paper.document-cancelled { position:relative; }
.document-cancelled-watermark {
  position:absolute;
  left:50%; top:48%;
  z-index:20;
  transform:translate(-50%,-50%) rotate(-28deg);
  color:#b42318;
  opacity:.14;
  font-size:92px;
  font-weight:900;
  letter-spacing:10px;
  white-space:nowrap;
  pointer-events:none;
  user-select:none;
}
@media print {
  .document-governance-panel { display:none !important; }
  .document-cancelled-watermark { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}


/* Document verification QR */
.doc-verification-qr {
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin: 2.5mm 8mm 0 auto;
  color: #334155;
  text-align: left;
}
.doc-verification-qr img { width: 16mm; height: 16mm; object-fit: contain; }
.doc-verification-qr div { display: grid; gap: 1px; }
.doc-verification-qr strong { font-size: 9px; color: #0b3b82; line-height: 1.1; }
.doc-verification-qr small { font-size: 7px; color: #64748b; line-height: 1.1; }
@media print { .doc-verification-qr img { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Receipt-only payment block shared by preview, print and PDF. */
.document-receipt_cash .receipt-payment-block {
  margin-top: 3.5mm;
  padding: 3mm 4mm 2.5mm;
  border: 1px solid #8cbcff;
  border-radius: 6px;
  background: #f8fbff;
  color: #132f57;
  break-inside: avoid;
  page-break-inside: avoid;
}

.document-receipt_cash .receipt-payment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4mm;
  padding-bottom: 2mm;
  border-bottom: 1px solid #c9ddf6;
}

.document-receipt_cash .receipt-payment-heading h2 {
  flex: 0 0 auto;
  margin: 0;
  color: #075ed8;
  font-size: 15px;
  line-height: 1.1;
}

.document-receipt_cash .receipt-payment-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.5mm 4mm;
  color: #475569;
  font-size: 11.5px;
  line-height: 1.2;
}

.document-receipt_cash .receipt-payment-check.is-selected {
  color: #075ed8;
  font-weight: 800;
}

.document-receipt_cash .receipt-payment-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2mm 3mm;
  padding: 2.2mm 0;
  border-bottom: 1px solid #dbe8f7;
}

.document-receipt_cash .receipt-payment-details p {
  display: grid;
  gap: .6mm;
  min-width: 0;
  margin: 0;
  font-size: 11px;
  line-height: 1.18;
}

.document-receipt_cash .receipt-payment-details span {
  color: #64748b;
}

.document-receipt_cash .receipt-payment-details strong {
  overflow-wrap: anywhere;
  color: #172b4d;
}

.document-receipt_cash .receipt-payment-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14mm;
  padding: 2mm 7mm 0;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}

.document-receipt_cash .receipt-payment-signature-line {
  position: relative;
  display: block;
  height: 8mm;
  border-bottom: 1px solid #6c7f99;
}

.document-receipt_cash .receipt-payment-person,
.document-receipt_cash .receipt-payment-role,
.document-receipt_cash .receipt-payment-date {
  margin: .6mm 0 0;
  font-size: 10.5px;
  line-height: 1.12;
}

.document-receipt_cash .receipt-payment-person {
  min-height: 1.2em;
  color: #172b4d;
}

.document-receipt_cash .receipt-payment-role {
  color: #075ed8;
  font-weight: 800;
}

.document-receipt_cash .receipt-payment-date {
  color: #64748b;
  min-height: 1.12em;
}

.document-receipt_cash .receipt-payment-date.is-hidden {
  visibility: hidden;
}

.document-receipt_cash .receipt-payment-digital-signature {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 50mm;
  height: 12mm;
  max-width: 50mm;
  max-height: 12mm;
  margin: auto;
  object-fit: contain;
  transform: none;
}

/* Keep the complete A4 receipt footer together in Preview, Print and PDF. */
.document-receipt_cash .doc-summary {
  gap: 4mm;
  margin-top: 2.5mm;
}

.document-receipt_cash .doc-total-box {
  padding: 2mm 3.5mm;
}

.document-receipt_cash .doc-terms-box {
  margin-top: 1.8mm;
}

.document-receipt_cash .receipt-payment-block {
  margin-top: 1.8mm;
  padding: 1.8mm 3mm 1.3mm;
}

.document-receipt_cash .receipt-payment-heading {
  padding-bottom: 1mm;
}

.document-receipt_cash .receipt-payment-details {
  padding: 1.1mm 0;
}

.document-receipt_cash .receipt-payment-signatures {
  padding: 1mm 5mm 0;
}

.document-receipt_cash .receipt-payment-signature-line {
  height: 12mm;
}

.document-receipt_cash .doc-verification-qr {
  margin-top: 1mm;
  break-inside: avoid;
  page-break-inside: avoid;
}

.document-receipt_cash .doc-verification-qr img {
  width: 14mm;
  height: 14mm;
  object-fit: contain;
}

.document-receipt_cash.paper-a5 .receipt-payment-heading,
.document-receipt_cash.paper-thermal-80mm .receipt-payment-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 1.5mm;
}

.document-receipt_cash.paper-a5 .receipt-payment-checks,
.document-receipt_cash.paper-thermal-80mm .receipt-payment-checks {
  justify-content: flex-start;
}

.document-receipt_cash.paper-a5 .receipt-payment-details,
.document-receipt_cash.paper-thermal-80mm .receipt-payment-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-receipt_cash.paper-a5 .receipt-payment-signatures,
.document-receipt_cash.paper-thermal-80mm .receipt-payment-signatures {
  gap: 5mm;
  padding-right: 1mm;
  padding-left: 1mm;
}

@media print {
  .document-receipt_cash .receipt-payment-block {
    margin-top: 1.8mm;
    padding: 1.8mm 3mm 1.3mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .document-receipt_cash .receipt-payment-heading {
    padding-bottom: 1mm;
  }

  .document-receipt_cash .receipt-payment-details {
    padding: 1.1mm 0;
  }

  .document-receipt_cash .receipt-payment-signatures {
    padding: 1mm 5mm 0;
  }

  .document-receipt_cash .receipt-payment-digital-signature {
    display: block;
    width: 50mm;
    height: 12mm;
    max-width: 50mm;
    max-height: 12mm;
    object-fit: contain;
  }
}

/* Receipt preview workspace. Scoped so other document toolbars keep their layout. */
.preview-toolbar-receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 12px;
  padding: 10px 16px;
}

.preview-toolbar-receipt .preview-toolbar-document {
  flex: 0 0 150px;
  min-width: 0;
}

.preview-toolbar-receipt .preview-toolbar-options-receipt {
  display: flex;
  flex: 1 1 1080px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.preview-toolbar-receipt .preview-option-form {
  flex: 0 0 auto;
  margin: 0;
}

.preview-toolbar-receipt .preview-date-toggle {
  box-sizing: border-box;
  margin: 0;
}

.preview-toolbar-receipt input[type="checkbox"],
.preview-toolbar-receipt input[type="radio"] {
  box-sizing: border-box;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.preview-toolbar-receipt .preview-payer-mode-form {
  display: grid;
  flex: 0 0 370px;
  grid-template-columns: 270px 90px;
  align-items: stretch;
  gap: 10px;
  width: 370px;
}

.preview-toolbar-receipt .preview-payer-mode-form fieldset {
  display: block;
  box-sizing: border-box;
  width: 270px;
  min-width: 0;
  padding: 4px 10px 7px;
}

.preview-toolbar-receipt .preview-payer-mode-choices {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2px;
}

.preview-toolbar-receipt .preview-payer-mode-form label,
.preview-toolbar-receipt .preview-payer-mode-form label span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.preview-toolbar-receipt .preview-payer-mode-form label {
  gap: 6px;
  min-height: 20px;
  margin: 0;
}

.preview-toolbar-receipt .preview-signature-date-options {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(15, 98, 254, 0.12);
}

.document-signature-date-options {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 98, 254, 0.18);
  border-radius: 8px;
}

.document-signature-date-options legend {
  padding: 0 4px;
  color: #315b8f;
  font-size: 12px;
  font-weight: 800;
}

.document-signature-date-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.document-signature-date-options input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.preview-toolbar-receipt .preview-payer-mode-form .secondary-btn {
  width: 90px;
  min-width: 90px;
  padding-inline: 10px;
}

.preview-toolbar-receipt .preview-signature-form {
  display: grid;
  flex: 0 0 530px;
  grid-template-columns: minmax(280px, 1fr) 82px 130px;
  align-items: stretch;
  gap: 8px;
  width: 530px;
}

.preview-toolbar-receipt .preview-signature-form .preview-date-toggle {
  width: auto;
  min-width: 0;
  max-width: none;
}

.preview-toolbar-receipt .preview-signature-pin {
  width: 82px;
}

.preview-toolbar-receipt .preview-signature-form .secondary-btn {
  width: 130px;
  min-width: 130px;
  padding-inline: 10px;
}

.preview-toolbar-receipt nav {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.document-governance-panel-receipt {
  position: relative;
  clear: both;
  width: min(980px, calc(100% - 32px));
  margin: 18px auto 6px;
}

.paper-wrap-receipt {
  clear: both;
  width: 100%;
  min-width: 0;
  padding: 28px max(18px, calc((100% - 210mm) / 2));
  overflow-x: auto;
}

.paper-wrap-receipt > .document-paper {
  flex: none;
  margin-right: auto;
  margin-left: auto;
}

@media (max-width: 1100px) {
  .preview-toolbar-receipt .preview-toolbar-document {
    flex-basis: 100%;
  }

  .preview-toolbar-receipt .preview-toolbar-options-receipt {
    flex-basis: 100%;
  }

  .preview-toolbar-receipt nav {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .preview-toolbar-receipt {
    align-items: stretch;
    padding: 10px 12px;
  }

  .preview-toolbar-receipt .preview-toolbar-options-receipt {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-toolbar-receipt .preview-option-form,
  .preview-toolbar-receipt .preview-date-toggle,
  .preview-toolbar-receipt .preview-payer-mode-form,
  .preview-toolbar-receipt .preview-payer-mode-form fieldset,
  .preview-toolbar-receipt .preview-signature-form {
    width: 100%;
    min-width: 0;
  }

  .preview-toolbar-receipt .preview-payer-mode-form,
  .preview-toolbar-receipt .preview-signature-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-toolbar-receipt .preview-payer-mode-form .secondary-btn,
  .preview-toolbar-receipt .preview-signature-pin,
  .preview-toolbar-receipt .preview-signature-form .secondary-btn {
    width: 100%;
  }

  .preview-toolbar-receipt nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-toolbar-receipt nav .secondary-btn {
    width: 100%;
  }
}

@media print {
  .preview-toolbar-receipt,
  .document-governance-panel-receipt {
    display: none !important;
  }

  .paper-wrap-receipt {
    width: 210mm;
    padding: 0;
    overflow: visible;
  }
}

/* Documents builder UI polish — receipt controls */
.documents-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.documents-form-card .form-body {
  gap: 12px;
}

.documents-form-card select,
.documents-form-card input,
.documents-form-card textarea {
  min-width: 0;
}

.documents-form-card .document-payment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 98, 254, 0.16);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.72);
}
.documents-form-card .document-payment-source,
.documents-form-card .document-payer-name-options,
.documents-form-card .document-signature-date-options {
  grid-column: 1 / -1;
}

.documents-form-card .document-payer-name-options,
.documents-form-card .document-signature-date-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 98, 254, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.documents-form-card .document-payer-name-options legend,
.documents-form-card .document-signature-date-options legend {
  flex: 0 0 100%;
  padding: 0;
  color: #315b8f;
  font-size: 12px;
  font-weight: 800;
}
.documents-form-card .document-payer-name-options label,
.documents-form-card .document-signature-date-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  cursor: pointer;
}

.documents-form-card .document-payer-name-options input,
.documents-form-card .document-signature-date-options input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.documents-form-card .document-payment-fields > .form-row {
  grid-column: 1 / -1;
  margin: 0;
}

.documents-form-card .document-payment-fields > label,
.documents-form-card .document-payment-fields > input {
  align-self: end;
}
.documents-side-card {
  position: sticky;
  top: 14px;
  align-self: start;
}

.documents-side-card .profile-list {
  gap: 8px;
  padding: 12px;
}

.documents-side-card .profile-list > div {
  padding: 11px 12px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.documents-side-card .profile-list > div:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 98, 254, 0.32);
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.08);
}

@media (max-width: 1180px) {
  .documents-layout { grid-template-columns: 1fr; }
  .documents-side-card { position: static; }
}

@media (max-width: 760px) {
  .documents-form-card .document-payment-fields { grid-template-columns: 1fr; }
  .documents-form-card .document-payer-name-options label,
  .documents-form-card .document-signature-date-options label { white-space: normal; }
}

/* Documents: context-aware conditional fields */
.documents-form-card .document-conditional-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.documents-form-card .document-conditional-block[hidden],
.documents-form-card .document-payment-fields:not(.is-visible) {
  display: none !important;
}

.documents-form-card .document-payment-fields[hidden] {
  display: none !important;
}

/* BM Shop Login — Dark Premium 2026-09-26 */
.auth-body {
  background:
    radial-gradient(circle at 86% 12%, rgba(35, 111, 255, 0.22), transparent 24%),
    radial-gradient(circle at 16% 88%, rgba(0, 174, 255, 0.12), transparent 28%),
    linear-gradient(135deg, #07101d 0%, #0b1424 48%, #111d31 100%);
}
.auth-shell {
  filter: drop-shadow(0 30px 70px rgba(0, 0, 0, 0.42));
}
.auth-brand {
  background:
    radial-gradient(circle at 72% 18%, rgba(55, 132, 255, 0.28), transparent 30%),
    linear-gradient(150deg, #071b4d 0%, #0a2e79 52%, #071126 100%);
  border: 1px solid rgba(255,255,255,0.06);
}
.auth-brand-mark {
  background: rgba(255,255,255,0.97);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.82), 0 24px 52px rgba(0,0,0,0.28);
}
.auth-panel {
  border-color: rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 88% 0%, rgba(33, 111, 255, 0.10), transparent 30%),
    linear-gradient(180deg, rgba(20,31,51,0.985), rgba(12,20,34,0.99));
  box-shadow: 0 30px 72px rgba(0,0,0,0.34);
}
.auth-panel h2 { color:#f7fbff; }
.auth-panel p, .auth-title p { color:#9fb0c9; }
.auth-panel label { color:#dce7f7; }
.auth-lock-badge {
  color:#62a6ff;
  background:linear-gradient(180deg, rgba(31,55,91,0.96), rgba(20,34,56,0.96));
  box-shadow:inset 0 0 0 1px rgba(99,167,255,0.18), 0 16px 34px rgba(0,0,0,0.24);
}
.auth-input-wrap { color:#65a8ff; }
.auth-input-wrap input {
  color:#f6f9ff;
  border-color:rgba(255,255,255,0.10);
  background:rgba(8,16,29,0.92);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.03), 0 10px 22px rgba(0,0,0,0.16);
}
.auth-input-wrap input::placeholder { color:#71829d; }
.auth-input-wrap input:focus {
  border-color:rgba(55,136,255,0.78);
  background:#0b1729;
  box-shadow:0 0 0 4px rgba(35,111,255,0.15), 0 14px 28px rgba(0,0,0,0.22);
}
.auth-password-toggle { color:#8192ad; }
.auth-password-toggle:hover { color:#6eafff; background:rgba(65,143,255,0.10); }
.auth-submit {
  border-radius:12px;
  background:linear-gradient(135deg,#258fff 0%,#1268e8 55%,#0b57ce 100%);
  box-shadow:0 18px 36px rgba(18,104,232,0.30);
}
.auth-version { color:#7386a4; }
.auth-version::before,.auth-version::after { background:rgba(255,255,255,0.08); }
.auth-version span { color:#8095b4; }
.auth-panel .alert {
  color:#ffd7d7;
  border-color:rgba(255,92,92,0.22);
  background:rgba(255,75,75,0.10);
}
