:root {
  --bg: #f6f6f7;
  --panel: #ffffff;
  --ink: #242424;
  --muted: #707070;
  --line: rgba(36, 36, 36, 0.1);
  --accent: #ee2f38;
  --accent-2: #8b8d8f;
  --accent-dark: #ba2028;
  --charcoal: #2d2d30;
  --glass: rgba(255, 255, 255, 0.72);
  --good: #137a46;
  --warn: #9a6212;
  --bad: #c91f2b;
  --soft: #fff0f1;
  --shadow: 0 24px 70px rgba(35, 35, 35, 0.12);
  --shadow-soft: 0 10px 28px rgba(35, 35, 35, 0.08);
  --ring: 0 0 0 4px rgba(238, 47, 56, 0.12);
}

.estimate-draft-notice {
  grid-column: 1 / -1;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(55, 151, 94, 0.28);
  border-radius: 8px;
  color: #185d37;
  background: linear-gradient(110deg, rgba(232, 249, 239, 0.96), rgba(247, 252, 249, 0.92));
  box-shadow: 0 8px 22px rgba(34, 113, 67, 0.08);
}

.estimate-draft-notice strong {
  font-size: 13px;
}

.estimate-draft-notice em {
  color: #527060;
  font-size: 12px;
  font-style: normal;
}

.estimate-draft-notice button {
  margin-left: auto;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(145, 50, 50, 0.25);
  border-radius: 7px;
  color: #812929;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

body.theme-night .estimate-draft-notice {
  color: #b9f2cf;
  background: linear-gradient(110deg, rgba(21, 72, 47, 0.72), rgba(20, 43, 51, 0.92));
  border-color: rgba(93, 211, 142, 0.34);
}

body.theme-night .estimate-draft-notice em {
  color: #a9c8b5;
}

body.theme-night .estimate-draft-notice button {
  color: #ffd2d2;
  background: rgba(74, 32, 39, 0.72);
  border-color: rgba(239, 128, 128, 0.34);
}

/* Night theme refinement layer.
   Kept after the print rules so normal printable documents remain untouched. */
body.theme-night {
  --bg: #101725;
  --panel: #172132;
  --ink: #f4f7fb;
  --muted: #aeb8c7;
  --line: rgba(214, 224, 238, 0.13);
  --accent: #ff4653;
  --accent-dark: #c72a35;
  --charcoal: #0b1020;
  --glass: rgba(23, 33, 50, 0.78);
  --soft: rgba(255, 70, 83, 0.14);
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 70, 83, 0.14), transparent 32%),
    radial-gradient(circle at 4% 16%, rgba(77, 137, 210, 0.14), transparent 30%),
    linear-gradient(135deg, #0b1220 0%, #101827 42%, #151b2b 100%);
}

body.theme-night .main,
body.theme-night .content {
  color: var(--ink);
}

body.theme-night .app-tabs,
body.theme-night .topbar {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(135deg, rgba(16, 24, 39, 0.92), rgba(22, 31, 49, 0.86));
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-night .sidebar {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 70, 83, 0.2), transparent 34%),
    linear-gradient(165deg, #070b14 0%, #101725 54%, #21101a 100%);
}

body.theme-night .panel,
body.theme-night .metric,
body.theme-night .report-card,
body.theme-night .task-panel,
body.theme-night .task-manager,
body.theme-night .client-contribution-panel,
body.theme-night .schedule-reminder-panel,
body.theme-night .ro-group-panel,
body.theme-night .modal-panel,
body.theme-night .billing-head-card,
body.theme-night .vendor-payable-card,
body.theme-night .mrv-vendor-group,
body.theme-night .access-denied-panel {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background:
    linear-gradient(145deg, rgba(25, 36, 55, 0.92), rgba(14, 22, 36, 0.9)),
    radial-gradient(circle at 92% 0%, rgba(255, 70, 83, 0.1), transparent 32%);
  box-shadow: 0 24px 70px rgba(3, 7, 18, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-night .panel-head,
body.theme-night .task-panel .panel-head,
body.theme-night .client-contribution-panel .panel-head,
body.theme-night .panel-head.subtle {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background:
    linear-gradient(135deg, rgba(32, 45, 66, 0.82), rgba(20, 29, 46, 0.76)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 34%);
}

body.theme-night .panel-head h3,
body.theme-night .task-panel .panel-head h3,
body.theme-night .brand h1,
body.theme-night .topbar h2,
body.theme-night .metric strong,
body.theme-night .report-card strong,
body.theme-night .client-contribution-panel .panel-head p strong {
  color: #f7fafc;
}

body.theme-night .crumb,
body.theme-night .brand p,
body.theme-night .app-tab-count,
body.theme-night .metric span,
body.theme-night .metric p,
body.theme-night .report-card p,
body.theme-night .field-hint,
body.theme-night .client-contribution-panel .panel-head p {
  color: #b6c2d3;
}

body.theme-night input,
body.theme-night select,
body.theme-night textarea,
body.theme-night .letter-body-editor,
body.theme-night .task-add-row input,
body.theme-night .task-add-row select,
body.theme-night .task-assign,
body.theme-night .filters input,
body.theme-night .filters select,
body.theme-night .form-grid input,
body.theme-night .form-grid select,
body.theme-night .form-grid textarea,
body.theme-night .top-actions input {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.14);
  background:
    linear-gradient(145deg, rgba(52, 63, 81, 0.78), rgba(35, 45, 62, 0.82)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.07), transparent 38%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(3, 7, 18, 0.22);
}

body.theme-night input::placeholder,
body.theme-night textarea::placeholder,
body.theme-night .task-add-row input::placeholder {
  color: #a5afbf;
}

body.theme-night .task-add-row {
  border-color: rgba(214, 224, 238, 0.1);
  background: rgba(11, 18, 32, 0.32);
}

body.theme-night .task-add-row label {
  color: #ff8c95;
}

body.theme-night .task-row,
body.theme-night .schedule-reminder-item,
body.theme-night .notice,
body.theme-night .empty,
body.theme-night .mrv-summary-strip,
body.theme-night .portal-line-progress,
body.theme-night .workspace-badge {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(135deg, rgba(31, 43, 64, 0.78), rgba(18, 28, 45, 0.72));
}

body.theme-night .schedule-reminder-item strong,
body.theme-night .task-row strong,
body.theme-night .empty h3 {
  color: #f8fafc;
}

body.theme-night .schedule-reminder-item span,
body.theme-night .task-row span {
  color: #b8c3d2;
}

body.theme-night .schedule-toggle {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(145deg, rgba(55, 66, 84, 0.86), rgba(31, 40, 57, 0.88));
}

body.theme-night .client-contribution-name strong {
  color: #e8eef7;
}

body.theme-night .client-contribution-name span {
  color: #ffd8dc;
  background: rgba(255, 70, 83, 0.18);
  border: 1px solid rgba(255, 70, 83, 0.24);
}

body.theme-night .client-contribution-value strong {
  color: #ff6f7a;
}

body.theme-night .client-contribution-value span {
  color: #aeb8c7;
}

body.theme-night .client-contribution-track {
  background: linear-gradient(90deg, rgba(214, 224, 238, 0.12), rgba(214, 224, 238, 0.06));
}

body.theme-night .metric-warning {
  border-color: rgba(245, 179, 63, 0.42);
  background:
    linear-gradient(145deg, rgba(55, 44, 20, 0.82), rgba(32, 27, 18, 0.72)),
    radial-gradient(circle at 90% 0%, rgba(245, 179, 63, 0.16), transparent 34%);
}

body.theme-night .metric-warning span,
body.theme-night .metric-warning em {
  color: #f3c96b;
}

body.theme-night .metric-warning strong {
  color: #fff4d0;
}

body.theme-night .metric em {
  color: #b8c3d2;
}

body.theme-night .metric em small {
  color: #f9dfe2;
  background: rgba(255, 70, 83, 0.18);
  border: 1px solid rgba(255, 70, 83, 0.22);
}

body.theme-night .metric-upcoming-mrv {
  border-color: rgba(120, 168, 220, 0.14);
  background:
    linear-gradient(145deg, rgba(31, 43, 64, 0.86), rgba(18, 28, 45, 0.78)),
    radial-gradient(circle at 88% 0%, rgba(238, 47, 56, 0.12), transparent 34%);
}

body.theme-night .smart-dropdown,
body.theme-night .global-search-dropdown {
  border-color: rgba(214, 224, 238, 0.14);
  background:
    linear-gradient(145deg, rgba(35, 46, 65, 0.96), rgba(17, 26, 41, 0.96));
}

body.theme-night .smart-dropdown button,
body.theme-night .global-search-dropdown button,
body.theme-night .smart-option {
  color: #edf2f7;
}

body.theme-night table,
body.theme-night .table-wrap,
body.theme-night .mrv-table,
body.theme-night .bulk-table,
body.theme-night .portal-bill-table {
  color: #edf2f7;
  background: rgba(17, 26, 41, 0.78);
}

body.theme-night th,
body.theme-night .mrv-table th {
  color: #ffd6da;
  background: rgba(255, 70, 83, 0.14);
}

body.theme-night td,
body.theme-night .mrv-table td {
  color: #edf2f7;
  border-color: rgba(214, 224, 238, 0.08);
}

body.theme-night .doc-box.ro-doc,
body.theme-night .estimate-doc,
body.theme-night .invoice-doc,
body.theme-night .official-letter,
body.theme-night .official-letter-page,
body.theme-night .print-body {
  color: #242424;
  background: #fff;
}

/* Night contrast hardening. Any light surface gets dark text; any dark surface gets light text. */
body.theme-night .doc-box.ro-doc,
body.theme-night .doc-box.ro-doc *,
body.theme-night .estimate-doc,
body.theme-night .estimate-doc *,
body.theme-night .invoice-doc,
body.theme-night .invoice-doc *,
body.theme-night .official-letter,
body.theme-night .official-letter *,
body.theme-night .official-letter-page,
body.theme-night .official-letter-page *,
body.theme-night .print-body,
body.theme-night .print-body * {
  color: #24272d;
}

body.theme-night .doc-box.ro-doc,
body.theme-night .estimate-doc,
body.theme-night .invoice-doc,
body.theme-night .official-letter,
body.theme-night .official-letter-page,
body.theme-night .print-body,
body.theme-night .doc-box.ro-doc table,
body.theme-night .estimate-doc table,
body.theme-night .invoice-doc table {
  background: #fff;
}

body.theme-night .doc-box.ro-doc th,
body.theme-night .estimate-doc th,
body.theme-night .invoice-doc th,
body.theme-night .official-letter th,
body.theme-night .print-body th {
  color: #7d121b;
  background: #fff0f2;
}

body.theme-night .doc-box.ro-doc td,
body.theme-night .estimate-doc td,
body.theme-night .invoice-doc td,
body.theme-night .official-letter td,
body.theme-night .print-body td {
  color: #24272d;
  background: #fff;
}

body.theme-night .doc-box.ro-doc .ro-heading-block h3,
body.theme-night .estimate-doc .ro-heading-block h3,
body.theme-night .invoice-doc .ro-heading-block h3 {
  color: #9d1721;
}

body.theme-night .doc-box.ro-doc .ro-title-text p,
body.theme-night .estimate-doc .ro-title-text p,
body.theme-night .invoice-doc .ro-title-text p {
  color: #6f7785;
}

body.theme-night .doc-box.ro-doc .ro-particulars th,
body.theme-night .doc-box.ro-doc .ro-particulars td,
body.theme-night .estimate-doc .ro-particulars th,
body.theme-night .estimate-doc .ro-particulars td {
  border-color: rgba(125, 18, 27, 0.12);
}

body.theme-night .doc-box.ro-doc .doc-meta div,
body.theme-night .doc-box.ro-doc .address-block {
  color: #24272d;
  background: #f7f7f8;
}

body.theme-night .ro-calc-box,
body.theme-night .ro-calc-box div {
  color: #24272d;
  border-color: rgba(125, 18, 27, 0.16);
  background: linear-gradient(135deg, rgba(255, 240, 242, 0.96), rgba(248, 248, 250, 0.9));
}

body.theme-night .ro-calc-box span {
  color: #7d121b;
}

body.theme-night .ro-calc-box strong {
  color: #24272d;
}

body.theme-night .modal-panel {
  color: #f8fafc;
  background: linear-gradient(145deg, rgba(23, 33, 50, 0.96), rgba(13, 22, 36, 0.96));
}

body.theme-night .modal-head {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.14);
  background: linear-gradient(135deg, rgba(32, 45, 66, 0.92), rgba(20, 29, 46, 0.9));
}

body.theme-night .modal-head h3,
body.theme-night .modal-head p,
body.theme-night .modal-panel label {
  color: #f8fafc;
}

body.theme-night .modal-panel .icon-btn {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.11);
}

body.theme-night .mini-btn,
body.theme-night .ro-action-btn,
body.theme-night .mini-btn.ro-action-btn {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.26);
  background: linear-gradient(135deg, rgba(52, 63, 81, 0.92), rgba(28, 38, 56, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 22px rgba(2, 6, 23, 0.22);
}

body.theme-night .mini-btn:hover,
body.theme-night .ro-action-btn:hover,
body.theme-night .mini-btn.ro-action-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff4653, #b91c2a);
}

body.theme-night .mini-btn.danger-link,
body.theme-night .ro-action-btn.danger-link {
  color: #ffdbe0;
  border-color: rgba(255, 90, 102, 0.28);
}

body.theme-night .mini-btn:disabled,
body.theme-night .ro-action-btn:disabled,
body.theme-night button:disabled {
  color: #8c97aa;
  opacity: 0.55;
}

body.theme-night .mrv-vendor-group summary strong,
body.theme-night .billing-head-card summary strong,
body.theme-night .vendor-payable-card summary strong {
  color: #7d121b;
  background: rgba(255, 232, 235, 0.94);
}

body.theme-night .mrv-vendor-group summary span,
body.theme-night .billing-head-card summary span,
body.theme-night .vendor-payable-card summary span,
body.theme-night .mrv-vendor-group summary em,
body.theme-night .billing-head-card summary em,
body.theme-night .vendor-payable-card summary em {
  color: #dce6f5;
}

body.theme-night .billing-head-publications,
body.theme-night .billing-head-card .muted-note {
  color: #cbd6e8;
}

body.theme-night .billing-head-selected,
body.theme-night .billing-head-chip-list {
  border-color: rgba(214, 224, 238, 0.13);
  background: linear-gradient(135deg, rgba(23, 34, 54, 0.9), rgba(42, 22, 34, 0.74));
}

body.theme-night .billing-head-chip {
  border-color: rgba(255, 137, 146, 0.28);
  color: #ffdfe2;
  background: rgba(238, 47, 56, 0.18);
}

body.theme-night .billing-head-chip button {
  color: #ffdfe2;
  background: rgba(255, 255, 255, 0.12);
}

body.theme-night .billing-head-field,
body.theme-night .billing-bank-field {
  color: #dce6f5;
}

body.theme-night .billing-head-field small {
  color: #aebbd0;
}

body.theme-night .billing-head-field input,
body.theme-night .billing-head-add-row input,
body.theme-night .billing-bank-field input,
body.theme-night .billing-bank-field textarea {
  border-color: rgba(214, 224, 238, 0.16);
  color: #f7fbff;
  background: linear-gradient(145deg, rgba(35, 48, 71, 0.94), rgba(24, 34, 53, 0.92));
}

body.theme-night .billing-head-bank-tile,
body.theme-night .billing-head-bank-summary {
  border-color: rgba(214, 224, 238, 0.14);
  background: linear-gradient(145deg, rgba(31, 43, 65, 0.95), rgba(42, 22, 34, 0.74));
}

body.theme-night .billing-head-bank-tile strong,
body.theme-night .billing-head-bank-summary strong {
  color: #f3f8ff;
}

body.theme-night .billing-head-edition-pill {
  color: #dbeafe;
  background: rgba(79, 70, 229, 0.34);
}

body.theme-night .billing-head-edition-summary {
  border-color: rgba(129, 140, 248, 0.2);
  background: linear-gradient(145deg, rgba(33, 45, 77, 0.92), rgba(24, 34, 53, 0.88));
}

body.theme-night .billing-head-edition-summary strong {
  color: #f3f8ff;
}

body.theme-night .billing-bank-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, rgba(27, 39, 62, 0.98), rgba(20, 29, 48, 0.96));
}

body.theme-night .billing-bank-head h3 {
  color: #f8fbff;
}

body.theme-night .mrv-summary-strip strong,
body.theme-night .mrv-completion-meter .portal-line-progress strong,
body.theme-night .mrv-completion-meter .portal-line-progress span,
body.theme-night .mrv-completion-meter .portal-line-progress em {
  color: #24272d;
}

body.theme-night .mrv-completion-meter .portal-line-progress,
body.theme-night .portal-line-progress {
  color: #24272d;
  background: rgba(255, 255, 255, 0.86);
}

body.theme-night .mrv-table {
  color: #edf2f7;
  background: rgba(17, 26, 41, 0.86);
}

body.theme-night .mrv-table th {
  color: #ffd6da;
  background: rgba(255, 70, 83, 0.16);
}

body.theme-night .mrv-table td {
  color: #edf2f7;
}

body.theme-night .previous-system-detail {
  border-color: rgba(255, 80, 94, 0.36) !important;
  background: linear-gradient(135deg, rgba(72, 22, 35, 0.86), rgba(24, 34, 52, 0.9)) !important;
}

body.theme-night .previous-system-detail span {
  color: #ffcad0;
}

body.theme-night .previous-system-detail strong {
  color: #f8fafc;
}

body.theme-night .previous-system-mrv-row {
  background: rgba(72, 22, 35, 0.38);
}

body.theme-night .previous-system-inline {
  color: #ffdbe0;
  border-color: rgba(255, 90, 102, 0.34);
  background: rgba(255, 70, 83, 0.16);
}

body.theme-night .client-portal-card {
  color: #24272d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(241, 244, 248, 0.86)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.09), transparent 42%);
}

body.theme-night .client-portal-card h3,
body.theme-night .client-portal-card p,
body.theme-night .client-portal-stats strong {
  color: #24272d;
}

body.theme-night .client-portal-card span,
body.theme-night .client-portal-stats small {
  color: #7d121b;
}

body.theme-night .client-portal-access {
  color: #fff;
}

body.theme-night .portal-bill-card,
body.theme-night .portal-bill-card.progress-empty,
body.theme-night .portal-bill-card.progress-partial,
body.theme-night .portal-bill-card.progress-complete,
body.theme-night .portal-bill-ro,
body.theme-night .portal-field,
body.theme-night .portal-milestone,
body.theme-night .portal-system-cell,
body.theme-night .portal-rate-box label,
body.theme-night .portal-date-line,
body.theme-night .portal-size-badge {
  color: #24272d;
}

body.theme-night .portal-bill-ro strong,
body.theme-night .portal-bill-ro p,
body.theme-night .portal-bill-ro small,
body.theme-night .portal-switch-row,
body.theme-night .portal-switch-row span,
body.theme-night .portal-field.locked strong,
body.theme-night .portal-system-cell strong,
body.theme-night .portal-system-cell span,
body.theme-night .portal-system-cell small,
body.theme-night .portal-row-ring span {
  color: inherit;
}

body.theme-night .portal-bill-fields input,
body.theme-night .portal-bill-fields select,
body.theme-night .portal-bill-fields textarea,
body.theme-night .portal-rate-box input {
  color: #24272d;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 243, 248, 0.9));
}

/* Last-layer RO document overrides. Keep these at EOF so print/PDF rules cannot override them. */
.doc-box.ro-doc .ro-title.has-branch-address .ro-title-text,
.bulk-pdf-render-root .doc-box.ro-doc .ro-title.has-branch-address .ro-title-text,
.print-body .doc-box.ro-doc .ro-title.has-branch-address .ro-title-text {
  justify-self: start !important;
  width: 465px !important;
  max-width: 465px !important;
  padding-left: 0 !important;
}

.doc-box.ro-doc .ro-office-address-grid,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-grid,
.print-body .doc-box.ro-doc .ro-office-address-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.doc-box.ro-doc .ro-office-address-block,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block,
.print-body .doc-box.ro-doc .ro-office-address-block {
  padding: 5px 7px !important;
}

.doc-box.ro-doc .ro-office-address-block p,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block p,
.print-body .doc-box.ro-doc .ro-office-address-block p {
  font-size: 9.4px !important;
  line-height: 1.18 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.doc-box.ro-doc .sign-box .signature-img,
.bulk-pdf-render-root .doc-box.ro-doc .sign-box .signature-img,
.print-body .doc-box.ro-doc .sign-box .signature-img {
  width: 178px !important;
  height: 58px !important;
  max-width: 178px !important;
  max-height: 58px !important;
  margin: -2px 0 -6px !important;
  object-fit: contain !important;
}

/* Final Indigo UI layer. Keep last so legacy day/night rules cannot override it. */
body.theme-indigo {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #11182c;
  --muted: #71809a;
  --line: rgba(64, 78, 112, 0.14);
  --accent: #5538ee;
  --accent-2: #2f80ed;
  --accent-dark: #34239d;
  --charcoal: #201954;
  --soft: #efedff;
  color: #11182c;
  background: linear-gradient(135deg, #f8faff 0%, #f2f5fa 54%, #edf2f8 100%);
}

body.theme-indigo .sidebar {
  color: #25304a;
  border-right-color: #e1e6ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 62%, #f0f3fa 100%);
  box-shadow: 16px 0 44px rgba(37, 48, 84, 0.1);
}

body.theme-indigo .brand h1,
body.theme-indigo .topbar h2 { color: #151a2c; }
body.theme-indigo .brand p,
body.theme-indigo .storage-card span,
body.theme-indigo .clock-card span { color: #77849b; }

body.theme-indigo .nav button {
  color: #63718b;
  border-color: transparent;
  background: transparent;
}

body.theme-indigo .nav button:hover,
body.theme-indigo .nav button.active {
  color: #fff;
  border-color: rgba(85, 56, 238, 0.2);
  background: linear-gradient(135deg, #6542f4 0%, #4a2fe0 100%);
  box-shadow: 0 12px 25px rgba(85, 56, 238, 0.23);
}

body.theme-indigo .nav button:hover .nav-icon,
body.theme-indigo .nav button.active .nav-icon {
  color: #5538ee;
  background: #fff;
}

body.theme-indigo .topbar,
body.theme-indigo .app-tabs,
body.theme-indigo .clock-card,
body.theme-indigo .storage-card {
  color: #1c2540;
  border-color: #dfe5ef;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(35, 49, 87, 0.08);
}

body.theme-indigo .panel,
body.theme-indigo .metric,
body.theme-indigo .report-card,
body.theme-indigo .task-panel,
body.theme-indigo .task-manager,
body.theme-indigo .client-contribution-panel,
body.theme-indigo .schedule-reminder-panel,
body.theme-indigo .ro-group-panel,
body.theme-indigo .modal-panel,
body.theme-indigo .billing-head-card,
body.theme-indigo .vendor-payable-card,
body.theme-indigo .mrv-vendor-group,
body.theme-indigo .access-denied-panel,
body.theme-indigo .dashboard-comparison-panel {
  color: #151b2f;
  border-color: #dde4ee;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.94));
  box-shadow: 0 20px 52px rgba(35, 49, 87, 0.09), inset 0 1px 0 #fff;
}

body.theme-indigo .panel-head,
body.theme-indigo .task-panel .panel-head,
body.theme-indigo .client-contribution-panel .panel-head,
body.theme-indigo .panel-head.subtle,
body.theme-indigo .dashboard-comparison-head {
  color: #171d31;
  border-color: #e0e6ef;
  background: linear-gradient(135deg, #ffffff, #f6f8fc);
}

body.theme-indigo input,
body.theme-indigo select,
body.theme-indigo textarea,
body.theme-indigo .letter-body-editor,
body.theme-indigo .task-assign {
  color: #20283c;
  border-color: #d9e1ec;
  background: linear-gradient(145deg, #ffffff, #f3f7fc);
}

body.theme-indigo input:focus,
body.theme-indigo select:focus,
body.theme-indigo textarea:focus,
body.theme-indigo .letter-body-editor:focus {
  border-color: #7662ee;
  box-shadow: 0 0 0 4px rgba(85, 56, 238, 0.13);
}

body.theme-indigo .primary {
  color: #fff;
  border-color: #5538ee;
  background: linear-gradient(135deg, #6542f4, #4430bd);
  box-shadow: 0 12px 26px rgba(85, 56, 238, 0.21);
}

body.theme-indigo .smart-dropdown,
body.theme-indigo .global-search-dropdown {
  color: #273149;
  border-color: #dce3ed;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 24px 58px rgba(31, 43, 80, 0.18);
}

body.theme-indigo .smart-option:hover,
body.theme-indigo .smart-option.active,
body.theme-indigo .smart-dropdown button:hover,
body.theme-indigo .global-search-dropdown button:hover {
  color: #fff;
  background: linear-gradient(135deg, #6542f4, #4930cf);
}

body.theme-indigo table,
body.theme-indigo .table-wrap,
body.theme-indigo .bulk-table,
body.theme-indigo .mrv-table,
body.theme-indigo .portal-bill-table { color: #273149; background: #fff; }
body.theme-indigo th,
body.theme-indigo .mrv-table th { color: #40368d; background: #efedfc; }
body.theme-indigo tbody tr:hover { background: #f4f2ff; }

body.theme-indigo.theme-night {
  --bg: #0d1428;
  --panel: #18223b;
  --ink: #f3f6ff;
  --muted: #a9b5cc;
  --line: rgba(205, 215, 238, 0.13);
  --accent: #8977ff;
  --accent-2: #5ea1ff;
  --accent-dark: #5b46df;
  --charcoal: #0d1226;
  --soft: rgba(137, 119, 255, 0.15);
  color: #f3f6ff;
  background: linear-gradient(135deg, #0b1123 0%, #111a31 52%, #171d3b 100%);
}

body.theme-indigo.theme-night .sidebar {
  color: #edf2ff;
  border-color: rgba(205, 215, 238, 0.1);
  background: linear-gradient(180deg, #101530 0%, #171d42 54%, #0d132a 100%);
}

body.theme-indigo.theme-night .brand h1,
body.theme-indigo.theme-night .topbar h2 { color: #fff; }
body.theme-indigo.theme-night .nav button { color: #b8c4de; }

body.theme-indigo.theme-night .topbar,
body.theme-indigo.theme-night .app-tabs,
body.theme-indigo.theme-night .clock-card,
body.theme-indigo.theme-night .storage-card,
body.theme-indigo.theme-night .panel,
body.theme-indigo.theme-night .metric,
body.theme-indigo.theme-night .report-card,
body.theme-indigo.theme-night .task-panel,
body.theme-indigo.theme-night .task-manager,
body.theme-indigo.theme-night .client-contribution-panel,
body.theme-indigo.theme-night .schedule-reminder-panel,
body.theme-indigo.theme-night .ro-group-panel,
body.theme-indigo.theme-night .modal-panel,
body.theme-indigo.theme-night .billing-head-card,
body.theme-indigo.theme-night .vendor-payable-card,
body.theme-indigo.theme-night .mrv-vendor-group,
body.theme-indigo.theme-night .access-denied-panel,
body.theme-indigo.theme-night .dashboard-comparison-panel {
  color: #f3f6ff;
  border-color: rgba(205, 215, 238, 0.12);
  background: linear-gradient(145deg, rgba(29, 40, 69, 0.97), rgba(19, 28, 52, 0.95));
  box-shadow: 0 24px 64px rgba(2, 6, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-indigo.theme-night .panel-head,
body.theme-indigo.theme-night .task-panel .panel-head,
body.theme-indigo.theme-night .client-contribution-panel .panel-head,
body.theme-indigo.theme-night .panel-head.subtle,
body.theme-indigo.theme-night .dashboard-comparison-head {
  color: #f3f6ff;
  border-color: rgba(205, 215, 238, 0.11);
  background: linear-gradient(135deg, rgba(42, 53, 86, 0.92), rgba(27, 37, 66, 0.88));
}

body.theme-indigo.theme-night input,
body.theme-indigo.theme-night select,
body.theme-indigo.theme-night textarea,
body.theme-indigo.theme-night .letter-body-editor,
body.theme-indigo.theme-night .task-assign {
  color: #f3f6ff;
  border-color: rgba(205, 215, 238, 0.15);
  background: linear-gradient(145deg, #26324f, #1a2540);
}

body.theme-indigo.theme-night table,
body.theme-indigo.theme-night .table-wrap,
body.theme-indigo.theme-night .bulk-table,
body.theme-indigo.theme-night .mrv-table,
body.theme-indigo.theme-night .portal-bill-table { color: #eaf0ff; background: #151f36; }
body.theme-indigo.theme-night th,
body.theme-indigo.theme-night .mrv-table th { color: #ddd8ff; background: rgba(117, 92, 255, 0.17); }
body.theme-indigo.theme-night td { color: #e7edfa; }

/* Theme choice never recolors generated or printable documents. */
body.theme-indigo .doc-box.ro-doc,
body.theme-indigo .estimate-doc,
body.theme-indigo .invoice-doc,
body.theme-indigo .official-letter,
body.theme-indigo .official-letter-page,
body.theme-indigo .print-body {
  --bg: #f6f6f7;
  --panel: #ffffff;
  --ink: #242424;
  --muted: #707070;
  --line: rgba(36, 36, 36, 0.1);
  --accent: #ee2f38;
  --accent-2: #8b8d8f;
  --accent-dark: #ba2028;
  --charcoal: #2d2d30;
  --soft: #fff0f1;
}

/* Theme library and Indigo application skin. Printable documents are isolated below. */
.theme-library-panel {
  overflow: hidden;
  border: 1px solid rgba(74, 64, 148, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 70px rgba(34, 45, 78, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(135%);
}

.theme-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border-bottom: 1px solid rgba(74, 64, 148, 0.1);
}

.theme-library-head span {
  color: #7c8498;
  font-size: 12px;
  font-weight: 720;
}

.theme-library-head h3 {
  margin: 4px 0 0;
  color: #171a2a;
  font-size: 27px;
  font-weight: 760;
}

.theme-library-head > strong {
  padding: 8px 13px;
  border: 1px solid rgba(85, 56, 238, 0.18);
  border-radius: 999px;
  color: #4935c7;
  background: #f0edff;
  font-size: 12px;
}

.theme-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 26px;
}

.theme-option-card {
  overflow: hidden;
  border: 1px solid rgba(32, 41, 72, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(32, 41, 72, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.theme-option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(85, 56, 238, 0.3);
  box-shadow: 0 22px 52px rgba(48, 50, 112, 0.14);
}

.theme-option-card.active {
  border-color: #6553e8;
  box-shadow: 0 0 0 3px rgba(101, 83, 232, 0.1), 0 22px 52px rgba(48, 50, 112, 0.14);
}

.theme-preview {
  display: grid;
  grid-template-columns: 22% 1fr;
  min-height: 275px;
  padding: 15px;
}

.theme-preview-sidebar {
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 17px 11px;
  border-radius: 12px 0 0 12px;
}

.theme-preview-sidebar i {
  display: block;
  height: 17px;
  border-radius: 5px;
}

.theme-preview-main {
  display: grid;
  grid-template-rows: 28px 74px 1fr;
  gap: 13px;
  padding: 17px;
  border-radius: 0 12px 12px 0;
}

.theme-preview-top,
.theme-preview-metrics i,
.theme-preview-chart {
  border-radius: 8px;
}

.theme-preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.theme-preview-chart {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 13px;
}

.theme-preview-chart span {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
}

.theme-preview-chart span:nth-child(1) { height: 38%; }
.theme-preview-chart span:nth-child(2) { height: 74%; }
.theme-preview-chart span:nth-child(3) { height: 52%; }
.theme-preview-chart span:nth-child(4) { height: 88%; }

.theme-preview-default {
  background: #f2f2f4;
}

.theme-preview-default .theme-preview-sidebar { background: #343438; }
.theme-preview-default .theme-preview-sidebar i { background: rgba(255, 255, 255, 0.12); }
.theme-preview-default .theme-preview-sidebar i:nth-child(2) { background: #e93640; }
.theme-preview-default .theme-preview-main { background: #f8f8f9; }
.theme-preview-default .theme-preview-top,
.theme-preview-default .theme-preview-metrics i,
.theme-preview-default .theme-preview-chart { background: #fff; border: 1px solid #e4e4e7; }
.theme-preview-default .theme-preview-chart span { background: #ed3944; }

.theme-preview-indigo {
  background: #eef2f8;
}

.theme-preview-indigo .theme-preview-sidebar { background: #fff; border: 1px solid #e0e6f0; }
.theme-preview-indigo .theme-preview-sidebar i { background: #e9edf5; }
.theme-preview-indigo .theme-preview-sidebar i:nth-child(2) { background: #5938ef; }
.theme-preview-indigo .theme-preview-main { background: #f6f8fc; }
.theme-preview-indigo .theme-preview-top,
.theme-preview-indigo .theme-preview-metrics i,
.theme-preview-indigo .theme-preview-chart { background: #fff; border: 1px solid #dfe5ef; }
.theme-preview-indigo .theme-preview-metrics i:first-child { background: #27205f; }
.theme-preview-indigo .theme-preview-chart span:nth-child(odd) { background: #5538ee; }
.theme-preview-indigo .theme-preview-chart span:nth-child(even) { background: #20a77b; }

.theme-option-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-top: 1px solid rgba(32, 41, 72, 0.1);
}

.theme-option-footer h3 {
  margin: 0 0 9px;
  color: #202438;
  font-size: 19px;
}

.theme-swatches {
  display: flex;
  gap: 6px;
}

.theme-swatches i {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(32, 41, 72, 0.14);
}

body.theme-indigo {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #11182c;
  --muted: #71809a;
  --line: rgba(64, 78, 112, 0.13);
  --accent: #5538ee;
  --accent-2: #2f80ed;
  --accent-dark: #34239d;
  --charcoal: #201954;
  --glass: rgba(255, 255, 255, 0.78);
  --good: #0b946b;
  --warn: #bd7100;
  --bad: #de3151;
  --soft: #efedff;
  --shadow: 0 22px 58px rgba(35, 49, 87, 0.1);
  --shadow-soft: 0 10px 28px rgba(35, 49, 87, 0.08);
  --ring: 0 0 0 4px rgba(85, 56, 238, 0.13);
  color: var(--ink);
  background: linear-gradient(135deg, #f7f9fc 0%, #f2f5fa 50%, #eef2f8 100%);
}

body.theme-indigo .sidebar {
  color: #25304a;
  border-right: 1px solid #e2e7f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 60%, #f1f4fa 100%);
  box-shadow: 16px 0 44px rgba(37, 48, 84, 0.09);
}

body.theme-indigo .brand {
  border-color: #e5e9f1;
}

body.theme-indigo .brand h1 { color: #151a2c; }
body.theme-indigo .brand p,
body.theme-indigo .storage-card span,
body.theme-indigo .clock-card span { color: #7b879d; }

body.theme-indigo .sidebar-toggle {
  border-color: rgba(85, 56, 238, 0.14);
  background: linear-gradient(135deg, #f7f5ff, #edf1fb);
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(49, 45, 114, 0.08);
}

body.theme-indigo .sidebar-toggle span { background: #6250dc; }

body.theme-indigo .sidebar-toggle:hover {
  background: linear-gradient(135deg, #6543f3, #4430bd);
}

body.theme-indigo .sidebar-toggle:hover span { background: #fff; }

body.theme-indigo .nav button {
  color: #66748e;
  border-color: transparent;
  background: transparent;
}

body.theme-indigo .nav button:hover,
body.theme-indigo .nav button.active {
  color: #fff;
  border-color: rgba(85, 56, 238, 0.18);
  background: linear-gradient(135deg, #6542f4 0%, #4a2fe0 100%);
  box-shadow: 0 12px 25px rgba(85, 56, 238, 0.22);
}

body.theme-indigo .nav button:hover .nav-icon,
body.theme-indigo .nav button.active .nav-icon {
  color: #5538ee;
  background: #fff;
}

body.theme-indigo .clock-card,
body.theme-indigo .storage-card {
  color: #25304a;
  border-color: #e0e6f0;
  background: rgba(255, 255, 255, 0.78);
}

body.theme-indigo .app-tabs,
body.theme-indigo .topbar {
  color: #161c30;
  border-color: #e2e7f0;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 32px rgba(35, 49, 87, 0.07);
}

body.theme-indigo .app-tab,
body.theme-indigo .app-tab-add {
  color: #58657d;
  border-color: #e0e5ee;
  background: linear-gradient(135deg, #fff, #f2f5fa);
}

body.theme-indigo .app-tab.active {
  color: #fff;
  border-color: #5538ee;
  background: linear-gradient(135deg, #6244f1, #4430bd);
  box-shadow: 0 12px 26px rgba(85, 56, 238, 0.2);
}

body.theme-indigo .app-tab-add { color: #5538ee; }

body.theme-indigo .panel,
body.theme-indigo .metric,
body.theme-indigo .report-card,
body.theme-indigo .task-panel,
body.theme-indigo .task-manager,
body.theme-indigo .client-contribution-panel,
body.theme-indigo .schedule-reminder-panel,
body.theme-indigo .ro-group-panel,
body.theme-indigo .modal-panel,
body.theme-indigo .billing-head-card,
body.theme-indigo .vendor-payable-card,
body.theme-indigo .mrv-vendor-group,
body.theme-indigo .access-denied-panel,
body.theme-indigo .dashboard-comparison-panel {
  color: #151b2f;
  border-color: #dfe5ee;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.92));
  box-shadow: 0 20px 52px rgba(35, 49, 87, 0.09), inset 0 1px 0 #fff;
}

body.theme-indigo .metric::before {
  background: linear-gradient(90deg, #5538ee, #2f80ed, rgba(47, 128, 237, 0));
}

body.theme-indigo .metric:nth-child(2)::before { background: linear-gradient(90deg, #0ba777, rgba(11, 167, 119, 0)); }
body.theme-indigo .metric:nth-child(3)::before { background: linear-gradient(90deg, #2f80ed, rgba(47, 128, 237, 0)); }

body.theme-indigo .metric-warning {
  border-color: rgba(215, 142, 19, 0.34);
  background: linear-gradient(145deg, #fffaf0, #fff4d8);
}

body.theme-indigo .metric-warning::before { background: linear-gradient(90deg, #efa420, rgba(239, 164, 32, 0)); }

body.theme-indigo .panel-head,
body.theme-indigo .task-panel .panel-head,
body.theme-indigo .client-contribution-panel .panel-head,
body.theme-indigo .panel-head.subtle,
body.theme-indigo .dashboard-comparison-head {
  color: #171d31;
  border-color: #e2e7f0;
  background: linear-gradient(135deg, #ffffff, #f7f9fd);
}

body.theme-indigo .task-panel .panel-head h3,
body.theme-indigo .panel-head h3,
body.theme-indigo .dashboard-comparison-head h3 { color: #221b5c; }

body.theme-indigo input,
body.theme-indigo select,
body.theme-indigo textarea,
body.theme-indigo .letter-body-editor,
body.theme-indigo .task-assign {
  color: #20283c;
  border-color: #dce3ed;
  background: linear-gradient(145deg, #ffffff, #f5f8fc);
  box-shadow: inset 0 1px 0 #fff, 0 8px 20px rgba(39, 54, 90, 0.05);
}

body.theme-indigo input:focus,
body.theme-indigo select:focus,
body.theme-indigo textarea:focus,
body.theme-indigo .letter-body-editor:focus {
  border-color: #7662ee;
  box-shadow: var(--ring);
}

body.theme-indigo input::placeholder,
body.theme-indigo textarea::placeholder { color: #9aa5b8; }

body.theme-indigo .primary {
  color: #fff;
  border-color: #5538ee;
  background: linear-gradient(135deg, #6542f4, #4430bd);
  box-shadow: 0 12px 26px rgba(85, 56, 238, 0.2);
}

body.theme-indigo .secondary,
body.theme-indigo #printBtn {
  color: #39445c;
  border-color: #d9e0ea;
  background: linear-gradient(135deg, #ffffff, #e9eef5);
}

body.theme-indigo .smart-dropdown,
body.theme-indigo .global-search-dropdown {
  border-color: #dce3ed;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 58px rgba(31, 43, 80, 0.18);
}

body.theme-indigo .smart-option,
body.theme-indigo .smart-dropdown button,
body.theme-indigo .global-search-dropdown button { color: #303a52; }

body.theme-indigo .smart-option:hover,
body.theme-indigo .smart-option.active,
body.theme-indigo .smart-dropdown button:hover,
body.theme-indigo .global-search-dropdown button:hover {
  color: #fff;
  background: linear-gradient(135deg, #6542f4, #4930cf);
}

body.theme-indigo table,
body.theme-indigo .table-wrap,
body.theme-indigo .bulk-table,
body.theme-indigo .mrv-table,
body.theme-indigo .portal-bill-table {
  color: #273149;
  background: #fff;
}

body.theme-indigo th,
body.theme-indigo .mrv-table th {
  color: #3f348b;
  background: #f0effc;
}

body.theme-indigo tbody tr:hover { background: #f4f2ff; }

body.theme-indigo .dashboard-chart-modes {
  border-color: rgba(85, 56, 238, 0.18);
  background: #f2f0ff;
}

body.theme-indigo .dashboard-chart-modes button { color: #5746b3; }
body.theme-indigo .dashboard-chart-modes button.active { color: #fff; background: linear-gradient(135deg, #6542f4, #4430bd); }
body.theme-indigo .dashboard-comparison-svg .line.invoice { stroke: #5538ee; }
body.theme-indigo .dashboard-comparison-svg .line.payable { stroke: #11a779; }
body.theme-indigo .dashboard-chart-legend i.invoice { background: #5538ee; }
body.theme-indigo .dashboard-chart-legend i.payable { background: #11a779; }
body.theme-indigo .client-contribution-bar { background: linear-gradient(90deg, #5538ee, #2f80ed); }

body.theme-indigo.theme-night {
  --bg: #10162a;
  --panel: #18223b;
  --ink: #f3f6ff;
  --muted: #a9b5cc;
  --line: rgba(205, 215, 238, 0.13);
  --accent: #8977ff;
  --accent-2: #5ea1ff;
  --accent-dark: #5b46df;
  --charcoal: #0d1226;
  --glass: rgba(24, 34, 59, 0.82);
  --soft: rgba(137, 119, 255, 0.15);
  color: var(--ink);
  background: linear-gradient(135deg, #0c1224 0%, #111a31 50%, #161c38 100%);
}

body.theme-indigo.theme-night .sidebar {
  color: #eaf0ff;
  border-color: rgba(205, 215, 238, 0.1);
  background: linear-gradient(180deg, #111633 0%, #171d42 54%, #0e142b 100%);
  box-shadow: 18px 0 48px rgba(3, 7, 22, 0.36);
}

body.theme-indigo.theme-night .brand { border-color: rgba(205, 215, 238, 0.1); }
body.theme-indigo.theme-night .brand h1 { color: #fff; }
body.theme-indigo.theme-night .brand p,
body.theme-indigo.theme-night .storage-card span,
body.theme-indigo.theme-night .clock-card span { color: #aeb9d0; }

body.theme-indigo.theme-night .nav button { color: #b7c2dc; }
body.theme-indigo.theme-night .nav button:hover,
body.theme-indigo.theme-night .nav button.active { color: #fff; background: linear-gradient(135deg, #735cff, #4f37d0); }

body.theme-indigo.theme-night .app-tabs,
body.theme-indigo.theme-night .topbar,
body.theme-indigo.theme-night .panel,
body.theme-indigo.theme-night .metric,
body.theme-indigo.theme-night .report-card,
body.theme-indigo.theme-night .task-panel,
body.theme-indigo.theme-night .task-manager,
body.theme-indigo.theme-night .client-contribution-panel,
body.theme-indigo.theme-night .schedule-reminder-panel,
body.theme-indigo.theme-night .ro-group-panel,
body.theme-indigo.theme-night .modal-panel,
body.theme-indigo.theme-night .billing-head-card,
body.theme-indigo.theme-night .vendor-payable-card,
body.theme-indigo.theme-night .mrv-vendor-group,
body.theme-indigo.theme-night .dashboard-comparison-panel {
  color: #f3f6ff;
  border-color: rgba(205, 215, 238, 0.12);
  background: linear-gradient(145deg, rgba(29, 40, 69, 0.96), rgba(20, 29, 53, 0.94));
  box-shadow: 0 24px 64px rgba(2, 6, 20, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-indigo.theme-night .panel-head,
body.theme-indigo.theme-night .task-panel .panel-head,
body.theme-indigo.theme-night .client-contribution-panel .panel-head,
body.theme-indigo.theme-night .dashboard-comparison-head {
  color: #f3f6ff;
  border-color: rgba(205, 215, 238, 0.11);
  background: linear-gradient(135deg, rgba(42, 53, 86, 0.9), rgba(28, 38, 67, 0.86));
}

body.theme-indigo.theme-night .panel-head h3,
body.theme-indigo.theme-night .task-panel .panel-head h3,
body.theme-indigo.theme-night .dashboard-comparison-head h3 { color: #f7f8ff; }

body.theme-indigo.theme-night input,
body.theme-indigo.theme-night select,
body.theme-indigo.theme-night textarea,
body.theme-indigo.theme-night .letter-body-editor,
body.theme-indigo.theme-night .task-assign {
  color: #f3f6ff;
  border-color: rgba(205, 215, 238, 0.14);
  background: linear-gradient(145deg, #26324f, #1b2641);
}

body.theme-indigo.theme-night input::placeholder,
body.theme-indigo.theme-night textarea::placeholder { color: #9eabc2; }

body.theme-indigo.theme-night table,
body.theme-indigo.theme-night .table-wrap,
body.theme-indigo.theme-night .bulk-table,
body.theme-indigo.theme-night .mrv-table,
body.theme-indigo.theme-night .portal-bill-table {
  color: #eaf0ff;
  background: #151f36;
}

body.theme-indigo.theme-night th,
body.theme-indigo.theme-night .mrv-table th {
  color: #d9d3ff;
  background: rgba(117, 92, 255, 0.16);
}

body.theme-indigo.theme-night td { color: #e7edfa; }
body.theme-indigo.theme-night tbody tr:hover { background: rgba(117, 92, 255, 0.08); }

body.theme-indigo.theme-night .smart-dropdown,
body.theme-indigo.theme-night .global-search-dropdown {
  border-color: rgba(205, 215, 238, 0.14);
  background: #1b2641;
}

body.theme-indigo.theme-night .smart-option,
body.theme-indigo.theme-night .smart-dropdown button,
body.theme-indigo.theme-night .global-search-dropdown button { color: #edf2ff; }

body.theme-indigo.theme-night .theme-library-panel,
body.theme-indigo.theme-night .theme-option-card {
  color: #f3f6ff;
  border-color: rgba(205, 215, 238, 0.13);
  background: #18223b;
}

body.theme-indigo.theme-night .theme-library-head,
body.theme-indigo.theme-night .theme-option-footer { border-color: rgba(205, 215, 238, 0.12); }
body.theme-indigo.theme-night .theme-library-head h3,
body.theme-indigo.theme-night .theme-option-footer h3 { color: #f7f8ff; }

/* Keep every generated or printable document on its established corporate palette. */
body.theme-indigo .doc-box.ro-doc,
body.theme-indigo .estimate-doc,
body.theme-indigo .invoice-doc,
body.theme-indigo .official-letter,
body.theme-indigo .official-letter-page,
body.theme-indigo .print-body {
  --bg: #f6f6f7;
  --panel: #ffffff;
  --ink: #242424;
  --muted: #707070;
  --line: rgba(36, 36, 36, 0.1);
  --accent: #ee2f38;
  --accent-2: #8b8d8f;
  --accent-dark: #ba2028;
  --charcoal: #2d2d30;
  --soft: #fff0f1;
}

@media (max-width: 860px) {
  .theme-option-grid { grid-template-columns: 1fr; }
}

/* Final address typography for branch-enabled Release Orders. */
.doc-box.ro-doc .ro-office-address-block > strong,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block > strong,
.print-body .doc-box.ro-doc .ro-office-address-block > strong {
  font-size: 12.33px !important;
}

.doc-box.ro-doc .ro-office-address-block p,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block p,
.print-body .doc-box.ro-doc .ro-office-address-block p {
  font-size: 10.73px !important;
  line-height: 1.18 !important;
}

/* Final RO print/PDF guards: keep stamp and branch header locked in one-page layout. */
.doc-box.ro-doc .ro-title.has-branch-address .ro-title-text,
.bulk-pdf-render-root .doc-box.ro-doc .ro-title.has-branch-address .ro-title-text,
.print-body .doc-box.ro-doc .ro-title.has-branch-address .ro-title-text {
  justify-self: start !important;
  width: 465px !important;
  max-width: 465px !important;
  padding-left: 0 !important;
}

.doc-box.ro-doc .ro-office-address-grid,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-grid,
.print-body .doc-box.ro-doc .ro-office-address-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.doc-box.ro-doc .ro-office-address-block,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block,
.print-body .doc-box.ro-doc .ro-office-address-block {
  padding: 5px 7px !important;
}

.doc-box.ro-doc .ro-office-address-block p,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block p,
.print-body .doc-box.ro-doc .ro-office-address-block p {
  font-size: 9.4px !important;
  line-height: 1.18 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.doc-box.ro-doc .sign-box .signature-img,
.bulk-pdf-render-root .doc-box.ro-doc .sign-box .signature-img,
.print-body .doc-box.ro-doc .sign-box .signature-img {
  width: 178px !important;
  height: 58px !important;
  max-width: 178px !important;
  max-height: 58px !important;
  margin: -2px 0 -6px !important;
  object-fit: contain !important;
}

body.theme-night .dashboard-comparison-panel {
  border-color: rgba(111, 135, 168, 0.22);
  background:
    linear-gradient(145deg, rgba(35, 50, 70, 0.96), rgba(26, 39, 58, 0.94)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.14), transparent 42%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-night .dashboard-comparison-head {
  border-bottom-color: rgba(156, 176, 205, 0.2);
}

body.theme-night .dashboard-comparison-head h3,
body.theme-night .dashboard-chart-legend {
  color: #f7fbff;
}

body.theme-night .dashboard-comparison-head p,
body.theme-night .dashboard-chart-legend strong {
  color: #d8e3f0;
}

body.theme-night .dashboard-chart-modes {
  border-color: rgba(145, 166, 198, 0.28);
  background: linear-gradient(145deg, rgba(52, 70, 95, 0.92), rgba(36, 52, 76, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 16px 34px rgba(0, 0, 0, 0.18);
}

body.theme-night .dashboard-chart-modes button {
  color: #d5e1ef;
}

body.theme-night .dashboard-chart-modes button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #3f7fff, #244eaa);
}

body.theme-night .dashboard-comparison-svg line {
  stroke: rgba(235, 241, 250, 0.42);
}

body.theme-night .dashboard-comparison-svg text,
body.theme-night .dashboard-comparison-svg .x-label {
  fill: #edf4ff;
}

body.theme-night .dashboard-side-metrics .metric {
  background:
    linear-gradient(145deg, rgba(22, 31, 47, 0.96), rgba(20, 27, 42, 0.94)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.1), transparent 38%);
  border-color: rgba(111, 135, 168, 0.2);
}

body.theme-night .dashboard-side-metrics .metric span,
body.theme-night .dashboard-side-metrics .metric em {
  color: #c8d5e5;
}

body.theme-night .dashboard-side-metrics .metric strong {
  color: #ffffff;
}

body.theme-night .task-delete {
  color: #ffd8dc;
  border-color: rgba(255, 126, 136, 0.28);
  background: linear-gradient(145deg, rgba(86, 37, 48, 0.94), rgba(60, 34, 45, 0.88));
}

body.theme-night .task-delete:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff4b56, #a71924);
}

@media (max-width: 1200px) {
  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-side-metrics {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-side-metrics,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .dashboard-comparison-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .task-clock,
  .task-assign,
  .task-delete {
    grid-column: 2;
    width: 100%;
  }
}

.rate-card-panel,
.rate-card-list-panel {
  overflow: visible;
}

.rate-card-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.rate-card-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) minmax(220px, 1.1fr) minmax(180px, 0.7fr) 170px;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 250, 0.82)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.08), transparent 46%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 18px 42px rgba(30, 38, 58, 0.08);
}

.rate-card-upload {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 250, 0.82)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.08), transparent 46%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 18px 42px rgba(30, 38, 58, 0.08);
}

.rate-card-upload {
  margin: 0;
}

.rate-card-upload-head,
.rate-card-upload .wide,
.rate-card-actions,
.rate-card-progress,
.rate-card-load-more {
  grid-column: 1 / -1;
}

.rate-card-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rate-card-upload-head h4 {
  margin: 0;
  color: #8a1720;
  font-size: 1.02rem;
}

.rate-card-upload-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(104, 111, 126, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(246, 247, 249, 0.96), rgba(255, 255, 255, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.rate-card-upload-mode button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #555b66;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.rate-card-upload-mode button > span:last-child {
  display: grid;
  gap: 2px;
}

.rate-card-upload-mode button strong,
.rate-card-upload-mode button small {
  color: inherit;
}

.rate-card-upload-mode button small {
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0.78;
}

.rate-card-upload-mode button.active[data-rate-card-upload-mode="single"] {
  color: #8a1720;
  border-color: rgba(216, 45, 58, 0.2);
  background: linear-gradient(135deg, #fff7f8, #ffe8eb);
  box-shadow: 0 8px 20px rgba(182, 38, 50, 0.1), inset 0 1px 0 #fff;
}

.rate-card-upload-mode button.active[data-rate-card-upload-mode="bulk"] {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.rate-card-upload-mode button[data-rate-card-upload-mode="bulk"] {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 9px 22px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.rate-card-upload-mode button.active[data-rate-card-upload-mode="bulk"] {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 13px 30px rgba(79, 70, 229, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.rate-card-mode-panel {
  display: grid;
  gap: 12px;
}

.rate-card-mode-panel[hidden] {
  display: none !important;
}

.rate-card-bulk-panel {
  padding: 2px;
}

.rate-card-bulk-dropzone {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 190px;
  padding: 28px;
  border: 2px dashed rgba(99, 102, 241, 0.42);
  border-radius: 20px;
  color: #4338ca;
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.94), rgba(250, 245, 255, 0.9));
  box-shadow: inset 0 1px 0 #fff, 0 12px 30px rgba(79, 70, 229, 0.08);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.rate-card-bulk-dropzone:hover,
.rate-card-bulk-dropzone:focus-visible,
.rate-card-bulk-dropzone.is-dragging {
  outline: none;
  transform: translateY(-2px);
  border-color: #6366f1;
  background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
}

.rate-card-bulk-dropzone > .material-symbols-rounded {
  margin-bottom: 8px;
  font-size: 48px;
}

.rate-card-bulk-dropzone strong {
  font-size: 1.12rem;
}

.rate-card-bulk-dropzone p {
  margin: 5px 0;
  color: #5d6471;
}

.rate-card-bulk-dropzone small {
  color: #727887;
}

.rate-card-bulk-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rate-card-bulk-list-head > div {
  display: grid;
  gap: 2px;
}

.rate-card-bulk-list-head > div > strong {
  color: #2e3138;
}

.rate-card-bulk-list-head > div > span {
  color: #727781;
  font-size: 0.8rem;
}

.rate-card-bulk-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow: 0 9px 22px rgba(99, 102, 241, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.rate-card-bulk-empty {
  padding: 20px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 14px;
  color: #747986;
  background: rgba(248, 249, 252, 0.8);
  text-align: center;
}

.rate-card-bulk-file-row {
  border-color: rgba(99, 102, 241, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.94));
}

.rate-card-bulk-file-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #343846;
}

.rate-card-bulk-file-identity > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
}

.rate-card-bulk-file-identity > div {
  display: grid;
  min-width: 0;
}

.rate-card-bulk-file-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-card-bulk-file-identity small {
  color: #747986;
}

.rate-card-bulk-row-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.rate-card-filters label,
.rate-card-upload label {
  display: grid;
  gap: 8px;
  color: #5b1017;
  font-weight: 800;
}

.rate-card-filters input,
.rate-card-filters select,
.rate-card-upload input,
.rate-card-upload select,
.rate-card-upload textarea {
  min-height: 48px;
  width: 100%;
  border: 1px solid rgba(125, 18, 27, 0.14);
  border-radius: 14px;
  padding: 0 15px;
  color: #282b31;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.rate-card-upload textarea {
  min-height: 90px;
  padding-top: 12px;
  resize: vertical;
}

.rate-card-upload.is-locked {
  opacity: 0.76;
}

.rate-card-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rate-card-progress div {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 18, 27, 0.1);
}

.rate-card-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4653, #b91c2a);
  transition: width 0.25s ease;
}

.rate-card-progress strong {
  min-width: 180px;
  color: #5b1017;
  font-size: 0.86rem;
}

.rate-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.rate-card-common-fields {
  display: grid;
  grid-template-columns: 1.35fr repeat(5, minmax(150px, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(125, 18, 27, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.rate-card-editions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
}

.rate-card-editions-head > div {
  display: grid;
  gap: 3px;
}

.rate-card-editions-head strong {
  color: #82151e;
  font-size: 1rem;
}

.rate-card-editions-head span {
  color: #6f737a;
  font-size: 0.82rem;
}

.rate-card-edition-rows {
  display: grid;
  gap: 12px;
  max-height: 46vh;
  overflow: auto;
  padding: 2px 6px 10px 2px;
}

.rate-card-edition-row {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(125, 18, 27, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 248, 0.9));
  box-shadow: 0 8px 22px rgba(69, 32, 37, 0.07), inset 0 1px 0 #fff;
}

.rate-card-edition-row.is-uploaded {
  border-color: rgba(26, 135, 76, 0.28);
  background: linear-gradient(135deg, #f1fff6, #dff7e8);
}

.rate-card-edition-row-grid {
  display: grid;
  grid-template-columns: 1fr 0.75fr 1.15fr 1.25fr auto;
  gap: 12px;
  align-items: end;
}

.rate-card-row-remarks textarea {
  min-height: 58px;
}

.rate-card-file-picker {
  position: relative;
  min-width: 0;
}

.rate-card-file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rate-card-file-picker > span {
  display: flex;
  align-items: center;
  min-height: 48px;
  overflow: hidden;
  padding: 0 15px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 14px;
  color: #3730a3;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.rate-card-row-remove {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(139, 25, 34, 0.18);
  border-radius: 12px;
  color: #8a1720;
  background: #fff1f2;
  font-weight: 750;
}

.rate-card-row-state {
  justify-self: end;
  color: #6d7178;
  font-size: 0.78rem;
  font-weight: 750;
}

.rate-card-edition-row.is-uploaded .rate-card-row-state {
  color: #14713b;
}

.rate-card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

.rate-card-status.current {
  color: #0f6b36;
  background: linear-gradient(135deg, #e9fff2, #bff0d0);
}

.rate-card-status.expired,
.rate-card-status.inactive {
  color: #5a6473;
  background: linear-gradient(135deg, #f4f5f7, #d8dde5);
}

.rate-card-status.superseded {
  color: #7a4f00;
  background: linear-gradient(135deg, #fff7d8, #f8db82);
}

.rate-card-status.draft {
  color: #8a1720;
  background: linear-gradient(135deg, #fff0f2, #ffd5dc);
}

.rate-card-load-more {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}

.rate-card-search-first {
  min-height: 240px;
  display: grid;
  place-content: center;
  text-align: center;
}

.rate-card-auto-load {
  margin: 8px 14px 18px;
  padding: 12px 16px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 8px;
  background: rgba(255, 248, 249, 0.8);
  color: #7d2730;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

body.theme-night .rate-card-auto-load {
  border-color: rgba(125, 211, 252, 0.22);
  background: rgba(30, 41, 59, 0.88);
  color: #bae6fd;
}

.rate-card-list-panel .table-wrap {
  max-height: 62vh;
  overflow: auto;
}

.rate-card-group-list {
  padding: 14px;
}

.rate-card-group-head {
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
}

.rate-card-group-head strong {
  min-width: 160px;
}

.rate-card-group-panel .table-wrap {
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

body.theme-night .rate-card-filters,
body.theme-night .rate-card-upload {
  border-color: rgba(141, 159, 190, 0.22);
  background:
    linear-gradient(135deg, rgba(22, 34, 54, 0.96), rgba(13, 24, 40, 0.94)),
    radial-gradient(circle at top right, rgba(255, 70, 83, 0.11), transparent 44%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 46px rgba(0, 0, 0, 0.28);
}

body.theme-night .rate-card-common-fields,
body.theme-night .rate-card-edition-row {
  border-color: rgba(166, 181, 204, 0.2);
  background: linear-gradient(135deg, rgba(31, 45, 68, 0.98), rgba(20, 33, 52, 0.96));
}

body.theme-night .rate-card-editions-head strong,
body.theme-night .rate-card-editions-head span,
body.theme-night .rate-card-row-state {
  color: #e4eaf3;
}

body.theme-night .rate-card-upload-head h4,
body.theme-night .rate-card-filters label,
body.theme-night .rate-card-upload label,
body.theme-night .rate-card-progress strong {
  color: #f8fafc;
}

body.theme-night .rate-card-filters input,
body.theme-night .rate-card-filters select,
body.theme-night .rate-card-upload input,
body.theme-night .rate-card-upload select,
body.theme-night .rate-card-upload textarea {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.22);
  background: linear-gradient(145deg, rgba(42, 55, 78, 0.96), rgba(26, 39, 60, 0.96));
}

body.theme-night .rate-card-filters input::placeholder,
body.theme-night .rate-card-upload input::placeholder,
body.theme-night .rate-card-upload textarea::placeholder {
  color: #aebbd0;
}

body.theme-night .rate-card-progress div {
  background: rgba(214, 224, 238, 0.16);
}

body.theme-night .rate-card-upload-mode,
body.theme-night .rate-card-bulk-empty {
  border-color: rgba(166, 181, 204, 0.2);
  background: linear-gradient(135deg, rgba(29, 43, 66, 0.98), rgba(19, 31, 50, 0.96));
}

body.theme-night .rate-card-upload-mode button {
  color: #d7dfeb;
}

body.theme-night .rate-card-upload-mode button.active[data-rate-card-upload-mode="single"] {
  color: #fff;
  border-color: rgba(255, 104, 116, 0.32);
  background: linear-gradient(135deg, rgba(142, 31, 43, 0.9), rgba(84, 24, 35, 0.94));
}

body.theme-night .rate-card-bulk-dropzone {
  color: #c7c9ff;
  border-color: rgba(129, 140, 248, 0.5);
  background: linear-gradient(135deg, rgba(42, 45, 91, 0.84), rgba(40, 31, 72, 0.78));
}

body.theme-night .rate-card-bulk-dropzone p,
body.theme-night .rate-card-bulk-dropzone small,
body.theme-night .rate-card-bulk-list-head > div > span,
body.theme-night .rate-card-bulk-file-identity small,
body.theme-night .rate-card-bulk-empty {
  color: #b9c4d6;
}

body.theme-night .rate-card-bulk-list-head > div > strong,
body.theme-night .rate-card-bulk-file-identity {
  color: #f8fafc;
}

body.theme-night .rate-card-bulk-file-row {
  border-color: rgba(129, 140, 248, 0.3);
  background: linear-gradient(135deg, rgba(35, 49, 73, 0.98), rgba(30, 37, 70, 0.96));
}

@media (max-width: 1180px) {
  .rate-card-filters,
  .rate-card-upload {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .modal.rate-card-modal .modal-panel {
    width: calc(100vw - 36px);
    min-width: 0;
  }

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

  .rate-card-common-fields { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .rate-card-edition-row-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .rate-card-bulk-row-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .rate-card-row-remove { justify-self: start; }
}

@media (max-width: 720px) {
  .rate-card-filters,
  .rate-card-upload {
    grid-template-columns: 1fr;
  }

  .modal.rate-card-modal {
    padding: 12px;
  }

  .modal.rate-card-modal .form-grid {
    padding: 16px;
  }

  .modal.rate-card-modal .rate-card-upload {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .rate-card-common-fields,
  .rate-card-edition-row-grid,
  .rate-card-bulk-row-grid,
  .rate-card-upload-mode { grid-template-columns: 1fr; }

  .rate-card-editions-head { align-items: stretch; flex-direction: column; }
}

body.theme-night .mrv-filter-row label,
body.theme-night .mrv-vendor-group summary span,
body.theme-night .mrv-vendor-group summary em,
body.theme-night .mrv-table small {
  color: #c7d3e5;
}

body.theme-night .mrv-vendor-group summary strong,
body.theme-night .mrv-month-tabs strong,
body.theme-night .mrv-vendor-payment label {
  color: #f8fafc;
}

body.theme-night .mrv-month-tabs button {
  color: #e8eef7;
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(135deg, rgba(31, 43, 64, 0.86), rgba(18, 28, 45, 0.78));
}

body.theme-night .mrv-month-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 70, 83, 0.94), rgba(174, 26, 38, 0.9));
}

body.theme-night .mrv-table input,
body.theme-night .mrv-vendor-payment input,
body.theme-night .mrv-vendor-payment select {
  color: #f8fafc;
  background: linear-gradient(145deg, rgba(52, 63, 81, 0.9), rgba(34, 45, 63, 0.92));
}

body.theme-night .portal-bill-card,
body.theme-night .portal-bill-card.progress-empty,
body.theme-night .portal-bill-card.progress-partial,
body.theme-night .portal-bill-card.progress-complete,
body.theme-night .portal-bill-ro,
body.theme-night .portal-field,
body.theme-night .portal-milestone,
body.theme-night .portal-system-cell,
body.theme-night .portal-rate-box label,
body.theme-night .portal-date-line,
body.theme-night .portal-size-badge {
  color: #262b35;
}

body.theme-night .portal-bill-card.stage-ready .portal-bill-ro {
  color: #12643c;
}

body.theme-night .portal-bill-card.stage-vts .portal-bill-ro,
body.theme-night .portal-bill-card.stage-rate .portal-bill-ro,
body.theme-night .portal-bill-card.stage-bill .portal-bill-ro {
  color: #7a520b;
}

body.theme-night .portal-bill-ro strong,
body.theme-night .portal-bill-ro p,
body.theme-night .portal-bill-ro small,
body.theme-night .portal-switch-row,
body.theme-night .portal-switch-row span,
body.theme-night .portal-field.locked strong,
body.theme-night .portal-system-cell strong,
body.theme-night .portal-system-cell span,
body.theme-night .portal-system-cell small,
body.theme-night .portal-row-ring span,
body.theme-night .portal-progress strong {
  color: inherit;
}

body.theme-night .portal-field.locked span,
body.theme-night .portal-field.rate-value em {
  color: #8b1e28;
}

body.theme-night .portal-bill-fields input,
body.theme-night .portal-bill-fields select,
body.theme-night .portal-bill-fields textarea,
body.theme-night .portal-rate-box input {
  color: #242936;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 243, 248, 0.9)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 40%);
}

body.theme-night .portal-line-progress {
  color: #242936;
  background: rgba(255, 255, 255, 0.82);
}

body.theme-night .portal-line-progress span,
body.theme-night .portal-line-progress em {
  color: #303642;
}

body.theme-night .portal-key-card,
body.theme-night .portal-key-picker,
body.theme-night .portal-key-hero,
body.theme-night .portal-key-meter {
  color: #f4f7fb;
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(145deg, rgba(25, 36, 55, 0.9), rgba(14, 22, 36, 0.84));
}

body.theme-night .portal-key-card strong,
body.theme-night .portal-key-hero strong,
body.theme-night .client-bill-head h3,
body.theme-night .portal-active-key,
body.theme-night .portal-active-key strong {
  color: #f8fafc;
}

body.theme-night .portal-key-card p,
body.theme-night .portal-key-search-hint,
body.theme-night .portal-key-hero p {
  color: #b6c2d3;
}

body.theme-night {
  --bg: #0d0e11;
  --panel: #17181c;
  --ink: #f2f2f4;
  --muted: #a7a7ad;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #f0444d;
  --accent-2: #8b8d8f;
  --accent-dark: #b51d27;
  --charcoal: #0b0c0f;
  --glass: rgba(24, 25, 30, 0.74);
  --soft: rgba(238, 47, 56, 0.13);
  --shadow: 0 28px 78px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 14px 38px rgba(0, 0, 0, 0.34);
  --ring: 0 0 0 4px rgba(240, 68, 77, 0.16);
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 0%, rgba(238, 47, 56, 0.16), transparent 34%),
    radial-gradient(circle at 0% 18%, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(135deg, #0b0c0f 0%, #15161a 50%, #0f1013 100%);
}

body.theme-night .app-tabs,
body.theme-night .topbar {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(13, 14, 17, 0.78);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

body.theme-night .sidebar {
  background:
    linear-gradient(160deg, rgba(10, 10, 12, 0.98), rgba(28, 8, 11, 0.94)),
    radial-gradient(circle at 10% 0%, rgba(238, 47, 56, 0.22), transparent 32%);
  box-shadow: 24px 0 55px rgba(0, 0, 0, 0.46);
}

body.theme-night .brand h1,
body.theme-night .topbar h2,
body.theme-night .panel h3,
body.theme-night .metric strong,
body.theme-night .report-card strong,
body.theme-night .nav-label {
  color: var(--ink);
}

body.theme-night .crumb,
body.theme-night .brand p,
body.theme-night .app-tab-count,
body.theme-night .metric p,
body.theme-night .report-card p,
body.theme-night .field-hint {
  color: var(--muted);
}

body.theme-night .panel,
body.theme-night .metric,
body.theme-night .report-card,
body.theme-night .task-manager,
body.theme-night .modal-panel,
body.theme-night .ro-group-panel,
body.theme-night .schedule-reminder-panel,
body.theme-night .vendor-payable-card,
body.theme-night .mrv-vendor-group,
body.theme-night .access-denied-panel {
  border-color: rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(145deg, rgba(31, 32, 37, 0.86), rgba(17, 18, 22, 0.82)),
    radial-gradient(circle at top left, rgba(238, 47, 56, 0.11), transparent 36%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

body.theme-night .doc-box.ro-doc,
body.theme-night .estimate-doc,
body.theme-night .invoice-doc,
body.theme-night .official-letter,
body.theme-night .official-letter-page,
body.theme-night .print-body {
  color: #242424;
  background: #fff;
}

body.theme-night .nav button:not(.active),
body.theme-night .app-tab:not(.active),
body.theme-night .nav-sub:not(.active),
body.theme-night .software-data-card,
body.theme-night .storage-card,
body.theme-night .clock-card {
  border-color: rgba(255, 255, 255, 0.08);
  color: #d7d7dc;
  background: linear-gradient(135deg, rgba(54, 55, 60, 0.58), rgba(25, 26, 30, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 30px rgba(0, 0, 0, 0.22);
}

body.theme-night .nav button:not(.active):hover,
body.theme-night .app-tab:not(.active):hover,
body.theme-night .nav-sub:not(.active):hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(238, 47, 56, 0.78), rgba(148, 18, 27, 0.78));
}

body.theme-night input,
body.theme-night select,
body.theme-night textarea,
body.theme-night .letter-body-editor,
body.theme-night .filters input,
body.theme-night .filters select,
body.theme-night .form-grid input,
body.theme-night .form-grid select,
body.theme-night .form-grid textarea,
body.theme-night .top-actions input {
  border-color: rgba(255, 255, 255, 0.1);
  color: #f2f2f4;
  background: rgba(19, 20, 24, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 26px rgba(0, 0, 0, 0.2);
}

body.theme-night input::placeholder,
body.theme-night textarea::placeholder {
  color: #7d7f86;
}

body.theme-night table,
body.theme-night .table-wrap,
body.theme-night .mrv-table,
body.theme-night .bulk-table,
body.theme-night .portal-bill-table {
  color: var(--ink);
  background: rgba(18, 19, 23, 0.74);
}

body.theme-night th,
body.theme-night .mrv-table th {
  color: #ffb7bd;
  background: rgba(238, 47, 56, 0.13);
}

body.theme-night td,
body.theme-night .mrv-table td {
  color: #e8e8eb;
  border-color: rgba(255, 255, 255, 0.07);
}

body.theme-night tbody tr:hover {
  background: rgba(238, 47, 56, 0.09);
}

body.theme-night .mrv-summary-strip,
body.theme-night .portal-line-progress,
body.theme-night .workspace-badge,
body.theme-night .notice,
body.theme-night .empty {
  border-color: rgba(255, 255, 255, 0.1);
  color: #e6e6ea;
  background:
    linear-gradient(135deg, rgba(33, 34, 39, 0.84), rgba(20, 21, 25, 0.82)),
    radial-gradient(circle at top left, rgba(238, 47, 56, 0.14), transparent 38%);
}

body.theme-night .mrv-summary-strip strong,
body.theme-night .portal-line-progress span,
body.theme-night .empty h3 {
  color: #fff;
}

body.theme-night .smart-dropdown,
body.theme-night .global-search-dropdown {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(19, 20, 24, 0.94);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.46);
}

body.theme-night .smart-dropdown button,
body.theme-night .global-search-dropdown button {
  color: #f0f0f2;
}

body.theme-night .smart-dropdown button.active,
body.theme-night .smart-dropdown button:hover,
body.theme-night .global-search-dropdown button.active,
body.theme-night .global-search-dropdown button:hover {
  color: #fff;
  background: linear-gradient(135deg, #f0444d, #b51d27);
}

.theme-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 84px;
  height: 40px;
  min-height: 40px;
  padding: 3px;
  border: 1px solid rgba(45, 45, 48, 0.12);
  border-radius: 999px;
  color: #7a7a80;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(231, 231, 234, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 28px rgba(35, 35, 35, 0.08);
  overflow: hidden;
}

.theme-toggle i {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 34px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 238, 240, 0.78));
  box-shadow: 0 10px 20px rgba(35, 35, 35, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease;
}

.theme-toggle.night i {
  transform: translateX(-42px);
  background: linear-gradient(135deg, #4c4d54, #15161a);
}

.theme-toggle .theme-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  font-family: "Material Symbols Rounded";
  font-size: 18px;
  font-weight: 500;
  color: #77787e;
  transition: color 0.25s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-toggle:not(.night) .theme-icon.day,
.theme-toggle.night .theme-icon.night {
  color: var(--accent-dark);
  transform: scale(1.06);
}

body.theme-night .theme-toggle {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(44, 45, 50, 0.8), rgba(13, 14, 17, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 30px rgba(0, 0, 0, 0.34);
}

body.theme-night .theme-toggle.night .theme-icon.night {
  color: #fff;
}

.vendor-payables-panel .panel-head p,
.mrv-panel .panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mrv-filter-row {
  display: flex;
  align-items: end;
  gap: 12px;
}

.mrv-filter-row label {
  display: grid;
  gap: 6px;
  color: #6f6f72;
  font-size: 12px;
  font-weight: 700;
}

.mrv-filter-row input {
  min-width: 150px;
}

.mrv-summary-strip {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  padding: 14px 18px;
  border: 1px solid rgba(178, 26, 38, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 246, 0.72)),
    radial-gradient(circle at 0 0, rgba(178, 26, 38, 0.11), transparent 42%);
  box-shadow: 0 18px 45px rgba(35, 35, 38, 0.08);
}

.mrv-summary-strip span,
.mrv-summary-strip em {
  color: #78787d;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.mrv-summary-strip strong {
  justify-self: center;
  color: #2f2f33;
  font-size: 24px;
  font-weight: 780;
}

.mrv-summary-strip em {
  justify-self: end;
}

.mrv-completion-meter {
  grid-column: 1 / -1;
}

.mrv-completion-meter .portal-line-progress {
  width: 100%;
  padding: 8px 10px;
  border-color: rgba(178, 26, 38, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.mrv-completion-meter .portal-line-progress div {
  grid-template-columns: auto 1fr auto;
}

.mrv-completion-meter .portal-line-progress i {
  height: 5px;
}

.vendor-payable-list,
.mrv-table-wrap {
  display: grid;
  gap: 14px;
}

.billing-head-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.billing-head-form .full {
  grid-column: 1 / -1;
}

.billing-head-field,
.billing-bank-field {
  display: grid;
  gap: 8px;
  color: #5a3338;
  font-size: 13px;
  font-weight: 800;
}

.billing-head-field small {
  margin-left: 6px;
  color: #8d8d93;
  font-size: 11px;
  font-weight: 760;
}

.billing-head-field input,
.billing-head-add-row input,
.billing-bank-field input,
.billing-bank-field textarea {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid rgba(178, 26, 38, 0.14);
  border-radius: 18px;
  color: #2e2e33;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 250, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 30px rgba(93, 45, 51, 0.06);
  font: inherit;
}

.billing-head-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.billing-head-add-row .mini-btn {
  min-width: 76px;
  border-radius: 16px;
}

.billing-head-bank-tile,
.billing-head-bank-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(178, 26, 38, 0.14);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 245, 247, 0.94), rgba(255, 255, 255, 0.86));
  box-shadow: 0 14px 35px rgba(110, 38, 48, 0.07);
}

.billing-head-bank-tile span,
.billing-head-bank-summary span {
  color: #8f1f2d;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-head-bank-tile strong,
.billing-head-bank-summary strong {
  min-width: 0;
  color: #37343a;
  font-size: 13px;
  font-weight: 760;
}

.billing-head-bank-tile .billing-head-bank-btn,
.billing-head-bank-summary .billing-head-bank-btn {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  white-space: nowrap;
}

.billing-head-selected,
.billing-head-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 52px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(178, 26, 38, 0.13);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 244, 246, 0.62));
}

.billing-head-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 9px 6px 13px;
  border: 1px solid rgba(178, 26, 38, 0.16);
  border-radius: 999px;
  color: #7b1820;
  background: rgba(255, 232, 235, 0.88);
  font-size: 13px;
  font-weight: 760;
}

.billing-head-chip button {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: #7b1820;
  background: rgba(178, 26, 38, 0.14);
  font-size: 12px;
  line-height: 1;
}

.billing-head-actions {
  display: flex;
  justify-content: flex-end;
}

.billing-head-actions .primary {
  min-width: 190px;
}

.billing-head-list {
  display: grid;
  gap: 12px;
}

.billing-head-card {
  overflow: hidden;
  border: 1px solid rgba(178, 26, 38, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 55px rgba(36, 36, 39, 0.08);
  backdrop-filter: blur(18px);
}

.billing-head-card summary {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.billing-head-card summary::-webkit-details-marker {
  display: none;
}

.billing-head-card summary span {
  color: #3a3a3e;
  font-size: 17px;
  font-weight: 780;
}

.billing-head-card summary strong {
  padding: 8px 14px;
  border-radius: 999px;
  color: #7b1820;
  background: rgba(255, 232, 235, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.billing-head-bank-ok,
.billing-head-bank-missing,
.billing-head-edition-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.billing-head-edition-pill {
  color: #4338ca;
  background: rgba(224, 231, 255, 0.9);
  font-style: normal;
}

.billing-head-bank-ok {
  color: #14532d;
  background: rgba(209, 250, 229, 0.9);
}

.billing-head-bank-missing {
  color: #8a4a04;
  background: rgba(254, 243, 199, 0.94);
}

.billing-head-card summary em {
  color: #77777c;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.billing-head-card-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.billing-head-edition-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(238, 242, 255, 0.86), rgba(255, 255, 255, 0.78));
}

.billing-head-edition-summary span {
  color: #4f46e5;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-head-edition-summary strong {
  color: #2f2d3a;
  font-size: 13px;
  font-weight: 780;
}

.billing-head-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.billing-head-publications {
  display: block;
  margin-top: 4px;
  color: #77777c;
  font-size: 11px;
  font-weight: 650;
}

.billing-bank-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(26, 25, 27, 0.48);
  backdrop-filter: blur(14px);
}

.billing-bank-card {
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 243, 245, 0.82)),
    radial-gradient(circle at 100% 0%, rgba(239, 68, 68, 0.14), transparent 35%);
  box-shadow: 0 34px 90px rgba(18, 18, 22, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.billing-bank-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.billing-bank-head p {
  margin: 0 0 6px;
  color: #a3202e;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.billing-bank-head h3 {
  margin: 0;
  color: #27252d;
  font-size: 28px;
  line-height: 1.1;
}

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

.billing-bank-field.full {
  grid-column: 1 / -1;
}

.billing-bank-field textarea {
  min-height: 92px;
  resize: vertical;
}

.billing-bank-field.confirmed {
  display: none;
}

.billing-bank-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #a3202e;
  font-weight: 800;
}

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

/* Billing Heads: legal-company mapping workbench */
.billing-head-panel {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.billing-head-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 22px 22px 10px 10px;
  color: #fff;
  background: linear-gradient(118deg, rgba(29, 24, 90, 0.98), rgba(79, 70, 229, 0.96) 54%, rgba(8, 145, 178, 0.92));
  box-shadow: 0 24px 58px rgba(49, 46, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.billing-head-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -44px -78px auto;
  width: 260px;
  height: 180px;
  border: 34px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  transform: rotate(-16deg);
}

.billing-head-hero-copy {
  min-width: 0;
  flex: 1;
}

.billing-head-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-head-hero-copy h3 {
  margin: 0;
  color: #fff;
  font-size: 25px;
  line-height: 1.12;
}

.billing-head-hero-copy p {
  max-width: 820px;
  margin: 7px 0 0;
  color: rgba(244, 247, 255, 0.86);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.45;
}

.billing-head-hero-status {
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
}

.billing-head-hero-status span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.billing-head-hero-status strong {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.billing-head-hero > .secondary {
  color: #22236a;
  background: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.billing-head-workbench {
  display: grid;
  grid-template-columns: minmax(235px, 0.9fr) minmax(520px, 1.8fr) minmax(245px, 0.85fr);
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(246, 249, 255, 0.92));
  box-shadow: 0 22px 56px rgba(36, 47, 90, 0.09);
}

.billing-head-name-field,
.billing-head-rule-composer,
.billing-head-bank-tile {
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(55, 65, 120, 0.06), inset 0 1px 0 #fff;
}

.billing-head-name-field {
  align-content: start;
  padding: 15px;
}

.billing-head-rule-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 15px;
}

.billing-head-composer-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.billing-head-composer-title em {
  padding: 5px 9px;
  border-radius: 999px;
  color: #0369a1;
  background: rgba(224, 242, 254, 0.9);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.billing-head-field-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #24285f;
}

.billing-head-field-title i {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #4f46e5, #0891b2);
  box-shadow: 0 7px 16px rgba(79, 70, 229, 0.22);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.billing-head-field-title b {
  font-size: 13px;
  font-weight: 850;
}

.billing-head-rule-composer .billing-head-field {
  gap: 6px;
}

.billing-head-rule-composer .billing-head-field > span {
  padding-left: 3px;
  color: #60657a;
  font-size: 11px;
  font-weight: 800;
}

.billing-head-workbench .billing-head-field input {
  min-height: 48px;
  padding: 11px 13px;
  border-radius: 13px;
  border-color: rgba(99, 102, 241, 0.18);
  background: #fbfcff;
  box-shadow: inset 0 1px 2px rgba(36, 40, 95, 0.04);
}

.billing-head-workbench .billing-head-field input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.billing-head-add-command {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 126px;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #2563eb 56%, #0891b2);
  box-shadow: 0 12px 24px rgba(59, 70, 191, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  font-size: 12px;
  font-weight: 850;
}

.billing-head-add-command:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(59, 70, 191, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.billing-head-add-command span {
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
}

.billing-head-bank-tile {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  align-content: start;
  min-height: auto;
  padding: 15px;
  background: linear-gradient(145deg, rgba(237, 253, 255, 0.9), rgba(246, 247, 255, 0.92));
}

.billing-head-bank-tile .billing-head-field-title {
  grid-column: 1 / -1;
}

.billing-head-bank-tile strong {
  align-self: center;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

.billing-head-bank-tile .billing-head-bank-btn {
  grid-column: 2;
  grid-row: 2;
  min-width: 84px;
  color: #075985;
  border-color: rgba(8, 145, 178, 0.2);
  background: rgba(207, 250, 254, 0.84);
}

.billing-head-selected {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  border-color: rgba(16, 185, 129, 0.18);
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.9), rgba(238, 242, 255, 0.78));
}

.billing-head-selected-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  color: #334155;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-head-selected-title strong {
  padding: 5px 9px;
  border-radius: 999px;
  color: #065f46;
  background: rgba(209, 250, 229, 0.92);
  font-size: 10px;
}

.billing-head-selected .billing-head-chip-list {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}

.billing-head-selected .billing-head-chip {
  color: #312e81;
  border-color: rgba(99, 102, 241, 0.2);
  background: linear-gradient(145deg, rgba(238, 242, 255, 0.96), rgba(224, 242, 254, 0.9));
}

.billing-head-selected .billing-head-chip button {
  color: #3730a3;
  background: rgba(99, 102, 241, 0.13);
}

.billing-head-actions {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.billing-head-actions p {
  max-width: 760px;
  margin: 0;
  color: #6b7280;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.billing-head-actions .primary {
  min-width: 185px;
  background: linear-gradient(135deg, #4338ca, #4f46e5 55%, #0891b2);
}

.billing-head-list-panel {
  margin-top: 16px;
}

.billing-head-list-panel .panel-head {
  margin-bottom: 14px;
}

body.theme-night .billing-head-workbench,
body.theme-indigo.theme-night .billing-head-workbench {
  border-color: rgba(125, 211, 252, 0.13);
  background: linear-gradient(145deg, rgba(22, 34, 57, 0.98), rgba(14, 25, 46, 0.96));
  box-shadow: 0 24px 64px rgba(2, 6, 20, 0.28);
}

body.theme-night .billing-head-name-field,
body.theme-night .billing-head-rule-composer,
body.theme-night .billing-head-bank-tile,
body.theme-indigo.theme-night .billing-head-name-field,
body.theme-indigo.theme-night .billing-head-rule-composer,
body.theme-indigo.theme-night .billing-head-bank-tile {
  border-color: rgba(148, 163, 184, 0.15);
  background: rgba(30, 43, 68, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.theme-night .billing-head-field-title,
body.theme-night .billing-head-rule-composer .billing-head-field > span,
body.theme-night .billing-head-bank-tile strong,
body.theme-night .billing-head-selected-title,
body.theme-indigo.theme-night .billing-head-field-title,
body.theme-indigo.theme-night .billing-head-rule-composer .billing-head-field > span,
body.theme-indigo.theme-night .billing-head-bank-tile strong,
body.theme-indigo.theme-night .billing-head-selected-title {
  color: #e5e7eb;
}

body.theme-night .billing-head-workbench .billing-head-field input,
body.theme-indigo.theme-night .billing-head-workbench .billing-head-field input {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.2);
  background: #17243a;
}

body.theme-night .billing-head-selected,
body.theme-indigo.theme-night .billing-head-selected {
  border-color: rgba(52, 211, 153, 0.18);
  background: linear-gradient(135deg, rgba(16, 85, 82, 0.25), rgba(49, 46, 129, 0.25));
}

body.theme-night .billing-head-actions p,
body.theme-indigo.theme-night .billing-head-actions p {
  color: #aebbd0;
}

@media (max-width: 980px) {
  .billing-head-form,
  .billing-bank-grid {
    grid-template-columns: 1fr;
  }

  .billing-head-workbench {
    grid-template-columns: 1fr 1fr;
  }

  .billing-head-rule-composer {
    grid-column: 1 / -1;
  }

  .billing-head-card summary {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .billing-head-bank-tile,
  .billing-head-bank-summary {
    grid-template-columns: 1fr;
  }

  .billing-head-bank-tile .billing-head-bank-btn,
  .billing-head-bank-summary .billing-head-bank-btn {
    grid-row: auto;
    grid-column: auto;
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .billing-head-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .billing-head-hero-status {
    width: 100%;
  }

  .billing-head-workbench {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .billing-head-rule-composer {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .billing-head-composer-title,
  .billing-head-selected,
  .billing-head-actions {
    grid-column: auto;
  }

  .billing-head-add-command {
    width: 100%;
  }

  .billing-head-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.vendor-payable-card,
.mrv-vendor-group {
  overflow: hidden;
  border: 1px solid rgba(178, 26, 38, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 20px 55px rgba(36, 36, 39, 0.08);
  backdrop-filter: blur(18px);
}

.vendor-payable-card summary,
.mrv-vendor-group summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.vendor-payable-card summary::-webkit-details-marker,
.mrv-vendor-group summary::-webkit-details-marker {
  display: none;
}

.vendor-payable-card summary span,
.mrv-vendor-group summary span {
  color: #3a3a3e;
  font-size: 17px;
  font-weight: 780;
}

.vendor-payable-card summary strong,
.mrv-vendor-group summary strong {
  padding: 8px 14px;
  border-radius: 999px;
  color: #7b1820;
  background: rgba(255, 232, 235, 0.9);
  font-size: 15px;
  font-weight: 800;
}

.vendor-payable-card summary em,
.mrv-vendor-group summary em {
  color: #77777c;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.mrv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.72);
}

.mrv-table th,
.mrv-table td {
  padding: 12px 14px;
  border-top: 1px solid rgba(120, 120, 125, 0.12);
  color: #3a3a3e;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

.mrv-table th {
  color: #7b1820;
  background: rgba(255, 240, 242, 0.72);
  font-weight: 820;
}

.mrv-table small {
  color: #7d7d82;
  font-size: 11px;
  font-weight: 650;
}

.mrv-table input {
  width: 100%;
  min-width: 110px;
  border: 1px solid rgba(120, 120, 125, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #303034;
  font-size: 13px;
  font-weight: 650;
}

.previous-system-detail {
  border-color: rgba(190, 18, 32, 0.38) !important;
  background: linear-gradient(135deg, rgba(255, 235, 238, 0.95), rgba(255, 245, 246, 0.78)) !important;
}

.previous-system-warning {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(190, 18, 32, 0.36);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff3347, #a50f1c);
  box-shadow: 0 14px 28px rgba(190, 18, 32, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-size: 18px;
  font-weight: 850;
  text-align: center;
  animation: previousSystemPulse 1.2s ease-in-out infinite;
}

.previous-system-detail .previous-system-warning,
.previous-system-warning.full {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(135deg, #e11d2f, #7f0d17) !important;
  text-shadow: 0 1px 2px rgba(45, 0, 5, 0.46);
}

.previous-system-inline,
.previous-system-cell-warning,
.previous-system-mrv-warning {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(190, 18, 32, 0.32);
  border-radius: 999px;
  color: #a50f1c;
  background: rgba(255, 232, 235, 0.96);
  font-weight: 850;
}

.previous-system-inline {
  padding: 6px 10px;
  font-size: 12px;
}

.previous-system-cell-warning {
  margin-top: 8px;
  padding: 6px 10px;
  color: #fff;
  background: linear-gradient(135deg, #ff3347, #a50f1c);
  font-size: 11px;
  animation: previousSystemPulse 1.2s ease-in-out infinite;
}

.previous-system-mrv-warning {
  margin-left: 10px;
  padding: 6px 10px;
  color: #fff;
  background: linear-gradient(135deg, #ff3347, #a50f1c);
  font-size: 11px;
  vertical-align: middle;
  animation: previousSystemPulse 1.2s ease-in-out infinite;
}

.previous-system-mrv-row {
  background: rgba(255, 244, 246, 0.72);
}

@keyframes previousSystemPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.015);
    filter: brightness(1.18);
  }
}

.mrv-locked {
  background: rgba(238, 238, 240, 0.58);
}

.mrv-locked input:disabled {
  color: #777;
  background: rgba(230, 230, 233, 0.78);
}

.mrv-actions,
.mrv-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.mrv-month-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mrv-month-tabs button {
  display: grid;
  gap: 5px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(120, 120, 125, 0.12);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(245, 245, 247, 0.76));
  color: #333338;
  text-align: left;
  box-shadow: 0 16px 40px rgba(35, 35, 38, 0.08);
  cursor: pointer;
}

.mrv-month-tabs button.active {
  border-color: rgba(178, 26, 38, 0.28);
  background: linear-gradient(145deg, rgba(255, 248, 249, 0.98), rgba(255, 229, 233, 0.78));
}

.mrv-month-tabs strong {
  color: #7b1820;
  font-size: 16px;
}

.mrv-month-tabs span {
  font-size: 18px;
  font-weight: 820;
}

.mrv-month-tabs em {
  color: #77777c;
  font-size: 12px;
  font-style: normal;
}

.mrv-vendor-payment {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 12px;
  padding: 16px 18px 18px;
  border-top: 1px solid rgba(120, 120, 125, 0.12);
  background: linear-gradient(135deg, rgba(247, 247, 248, 0.85), rgba(255, 244, 246, 0.64));
}

.mrv-vendor-payment label {
  display: grid;
  gap: 6px;
  color: #6f6f72;
  font-size: 12px;
  font-weight: 760;
}

.mrv-vendor-payment button {
  align-self: end;
}

.portal-difference.favor {
  color: #0d6f3d;
  background: rgba(217, 247, 227, 0.88);
}

.portal-difference.against {
  color: #9d1f27;
  background: rgba(255, 226, 230, 0.88);
}

.portal-difference.neutral {
  color: #66666b;
  background: rgba(231, 231, 234, 0.88);
}

.inward-bills-panel .panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inward-bill-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.1fr) minmax(300px, 1.8fr) minmax(160px, 0.8fr);
  gap: 14px;
  padding: 18px;
  border-top: 1px solid rgba(120, 120, 125, 0.1);
}

.inward-bill-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #57575b;
  font-size: 12px;
  font-weight: 780;
}

.inward-bill-form label.wide {
  grid-column: span 1;
}

.inward-bill-form .full-row {
  grid-column: 1 / -1;
}

.inward-bill-form input,
.inward-bill-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(120, 120, 125, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: #303034;
  font-size: 14px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.inward-bill-form input[readonly][data-inward-file-no] {
  color: #7b1620;
  background: linear-gradient(135deg, rgba(255, 244, 245, 0.94), rgba(239, 239, 241, 0.76));
  border-color: rgba(188, 37, 48, 0.18);
  cursor: default;
}

.inward-bill-form input[readonly][data-inward-file-no].pending {
  color: #7a7a80;
  background: linear-gradient(135deg, rgba(226, 227, 231, 0.96), rgba(210, 212, 218, 0.86));
  border-color: rgba(125, 125, 132, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.inward-bill-form input[readonly][data-inward-file-no].ready {
  color: #7b1620;
  background:
    linear-gradient(135deg, rgba(255, 248, 249, 0.96), rgba(255, 255, 255, 0.88)) padding-box,
    linear-gradient(90deg, #ef4444, #22c55e, #eab308, #3b82f6, #ef4444) border-box;
  border: 1px solid transparent;
  animation: inwardFileNoGlow 2.4s linear infinite;
}

@keyframes inwardFileNoGlow {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.75); }
  25% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.75); }
  50% { box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.75); }
  75% { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.75); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.75); }
}

.inward-date-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
}

.inward-date-control input[type="date"] {
  min-width: 54px;
  padding: 0 8px;
  color: transparent;
  cursor: pointer;
}

.inward-edition-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #57575b;
  font-size: 12px;
  font-weight: 780;
}

.inward-edition-picker > span {
  color: #57575b;
}

.inward-edition-picker {
  position: relative;
  z-index: 120;
}

.inward-edition-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(120, 120, 125, 0.14);
  border-radius: 16px;
  color: #3b3b40;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 250, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 12px 28px rgba(26, 26, 30, 0.06);
}

.inward-edition-trigger span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.inward-edition-trigger b {
  font-family: "Material Symbols Rounded";
  font-size: 22px;
  font-weight: 500;
  color: #9a1b25;
}

.inward-edition-options {
  position: static;
  z-index: 1;
  width: 100%;
  display: none;
  gap: 6px;
  max-height: 320px;
  margin-top: 6px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(120, 120, 125, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 246, 248, 0.9));
  box-shadow: 0 22px 52px rgba(32, 32, 38, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: max-height 0.24s ease, opacity 0.22s ease;
}

.inward-edition-picker.open .inward-edition-options,
.inward-edition-picker:focus-within .inward-edition-options {
  display: grid;
}

.inward-edition-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
  padding: 7px 10px;
  border: 1px solid rgba(188, 37, 48, 0.16);
  border-radius: 999px;
  color: #5d5d62;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 246, 248, 0.76));
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.inward-edition-options label:hover {
  transform: translateY(-1px);
  border-color: rgba(188, 37, 48, 0.32);
}

.inward-edition-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.inward-edition-options i {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(128, 128, 132, 0.5);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
}

.inward-edition-options input:checked + i {
  border-color: rgba(179, 31, 42, 0.74);
  background:
    linear-gradient(135deg, rgba(255, 88, 99, 0.95), rgba(183, 30, 40, 0.94));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.78);
}

.inward-edition-options input:checked ~ b {
  color: #8e1b25;
}

.inward-edition-options .inward-edition-all {
  border-color: rgba(179, 31, 42, 0.25);
  background: linear-gradient(135deg, rgba(255, 241, 243, 0.98), rgba(255, 255, 255, 0.88));
}

.inward-date-control input[type="date"]::-webkit-calendar-picker-indicator {
  width: 24px;
  height: 24px;
  margin: auto;
  cursor: pointer;
  opacity: 0.78;
}

.inward-bill-form label.needs-date input {
  border-color: rgba(214, 164, 22, 0.48);
  background: linear-gradient(135deg, rgba(255, 250, 225, 0.96), rgba(255, 244, 188, 0.72));
}

.inward-ro-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(120, 120, 125, 0.13);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(246, 246, 248, 0.92), rgba(238, 239, 242, 0.72));
}

.inward-ro-details div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.inward-ro-details span,
.inward-preview-label {
  color: #77777c;
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.inward-ro-details strong {
  color: #303034;
  font-size: 14px;
  font-weight: 760;
}

.inward-ro-details.empty-detail {
  display: block;
  color: #77777c;
  font-weight: 680;
}

.inward-difference-preview {
  display: grid;
  gap: 8px;
  align-content: end;
  min-height: 76px;
}

.inward-difference-preview strong {
  display: inline-flex;
  width: fit-content;
  min-height: 38px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 820;
}

.inward-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.davp-breakup-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(178, 26, 38, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 245, 247, 0.88), rgba(255, 255, 255, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 14px 34px rgba(35, 35, 38, 0.06);
}

.davp-breakup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.davp-breakup-title strong {
  color: #7b1820;
  font-size: 14px;
  font-weight: 850;
}

.davp-breakup-title span {
  color: #6f6f75;
  font-size: 12px;
  font-weight: 650;
}

.davp-breakup-editor table {
  width: 100%;
  overflow: hidden;
  border-collapse: collapse;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.davp-breakup-editor th,
.davp-breakup-editor td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(120, 120, 125, 0.12);
  color: #333337;
  text-align: left;
  font-size: 13px;
  font-weight: 720;
}

.davp-breakup-editor th {
  color: #7b1820;
  background: rgba(255, 235, 238, 0.72);
  font-weight: 850;
}

.davp-breakup-editor input[data-davp-edition-rate] {
  min-height: 38px;
  max-width: 160px;
  padding: 0 12px;
  border-radius: 12px;
}

.davp-breakup-summary {
  display: grid;
  gap: 7px;
}

.davp-breakup-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #5d5d62;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 720;
}

.davp-breakup-summary strong {
  color: #7b1820;
  font-weight: 850;
}

.davp-breakup-summary .final {
  border: 1px solid rgba(178, 26, 38, 0.18);
  background: linear-gradient(135deg, rgba(255, 235, 238, 0.96), rgba(255, 255, 255, 0.82));
}

.inward-bills-list {
  margin-top: 18px;
}

.inward-group-panel .ro-group-head {
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
}

.ro-group-head .inward-omission-count {
  color: #755000;
  border-color: rgba(190, 133, 15, 0.28);
  background: linear-gradient(135deg, rgba(255, 248, 204, 0.96), rgba(247, 210, 96, 0.76));
}

.inward-omission-ledger {
  margin: 14px;
  overflow: hidden;
  border: 1px solid rgba(190, 133, 15, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 251, 228, 0.96), rgba(255, 255, 255, 0.86));
}

.inward-omission-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  color: #6c4800;
  border-bottom: 1px solid rgba(190, 133, 15, 0.2);
  background: rgba(248, 218, 116, 0.18);
}

.inward-omission-title span {
  color: #7a6a45;
  font-size: 12px;
}

.inward-omission-table {
  display: grid;
}

.inward-omission-table article {
  display: grid;
  grid-template-columns: minmax(155px, .8fr) minmax(150px, 1fr) minmax(145px, .9fr) minmax(260px, 2fr) minmax(170px, 1fr) minmax(180px, 1.1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  color: #4a453a;
  border-bottom: 1px solid rgba(120, 100, 60, 0.12);
  font-size: 12px;
}

.inward-omission-table article:last-child {
  border-bottom: 0;
}

.inward-omission-table article > b {
  color: #8b1d26;
  font-size: 13px;
}

.inward-omission-table small {
  color: #746d60;
}

body.theme-night .inward-bill-form label,
body.theme-night .inward-bills-panel .panel-head p,
body.theme-night .inward-edition-field,
body.theme-night .inward-edition-picker > span {
  color: #cbd3df;
}

body.theme-night .inward-bill-form input,
body.theme-night .inward-bill-form select {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(29, 40, 56, 0.94);
  color: #f3f6fb;
}

body.theme-night .inward-edition-trigger {
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f6fb;
  background: linear-gradient(135deg, rgba(29, 40, 56, 0.96), rgba(18, 27, 42, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 42px rgba(0, 0, 0, 0.22);
}

body.theme-night .inward-edition-trigger b {
  color: #ff9da6;
}

body.theme-night .inward-bill-form input[readonly][data-inward-file-no] {
  color: #ffd7dc;
  background: linear-gradient(135deg, rgba(82, 31, 44, 0.9), rgba(33, 44, 61, 0.86));
  border-color: rgba(255, 91, 104, 0.24);
}

body.theme-night .inward-bill-form input[readonly][data-inward-file-no].pending {
  color: #b7c0cc;
  background: linear-gradient(135deg, rgba(49, 58, 70, 0.96), rgba(30, 39, 53, 0.92));
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-night .inward-bill-form input[readonly][data-inward-file-no].ready {
  color: #ffe7ec;
  background:
    linear-gradient(135deg, rgba(82, 31, 44, 0.9), rgba(33, 44, 61, 0.86)) padding-box,
    linear-gradient(90deg, #ff6b78, #55d98d, #f5c944, #65a6ff, #ff6b78) border-box;
  border: 1px solid transparent;
}

body.theme-night .davp-breakup-editor {
  border-color: rgba(255, 92, 104, 0.18);
  background: linear-gradient(135deg, rgba(23, 34, 49, 0.94), rgba(16, 23, 35, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 40px rgba(0, 0, 0, 0.28);
}

body.theme-night .davp-breakup-title strong,
body.theme-night .davp-breakup-editor th,
body.theme-night .davp-breakup-summary strong {
  color: #ffb7bf;
}

body.theme-night .davp-breakup-title span,
body.theme-night .davp-breakup-summary div {
  color: #d7deea;
}

body.theme-night .davp-breakup-editor table {
  background: rgba(12, 20, 32, 0.74);
}

body.theme-night .davp-breakup-editor th {
  background: rgba(123, 24, 32, 0.38);
}

body.theme-night .davp-breakup-editor td {
  color: #edf2fb;
}

body.theme-night .davp-breakup-summary div {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-night .davp-breakup-summary .final {
  border-color: rgba(255, 92, 104, 0.24);
  background: linear-gradient(135deg, rgba(123, 24, 32, 0.42), rgba(16, 23, 35, 0.7));
}

body.theme-night .inward-edition-options {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(29, 40, 56, 0.94);
}

body.theme-night .inward-edition-options label {
  color: #d8dee9;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(29, 40, 56, 0.96), rgba(18, 27, 42, 0.86));
}

body.theme-night .inward-edition-options input:checked ~ b {
  color: #ffd7dc;
}

body.theme-night .inward-edition-options .inward-edition-all {
  background: linear-gradient(135deg, rgba(62, 28, 42, 0.96), rgba(23, 34, 50, 0.9));
}

body.theme-night .ro-group-head mark {
  color: #ffd7dc;
  border-color: rgba(255, 91, 104, 0.28);
  background: linear-gradient(135deg, rgba(97, 31, 44, 0.86), rgba(55, 23, 36, 0.82));
}

body.theme-night .ro-group-head .inward-omission-count {
  color: #ffe7a1;
  border-color: rgba(247, 194, 66, 0.3);
  background: linear-gradient(135deg, rgba(112, 78, 17, 0.88), rgba(67, 47, 13, 0.84));
}

body.theme-night .inward-omission-ledger {
  border-color: rgba(247, 194, 66, 0.24);
  background: linear-gradient(135deg, rgba(38, 42, 48, 0.96), rgba(26, 34, 47, 0.9));
}

body.theme-night .inward-omission-title {
  color: #ffe8a8;
  border-color: rgba(247, 194, 66, 0.2);
  background: rgba(155, 108, 18, 0.18);
}

body.theme-night .inward-omission-title span,
body.theme-night .inward-omission-table article,
body.theme-night .inward-omission-table small {
  color: #e6dfcf;
}

body.theme-night .inward-omission-table article {
  border-color: rgba(255, 255, 255, 0.1);
}

body.theme-night .inward-omission-table article > b {
  color: #ffacb4;
}

body.theme-night .inward-ro-details {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(29, 40, 56, 0.92), rgba(21, 30, 45, 0.78));
}

body.theme-night .inward-ro-details div {
  background: rgba(12, 20, 32, 0.58);
}

body.theme-night .inward-ro-details strong {
  color: #f5f7fb;
}

body.theme-night .inward-ro-details span,
body.theme-night .inward-preview-label {
  color: #aeb9c8;
}

@media (max-width: 980px) {
  .mrv-vendor-payment,
  .vendor-payable-card summary,
  .mrv-vendor-group summary {
    grid-template-columns: 1fr;
  }

  .mrv-table-wrap {
    overflow-x: auto;
  }

  .mrv-table {
    min-width: 980px;
  }

  .inward-bill-form,
  .inward-ro-details {
    grid-template-columns: 1fr;
  }
}

.davp-import-panel {
  position: relative;
  overflow: hidden;
}

.davp-import-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(245, 245, 246, 0.58)),
    radial-gradient(circle at top right, rgba(198, 34, 43, 0.12), transparent 34%);
}

.davp-import-panel > * {
  position: relative;
}

.davp-import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 6px 2px 0;
}

.davp-import-layout p {
  margin: 0 0 8px;
  color: #3f3f46;
}

.davp-import-layout small,
.davp-file-name {
  display: block;
  color: #71717a;
}

.davp-file-name {
  margin-top: 8px;
  color: #7f1d1d;
}

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

@media (max-width: 760px) {
  .davp-import-layout {
    grid-template-columns: 1fr;
  }

  .davp-import-actions {
    justify-content: stretch;
  }

  .davp-import-actions button {
    flex: 1;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 6%, rgba(238, 47, 56, 0.14), transparent 29%),
    radial-gradient(circle at 18% 0%, rgba(70, 70, 73, 0.12), transparent 27%),
    linear-gradient(135deg, #fbfbfc 0%, #f3f3f5 48%, #eeeeef 100%);
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body.theme-night {
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 0%, rgba(238, 47, 56, 0.16), transparent 34%),
    radial-gradient(circle at 0% 18%, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(135deg, #0b0c0f 0%, #15161a 50%, #0f1013 100%);
}

body.cloud-locked .app-shell {
  display: none;
}

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

button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.app-shell {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
  overflow: visible;
  transition: grid-template-columns 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  position: relative;
  z-index: 30;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(160deg, #2b2b2e 0%, #414145 58%, #242426 100%);
  color: #fff;
  box-shadow: 18px 0 55px rgba(20, 20, 22, 0.2);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), padding 0.5s cubic-bezier(0.22, 1, 0.36, 1), gap 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease, background 0.5s ease;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand p,
.storage-card span,
.clock-card span,
.crumb,
#modalKicker {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.brand p,
.storage-card span,
.clock-card span {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    radial-gradient(circle at top left, rgba(238, 47, 56, 0.22), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 12px 28px rgba(16, 16, 18, 0.18);
  backdrop-filter: blur(18px) saturate(145%);
}

.sidebar-toggle span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.2);
  transition: transform 0.35s ease, background 0.35s ease;
}

.sidebar-toggle:hover {
  background:
    linear-gradient(135deg, rgba(238, 47, 56, 0.86), rgba(138, 12, 20, 0.72)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.3), transparent 46%);
  transform: translateY(-1px);
}

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

.nav button {
  width: 100%;
  min-height: 43px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.03);
}

.nav button:hover,
.nav button.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #f53b44 0%, #cc222b 100%);
  box-shadow: 0 12px 26px rgba(238, 47, 56, 0.28);
  transform: translateY(-1px);
}

.nav button:hover .nav-icon,
.nav button.active .nav-icon {
  color: #ee2f38;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 235, 237, 0.84)),
    radial-gradient(circle at 26% 14%, rgba(255, 255, 255, 0.62), transparent 42%);
}

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

.nav-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 760;
}

.nav-main,
.nav-sub,
.agency-portal-exit {
  position: relative;
}

.nav-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 9px;
  border-radius: 10px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.34), transparent 40%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 16px rgba(0, 0, 0, 0.14);
  font-family: "Material Symbols Rounded";
  font-size: 21px;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 520, "GRAD" 0, "opsz" 24;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background 0.35s ease, box-shadow 0.35s ease;
}

.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.sidebar-collapsed) .nav button {
  display: flex;
  align-items: center;
}

body:not(.sidebar-collapsed) .nav-icon {
  display: none;
}

body:not(.sidebar-collapsed) .nav-label {
  display: block;
  line-height: 1.25;
}

body:not(.sidebar-collapsed) .nav-main {
  gap: 10px;
}

body:not(.sidebar-collapsed) .nav button.nav-sub {
  padding-left: 16px;
}

.nav-caret {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
}

.nav-children {
  display: grid;
  gap: 5px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 4px 0 4px 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  transform: translateY(-4px);
  transition: max-height 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

.nav-group.open .nav-children {
  max-height: 340px;
  opacity: 1;
  transform: translateY(0);
}

.nav button.nav-sub {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
}

.nav button.nav-sub:hover,
.nav button.nav-sub.active {
  color: #fff;
  background: rgba(238, 47, 56, 0.72);
  box-shadow: 0 8px 18px rgba(238, 47, 56, 0.18);
}

.nav button.nav-sub.rapid-release-nav {
  isolation: isolate;
}

body:not(.sidebar-collapsed) .nav button.nav-sub.rapid-release-nav {
  gap: 7px;
}

body:not(.sidebar-collapsed) .nav button.nav-sub.rapid-release-nav .nav-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 1px;
  border-radius: 8px;
  color: #dbeafe;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.52), rgba(15, 23, 42, 0.76));
  font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 5px 12px rgba(30, 64, 175, 0.22);
}

.nav button.nav-sub.rapid-release-nav:hover,
.nav button.nav-sub.rapid-release-nav.active,
body.theme-night .nav button.nav-sub.rapid-release-nav:hover,
body.theme-night .nav button.nav-sub.rapid-release-nav.active {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.82);
  background: linear-gradient(115deg, #0f2f68, #164b9a 52%, #102c61);
  box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.2), 0 9px 22px rgba(30, 64, 175, 0.34);
  animation: rapid-release-electricity 1.15s linear infinite;
}

.nav button.nav-sub.rapid-release-nav:hover .nav-icon,
.nav button.nav-sub.rapid-release-nav.active .nav-icon {
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #0b1f49);
  filter: drop-shadow(0 0 5px rgba(147, 197, 253, 0.92));
}

@keyframes rapid-release-electricity {
  0%, 100% { box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.16), -5px 0 12px rgba(59, 130, 246, 0.18), 0 9px 22px rgba(30, 64, 175, 0.3); }
  25% { box-shadow: 0 0 0 1px rgba(191, 219, 254, 0.58), 0 -5px 15px rgba(96, 165, 250, 0.52), 0 9px 24px rgba(30, 64, 175, 0.38); }
  50% { box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.22), 6px 0 14px rgba(59, 130, 246, 0.5), 0 9px 22px rgba(30, 64, 175, 0.34); }
  75% { box-shadow: 0 0 0 1px rgba(219, 234, 254, 0.62), 0 5px 15px rgba(96, 165, 250, 0.46), 0 9px 26px rgba(30, 64, 175, 0.4); }
}

.rapid-live-badge {
  border-color: rgba(37, 99, 235, 0.32);
  color: #153f82;
  background: linear-gradient(135deg, #e8f2ff, #dbeafe);
}

.rapid-live-notice,
.rapid-live-summary {
  border-color: rgba(59, 130, 246, 0.24);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.92));
}

.rapid-live-action {
  background: linear-gradient(135deg, #1d4ed8, #0f2f68);
  box-shadow: 0 12px 26px rgba(30, 64, 175, 0.28);
}

body.theme-night .rapid-live-badge {
  border-color: rgba(147, 197, 253, 0.3);
  color: #dbeafe;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.42), rgba(15, 23, 42, 0.82));
}

body.theme-night .rapid-live-notice,
body.theme-night .rapid-live-summary {
  border-color: rgba(96, 165, 250, 0.24);
  color: #e5eefc;
  background: linear-gradient(135deg, rgba(24, 45, 78, 0.88), rgba(15, 23, 42, 0.92));
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 98px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  gap: 14px;
  padding: 18px 12px;
  z-index: 120;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 30%),
    linear-gradient(160deg, rgba(48, 6, 10, 0.98), rgba(16, 16, 18, 0.98) 54%, rgba(30, 30, 33, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset -18px 0 44px rgba(238, 47, 56, 0.08),
    14px 0 42px rgba(20, 20, 22, 0.22);
  backdrop-filter: blur(26px) saturate(150%);
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding: 8px 0 12px;
}

body.sidebar-collapsed .brand h1 {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(238, 47, 56, 0.72), rgba(90, 8, 15, 0.86)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 14px 30px rgba(4, 4, 6, 0.25);
  font-size: 0;
}

body.sidebar-collapsed .brand h1::after {
  content: "P1";
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 15px;
  font-weight: 780;
  line-height: 1;
  transform: translate(-50%, -50%);
}

body.sidebar-collapsed .brand p,
body.sidebar-collapsed .clock-card,
body.sidebar-collapsed .storage-card {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  width: 48px;
  min-height: 42px;
  margin: 0 auto;
  border-radius: 16px;
}

body.sidebar-collapsed .sidebar-toggle span:nth-child(1) {
  transform: translateX(7px);
}

body.sidebar-collapsed .sidebar-toggle span:nth-child(3) {
  transform: translateX(-7px);
}

body.sidebar-collapsed .nav {
  justify-items: center;
  gap: 10px;
}

body.sidebar-collapsed .nav-group {
  position: relative;
  width: 100%;
  justify-items: center;
}

body.sidebar-collapsed .nav-group::after {
  content: "";
  position: absolute;
  left: 61px;
  top: 0;
  width: 34px;
  height: 100%;
  z-index: 230;
  pointer-events: auto;
}

body.sidebar-collapsed .nav button {
  position: relative;
  width: 60px;
  min-height: 60px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    radial-gradient(circle at 24% 14%, rgba(255, 255, 255, 0.18), transparent 42%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 22px rgba(0, 0, 0, 0.12);
}

body.sidebar-collapsed .nav button:hover,
body.sidebar-collapsed .nav button.active {
  transform: scale(1.1);
  z-index: 160;
}

body.sidebar-collapsed .nav-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 16px;
  font-size: 31px;
  color: #fff;
  opacity: 0.75;
  text-align: center;
  transform: translate(-50%, -50%);
}

body.sidebar-collapsed .nav button:hover .nav-icon,
body.sidebar-collapsed .nav button.active .nav-icon {
  transform: translate(-50%, -50%) scale(1.08);
  color: #ee2f38;
  opacity: 0.75;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 232, 235, 0.88)),
    radial-gradient(circle at 26% 14%, rgba(255, 255, 255, 0.62), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 26px rgba(238, 47, 56, 0.34);
}

body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-caret {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .nav-main::after,
body.sidebar-collapsed .nav-sub::after {
  content: attr(data-nav-title);
  position: absolute;
  left: 76px;
  top: 50%;
  z-index: 260;
  min-width: max-content;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(38, 38, 42, 0.94), rgba(116, 16, 24, 0.9)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.24), transparent 42%);
  box-shadow: 0 18px 42px rgba(6, 6, 8, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(22px) saturate(160%);
  font-size: 13px;
  font-weight: 620;
  transform: translate(-10px, -50%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

body.sidebar-collapsed .nav-main:hover::after,
body.sidebar-collapsed .nav-sub:hover::after {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

body.sidebar-collapsed .nav-group .nav-children {
  position: absolute;
  left: 82px;
  top: -8px;
  z-index: 300;
  width: 238px;
  max-height: 0;
  padding: 10px;
  visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(37, 37, 41, 0.94), rgba(92, 10, 18, 0.9)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 42%);
  box-shadow: 0 24px 58px rgba(8, 8, 10, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(28px) saturate(160%);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  transform: translateX(-10px) scale(0.98);
  pointer-events: none;
}

body.sidebar-collapsed .nav-group:hover .nav-children {
  max-height: 620px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

body.sidebar-collapsed .nav-group:hover {
  z-index: 280;
}

body.sidebar-collapsed .nav:has(.nav-group:hover) > .nav-group:not(:hover) {
  pointer-events: none;
}

body.sidebar-collapsed .nav:has(.nav-group:hover) > .nav-group:hover {
  pointer-events: auto;
}

body.sidebar-collapsed .nav-group .nav-children .nav-sub {
  width: 100%;
  min-height: 42px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
}

body.sidebar-collapsed .nav-group .nav-children .nav-label {
  position: static;
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-collapsed .nav-group .nav-children .nav-icon {
  position: static;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  margin-right: 8px;
  border-radius: 12px;
  font-size: 22px;
  transform: none;
}

body.sidebar-collapsed .nav-group .nav-children .nav-sub:hover .nav-icon,
body.sidebar-collapsed .nav-group .nav-children .nav-sub.active .nav-icon {
  transform: none;
  opacity: 0.75;
}

body.sidebar-collapsed .nav-group .nav-children .nav-sub::after {
  content: none;
}

body.sidebar-collapsed .portal-sidebar-client {
  display: none;
}

body.sidebar-collapsed .portal-sidebar-nav {
  min-height: auto;
  align-items: center;
}

body.sidebar-collapsed .agency-portal-exit {
  width: 60px;
  min-height: 60px;
  padding: 0;
  border-radius: 20px;
  font-size: 0;
}

body.sidebar-collapsed .agency-portal-exit .nav-label {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .agency-portal-exit .nav-icon {
  margin: 0;
}

body.sidebar-collapsed .agency-portal-exit::after {
  content: attr(data-nav-title);
  position: absolute;
  left: 76px;
  top: 50%;
  z-index: 260;
  min-width: max-content;
  padding: 10px 13px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, rgba(38, 38, 42, 0.94), rgba(116, 16, 24, 0.9));
  box-shadow: 0 18px 42px rgba(6, 6, 8, 0.28);
  font-size: 13px;
  font-weight: 620;
  transform: translate(-10px, -50%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

body.sidebar-collapsed .agency-portal-exit:hover::after {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

.clock-card,
.storage-card {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.clock-card {
  margin-top: auto;
}

.clock-card strong,
.storage-card strong {
  font-size: 16px;
}

.storage-card small {
  display: block;
  margin-top: -4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.35;
}

.clock-card strong {
  line-height: 1.35;
  color: #fff;
}

.storage-card button,
.file-btn,
.primary,
.secondary,
.danger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 11px;
  font-weight: 720;
  letter-spacing: 0;
}

.storage-card button,
.primary {
  color: #fff;
  background: linear-gradient(135deg, #ff4650 0%, var(--accent) 52%, var(--accent-dark) 100%);
  box-shadow: 0 12px 24px rgba(238, 47, 56, 0.25);
}

.storage-card #cloudLogoutBtn {
  color: #2b2b2e;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(20, 20, 22, 0.12);
}

.cloud-sync-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 143, 82, 0.22);
  color: #12663c;
  background: linear-gradient(135deg, rgba(229, 255, 240, 0.94), rgba(188, 242, 211, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(29, 132, 76, 0.1);
  font-size: 12px;
  font-weight: 680;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.cloud-sync-pill .sync-led {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #19b660;
  box-shadow: 0 0 0 3px rgba(25, 182, 96, 0.14), 0 0 14px rgba(25, 182, 96, 0.62);
}

.cloud-sync-pill.sync-saved,
.storage-card button.cloud-sync-pill.sync-saved {
  color: #0f5d37;
}

.cloud-sync-pill.sync-saved span:last-child,
.storage-card button.cloud-sync-pill.sync-saved span:last-child {
  color: #0f5d37;
}

.cloud-sync-pill.sync-pending {
  border-color: rgba(199, 144, 18, 0.3);
  color: #7a5610;
  background: linear-gradient(135deg, rgba(255, 249, 221, 0.96), rgba(255, 225, 138, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 22px rgba(199, 144, 18, 0.12);
}

.cloud-sync-pill.sync-pending .sync-led {
  background: #f1b51c;
  box-shadow: 0 0 0 3px rgba(241, 181, 28, 0.18), 0 0 14px rgba(241, 181, 28, 0.72);
}

.storage-card .cloud-sync-pill {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  color: #12663c;
  background: linear-gradient(135deg, rgba(229, 255, 240, 0.94), rgba(188, 242, 211, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 9px 18px rgba(29, 132, 76, 0.1);
}

.storage-card .cloud-sync-pill.sync-pending {
  color: #7a5610;
  background: linear-gradient(135deg, rgba(255, 249, 221, 0.96), rgba(255, 225, 138, 0.9));
}

.secondary,
.file-btn {
  color: #fff;
  background: linear-gradient(135deg, #7a7a7d 0%, #555558 100%);
  box-shadow: 0 10px 20px rgba(45, 45, 48, 0.16);
}

.danger {
  color: #fff;
  background: linear-gradient(135deg, #e93642 0%, var(--bad) 100%);
}

.clerical-desk,
.clerical-settings {
  overflow: visible;
}

.clerical-meta-grid,
.clerical-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  padding: 16px;
}

.clerical-meta-grid .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px;
  border: 1px solid rgba(190, 31, 40, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.letter-form-shell {
  padding: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(238, 47, 56, 0.06), transparent 28%),
    linear-gradient(135deg, rgba(248, 248, 249, 0.94), rgba(238, 238, 240, 0.76));
}

.letter-form-card {
  display: grid;
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid rgba(190, 31, 40, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 26px 70px rgba(35, 35, 38, 0.1);
  backdrop-filter: blur(18px);
}

.letter-form-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px 14px;
  padding: 16px;
  border: 1px solid rgba(35, 35, 38, 0.06);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 249, 0.76));
}

.letter-form-block.tight,
.letter-form-block.subject,
.letter-form-block.salutation,
.letter-form-block.signoff,
.letter-form-block.controls {
  align-items: end;
}

.letter-form-block .full {
  grid-column: 1 / -1;
}

.letter-form-block label {
  display: grid;
  gap: 5px;
  color: #7d151d;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.letter-form-block input,
.letter-form-block select,
.letter-form-block textarea,
.letter-body-editor {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(120, 120, 124, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  color: #262629;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 8px 20px rgba(35, 35, 38, 0.05);
  font-size: 14px;
  font-weight: 560;
}

.letter-form-block input[readonly] {
  color: #555558;
  background: rgba(242, 242, 244, 0.92);
}

.letter-form-block textarea {
  min-height: 250px;
  resize: vertical;
  line-height: 1.55;
}

.letter-body-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(190, 31, 40, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  overflow: visible;
}

.letter-body-toolbar button,
.letter-body-toolbar select,
.letter-body-toolbar input[type="color"] {
  min-height: 34px;
  border: 1px solid rgba(190, 31, 40, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #333336;
  font-size: 12px;
  font-weight: 720;
}

.letter-body-toolbar button {
  padding: 7px 10px;
}

.letter-body-toolbar label {
  min-width: 0;
  text-transform: none;
  color: #7d151d;
  font-size: 10px;
  font-weight: 760;
}

.letter-body-toolbar label select {
  margin-top: 2px;
}

.letter-body-toolbar label:has([data-clerical-font-size]) {
  flex: 0 0 132px;
}

.letter-body-toolbar label:has([data-clerical-font]) {
  flex: 1 1 190px;
  min-width: 160px;
}

.letter-body-toolbar label:has([data-clerical-color]) {
  flex: 0 0 116px;
}

.letter-format-btn {
  width: 38px;
  min-width: 38px;
  height: 36px;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
  color: #7d151d !important;
  font-size: 16px !important;
  font-weight: 860 !important;
  line-height: 1;
}

.letter-format-btn.italic {
  font-style: italic;
}

.letter-format-btn.underline {
  text-decoration: underline;
}

.table-toolset {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 1px solid rgba(190, 31, 40, 0.08);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(248, 248, 249, 0.58));
}

.table-toolset label {
  min-width: 0;
}

.table-toolset input {
  min-height: 30px;
  padding: 6px 8px;
}

.table-toolset button {
  white-space: nowrap;
}

.letter-table-mini {
  min-height: 34px !important;
  padding: 6px 9px !important;
  border: 0 !important;
  background: transparent !important;
  color: #7d151d !important;
  font-size: 11px !important;
  font-weight: 780 !important;
}

.letter-table-menu {
  position: relative;
}

.letter-table-menu summary {
  width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #7d151d;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(190, 31, 40, 0.16);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  list-style: none;
}

.letter-table-menu summary::-webkit-details-marker {
  display: none;
}

.letter-table-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 210px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(190, 31, 40, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(35, 35, 38, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
}

.letter-table-popover label {
  display: grid;
  gap: 4px;
}

.letter-table-popover button {
  width: 100%;
  color: #fff !important;
  border: 0 !important;
  background: linear-gradient(135deg, #ef535a, #b71f28) !important;
}

.google-workspace-panel {
  display: grid;
  gap: 18px;
}

.google-workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 16px;
}

.google-workspace-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(190, 31, 40, 0.12);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 248, 249, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 20px 45px rgba(35, 35, 38, 0.08);
  backdrop-filter: blur(18px);
}

.google-workspace-card > span {
  color: #9b1d25;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.google-workspace-status {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(120, 120, 124, 0.14);
  background: rgba(255, 255, 255, 0.74);
}

.google-workspace-status.connected {
  border-color: rgba(50, 150, 84, 0.26);
  background: linear-gradient(135deg, rgba(226, 248, 233, 0.95), rgba(255, 255, 255, 0.78));
}

.google-workspace-status.not-connected {
  border-color: rgba(190, 31, 40, 0.18);
  background: linear-gradient(135deg, rgba(255, 238, 240, 0.86), rgba(255, 255, 255, 0.76));
}

.google-workspace-status strong {
  color: #262629;
  font-size: 20px;
  font-weight: 780;
}

.google-workspace-status span,
.google-workspace-status small {
  color: #65656a;
  font-weight: 580;
}

.google-workspace-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.google-workspace-actions.wrap {
  flex-wrap: wrap;
}

.google-workspace-output {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(190, 31, 40, 0.1);
  border-radius: 16px;
  color: #343437;
  background: rgba(255, 255, 255, 0.82);
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .google-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.letter-body-editor {
  min-height: 270px;
  line-height: 1.55;
  overflow: auto;
  text-transform: none !important;
}

.clerical-pages-host + .letter-form-block.body,
.clerical-pages-host + .letter-form-block.body + .letter-form-block.body,
.letter-switch-row:has(#clericalAddPage) {
  display: none !important;
}

.clerical-page-tools,
.clerical-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clerical-page-tools {
  padding: 12px;
  border: 1px solid rgba(190, 31, 40, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 241, 243, 0.62));
}

.clerical-page-tools strong,
.clerical-page-title strong {
  color: #7d151d;
  font-size: 15px;
}

.clerical-page-tools span {
  display: block;
  margin-top: 2px;
  color: #77777b;
  font-size: 12px;
  font-weight: 650;
}

.clerical-pages-list {
  display: grid;
  gap: 14px;
}

.clerical-page-block {
  border-color: rgba(190, 31, 40, 0.14);
}

.clerical-page-suggestion {
  display: none;
  padding: 10px 12px;
  border: 1px solid rgba(207, 142, 24, 0.24);
  border-radius: 12px;
  color: #7a5610;
  background: linear-gradient(135deg, rgba(255, 250, 229, 0.96), rgba(255, 233, 166, 0.72));
  font-size: 12px;
  font-weight: 760;
}

.clerical-page-suggestion.is-visible {
  display: block;
}

.clerical-page-meter {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(160px, 1fr) 48px;
  gap: 10px;
  align-items: center;
  color: #626268;
  font-size: 12px;
  font-weight: 720;
}

.clerical-page-meter b {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(35, 35, 38, 0.08);
}

.clerical-page-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #42a765, #f0c14b 78%, #c91f2b);
  transition: width 0.25s ease;
}

.clerical-page-meter.is-warn em {
  color: #9a6212;
}

.clerical-page-meter.is-over em,
.clerical-page-meter.is-over span {
  color: #b51f2a;
}

.letter-body-editor *,
.official-letter-body,
.official-letter-body * {
  text-transform: none !important;
}

.letter-body-editor table,
.official-letter table {
  table-layout: fixed;
}

.letter-body-editor td,
.letter-body-editor th {
  min-width: 80px;
  height: 28px;
  vertical-align: top;
  resize: both;
  overflow: auto;
}

.letter-body-editor:empty::before {
  content: attr(data-placeholder);
  color: #929296;
}

.letter-form-block .fixed-line {
  grid-column: 1 / -1;
  color: #2c2c2f;
  font-size: 15px;
  font-weight: 620;
}

.letter-form-block .signature-gap {
  grid-column: 1 / -1;
  height: 72px;
  display: grid;
  place-items: center start;
  color: rgba(125, 21, 29, 0.42);
  border: 1px dashed rgba(190, 31, 40, 0.2);
  border-radius: 14px;
  padding-left: 14px;
  background: rgba(255, 238, 240, 0.34);
  font-weight: 650;
}

.letter-form-block.controls .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  text-transform: none;
}

.letter-switch-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 31, 40, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  text-transform: none !important;
}

.letter-switch-row span {
  color: #38383b;
  font-size: 13px;
  font-weight: 760;
}

.letter-switch-row input {
  display: none;
}

.letter-switch-row i {
  position: relative;
  width: 58px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5c9cd, #c6373f);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.14), 0 8px 18px rgba(120, 20, 28, 0.12);
  transition: 0.25s ease;
}

.letter-switch-row i::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(30, 30, 32, 0.18);
  transition: 0.25s ease;
}

.letter-switch-row input:checked + i {
  background: linear-gradient(135deg, #dff7e8, #49a965);
}

.letter-switch-row input:checked + i::after {
  transform: translateX(28px);
}

.clerical-toolbar {
  position: sticky;
  top: 136px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(190, 31, 40, 0.1);
  border-bottom: 1px solid rgba(190, 31, 40, 0.12);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

.clerical-toolbar button,
.clerical-toolbar select {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(190, 31, 40, 0.16);
  border-radius: 10px;
  color: #4a4a4d;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(35, 35, 38, 0.06);
  font-weight: 650;
}

.letter-page-shell {
  display: grid;
  place-items: start center;
  padding: 26px;
  background:
    radial-gradient(circle at 18% 0%, rgba(238, 47, 56, 0.05), transparent 30%),
    linear-gradient(135deg, rgba(248, 248, 249, 0.9), rgba(236, 236, 238, 0.7));
}

.letter-editor-page,
.official-letter {
  width: min(794px, 100%);
  min-height: 1122px;
  padding: 50px 58px;
  border: 1px solid rgba(30, 30, 32, 0.08);
  background: #fff;
  box-shadow: 0 24px 60px rgba(30, 30, 32, 0.13);
  color: #262629;
  font-family: Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.38;
}

.official-letter {
  display: flex;
  flex-direction: column;
}

.official-letter.multi-page-letter {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  gap: 18px;
}

.official-letter-page {
  position: relative;
  width: 794px;
  min-height: 1122px;
  padding: 50px 58px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(30, 30, 32, 0.08);
  background: #fff;
  box-shadow: 0 24px 60px rgba(30, 30, 32, 0.13);
  page-break-after: always;
}

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

.second-page-body {
  margin-top: 18px;
}

.letter-editor-page:focus {
  outline: 2px solid rgba(190, 31, 40, 0.24);
  outline-offset: 4px;
}

.letter-editor-page table,
.official-letter table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.letter-editor-page td,
.official-letter td,
.letter-editor-page th,
.official-letter th {
  padding: 8px;
  border: 1px solid #d8d8dc;
}

.official-letterhead {
  min-height: 82px;
  padding-bottom: 10px;
  text-align: left;
}

.official-letterhead img,
.official-footer img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.official-letterhead h2 {
  margin: 0 0 6px;
  color: #9b1d25;
  font-size: 24px;
}

.official-letterhead p {
  margin: 2px 0;
  color: #4d4d51;
  font-size: 12px;
}

.official-letter-meta {
  display: block;
  margin: 18px 0;
  padding: 0;
  color: #242427;
  font-weight: 500;
}

.official-letter-meta p,
.official-letter-to p,
.official-letter-subject p,
.official-signature p {
  margin: 0;
}

.official-letter-meta.tight-lines p + p,
.official-letter-to p br + br,
.official-letter-subject p + p,
.official-signature p + p {
  margin-top: 0;
}

.clerical-edit-reference {
  display: block;
  margin-top: 2px;
  color: #77777b;
  font-size: 8.5px;
  font-weight: 500;
  line-height: 1.15;
}

.official-letter-to,
.official-letter-subject {
  margin: 0 0 18px;
}

.official-letter-body {
  min-height: 0;
  margin: 0 0 18px;
}

.official-letter-body p {
  margin: 0 0 11px;
}

.official-signature {
  display: block;
  margin-top: 18px;
}

.official-signature-stack {
  position: relative;
  display: inline-block;
  min-width: 260px;
  min-height: 88px;
  margin: 8px 0 0;
}

.official-sign-img {
  position: relative;
  z-index: 2;
  width: 215px;
  max-height: 96px;
  object-fit: contain;
  object-position: left bottom;
}

.official-stamp-img {
  position: absolute;
  z-index: 1;
  left: 145px;
  top: 8px;
  width: 106px;
  max-height: 106px;
  object-fit: contain;
  opacity: 0.82;
}

.official-sign-name {
  margin-top: 0 !important;
  font-weight: 700;
}

.official-footer {
  margin-top: auto;
  padding-right: 110px;
  padding-top: 0;
  color: #77777b;
  font-size: 11px;
  text-align: left;
}

.official-page-number {
  position: absolute;
  right: 58px;
  bottom: 34px;
  color: #66666b;
  font-size: 10.5px;
  font-weight: 600;
}

.signature-thumb {
  max-width: 90px;
  max-height: 44px;
  object-fit: contain;
}

.clerical-upload-preview {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(190, 31, 40, 0.12);
  border-radius: 16px;
  color: #555558;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(246, 246, 247, 0.72)),
    radial-gradient(circle at 12% 0%, rgba(190, 31, 40, 0.08), transparent 32%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 16px 36px rgba(35, 35, 38, 0.06);
  font-size: 12px;
  font-weight: 720;
}

.clerical-upload-preview.wide {
  grid-column: span 1;
}

.clerical-upload-preview.empty {
  justify-content: center;
  border-style: dashed;
  color: #8a8a8d;
}

.clerical-upload-preview img {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
  justify-self: start;
}

.clerical-upload-preview.stamp img {
  max-width: 84px;
  max-height: 84px;
}

.signature-preview-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 31, 40, 0.12);
  border-radius: 12px;
  color: #555558;
  background: rgba(255, 255, 255, 0.78);
}

.panel-head.subtle {
  margin-top: 10px;
  border-top: 1px solid rgba(190, 31, 40, 0.08);
}

.print-body {
  margin: 0;
  background: #fff;
}

.print-body .official-letter {
  width: 794px;
  min-height: 1122px;
  margin: 0;
  box-shadow: none;
  border: 0;
}

.print-body .official-letter.one-page-letter {
  height: 1122px;
  overflow: hidden;
  transform: scale(var(--letter-scale, 1));
  transform-origin: top left;
}

.print-body .official-letter.allow-extra-page {
  min-height: 0;
  height: auto;
  overflow: visible;
}

.print-body .official-letter.multi-page-letter {
  width: 794px;
  margin: 0;
  padding: 0;
  box-shadow: none;
  border: 0;
  gap: 0;
}

.print-body .official-letter-page {
  margin: 0;
  border: 0;
  box-shadow: none;
}

.invoice-workbench {
  overflow: visible;
}

.invoice-mode-filter select {
  min-width: 220px;
}

.invoice-summary-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 180px minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid rgba(186, 28, 42, 0.14);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 245, 246, 0.72));
  box-shadow: 0 18px 46px rgba(105, 18, 28, 0.08);
}

.invoice-summary-strip > span {
  align-self: center;
  color: #6b6b70;
  font-weight: 600;
}

.invoice-summary-strip > span strong {
  display: block;
  color: #a71925;
  font-size: 30px;
  line-height: 1;
}

.invoice-group {
  margin-top: 18px;
}

.invoice-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #7a1c24;
}

.invoice-group-head h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
}

.invoice-group-head span {
  padding: 7px 12px;
  border: 1px solid rgba(186, 28, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 236, 238, 0.72);
  color: #7b2028;
  font-size: 12px;
  font-weight: 700;
}

.invoice-tray-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.invoice-tray-card {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(186, 28, 42, 0.16);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 248, 0.82));
  box-shadow: 0 22px 50px rgba(87, 18, 28, 0.09);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.invoice-tray-card:has([data-invoice-line-check]:checked) {
  border-color: rgba(183, 25, 36, 0.46);
  box-shadow: 0 24px 60px rgba(156, 20, 30, 0.15);
  transform: translateY(-2px);
}

.invoice-card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.invoice-select-line {
  width: auto;
  margin: 0;
}

.invoice-select-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.invoice-select-line span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid rgba(160, 28, 38, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
}

.invoice-select-line input:checked + span {
  border-color: #af1f2a;
  background: linear-gradient(135deg, #ef4b57, #a91d27);
}

.invoice-select-line input:checked + span::after {
  content: "";
  width: 10px;
  height: 16px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translateY(-2px);
}

.invoice-card-top strong,
.invoice-card-main h3 {
  color: #28282c;
}

.invoice-card-top p,
.invoice-card-main p {
  margin: 3px 0 0;
  color: #77777c;
}

.invoice-card-top em {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 237, 239, 0.9);
  color: #a51f2a;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.invoice-card-main h3 {
  margin: 0;
  font-size: 19px;
}

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

.invoice-card-values > span,
.invoice-card-values label {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(170, 33, 44, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #747478;
  font-size: 12px;
  font-weight: 700;
}

.invoice-card-values input,
.invoice-card-values select {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #27272b;
  font-size: 14px;
  font-weight: 650;
}

.invoice-card-values strong {
  color: #242428;
  font-size: 17px;
}

.invoice-edit-lines {
  display: grid;
  gap: 12px;
}

.invoice-edit-line {
  display: grid;
  grid-template-columns: 1.2fr 1fr repeat(4, minmax(110px, 0.55fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(170, 33, 44, 0.12);
  border-radius: 18px;
  background: rgba(255, 247, 248, 0.72);
}

.invoice-title {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
}

.invoice-title strong {
  color: #7d1e27;
  font-size: 23px;
}

.invoice-title p {
  margin: 5px 0 0;
  color: #444448;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin: 16px 0;
}

.invoice-meta-grid > div,
.invoice-total-box {
  padding: 14px;
  border: 1px solid rgba(170, 33, 44, 0.12);
  border-radius: 14px;
  background: rgba(255, 247, 248, 0.7);
}

.invoice-meta-grid span {
  color: #8b1d27;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-line-table th {
  background: #fff0f2;
  color: #861d26;
}

.invoice-line-table td,
.invoice-line-table th {
  font-size: 12px;
  vertical-align: top;
}

.invoice-line-table tfoot td {
  color: #7c1d26;
  font-weight: 800;
}

.invoice-total-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.invoice-total-box span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #55555b;
}

.invoice-remarks {
  padding: 12px;
  border-left: 4px solid #b51f2b;
  background: #fff7f8;
}

@media print {
  .print-body {
    width: 794px;
    min-height: 1122px;
  }

  .print-body .official-letter.one-page-letter {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
}

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

.history-icon-btn {
  min-height: 20px;
  min-width: 38px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-left: 6px;
  padding: 3px 7px;
  border: 1px solid rgba(190, 31, 40, 0.42);
  border-radius: 7px;
  color: #6d6d72;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 5px 12px rgba(35, 35, 38, 0.06);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.history-icon-btn:hover {
  color: #fff;
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(190, 31, 40, 0.5);
  background: linear-gradient(135deg, rgba(239, 77, 86, 0.92), rgba(190, 31, 40, 0.95));
}

.log-history-popover {
  position: fixed;
  z-index: 80;
  max-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(24, 24, 26, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

.log-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-bottom: 1px solid rgba(35, 35, 38, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 246, 247, 0.74));
}

.log-history-head strong {
  color: #8f161f;
  font-size: 13px;
}

.log-history-head button {
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 8px;
  color: #333337;
  background: rgba(235, 235, 237, 0.9);
}

.log-history-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding: 12px;
}

.log-history-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(35, 35, 38, 0.07);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(247, 247, 248, 0.7));
}

.log-history-list strong {
  color: #2d2d30;
  font-size: 12px;
}

.log-history-list span,
.log-history-list small {
  color: #66666a;
  font-size: 11px;
  line-height: 1.35;
}

.data-log-panel {
  display: grid;
  gap: 14px;
}

.data-log-list {
  display: grid;
  gap: 12px;
}

.data-log-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
}

.data-log-filters label {
  display: grid;
  gap: 6px;
  color: #6a6a6d;
  font-size: 12px;
  font-weight: 680;
}

.data-log-filters input,
.data-log-filters select {
  min-height: 40px;
  border: 1px solid rgba(36, 36, 36, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.88);
}

.data-log-entry {
  display: grid;
  gap: 10px;
  padding: 14px 15px;
  border: 1px solid rgba(36, 36, 36, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(246, 246, 247, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 24px rgba(35, 35, 35, 0.06);
}

.data-log-main {
  display: grid;
  gap: 5px;
}

.data-log-main strong {
  color: var(--charcoal);
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
}

.data-log-main span,
.data-log-main small {
  color: #68686b;
  font-size: 12px;
}

.data-log-details {
  border-top: 1px solid rgba(36, 36, 36, 0.08);
  padding-top: 8px;
}

.data-log-details summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.data-log-details p {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(238, 47, 56, 0.05);
  color: #343437;
  font-size: 12px;
  line-height: 1.45;
}

.software-data-panel {
  display: grid;
  gap: 14px;
}

.software-data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px;
}

.software-data-actions button {
  min-width: 170px;
}

.software-data-log-list {
  padding: 0 18px 18px;
}

.structured-shadow-card {
  margin: 0 18px;
  padding: 18px;
  border: 1px solid rgba(103, 107, 116, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(244, 245, 247, 0.88));
  box-shadow: 0 14px 34px rgba(37, 40, 47, 0.08);
}

.structured-shadow-card.healthy {
  border-color: rgba(36, 143, 84, 0.32);
}

.structured-shadow-card.review,
.structured-shadow-card.unavailable {
  border-color: rgba(205, 145, 28, 0.42);
}

.structured-shadow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.structured-shadow-head h3 {
  margin: 3px 0 5px;
  font-size: 22px;
  font-weight: 600;
}

.structured-shadow-head p {
  max-width: 850px;
  margin: 0;
  color: #676a71;
}

.structured-shadow-eyebrow {
  color: #9d1821;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.structured-shadow-run {
  flex: 0 0 auto;
}

.structured-shadow-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.structured-shadow-metrics article {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(116, 119, 127, 0.15);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.structured-shadow-metrics span,
.structured-shadow-detail span {
  color: #6b6e75;
  font-size: 12px;
}

.structured-shadow-metrics strong {
  display: block;
  margin-top: 5px;
  color: #292b30;
  font-size: 17px;
}

.structured-shadow-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
}

.structured-shadow-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(197, 134, 17, 0.34);
  border-radius: 6px;
  color: #6f4a00;
  background: #fff7df;
}

body.theme-night .structured-shadow-card {
  color: #eef4ff;
  border-color: rgba(125, 150, 190, 0.3);
  background: linear-gradient(135deg, rgba(29, 42, 64, 0.96), rgba(20, 31, 49, 0.94));
}

body.theme-night .structured-shadow-head p,
body.theme-night .structured-shadow-metrics span,
body.theme-night .structured-shadow-detail span {
  color: #b7c4d7;
}

body.theme-night .structured-shadow-metrics article {
  border-color: rgba(143, 164, 197, 0.2);
  background: rgba(42, 57, 80, 0.74);
}

body.theme-night .structured-shadow-metrics strong {
  color: #f5f8fd;
}

@media (max-width: 900px) {
  .structured-shadow-head {
    align-items: stretch;
    flex-direction: column;
  }

  .structured-shadow-metrics {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

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

button:active {
  transform: translateY(0);
}

.file-btn input {
  display: none;
}

.main {
  min-width: 0;
}

.app-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 30px 0;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(22px) saturate(140%);
}

.app-tab-list {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.app-tab,
.app-tab-add {
  min-height: 38px;
  border: 1px solid rgba(45, 45, 48, 0.1);
  border-bottom-color: rgba(45, 45, 48, 0.18);
  color: #3e3e42;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(239, 239, 241, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 12px 24px rgba(35, 35, 35, 0.07);
}

.app-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 138px;
  max-width: 270px;
  padding: 8px 12px 8px 15px;
  border-radius: 13px 13px 8px 8px;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}

.app-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tab.active {
  color: #fff;
  border-color: rgba(186, 32, 40, 0.28);
  background: linear-gradient(135deg, rgba(238, 47, 56, 0.94), rgba(186, 32, 40, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 14px 30px rgba(186, 32, 40, 0.19);
}

.app-tab em {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-style: normal;
  font-size: 13px;
  line-height: 1;
  color: inherit;
  opacity: 0.74;
}

.app-tab em:hover {
  background: rgba(255, 255, 255, 0.22);
  opacity: 1;
}

.app-tab-add {
  width: 38px;
  border-radius: 12px;
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 420;
}

.app-tab-add:disabled {
  color: #9a9a9e;
  cursor: not-allowed;
  opacity: 0.62;
}

.app-tab-count {
  flex: 0 0 auto;
  color: #77777b;
  font-size: 12px;
}

.topbar {
  position: sticky;
  top: 50px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 10px 28px rgba(35, 35, 35, 0.06);
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 780;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-sync-pill {
  flex: 0 0 auto;
  min-height: 40px;
  max-width: 265px;
}

.top-sync-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions input {
  width: min(38vw, 420px);
  min-height: 43px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 24px rgba(35, 35, 35, 0.06);
}

#printBtn {
  min-height: 43px;
  padding: 9px 14px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #66666a 0%, #3f3f42 100%);
}

.content {
  padding: 28px 30px 52px;
}

.workspace-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(238, 47, 56, 0.22);
  border-radius: 999px;
  color: #8f1720;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 238, 240, 0.74)),
    radial-gradient(circle at top left, rgba(238, 47, 56, 0.16), transparent 42%);
  box-shadow: 0 12px 26px rgba(190, 31, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 720;
}

.test-workspace-badge {
  border-color: rgba(99, 102, 241, 0.32);
  color: #3730a3;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(237, 233, 254, 0.82)),
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.22), transparent 44%);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.theme-night .test-workspace-badge {
  color: #dbeafe;
  border-color: rgba(129, 140, 248, 0.34);
  background:
    linear-gradient(135deg, rgba(49, 46, 129, 0.94), rgba(30, 41, 59, 0.88)),
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 44%);
}

.access-denied-panel {
  max-width: 720px;
  margin: 40px auto;
  padding: 42px;
  text-align: center;
}

.access-denied-panel h3 {
  margin: 0 0 10px;
  color: #991b1b;
  font-size: 34px;
  font-weight: 760;
}

.access-denied-panel p {
  margin: 0;
  color: #5f6065;
  font-size: 16px;
  line-height: 1.6;
}

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

body.record-delete-locked [data-delete],
body.record-delete-locked [data-delete-billing-head],
body.record-delete-locked [data-delete-clerical-template],
body.record-delete-locked [data-delete-clerical-signature],
body.record-delete-locked [data-delete-inward-bill],
body.record-delete-locked [data-delete-user-access] {
  display: none !important;
}

.control-centre-panel {
  overflow: hidden;
}

.control-centre-panel .panel-head p {
  margin: 4px 0 0;
  color: #77787d;
  font-size: 13px;
}

.control-centre-users {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.control-user-card {
  border: 1px solid rgba(238, 47, 56, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 250, 0.9));
  box-shadow: 0 16px 38px rgba(26, 26, 30, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.control-user-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.control-user-card summary::-webkit-details-marker {
  display: none;
}

.control-user-card summary strong {
  display: block;
  color: var(--charcoal);
  font-size: 16px;
}

.control-user-card summary small {
  display: block;
  margin-top: 3px;
  color: #73747a;
  font-size: 12px;
}

.control-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-user-meta label,
.control-ncr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5d5e64;
  font-size: 12px;
  font-weight: 750;
}

.control-user-meta select {
  min-height: 36px;
  padding: 7px 32px 7px 12px;
  border: 1px solid rgba(36, 36, 36, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--charcoal);
  font-weight: 750;
}

.control-identity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}

.control-identity-grid label {
  display: grid;
  gap: 6px;
  color: #5d5e64;
  font-size: 12px;
  font-weight: 750;
}

.control-identity-grid input {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(36, 36, 36, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--charcoal);
  font-weight: 700;
}

.control-permission-wrap {
  max-height: 520px;
  overflow: auto;
  border-top: 1px solid rgba(36, 36, 36, 0.08);
}

.control-permission-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.control-permission-table th,
.control-permission-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(36, 36, 36, 0.07);
  text-align: center;
  color: var(--charcoal);
}

.control-permission-table th:first-child,
.control-permission-table td:first-child {
  text-align: left;
  width: 260px;
}

.control-permission-table td strong {
  display: block;
  font-size: 13px;
}

.control-permission-table td small {
  display: block;
  margin-top: 2px;
  color: #77787d;
  font-size: 11px;
}

.control-check {
  display: inline-grid;
  place-items: center;
}

.control-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.control-check span {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(36, 36, 36, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.control-check input:checked + span {
  border-color: rgba(238, 47, 56, 0.46);
  background: linear-gradient(135deg, #ff5d65, #c9222b);
  box-shadow: 0 8px 18px rgba(238, 47, 56, 0.22);
}

.control-check input:checked + span::after {
  content: "";
  display: block;
  width: 10px;
  height: 6px;
  margin: 7px auto 0;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg);
}

.control-check:hover span {
  transform: scale(1.08);
}

.control-centre-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid rgba(36, 36, 36, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
}

body.theme-night .control-user-card,
body.theme-indigo.theme-night .control-user-card {
  border-color: rgba(205, 215, 238, 0.14);
  background: linear-gradient(145deg, rgba(29, 40, 69, 0.97), rgba(19, 28, 52, 0.94));
}

body.theme-night .control-user-card summary strong,
body.theme-night .control-permission-table th,
body.theme-night .control-permission-table td,
body.theme-night .control-permission-table td strong,
body.theme-indigo.theme-night .control-user-card summary strong,
body.theme-indigo.theme-night .control-permission-table th,
body.theme-indigo.theme-night .control-permission-table td,
body.theme-indigo.theme-night .control-permission-table td strong {
  color: #f3f6ff;
}

body.theme-night .control-user-card summary small,
body.theme-night .control-permission-table td small,
body.theme-night .control-user-meta label,
body.theme-night .control-ncr,
body.theme-night .control-identity-grid label,
body.theme-indigo.theme-night .control-user-card summary small,
body.theme-indigo.theme-night .control-permission-table td small,
body.theme-indigo.theme-night .control-user-meta label,
body.theme-indigo.theme-night .control-ncr,
body.theme-indigo.theme-night .control-identity-grid label {
  color: #b8c4de;
}

body.theme-night .control-identity-grid input,
body.theme-indigo.theme-night .control-identity-grid input {
  border-color: rgba(205, 215, 238, 0.15);
  background: linear-gradient(145deg, #26324f, #1a2540);
  color: #f3f6ff;
}

body.theme-indigo .control-check input:checked + span {
  border-color: rgba(79, 70, 229, 0.42);
  background: linear-gradient(135deg, #4f46e5, #0891b2);
}

body.theme-indigo .control-centre-actions {
  background: rgba(248, 250, 255, 0.78);
}

.bulk-result-toolbar {
  align-items: center;
}

.bulk-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.google-draft-bulk-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  min-height: 44px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(135deg, #2563eb, #16a34a);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.google-draft-bulk-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 18px 36px rgba(22, 163, 74, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.google-draft-bulk-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.bulk-gmail-progress-card .software-alert-mark {
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color: #fff;
}

.bulk-gmail-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.bulk-gmail-progress i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(218, 226, 242, 0.8);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.bulk-gmail-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
  transition: width 220ms ease;
}

.bulk-gmail-progress strong {
  color: #14532d;
  font-size: 13px;
}

.bulk-gmail-progress-card ul {
  max-height: 230px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bulk-gmail-progress-card li {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(241, 245, 249, 0.92);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.bulk-gmail-progress-card li.ok {
  background: #dcfce7;
  color: #14532d;
  border-color: #86efac;
}

.bulk-gmail-progress-card li.bad {
  background: #ffe4e6;
  color: #b91c1c;
  border-color: #fda4af;
}

.matter-upload-card {
  width: min(1500px, calc(100vw - 14px));
  max-height: min(96vh, 1080px);
  display: block;
  overflow: hidden;
  padding: 0;
  border-radius: 30px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 242, 244, 0.94));
}

.matter-upload-card .software-alert-copy {
  min-width: 0;
}

.matter-upload-card .software-alert-mark {
  color: #9f1239;
  background: linear-gradient(135deg, #fff1f2, #ffffff);
  box-shadow: 0 16px 34px rgba(190, 31, 40, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.matter-upload-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(238, 47, 56, 0.14);
}

.matter-upload-hero > strong {
  align-self: start;
  padding: 8px 14px;
  border: 1px solid rgba(238, 47, 56, 0.2);
  border-radius: 999px;
  color: #9f1239;
  background: rgba(255, 241, 242, 0.9);
  white-space: nowrap;
}

.matter-upload-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 28px 0;
}

.matter-upload-tabs button {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 22px;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.matter-upload-tabs button:hover,
.matter-upload-tabs button.active {
  transform: translateY(-1px);
  color: #87121b;
  border-color: rgba(238, 47, 56, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 233, 236, 0.9));
  box-shadow: 0 18px 36px rgba(190, 31, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.matter-upload-tabs .material-symbols-rounded {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #ff4b55, #b91623);
}

.matter-upload-tabs b {
  text-align: left;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matter-upload-tabs small {
  min-width: 32px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #87121b;
  background: rgba(255, 241, 242, 0.92);
  font-weight: 900;
}

.matter-upload-panels {
  max-height: min(760px, calc(96vh - 270px));
  overflow: auto;
  padding: 18px 28px;
}

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

.matter-tab-panel.active {
  display: block;
}

.matter-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 12px;
}

.matter-panel-title strong {
  color: #87121b;
  font-size: 18px;
}

.matter-panel-title small {
  color: #6b7280;
  font-weight: 750;
}

.matter-upload-list {
  display: grid;
  gap: 14px;
}

.matter-upload-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(180px, 0.9fr) minmax(240px, 1.1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(238, 47, 56, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 248, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.matter-upload-row strong {
  color: #87121b;
  font-size: 15px;
  font-weight: 850;
}

.matter-upload-row small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 750;
}

.matter-upload-row input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(238, 47, 56, 0.16);
  border-radius: 14px;
  color: #242428;
  background: rgba(255, 255, 255, 0.94);
}

.matter-requirement-card {
  padding: 16px;
  border: 1px solid rgba(238, 47, 56, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 248, 0.9));
  box-shadow: 0 16px 38px rgba(120, 25, 34, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.matter-requirement-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.matter-requirement-head strong {
  display: block;
  color: #87121b;
  font-size: 17px;
  font-weight: 900;
}

.matter-requirement-head small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 750;
}

.matter-requirement-head > span {
  padding: 7px 11px;
  border-radius: 999px;
  color: #14532d;
  background: rgba(220, 252, 231, 0.9);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.matter-file-stack {
  display: grid;
  gap: 9px;
}

.matter-file-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.matter-file-line .material-symbols-rounded {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #9f1239;
  background: rgba(255, 241, 242, 0.95);
}

.matter-file-line input[type="file"] {
  width: 100%;
  color: #242428;
  font-weight: 750;
}

.matter-file-remove {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #737373, #3f3f46);
  font-weight: 900;
}

.matter-add-row-btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 12px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #87121b;
  background: rgba(255, 241, 242, 0.96);
  border: 1px solid rgba(238, 47, 56, 0.16);
  font-size: 12px;
  font-weight: 900;
}

.matter-add-row-btn .material-symbols-rounded {
  font-size: 17px;
}

.matter-empty {
  padding: 28px;
  border: 1px dashed rgba(238, 47, 56, 0.24);
  border-radius: 20px;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.64);
  text-align: center;
  font-weight: 800;
}

.matter-upload-status {
  min-height: 18px;
  margin: 0 28px 18px !important;
  color: #87121b !important;
  font-size: 13px;
  font-weight: 800;
}

.matter-upload-actions {
  padding: 18px 28px 24px;
  border-top: 1px solid rgba(238, 47, 56, 0.12);
  background: rgba(255, 255, 255, 0.42);
}

.software-alert-btn.grey {
  color: #303034;
  background: linear-gradient(135deg, #f5f5f6, #d7d7dc);
  box-shadow: 0 14px 28px rgba(80, 80, 86, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body.theme-night .matter-upload-row,
body.theme-indigo.theme-night .matter-upload-row {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(51, 65, 85, 0.88));
}

body.theme-night .matter-upload-card,
body.theme-indigo.theme-night .matter-upload-card {
  background:
    radial-gradient(circle at 16% 0%, rgba(51, 65, 85, 0.92), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
}

body.theme-night .matter-upload-hero,
body.theme-indigo.theme-night .matter-upload-hero,
body.theme-night .matter-upload-actions,
body.theme-indigo.theme-night .matter-upload-actions {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.28);
}

body.theme-night .matter-upload-tabs button,
body.theme-indigo.theme-night .matter-upload-tabs button,
body.theme-night .matter-requirement-card,
body.theme-indigo.theme-night .matter-requirement-card,
body.theme-night .matter-file-line,
body.theme-indigo.theme-night .matter-file-line {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.84));
}

body.theme-night .matter-upload-tabs button.active,
body.theme-night .matter-upload-tabs button:hover,
body.theme-indigo.theme-night .matter-upload-tabs button.active,
body.theme-indigo.theme-night .matter-upload-tabs button:hover {
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.34);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(37, 99, 235, 0.2));
}

body.theme-night .matter-panel-title strong,
body.theme-night .matter-requirement-head strong,
body.theme-indigo.theme-night .matter-panel-title strong,
body.theme-indigo.theme-night .matter-requirement-head strong {
  color: #f8fafc;
}

body.theme-night .matter-panel-title small,
body.theme-night .matter-requirement-head small,
body.theme-indigo.theme-night .matter-panel-title small,
body.theme-indigo.theme-night .matter-requirement-head small {
  color: #cbd5e1;
}

body.theme-night .matter-file-line input[type="file"],
body.theme-indigo.theme-night .matter-file-line input[type="file"] {
  color: #f8fafc;
}

body.theme-night .matter-upload-row strong,
body.theme-indigo.theme-night .matter-upload-row strong {
  color: #f8fafc;
}

body.theme-night .matter-upload-row small,
body.theme-indigo.theme-night .matter-upload-row small {
  color: #cbd5e1;
}

body.theme-night .matter-upload-row input[type="file"],
body.theme-indigo.theme-night .matter-upload-row input[type="file"] {
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.26);
}

@media (max-width: 760px) {
  .matter-upload-hero,
  .matter-upload-tabs {
    grid-template-columns: 1fr;
  }

  .matter-upload-panels {
    max-height: min(700px, calc(96vh - 360px));
  }

  .matter-upload-row {
    grid-template-columns: 1fr;
  }
}

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

.filters input,
.filters select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.filters input:focus,
.filters select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.top-actions input:focus,
.bulk-shared input:focus,
.bulk-table input:focus,
.bulk-table select:focus {
  outline: none;
  border-color: rgba(238, 47, 56, 0.42);
  background: #fff;
  box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.smart-dropdown {
  position: fixed;
  z-index: 40;
  max-height: 310px;
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(90, 90, 94, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(242, 242, 244, 0.84));
  box-shadow: 0 22px 52px rgba(22, 22, 24, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(150%);
  animation: dropdownBloom 0.22s ease both;
}

.smart-option {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 11px;
  color: #3d3d42;
  text-align: left;
  background: transparent;
  font-size: 13px;
  font-weight: 560;
  transition: transform 0.22s ease, color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.smart-option + .smart-option {
  margin-top: 3px;
}

.smart-option:hover,
.smart-option.active {
  color: rgba(255, 255, 255, 0.96);
  background: linear-gradient(135deg, rgba(255, 91, 101, 0.94), rgba(187, 24, 34, 0.96));
  box-shadow: 0 12px 22px rgba(190, 31, 40, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transform: translateY(-1px) scale(1.012);
}

.smart-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes dropdownBloom {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(280px, 0.58fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}

.dashboard-side-metrics {
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 0;
}

.dashboard-side-metrics .metric {
  min-height: 132px;
}

.dashboard-comparison-panel {
  overflow: hidden;
  min-height: 590px;
  border-color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 252, 0.8)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.09), transparent 38%);
}

.dashboard-comparison-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 22px;
  border-bottom: 1px solid rgba(60, 64, 72, 0.1);
}

.dashboard-comparison-head h3 {
  margin: 0;
  color: #252529;
  font-size: 25px;
  font-weight: 780;
}

.dashboard-comparison-head p {
  margin: 5px 0 0;
  color: #77777d;
  font-size: 13px;
  font-weight: 620;
}

.dashboard-chart-modes {
  display: inline-flex;
  padding: 5px;
  border: 1px solid rgba(159, 31, 40, 0.14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 242, 244, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(238, 47, 56, 0.06);
}

.dashboard-chart-modes button {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  color: #7f1c25;
  background: transparent;
  font-size: 12px;
  font-weight: 760;
}

.dashboard-chart-modes button.active {
  color: #fff;
  background: linear-gradient(135deg, #ff4c58, #b8202b);
  box-shadow: 0 10px 24px rgba(238, 47, 56, 0.22);
}

.dashboard-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  padding: 18px 22px 4px;
  color: #303036;
  font-size: 14px;
  font-weight: 760;
}

.dashboard-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-chart-legend i {
  width: 16px;
  height: 9px;
  border-radius: 999px;
}

.dashboard-chart-legend i.invoice {
  background: #3f7fff;
}

.dashboard-chart-legend i.payable {
  background: #f5a623;
}

.dashboard-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 22px 22px;
}

.dashboard-comparison-svg {
  display: block;
  width: 100%;
  height: 430px;
}

.dashboard-comparison-svg line {
  stroke: rgba(70, 75, 86, 0.18);
  stroke-dasharray: 2 3;
}

.dashboard-comparison-svg text {
  fill: #63666f;
  font-size: 13px;
  font-weight: 650;
}

.dashboard-comparison-svg .x-label {
  text-anchor: middle;
  fill: #7c7f88;
  font-size: 12px;
}

.dashboard-comparison-svg .area {
  stroke: none;
}

.dashboard-comparison-svg .area.invoice {
  fill: url(#invoiceAreaGradient);
}

.dashboard-comparison-svg .area.payable {
  fill: url(#payableAreaGradient);
}

.dashboard-comparison-svg .line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-comparison-svg .line.invoice {
  stroke: #3f7fff;
  filter: drop-shadow(0 8px 14px rgba(63, 127, 255, 0.18));
}

.dashboard-comparison-svg .line.payable {
  stroke: #f5a623;
  filter: drop-shadow(0 8px 14px rgba(245, 166, 35, 0.18));
}

.metric,
.panel,
.report-card,
.doc-box {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(135%);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
  text-align: left;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(238, 47, 56, 0));
}

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

.metric strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 9px;
  font-size: 28px;
  font-weight: 820;
  letter-spacing: 0;
}

.metric em {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 5px;
  color: #77777c;
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.metric em small {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #7b1620;
  background: rgba(255, 230, 233, 0.86);
  font-size: 10px;
  font-weight: 760;
  vertical-align: middle;
}

.metric.metric-graph,
.metric.metric-warning,
.metric.metric-upcoming-mrv {
  cursor: pointer;
}

.metric-sparkline {
  position: absolute;
  right: 16px;
  bottom: 11px;
  left: 46%;
  height: 34px;
  opacity: 0.74;
  pointer-events: none;
}

.metric-sparkline polyline {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 12px rgba(238, 47, 56, 0.14));
}

.metric-sparkline.red polyline {
  stroke: #d12831;
}

.metric-sparkline.grey polyline {
  stroke: #6f7277;
}

.metric-warning {
  border-color: rgba(166, 113, 10, 0.54);
  background:
    linear-gradient(180deg, rgba(255, 251, 227, 0.96), rgba(255, 242, 176, 0.8)),
    radial-gradient(circle at 86% 18%, rgba(226, 166, 36, 0.18), transparent 34%);
  box-shadow: 0 22px 54px rgba(166, 113, 10, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.metric-warning::before {
  background: linear-gradient(90deg, #d49a1f, rgba(212, 154, 31, 0));
}

.metric-warning span,
.metric-warning em {
  position: relative;
  z-index: 1;
  color: #75500c;
}

.metric-warning strong {
  color: #5f3d00;
}

.metric-warning em {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.metric-warning:hover {
  border-color: rgba(166, 113, 10, 0.72);
  transform: translateY(-1px);
}

.metric-upcoming-mrv::before {
  background: linear-gradient(90deg, #ee2f38, rgba(100, 116, 139, 0.15));
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
}

.task-panel {
  min-height: 640px;
  color: #2d2d30;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(247, 247, 249, 0.78)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.1), transparent 36%);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 74px rgba(35, 35, 38, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.task-panel .panel-head {
  border-bottom-color: rgba(238, 47, 56, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 242, 244, 0.44));
}

.task-panel .panel-head h3 {
  color: #a71924;
  font-size: 25px;
  font-weight: 620;
}

.client-contribution-panel {
  overflow: hidden;
  min-height: 640px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(247, 247, 249, 0.78)),
    radial-gradient(circle at top left, rgba(238, 47, 56, 0.08), transparent 34%);
}

.client-contribution-panel .panel-head {
  align-items: flex-start;
  border-bottom-color: rgba(238, 47, 56, 0.08);
}

.client-contribution-panel .panel-head p {
  margin: 5px 0 0;
  color: #77777d;
  font-size: 12px;
}

.client-contribution-panel .panel-head p strong {
  color: #2d2d30;
}

.client-contribution-chart {
  display: grid;
  gap: 13px;
  max-height: 590px;
  overflow: auto;
  padding: 18px;
}

.client-contribution-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.05fr) minmax(110px, 1.3fr) minmax(96px, 0.65fr);
  gap: 12px;
  align-items: center;
}

.client-contribution-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.client-contribution-name span {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #8f161f;
  background: #fff0f2;
  font-size: 11px;
  font-weight: 760;
}

.client-contribution-name strong {
  overflow: hidden;
  color: #333337;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-contribution-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(48, 48, 52, 0.08), rgba(48, 48, 52, 0.04));
  box-shadow: inset 0 1px 2px rgba(35, 35, 38, 0.08);
}

.client-contribution-track i {
  display: block;
  width: max(3%, var(--bar));
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #a71924, #ee2f38 62%, #ff7a82),
    radial-gradient(circle at left, rgba(255, 255, 255, 0.5), transparent 44%);
  box-shadow: 0 7px 16px rgba(238, 47, 56, 0.22);
}

.client-contribution-value {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.client-contribution-value strong {
  color: #9e1721;
  font-size: 13px;
  font-weight: 780;
}

.client-contribution-value span {
  color: #7a7a80;
  font-size: 11px;
  font-weight: 560;
}

.task-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(238, 47, 56, 0.08);
  background: rgba(255, 255, 255, 0.36);
}

.task-add-row input,
.task-add-row select,
.task-assign {
  min-height: 42px;
  border: 1px solid rgba(190, 31, 40, 0.18);
  border-radius: 12px;
  color: #303034;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 243, 245, 0.78)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 10px 22px rgba(190, 31, 40, 0.06);
  padding: 8px 11px;
}

.task-add-row input::placeholder {
  color: #9b9ba0;
}

.task-add-row label {
  display: grid;
  gap: 5px;
  color: #8b1e28;
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.task-add-row select,
.task-assign {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 243, 245, 0.78)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(45deg, transparent 50%, #aa1f29 50%),
    linear-gradient(135deg, #aa1f29 50%, transparent 50%);
  background-position: 0 0, 0 0, calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: auto, auto, 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.task-list-shell {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.task-bucket h4 {
  margin: 0 0 10px;
  color: #a71924;
  font-size: 20px;
  font-weight: 760;
}

.task-empty-line {
  margin: 0 0 4px;
  color: #8a8a8f;
}

.task-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 150px auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  margin-bottom: 8px;
  padding: 9px 10px;
  border-radius: 13px;
  border: 1px solid rgba(238, 47, 56, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 244, 246, 0.52));
  transition: transform 0.18s ease, background 0.18s ease;
}

.task-row:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 235, 238, 0.76));
  transform: translateY(-1px);
}

.task-row:not(.done) {
  grid-template-columns: 32px minmax(0, 1fr) auto 150px;
}

.task-row.done {
  opacity: 0.72;
}

.task-check {
  width: 25px;
  height: 25px;
  border: 2px solid rgba(190, 31, 40, 0.36);
  border-radius: 999px;
  background: transparent;
}

.task-row.done .task-check {
  background: linear-gradient(135deg, #57cc81, #17804b);
  border-color: transparent;
}

.task-main strong {
  display: block;
  overflow: hidden;
  color: #2d2d30;
  font-size: 16px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-main span {
  display: block;
  margin-top: 3px;
  color: #77777b;
  font-size: 12px;
}

.task-clock {
  min-width: 38px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(238, 75, 84, 0.9), rgba(168, 24, 34, 0.96));
  font-size: 0;
}

.task-clock::before {
  content: "Clock";
  font-size: 12px;
  font-weight: 760;
}

.task-assign {
  min-height: 34px;
  font-size: 12px;
}

.task-delete {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(166, 31, 40, 0.18);
  border-radius: 999px;
  color: #8f1b25;
  background: linear-gradient(145deg, rgba(255, 246, 247, 0.96), rgba(255, 226, 230, 0.78));
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 10px 20px rgba(238, 47, 56, 0.08);
}

.task-delete:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff4b56, #b8202b);
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.36));
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 780;
}

.panel-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

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

th {
  color: #555558;
  background: rgba(247, 247, 248, 0.88);
  font-weight: 760;
}

th small {
  display: block;
  margin-top: 2px;
  color: #77777b;
  font-size: 11px;
  font-weight: 520;
  line-height: 1.15;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(238, 47, 56, 0.035);
}

td.actions {
  white-space: nowrap;
}

.mini-btn {
  margin-right: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--accent-dark);
  background: rgba(238, 47, 56, 0.1);
  font-size: 13px;
  font-weight: 720;
}

.mini-btn.danger-link {
  color: var(--bad);
  background: #fff0f1;
}

.mini-btn.ro-action-btn,
.mini-btn.ro-action-btn.danger-link {
  color: #242424;
  background: rgba(45, 45, 48, 0.08);
  border: 1px solid rgba(45, 45, 48, 0.08);
  font-weight: 560;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  transition: transform 0.5s ease, background 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}

.mini-btn.ro-action-btn:hover,
.mini-btn.ro-action-btn.danger-link:hover {
  color: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.42);
  background: linear-gradient(135deg, rgba(249, 94, 101, 0.92) 0%, rgba(190, 31, 40, 0.94) 100%);
  box-shadow: 0 12px 24px rgba(190, 31, 40, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transform: translateY(-1px) scale(1.045);
}

.mini-btn.ro-action-btn.mini-btn-warning-pulse,
.mini-btn.ro-action-btn.mini-btn-warning-pulse:hover {
  color: #6b3f00;
  border-color: rgba(196, 135, 20, 0.34);
  background: linear-gradient(135deg, rgba(255, 238, 143, 0.96), rgba(230, 176, 45, 0.9));
  box-shadow: 0 12px 24px rgba(218, 165, 32, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.74);
  animation: yellowWarningPulse 1.15s ease-in-out infinite alternate;
}

.mini-btn.ro-action-btn.mini-btn-warning-pulse:hover {
  transform: translateY(-1px) scale(1.045);
}

.mini-btn.ro-action-btn.ro-mail-btn {
  width: 38px;
  min-width: 38px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}

.mini-btn.ro-action-btn.ro-mail-btn .material-symbols-rounded {
  font-size: 19px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 520, "GRAD" 0, "opsz" 24;
}

.rate-warning-text {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(196, 135, 20, 0.32);
  border-radius: 999px;
  color: #6b3f00;
  background: linear-gradient(135deg, rgba(255, 244, 181, 0.88), rgba(244, 211, 94, 0.58));
  font-size: 12px;
  font-weight: 760;
}

@keyframes yellowWarningPulse {
  from {
    filter: saturate(0.94) brightness(1);
    box-shadow: 0 8px 20px rgba(218, 165, 32, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  to {
    filter: saturate(1.14) brightness(1.05);
    box-shadow: 0 14px 30px rgba(218, 165, 32, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 99px;
  color: var(--accent-dark);
  background: var(--soft);
  font-size: 12px;
  font-weight: 780;
}

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

.ro-group-panel {
  overflow: hidden;
  border: 1px solid rgba(80, 80, 84, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 248, 249, 0.82) 58%, rgba(232, 232, 234, 0.58) 100%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px) saturate(135%);
}

.ro-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 15px 18px;
  color: #232326;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84) 0%, rgba(246, 246, 247, 0.74) 58%, rgba(230, 230, 232, 0.48) 100%);
  border-bottom: 1px solid rgba(80, 80, 84, 0.1);
  transition: background 0.5s ease, transform 0.5s ease;
}

.ro-group-head:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 248, 249, 0.82) 58%, rgba(229, 229, 231, 0.56) 100%);
}

.ro-group-head span {
  font-size: 17px;
  font-weight: 520;
}

.ro-group-head strong {
  min-width: 74px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #333337;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(80, 80, 84, 0.12);
  font-weight: 560;
}

.ro-group-head mark {
  padding: 5px 11px;
  border: 1px solid rgba(184, 28, 37, 0.22);
  border-radius: 999px;
  color: #a71923;
  background:
    linear-gradient(135deg, rgba(255, 236, 239, 0.95), rgba(255, 207, 213, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.ro-group-head em {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #1f1f22;
  font-style: normal;
  font-weight: 560;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(80, 80, 84, 0.12);
}

.ro-group-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-8px);
  transition: grid-template-rows 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

.ro-group-body > div {
  min-height: 0;
  overflow: hidden;
}

.ro-group-panel.open .ro-group-body {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

.ro-series-gap-row td {
  padding: 5px 12px;
  background: transparent;
}

.ro-series-gap-strip {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 28px;
  color: #fff;
}

.ro-series-gap-strip span {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 76, 88, 0), rgba(190, 31, 40, 0.78), rgba(255, 76, 88, 0));
  transform: translateY(-50%);
}

.ro-series-gap-strip strong {
  position: relative;
  z-index: 1;
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4a55, #a9141e);
  color: #fff;
  font-size: 11px;
  font-weight: 760;
  box-shadow: 0 10px 22px rgba(190, 31, 40, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.ro-series-gap-strip em {
  position: absolute;
  right: 16px;
  top: 50%;
  color: rgba(140, 18, 26, 0.72);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
  transform: translateY(-50%);
}

input[data-ro-number-locked] {
  color: #4a3032;
  background: linear-gradient(135deg, rgba(244, 244, 245, 0.96), rgba(230, 230, 232, 0.86));
  border-color: rgba(80, 80, 84, 0.14);
  cursor: not-allowed;
}

.status.warn {
  color: var(--warn);
  background: #fff4df;
}

.status.bad {
  color: var(--bad);
  background: #fae9e7;
}

.ro-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
  transform: rotate(-1deg);
  box-shadow: 0 8px 18px rgba(190, 31, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.ro-stamp.shifted {
  color: #a21620;
  background: linear-gradient(135deg, rgba(255, 246, 247, 0.96), rgba(255, 214, 218, 0.72));
  border: 1px solid rgba(190, 31, 40, 0.18);
}

.ro-stamp.cancelled {
  min-height: 34px;
  padding: 6px 14px;
  color: #fff;
  background: linear-gradient(135deg, rgba(239, 62, 72, 0.96), rgba(156, 18, 27, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.36);
  font-size: 13px;
  font-weight: 780;
  box-shadow: 0 12px 24px rgba(160, 23, 32, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.letter-maker-panel {
  margin-bottom: 18px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(247, 247, 248, 0.76));
}

.letter-maker-panel label {
  display: grid;
  gap: 8px;
  color: #2b2b2e;
  font-size: 13px;
  font-weight: 560;
}

.letter-maker-panel input,
.letter-maker-panel textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(104, 104, 110, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 246, 248, 0.78));
  color: #2c2c30;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 24px rgba(28, 28, 32, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.letter-maker-panel textarea {
  resize: vertical;
}

.letter-maker-panel input:focus,
.letter-maker-panel textarea:focus {
  outline: none;
  border-color: rgba(238, 47, 56, 0.42);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.letter-date-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.letter-ro-jump {
  min-width: 240px;
}

.letter-date-row input {
  max-width: 220px;
}

.letter-date-list {
  min-height: 34px;
  margin-bottom: 14px;
}

.letter-body-text {
  margin-top: 14px;
  color: #252529;
  font-size: 13px;
  line-height: 1.58;
}

.letter-body-text p {
  margin: 0 0 10px;
}

.letter-heading-block {
  margin: 8px 0 10px;
  text-align: center;
  color: #8f161f;
}

.letter-heading-block h3 {
  margin: 0 0 2px;
  color: #8f161f;
  font-size: 22px;
  font-weight: 760;
}

.letter-heading-block div {
  color: #8f161f;
  font-size: 12px;
  font-weight: 560;
}

.letter-subject {
  margin: 10px 0 12px;
  color: #242428;
  font-size: 13px;
  line-height: 1.5;
}

.letter-note {
  color: #343438;
  font-size: 10.5px;
  line-height: 1.42;
}

.letter-note strong {
  display: block;
  margin-bottom: 5px;
  color: #8f161f;
  font-size: 11px;
}

.letter-note ul {
  margin: 0;
  padding-left: 16px;
}

.letter-note li {
  margin-bottom: 4px;
}

.shift-highlight {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 8px;
  color: #8e121b;
  background: rgba(238, 47, 56, 0.08);
  border: 1px solid rgba(238, 47, 56, 0.14);
  font-weight: 650;
}

.revert-shift-btn {
  color: #704809;
  border: 1px solid rgba(154, 104, 15, 0.36);
  background: linear-gradient(135deg, rgba(255, 248, 217, 0.96), rgba(245, 203, 83, 0.84));
  box-shadow: 0 12px 24px rgba(154, 104, 15, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.status.good {
  color: var(--good);
  background: #e8f5ee;
}

.empty {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}

.empty h3 {
  margin: 0 0 6px;
  color: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 24, 22, 0.58);
}

.modal.open {
  display: grid;
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(24px) saturate(140%);
}

.modal.workspace-modal {
  padding: 16px;
}

body:not(.sidebar-collapsed) .modal.workspace-modal {
  left: 304px;
  width: calc(100vw - 304px);
}

body.sidebar-collapsed .modal.workspace-modal {
  left: 98px;
  width: calc(100vw - 98px);
}

.modal.workspace-modal .modal-panel {
  width: min(1440px, 100%);
  height: calc(100vh - 32px);
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal.workspace-modal .modal-head {
  position: relative;
}

.modal.workspace-modal .form-grid {
  overflow: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  padding-bottom: 26px;
}

.modal.rate-card-modal {
  padding: 22px;
  z-index: 2350;
}

.modal.rate-card-modal .modal-panel {
  width: 88vw;
  max-width: 1540px;
  min-width: min(1120px, calc(100vw - 44px));
  height: 90vh;
  max-height: 92vh;
}

.modal.bulk-size-modal {
  padding: 24px;
}

.modal.bulk-size-modal .modal-panel {
  width: 60vw;
  min-width: min(860px, calc(100vw - 48px));
  min-height: 50vh;
  max-height: 86vh;
}

.modal.bulk-size-modal .form-grid {
  display: block;
  padding: 28px;
}

.modal.rate-card-modal .form-grid {
  display: block;
  height: calc(90vh - 91px);
  overflow: auto;
  padding: 30px;
  background: transparent;
}

.modal.rate-card-modal .form-actions {
  display: none;
}

.modal.rate-card-modal .rate-card-upload {
  width: 100%;
  grid-template-columns: 1fr;
  padding: 28px;
  border-radius: 22px;
}

@media (max-width: 1180px) {
  .modal.rate-card-modal .modal-panel {
    width: calc(100vw - 36px);
    min-width: 0;
  }

  .modal.rate-card-modal .rate-card-upload {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .modal.rate-card-modal {
    padding: 12px;
  }

  .modal.rate-card-modal .form-grid {
    padding: 16px;
  }

  .modal.rate-card-modal .rate-card-upload {
    grid-template-columns: 1fr;
    padding: 18px;
  }
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.modal-head h3 {
  margin: 3px 0 0;
}

.modal-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--ink);
  background: #f1f1f2;
  font-weight: 800;
}

.modal-restore {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 11;
  display: none;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff4650 0%, var(--accent) 52%, var(--accent-dark) 100%);
  box-shadow: 0 18px 38px rgba(238, 47, 56, 0.32);
  font-weight: 760;
}

.modal-restore.show {
  display: inline-flex;
}

.cloud-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 72% 18%, rgba(238, 47, 56, 0.2), transparent 28%),
    rgba(20, 20, 22, 0.52);
  backdrop-filter: blur(18px);
  overflow: hidden;
  perspective: 1300px;
}

.cloud-gate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 72% 18%, rgba(238, 47, 56, 0.18), transparent 30%),
    radial-gradient(circle at 18% 0%, rgba(70, 70, 73, 0.14), transparent 28%),
    linear-gradient(135deg, #fbfbfc 0%, #f2f2f4 52%, #ececef 100%);
  overflow: hidden;
  perspective: 1300px;
}

.login-quote-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-quote {
  position: absolute;
  max-width: min(460px, 31vw);
  color: rgba(125, 20, 27, 0.34);
  text-shadow: 0 18px 42px rgba(125, 20, 27, 0.12);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  animation: quoteFloat 4s ease-in-out both;
}

.login-quote b {
  display: block;
  font-size: clamp(27px, 3.65vw, 62px);
  line-height: 0.98;
  font-weight: 780;
  letter-spacing: 0;
}

.login-quote em {
  display: block;
  margin-top: 12px;
  color: rgba(55, 55, 58, 0.36);
  font-size: clamp(12px, 1vw, 16px);
  font-style: normal;
  font-weight: 740;
  text-transform: uppercase;
}

.login-quote.q1 {
  left: 3.8vw;
  top: 7vh;
}

.login-quote.q2 {
  right: 3.8vw;
  top: 8vh;
  text-align: right;
  animation-delay: 0.14s;
}

.login-quote.q3 {
  left: 5vw;
  bottom: 6vh;
  animation-delay: 0.28s;
}

.login-quote.q4 {
  right: 5vw;
  bottom: 6vh;
  text-align: right;
  animation-delay: 0.42s;
}

@keyframes quoteFloat {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
    filter: blur(5px);
  }

  18%,
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-14px) scale(1.03);
    filter: blur(4px);
  }
}

@media (max-width: 760px) {
  .estimate-page-form {
    grid-template-columns: 1fr;
  }

  .login-quote {
    max-width: 72vw;
    color: rgba(125, 20, 27, 0.13);
  }

  .login-quote b {
    font-size: clamp(24px, 9vw, 44px);
  }

  .login-quote.q2,
  .login-quote.q4 {
    right: 4vw;
  }

}

.cloud-gate-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  justify-items: center;
  width: min(520px, 100%);
  padding: 42px 38px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.46)),
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.92), transparent 32%),
    radial-gradient(circle at 100% 100%, rgba(238, 47, 56, 0.08), transparent 38%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -24px 44px rgba(255, 255, 255, 0.22),
    0 34px 90px rgba(20, 20, 22, 0.16);
  text-align: center;
  backdrop-filter: blur(30px) saturate(150%);
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.cloud-gate-card.is-flipping {
  animation: gateCardFlipOut 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes gateCardFlipOut {
  0% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
    filter: blur(0);
  }

  54% {
    opacity: 0.94;
    transform: rotateY(-74deg) scale(0.985);
    filter: blur(0.4px);
  }

  100% {
    opacity: 0;
    transform: rotateY(-112deg) scale(0.96);
    filter: blur(4px);
  }
}

.cloud-gate-card::before,
.cloud-gate-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 33px;
  pointer-events: none;
}

.cloud-gate-card::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.86), transparent 24%, rgba(255, 255, 255, 0.24) 54%, transparent 76%),
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.74), transparent 22%);
  opacity: 0.74;
}

.cloud-gate-card::after {
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(45, 45, 48, 0.4) 0 0.7px, transparent 0.8px),
    radial-gradient(circle at 72% 44%, rgba(45, 45, 48, 0.28) 0 0.6px, transparent 0.7px);
  background-size: 13px 13px, 17px 17px;
  mix-blend-mode: multiply;
}

.cloud-gate-card > * {
  position: relative;
  z-index: 1;
}

.cloud-gate-card img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.cloud-gate-card p {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cloud-gate-card h1 {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(28px, 5vw, 42px);
  font-family: "Roboto", "Arial", "Segoe UI", sans-serif;
  font-weight: 300;
  text-transform: capitalize;
}

.cloud-gate-card span {
  color: var(--muted);
  font-size: 14px;
}

.cloud-gate-card .primary {
  min-width: 180px;
  color: #fff;
  background:
    linear-gradient(135deg, #f45a61 0%, #ee2f38 52%, #ba2028 100%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.32), transparent 42%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 18px 34px rgba(238, 47, 56, 0.28);
  font-weight: 360;
}

.cloud-login-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(452px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 26px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 116, 122, 0.72) 0%, rgba(232, 53, 62, 0.74) 48%, rgba(152, 24, 31, 0.78) 100%),
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.42), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.18), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -22px 40px rgba(110, 10, 18, 0.16),
    0 34px 90px rgba(120, 20, 28, 0.34);
  backdrop-filter: blur(30px) saturate(155%);
  overflow: hidden;
  transform-style: preserve-3d;
  animation: loginCardFlipIn 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cloud-login-card.login-shake {
  animation: loginShake 0.46s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes loginCardFlipIn {
  0% {
    opacity: 0;
    transform: rotateY(104deg) scale(0.96);
    filter: blur(5px);
  }

  62% {
    opacity: 1;
    transform: rotateY(-7deg) scale(1.01);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes loginShake {
  0%,
  100% {
    transform: translateX(0);
  }

  18% {
    transform: translateX(-9px);
  }

  34% {
    transform: translateX(8px);
  }

  50% {
    transform: translateX(-6px);
  }

  66% {
    transform: translateX(5px);
  }

  82% {
    transform: translateX(-2px);
  }
}

.cloud-login-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 25px;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.55), transparent 26%, rgba(255, 255, 255, 0.18) 54%, transparent 72%),
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.34), transparent 18%);
  opacity: 0.82;
}

.cloud-login-card > * {
  position: relative;
  z-index: 1;
}

.cloud-login-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.cloud-login-card h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 360;
  letter-spacing: 0;
}

.cloud-login-card p,
.cloud-login-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 300;
}

.cloud-login-status {
  min-height: 20px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 300;
}

.cloud-login-card label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-family: "Arial", "Segoe UI", sans-serif;
  font-weight: 300;
}

.cloud-login-card input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 14px;
  padding: 10px 12px;
  color: #111113;
  background: rgba(255, 255, 255, 0.66);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px);
}

.cloud-login-card input:focus {
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.cloud-login-card .primary {
  min-height: 48px;
  color: rgba(125, 20, 27, 0.92);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.66)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 42%);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 34px rgba(120, 20, 28, 0.18);
  font-family: "Arial", "Segoe UI", sans-serif;
  font-weight: 300;
}

.cloud-login-fields {
  display: grid;
  gap: 14px;
}

.cloud-login-card.login-loading .cloud-login-fields,
.cloud-login-card.login-loading > p,
.cloud-login-card.login-loading .cloud-login-note {
  display: none;
}

.cloud-login-welcome {
  display: none;
  min-height: 190px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 22px;
  align-content: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.24), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 18px 36px rgba(95, 12, 20, 0.14);
  backdrop-filter: blur(20px);
}

.cloud-login-card.login-loading .cloud-login-welcome {
  display: grid;
  gap: 8px;
}

.cloud-login-welcome strong {
  color: #fff;
  font-family: "Roboto", "Arial", "Segoe UI", sans-serif;
  font-size: clamp(18px, 2.4vw, 25px);
  font-weight: 430;
  line-height: 1.22;
  letter-spacing: 0;
}

.cloud-login-welcome span {
  color: rgba(255, 255, 255, 0.9);
  font-family: "Roboto", "Arial", "Segoe UI", sans-serif;
  font-size: clamp(18px, 2.4vw, 25px);
  font-weight: 300;
  line-height: 1.22;
}

.cloud-login-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.cloud-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  color: #2b2b2e;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 44px rgba(20, 20, 22, 0.18);
  backdrop-filter: blur(14px);
}

.cloud-toast.error {
  color: #fff;
  background: linear-gradient(135deg, rgba(238, 47, 56, 0.94), rgba(186, 32, 40, 0.94));
}

.software-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 18, 20, 0.48);
  backdrop-filter: blur(14px) saturate(130%);
}

.software-alert-card {
  width: min(540px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 246, 247, 0.88));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.software-alert-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #ff4d56, #b71522);
  box-shadow: 0 16px 32px rgba(190, 31, 40, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  font-size: 24px;
  font-weight: 850;
}

.software-alert-copy span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
}

.software-alert-copy h3 {
  margin: 4px 0 8px;
  color: #1f1f22;
  font-size: 23px;
  font-weight: 760;
}

.software-alert-copy p {
  margin: 0;
  color: #4b4b50;
  line-height: 1.55;
}

.software-alert-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.software-alert-btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 14px;
  color: #fff;
  font-weight: 740;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.software-alert-btn:hover {
  transform: translateY(-1px);
}

.software-alert-btn.blue {
  background: linear-gradient(135deg, #2f7df1, #1751b8);
  box-shadow: 0 14px 28px rgba(47, 125, 241, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.software-alert-btn.red {
  background: linear-gradient(135deg, #ff4b55, #b91623);
  box-shadow: 0 14px 28px rgba(190, 31, 40, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.media-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.media-choice button {
  display: grid;
  gap: 4px;
  min-height: 92px;
  font-size: 18px;
}

.media-choice span {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.82;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: #4f4f52;
  font-size: 13px;
  font-weight: 720;
}

.form-grid label.full {
  grid-column: 1 / -1;
}

.vendor-mail-panel,
.vendor-subpaper-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 245, 246, 0.62)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.1), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 14px 34px rgba(35, 35, 35, 0.06);
}

.vendor-mail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vendor-mail-head h4 {
  margin: 0 0 4px;
  color: #8a1720;
  font-size: 15px;
}

.vendor-mail-head p {
  margin: 0;
  color: #777;
  font-size: 12px;
  font-weight: 560;
}

.vendor-mail-list,
.vendor-subpaper-list {
  display: grid;
  gap: 10px;
}

.vendor-mail-row,
.vendor-subpaper-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(175px, 0.65fr) minmax(240px, 1fr) 92px;
  gap: 14px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(120, 120, 126, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.vendor-subpaper-row {
  grid-template-columns: minmax(260px, 1fr) 120px;
}

.vendor-mail-row .is-hidden {
  display: none;
}

.vendor-mail-row .vendor-mail-remove {
  grid-column: 4;
  width: 100%;
  min-height: 44px;
  padding-inline: 12px;
  white-space: nowrap;
  justify-content: center;
}

.vendor-subpaper-row .vendor-subpaper-remove {
  width: 100%;
  min-height: 44px;
  padding-inline: 12px;
  white-space: nowrap;
  justify-content: center;
}

.vendor-mail-row label,
.vendor-subpaper-row label {
  min-width: 0;
}

.vendor-mail-row label[data-vendor-mail-client-wrap],
.vendor-mail-row label[data-vendor-mail-edition-wrap] {
  grid-column: 3;
}

.vendor-mail-row input,
.vendor-subpaper-row input {
  min-width: 0;
}

@media (max-width: 1180px) {
  .vendor-mail-row {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.75fr) 92px;
  }

  .vendor-mail-row label[data-vendor-mail-client-wrap],
  .vendor-mail-row label[data-vendor-mail-edition-wrap] {
    grid-column: 1 / -1;
  }

  .vendor-mail-row .vendor-mail-remove {
    grid-column: 3;
  }
}

@media (max-width: 760px) {
  .vendor-mail-row,
  .vendor-subpaper-row {
    grid-template-columns: 1fr;
  }

  .vendor-mail-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.estimate-page-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  column-gap: 22px;
  row-gap: 14px;
}

.estimate-page-form > .notice,
.estimate-page-form > .panel-head,
.estimate-page-form .estimate-builder,
.estimate-page-form .estimate-total-line,
.estimate-page-form .estimate-lock-row,
.estimate-page-form .estimate-two-row,
.estimate-page-form .estimate-three-row,
.estimate-page-form .estimate-spec-row,
.estimate-page-form label.full {
  grid-column: 1 / -1;
}

.estimate-page-form .release-date-picker {
  grid-column: auto;
}

.estimate-lock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  gap: 22px;
  align-items: start;
}

.estimate-lock-stack {
  display: grid;
  gap: 12px;
}

.estimate-two-row,
.estimate-three-row,
.estimate-spec-row {
  display: grid;
  gap: 18px;
  align-items: start;
}

.estimate-two-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.estimate-three-row {
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(280px, 1.4fr);
}

.estimate-spec-row {
  grid-template-columns: minmax(220px, 1.25fr) minmax(210px, 0.9fr) minmax(170px, 0.8fr) minmax(130px, 0.55fr) minmax(130px, 0.55fr);
}

.estimate-spec-row .compact-pair input {
  min-width: 0;
}

.estimate-size-selector {
  display: grid;
  gap: 7px;
}

.estimate-size-selector > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.estimate-size-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 44px;
  padding: 4px;
  border: 1px solid rgba(102, 102, 110, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 4px rgba(44, 44, 52, 0.08);
}

.estimate-size-toggle button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6a686f;
  box-shadow: none;
}

.estimate-size-toggle button.active.single {
  background: linear-gradient(135deg, #dff7e8, #bdeccf);
  color: #17663a;
  box-shadow: 0 7px 15px rgba(40, 150, 88, 0.14), inset 0 1px rgba(255, 255, 255, 0.8);
}

.estimate-size-toggle button.active.multiple {
  background: linear-gradient(135deg, #eee7ff, #ddd0ff);
  color: #5b21b6;
  box-shadow: 0 7px 15px rgba(109, 40, 217, 0.15), inset 0 1px rgba(255, 255, 255, 0.82);
}

.estimate-multiple-size-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
}

.estimate-multiple-size-field > button {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.24), inset 0 1px rgba(255, 255, 255, 0.35);
}

.estimate-multiple-size-field span {
  color: #5b21b6;
  font-size: 12px;
  font-weight: 700;
}

.estimate-size-overlay {
  position: fixed;
  inset: 0;
  z-index: 2450;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 21, 30, 0.5);
  backdrop-filter: blur(14px);
}

.estimate-size-dialog {
  width: min(1060px, 92vw);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(246, 244, 252, 0.97));
  box-shadow: 0 30px 90px rgba(22, 18, 40, 0.34);
}

.estimate-size-dialog > header,
.estimate-size-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
}

.estimate-size-dialog > header { border-bottom: 1px solid rgba(99, 102, 241, 0.14); }
.estimate-size-dialog > header span { color: #746f7e; font-size: 13px; }
.estimate-size-dialog > header h3 { margin: 2px 0 0; color: #4f46e5; }
.estimate-size-dialog > header > button { width: 42px; height: 42px; border: 0; border-radius: 50%; font-size: 24px; }
.estimate-size-dialog > footer { justify-content: flex-end; border-top: 1px solid rgba(99, 102, 241, 0.14); }
.estimate-size-dialog-body { max-height: calc(88vh - 158px); overflow: auto; padding: 22px 24px; }
.estimate-size-dialog-body > p:first-child { margin: 0 0 15px; color: #5d5866; }
.estimate-size-modal-rows { display: grid; gap: 10px; }
.estimate-size-modal-row {
  display: grid;
  grid-template-columns: 72px minmax(155px, 1fr) repeat(3, minmax(125px, 0.75fr)) 42px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}
.estimate-size-modal-row > strong { align-self: center; color: #4f46e5; }
.estimate-size-modal-row label { display: grid; gap: 6px; color: #4d4857; font-size: 12px; font-weight: 680; }
.estimate-size-modal-row input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid rgba(99, 102, 241, 0.17); border-radius: 12px; background: #fff; color: #27252d; }
.estimate-size-remove { width: 42px; height: 42px; border: 0; border-radius: 12px; color: #8c1820; font-size: 22px; }
.estimate-size-modal-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.estimate-size-modal-summary > div { display: flex; align-items: baseline; gap: 12px; padding: 10px 16px; border-radius: 999px; background: #ede9fe; color: #5b21b6; }
.estimate-size-modal-error { min-height: 20px; margin: 8px 0 0; color: #b4232c; font-weight: 680; }
.estimate-generate-ro-button { border-color: rgba(99, 102, 241, 0.3) !important; color: #4338ca !important; background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important; }

body.theme-night .estimate-size-toggle { border-color: rgba(145, 166, 198, 0.2); background: rgba(31, 45, 65, 0.9); }
body.theme-night .estimate-size-toggle button { color: #c7d4e4; }
body.theme-night .estimate-size-dialog { border-color: rgba(165, 157, 255, 0.2); background: linear-gradient(145deg, #1e293b, #172033); }
body.theme-night .estimate-size-dialog-body > p:first-child,
body.theme-night .estimate-size-modal-row label { color: #ced9e6; }
body.theme-night .estimate-size-modal-row { border-color: rgba(165, 157, 255, 0.2); background: rgba(31, 44, 64, 0.88); }
body.theme-night .estimate-size-modal-row input { border-color: rgba(165, 157, 255, 0.22); background: #27374e; color: #f8fbff; }

.estimate-page-form .release-date-picker.is-disabled {
  opacity: 0.48;
  filter: grayscale(0.2);
}

.estimate-page-form .release-date-picker.is-disabled input,
.estimate-page-form .release-date-picker.is-disabled button,
.estimate-page-form .release-date-picker.is-disabled .chip-list {
  pointer-events: none;
}

.estimate-page-form .estimate-builder {
  padding-top: 4px;
}

.estimate-page-form .table-wrap {
  margin-top: 2px;
}

.estimate-page-form .estimate-total-line {
  max-width: 360px;
  justify-self: end;
  width: 100%;
}

.estimate-doc .estimate-lines-table th,
.estimate-doc .estimate-lines-table td {
  font-size: 12px;
  vertical-align: top;
}

.estimate-doc .estimate-lines-table {
  table-layout: fixed;
  width: 100%;
}

.estimate-doc .estimate-col-publication {
  width: 31%;
}

.estimate-doc .estimate-col-edition {
  width: 18%;
}

.estimate-doc .estimate-col-package {
  width: 11%;
}

.estimate-doc .estimate-col-language {
  width: 9%;
}

.estimate-doc .estimate-col-rate-type {
  width: 9%;
}

.estimate-doc .estimate-col-rate {
  width: 16%;
}

.estimate-doc .estimate-col-discount {
  width: 9%;
}

.estimate-doc .estimate-col-amount {
  width: 15%;
}

.estimate-doc .estimate-lines-table.has-language .estimate-col-publication {
  width: 27%;
}

.estimate-doc .estimate-lines-table.has-language .estimate-col-edition {
  width: 15%;
}

.estimate-doc .estimate-lines-table.has-language .estimate-col-package {
  width: 9%;
}

.estimate-doc .estimate-lines-table.has-language .estimate-col-language {
  width: 10%;
}

.estimate-doc .estimate-lines-table th,
.estimate-doc .estimate-lines-table td {
  padding-left: 7px;
  padding-right: 7px;
}

.estimate-doc .estimate-lines-table th:nth-child(3),
.estimate-doc .estimate-lines-table td:nth-child(3),
.estimate-doc .estimate-lines-table th:nth-child(4),
.estimate-doc .estimate-lines-table td:nth-child(4) {
  padding-left: 5px;
  padding-right: 5px;
}

.estimate-doc .estimate-lines-table th:nth-child(4),
.estimate-doc .estimate-lines-table td:nth-child(4) {
  font-size: 11.2px;
}

.estimate-doc .estimate-lines-table th:nth-last-child(-n + 3),
.estimate-doc .estimate-lines-table td:nth-last-child(-n + 3) {
  overflow-wrap: normal;
  word-break: normal;
}

.estimate-doc .estimate-lines-table th:last-child,
.estimate-doc .estimate-lines-table td:last-child {
  white-space: nowrap;
}

.estimate-doc .estimate-lines-table .estimate-total-row th,
.estimate-doc .estimate-lines-table .estimate-total-row td {
  color: #4a4a4d;
  font-weight: 800;
  background: rgba(238, 238, 240, 0.72);
}

.estimate-doc .estimate-lines-table .estimate-total-row.grand th,
.estimate-doc .estimate-lines-table .estimate-total-row.grand td {
  color: var(--accent-dark);
  border-top: 1px solid rgba(238, 47, 56, 0.34);
  border-bottom: 1px solid rgba(238, 47, 56, 0.34);
  background: rgba(238, 47, 56, 0.08);
}

.estimate-doc .estimate-lines-table .estimate-total-row.grand th {
  border-left: 1px solid rgba(238, 47, 56, 0.34);
}

.estimate-doc .estimate-lines-table .estimate-total-row.grand td {
  border-right: 1px solid rgba(238, 47, 56, 0.34);
}

.estimate-doc .estimate-lines-table .estimate-amount-words td {
  color: #7d121b;
  border: 1px solid rgba(238, 47, 56, 0.24);
  background: rgba(238, 47, 56, 0.045);
  font-size: 11.5px;
  font-weight: 620;
}

.estimate-notes {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 12px;
  background: rgba(238, 47, 56, 0.04);
  color: #3f3f42;
  font-size: 12.5px;
  line-height: 1.45;
}

.field-hint {
  color: #8b8b90;
  font-size: 11px;
  font-weight: 560;
}

.ro-last-used {
  margin-top: -3px;
  margin-bottom: 1px;
}

[data-ro-date-locked] {
  color: #5e5e62;
  background: linear-gradient(135deg, rgba(238, 238, 239, 0.96), rgba(222, 222, 224, 0.84));
  border-color: rgba(80, 80, 84, 0.16);
  cursor: not-allowed;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  opacity: 1;
}

.key-inline-input {
  margin-top: 8px;
}

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

.estimate-page-form .release-date-picker.full {
  grid-column: auto;
}

.form-section-title {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}

.select-add-row,
.compact-pair {
  display: grid;
  gap: 8px;
}

.select-add-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-pair {
  grid-template-columns: 1fr 1fr;
}

.addressed-edition-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.2fr) minmax(0, 0.8fr);
  gap: 16px;
  align-items: start;
}

.ro-calc-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(238, 47, 56, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 240, 241, 0.9), rgba(255, 255, 255, 0.72));
  box-shadow: var(--shadow-soft);
}

.ro-calc-box div {
  display: grid;
  gap: 3px;
}

.ro-calc-box span {
  color: var(--muted);
  font-size: 12px;
}

.ro-calc-box strong {
  font-size: 14px;
}

.form-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.form-grid input:disabled,
.form-grid textarea:disabled {
  color: #777;
  background: #ece8e0;
  cursor: not-allowed;
}

.picker-field {
  display: grid;
  gap: 8px;
}

.match-date-toggle {
  width: fit-content;
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(238, 47, 56, 0.2);
  border-radius: 999px;
  color: var(--accent-dark) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(238, 47, 56, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 8px 18px rgba(160, 25, 34, 0.08);
  font-size: 12px !important;
  font-weight: 650 !important;
}

.match-date-toggle input {
  width: 15px;
  height: 15px;
  min-height: 0;
  accent-color: var(--accent);
}

.matched-date-card {
  width: min(520px, calc(100vw - 34px));
}

.matched-date-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.matched-date-grid label {
  display: grid;
  gap: 7px;
  color: #4a4a4d;
  font-size: 13px;
  font-weight: 720;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(238, 47, 56, 0.1);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
}

.chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(238, 47, 56, 0.18);
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1;
}

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

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

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

.report-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.report-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(238, 47, 56, 0.08);
}

.report-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 780;
}

.report-card p {
  margin: 4px 0;
  color: var(--muted);
}

.statement-builder-panel {
  overflow: visible;
}

.statement-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
  padding: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,246,248,.7));
}

.statement-filter-grid.pro {
  grid-template-columns: minmax(320px, 1.9fr) minmax(260px, 1.35fr) minmax(150px, .8fr) minmax(170px, .9fr) minmax(170px, .9fr) minmax(170px, .9fr);
  align-items: end;
  padding: 22px 24px;
  gap: 16px;
  background:
    radial-gradient(circle at 8% 20%, rgba(255, 64, 86, .14), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,242,245,.82));
}

.statement-filter-grid.pro label {
  display: grid;
  gap: 7px;
  color: #7b1822;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.statement-filter-grid.pro input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(136, 23, 34, .16);
  border-radius: 16px;
  padding: 0 16px;
  color: #26262c;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(250,250,252,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 12px 26px rgba(117, 23, 33, .08);
}

.statement-filter-grid.pro input:focus {
  outline: none;
  border-color: rgba(238, 47, 62, .45);
  box-shadow: 0 0 0 4px rgba(255, 64, 86, .12), 0 16px 32px rgba(117, 23, 33, .12);
}

.statement-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.statement-actions strong {
  margin-right: auto;
  color: var(--danger-dark);
}

.statement-preview {
  padding: 0 18px 18px;
}

.statement-preview-empty {
  margin: 0 24px 24px;
  padding: 28px;
  border: 1px dashed rgba(136, 23, 34, .22);
  border-radius: 18px;
  color: #5f6069;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,247,248,.72));
  text-align: center;
}

.statement-preview-empty h3 {
  margin: 0 0 6px;
  color: #2b2b30;
}

.statement-group {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,.72);
}

.statement-group-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  color: #7b1822;
  background: linear-gradient(135deg, #fff, #f6f6f8);
  border-bottom: 1px solid var(--line);
}

.statement-group-head span {
  color: var(--muted);
  font-weight: 700;
}

.statement-pdf-export {
  position: fixed;
  left: -200vw;
  top: 0;
  width: 1120px;
  background: #fff;
  color: #111;
  z-index: -1;
}

.statement-pdf {
  padding: 8mm;
  font-family: Arial, sans-serif;
  color: #111;
  background: #fff;
}

.statement-pdf header {
  text-align: center;
  margin-bottom: 8px;
}

.statement-pdf h1 {
  margin: 4px 0;
  color: #8d111b;
  font-size: 18px;
  text-transform: uppercase;
}

.pdf-statement-group {
  margin-bottom: 10px;
}

.pdf-statement-group h3 {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 4px;
  padding: 5px 8px;
  font-size: 12px;
  color: #8d111b;
  border: 1px solid #efb9bf;
  border-radius: 6px;
  background: #fff5f6;
}

.statement-pdf table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.2px;
}

.statement-pdf th,
.statement-pdf td {
  padding: 3px 4px;
  border: 1px solid #d8d8d8;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.statement-total-row td {
  background: #fff3f4;
  color: #7b1822;
}

.statement-pdf th {
  color: #7b1822;
  background: #fff2f3;
}

.statement-pdf footer {
  margin-top: 8px;
  text-align: right;
  font-size: 13px;
}

.statement-pdf th:nth-child(1), .statement-pdf td:nth-child(1) { width: 4%; text-align: center; }
.statement-pdf th:nth-child(2), .statement-pdf td:nth-child(2) { width: 8%; }
.statement-pdf th:nth-child(3), .statement-pdf td:nth-child(3) { width: 6%; }
.statement-pdf th:nth-child(4), .statement-pdf td:nth-child(4) { width: 6%; }
.statement-pdf th:nth-child(5), .statement-pdf td:nth-child(5) { width: 7%; }
.statement-pdf th:nth-child(6), .statement-pdf td:nth-child(6) { width: 18%; font-weight: 700; }
.statement-pdf th:nth-child(7), .statement-pdf td:nth-child(7) { width: 12%; }
.statement-pdf th:nth-child(8), .statement-pdf td:nth-child(8) { width: 7%; }
.statement-pdf th:nth-child(9), .statement-pdf td:nth-child(9) { width: 10%; }
.statement-pdf th:nth-child(10), .statement-pdf td:nth-child(10) { width: 7%; text-align: right; }
.statement-pdf th:nth-child(11), .statement-pdf td:nth-child(11) { width: 7%; text-align: right; }
.statement-pdf th:nth-child(12), .statement-pdf td:nth-child(12) { width: 8%; text-align: right; }

.doc-box {
  padding: 24px;
  color: #202020;
  background: #fff;
}

.doc-box h3 {
  margin-top: 0;
  text-align: center;
  text-transform: uppercase;
}

.doc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}

.ro-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-right {
  margin-left: auto;
  justify-content: flex-end;
}

.ro-doc .doc-meta {
  padding: 10px 12px;
  border: 1px solid #cfd0d2;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f4f4f5;
}

.ro-doc .doc-meta div {
  color: #2d2d30;
  font-size: 15px;
  font-weight: 620;
}

.ro-doc .doc-meta strong {
  font-weight: 680;
}

.ro-meta-cancelled {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 10px;
  padding: 3px 10px;
  border: 1px solid rgba(190, 31, 40, 0.18);
  border-radius: 8px;
  color: #a1111b;
  background: #fff0f2;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  vertical-align: middle;
}

.doc-box pre {
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.55;
}

.signature-img {
  display: block;
  width: 260px;
  height: 118px;
  margin: -14px 0 -18px;
  object-fit: contain;
}

.letter-signature {
  display: grid;
  gap: 4px;
  justify-items: start;
  margin-top: 18px;
}

.letter-signature p {
  margin: 0 0 2px;
}

.letter-signature span {
  display: block;
}

.ro-doc {
  position: relative;
  max-width: 794px;
  margin: 0 auto;
  overflow: hidden;
}

.cancelled-ribbon {
  position: absolute;
  top: 22px;
  left: -44px;
  z-index: 4;
  width: 190px;
  padding: 9px 0;
  pointer-events: none;
  user-select: none;
  transform: rotate(-38deg);
  color: #fff;
  background: linear-gradient(135deg, #7f1018, #be1f28 54%, #7b0e16);
  box-shadow: 0 10px 24px rgba(126, 16, 24, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-size: 14px;
  font-weight: 760;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
}

.ro-doc > *:not(.cancelled-ribbon) {
  position: relative;
  z-index: 1;
}

.ro-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 18px;
  align-items: start;
  text-align: center;
}

.ro-title-text {
  padding-left: 130px;
}

.ro-title.has-branch-address .ro-title-text {
  justify-self: start;
  padding-left: 0;
  width: 465px;
  max-width: 100%;
}

.ro-title.has-branch-address .ro-title-text > strong {
  text-align: left;
}

.ro-office-address-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 7px;
  text-align: left;
}

.ro-office-address-block {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #dedee1;
  border-radius: 5px;
  background: #fafafa;
}

.ro-office-address-block > strong {
  display: block;
  color: #8f161f;
  font-size: 11px;
  font-weight: 760;
}

.ro-title .ro-office-address-block p {
  margin: 3px 0 0;
  color: #5e6065;
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ro-office-address-block p b {
  color: #3e4045;
  font-weight: 700;
}

.ro-logo {
  width: 106px;
  height: 106px;
  object-fit: contain;
  justify-self: end;
}

.ro-heading-block {
  margin: 8px 0 10px;
  text-align: center;
}

.ro-heading-block h3 {
  margin: 0 0 2px;
  color: #8f161f;
  font-size: 22px;
  font-weight: 760;
  text-transform: uppercase;
}

.ro-heading-block div {
  color: #4e4e54;
  font-size: 12px;
  font-weight: 560;
  text-transform: uppercase;
}

.ro-title-text > strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.ro-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.address-block {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #d6d6d8;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: #f7f7f8;
}

.ro-particulars {
  min-width: 0;
  margin-top: 14px;
}

.ro-particulars th {
  width: 32%;
  color: #7d1118;
  background: #fff7f8;
}

.ro-particulars td {
  background: #ffffff;
}

.ro-particulars tr:nth-child(even) td {
  background: #fbfbfc;
}

.ro-particulars tr.translation-action-row th,
.ro-particulars tr.translation-action-row td,
.ro-particulars tr.shift-action-row th,
.ro-particulars tr.shift-action-row td {
  border-top: 2px solid #be1f28;
  border-bottom: 2px solid #be1f28;
  color: #8f161f;
  background: #fff6f7;
  font-weight: 780;
}

.ro-particulars tr.translation-action-row th,
.ro-particulars tr.shift-action-row th {
  border-left: 2px solid #be1f28;
}

.ro-particulars tr.translation-action-row td,
.ro-particulars tr.shift-action-row td {
  border-right: 2px solid #be1f28;
}

.ro-translation-final-split {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(220px, 0.66fr);
  gap: 0;
  align-items: stretch;
}

.ro-translation-final-split span {
  display: block;
  padding: 0 10px;
}

.ro-translation-final-split span:first-child {
  padding-left: 0;
}

.ro-translation-final-split span + span {
  border-left: 1px solid rgba(125, 17, 24, 0.22);
}

.ro-doc .signature-row {
  padding-top: 12px;
  border-top: 2px solid var(--accent);
}

.ro-print-left {
  display: grid;
  gap: 10px;
}

.ro-davp-requirements {
  margin: 0;
  padding: 8px 10px 10px;
  border: 1.5px solid #ef3b4a;
  border-radius: 7px;
  color: #8a1018;
  background: linear-gradient(135deg, #fff8fa, #fffdfd);
  box-shadow: 3px 5px 10px rgba(54, 28, 31, 0.2);
  font-weight: 800;
}

.ro-davp-requirements strong {
  display: block;
  margin: 0 0 8px;
  color: #8a1e26;
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
}

.ro-davp-requirements strong span {
  display: inline;
  color: #ee2f38;
}

.ro-davp-requirements div {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.ro-davp-requirements div span {
  display: grid;
  min-height: 31px;
  place-items: center;
  padding: 4px 7px;
  border: 1px solid rgba(255, 80, 90, 0.45);
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(135deg, #9b2026, #7d1118);
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.ro-editor-shell {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

.ro-editor-paper {
  width: min(100%, 920px);
  padding: 28px;
  border: 1px solid rgba(125, 22, 31, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 250, 0.94)),
    radial-gradient(circle at 8% 0%, rgba(188, 31, 40, 0.07), transparent 28%);
  box-shadow: 0 28px 80px rgba(30, 22, 26, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.ro-editor-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 18px;
  align-items: start;
}

.ro-editor-agency {
  padding-left: 120px;
  text-align: center;
}

.ro-editor-agency strong {
  display: block;
  color: #7d1d26;
  font-size: 23px;
  font-weight: 820;
}

.ro-editor-agency p {
  margin: 5px 0 0;
  color: #414146;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.45;
}

.ro-editor-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
  justify-self: end;
}

.ro-editor-heading {
  margin: 14px 0 12px;
  text-align: center;
}

.ro-editor-heading h3 {
  margin: 0;
  color: #981e28;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ro-editor-heading span {
  display: block;
  margin-top: 2px;
  color: #59595e;
  font-size: 13px;
  font-weight: 560;
}

.ro-editor-meta {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(170px, 0.8fr) minmax(220px, 1fr);
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(188, 31, 40, 0.12);
  border-left: 4px solid #be1f28;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(246, 246, 247, 0.94), rgba(255, 247, 248, 0.72));
}

.ro-editor-address {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 16px;
  margin: 14px 0;
}

.ro-editor-address-copy,
.ro-editor-client-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(188, 31, 40, 0.12);
  border-radius: 14px;
  background: rgba(255, 245, 246, 0.55);
}

.branch-address-toggle {
  display: grid;
  gap: 6px;
  align-content: start;
  color: #4f4b44;
  font-size: 13px;
  font-weight: 700;
}

.branch-address-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.branch-address-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 42px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(122, 28, 38, 0.12);
  border-radius: 999px;
  background: linear-gradient(135deg, #f1f2f4, #e2e4e8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.branch-address-toggle-track i {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff, #f7f7f8);
  box-shadow: 0 6px 16px rgba(36, 39, 46, 0.13);
  transition: transform 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}

.branch-address-toggle-track em {
  position: relative;
  z-index: 1;
  color: #5f6268;
  font-style: normal;
  text-align: center;
  transition: color 0.4s ease;
}

.branch-address-toggle input[type="checkbox"]:checked + .branch-address-toggle-track i {
  transform: translateX(100%);
  background: linear-gradient(135deg, #dff7e7, #bdeccf);
  box-shadow: 0 7px 18px rgba(33, 139, 76, 0.2);
}

.branch-address-toggle input[type="checkbox"]:checked + .branch-address-toggle-track em:last-child {
  color: #0f6b34;
}

.bulk-branch-address-toggle {
  align-self: end;
  width: 210px;
  max-width: 100%;
}

.bulk-client-branch-row {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 210px;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.bulk-client-branch-row > label:first-child {
  min-width: 0;
}

.ro-branch-address-toggle {
  width: 220px;
  max-width: 100%;
}

.ro-editor-client-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(160px, 0.75fr);
  gap: 10px;
  align-items: end;
}

.ro-editor-client-choice-row > label {
  min-width: 0;
}

@media (max-width: 980px) {
  .ro-editor-client-choice-row {
    grid-template-columns: 1fr;
  }

  .bulk-client-branch-row {
    grid-template-columns: minmax(0, 1fr) 190px;
  }
}

body.theme-night .branch-address-toggle {
  color: #dceeff;
}

body.theme-night .branch-address-toggle-track {
  border-color: rgba(150, 185, 222, 0.16);
  background: linear-gradient(135deg, #253650, #18283e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-night .branch-address-toggle-track i {
  background: linear-gradient(135deg, #435572, #2e405d);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28);
}

body.theme-night .branch-address-toggle-track em {
  color: #c5d4e7;
}

.ro-editor-address-copy > span,
.ro-editor-address-copy > strong {
  color: #2e2e33;
  font-size: 15px;
}

.ro-editor-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(188, 31, 40, 0.14);
  border-radius: 14px;
}

.ro-editor-table th,
.ro-editor-table td {
  border-bottom: 1px solid rgba(188, 31, 40, 0.1);
  vertical-align: top;
}

.ro-editor-table tr:last-child th,
.ro-editor-table tr:last-child td {
  border-bottom: 0;
}

.ro-editor-table th {
  width: 185px;
  padding: 16px 14px;
  color: #861d26;
  background: rgba(255, 238, 240, 0.62);
  font-size: 13px;
  font-weight: 820;
  text-align: left;
}

.ro-editor-table td {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
}

.ro-editor-table tr:nth-child(even) td {
  background: rgba(255, 250, 251, 0.9);
}

.ro-editor-paper label {
  min-width: 0;
  gap: 6px;
  margin: 0;
  color: #6a2229;
  font-size: 11px;
  font-weight: 780;
}

.ro-editor-paper input,
.ro-editor-paper select,
.ro-editor-paper textarea {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border-color: rgba(92, 92, 98, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #27272b;
  font-size: 13px;
  font-weight: 620;
}

.ro-editor-paper textarea {
  min-height: 68px;
  resize: vertical;
}

.ro-editor-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.ro-editor-inline > div {
  min-width: 0;
}

.ro-editor-inline > div > label {
  width: 100%;
}

.ro-editor-conditional-rate {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ro-conditional-rate-row th {
  color: #4c2783;
  background: rgba(243, 238, 255, 0.72);
}

.ro-conditional-rate-row td {
  background: linear-gradient(135deg, rgba(249, 247, 255, 0.96), rgba(255, 255, 255, 0.9));
}

body.theme-night .ro-conditional-rate-row th {
  color: #d9ccff;
  background: #25213b;
}

body.theme-night .ro-conditional-rate-row td {
  background: #1f2c40;
}

.ro-editor-size-row {
  grid-template-columns: minmax(105px, 0.55fr) minmax(105px, 0.55fr) minmax(150px, 0.75fr) minmax(150px, 0.6fr);
  align-items: end;
}

.ro-big-size-control {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.ro-big-size-button {
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid rgba(109, 40, 217, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 10px 22px rgba(109, 40, 217, 0.24), inset 0 1px rgba(255, 255, 255, 0.35);
}

.ro-big-size-button:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 28px rgba(109, 40, 217, 0.3), inset 0 1px rgba(255, 255, 255, 0.42);
}

.ro-big-size-control small { color: #6d28d9; font-weight: 650; }

.release-date-picker {
  grid-template-columns: minmax(230px, 1fr) auto minmax(250px, 0.85fr);
  align-items: end;
}
.release-date-picker .chip-list,
.release-date-picker .field-hint,
.release-date-picker .release-date-remarks { grid-column: 1 / -1; }
.release-date-remarks { display: grid; gap: 6px; }
.release-date-remarks input { min-height: 42px; }
.ro-package-control { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ro-package-button {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid rgba(79, 70, 229, 0.36);
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.2);
  white-space: nowrap;
}
.ro-package-control small { color: #5145a5; font-weight: 650; }

.ro-big-size-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 22, 30, 0.48);
  backdrop-filter: blur(14px);
}

.ro-big-size-dialog {
  width: min(920px, 92vw);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 252, 0.96));
  box-shadow: 0 30px 90px rgba(24, 16, 40, 0.32);
}

.ro-big-size-dialog > header,
.ro-big-size-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
}

.ro-big-size-dialog > header { border-bottom: 1px solid rgba(109, 40, 217, 0.12); }
.ro-big-size-dialog > header span { color: #746b80; font-size: 13px; }
.ro-big-size-dialog > header h3 { margin: 2px 0 0; color: #6d28d9; }
.ro-big-size-dialog > header > button { width: 42px; height: 42px; border: 0; border-radius: 50%; font-size: 25px; }
.ro-big-size-dialog > footer { justify-content: flex-end; border-top: 1px solid rgba(109, 40, 217, 0.12); }
.ro-big-size-dialog > footer .ro-big-size-clear { margin-right: auto; color: #7d1118; }

.ro-big-size-body { max-height: calc(88vh - 156px); overflow: auto; padding: 22px 24px; }
.ro-big-size-body > p:first-child { margin: 0 0 14px; color: #5f5868; }
.ro-big-size-rows { display: grid; gap: 10px; }
.ro-big-size-row {
  display: grid;
  grid-template-columns: 86px repeat(3, minmax(130px, 1fr)) 42px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(109, 40, 217, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}
.ro-big-size-row > strong { align-self: center; color: #5b21b6; }
.ro-big-size-row label { display: grid; gap: 6px; color: #4f4659; font-size: 12px; font-weight: 650; }
.ro-big-size-row input { min-height: 42px; padding: 9px 12px; border: 1px solid rgba(109, 40, 217, 0.16); border-radius: 12px; background: #fff; color: #27232d; }
.ro-big-size-remove { width: 42px; height: 42px; border: 0; border-radius: 12px; color: #7d1118; font-size: 22px; }
.ro-big-size-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.ro-big-size-footer > div { display: flex; align-items: baseline; gap: 12px; padding: 10px 16px; border-radius: 999px; background: #ede9fe; color: #5b21b6; }
.ro-big-size-footer strong { font-size: 18px; }
.ro-big-size-error { min-height: 20px; margin: 8px 0 0; color: #b4232c; font-weight: 650; }
.ro-page-size-breakdown { display: inline-block; margin-top: 2px; line-height: 1.35; }
.ro-package-dialog { width: min(820px, calc(100vw - 32px)); }
.ro-package-dialog .ro-big-size-body { overflow-x: hidden; }
.ro-package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}
.ro-package-grid label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: #453d51;
  font-size: 13px;
  font-weight: 700;
}
.ro-package-grid input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  box-sizing: border-box;
  padding: 11px 16px;
  border: 1px solid rgba(99, 102, 241, 0.26);
  border-radius: 14px;
  background: #fff;
  color: #24202a;
  font-size: 17px;
}
.ro-package-grid input::placeholder { color: transparent; }
.ro-package-preview { margin-top: 18px; padding: 13px 16px; border: 1px solid #f1c9cf; border-radius: 12px; background: #fff4f5; color: #8f2730; font-weight: 650; }
.ro-package-preview.valid { border-color: #b7e3c8; background: #effcf4; color: #176a3a; }

body.theme-night .ro-big-size-dialog { border-color: rgba(181, 155, 255, 0.2); background: linear-gradient(145deg, #1e293b, #172033); }
body.theme-night .ro-big-size-body > p:first-child,
body.theme-night .ro-big-size-row label { color: #c9d5e4; }
body.theme-night .ro-big-size-row { border-color: rgba(167, 139, 250, 0.2); background: rgba(31, 44, 64, 0.86); }
body.theme-night .ro-big-size-row input { border-color: rgba(167, 139, 250, 0.22); background: #26364d; color: #f8fbff; }
body.theme-night .ro-package-grid label { color: #dce7f5; }
body.theme-night .ro-package-grid input { border-color: rgba(129, 140, 248, 0.35); background: #26364d; color: #f8fbff; }
body.theme-night .ro-package-preview { background: #38252e; color: #ffbbc2; }
body.theme-night .ro-package-preview.valid { background: #18372b; color: #8fe6b3; }
body.theme-night .ro-package-control small { color: #c7d2fe; }

@media (max-width: 900px) {
  .estimate-size-modal-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate-size-modal-row > strong { grid-column: 1 / -1; }
  .ro-editor-size-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ro-editor-conditional-rate { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ro-big-size-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ro-big-size-row > strong { grid-column: 1 / -1; }
  .release-date-picker,
  .ro-package-grid { grid-template-columns: 1fr; }
  .ro-package-control { align-items: flex-start; flex-direction: column; }
}

.ro-editor-rate-remarks {
  grid-template-columns: minmax(170px, 0.65fr) minmax(150px, 0.55fr) minmax(260px, 1fr);
}

.ro-editor-rate-remarks label:last-child {
  grid-column: auto;
}

.ro-translation-split {
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) minmax(280px, 1fr);
  gap: 10px;
}

.ro-editor-table .picker-field,
.ro-editor-table label.full {
  grid-column: auto;
}

.ro-editor-table .chip-list {
  margin-top: 7px;
}

.ro-editor-table .release-date-picker {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
}

.ro-editor-table .release-date-picker .field-hint,
.ro-editor-table .release-date-picker .chip-list,
.ro-editor-table .release-date-picker input[type="hidden"] {
  grid-column: 1 / -1;
}

.ro-editor-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 16px;
  margin-top: 16px;
}

.ro-editor-internal,
.ro-editor-sign {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(188, 31, 40, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(248, 248, 249, 0.9), rgba(255, 244, 245, 0.58));
}

.ro-editor-internal h4 {
  margin: 0;
  color: #8f1d27;
  font-size: 13px;
  text-transform: uppercase;
}

.ro-editor-sign {
  align-content: start;
  text-align: center;
}

.ro-editor-sign > span {
  color: #7d1d26;
  font-weight: 780;
}

.ro-editor-sign-pad {
  display: grid;
  min-height: 74px;
  place-items: center;
  border: 1px dashed rgba(132, 132, 138, 0.26);
  border-radius: 12px;
  color: #9b9ba1;
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.ro-editor-shell + .ro-calc-box {
  grid-column: 1 / -1;
  max-width: 920px;
  justify-self: center;
  margin-top: -4px;
}

.signature-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: end;
  margin-top: 26px;
}

.ro-print-instructions {
  font-size: 11px;
  line-height: 1.35;
}

.ro-print-instructions strong {
  display: block;
  margin-bottom: 6px;
}

.ro-print-instructions ol {
  margin: 0;
  padding-left: 18px;
}

.ro-print-instructions li {
  margin: 2px 0;
}

.sign-box {
  display: grid;
  gap: 10px;
  min-height: 130px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
  justify-items: center;
}

.sign-box span {
  color: #202024;
  font-weight: 800;
}

.sign-box strong {
  align-self: end;
}

.sign-box em {
  color: var(--muted);
  font-style: normal;
}

.ro-internal-print-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #111;
  font-size: 9.5pt;
  font-style: italic;
  line-height: 1.2;
  white-space: nowrap;
}

.ro-internal-print-line strong {
  font-weight: 800;
}

.ro-form-doc {
  width: 794px;
  min-height: 1123px;
  padding: 70px 78px 54px;
  border: 0;
  border-radius: 0;
  color: #111;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.ro-form-head {
  display: grid;
  grid-template-columns: 1fr 235px;
  gap: 20px;
  align-items: start;
}

.ro-form-head h3 {
  margin: 0;
  text-align: left;
  font-size: 24px;
  line-height: 1.1;
  text-transform: uppercase;
}

.ro-form-head .ins-line {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.1;
}

.ro-form-meta {
  display: grid;
  gap: 10px;
  justify-items: end;
  text-align: right;
  font-size: 15px;
}

.ro-address-grid {
  display: grid;
  grid-template-columns: 1fr 235px;
  gap: 20px;
  margin-top: 26px;
  min-height: 82px;
}

.ro-address-grid p,
.ro-company-mini span,
.ro-note p {
  margin: 0;
}

.ro-address-grid strong {
  display: block;
  margin: 7px 0;
}

.ro-company-mini {
  display: grid;
  gap: 4px;
  align-content: start;
  color: #333;
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.ro-form-lines {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.ro-line {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  min-height: 26px;
}

.ro-line span {
  color: #222;
  font-weight: 700;
}

.ro-line strong {
  display: block;
  min-height: 24px;
  padding: 2px 4px 4px;
  border-bottom: 1px solid #222;
  font-weight: 500;
  white-space: pre-wrap;
}

.ro-four,
.ro-two {
  display: grid;
  gap: 16px;
}

.ro-four {
  grid-template-columns: 1.2fr 0.72fr 0.72fr 0.9fr;
}

.ro-two {
  grid-template-columns: 1fr 1fr;
}

.ro-four .ro-line,
.ro-two .ro-line {
  grid-template-columns: auto minmax(0, 1fr);
}

.ro-tall {
  align-items: start;
}

.ro-tall strong {
  min-height: 52px;
}

.ro-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 28px;
  align-items: end;
  margin-top: 36px;
}

.ro-instructions {
  font-size: 11px;
  line-height: 1.35;
}

.ro-instructions strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.ro-instructions ol {
  margin: 0;
  padding-left: 18px;
}

.ro-instructions li {
  margin: 3px 0;
}

.ro-signature-box {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 122px;
  text-align: center;
  font-size: 12px;
}

.ro-signature-box .signature-img {
  width: 120px;
  height: 54px;
}

.ro-note {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 18px;
  margin-top: 24px;
  font-size: 12px;
  line-height: 1.3;
}

.ro-note strong {
  grid-row: span 3;
  align-self: center;
  text-align: center;
  font-size: 15px;
}

.notice {
  padding: 13px 15px;
  border: 1px solid rgba(238, 47, 56, 0.16);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  color: #5f5f62;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.ro-bulk-reprint-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(320px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 0%, rgba(238, 47, 56, 0.1), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 247, 248, 0.72));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(140%);
}

.ro-bulk-selector-card {
  display: grid;
  gap: 8px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid rgba(125, 17, 24, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.ro-bulk-selector-card > span {
  color: #7d1118;
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.ro-bulk-range-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ro-bulk-range-card > span {
  grid-column: 1 / -1;
}

.ro-bulk-selector-card label {
  display: grid;
  gap: 4px;
  color: #6b6461;
  font-size: 11px;
  font-weight: 780;
}

.ro-bulk-selector-card input {
  min-height: 38px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #303034;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 650;
}

.ro-bulk-reprint-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.ro-bulk-reprint-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.ro-bulk-reprint-actions > div {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.ro-confirming-list-button {
  min-height: 38px !important;
  border: 1px solid rgba(19, 128, 102, 0.32);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #4ca987, #168b78);
  box-shadow: 0 10px 22px rgba(22, 139, 120, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-weight: 720;
}

.ro-confirming-list-button:hover {
  color: #fff;
  background: linear-gradient(135deg, #399d7d, #087968);
  transform: translateY(-1px);
}

.ro-confirming-list-prompt {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,245,247,.72));
}

.ro-confirming-list-prompt p {
  margin: 0;
  color: #5d5f64;
  font-size: 15px;
}

.confirmation-register-button {
  min-height: 36px;
  border: 1px solid rgba(94, 99, 109, 0.2);
  border-radius: 12px;
  color: #35373c;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(226, 228, 232, 0.86));
  box-shadow: 0 8px 18px rgba(55, 58, 64, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  font-weight: 680;
}

.modal.ro-confirming-list-modal .modal-panel {
  width: min(1180px, 94vw);
  max-width: 1180px;
  max-height: 92vh;
}

.confirmation-funnel {
  display: grid;
  gap: 14px;
}

.confirmation-filter-block {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(125, 17, 24, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 248, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 9px 24px rgba(79, 35, 39, 0.07);
}

.confirmation-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.confirmation-section-title strong {
  color: #80131b;
  font-size: 15px;
}

.confirmation-section-title span {
  color: #777a80;
  font-size: 12px;
  text-align: right;
}

.confirmation-period-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  padding: 4px;
  border: 1px solid rgba(102, 105, 112, 0.14);
  border-radius: 14px;
  background: rgba(226, 228, 232, 0.66);
}

.confirmation-mailing-button {
  min-height: 40px;
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  color: #fff;
  font-weight: 720;
  box-shadow: 0 9px 20px rgba(42, 48, 74, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.confirmation-mailing-button { background: linear-gradient(135deg, #5577e6, #334eb5); }

.confirmation-mailing-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08) brightness(1.02);
}

.confirmation-period-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  color: #64676d;
  background: transparent;
  box-shadow: none;
  font-weight: 680;
}

.confirmation-period-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, #ef4a50, #bd2029);
  box-shadow: 0 7px 16px rgba(189, 32, 41, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.confirmation-date-fields {
  display: flex;
  gap: 12px;
}

.confirmation-date-fields label,
.confirmation-client-field,
.confirmation-filter-block > label {
  display: grid;
  gap: 6px;
  color: #4f5156;
  font-size: 12px;
  font-weight: 720;
}

.confirmation-date-fields label {
  flex: 1 1 220px;
}

.confirmation-date-fields label[hidden] {
  display: none;
}

.confirmation-date-fields input,
.confirmation-client-field select,
.confirmation-filter-block > label input,
.confirmation-register > input {
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid rgba(104, 106, 112, 0.18);
  border-radius: 13px;
  color: #303238;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.confirmation-inclusion {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.confirmation-inclusion label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(125, 17, 24, 0.11);
  border-radius: 999px;
  color: #4d4f54;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 650;
}

.confirmation-inclusion input,
.confirmation-group-card input {
  width: 17px;
  height: 17px;
  accent-color: #c5222c;
}

.confirmation-preview-block {
  min-height: 150px;
}

.confirmation-group-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow: auto;
  padding: 2px;
}

.confirmation-group-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(125, 17, 24, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.confirmation-group-card:hover {
  transform: translateY(-1px);
  border-color: rgba(197, 34, 44, 0.34);
  box-shadow: 0 8px 18px rgba(90, 38, 42, 0.1);
}

.confirmation-group-card span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.confirmation-group-card strong {
  overflow: hidden;
  color: #313338;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirmation-group-card small {
  overflow: hidden;
  color: #797c82;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirmation-empty {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed rgba(125, 17, 24, 0.2);
  border-radius: 14px;
  color: #777a80;
  background: rgba(255, 255, 255, 0.48);
  text-align: center;
}

.confirmation-results,
.confirmation-register {
  display: grid;
  gap: 12px;
}

.confirmation-results-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirmation-results article,
.confirmation-register-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(125, 17, 24, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.confirmation-results article > div,
.confirmation-register-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.confirmation-results article strong,
.confirmation-register-row strong {
  color: #8b141d;
  font-size: 13px;
}

.confirmation-results article span,
.confirmation-register-row span {
  color: #33353a;
  font-weight: 680;
}

.confirmation-results article small,
.confirmation-register-row small {
  color: #7a7d83;
}

.confirmation-register-row {
  grid-template-columns: minmax(200px, 0.8fr) minmax(260px, 1.2fr) minmax(220px, 0.9fr) auto;
}

#confirmationBatchRegisterRows {
  display: grid;
  gap: 9px;
  max-height: 58vh;
  overflow: auto;
}

body.theme-dark .confirmation-filter-block,
body.theme-dark .confirmation-results article,
body.theme-dark .confirmation-register-row {
  border-color: rgba(150, 164, 190, 0.2);
  background: linear-gradient(135deg, rgba(30, 44, 67, 0.96), rgba(23, 35, 55, 0.92));
}

body.theme-dark .confirmation-section-title strong,
body.theme-dark .confirmation-results article strong,
body.theme-dark .confirmation-register-row strong {
  color: #ff8890;
}

body.theme-dark .confirmation-section-title span,
body.theme-dark .confirmation-results article small,
body.theme-dark .confirmation-register-row small {
  color: #aebbd0;
}

body.theme-dark .confirmation-group-card,
body.theme-dark .confirmation-inclusion label {
  border-color: rgba(165, 178, 202, 0.18);
  background: rgba(40, 55, 80, 0.86);
}

body.theme-dark .confirmation-group-card strong,
body.theme-dark .confirmation-results article span,
body.theme-dark .confirmation-register-row span,
body.theme-dark .confirmation-inclusion label {
  color: #f3f6fb;
}

body.theme-dark .confirmation-group-card small {
  color: #b3bfd2;
}

@media (max-width: 900px) {
  .confirmation-period-switch {
    grid-template-columns: repeat(2, 1fr);
  }

  .confirmation-register-row {
    grid-template-columns: 1fr;
  }
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #8e121d;
  background: rgba(238, 47, 56, 0.08);
  border: 1px solid rgba(238, 47, 56, 0.16);
}

.action-landing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.action-landing h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.action-landing p {
  margin: 0;
  max-width: 620px;
  color: #69696c;
}

.schedule-reminder-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.schedule-reminder-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-6px);
  transition: grid-template-rows 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

.schedule-reminder-body > div {
  min-height: 0;
  overflow: hidden;
}

.schedule-reminder-panel.open .schedule-reminder-body {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

.schedule-toggle {
  width: 34px;
  height: 34px;
  color: #2d2d30;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(45, 45, 48, 0.12);
  box-shadow: var(--shadow-soft);
  transition: transform 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
}

.schedule-toggle:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.schedule-reminder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(238, 47, 56, 0.12);
}

.schedule-reminder-item strong {
  display: block;
  color: #2b2b2e;
  font-size: 14px;
}

.schedule-reminder-item span {
  display: block;
  color: #6c6c70;
  font-size: 13px;
}

.schedule-done {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: linear-gradient(135deg, rgba(136, 220, 166, 0.94) 0%, rgba(32, 153, 86, 0.96) 100%);
  box-shadow: 0 12px 24px rgba(19, 122, 70, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(14px) saturate(130%);
}

.schedule-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.schedule-nav input {
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.schedule-month-btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, rgba(95, 165, 255, 0.96), rgba(31, 94, 190, 0.98));
  box-shadow: 0 14px 28px rgba(47, 125, 241, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  font-size: 13px;
  font-weight: 740;
}

.schedule-month-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(47, 125, 241, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.month-nav {
  display: inline-flex;
  gap: 8px;
  margin-left: auto;
}

.month-nav button {
  width: 36px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, rgba(95, 165, 255, 0.96), rgba(31, 94, 190, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  font-size: 17px;
  font-weight: 760;
}

.schedule-calendar-panel {
  padding: 16px;
}

.month-calendar {
  padding: 16px;
}

.month-calendar-head,
.month-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
}

.month-calendar-head {
  gap: 8px;
  margin-bottom: 8px;
}

.month-calendar-head span {
  color: #6b6b70;
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.month-calendar-grid {
  gap: 8px;
}

.month-date {
  min-height: 104px;
  aspect-ratio: 1 / 1;
  padding: 9px;
  border: 1px solid rgba(47, 125, 241, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 247, 255, 0.76));
  box-shadow: 0 12px 24px rgba(47, 125, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.month-date.today {
  border-color: rgba(238, 47, 56, 0.3);
  background: linear-gradient(135deg, rgba(255, 244, 246, 0.96), rgba(241, 247, 255, 0.78));
}

.month-date.muted-month {
  opacity: 0.46;
}

.month-date-number {
  color: #1f5ebe;
  font-size: 13px;
  font-weight: 780;
}

.month-ro-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  word-break: break-word;
}

.month-ro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.month-ro-badge.unpublished {
  color: #3f3f44;
  border: 1px solid rgba(190, 31, 40, 0.22);
  background: #fff0f2;
}

.month-ro-badge.unpublished[draggable="true"],
.month-ro-badge.missed[draggable="true"] {
  cursor: grab;
}

.month-ro-badge.unpublished[draggable="true"]:active,
.month-ro-badge.missed[draggable="true"]:active {
  cursor: grabbing;
}

.month-ro-badge[data-schedule-preview-dbl] {
  cursor: pointer;
}

.month-ro-badge[data-schedule-preview-dbl]:hover {
  transform: translateY(-1px);
}

.month-ro-badge.published {
  color: #0d5f37;
  border: 1px solid rgba(19, 122, 70, 0.46);
  background: #e7f8ed;
}

.month-ro-badge.shifted {
  color: #7a520b;
  border: 1px solid rgba(190, 136, 16, 0.52);
  background: #fff3c4;
}

.month-ro-badge.missed {
  color: #8f1620;
  border: 1px solid rgba(190, 31, 40, 0.34);
  background: #ffe8ec;
}

.month-ro-badge.cancelled {
  color: #5e5e64;
  border: 1px solid rgba(104, 104, 110, 0.36);
  background: #eeeeef;
  text-decoration: line-through;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(230px, 1fr));
  gap: 10px;
  padding: 16px;
  overflow-x: auto;
}

.schedule-day {
  min-height: 220px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(238, 47, 56, 0.1);
  box-shadow: var(--shadow-soft);
}

.schedule-day.today {
  border-color: rgba(238, 47, 56, 0.28);
  background: rgba(255, 240, 241, 0.92);
}

.schedule-day.drop-ready {
  border-color: rgba(47, 125, 241, 0.46);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: 0 18px 36px rgba(47, 125, 241, 0.16), inset 0 0 0 1px rgba(47, 125, 241, 0.18);
}

.schedule-day.auto-week-pending {
  border-color: rgba(47, 125, 241, 0.72);
  box-shadow: 0 18px 38px rgba(47, 125, 241, 0.2), inset 0 0 0 2px rgba(47, 125, 241, 0.26);
}

.schedule-day.auto-week-pending::after {
  content: "Hold to next week";
  display: block;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, rgba(95, 165, 255, 0.96), rgba(31, 94, 190, 0.98));
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.schedule-day-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(238, 47, 56, 0.1);
}

.schedule-day-head > div {
  display: grid;
  gap: 3px;
}

.schedule-day-head strong {
  color: #a11b24;
  font-size: 14px;
}

.schedule-day-head span {
  color: #6e6e72;
  font-size: 12px;
  font-weight: 650;
}

.schedule-mark-all-btn {
  min-height: 25px;
  padding: 5px 8px;
  border: 1px solid rgba(24, 133, 76, 0.42);
  border-radius: 9px;
  color: #197147;
  background: linear-gradient(135deg, rgba(236, 255, 243, 0.98), rgba(184, 235, 202, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 16px rgba(24, 133, 76, 0.1);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.1;
}

.schedule-mark-all-btn:hover {
  color: #0d5f37;
  transform: translateY(-1px) scale(1.02);
  background: linear-gradient(135deg, rgba(225, 255, 237, 1), rgba(151, 219, 177, 0.92));
}

.schedule-day-items {
  display: grid;
  gap: 8px;
}

.schedule-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  position: relative;
  overflow: hidden;
  padding: 10px;
  border-radius: 14px;
  background: rgba(238, 47, 56, 0.06);
  border: 1px solid rgba(238, 47, 56, 0.14);
  transition: background 0.28s ease, border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.schedule-item.printed {
  background: linear-gradient(135deg, rgba(229, 251, 237, 0.96), rgba(197, 239, 213, 0.78));
  border-color: rgba(24, 133, 76, 0.62);
  box-shadow: 0 14px 28px rgba(19, 122, 70, 0.14);
}

.schedule-item.shifted-next {
  background: linear-gradient(135deg, rgba(255, 250, 229, 0.96), rgba(255, 237, 171, 0.72));
  border-color: rgba(205, 153, 22, 0.52);
}

.schedule-item.drag-shifted {
  background: linear-gradient(135deg, rgba(255, 250, 229, 0.96), rgba(255, 237, 171, 0.72));
  border-color: rgba(205, 153, 22, 0.52);
}

.schedule-item.missed {
  background: linear-gradient(135deg, rgba(255, 237, 240, 0.94), rgba(255, 248, 249, 0.86));
  border-color: rgba(190, 31, 40, 0.44);
  box-shadow: 0 14px 28px rgba(190, 31, 40, 0.09);
}

.schedule-item.dragging {
  opacity: 0.62;
  transform: scale(0.985);
}

.schedule-item.cancelled {
  background: linear-gradient(135deg, rgba(237, 237, 239, 0.96), rgba(212, 212, 216, 0.82));
  border-color: rgba(104, 104, 110, 0.48);
}

.schedule-client {
  color: #2d2d30;
  font-size: 11.5px;
  font-weight: 560;
  line-height: 1.25;
}

.schedule-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.schedule-ro-chip,
.schedule-key-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.schedule-ro-chip {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(135deg, rgba(255, 84, 94, 0.96), rgba(174, 20, 31, 0.98));
}

.schedule-ro-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(190, 31, 40, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.schedule-key-chip {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(82, 148, 255, 0.96), rgba(28, 86, 178, 0.98));
}

.schedule-note {
  margin-top: 7px;
  color: #9a6212;
  font-size: 10.5px;
  font-weight: 700;
}

.schedule-actions {
  display: grid;
  gap: 6px;
  align-self: start;
  min-width: 92px;
}

.schedule-action {
  min-height: 27px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 720;
  white-space: nowrap;
  transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
}

.schedule-action:hover:not(:disabled) {
  transform: translateX(-1px) scale(1.02);
}

.schedule-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.schedule-action.print {
  color: #0d5f37;
  border: 1px solid rgba(19, 122, 70, 0.26);
  background: linear-gradient(135deg, #e9fff1, #bfeccd);
}

.schedule-action.shift {
  color: #7c560c;
  border: 1px solid rgba(210, 155, 24, 0.34);
  background: linear-gradient(135deg, #fff9dd, #ffe8a3);
}

.schedule-action.cancel {
  color: #9c121b;
  border: 1px solid rgba(190, 31, 40, 0.22);
  background: linear-gradient(135deg, #fff0f2, #ffd0d6);
}

.client-portal-mode .sidebar {
  z-index: 3;
  grid-template-rows: 1fr;
  min-height: calc(100vh - 32px);
  transform: translateY(-4px);
  background:
    linear-gradient(145deg, rgba(38, 38, 42, 0.98) 0%, rgba(19, 19, 22, 0.99) 46%, rgba(74, 7, 14, 0.96) 100%),
    radial-gradient(circle at 0% 0%, rgba(180, 24, 35, 0.32), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(238, 47, 56, 0.14), transparent 38%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -28px 46px rgba(60, 3, 10, 0.26),
    16px 0 48px rgba(48, 4, 10, 0.24),
    0 34px 86px rgba(95, 8, 18, 0.38);
  backdrop-filter: blur(30px) saturate(155%);
}

.client-portal-mode .brand,
.client-portal-mode .clock-card,
.client-portal-mode .storage-card {
  display: none;
}

.portal-sidebar-nav {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-sidebar-client {
  padding: 12px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
}

.portal-sidebar-client span {
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.portal-sidebar-client h3 {
  margin: 7px 0 4px;
  color: #fff;
  font-size: 22px;
  font-weight: 460;
  line-height: 1.18;
}

.portal-sidebar-client p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.portal-sidebar-nav .nav-main {
  min-height: 46px;
  color: rgba(255, 255, 255, 0.84);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 10px 22px rgba(96, 12, 21, 0.1);
  font-weight: 420;
}

.portal-sidebar-nav .nav-main.active {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(170, 24, 34, 0.9), rgba(95, 9, 17, 0.78)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 42%);
  box-shadow: 0 16px 30px rgba(16, 2, 4, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.agency-portal-exit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  color: #3d3d41;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 42%);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: 0 18px 34px rgba(55, 4, 12, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-family: "Roboto", "Arial", "Segoe UI", sans-serif;
  font-weight: 300;
  backdrop-filter: blur(18px);
}

.agency-portal-exit::before {
  content: "<";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 16px;
  line-height: 1;
}

.agency-portal-exit:hover {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(93, 199, 126, 0.98), rgba(22, 128, 75, 1)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.34), transparent 42%);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 34px rgba(22, 128, 75, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.client-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 18px;
  padding: 20px;
  align-items: stretch;
}

.client-portal-card {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 14px;
  min-height: 236px;
  padding: 18px;
  border: 1px solid rgba(238, 47, 56, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 249, 0.78)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.09), transparent 42%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  overflow: hidden;
}

.client-portal-card-main {
  min-width: 0;
}

.client-portal-card span,
.client-focus-nav span,
.client-bill-head span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.client-portal-card h3,
.client-focus-nav h3 {
  margin: 3px 0;
  color: var(--charcoal);
  font-size: 21px;
  font-weight: 520;
}

.client-portal-card h3 {
  display: -webkit-box;
  min-height: 52px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.client-portal-card p,
.client-focus-nav p {
  margin: 0;
  color: #6d6d72;
  font-size: 12.5px;
}

.client-portal-card p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.client-portal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.client-portal-stats strong {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 10px;
  border-radius: 12px;
  color: #2d2d30;
  background: rgba(245, 245, 246, 0.82);
  text-align: center;
  align-content: center;
}

.client-portal-stats small {
  color: #747478;
  font-size: 10px;
  font-weight: 650;
}

.client-portal-access {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.client-focus-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.client-portal-mode .client-focus-main {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.client-portal-mode .content,
.client-portal-mode .client-bill-panel {
  min-width: 0;
  max-width: 100%;
}

.client-portal-mode .client-bill-panel {
  overflow: visible;
}

.client-focus-nav {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 10px;
  align-self: start;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(238, 238, 240, 0.62));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
}

.client-focus-nav button:not(.secondary) {
  justify-content: flex-start;
  color: #333336;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(235, 235, 237, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.client-focus-nav button.active {
  color: #fff;
  background: linear-gradient(135deg, #f45a61, #ba2028);
}

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

.client-schedule-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 14px;
  background: rgba(238, 47, 56, 0.05);
}

.client-schedule-card.printed {
  border-color: rgba(19, 122, 70, 0.42);
  background: #e9fff1;
}

.client-schedule-card.cancelled {
  border-color: rgba(104, 104, 110, 0.36);
  background: #eeeeef;
}

.client-schedule-card span {
  color: #77777b;
  font-size: 11px;
  font-weight: 700;
}

.client-schedule-card strong {
  display: block;
  color: var(--accent-dark);
  font-size: 15px;
}

.client-schedule-card p {
  margin: 2px 0 0;
  color: #606064;
  font-size: 12px;
}

.portal-key-command {
  display: grid;
  gap: 7px;
  padding: 10px 18px 12px;
  border-top: 1px solid rgba(238, 47, 56, 0.08);
  border-bottom: 1px solid rgba(238, 47, 56, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(248, 248, 250, 0.58)),
    radial-gradient(circle at 100% 0%, rgba(238, 47, 56, 0.08), transparent 40%);
}

.portal-key-command p {
  margin: 0;
  color: #77777b;
  font-size: 11.5px;
  text-align: center;
}

.portal-key-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.portal-key-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 94px;
  padding: 14px 16px;
  border: 1px solid rgba(238, 47, 56, 0.11);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 248, 250, 0.72)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.08), transparent 38%);
  box-shadow: 0 14px 34px rgba(35, 35, 38, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.portal-key-card span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.portal-key-card strong {
  display: block;
  margin-top: 3px;
  color: #2c2c30;
  font-size: 22px;
  font-weight: 560;
}

.portal-key-card p {
  margin: 4px 0 0;
  color: #747478;
  font-size: 12.5px;
}

.portal-key-card-progress .portal-progress-rail {
  width: min(420px, 100%);
}

.portal-key-card:not(.processed) > .primary {
  min-width: 190px;
}

.portal-line-progress {
  --line-color: #c91f2b;
  display: grid;
  gap: 9px;
  width: min(520px, 100%);
  padding: 10px 12px 9px;
  border: 1px solid rgba(220, 224, 232, 0.62);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(35, 35, 38, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.portal-line-progress.good {
  --line-color: #17804b;
}

.portal-line-progress.warn {
  --line-color: #d6a42a;
}

.portal-line-progress.bad {
  --line-color: #c91f2b;
}

.portal-line-progress div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: center;
}

.portal-line-progress strong {
  color: var(--line-color);
  font-size: 15px;
  font-weight: 820;
}

.portal-line-progress span {
  color: #2d2d30;
  font-size: 13px;
  font-weight: 680;
  text-transform: none;
}

.portal-line-progress em {
  color: #5d5d62;
  font-size: 13px;
  font-style: normal;
  font-weight: 680;
}

.portal-line-progress i {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: rgba(198, 207, 226, 0.7);
}

.portal-line-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--line-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--line-color) 26%, transparent);
}

.processed-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.processed-actions button {
  min-width: 0;
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
}

.portal-key-picker,
.portal-key-hero,
.portal-key-meter {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 14px 28px rgba(35, 35, 38, 0.06);
  backdrop-filter: blur(18px);
}

.portal-key-picker label {
  display: grid;
  gap: 8px;
  color: #4b4b4f;
  font-size: 12px;
  font-weight: 680;
}

.portal-key-picker input,
.portal-key-picker.compact input {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(190, 31, 40, 0.22);
  border-radius: 14px;
  color: #303034;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 242, 244, 0.78)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 12px 26px rgba(190, 31, 40, 0.08);
  font-size: 15px;
  font-weight: 520;
}

.portal-key-picker input::placeholder,
.portal-key-picker.compact input::placeholder {
  color: #9b9ba0;
}

.portal-key-picker input:focus,
.portal-key-picker.compact input:focus {
  outline: none;
  border-color: rgba(238, 47, 56, 0.46);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(255, 236, 239, 0.86)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 42%);
  box-shadow: 0 0 0 4px rgba(238, 47, 56, 0.12), 0 16px 32px rgba(190, 31, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.portal-key-picker.compact {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  width: min(430px, 42vw);
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: #5a5a60;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.84), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 240, 242, 0.82) 56%, rgba(226, 226, 229, 0.76));
  box-shadow:
    0 18px 36px rgba(35, 35, 38, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -18px 36px rgba(80, 80, 86, 0.05);
  backdrop-filter: blur(18px) saturate(150%);
  font-size: 12px;
  font-weight: 720;
}

.portal-key-picker.compact::before {
  position: absolute;
  inset: 1px;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.62), transparent 28%, rgba(255, 255, 255, 0.2) 50%, transparent 70%),
    repeating-radial-gradient(circle at 20% 20%, rgba(120, 120, 126, 0.08) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  opacity: 0.5;
}

.portal-key-picker.compact > * {
  position: relative;
  z-index: 1;
}

.portal-key-picker.compact input {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.54);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 247, 0.82)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 42%);
  box-shadow:
    inset 0 2px 4px rgba(116, 12, 22, 0.12),
    0 12px 26px rgba(87, 8, 16, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.portal-key-search-hint,
.portal-key-hero p {
  margin-top: 8px;
  color: #77777b;
  font-size: 12px;
}

.portal-key-hero span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.portal-key-hero strong {
  display: block;
  margin-top: 4px;
  color: var(--charcoal);
  font-size: 24px;
  font-weight: 540;
}

.portal-key-meter {
  display: grid;
  align-content: center;
}

.portal-progress {
  position: relative;
  overflow: hidden;
  min-width: 118px;
  height: 30px;
  border-radius: 12px;
  background: rgba(235, 235, 237, 0.92);
  box-shadow: inset 0 1px 2px rgba(20, 20, 22, 0.08);
}

.portal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.portal-progress.good span {
  background: linear-gradient(135deg, #49c77b, #17844e);
}

.portal-progress.warn span {
  background: linear-gradient(135deg, #ffd66d, #d1991b);
}

.portal-progress.bad span {
  background: linear-gradient(135deg, #ff7780, #c22631);
}

.portal-progress strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #2d2d30;
  font-size: 11px;
  font-weight: 800;
}

.client-bill-head {
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(180px, 0.56fr) minmax(330px, 1fr);
  align-items: center;
}

.client-bill-head h3 {
  color: #242428;
  font-family: "Apple Gothic", "Apple SD Gothic Neo", "Roboto Light", "Segoe UI Light", "Arial", sans-serif;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0;
}

.portal-active-key {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #303034;
}

.portal-active-key span {
  color: var(--accent-dark);
  font-size: 10.5px;
  font-weight: 760;
  text-transform: uppercase;
}

.portal-active-key strong {
  color: #29292d;
  font-size: 18px;
  font-weight: 520;
}

.portal-progress-rail {
  --rail-color: #2e63d6;
  position: relative;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  width: min(620px, 82%);
  margin: 8px auto 2px;
}

.portal-progress-rail::before {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 2px;
  content: "";
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--rail-color) var(--progress), rgba(207, 214, 232, 0.58) var(--progress));
}

.portal-progress-rail i {
  position: relative;
  z-index: 1;
  display: block;
  width: 9px;
  height: 9px;
  margin: auto;
  border-radius: 999px;
  background: rgba(193, 202, 230, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.portal-progress-rail i.active {
  background: var(--rail-color);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.74), 0 4px 10px color-mix(in srgb, var(--rail-color) 32%, transparent);
}

.portal-progress-rail.bad {
  --rail-color: #c91f2b;
}

.portal-progress-rail.warn {
  --rail-color: #d6a42a;
}

.portal-progress-rail.good {
  --rail-color: #17804b;
}

.portal-progress-bubble {
  position: absolute;
  left: var(--progress);
  bottom: 13px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 5px;
  color: #fff;
  background: var(--rail-color);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  transform: translateX(-50%);
  box-shadow: 0 8px 18px rgba(35, 35, 38, 0.12);
}

.portal-progress-bubble::after {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 0;
  height: 0;
  content: "";
  border: 4px solid transparent;
  border-top-color: var(--rail-color);
  transform: translateX(-50%);
}

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

.client-bill-head strong {
  display: block;
  color: var(--charcoal);
  font-size: 20px;
}

.client-bill-panel .client-bill-head {
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(180px, 0.56fr) minmax(360px, 1fr);
  justify-content: stretch;
  align-items: center;
}

.client-bill-panel .client-bill-head h3 {
  color: #242428;
  font-family: "Apple Gothic", "Apple SD Gothic Neo", "Roboto Light", "Segoe UI Light", Arial, sans-serif;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0;
}

.client-bill-panel .portal-key-picker.compact {
  justify-self: end;
  width: min(460px, 44vw);
}

.portal-workboard {
  display: block;
  gap: 14px;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 22px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.portal-workboard::-webkit-scrollbar {
  height: 14px;
}

.portal-workboard::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(226, 226, 229, 0.82);
}

.portal-workboard::-webkit-scrollbar-thumb {
  border: 3px solid rgba(226, 226, 229, 0.82);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(172, 31, 42, 0.9), rgba(60, 60, 64, 0.9));
}

.portal-bill-card {
  display: grid;
  grid-template-columns: 470px max-content;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  margin-bottom: 14px;
  overflow: visible;
  border: 1px solid rgba(238, 47, 56, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 44px rgba(35, 35, 38, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.portal-bill-card.progress-empty {
  background: linear-gradient(135deg, rgba(255, 238, 241, 0.92), rgba(255, 251, 252, 0.86));
  border-color: rgba(238, 47, 56, 0.18);
}

.portal-bill-card.progress-partial {
  background: linear-gradient(135deg, rgba(255, 248, 219, 0.94), rgba(255, 253, 246, 0.86));
  border-color: rgba(210, 155, 24, 0.26);
}

.portal-bill-card.progress-complete {
  background: linear-gradient(135deg, rgba(226, 251, 237, 0.96), rgba(247, 255, 250, 0.88));
  border-color: rgba(23, 128, 75, 0.34);
}

.portal-bill-card.stage-ready {
  border-color: rgba(25, 137, 80, 0.32);
}

.portal-bill-card.stage-pending {
  border-color: rgba(190, 31, 40, 0.16);
}

.portal-bill-ro {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  height: 142px;
  padding: 14px 16px;
  color: #6f1b22;
  background:
    linear-gradient(145deg, rgba(255, 238, 241, 0.98), rgba(255, 248, 249, 0.86)),
    radial-gradient(circle at top left, rgba(238, 47, 56, 0.12), transparent 40%);
}

.portal-row-ring {
  --ring-color: #c91f2b;
  position: absolute;
  top: 13px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.94) 0 56%, transparent 57%),
    conic-gradient(var(--ring-color) var(--ring-progress), rgba(215, 219, 229, 0.7) 0);
  box-shadow: 0 8px 18px rgba(35, 35, 38, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.portal-row-ring span {
  color: #2d2d30;
  font-size: 11px;
  font-weight: 780;
  line-height: 1;
}

.portal-row-ring.bad {
  --ring-color: #c91f2b;
}

.portal-row-ring.warn {
  --ring-color: #d6a42a;
}

.portal-row-ring.good {
  --ring-color: #17804b;
}

.portal-bill-card.stage-ready .portal-bill-ro {
  color: #12643c;
  background: linear-gradient(145deg, rgba(232, 252, 239, 0.98), rgba(247, 255, 250, 0.88));
}

.portal-bill-card.stage-vts .portal-bill-ro,
.portal-bill-card.stage-rate .portal-bill-ro,
.portal-bill-card.stage-bill .portal-bill-ro {
  color: #7a520b;
  background: linear-gradient(145deg, rgba(255, 248, 220, 0.98), rgba(255, 253, 244, 0.86));
}

.portal-stage-pill {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #e9525b, #a71924);
  font-size: 10.5px;
  font-weight: 780;
  text-transform: uppercase;
}

.stage-printed .portal-stage-pill {
  background: linear-gradient(135deg, #55cc82, #13804b);
}

.stage-ready .portal-stage-pill {
  background: linear-gradient(135deg, #48c77a, #16804b);
}

.stage-vts .portal-stage-pill,
.stage-rate .portal-stage-pill,
.stage-bill .portal-stage-pill {
  background: linear-gradient(135deg, #ffd35f, #b97a0c);
}

.portal-bill-ro strong {
  max-width: calc(100% - 78px);
  color: inherit;
  font-size: 22px;
  line-height: 1.08;
  font-weight: 620;
}

.portal-bill-ro p,
.portal-bill-ro small {
  max-width: calc(100% - 78px);
  margin: 0;
  color: inherit;
  opacity: 0.82;
  font-size: 15px;
  font-weight: 520;
}

.portal-ro-number {
  font-size: 12px !important;
  font-weight: 760 !important;
  opacity: 0.7 !important;
}

.portal-date-line {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #3d3d41;
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 720;
}

.portal-date-size-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  margin-top: auto;
}

.portal-size-badge {
  width: fit-content;
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 999px;
  color: #3d3d41;
  border: 0;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 720;
}

.portal-rate-box {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.portal-rate-box label,
.portal-field,
.portal-milestone {
  display: grid;
  gap: 8px;
  color: #343438;
  font-size: 13px;
  font-weight: 620;
}

.portal-rate-box span {
  font-size: 14px;
  font-weight: 760;
}

.portal-bill-fields {
  display: grid;
  grid-template-columns: 170px 190px 190px 230px 180px 220px 220px;
  gap: 8px;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  padding: 10px;
}

.portal-field,
.portal-milestone,
.portal-system-cell {
  height: 142px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(245, 245, 247, 0.68)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 38%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 24px rgba(35, 35, 38, 0.06);
  backdrop-filter: blur(16px);
}

.portal-milestone.done {
  border-color: rgba(23, 128, 75, 0.38);
  background:
    linear-gradient(135deg, rgba(223, 251, 235, 0.98), rgba(247, 255, 250, 0.84)),
    radial-gradient(circle at top left, rgba(87, 205, 129, 0.18), transparent 42%);
}

.portal-milestone {
  align-content: start;
  overflow: hidden;
}

.portal-field {
  overflow: hidden;
}

.portal-field.pub-bill-amount {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.portal-field.pub-bill-amount.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.portal-field.locked {
  color: #4a4a4e;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(238, 238, 240, 0.62)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.84), transparent 42%);
}

.portal-field.locked span {
  color: #8b1e28;
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.portal-field.locked strong {
  color: #2e2e32;
  font-size: 16px;
  line-height: 1.2;
}

.portal-field.rate-value em {
  color: #8b1e28;
  font-size: 14px;
  font-style: normal;
  font-weight: 820;
}

.portal-field.rate-value strong {
  font-size: 21px;
}

.portal-milestone label:not(.portal-switch-row) {
  display: flex;
  align-items: center;
  gap: 7px;
  color: inherit;
}

.portal-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  color: #343438;
}

.portal-switch-row span {
  font-size: 13px;
  font-weight: 760;
}

.portal-switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-switch-row i {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 24px;
  border: 1px solid rgba(190, 31, 40, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 230, 233, 0.96), rgba(218, 50, 61, 0.88));
  box-shadow: inset 0 1px 3px rgba(92, 12, 20, 0.16), 0 8px 16px rgba(190, 31, 40, 0.12);
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.portal-switch-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  content: "";
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 8px rgba(35, 35, 38, 0.22);
  transition: transform 0.22s ease;
}

.portal-switch-row input:checked + i {
  border-color: rgba(23, 128, 75, 0.28);
  background: linear-gradient(135deg, rgba(218, 251, 232, 0.96), rgba(36, 166, 91, 0.9));
  box-shadow: inset 0 1px 3px rgba(13, 86, 49, 0.14), 0 8px 16px rgba(23, 128, 75, 0.14);
}

.portal-switch-row input:checked + i::after {
  transform: translateX(24px);
}

.portal-file-fields {
  display: grid;
  gap: 6px;
  margin-top: 7px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px) scaleY(0.96);
  transform-origin: top;
  transition: max-height 0.34s ease, opacity 0.24s ease, transform 0.34s ease;
}

.portal-milestone.done .portal-file-fields {
  max-height: 86px;
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

.portal-bill-fields input,
.portal-bill-fields select,
.portal-bill-fields textarea,
.portal-rate-box input {
  width: 100%;
  min-height: 31px;
  border: 1px solid rgba(185, 185, 190, 0.42);
  border-radius: 10px;
  color: #2e2e32;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 244, 246, 0.82)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.84), transparent 40%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(35, 35, 38, 0.05);
  font-size: 12px;
  font-weight: 430;
}

.portal-bill-fields select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 244, 246, 0.82)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.84), transparent 40%),
    linear-gradient(45deg, transparent 50%, #aa1f29 50%),
    linear-gradient(135deg, #aa1f29 50%, transparent 50%);
  background-position: 0 0, 0 0, calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: auto, auto, 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.portal-bill-fields input:focus,
.portal-bill-fields select:focus,
.portal-bill-fields textarea:focus,
.portal-rate-box input:focus {
  border-color: rgba(190, 31, 40, 0.42);
  box-shadow: 0 0 0 4px rgba(238, 47, 56, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.portal-bill-fields input[type="checkbox"] {
  width: auto;
  min-height: 0;
  accent-color: #17804b;
}

.portal-field.remarks textarea {
  min-height: 76px;
}

.portal-system-cell {
  display: grid;
  gap: 6px;
}

.portal-system-cell span,
.portal-system-cell small {
  color: #66666a;
  font-size: 13px;
}

.portal-system-cell strong {
  color: var(--charcoal);
  font-size: 17px;
}

.portal-difference {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 12px;
  color: #46464a;
  background: rgba(235, 235, 237, 0.9);
  font-size: 14px;
  font-style: normal;
  font-weight: 760;
}

.portal-difference.favor {
  color: #fff;
  background: linear-gradient(135deg, #4fc77d, #13804b);
  box-shadow: 0 10px 24px rgba(19, 128, 75, 0.22);
  animation: portalDifferenceBlink 1.05s ease-in-out infinite;
}

.portal-difference.against {
  color: #fff;
  background: linear-gradient(135deg, #f1545d, #a91420);
  box-shadow: 0 10px 24px rgba(190, 31, 40, 0.22);
  animation: portalDifferenceBlink 1.05s ease-in-out infinite;
}

.portal-difference.neutral {
  color: #68686d;
  background: rgba(232, 232, 234, 0.9);
  box-shadow: none;
}

@keyframes portalDifferenceBlink {
  0%,
  100% {
    filter: brightness(1);
    transform: scale(1);
  }

  50% {
    filter: brightness(1.25);
    transform: scale(1.025);
  }
}

@media print {
  @page {
    size: A4 landscape;
  }

  .client-key-print .portal-bill-table {
    min-width: 0;
    width: 100%;
  }
}

.schedule-cancel-stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  padding: 5px 14px;
  border: 2px solid rgba(140, 18, 26, 0.72);
  color: rgba(140, 18, 26, 0.78);
  font-size: 18px;
  font-weight: 860;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-18deg);
  pointer-events: none;
}

.schedule-missed-ribbon {
  position: absolute;
  left: -25px;
  top: 10px;
  z-index: 2;
  width: 92px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #f04b55 0%, #a9141e 100%);
  box-shadow: 0 8px 16px rgba(190, 31, 40, 0.18);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-45deg);
  pointer-events: none;
}

.schedule-item.cancelled .schedule-main,
.schedule-item.cancelled .schedule-actions {
  opacity: 0.42;
}

.schedule-item span,
.schedule-empty {
  font-size: 12px;
  color: #6f6f73;
}

.schedule-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(22, 22, 24, 0.42);
  backdrop-filter: blur(16px);
}

.schedule-preview-panel {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 70px rgba(22, 22, 24, 0.28);
}

.schedule-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(190, 31, 40, 0.1);
}

.schedule-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.schedule-preview-action {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 740;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-preview-action:hover {
  transform: translateY(-1px);
}

.schedule-preview-action.print {
  background: linear-gradient(135deg, rgba(255, 84, 94, 0.96), rgba(174, 20, 31, 0.98));
  box-shadow: 0 12px 24px rgba(190, 31, 40, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.schedule-preview-action.shift {
  color: #7a520b;
  background: linear-gradient(135deg, #fff7d8, #ffd979);
  border: 1px solid rgba(190, 136, 16, 0.32);
}

.schedule-preview-scroll {
  max-height: calc(92vh - 58px);
  overflow: auto;
  padding: 18px;
}

.schedule-preview-doc {
  transform-origin: top center;
}

.schedule-pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 52;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 18, 20, 0.38);
  backdrop-filter: blur(18px) saturate(140%);
}

.schedule-pin-card {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 246, 248, 0.82));
  box-shadow: 0 30px 72px rgba(22, 22, 24, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.schedule-pin-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #4a4a4f;
  background: rgba(230, 230, 232, 0.78);
  font-size: 17px;
  font-weight: 520;
  line-height: 1;
}

.schedule-pin-copy {
  display: grid;
  justify-items: start;
  max-width: 420px;
}

.schedule-pin-copy span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.schedule-pin-copy h3 {
  margin: 4px 0 8px;
  color: #202024;
  font-size: 23px;
  font-weight: 760;
}

.schedule-pin-copy p {
  margin: 0 0 14px;
  color: #5a5a60;
  font-size: 15px;
  line-height: 1.5;
}

.schedule-pin-copy input {
  width: 160px;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid rgba(104, 104, 110, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #202024;
  font-size: 18px;
  font-weight: 760;
  text-align: center;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 10px 22px rgba(22, 22, 24, 0.08);
}

.schedule-pin-copy input:focus {
  outline: none;
  border-color: rgba(238, 47, 56, 0.42);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.schedule-pin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.client-portal-pin-overlay .schedule-pin-card {
  width: min(560px, 100%);
}

.client-portal-pin-overlay .schedule-pin-copy input {
  width: min(260px, 100%);
}

.quick-message {
  position: fixed;
  left: 50%;
  top: 24px;
  z-index: 80;
  min-width: 150px;
  padding: 11px 16px;
  border-radius: 14px;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 760;
  transform: translateX(-50%);
  animation: quickMessageIn 0.18s ease both;
  box-shadow: 0 16px 34px rgba(22, 22, 24, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.quick-message.bad {
  background: linear-gradient(135deg, #ff4b55, #b91623);
}

@keyframes quickMessageIn {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.confetti-burst {
  position: fixed;
  z-index: 70;
  pointer-events: none;
}

.confetti-burst span {
  position: absolute;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  background: hsl(calc(var(--i) * 28), 84%, 58%);
  animation: confettiPop 0.85s ease-out forwards;
}

@keyframes confettiPop {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(calc(var(--x) * 92px), calc(var(--y) * 76px + 38px)) rotate(260deg) scale(0.72);
  }
}

.schedule-item strong {
  font-size: 13px;
  color: #2d2d30;
}

.bulk-panel .panel-head > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-draft-notice {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 0 18px 14px;
  padding: 8px 13px;
  border: 1px solid rgba(34, 132, 75, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(228, 250, 236, 0.94), rgba(204, 239, 217, 0.78));
  color: #145c34;
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 12px 28px rgba(28, 126, 72, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.bulk-draft-notice em {
  color: #376a4b;
  font-style: normal;
  font-weight: 650;
}

.bulk-discard-draft {
  min-height: 26px;
  padding: 5px 10px;
  border: 1px solid rgba(190, 31, 40, 0.18);
  border-radius: 999px;
  color: #8c121a;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 230, 233, 0.82));
  font-size: 11px;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 8px 18px rgba(190, 31, 40, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.bulk-discard-draft:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff4f59, #b51d28);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(190, 31, 40, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

body.theme-night .bulk-draft-notice {
  border-color: rgba(109, 217, 151, 0.2);
  background: linear-gradient(135deg, rgba(30, 77, 56, 0.82), rgba(20, 54, 41, 0.9));
  color: #d8f8e4;
}

body.theme-night .bulk-draft-notice em {
  color: #aee5c3;
}

body.theme-night .bulk-discard-draft {
  color: #ffd5d8;
  border-color: rgba(255, 108, 116, 0.24);
  background: linear-gradient(135deg, rgba(105, 34, 42, 0.76), rgba(64, 24, 30, 0.88));
}

body.theme-night .bulk-discard-draft:hover {
  color: #fff;
  background: linear-gradient(135deg, #fb4a54, #a9141e);
}

body.theme-night .bulk-panel {
  border-color: rgba(120, 168, 220, 0.16);
  background:
    radial-gradient(circle at 86% 0%, rgba(238, 47, 56, 0.1), transparent 30%),
    linear-gradient(145deg, rgba(17, 30, 49, 0.96), rgba(8, 16, 30, 0.96));
}

body.theme-night .bulk-panel .panel-head {
  border-color: rgba(120, 168, 220, 0.12);
  background: linear-gradient(135deg, rgba(19, 35, 58, 0.92), rgba(11, 20, 36, 0.88));
}

body.theme-night .bulk-panel .panel-head h3 {
  color: #f8fbff;
}

body.theme-night .bulk-shared {
  border-color: rgba(120, 168, 220, 0.12);
  background:
    radial-gradient(circle at top right, rgba(69, 118, 180, 0.13), transparent 36%),
    linear-gradient(135deg, rgba(18, 33, 54, 0.94), rgba(10, 20, 36, 0.96));
}

body.theme-night .bulk-shared label,
body.theme-night .bulk-table th,
body.theme-night .bulk-size-selector {
  color: #dceeff;
}

body.theme-night .bulk-shared .field-hint {
  color: #a9c5df;
}

body.theme-night .bulk-shared input,
body.theme-night .bulk-table input,
body.theme-night .bulk-table select {
  color: #f8fbff;
  border-color: rgba(150, 185, 222, 0.16);
  background: linear-gradient(135deg, rgba(39, 55, 78, 0.94), rgba(24, 38, 60, 0.96));
}

body.theme-night .bulk-shared input::placeholder,
body.theme-night .bulk-table input::placeholder {
  color: #9db0c8;
}

body.theme-night .bulk-table th {
  background: linear-gradient(135deg, rgba(83, 33, 53, 0.94), rgba(49, 22, 42, 0.96));
}

body.theme-night .bulk-size-toggle {
  border-color: rgba(150, 185, 222, 0.14);
  background: linear-gradient(135deg, rgba(34, 50, 73, 0.94), rgba(18, 31, 50, 0.96));
}

body.theme-night .bulk-size-toggle button {
  color: #b9cce1;
}

body.theme-night .bulk-multiple-size-field span,
body.theme-night .bulk-size-modal-table th {
  color: #f6dce0;
}

body.theme-night .bulk-size-modal-table input {
  color: #f8fbff;
  border-color: rgba(150, 185, 222, 0.16);
  background: linear-gradient(135deg, rgba(39, 55, 78, 0.94), rgba(24, 38, 60, 0.96));
}

body.theme-night .ro-bulk-reprint-panel {
  border-color: rgba(120, 168, 220, 0.16);
  background:
    radial-gradient(circle at 90% 0%, rgba(238, 47, 56, 0.08), transparent 32%),
    linear-gradient(135deg, rgba(18, 33, 54, 0.94), rgba(10, 20, 36, 0.96));
}

body.theme-night .ro-bulk-selector-card {
  border-color: rgba(150, 185, 222, 0.13);
  background: rgba(28, 43, 66, 0.74);
}

body.theme-night .ro-bulk-selector-card > span {
  color: #ffb8c0;
}

body.theme-night .ro-bulk-selector-card label {
  color: #dceeff;
}

body.theme-night .ro-bulk-selector-card input {
  color: #f8fbff;
  border-color: rgba(150, 185, 222, 0.16);
  background: linear-gradient(135deg, rgba(39, 55, 78, 0.94), rgba(24, 38, 60, 0.96));
}

body.theme-night .bulk-row-actions,
body.theme-night .bulk-add-count {
  color: #dceeff;
  background: transparent;
}

body.theme-night .ro-series-gap-strip em {
  color: rgba(255, 205, 210, 0.78);
}

body.theme-night input[data-ro-number-locked] {
  color: #f1f5fb;
  background: linear-gradient(135deg, rgba(42, 52, 66, 0.92), rgba(25, 35, 49, 0.96));
  border-color: rgba(255, 255, 255, 0.12);
}

.bulk-shared {
  display: grid;
  grid-template-columns: repeat(5, minmax(135px, 1fr));
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.34);
}

.bulk-shared label {
  display: grid;
  gap: 6px;
  color: #4f4b44;
  font-size: 13px;
  font-weight: 650;
}

.bulk-shared input,
.bulk-shared textarea,
.bulk-table input,
.bulk-table select {
  min-height: 36px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
}

.bulk-shared textarea {
  min-height: 58px;
  resize: vertical;
  line-height: 1.35;
}

.bulk-common-final-remarks {
  grid-column: span 3;
}

.bulk-size-selector {
  display: grid;
  gap: 6px;
  color: #4f4b44;
  font-size: 13px;
  font-weight: 700;
}

.bulk-size-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 38px;
  padding: 4px;
  border: 1px solid rgba(122, 28, 38, 0.12);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(245, 245, 246, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bulk-size-toggle button {
  border: 0;
  border-radius: 999px;
  color: #777;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.bulk-size-toggle button:hover {
  transform: translateY(-1px);
}

.bulk-size-toggle button.active.single {
  color: #0f6b34;
  background: linear-gradient(135deg, #dff7e7, #bdeccf);
  box-shadow: 0 10px 24px rgba(33, 139, 76, 0.18);
}

.bulk-size-toggle button.active.multiple {
  color: #4c1d95;
  background: linear-gradient(135deg, #f3e8ff, #ddd6fe);
  box-shadow: 0 10px 24px rgba(109, 40, 217, 0.16);
}

.bulk-multiple-size-field {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 12px;
  min-width: 0;
}

.bulk-multiple-size-field span {
  color: #4c1d95;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.danger-gradient {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
}

.bulk-multiple-size-field .danger-gradient {
  width: auto;
  min-width: 128px;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 999px;
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(99, 102, 241, 0.24);
}

.bulk-size-editor {
  display: grid;
  gap: 16px;
}

.bulk-size-modal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.bulk-size-modal-table th {
  color: #7d1118;
  text-align: left;
  font-size: 13px;
}

.bulk-size-modal-table td {
  padding: 0 6px;
}

.bulk-size-modal-table input {
  min-height: 44px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.bulk-table {
  min-width: 1380px;
  table-layout: fixed;
}

.bulk-table th,
.bulk-table td {
  padding: 8px;
  font-size: 13px;
}

.bulk-table th:nth-child(1),
.bulk-table td:nth-child(1) {
  width: 270px;
}

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

.bulk-table th:nth-child(3),
.bulk-table td:nth-child(3) {
  width: 230px;
}

.bulk-table th:nth-child(4),
.bulk-table td:nth-child(4),
.bulk-table th:nth-child(5),
.bulk-table td:nth-child(5) {
  width: 135px;
}

.bulk-table th:nth-child(6),
.bulk-table td:nth-child(6) {
  width: 190px;
}

.bulk-table th:nth-child(7),
.bulk-table td:nth-child(7) {
  width: 120px;
}

.bulk-table th:nth-child(8),
.bulk-table td:nth-child(8) {
  width: 190px;
}

.bulk-table th:nth-child(9),
.bulk-table td:nth-child(9) {
  width: 96px;
}

.bulk-row.is-duplicate-publication td {
  background: #AECFF2;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.bulk-row.is-duplicate-publication input,
.bulk-row.is-duplicate-publication select {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(69, 127, 193, 0.38);
}

.bulk-row.is-merged-publication td {
  background: #dff7e8;
  box-shadow: inset 0 1px 0 rgba(51, 142, 83, 0.18), inset 0 -1px 0 rgba(51, 142, 83, 0.14);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.bulk-row.is-merged-publication input,
.bulk-row.is-merged-publication select {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(54, 148, 86, 0.28);
}

.bulk-publication-cell {
  position: relative;
  display: block;
  width: 100%;
}

.bulk-publication-cell input {
  min-width: 0;
  width: 100%;
}

.bulk-publication-cell:has(.ncr-source-serial) input {
  padding-left: 58px;
}

.ncr-source-serial {
  position: absolute;
  top: 50%;
  left: 8px;
  z-index: 2;
  transform: translateY(-50%);
  padding: 4px 7px;
  border: 1px solid rgba(92, 74, 164, 0.24);
  border-radius: 7px;
  background: rgba(238, 233, 255, 0.94);
  color: #55438f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.bulk-row.is-duplicate-publication .bulk-publication-cell input {
  padding-right: 76px;
}

.bulk-merge-btn {
  position: absolute;
  top: 50%;
  right: 7px;
  z-index: 2;
  transform: translateY(-50%);
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(58, 118, 187, 0.34);
  border-radius: 9px;
  background: linear-gradient(135deg, #4d86ca, #79aee7);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(78, 135, 201, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  animation: bulkMergePulse 1.1s ease-in-out infinite;
  transition: box-shadow 160ms ease;
}

.bulk-merge-btn:hover {
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 13px 28px rgba(78, 135, 201, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.bulk-merge-btn[hidden] {
  display: none;
}

/* Beta Features: deliberately isolated from the live RO workflow. */
.nav-group:has([data-view="betaFeatures"]) > .nav-main {
  background: linear-gradient(135deg, #f8d65b, #d9a51f);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 24px rgba(170,122,15,.16);
}

.beta-features-panel { overflow: hidden; }
.beta-feature-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; padding:20px; }
.beta-feature-card { min-height:250px; padding:28px; border:1px solid rgba(185,52,58,.14); border-radius:18px; background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(250,240,241,.9)); box-shadow:0 16px 34px rgba(54,35,41,.1); display:flex; flex-direction:column; align-items:flex-start; }
.beta-feature-card.batch { background:linear-gradient(145deg,#fffdf7,#fff0d7); border-color:rgba(181,126,25,.24); }
.beta-feature-card span,.beta-entry-panel .eyebrow,.beta-sample-results .eyebrow { color:#a51f2c; font-size:11px; font-weight:800; letter-spacing:.04em; }
.beta-feature-card h3 { margin:9px 0 11px; color:#2b2d34; font-size:25px; }
.beta-feature-card p { margin:0 0 24px; color:#62646b; line-height:1.55; max-width:520px; }
.beta-feature-card .primary { margin-top:auto; }
.beta-feature-card.ncr-reader { max-width:920px; min-height:280px; background:linear-gradient(145deg,rgba(255,255,255,.99),rgba(246,249,255,.95)); border-color:rgba(71,111,166,.2); }
.beta-feature-points { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 24px; padding:0; list-style:none; }
.beta-feature-points li { padding:7px 10px; border:1px solid rgba(61,116,173,.17); border-radius:999px; background:#f2f7fd; color:#40556c; font-size:12px; }
.beta-badge { border-color:#e4af35; color:#815900; background:#fff3c8; }
.beta-sandbox-notice { border-color:#dfb04b; background:linear-gradient(100deg,#fff9de,#fff1c7); color:#6b4c00; }
.beta-entry-panel { margin:16px 18px 4px; padding:17px 19px; border:1px solid rgba(143,78,91,.18); border-radius:16px; background:linear-gradient(135deg,rgba(255,255,255,.95),rgba(255,243,244,.88)); display:flex; align-items:center; justify-content:space-between; gap:18px; }
.beta-entry-panel h4 { margin:5px 0 6px; color:#2d2d32; font-size:18px; }
.beta-entry-panel p { margin:0; max-width:750px; color:#65666b; font-size:13px; line-height:1.45; }
.beta-entry-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; }
.file-action { display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.beta-purple-btn { border:1px solid #5146c9; border-radius:12px; padding:11px 15px; background:linear-gradient(135deg,#7a70ff,#4f46e5); color:#fff; box-shadow:0 10px 20px rgba(79,70,229,.23); font-weight:800; cursor:pointer; }
.batch-builder-panel { display:block; }
.batch-client-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:15px; }
.batch-client-card { min-height:128px; padding:15px; text-align:left; border:1px solid rgba(202,142,33,.24); border-radius:14px; background:linear-gradient(135deg,#fffdf7,#fff0d3); color:#312f28; cursor:pointer; transition:transform .22s ease, box-shadow .22s ease; }
.batch-client-card:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 14px 25px rgba(132,99,28,.14); }
.batch-client-card span,.batch-client-card em,.batch-client-card b { display:block; }
.batch-client-card span { color:#a06911; font-size:10px; font-weight:900; letter-spacing:.04em; }
.batch-client-card strong { display:block; margin:6px 0; font-size:16px; }
.batch-client-card em { color:#6c6961; font-size:12px; font-style:normal; line-height:1.35; }
.batch-client-card b { margin-top:10px; color:#a51f2c; font-size:12px; }
.batch-client-card.empty { opacity:.55; cursor:not-allowed; }
.beta-paste-area { display:block; width:100%; min-height:180px; margin-top:14px; padding:12px; border:1px solid #ddc5ca; border-radius:12px; resize:vertical; font:13px/1.45 Arial,sans-serif; }
.beta-sample-results .toolbar { justify-content:flex-end; margin:18px; }
.beta-sample-table { width:100%; border-collapse:collapse; min-width:880px; }
.beta-sample-table th { background:#fff1f2; color:#8e2028; text-align:left; }
.beta-sample-table th,.beta-sample-table td { padding:12px 13px; border-bottom:1px solid #eadfe1; font-size:13px; }
.beta-sample-table td:first-child { color:#6f42c1; font-weight:900; }

.ncr-wo-reader-panel { overflow:visible; }
.ncr-wo-upload-zone { display:grid; grid-template-columns:minmax(340px,1fr) auto auto; align-items:center; gap:12px; padding:20px; }
.ncr-wo-file-picker { min-height:92px; padding:16px 18px; border:1.5px dashed rgba(173,42,52,.34); border-radius:14px; background:linear-gradient(135deg,#fff,#fff6f7); display:grid; grid-template-columns:auto 1fr; column-gap:12px; align-items:center; cursor:pointer; }
.ncr-wo-file-picker .material-symbols-rounded { grid-row:1 / span 2; color:#b32832; font-size:34px; }
.ncr-wo-file-picker strong { overflow:hidden; color:#30343b; font-size:15px; text-overflow:ellipsis; white-space:nowrap; }
.ncr-wo-file-picker small { color:#777b83; font-size:12px; }
.ncr-wo-progress { grid-column:1 / -1; min-height:20px; color:#6f4d52; font-size:12px; font-weight:700; }
.ncr-wo-meta-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0 20px 14px; }
.ncr-wo-meta-grid > div { min-height:78px; padding:13px 15px; border:1px solid rgba(139,74,85,.14); border-radius:12px; background:linear-gradient(145deg,#fff,#f7f8fa); }
.ncr-wo-meta-grid span,.ncr-wo-meta-grid strong { display:block; }
.ncr-wo-meta-grid span { margin-bottom:7px; color:#797c83; font-size:11px; font-weight:700; text-transform:uppercase; }
.ncr-wo-meta-grid strong { color:#282b31; font-size:15px; }
.ncr-wo-status-strip { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 20px 14px; padding:10px 12px; border-radius:11px; background:#f7f8fa; }
.ncr-wo-status-strip span,.ncr-wo-status-strip b { padding:6px 9px; border-radius:999px; font-size:11px; }
.ncr-wo-status-strip .matched { background:#dff5e7; color:#226b41; }
.ncr-wo-status-strip .review { background:#fff0bd; color:#805d04; }
.ncr-wo-status-strip .missing,.ncr-wo-status-strip b { background:#ffe2e4; color:#a51e2a; }
.ncr-wo-review-table { width:100%; min-width:1080px; border-collapse:separate; border-spacing:0; }
.ncr-wo-review-table th { position:sticky; top:0; z-index:2; padding:11px 12px; background:#402631; color:#fff; text-align:left; font-size:12px; }
.ncr-wo-review-table td { position:relative; padding:10px 12px; border-bottom:1px solid #e4e6e9; color:#33373e; vertical-align:middle; font-size:13px; }
.ncr-wo-review-table input,.ncr-wo-review-table select { width:100%; min-height:40px; padding:8px 10px; border:1px solid #d7d9de; border-radius:9px; background:#fff; color:#282b31; font:inherit; }
.ncr-wo-review-table tr.confidence-review td { background:#ffe36b; color:#3d3100; }
.ncr-wo-review-table tr.confidence-missing td { background:#ffd05a; color:#492600; }
.ncr-wo-review-table tr.ncr-wo-duplicate td { background:#aecff2; }
.ncr-wo-review-table tr.ncr-wo-duplicate input,.ncr-wo-review-table tr.ncr-wo-duplicate select { border-color:#79a8d5; background:rgba(255,255,255,.82); }
.ncr-wo-review-table tr.ncr-wo-duplicate.confidence-review td { background:#ffe36b; }
.ncr-wo-review-table tr.ncr-wo-duplicate.confidence-missing td { background:#ffd05a; }
.ncr-wo-review-table input.needs-attention {
  border:2px solid transparent;
  background:linear-gradient(#fffef5,#fffef5) padding-box,linear-gradient(135deg,#ffd400,#ff8a00) border-box;
  box-shadow:0 0 0 3px rgba(255,193,7,.28),0 0 18px rgba(255,138,0,.52);
  animation:ncrAttentionGlow 1.4s ease-in-out infinite;
}
.ncr-wo-original { color:#363a42; font-weight:700; }
.ncr-wo-merge-hint { display:inline-block; margin-top:5px; padding:4px 7px; border-radius:7px; background:linear-gradient(135deg,#5b8dc7,#86b7e9); color:#fff; font-size:10px; font-weight:800; }
.ncr-wo-confidence { display:inline-flex; padding:6px 9px; border-radius:999px; font-size:10px; font-weight:800; }
.ncr-wo-confidence.matched { background:#dff5e7; color:#226b41; }
.ncr-wo-confidence.review { background:#fff0bd; color:#805d04; }
.ncr-wo-confidence.missing { background:#ffe2e4; color:#a51e2a; }
.ncr-wo-davp-hint { display:block; margin-top:5px; color:#684900; font-size:10px; font-weight:800; line-height:1.25; }
.ncr-wo-review-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; }
.ncr-wo-review-actions span { max-width:760px; color:#686c74; font-size:12px; }
.ncr-wo-empty { min-height:280px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; color:#777b83; }
.ncr-wo-empty .material-symbols-rounded { color:#b5bac2; font-size:52px; }
.ncr-wo-empty h3 { margin:10px 0 5px; color:#34373d; }
.ncr-wo-empty p { margin:0; }
.ncr-wo-draft-summary { margin:14px 16px; }

.general-rapid-excel-panel {
  margin-top: 18px;
  overflow: visible;
  border-color: rgba(67, 102, 190, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
}

.general-rapid-badge {
  border-color: rgba(79, 70, 229, 0.24);
  color: #3730a3;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.general-rapid-notice {
  margin: 16px 18px 0;
  border-color: rgba(79, 70, 229, 0.16);
  background: linear-gradient(100deg, #f8fbff, #eef4ff);
  color: #49546a;
}

.general-rapid-entry-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(200px, 0.9fr) minmax(170px, 0.7fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

.general-rapid-entry-grid label {
  display: grid;
  gap: 7px;
  color: #671b28;
  font-weight: 800;
}

.general-rapid-entry-grid input {
  min-height: 48px;
}

.general-rapid-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.general-rapid-import-btn {
  background: linear-gradient(135deg, #4f46e5, #1d4ed8);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.23);
}

.general-rapid-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 18px 18px;
  padding: 10px 13px;
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.general-rapid-helper span {
  color: #3730a3;
  font-weight: 900;
}

.general-rapid-helper small {
  color: #687386;
  font-weight: 700;
}

body.theme-night .beta-feature-card.ncr-reader,
body.theme-night .ncr-wo-file-picker,
body.theme-night .ncr-wo-meta-grid > div { background:linear-gradient(145deg,#18263a,#1d2d44); border-color:#36506e; }
body.theme-night .beta-feature-card.ncr-reader h3,
body.theme-night .ncr-wo-file-picker strong,
body.theme-night .ncr-wo-meta-grid strong,
body.theme-night .ncr-wo-empty h3 { color:#f3f7fc; }
body.theme-night .beta-feature-card.ncr-reader p,
body.theme-night .ncr-wo-file-picker small,
body.theme-night .ncr-wo-meta-grid span,
body.theme-night .ncr-wo-empty { color:#b8c5d5; }
body.theme-night .ncr-wo-status-strip { background:#172438; }
body.theme-night .ncr-wo-review-table td { border-bottom-color:#34465c; background:#172438; color:#edf3fa; }
body.theme-night .ncr-wo-review-table input,
body.theme-night .ncr-wo-review-table select { border-color:#40546d; background:#21324a; color:#f4f7fb; }
body.theme-night .ncr-wo-review-table tr.ncr-wo-duplicate td { background:#274d73; }
body.theme-night .ncr-wo-review-table tr.ncr-wo-duplicate input,
body.theme-night .ncr-wo-review-table tr.ncr-wo-duplicate select { background:#1f3d5e; color:#fff; }
body.theme-night .ncr-wo-review-table tr.confidence-review td,
body.theme-night .ncr-wo-review-table tr.ncr-wo-duplicate.confidence-review td { background:#d9a900; color:#211900; }
body.theme-night .ncr-wo-review-table tr.confidence-missing td,
body.theme-night .ncr-wo-review-table tr.ncr-wo-duplicate.confidence-missing td { background:#e58a16; color:#211000; }
body.theme-night .ncr-wo-davp-hint { color:#3d2c00; }
body.theme-night .ncr-wo-review-table input.needs-attention {
  color:#2c2100;
  background:linear-gradient(#fff9dc,#fff9dc) padding-box,linear-gradient(135deg,#ffe100,#ff8a00) border-box;
}

body.theme-night .general-rapid-excel-panel {
  border-color: rgba(100, 160, 255, 0.22);
  background: linear-gradient(145deg, #142137, #182945);
}

body.theme-night .general-rapid-excel-panel .panel-head {
  background: linear-gradient(135deg, #1f3150, #18253f);
}

body.theme-night .general-rapid-excel-panel h3,
body.theme-night .general-rapid-entry-grid label,
body.theme-night .general-rapid-helper span {
  color: #f4f8ff;
}

body.theme-night .general-rapid-notice,
body.theme-night .general-rapid-helper {
  border-color: rgba(125, 163, 255, 0.18);
  background: rgba(24, 39, 66, 0.82);
  color: #c7d3e5;
}

body.theme-night .general-rapid-helper small {
  color: #aebbd0;
}

body.theme-indigo .general-rapid-excel-panel {
  border-color: rgba(85, 56, 238, 0.18);
  background: linear-gradient(145deg, #ffffff, #f4f7ff);
}

body.theme-indigo .general-rapid-entry-grid label,
body.theme-indigo .general-rapid-helper span {
  color: #34239d;
}

body.theme-indigo .general-rapid-import-btn {
  background: linear-gradient(135deg, #5538ee, #2f80ed);
}

body.theme-indigo.theme-night .general-rapid-excel-panel {
  border-color: rgba(137, 119, 255, 0.22);
  background: linear-gradient(145deg, rgba(29, 40, 69, 0.97), rgba(19, 28, 52, 0.95));
}

body.theme-indigo.theme-night .general-rapid-notice,
body.theme-indigo.theme-night .general-rapid-helper {
  border-color: rgba(205, 215, 238, 0.14);
  background: rgba(20, 31, 56, 0.9);
}

@keyframes ncrAttentionGlow {
  0%,100% { box-shadow:0 0 0 3px rgba(255,193,7,.26),0 0 12px rgba(255,138,0,.42); }
  50% { box-shadow:0 0 0 4px rgba(255,213,0,.42),0 0 24px rgba(255,119,0,.72); }
}

@media (max-width: 920px) {
  .beta-feature-grid,.batch-client-grid { grid-template-columns:1fr; }
  .beta-entry-panel { align-items:flex-start; flex-direction:column; }
  .beta-entry-actions { justify-content:flex-start; }
  .ncr-wo-upload-zone { grid-template-columns:1fr; }
  .general-rapid-entry-grid { grid-template-columns:1fr; }
  .general-rapid-actions { justify-content:flex-start; }
  .general-rapid-helper { align-items:flex-start; flex-direction:column; }
  .ncr-wo-progress { grid-column:auto; }
  .ncr-wo-meta-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ncr-wo-review-actions { align-items:flex-start; flex-direction:column; }
}

@keyframes bulkMergePulse {
  0%, 100% { box-shadow: 0 10px 22px rgba(78, 135, 201, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 12px 28px rgba(78, 135, 201, 0.48), 0 0 0 3px rgba(174, 207, 242, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.42); }
}

.batch-ro-page {
  break-after: page;
  page-break-after: always;
  margin-bottom: 24px;
}

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

.batch-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
}

.bulk-pdf-render-root {
  position: fixed;
  left: -12000px;
  top: 0;
  width: 794px;
  background: #fff;
  pointer-events: none;
  z-index: -1;
}

.bulk-pdf-render-root .ro-doc {
  width: 794px;
  max-width: 794px;
  margin: 0;
  box-shadow: none;
  border: 0;
  zoom: var(--ro-zoom-scale, 1);
  font-size: var(--ro-font-body, 13pt);
  font-weight: 500;
  line-height: 1.42;
}

.bulk-pdf-render-root .ro-doc .doc-meta div {
  font-size: var(--ro-font-meta, 15.25pt);
  font-weight: 650;
}

.bulk-pdf-render-root .ro-doc .doc-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: center;
}

.bulk-pdf-render-root .ro-heading-block h3 {
  font-size: var(--ro-font-heading, 20.5pt);
  font-weight: 780;
}

.bulk-pdf-render-root .ro-heading-block div {
  font-size: var(--ro-font-ins, 13pt);
  font-weight: 600;
}

.bulk-pdf-render-root .ro-title-text > strong {
  font-size: var(--ro-font-title, 17.5pt);
  font-weight: 780;
}

.bulk-pdf-render-root .ro-title p,
.bulk-pdf-render-root .address-block,
.bulk-pdf-render-root .sign-box,
.bulk-pdf-render-root .ro-particulars th,
.bulk-pdf-render-root .ro-particulars td {
  font-size: var(--ro-font-body, 13pt);
  font-weight: 500;
}

.bulk-pdf-render-root .ro-title .ro-office-address-block p {
  font-size: var(--ro-font-small, 9pt);
  line-height: 1.2;
}

.bulk-pdf-render-root .ro-logo {
  width: var(--ro-logo-bulk, 106px);
  height: var(--ro-logo-bulk, 106px);
}

.bulk-pdf-render-root .doc-meta,
.bulk-pdf-render-root .address-block {
  margin-top: var(--ro-bulk-margin, 14px);
  margin-bottom: var(--ro-bulk-margin, 14px);
}

.bulk-pdf-render-root .address-block,
.bulk-pdf-render-root .sign-box {
  padding: var(--ro-bulk-padding, 12px);
}

.bulk-pdf-render-root .ro-particulars {
  margin-top: var(--ro-bulk-margin, 14px);
}

.bulk-pdf-render-root .ro-particulars th,
.bulk-pdf-render-root .ro-particulars td {
  padding: var(--ro-space-table-y, 7px) var(--ro-space-table-x, 8px);
}

.bulk-pdf-render-root .ro-particulars th {
  font-weight: 720;
}

.bulk-pdf-render-root .ro-print-instructions {
  font-size: var(--ro-font-instructions, 10.8pt);
  font-weight: 500;
}

.bulk-pdf-render-root .signature-row {
  gap: var(--ro-bulk-signature-gap, 32px);
  margin-top: var(--ro-bulk-signature-top, 26px);
}

.bulk-pdf-render-root .signature-img {
  width: var(--ro-bulk-signature-width, 260px);
  height: var(--ro-bulk-signature-height, 118px);
  margin: var(--ro-bulk-signature-margin-top, -14px) 0 var(--ro-bulk-signature-margin-bottom, -18px);
}

.ro-doc .sign-box .signature-img,
.bulk-pdf-render-root .ro-doc .sign-box .signature-img {
  width: 190px;
  height: 74px;
  max-height: 74px;
  max-width: 86%;
  margin: -6px 0 -8px;
  object-fit: contain;
}

.bulk-row-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  padding: 14px 0 2px;
}

.bulk-add-count {
  display: grid;
  gap: 5px;
  width: 120px;
  color: #6b6461;
  font-size: 12px;
  font-weight: 760;
}

.bulk-add-count input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  color: #303034;
  font-size: 14px;
  font-weight: 760;
  text-align: center;
}

.bulk-active-rows {
  align-self: center;
  color: #a01320;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.bulk-row.is-toi-davp-row [data-bulk-field="rate"] {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.bulk-row-actions .secondary {
  min-width: 180px;
}

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

  body:not(.sidebar-collapsed) .modal.workspace-modal,
  body.sidebar-collapsed .modal.workspace-modal {
    left: 0;
    width: 100vw;
  }

  .sidebar {
    position: static;
  }

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

  .client-contribution-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .client-contribution-value {
    justify-items: start;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
  }

  .app-tabs {
    position: static;
    padding: 10px 16px 0;
  }

  .topbar,
  .top-actions,
  .grid-2 {
    display: block;
  }

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

  .estimate-lock-row,
  .estimate-two-row,
  .estimate-three-row,
  .estimate-spec-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .topbar {
    top: 0;
  }

  .top-actions {
    margin-top: 14px;
  }

  .top-actions input {
    width: 100%;
    margin-bottom: 8px;
  }

  .ro-bulk-reprint-panel {
    grid-template-columns: 1fr;
  }

  .ro-bulk-reprint-actions {
    justify-content: stretch;
  }

  .ro-bulk-reprint-actions button {
    flex: 1;
  }

  .metrics,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .ro-calc-box,
  .bulk-shared,
  .addressed-edition-row,
  .doc-meta {
    grid-template-columns: 1fr;
  }

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

  .schedule-reminder-item {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .sidebar,
  .app-tabs,
  .topbar,
  .toolbar,
  .notice,
  .actions,
  .mini-btn,
  button,
  .storage-card {
    display: none !important;
  }

  .batch-actions {
    display: none !important;
  }

  .letter-maker-panel {
    display: none !important;
  }

  .batch-ro-page {
    margin-bottom: 0;
  }

  .app-shell,
  .grid-2,
  .report-grid {
    display: block;
  }

  .content {
    padding: 0;
  }

  .ro-doc {
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 0;
    border: 0;
    zoom: var(--ro-zoom-scale, 1);
    font-size: var(--ro-font-body, 13pt);
    font-weight: 500;
    line-height: 1.42;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .estimate-doc {
    --ro-logo-print: 20mm;
    --ro-font-title: 12pt;
    --ro-font-heading: 12pt;
    --ro-font-ins: 9pt;
    --ro-font-meta: 9pt;
    --ro-font-body: 9pt;
    --ro-font-instructions: 8pt;
    --ro-space-meta: 5px;
    --ro-space-address: 5px;
    --ro-space-table-y: 4px;
    --ro-space-table-x: 5px;
    --ro-space-signature-top: 8px;
    --ro-space-signature-gap: 10px;
    --ro-signbox-min-height: 58px;
    --ro-signature-width: 140px;
    --ro-signature-height: 62px;
    --ro-signature-margin-top: -8px;
    --ro-signature-margin-bottom: -12px;
    font-size: 9pt;
    line-height: 1.22;
  }

  .estimate-doc .ro-title {
    grid-template-columns: minmax(0, 1fr) 22mm;
    gap: 4mm;
    margin-bottom: 4px;
  }

  .estimate-doc .ro-title-text {
    padding-left: 0;
  }

  .estimate-doc .ro-title-text > strong,
  .estimate-doc .ro-heading-block h3 {
    font-size: 12pt;
  }

  .estimate-doc .ro-title-text p,
  .estimate-doc .ro-heading-block div,
  .estimate-doc .doc-meta div,
  .estimate-doc .ro-particulars th,
  .estimate-doc .ro-particulars td,
  .estimate-doc .estimate-lines-table th,
  .estimate-doc .estimate-lines-table td,
  .estimate-doc .estimate-notes,
  .estimate-doc .sign-box {
    font-size: 9pt;
    line-height: 1.2;
  }

  .estimate-doc .ro-logo {
    width: 20mm;
    height: 20mm;
  }

  .estimate-doc .ro-heading-block {
    margin: 4px 0 5px;
  }

  .estimate-doc .doc-meta {
    margin: 5px 0;
  }

  .estimate-doc .ro-particulars {
    margin-top: 5px;
  }

  .estimate-doc .ro-particulars th,
  .estimate-doc .ro-particulars td,
  .estimate-doc .estimate-lines-table th,
  .estimate-doc .estimate-lines-table td {
    padding: 3px 5px;
  }

  .estimate-doc .estimate-lines-table .estimate-total-row th,
  .estimate-doc .estimate-lines-table .estimate-total-row td {
    font-size: 10pt;
  }

  .estimate-doc .estimate-notes {
    margin-top: 7px;
    padding: 5px 7px;
  }

  .estimate-doc .estimate-signature-row {
    margin-top: 8px;
  }

  .ro-form-doc {
    width: 186mm;
    min-height: 273mm;
    padding: 12mm 13mm 10mm;
    font-size: 11.5px;
    box-shadow: none;
  }

  .ro-form-head {
    grid-template-columns: 1fr 58mm;
    gap: 8mm;
  }

  .ro-form-head h3 {
    font-size: 19px;
  }

  .ro-form-head .ins-line {
    font-size: 15px;
  }

  .ro-form-meta {
    gap: 5px;
    font-size: 12px;
  }

  .ro-address-grid {
    grid-template-columns: 1fr 58mm;
    gap: 8mm;
    margin-top: 8mm;
    min-height: 22mm;
  }

  .ro-company-mini {
    font-size: 9px;
  }

  .ro-form-lines {
    gap: 4.5mm;
    margin-top: 7mm;
  }

  .ro-line {
    grid-template-columns: 38mm minmax(0, 1fr);
    gap: 4mm;
    min-height: 6mm;
  }

  .ro-line strong {
    min-height: 6mm;
    padding: 0.5mm 1mm 1mm;
  }

  .ro-four,
  .ro-two {
    gap: 5mm;
  }

  .ro-tall strong {
    min-height: 16mm;
  }

  .ro-bottom-grid {
    grid-template-columns: 1fr 58mm;
    gap: 8mm;
    margin-top: 9mm;
  }

  .ro-instructions {
    font-size: 9.5px;
  }

  .ro-instructions strong {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .ro-signature-box {
    min-height: 26mm;
    gap: 2mm;
    font-size: 10px;
  }

  .ro-signature-box .signature-img {
    width: 30mm;
    height: 14mm;
  }

  .ro-note {
    grid-template-columns: 28mm 1fr;
    gap: 1mm 5mm;
    margin-top: 6mm;
    font-size: 10px;
  }

  .ro-note strong {
    font-size: 12px;
  }

  .ro-title h3 {
    margin-bottom: 2px;
    font-size: var(--ro-font-title, 17.5pt);
  }

  .ro-title-text > strong {
    font-size: var(--ro-font-title, 17.5pt);
    font-weight: 780;
  }

  .ro-heading-block h3 {
    font-size: var(--ro-font-heading, 20.5pt);
    font-weight: 780;
  }

  .ro-heading-block div {
    font-size: var(--ro-font-ins, 13pt);
    font-weight: 600;
  }

  .ro-title {
    grid-template-columns: minmax(0, 1fr) 30mm;
    gap: 5mm;
  }

  .ro-title-text {
    padding-left: 31mm;
  }

  .ro-title.has-branch-address .ro-title-text {
    padding-left: 0;
  }

  .ro-office-address-grid {
    gap: 2mm;
    margin-top: 1.5mm;
  }

  .ro-office-address-block {
    padding: 1.5mm 2mm;
  }

  .ro-office-address-block > strong {
    font-size: var(--ro-font-small, 9pt);
  }

  .ro-title .ro-office-address-block p {
    margin-top: 0.7mm;
    font-size: var(--ro-font-small, 8.5pt);
    line-height: 1.18;
  }

  .ro-logo {
    width: var(--ro-logo-print, 28mm);
    height: var(--ro-logo-print, 28mm);
  }

  .ins-line {
    margin-bottom: 6px;
    font-size: 14px;
  }

  .doc-meta {
    gap: 8px;
    margin: var(--ro-space-meta, 10px) 0;
  }

  .ro-doc .doc-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: center;
  }

  .ro-doc .doc-meta div {
    font-size: var(--ro-font-meta, 15.25pt);
    font-weight: 650;
  }

  .address-block {
    margin: var(--ro-space-meta, 10px) 0;
    padding: var(--ro-space-address, 9px);
    font-size: var(--ro-font-body, 13pt);
    font-weight: 500;
  }

  .ro-particulars {
    margin-top: var(--ro-space-meta, 10px);
  }

  .ro-particulars th,
  .ro-particulars td {
    padding: var(--ro-space-table-y, 7px) var(--ro-space-table-x, 8px);
    font-size: var(--ro-font-body, 13pt);
    font-weight: 500;
  }

  .ro-particulars th {
    font-weight: 720;
  }

  .signature-row {
    gap: var(--ro-space-signature-gap, 18px);
    margin-top: var(--ro-space-signature-top, 18px);
  }

  .ro-print-instructions {
    font-size: var(--ro-font-instructions, 10.8pt);
    font-weight: 500;
    line-height: 1.28;
  }

  .sign-box {
    font-size: var(--ro-font-body, 13pt);
    font-weight: 500;
  }

  .sign-box {
    min-height: var(--ro-signbox-min-height, 100px);
    gap: var(--ro-space-signbox-gap, 7px);
    padding: var(--ro-space-signbox, 10px);
  }

  .signature-img {
    width: var(--ro-signature-width, 255px);
    height: var(--ro-signature-height, 118px);
    margin: var(--ro-signature-margin-top, -18px) 0 var(--ro-signature-margin-bottom, -22px);
  }

  .panel,
  .metric,
  .report-card,
  .doc-box {
    box-shadow: none;
  }

  body {
    background: #fff;
  }
}

/* Final night theme polish: this must stay at the end so component styles cannot override it. */
body.theme-night {
  --bg: #101725;
  --panel: #172132;
  --ink: #f4f7fb;
  --muted: #aeb8c7;
  --line: rgba(214, 224, 238, 0.13);
  --accent: #ff4653;
  --accent-dark: #c72a35;
  --charcoal: #0b1020;
  --glass: rgba(23, 33, 50, 0.78);
  --soft: rgba(255, 70, 83, 0.14);
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 70, 83, 0.14), transparent 32%),
    radial-gradient(circle at 4% 16%, rgba(77, 137, 210, 0.14), transparent 30%),
    linear-gradient(135deg, #0b1220 0%, #101827 42%, #151b2b 100%);
}

body.theme-night .main,
body.theme-night .content {
  color: var(--ink);
}

body.theme-night .app-tabs,
body.theme-night .topbar {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(135deg, rgba(16, 24, 39, 0.92), rgba(22, 31, 49, 0.86));
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-night .sidebar {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 70, 83, 0.2), transparent 34%),
    linear-gradient(165deg, #070b14 0%, #101725 54%, #21101a 100%);
}

body.theme-night .panel,
body.theme-night .metric,
body.theme-night .report-card,
body.theme-night .task-panel,
body.theme-night .task-manager,
body.theme-night .client-contribution-panel,
body.theme-night .schedule-reminder-panel,
body.theme-night .ro-group-panel,
body.theme-night .modal-panel,
body.theme-night .vendor-payable-card,
body.theme-night .mrv-vendor-group,
body.theme-night .access-denied-panel {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background:
    linear-gradient(145deg, rgba(25, 36, 55, 0.92), rgba(14, 22, 36, 0.9)),
    radial-gradient(circle at 92% 0%, rgba(255, 70, 83, 0.1), transparent 32%);
  box-shadow: 0 24px 70px rgba(3, 7, 18, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-night .panel-head,
body.theme-night .task-panel .panel-head,
body.theme-night .client-contribution-panel .panel-head,
body.theme-night .panel-head.subtle {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background:
    linear-gradient(135deg, rgba(32, 45, 66, 0.82), rgba(20, 29, 46, 0.76)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 34%);
}

body.theme-night .panel-head h3,
body.theme-night .task-panel .panel-head h3,
body.theme-night .brand h1,
body.theme-night .topbar h2,
body.theme-night .metric strong,
body.theme-night .report-card strong,
body.theme-night .client-contribution-panel .panel-head p strong {
  color: #f7fafc;
}

body.theme-night .crumb,
body.theme-night .brand p,
body.theme-night .app-tab-count,
body.theme-night .metric span,
body.theme-night .metric p,
body.theme-night .report-card p,
body.theme-night .field-hint,
body.theme-night .client-contribution-panel .panel-head p {
  color: #b6c2d3;
}

body.theme-night input,
body.theme-night select,
body.theme-night textarea,
body.theme-night .letter-body-editor,
body.theme-night .task-add-row input,
body.theme-night .task-add-row select,
body.theme-night .task-assign,
body.theme-night .filters input,
body.theme-night .filters select,
body.theme-night .form-grid input,
body.theme-night .form-grid select,
body.theme-night .form-grid textarea,
body.theme-night .top-actions input {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.14);
  background:
    linear-gradient(145deg, rgba(52, 63, 81, 0.78), rgba(35, 45, 62, 0.82)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.07), transparent 38%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(3, 7, 18, 0.22);
}

body.theme-night input::placeholder,
body.theme-night textarea::placeholder,
body.theme-night .task-add-row input::placeholder {
  color: #a5afbf;
}

body.theme-night .task-add-row {
  border-color: rgba(214, 224, 238, 0.1);
  background: rgba(11, 18, 32, 0.32);
}

body.theme-night .task-add-row label {
  color: #ff8c95;
}

body.theme-night .task-row,
body.theme-night .schedule-reminder-item,
body.theme-night .notice,
body.theme-night .empty,
body.theme-night .mrv-summary-strip,
body.theme-night .portal-line-progress,
body.theme-night .workspace-badge {
  color: var(--ink);
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(135deg, rgba(31, 43, 64, 0.78), rgba(18, 28, 45, 0.72));
}

body.theme-night .schedule-reminder-item strong,
body.theme-night .task-row strong,
body.theme-night .empty h3 {
  color: #f8fafc;
}

body.theme-night .schedule-reminder-item span,
body.theme-night .task-row span {
  color: #b8c3d2;
}

body.theme-night .schedule-toggle {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.12);
  background: linear-gradient(145deg, rgba(55, 66, 84, 0.86), rgba(31, 40, 57, 0.88));
}

body.theme-night .client-contribution-name strong {
  color: #e8eef7;
}

body.theme-night .client-contribution-name span {
  color: #ffd8dc;
  background: rgba(255, 70, 83, 0.18);
  border: 1px solid rgba(255, 70, 83, 0.24);
}

body.theme-night .client-contribution-value strong {
  color: #ff6f7a;
}

body.theme-night .client-contribution-value span {
  color: #aeb8c7;
}

body.theme-night .client-contribution-track {
  background: linear-gradient(90deg, rgba(214, 224, 238, 0.12), rgba(214, 224, 238, 0.06));
}

body.theme-night .metric-warning {
  border-color: rgba(245, 179, 63, 0.42);
  background:
    linear-gradient(145deg, rgba(55, 44, 20, 0.82), rgba(32, 27, 18, 0.72)),
    radial-gradient(circle at 90% 0%, rgba(245, 179, 63, 0.16), transparent 34%);
}

body.theme-night .metric-warning span,
body.theme-night .metric-warning em {
  color: #f3c96b;
}

body.theme-night .metric-warning strong {
  color: #fff4d0;
}

body.theme-night .smart-dropdown,
body.theme-night .global-search-dropdown {
  border-color: rgba(214, 224, 238, 0.14);
  background:
    linear-gradient(145deg, rgba(35, 46, 65, 0.96), rgba(17, 26, 41, 0.96));
}

body.theme-night .smart-dropdown button,
body.theme-night .global-search-dropdown button,
body.theme-night .smart-option {
  color: #edf2f7;
}

body.theme-night table,
body.theme-night .table-wrap,
body.theme-night .mrv-table,
body.theme-night .bulk-table,
body.theme-night .portal-bill-table {
  color: #edf2f7;
  background: rgba(17, 26, 41, 0.78);
}

body.theme-night th,
body.theme-night .mrv-table th {
  color: #ffd6da;
  background: rgba(255, 70, 83, 0.14);
}

body.theme-night td,
body.theme-night .mrv-table td {
  color: #edf2f7;
  border-color: rgba(214, 224, 238, 0.08);
}

body.theme-night .doc-box.ro-doc,
body.theme-night .estimate-doc,
body.theme-night .invoice-doc,
body.theme-night .official-letter,
body.theme-night .official-letter-page,
body.theme-night .print-body {
  color: #242424;
  background: #fff;
}

/* Absolute final night contrast guard. This is intentionally last. */
body.theme-night .doc-box.ro-doc,
body.theme-night .doc-box.ro-doc *,
body.theme-night .estimate-doc,
body.theme-night .estimate-doc *,
body.theme-night .invoice-doc,
body.theme-night .invoice-doc *,
body.theme-night .official-letter,
body.theme-night .official-letter *,
body.theme-night .official-letter-page,
body.theme-night .official-letter-page *,
body.theme-night .print-body,
body.theme-night .print-body * {
  color: #24272d;
}

body.theme-night .doc-box.ro-doc,
body.theme-night .estimate-doc,
body.theme-night .invoice-doc,
body.theme-night .official-letter,
body.theme-night .official-letter-page,
body.theme-night .print-body,
body.theme-night .doc-box.ro-doc table,
body.theme-night .estimate-doc table,
body.theme-night .invoice-doc table {
  background: #fff;
}

body.theme-night .doc-box.ro-doc th,
body.theme-night .estimate-doc th,
body.theme-night .invoice-doc th,
body.theme-night .official-letter th,
body.theme-night .print-body th {
  color: #7d121b;
  background: #fff0f2;
}

body.theme-night .doc-box.ro-doc td,
body.theme-night .estimate-doc td,
body.theme-night .invoice-doc td,
body.theme-night .official-letter td,
body.theme-night .print-body td {
  color: #24272d;
  background: #fff;
}

body.theme-night .doc-box.ro-doc .ro-heading-block h3,
body.theme-night .estimate-doc .ro-heading-block h3,
body.theme-night .invoice-doc .ro-heading-block h3 {
  color: #9d1721;
}

body.theme-night .doc-box.ro-doc .ro-title-text p,
body.theme-night .estimate-doc .ro-title-text p,
body.theme-night .invoice-doc .ro-title-text p {
  color: #6f7785;
}

body.theme-night .doc-box.ro-doc .doc-meta div,
body.theme-night .doc-box.ro-doc .address-block {
  color: #24272d;
  background: #f7f7f8;
}

body.theme-night .ro-calc-box,
body.theme-night .ro-calc-box div {
  color: #24272d;
  border-color: rgba(125, 18, 27, 0.16);
  background: linear-gradient(135deg, rgba(255, 240, 242, 0.96), rgba(248, 248, 250, 0.9));
}

body.theme-night .ro-calc-box span {
  color: #7d121b;
}

body.theme-night .ro-calc-box strong {
  color: #24272d;
}

body.theme-night .modal-panel {
  color: #f8fafc;
  background: linear-gradient(145deg, rgba(23, 33, 50, 0.96), rgba(13, 22, 36, 0.96));
}

body.theme-night .modal-head {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.14);
  background: linear-gradient(135deg, rgba(32, 45, 66, 0.92), rgba(20, 29, 46, 0.9));
}

body.theme-night .modal-head h3,
body.theme-night .modal-head p,
body.theme-night .modal-panel label {
  color: #f8fafc;
}

body.theme-night .modal-panel .icon-btn {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.11);
}

body.theme-night .mini-btn,
body.theme-night .ro-action-btn,
body.theme-night .mini-btn.ro-action-btn {
  color: #f8fafc;
  border-color: rgba(214, 224, 238, 0.26);
  background: linear-gradient(135deg, rgba(52, 63, 81, 0.92), rgba(28, 38, 56, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 22px rgba(2, 6, 23, 0.22);
}

body.theme-night .mini-btn:hover,
body.theme-night .ro-action-btn:hover,
body.theme-night .mini-btn.ro-action-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff4653, #b91c2a);
}

body.theme-night .mini-btn.danger-link,
body.theme-night .ro-action-btn.danger-link {
  color: #ffdbe0;
  border-color: rgba(255, 90, 102, 0.28);
}

body.theme-night .mini-btn:disabled,
body.theme-night .ro-action-btn:disabled,
body.theme-night button:disabled {
  color: #8c97aa;
  opacity: 0.55;
}

body.theme-night .mrv-vendor-group summary strong,
body.theme-night .vendor-payable-card summary strong {
  color: #7d121b;
  background: rgba(255, 232, 235, 0.94);
}

body.theme-night .mrv-vendor-group summary span,
body.theme-night .vendor-payable-card summary span,
body.theme-night .mrv-vendor-group summary em,
body.theme-night .vendor-payable-card summary em {
  color: #dce6f5;
}

body.theme-night .mrv-summary-strip strong,
body.theme-night .mrv-completion-meter .portal-line-progress strong,
body.theme-night .mrv-completion-meter .portal-line-progress span,
body.theme-night .mrv-completion-meter .portal-line-progress em {
  color: #24272d;
}

body.theme-night .mrv-completion-meter .portal-line-progress,
body.theme-night .portal-line-progress {
  color: #24272d;
  background: rgba(255, 255, 255, 0.86);
}

body.theme-night .mrv-table {
  color: #edf2f7;
  background: rgba(17, 26, 41, 0.86);
}

body.theme-night .mrv-table th {
  color: #ffd6da;
  background: rgba(255, 70, 83, 0.16);
}

body.theme-night .mrv-table td {
  color: #edf2f7;
}

body.theme-night .client-portal-card {
  color: #24272d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(241, 244, 248, 0.86)),
    radial-gradient(circle at top right, rgba(238, 47, 56, 0.09), transparent 42%);
}

body.theme-night .client-portal-card h3,
body.theme-night .client-portal-card p,
body.theme-night .client-portal-stats strong {
  color: #24272d;
}

body.theme-night .client-portal-card span,
body.theme-night .client-portal-stats small {
  color: #7d121b;
}

body.theme-night .client-portal-access {
  color: #fff;
}

body.theme-night .portal-bill-card,
body.theme-night .portal-bill-card.progress-empty,
body.theme-night .portal-bill-card.progress-partial,
body.theme-night .portal-bill-card.progress-complete,
body.theme-night .portal-bill-ro,
body.theme-night .portal-field,
body.theme-night .portal-milestone,
body.theme-night .portal-system-cell,
body.theme-night .portal-rate-box label,
body.theme-night .portal-date-line,
body.theme-night .portal-size-badge {
  color: #24272d;
}

body.theme-night .portal-bill-ro strong,
body.theme-night .portal-bill-ro p,
body.theme-night .portal-bill-ro small,
body.theme-night .portal-switch-row,
body.theme-night .portal-switch-row span,
body.theme-night .portal-field.locked strong,
body.theme-night .portal-system-cell strong,
body.theme-night .portal-system-cell span,
body.theme-night .portal-system-cell small,
body.theme-night .portal-row-ring span {
  color: inherit;
}

body.theme-night .portal-bill-fields input,
body.theme-night .portal-bill-fields select,
body.theme-night .portal-bill-fields textarea,
body.theme-night .portal-rate-box input {
  color: #24272d;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 243, 248, 0.9));
}

/* EOF RO document overrides. Keep below every print rule. */
.doc-box.ro-doc .ro-title.has-branch-address .ro-title-text,
.bulk-pdf-render-root .doc-box.ro-doc .ro-title.has-branch-address .ro-title-text,
.print-body .doc-box.ro-doc .ro-title.has-branch-address .ro-title-text {
  justify-self: start !important;
  width: 465px !important;
  max-width: 465px !important;
  padding-left: 0 !important;
}

.doc-box.ro-doc .ro-office-address-grid,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-grid,
.print-body .doc-box.ro-doc .ro-office-address-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.doc-box.ro-doc .ro-office-address-block,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block,
.print-body .doc-box.ro-doc .ro-office-address-block {
  padding: 5px 7px !important;
}

.doc-box.ro-doc .ro-office-address-block p,
.bulk-pdf-render-root .doc-box.ro-doc .ro-office-address-block p,
.print-body .doc-box.ro-doc .ro-office-address-block p {
  font-size: 10.73px !important;
  line-height: 1.18 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.doc-box.ro-doc .sign-box .signature-img,
.bulk-pdf-render-root .doc-box.ro-doc .sign-box .signature-img,
.print-body .doc-box.ro-doc .sign-box .signature-img {
  width: 178px !important;
  height: 58px !important;
  max-width: 178px !important;
  max-height: 58px !important;
  margin: -2px 0 -6px !important;
  object-fit: contain !important;
}

/* Indigo runtime override: intentionally below every legacy theme rule. */
body.theme-indigo { --bg:#f3f6fb; --panel:#fff; --ink:#11182c; --muted:#71809a; --line:rgba(64,78,112,.14); --accent:#5538ee; --accent-2:#2f80ed; --accent-dark:#34239d; --charcoal:#201954; --soft:#efedff; color:#11182c; background:linear-gradient(135deg,#f8faff 0%,#f2f5fa 54%,#edf2f8 100%); }
body.theme-indigo .sidebar { color:#25304a; border-right-color:#e1e6ef; background:linear-gradient(180deg,#fff 0%,#f8faff 62%,#f0f3fa 100%); box-shadow:16px 0 44px rgba(37,48,84,.1); }
body.theme-indigo .brand h1,body.theme-indigo .topbar h2{color:#151a2c} body.theme-indigo .brand p,body.theme-indigo .storage-card span,body.theme-indigo .clock-card span{color:#77849b}
body.theme-indigo .nav button{color:#63718b;border-color:transparent;background:transparent} body.theme-indigo .nav button:hover,body.theme-indigo .nav button.active{color:#fff;border-color:rgba(85,56,238,.2);background:linear-gradient(135deg,#6542f4,#4a2fe0);box-shadow:0 12px 25px rgba(85,56,238,.23)} body.theme-indigo .nav button:hover .nav-icon,body.theme-indigo .nav button.active .nav-icon{color:#5538ee;background:#fff}
body.theme-indigo .topbar,body.theme-indigo .app-tabs,body.theme-indigo .clock-card,body.theme-indigo .storage-card{color:#1c2540;border-color:#dfe5ef;background:rgba(255,255,255,.86);box-shadow:0 12px 32px rgba(35,49,87,.08)}
body.theme-indigo .panel,body.theme-indigo .metric,body.theme-indigo .report-card,body.theme-indigo .task-panel,body.theme-indigo .task-manager,body.theme-indigo .client-contribution-panel,body.theme-indigo .schedule-reminder-panel,body.theme-indigo .ro-group-panel,body.theme-indigo .modal-panel,body.theme-indigo .billing-head-card,body.theme-indigo .vendor-payable-card,body.theme-indigo .mrv-vendor-group,body.theme-indigo .access-denied-panel,body.theme-indigo .dashboard-comparison-panel{color:#151b2f;border-color:#dde4ee;background:linear-gradient(145deg,rgba(255,255,255,.99),rgba(247,250,255,.94));box-shadow:0 20px 52px rgba(35,49,87,.09),inset 0 1px 0 #fff}
body.theme-indigo .panel-head,body.theme-indigo .task-panel .panel-head,body.theme-indigo .client-contribution-panel .panel-head,body.theme-indigo .panel-head.subtle,body.theme-indigo .dashboard-comparison-head{color:#171d31;border-color:#e0e6ef;background:linear-gradient(135deg,#fff,#f6f8fc)}
body.theme-indigo input,body.theme-indigo select,body.theme-indigo textarea,body.theme-indigo .letter-body-editor,body.theme-indigo .task-assign{color:#20283c;border-color:#d9e1ec;background:linear-gradient(145deg,#fff,#f3f7fc)} body.theme-indigo input:focus,body.theme-indigo select:focus,body.theme-indigo textarea:focus,body.theme-indigo .letter-body-editor:focus{border-color:#7662ee;box-shadow:0 0 0 4px rgba(85,56,238,.13)}
body.theme-indigo .primary{color:#fff;border-color:#5538ee;background:linear-gradient(135deg,#6542f4,#4430bd);box-shadow:0 12px 26px rgba(85,56,238,.21)} body.theme-indigo .smart-dropdown,body.theme-indigo .global-search-dropdown{color:#273149;border-color:#dce3ed;background:rgba(255,255,255,.99);box-shadow:0 24px 58px rgba(31,43,80,.18)} body.theme-indigo .smart-option:hover,body.theme-indigo .smart-option.active,body.theme-indigo .smart-dropdown button:hover,body.theme-indigo .global-search-dropdown button:hover{color:#fff;background:linear-gradient(135deg,#6542f4,#4930cf)}
body.theme-indigo table,body.theme-indigo .table-wrap,body.theme-indigo .bulk-table,body.theme-indigo .mrv-table,body.theme-indigo .portal-bill-table{color:#273149;background:#fff} body.theme-indigo th,body.theme-indigo .mrv-table th{color:#40368d;background:#efedfc} body.theme-indigo tbody tr:hover{background:#f4f2ff}
body.theme-indigo.theme-night{--bg:#0d1428;--panel:#18223b;--ink:#f3f6ff;--muted:#a9b5cc;--line:rgba(205,215,238,.13);--accent:#8977ff;--accent-2:#5ea1ff;--accent-dark:#5b46df;--charcoal:#0d1226;--soft:rgba(137,119,255,.15);color:#f3f6ff;background:linear-gradient(135deg,#0b1123 0%,#111a31 52%,#171d3b 100%)} body.theme-indigo.theme-night .sidebar{color:#edf2ff;border-color:rgba(205,215,238,.1);background:linear-gradient(180deg,#101530 0%,#171d42 54%,#0d132a 100%)} body.theme-indigo.theme-night .brand h1,body.theme-indigo.theme-night .topbar h2{color:#fff} body.theme-indigo.theme-night .nav button{color:#b8c4de}
body.theme-indigo.theme-night .topbar,body.theme-indigo.theme-night .app-tabs,body.theme-indigo.theme-night .clock-card,body.theme-indigo.theme-night .storage-card,body.theme-indigo.theme-night .panel,body.theme-indigo.theme-night .metric,body.theme-indigo.theme-night .report-card,body.theme-indigo.theme-night .task-panel,body.theme-indigo.theme-night .task-manager,body.theme-indigo.theme-night .client-contribution-panel,body.theme-indigo.theme-night .schedule-reminder-panel,body.theme-indigo.theme-night .ro-group-panel,body.theme-indigo.theme-night .modal-panel,body.theme-indigo.theme-night .billing-head-card,body.theme-indigo.theme-night .vendor-payable-card,body.theme-indigo.theme-night .mrv-vendor-group,body.theme-indigo.theme-night .access-denied-panel,body.theme-indigo.theme-night .dashboard-comparison-panel{color:#f3f6ff;border-color:rgba(205,215,238,.12);background:linear-gradient(145deg,rgba(29,40,69,.97),rgba(19,28,52,.95));box-shadow:0 24px 64px rgba(2,6,20,.35),inset 0 1px 0 rgba(255,255,255,.07)}
body.theme-indigo.theme-night .panel-head,body.theme-indigo.theme-night .task-panel .panel-head,body.theme-indigo.theme-night .client-contribution-panel .panel-head,body.theme-indigo.theme-night .panel-head.subtle,body.theme-indigo.theme-night .dashboard-comparison-head{color:#f3f6ff;border-color:rgba(205,215,238,.11);background:linear-gradient(135deg,rgba(42,53,86,.92),rgba(27,37,66,.88))} body.theme-indigo.theme-night input,body.theme-indigo.theme-night select,body.theme-indigo.theme-night textarea,body.theme-indigo.theme-night .letter-body-editor,body.theme-indigo.theme-night .task-assign{color:#f3f6ff;border-color:rgba(205,215,238,.15);background:linear-gradient(145deg,#26324f,#1a2540)} body.theme-indigo.theme-night table,body.theme-indigo.theme-night .table-wrap,body.theme-indigo.theme-night .bulk-table,body.theme-indigo.theme-night .mrv-table,body.theme-indigo.theme-night .portal-bill-table{color:#eaf0ff;background:#151f36} body.theme-indigo.theme-night th,body.theme-indigo.theme-night .mrv-table th{color:#ddd8ff;background:rgba(117,92,255,.17)} body.theme-indigo.theme-night td{color:#e7edfa}
body.theme-indigo .doc-box.ro-doc,body.theme-indigo .estimate-doc,body.theme-indigo .invoice-doc,body.theme-indigo .official-letter,body.theme-indigo .official-letter-page,body.theme-indigo .print-body{--bg:#f6f6f7;--panel:#fff;--ink:#242424;--muted:#707070;--line:rgba(36,36,36,.1);--accent:#ee2f38;--accent-2:#8b8d8f;--accent-dark:#ba2028;--charcoal:#2d2d30;--soft:#fff0f1}

/* Estimate media selector and item sourcing builder */
.estimate-type-selector {
  padding: 18px;
  border: 1px solid rgba(238, 47, 56, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 246, 247, 0.88));
  border-radius: 8px;
}

.estimate-type-selector-head,
.estimate-type-selector-head > div,
.estimate-type-options,
.item-sourcing-builder .panel-head,
.item-sourcing-calculation-panel > div,
.item-sourcing-calculation-panel dl {
  min-width: 0;
}

.estimate-type-selector-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.estimate-type-selector-head span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.estimate-type-selector-head h3,
.estimate-type-selector-head small {
  margin: 2px 0 0;
}

.estimate-type-selector-head small {
  color: var(--muted);
}

.estimate-type-options {
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}

.estimate-type-options button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid rgba(95, 95, 100, 0.14);
  border-radius: 7px;
  color: #3e3e42;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 18px rgba(45, 45, 48, 0.06);
  text-align: left;
}

.estimate-type-options button .material-symbols-rounded {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  color: #8d2028;
  background: #fff0f1;
  font-size: 18px;
}

.estimate-type-options button strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.18;
}

.estimate-type-options button small {
  grid-column: 2;
  color: #949499;
  font-size: 9px;
}

.estimate-type-options button.active {
  border-color: rgba(238, 47, 56, 0.48);
  background: linear-gradient(135deg, #fff, #ffe7e9);
  box-shadow: 0 8px 22px rgba(186, 32, 40, 0.13);
}

.estimate-type-options button.active .material-symbols-rounded {
  color: #fff;
  background: linear-gradient(135deg, #f34a52, #ba2028);
}

.estimate-type-options button.coming-soon:not(.active) {
  opacity: 0.68;
}

.estimate-coming-panel {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(238, 47, 56, 0.28);
  border-radius: 8px;
  background: rgba(255, 249, 249, 0.72);
}

.estimate-coming-panel .material-symbols-rounded {
  color: var(--accent);
  font-size: 36px;
}

.estimate-coming-panel h3,
.estimate-coming-panel p {
  margin: 0;
}

.estimate-coming-panel p {
  max-width: 580px;
  color: var(--muted);
}

.item-sourcing-main-fields {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.6fr);
  gap: 14px;
}

.item-sourcing-terms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.item-sourcing-builder {
  overflow: hidden;
  border: 1px solid rgba(238, 47, 56, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.item-sourcing-builder .panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(238, 47, 56, 0.12);
}

.item-sourcing-builder .panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.item-sourcing-builder .panel-head button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.item-sourcing-entry-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: collapse;
}

.item-sourcing-entry-table th {
  padding: 11px 9px;
  color: #75151d;
  background: #fff2f3;
  font-size: 11px;
  text-align: left;
}

.item-sourcing-entry-table th:nth-child(1) { width: 14%; }
.item-sourcing-entry-table th:nth-child(2) { width: 30%; }
.item-sourcing-entry-table th:nth-child(3) { width: 9%; }
.item-sourcing-entry-table th:nth-child(4) { width: 9%; }
.item-sourcing-entry-table th:nth-child(5) { width: 13%; }
.item-sourcing-entry-table th:nth-child(6) { width: 10%; }
.item-sourcing-entry-table th:nth-child(7) { width: 12%; }
.item-sourcing-entry-table th:nth-child(8) { width: 54px; }

.item-sourcing-entry-table td {
  padding: 8px;
  border-top: 1px solid rgba(95, 95, 100, 0.1);
  vertical-align: middle;
}

.item-sourcing-entry-table input,
.item-sourcing-entry-table textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(95, 95, 100, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #29292c;
}

.item-sourcing-entry-table textarea {
  min-height: 42px;
  resize: vertical;
}

.item-sourcing-entry-table [data-item-line-total] {
  color: #7d121b;
  white-space: nowrap;
}

.item-sourcing-calculation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 22px;
  padding: 16px;
  border: 1px solid rgba(238, 47, 56, 0.17);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,241,243,.76));
}

.item-sourcing-calculation-panel > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.item-sourcing-calculation-panel dl {
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid rgba(238, 47, 56, 0.16);
}

.item-sourcing-calculation-panel dl > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(95, 95, 100, 0.1);
}

.item-sourcing-calculation-panel dt {
  color: var(--muted);
}

.item-sourcing-calculation-panel dd {
  margin: 0;
  color: #3b3b3f;
  font-weight: 800;
}

.item-sourcing-calculation-panel .is-zero {
  display: none;
}

.item-sourcing-calculation-panel .grand {
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(238, 47, 56, 0.24);
  border-radius: 6px;
  background: #fff0f1;
}

.item-sourcing-calculation-panel .grand dt,
.item-sourcing-calculation-panel .grand dd {
  color: #83141d;
  font-size: 15px;
}

.item-estimate-client {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 7px 0;
  border: 1px solid #dadadd;
  border-left: 4px solid #ee2f38;
}

.item-estimate-client > div {
  min-width: 0;
  padding: 8px 10px;
}

.item-estimate-client > div + div {
  border-left: 1px solid #e3e3e5;
}

.item-estimate-client span {
  display: block;
  margin-bottom: 2px;
  color: #8d2028;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.item-estimate-client strong {
  display: block;
  color: #2d2d30;
}

.item-estimate-client p {
  margin: 2px 0 0;
  color: #66666b;
  font-size: 9.5px;
}

.item-sourcing-document-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  box-sizing: border-box;
}

.item-sourcing-document-table th,
.item-sourcing-document-table td {
  box-sizing: border-box;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #dedee1;
  color: #303034;
  font-size: 10px;
  line-height: 1.25;
  vertical-align: top;
  overflow: hidden;
}

.item-sourcing-document-table thead th {
  color: #7d121b;
  background: #fff1f2;
  text-align: left;
}

.item-sourcing-document-table .item-col-quantity,
.item-sourcing-document-table .item-col-unit,
.item-sourcing-document-table .item-col-unit-price,
.item-sourcing-document-table .item-col-discount,
.item-sourcing-document-table .item-col-total {
  white-space: nowrap;
}

.item-sourcing-document-table .item-col-unit-price,
.item-sourcing-document-table .item-col-discount,
.item-sourcing-document-table .item-col-total,
.item-sourcing-document-table tbody td:last-child {
  text-align: right;
}

.item-sourcing-document-table .item-col-details,
.item-sourcing-document-table tbody td:nth-child(3) {
  overflow-wrap: anywhere;
  word-break: normal;
}

.item-sourcing-document-table tbody td:last-child strong {
  display: block;
  width: 100%;
  color: #2e2e32;
  font-weight: 850;
  white-space: nowrap;
}

.item-sourcing-document-table .item-estimate-summary th {
  text-align: right;
  color: #505055;
  background: #f2f2f3;
}

.item-sourcing-document-table .item-estimate-summary td {
  white-space: nowrap;
  background: #f8f8f9;
}

.item-sourcing-document-table .item-estimate-summary.grand th,
.item-sourcing-document-table .item-estimate-summary.grand td {
  border-top: 2px solid #c7242e;
  border-bottom: 2px solid #c7242e;
  color: #751018;
  background: #ffe2e5;
  font-size: 12px;
  font-weight: 900;
}

.item-sourcing-document-table .item-estimate-summary.grand th {
  letter-spacing: 0;
  text-transform: uppercase;
}

.item-sourcing-document-table .item-estimate-summary.grand td {
  box-shadow: inset 4px 0 0 #c7242e;
}

.item-sourcing-doc .estimate-signature-row .sign-box em {
  display: none;
}

.item-sourcing-doc .estimate-signature-row .signature-img {
  width: 178px !important;
  height: 58px !important;
  max-width: 178px !important;
  max-height: 58px !important;
  margin: -2px 0 -6px !important;
  object-fit: contain !important;
}

.item-sourcing-doc .estimate-signature-row .sign-box {
  min-height: 96px;
  gap: 4px;
  padding: 8px 10px;
}

.item-sourcing-doc {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
  page: item-sourcing-portrait;
}

@page item-sourcing-portrait {
  size: A4 portrait;
  margin: 12mm;
}

.item-estimate-terms {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #e1e1e3;
  background: #fafafa;
}

.item-estimate-terms p {
  margin: 2px 0;
  color: #3e3e42;
  font-size: 9.5px;
}

.item-sourcing-doc.item-sourcing-dense .item-sourcing-document-table th,
.item-sourcing-doc.item-sourcing-dense .item-sourcing-document-table td {
  padding: 4px 5px;
  font-size: 9px;
  line-height: 1.16;
}

.item-sourcing-doc.item-sourcing-ultra-dense .item-sourcing-document-table th,
.item-sourcing-doc.item-sourcing-ultra-dense .item-sourcing-document-table td {
  padding: 3px 4px;
  font-size: 8px;
  line-height: 1.1;
}

.item-sourcing-doc.item-sourcing-dense .item-estimate-client,
.item-sourcing-doc.item-sourcing-ultra-dense .item-estimate-client {
  margin: 4px 0;
}

.item-sourcing-doc.item-sourcing-ultra-dense .item-estimate-client > div,
.item-sourcing-doc.item-sourcing-ultra-dense .item-estimate-terms {
  padding: 4px 6px;
}

.item-sourcing-doc.item-sourcing-ultra-dense .estimate-signature-row {
  margin-top: 3px;
}

body.theme-night .estimate-type-selector,
body.theme-night .item-sourcing-builder,
body.theme-night .item-sourcing-calculation-panel {
  border-color: rgba(122, 144, 190, 0.25);
  background: linear-gradient(135deg, #18253a, #1d2b42);
}

body.theme-night .estimate-type-options button,
body.theme-night .item-sourcing-entry-table input,
body.theme-night .item-sourcing-entry-table textarea {
  color: #eef4ff;
  border-color: rgba(156, 174, 210, 0.24);
  background: #24344d;
}

body.theme-night .estimate-type-options button.active {
  background: linear-gradient(135deg, #334c72, #253a59);
}

body.theme-night .item-sourcing-entry-table th {
  color: #b9d9ff;
  background: #202f47;
}

body.theme-night .item-sourcing-calculation-panel dd,
body.theme-night .item-sourcing-entry-table [data-item-line-total] {
  color: #eef4ff;
}

body.theme-indigo .estimate-type-options button.active .material-symbols-rounded,
body.theme-indigo .item-sourcing-builder .primary {
  background: linear-gradient(135deg, #5842f4, #3c2cc7);
}

@media (max-width: 980px) {
  .item-sourcing-main-fields,
  .item-sourcing-terms,
  .item-sourcing-calculation-panel,
  .item-sourcing-calculation-panel > div {
    grid-template-columns: 1fr;
  }
  .item-sourcing-calculation-panel dl {
    padding-left: 0;
    border-left: 0;
  }
}

@media print {
  .item-sourcing-doc {
    width: 186mm;
    max-width: 186mm;
    height: 273mm;
    min-height: 273mm;
    max-height: 273mm;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 auto;
    padding: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .item-sourcing-doc .item-sourcing-document-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  .item-sourcing-doc .item-sourcing-document-table th,
  .item-sourcing-doc .item-sourcing-document-table td {
    max-width: 0;
  }

  .item-sourcing-doc .item-sourcing-document-table .item-col-unit-price,
  .item-sourcing-doc .item-sourcing-document-table .item-col-total,
  .item-sourcing-doc .item-sourcing-document-table tbody td:nth-last-child(1) {
    white-space: nowrap;
  }

  .item-sourcing-doc .item-sourcing-document-table th,
  .item-sourcing-doc .item-sourcing-document-table td {
    padding: 3px 4px;
    font-size: 8.5pt;
    line-height: 1.15;
  }

  .item-sourcing-doc .item-estimate-client {
    margin: 4px 0;
  }

  .item-sourcing-doc .item-estimate-client > div {
    padding: 5px 7px;
  }

  .item-sourcing-doc .item-estimate-terms {
    margin-top: 5px;
    padding: 4px 6px;
  }

  .item-sourcing-doc .estimate-signature-row {
    margin-top: 5px;
  }

  .item-sourcing-doc.item-sourcing-dense .item-sourcing-document-table th,
  .item-sourcing-doc.item-sourcing-dense .item-sourcing-document-table td {
    padding: 2.5px 3.5px;
    font-size: 7.5pt;
    line-height: 1.08;
  }

  .item-sourcing-doc.item-sourcing-ultra-dense .item-sourcing-document-table th,
  .item-sourcing-doc.item-sourcing-ultra-dense .item-sourcing-document-table td {
    padding: 2px 3px;
    font-size: 6.6pt;
    line-height: 1.04;
  }

  .item-sourcing-doc.item-sourcing-ultra-dense .ro-title p,
  .item-sourcing-doc.item-sourcing-ultra-dense .item-estimate-client p,
  .item-sourcing-doc.item-sourcing-ultra-dense .item-estimate-terms p {
    font-size: 7pt;
    line-height: 1.05;
  }
}

/* Akshat-only recovery for historical gaps in the RO number series. */
.ro-series-gap-recover,
.ro-series-gap-label {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid rgba(181, 25, 35, 0.34);
  border-radius: 999px;
  color: #8b161d;
  background: linear-gradient(135deg, #fff6f6, #ffe4e6);
  box-shadow: 0 8px 20px rgba(160, 24, 34, 0.1), inset 0 1px 0 #fff;
}
.ro-series-gap-recover {
  cursor: pointer;
  font: inherit;
  transition: transform .24s ease, box-shadow .24s ease, color .24s ease;
}
.ro-series-gap-recover:hover {
  transform: translateY(-1px) scale(1.015);
  color: #fff;
  background: linear-gradient(135deg, #dc3545, #a51520);
  box-shadow: 0 12px 28px rgba(160, 24, 34, 0.24), inset 0 1px 0 rgba(255,255,255,.3);
}
.ro-series-gap-strip .ro-series-gap-recover strong,
.ro-series-gap-strip .ro-series-gap-label strong {
  position: static;
  z-index: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}
.ro-series-gap-strip .ro-series-gap-recover em,
.ro-series-gap-strip .ro-series-gap-label em {
  position: static;
  color: inherit;
  font-style: normal;
  font-size: 11px;
  opacity: .82;
  transform: none;
}

.missing-ro-recovery-modal .modal-panel { max-width: none; }
.missing-ro-recovery-modal .modal-form { background: linear-gradient(145deg, #f8f9fb, #f1f3f6); }
.missing-ro-recovery-intro {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(181, 25, 35, .2);
  border-radius: 8px;
  color: #67151b;
  background: linear-gradient(135deg, #fff, #fff0f1);
}
.missing-ro-recovery-intro > span { color: #c51f2a; font-size: 30px; }
.missing-ro-recovery-intro p { margin: 3px 0 0; color: #666; }
.missing-ro-recovery-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}
.missing-ro-recovery-card {
  overflow: visible;
  border: 1px solid #d9dde4;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 28px rgba(40,46,58,.07);
}
.missing-ro-recovery-card > summary {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
  color: #292c33;
}
.missing-ro-recovery-card > summary::-webkit-details-marker { display: none; }
.missing-ro-recovery-card > summary span { font-size: 17px; font-weight: 700; color: #9c1821; }
.missing-ro-recovery-card > summary small { color: #777d87; }
.missing-ro-recovery-card > summary i { transition: transform .25s ease; }
.missing-ro-recovery-card[open] > summary i { transform: rotate(180deg); }
.missing-ro-recovery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-top: 1px solid #e5e7ec;
  background: linear-gradient(145deg, #fff, #fbfbfc);
}
.missing-ro-recovery-grid label { min-width: 0; color: #4b4e55; font-size: 13px; font-weight: 600; }
.missing-ro-recovery-grid input,
.missing-ro-recovery-grid textarea { margin-top: 6px; color: #25272c; background: #fff; }
.missing-ro-recovery-grid textarea { min-height: 82px; }
.missing-ro-wide { grid-column: span 2; }
.missing-ro-full { grid-column: 1 / -1; }

body.theme-night .missing-ro-recovery-modal .modal-form,
body.theme-indigo.theme-night .missing-ro-recovery-modal .modal-form { background: linear-gradient(145deg, #111a2d, #18243b); }
body.theme-night .missing-ro-recovery-card,
body.theme-indigo.theme-night .missing-ro-recovery-card { border-color: rgba(211,220,238,.16); background: #18243b; }
body.theme-night .missing-ro-recovery-card > summary,
body.theme-indigo.theme-night .missing-ro-recovery-card > summary { color: #f2f6ff; }
body.theme-night .missing-ro-recovery-grid,
body.theme-indigo.theme-night .missing-ro-recovery-grid { border-color: rgba(211,220,238,.13); background: linear-gradient(145deg, #1b2942, #142039); }
body.theme-night .missing-ro-recovery-grid label,
body.theme-indigo.theme-night .missing-ro-recovery-grid label { color: #dfe7f7; }
body.theme-night .missing-ro-recovery-intro,
body.theme-indigo.theme-night .missing-ro-recovery-intro { color: #ffd9dc; border-color: rgba(255,120,132,.28); background: linear-gradient(135deg, #30202d, #241b2d); }
body.theme-night .missing-ro-recovery-intro p,
body.theme-indigo.theme-night .missing-ro-recovery-intro p { color: #bcc6d9; }

/* Indigo color correction: keep the app skin away from red/grey accents except true errors and printed documents. */
body.theme-indigo .mini-badge:not(.danger):not(.error),
body.theme-indigo .status-pill:not(.cancelled):not(.missed):not(.error),
body.theme-indigo .storage-card .mini-badge,
body.theme-indigo .client-contribution-panel .mini-badge {
  color: #06695b !important;
  border-color: rgba(16, 185, 129, .24) !important;
  background: linear-gradient(135deg, #e6fff5, #c9f8e5) !important;
}

body.theme-indigo .client-contribution-track {
  background: linear-gradient(90deg, #e6f7ff, #eafbf4) !important;
}

body.theme-indigo .client-contribution-track i,
body.theme-indigo .client-contribution-bar {
  background: linear-gradient(90deg, #10b981, #22d3ee) !important;
  box-shadow: 0 8px 18px rgba(16, 185, 129, .22) !important;
}

body.theme-indigo .client-contribution-name span {
  color: #312e81 !important;
  background: linear-gradient(135deg, #eef2ff, #dbeafe) !important;
}

body.theme-indigo .client-contribution-value strong {
  color: #059669 !important;
}

body.theme-indigo .client-contribution-value span,
body.theme-indigo .client-contribution-name strong {
  color: #172554 !important;
}

body.theme-indigo .task-panel .primary,
body.theme-indigo .task-manager .primary,
body.theme-indigo .task-add-button,
body.theme-indigo [data-add-task],
body.theme-indigo .task-actions button:not(.danger):not(.delete),
body.theme-indigo .task-row button:not(.danger):not(.delete) {
  color: #17324d !important;
  border-color: rgba(234, 179, 8, .34) !important;
  background: linear-gradient(135deg, #fde68a, #22c55e) !important;
  box-shadow: 0 12px 26px rgba(34, 197, 94, .16) !important;
}

body.theme-indigo .task-panel .secondary,
body.theme-indigo .task-manager .secondary,
body.theme-indigo .task-assign,
body.theme-indigo .task-input {
  color: #19365b !important;
  border-color: rgba(34, 211, 238, .26) !important;
  background: linear-gradient(145deg, #eff6ff, #ecfeff) !important;
}

body.theme-indigo .dashboard-chart-modes button:not(.active),
body.theme-indigo .theme-pill,
body.theme-indigo .glass-pill:not(.danger):not(.error) {
  color: #155e75 !important;
  border-color: rgba(34, 211, 238, .24) !important;
  background: linear-gradient(135deg, #ecfeff, #eef2ff) !important;
}

body.theme-indigo .metric:not(.metric-warning)::before {
  background: linear-gradient(90deg, #22d3ee, rgba(34, 211, 238, 0)) !important;
}

body.theme-indigo .metric:nth-child(2):not(.metric-warning)::before {
  background: linear-gradient(90deg, #10b981, rgba(16, 185, 129, 0)) !important;
}

body.theme-indigo .metric:nth-child(3):not(.metric-warning)::before {
  background: linear-gradient(90deg, #facc15, rgba(250, 204, 21, 0)) !important;
}

body.theme-indigo .metric-warning {
  color: #713f12 !important;
  border-color: rgba(234, 179, 8, .36) !important;
  background: linear-gradient(145deg, #fffbeb, #fef3c7) !important;
}

body.theme-indigo .metric-warning::before {
  background: linear-gradient(90deg, #facc15, rgba(250, 204, 21, 0)) !important;
}

body.theme-indigo .metric-warning span,
body.theme-indigo .metric-warning strong,
body.theme-indigo .metric-warning em {
  color: #713f12 !important;
}

body.theme-indigo .nav button:hover:not(.danger),
body.theme-indigo .nav button.active:not(.danger) {
  color: #fff !important;
  background: linear-gradient(135deg, #4f46e5, #0891b2) !important;
  box-shadow: 0 12px 25px rgba(8, 145, 178, .22) !important;
}

body.theme-indigo .primary:not(.danger):not(.error):not(.cancelled) {
  color: #fff !important;
  border-color: rgba(79, 70, 229, .36) !important;
  background: linear-gradient(135deg, #4f46e5, #06b6d4) !important;
}

body.theme-indigo .secondary:not(.danger):not(.error):not(.cancelled),
body.theme-indigo #printBtn {
  color: #064e3b !important;
  border-color: rgba(16, 185, 129, .28) !important;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
}

body.theme-indigo.theme-night .client-contribution-track {
  background: linear-gradient(90deg, rgba(34, 211, 238, .16), rgba(16, 185, 129, .14)) !important;
}

body.theme-indigo.theme-night .client-contribution-name strong,
body.theme-indigo.theme-night .client-contribution-value span {
  color: #eaf7ff !important;
}

body.theme-indigo.theme-night .client-contribution-value strong {
  color: #67e8f9 !important;
}

body.theme-indigo.theme-night .task-panel .secondary,
body.theme-indigo.theme-night .task-manager .secondary,
body.theme-indigo.theme-night .task-assign,
body.theme-indigo.theme-night .task-input {
  color: #e9fbff !important;
  border-color: rgba(34, 211, 238, .24) !important;
  background: linear-gradient(145deg, #152845, #123044) !important;
}

body.theme-indigo.theme-night .metric-warning {
  color: #fef3c7 !important;
  border-color: rgba(250, 204, 21, .3) !important;
  background: linear-gradient(145deg, rgba(113, 63, 18, .28), rgba(30, 41, 59, .94)) !important;
}

body.theme-indigo.theme-night .metric-warning span,
body.theme-indigo.theme-night .metric-warning strong,
body.theme-indigo.theme-night .metric-warning em {
  color: #fef3c7 !important;
}

@media (max-width: 1100px) {
  .missing-ro-recovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .ro-series-gap-recover,
  .ro-series-gap-label { flex-direction: column; gap: 2px; border-radius: 8px; }
  .missing-ro-recovery-grid { grid-template-columns: 1fr; }
  .missing-ro-wide,
  .missing-ro-full { grid-column: 1; }
}
/* Media Planner estimate */
.media-planner-form {
  overflow: visible;
}

.media-planner-badge,
.media-planner-list-badge {
  border-color: rgba(79, 70, 229, 0.2);
  color: #4338ca;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.media-planner-lock-row {
  align-items: stretch;
}

.media-planner-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 8px;
  color: #312e81;
  background:
    linear-gradient(135deg, rgba(238, 242, 255, 0.96), rgba(236, 254, 255, 0.9)),
    #fff;
}

.media-planner-intro > .material-symbols-rounded {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.22);
}

.media-planner-intro strong {
  display: block;
  font-size: 18px;
}

.media-planner-intro p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
}

.media-planner-main-fields {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(260px, 1fr) minmax(190px, 0.65fr);
  gap: 16px;
  align-items: end;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
}

.media-planner-main-fields > label {
  min-width: 0;
}

.media-planner-plan-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.28fr);
  gap: 12px;
}

.media-planner-note-field,
.media-planner-group-field {
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 8px;
  color: #312e81;
  background: linear-gradient(135deg, #f8faff, #f5f3ff);
}

.media-planner-note-field {
  grid-template-columns: auto auto 1fr;
}

.media-planner-group-field {
  grid-template-columns: auto minmax(110px, 1fr);
  font-weight: 750;
}

.media-planner-note-field small {
  color: #7c83a0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.media-planner-note-field input {
  min-width: 0;
}

.media-planner-group-field select {
  min-width: 0;
}

.media-planner-size-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-planner-builder {
  overflow: hidden;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 45px rgba(49, 46, 129, 0.07);
}

.media-planner-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(79, 70, 229, 0.12);
  background: linear-gradient(135deg, #f5f3ff, #ecfeff);
}

.media-planner-builder-head span {
  color: #0891b2;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.media-planner-builder-head h3 {
  margin: 3px 0 2px;
  color: #312e81;
}

.media-planner-builder-head p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.media-planner-add-button {
  flex: 0 0 auto;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5, #0891b2);
}

.media-planner-entry-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.media-planner-entry-table th {
  padding: 12px 10px;
  color: #312e81;
  background: #f8fafc;
  text-align: left;
}

.media-planner-entry-table th:nth-child(1),
.media-planner-entry-table td:nth-child(1) {
  width: 64px;
  text-align: center;
}

.media-planner-entry-table th:nth-child(2) { width: 35%; }
.media-planner-entry-table th:nth-child(3) { width: 32%; }
.media-planner-entry-table th:nth-child(4) { width: 22%; }
.media-planner-entry-table th:last-child,
.media-planner-entry-table td:last-child {
  width: 56px;
  text-align: center;
}

.media-planner-entry-table td {
  padding: 9px 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  vertical-align: middle;
}

.media-planner-entry-table input,
.media-planner-entry-table select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 7px;
  color: #1f2937;
  background: #fff;
}

.media-planner-entry-table input:focus,
.media-planner-entry-table select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.11);
}

.media-planner-row-number {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #4338ca;
  background: #eef2ff;
  font-weight: 800;
}

.media-planner-edit-modal .modal-panel {
  width: min(92vw, 1320px);
}

.media-planner-doc {
  min-height: 277mm;
  color: #20242b;
  background: #fff;
}

.media-planner-doc .ro-title {
  position: relative;
  display: block;
  min-height: 82px;
}

.media-planner-doc .ro-title-text {
  width: 100%;
  padding: 0 118px;
  text-align: center;
}

.media-planner-doc .ro-title .ro-logo {
  position: absolute;
  top: 0;
  right: 0;
}

.media-planner-heading h3 {
  color: #4338ca;
  letter-spacing: 0;
}

.media-planner-client-strip {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  margin: 14px 0;
  border: 1px solid #d8dce6;
  border-left: 4px solid #4f46e5;
  border-radius: 6px;
  background: #f8f9fc;
}

.media-planner-client-strip > div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 72px;
  padding: 12px 15px;
}

.media-planner-client-strip > div + div {
  border-left: 1px solid #d8dce6;
}

.media-planner-client-strip span {
  color: #6b7280;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.media-planner-client-strip strong {
  color: #24272d;
  font-size: 14px;
}

.media-planner-client-strip small {
  color: #687080;
  font-size: 9px;
}

.media-planner-note-line {
  margin: 10px 0 0;
  padding: 8px 11px;
  border-left: 3px solid #6366f1;
  color: #30364a;
  background: #f5f6ff;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.media-planner-spreads {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.media-planner-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.media-planner-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.media-planner-spread.single-column {
  grid-template-columns: 1fr;
}

.media-planner-document-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.media-planner-document-table .planner-col-number { width: 11%; }
.media-planner-document-table .planner-col-publication { width: 38%; }
.media-planner-document-table .planner-col-edition { width: 30%; }
.media-planner-document-table .planner-col-language { width: 21%; }

.media-planner-document-table th {
  padding: 9px 10px;
  border: 1px solid #d8dce6;
  color: #fff;
  background: #3730a3;
  font-size: 10px;
  text-align: left;
}

.media-planner-document-table td {
  padding: 8px 10px;
  border: 1px solid #d8dce6;
  color: #252931;
  background: #fff;
  font-size: 10px;
  vertical-align: top;
}

.media-planner-document-table tbody tr:nth-child(even) td {
  background: #f7f8fc;
}

.media-planner-document-table tbody tr.planner-group-start td {
  border-top: 3px solid #6366f1;
}

.media-planner-document-table th:first-child,
.media-planner-document-table td:first-child {
  text-align: center;
}

.media-planner-density-medium .media-planner-document-table th,
.media-planner-density-medium .media-planner-document-table td {
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.3;
}

.media-planner-density-compact .media-planner-document-table th,
.media-planner-density-compact .media-planner-document-table td {
  padding: 5px 7px;
  font-size: 10px;
  line-height: 1.3;
}

.media-planner-density-ultra .media-planner-client-strip {
  margin: 8px 0;
}

.media-planner-density-ultra .media-planner-client-strip > div {
  min-height: 54px;
  padding: 7px 11px;
}

.media-planner-density-ultra .media-planner-document-table th,
.media-planner-density-ultra .media-planner-document-table td {
  padding: 3px 6px;
  font-size: 10px;
  line-height: 1.22;
}

.media-planner-inline-signature {
  width: min(84%, 265px);
  min-height: 82px;
  margin: 10px 0 0 auto;
  padding: 6px 9px;
  gap: 2px;
  box-sizing: border-box;
  break-inside: avoid;
  page-break-inside: avoid;
}

.media-planner-inline-signature span,
.media-planner-inline-signature strong {
  font-size: 10px;
  line-height: 1.15;
}

.doc-box.ro-doc .media-planner-inline-signature .signature-img,
.bulk-pdf-render-root .doc-box.ro-doc .media-planner-inline-signature .signature-img,
.print-body .doc-box.ro-doc .media-planner-inline-signature .signature-img {
  width: 128px !important;
  height: 45px !important;
  max-width: 128px !important;
  max-height: 45px !important;
  margin: -2px 0 -5px !important;
  object-fit: contain !important;
}

body.theme-night .media-planner-intro,
body.theme-night .media-planner-main-fields,
body.theme-night .media-planner-note-field,
body.theme-night .media-planner-group-field,
body.theme-night .media-planner-builder {
  border-color: rgba(129, 140, 248, 0.22);
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(28, 39, 61, 0.96), rgba(20, 30, 48, 0.96));
}

body.theme-night .media-planner-intro strong,
body.theme-night .media-planner-note-field,
body.theme-night .media-planner-group-field,
body.theme-night .media-planner-builder-head h3 {
  color: #f8fafc;
}

body.theme-night .media-planner-intro p,
body.theme-night .media-planner-builder-head p {
  color: #cbd5e1;
}

body.theme-night .media-planner-builder-head,
body.theme-night .media-planner-entry-table th {
  color: #e0e7ff;
  background: rgba(79, 70, 229, 0.14);
}

body.theme-night .media-planner-entry-table td {
  border-color: rgba(148, 163, 184, 0.12);
}

body.theme-indigo .media-planner-add-button {
  background: linear-gradient(135deg, #5538ee, #13a8c7);
}

@media (max-width: 900px) {
  .media-planner-main-fields {
    grid-template-columns: 1fr;
  }

  .media-planner-lock-row,
  .media-planner-builder-head {
    display: grid;
  }
}

@media print {
  @page media-planner-page {
    size: A4 portrait;
    margin: 7mm;
  }

  .media-planner-doc {
    page: media-planner-page;
    width: 196mm !important;
    min-height: 283mm !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 7mm !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .media-planner-document-table {
    break-inside: auto;
    page-break-inside: auto;
  }

  .media-planner-spread {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .media-planner-document-table thead {
    display: table-header-group;
  }

  .media-planner-document-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .media-planner-document-table th {
    color: #fff !important;
    background: #3730a3 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .media-planner-document-table tbody tr:nth-child(even) td,
  .media-planner-client-strip,
  .media-planner-note-line {
    background: #f7f8fc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .media-planner-document-table tbody tr.planner-group-start td {
    border-top-color: #4f46e5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (max-width: 900px) {
  .media-planner-plan-controls {
    grid-template-columns: 1fr;
  }
}
