:root,
html[data-theme="light"] {
  color-scheme: light;
  --brand-navy: #0b1f3a;
  --brand-blue: #0088d6;
  --brand-cyan: #00b4f0;
  --brand-teal: #2ee6c8;
  --brand-light: #f4f8fc;
  --brand-background: #f7fafd;
  --brand-text: #0b1f3a;
  --brand-muted: #5b6b7c;
  --px-primary: var(--brand-blue);
  --px-primary-dark: #0070b3;
  --px-primary-soft: #e8f6fd;
  --px-bg: var(--brand-background);
  --px-surface: #ffffff;
  --px-border: #e2e8f0;
  --px-text: var(--brand-text);
  --px-muted: var(--brand-muted);
  --px-sidebar-width: 250px;
  --px-radius: 12px;
  --px-shadow: 0 1px 3px rgba(11, 31, 58, 0.06), 0 8px 24px rgba(11, 31, 58, 0.04);
  --px-sidebar-bg: #f8fafc;
  --px-input-bg: #ffffff;
  --px-soft: #f9fafb;
  --px-row-hover: #f3f4f6;
  --px-link-idle: #4b5563;
  --px-promo-bg: linear-gradient(135deg, rgba(0, 136, 214, 0.1), rgba(46, 230, 200, 0.12));
  --px-promo-text: var(--brand-navy);
  --px-ops-header-bg: #fde68a;
  --px-ops-header-text: #78350f;
  --px-preview-stage: linear-gradient(180deg, #e8edf3 0%, #dfe5ec 100%);
  --px-preview-stage-glow: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --brand-navy: #e2e8f0;
  --brand-blue: #38bdf8;
  --brand-cyan: #22d3ee;
  --brand-teal: #2dd4bf;
  --brand-light: #111827;
  --brand-background: #020617;
  --brand-text: #e2e8f0;
  --brand-muted: #94a3b8;
  --px-bg: #020617;
  --px-surface: #0f172a;
  --px-border: #334155;
  --px-text: var(--brand-text);
  --px-muted: var(--brand-muted);
  --px-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 12px 28px rgba(0, 0, 0, 0.35);
  --px-sidebar-bg: #020617;
  --px-input-bg: #1e293b;
  --px-soft: #111827;
  --px-row-hover: #1e293b;
  --px-link-idle: #cbd5e1;
  --px-promo-bg: linear-gradient(135deg, rgba(0, 180, 240, 0.18), rgba(46, 230, 200, 0.1));
  --px-promo-text: #e0f2fe;
  --px-ops-header-bg: rgba(245, 158, 11, 0.2);
  --px-ops-header-text: #fbbf24;
  --px-preview-stage: linear-gradient(180deg, #0b1220 0%, #020617 100%);
  --px-preview-stage-glow: rgba(0, 180, 240, 0.08);
  --px-primary: var(--brand-blue);
  --px-primary-dark: #0ea5e9;
  --px-primary-soft: rgba(56, 189, 248, 0.16);
  --bs-body-bg: var(--px-bg);
  --bs-body-color: var(--px-text);
  --bs-secondary-color: var(--px-muted);
  --bs-tertiary-bg: var(--px-soft);
  --bs-border-color: var(--px-border);
  --bs-emphasis-color: #f8fafc;
  --bs-heading-color: var(--px-text);
  --bs-link-color: var(--px-primary);
  --bs-link-hover-color: var(--px-primary-dark);
  --bs-table-bg: transparent;
  --bs-table-color: var(--px-text);
  --bs-table-border-color: var(--px-border);
  --bs-table-hover-bg: var(--px-row-hover);
  --bs-table-hover-color: var(--px-text);
  --bs-table-striped-bg: rgba(148, 163, 184, 0.06);
  --bs-table-striped-color: var(--px-text);
}

html[data-accent="blue"] {
  --px-primary: var(--brand-blue);
  --px-primary-dark: #0070b3;
  --px-primary-soft: #e8f6fd;
}
html[data-theme="dark"][data-accent="blue"] {
  --px-primary: #38bdf8;
  --px-primary-dark: #0ea5e9;
  --px-primary-soft: rgba(56, 189, 248, 0.16);
}

html[data-accent="teal"] {
  --px-primary: var(--brand-teal);
  --px-primary-dark: #14b8a6;
  --px-primary-soft: #ecfdf8;
}
html[data-theme="dark"][data-accent="teal"] {
  --px-primary-soft: rgba(20, 184, 166, 0.16);
}

html[data-accent="emerald"] {
  --px-primary: #10b981;
  --px-primary-dark: #059669;
  --px-primary-soft: #ecfdf5;
}
html[data-theme="dark"][data-accent="emerald"] {
  --px-primary-soft: rgba(16, 185, 129, 0.16);
}

html[data-accent="amber"] {
  --px-primary: #f59e0b;
  --px-primary-dark: #d97706;
  --px-primary-soft: #fffbeb;
}
html[data-theme="dark"][data-accent="amber"] {
  --px-primary-soft: rgba(245, 158, 11, 0.16);
}

html[data-accent="rose"] {
  --px-primary: #f43f5e;
  --px-primary-dark: #e11d48;
  --px-primary-soft: #fff1f2;
}
html[data-theme="dark"][data-accent="rose"] {
  --px-primary-soft: rgba(244, 63, 94, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--px-bg);
  color: var(--px-text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

a {
  color: var(--px-primary);
  text-decoration: none;
}

a:hover {
  color: var(--px-primary-dark);
}

/* App shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--px-sidebar-width);
  background: var(--px-sidebar-bg);
  border-right: 1px solid var(--px-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--px-border);
  text-decoration: none;
  color: inherit;
  min-height: 64px;
}

.sidebar-brand:hover {
  color: inherit;
  background: transparent;
}

.sidebar-brand-logo {
  display: block;
  width: auto;
  max-width: 176px;
  height: 38px;
  object-fit: contain;
  object-position: left center;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  filter: none;
}

.sidebar-brand-logo--dark {
  display: none;
}

html[data-theme="dark"] .sidebar-brand-logo--light {
  display: none;
}

html[data-theme="dark"] .sidebar-brand-logo--dark {
  display: block;
}

.sidebar-brand-mark {
  display: none;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-blue, var(--px-primary)), var(--brand-cyan, var(--px-primary-dark)));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--px-text);
}

.sidebar-footer-meta {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--px-muted);
  line-height: 1.35;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 24px 18px;
  margin-top: auto;
  border-top: 1px solid var(--px-border);
  color: var(--px-muted);
  font-size: 0.78rem;
  background: var(--px-surface);
}

.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--px-link-idle);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  color: inherit;
  opacity: 0.9;
}

.sidebar-link:hover {
  background: var(--px-primary-soft);
  color: var(--px-primary);
}

.sidebar-link.active {
  background: var(--px-primary);
  color: #fff;
}

.sidebar-link.active i {
  opacity: 1;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--px-border);
}

.sidebar-promo {
  background: var(--px-promo-bg);
  border-radius: var(--px-radius);
  padding: 14px;
  font-size: 0.82rem;
  color: var(--px-promo-text);
}

.app-main {
  flex: 1;
  margin-left: var(--px-sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--px-surface);
  border-bottom: 1px solid var(--px-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--px-muted);
  padding: 0;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.topbar-search-wrap {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.topbar-search {
  position: relative;
}

.topbar-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--px-muted);
}

.topbar-search input {
  width: 100%;
  border: 1px solid var(--px-border);
  border-radius: 999px;
  padding: 8px 14px 8px 38px;
  font-size: 0.9rem;
  background: var(--px-soft);
  color: var(--px-text);
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--px-primary);
  box-shadow: 0 0 0 3px var(--px-primary-soft);
  background: var(--px-surface);
}

.global-search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  z-index: 1100;
  max-height: 380px;
  overflow-y: auto;
  display: none;
}

.global-search-suggestions.show {
  display: block;
}

.global-search-suggestion {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--px-border);
}

.global-search-suggestion:last-of-type {
  border-bottom: 0;
}

.global-search-suggestion.active,
.global-search-suggestion:hover {
  background: var(--px-row-hover);
}

.global-search-suggestion-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.global-search-suggestion-subtitle {
  font-size: 0.8rem;
  color: var(--px-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-suggestion-footer,
.global-search-empty {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--px-primary);
  text-decoration: none;
  background: var(--px-soft);
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--px-border);
  background: var(--px-surface);
  color: var(--px-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.topbar-icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
}

.user-menu .dropdown-toggle {
  border: 1px solid var(--px-border);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  background: var(--px-surface);
  color: var(--px-text);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--px-primary), var(--px-primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.page-content {
  padding: 20px 24px 32px;
}

/* Cards & metrics */
.px-card {
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius);
  box-shadow: var(--px-shadow);
}

.px-card-body {
  padding: 18px 20px;
}

.px-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--px-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.px-card-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.metric-card {
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius);
  padding: 18px 20px;
  box-shadow: var(--px-shadow);
  height: 100%;
}

.metric-label {
  color: var(--px-muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.metric-trend {
  font-size: 0.78rem;
  margin-top: 8px;
  color: var(--px-muted);
}

.metric-trend.up {
  color: #059669;
}

.ops-overview-header {
  align-items: flex-start;
  gap: 12px;
}

.ops-overview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.ops-overview-colors {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ops-color-picker {
  position: relative;
  width: 28px;
  height: 28px;
  margin: 0;
  cursor: pointer;
}

.ops-color-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ops-color-dot {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e5e7eb, 0 2px 6px rgba(15, 23, 42, 0.12);
  background: #6366f1;
}

.ops-overview-kpis {
  display: flex;
  gap: 28px;
  margin-bottom: 12px;
}

.ops-kpi-label {
  font-size: 0.75rem;
  color: var(--px-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ops-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--px-text);
}

.ops-chart-wrap {
  position: relative;
  height: 260px;
  background: var(--px-surface);
}

.ops-overview-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--px-muted);
}

.ops-legend-line {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  background: #6366f1;
}

.ops-legend-line.is-bookings {
  background: #ef4444;
}

.ops-overview-card.is-loading .ops-chart-wrap {
  opacity: 0.55;
}

/* Page toolbar */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar-filters .form-control,
.toolbar-filters .form-select {
  min-width: 180px;
  border-radius: 8px;
  font-size: 0.88rem;
}

/* Tables */
.table-card .table {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.table-card thead th {
  background: var(--px-soft);
  color: var(--px-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--px-border);
  padding: 12px 16px;
  white-space: nowrap;
}

.table-card tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  border-color: var(--px-border);
  max-width: 220px;
  color: var(--px-text);
  background-color: transparent;
}

.table-card .cell-truncate {
  display: block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-card tbody tr:hover,
.table-card tbody tr:hover > * {
  background-color: var(--px-row-hover) !important;
  color: var(--px-text) !important;
  --bs-table-bg-state: var(--px-row-hover);
  --bs-table-color-state: var(--px-text);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.draft,
.status-badge.pending,
.status-badge.unpaid {
  background: #fef3c7;
  color: #b45309;
}

.status-badge.sent {
  background: #e0e7ff;
  color: #4338ca;
}

.status-badge.accepted,
.status-badge.confirmed,
.status-badge.deposit_paid,
.status-badge.fully_paid {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-badge.completed {
  background: #e0e7ff;
  color: #4338ca;
}

.tour-type-badge {
  background: #f3f4f6;
  color: #4b5563;
}

.status-badge.cancelled,
.status-badge.expired {
  background: #fee2e2;
  color: #b91c1c;
}

.status-badge.active {
  background: #d1fae5;
  color: #047857;
}

.status-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue, var(--px-primary)), var(--brand-cyan, #00b4f0));
  border-color: transparent;
  border-radius: 8px;
  font-weight: 600;
  padding: 8px 16px;
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--px-primary-dark), var(--brand-blue, var(--px-primary)));
  border-color: transparent;
  color: #fff;
  filter: brightness(1.04);
}

.btn-outline-primary {
  border-radius: 8px;
  font-weight: 500;
}

.btn-success {
  border-radius: 8px;
  font-weight: 500;
}

.package-day-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 992px) {
  .package-day-columns {
    grid-template-columns: 1fr;
  }
}

.package-day-column {
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius);
  padding: 14px;
  background: var(--px-soft);
}

.package-day-column.is-joiner {
  border-color: color-mix(in srgb, #2563eb 35%, var(--px-border));
}

.package-day-column.is-exclusive {
  border-color: color-mix(in srgb, #c2410c 35%, var(--px-border));
}

.package-day-column-title {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--px-text);
}

.package-day-card {
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.package-day-card.is-optional {
  border-style: dashed;
}

.package-day-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.package-day-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--px-muted);
}

.package-day-num {
  max-width: 72px;
}

.package-tour-mode-card {
  background: var(--px-soft);
  border-color: var(--px-border) !important;
}

.package-tour-mode-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--px-text);
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 72px;
  max-height: 160px;
  overflow: auto;
  margin: 0;
}

.form-section-card {
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius);
  box-shadow: var(--px-shadow);
  margin-bottom: 18px;
  overflow: hidden;
}

.form-section-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--px-border);
  background: var(--px-soft);
}

.form-section-header.is-ops {
  background: var(--px-ops-header-bg);
  border-bottom-color: transparent;
}

.form-section-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--px-text);
}

.form-section-header.is-ops h3 {
  color: var(--px-ops-header-text);
}

.form-section-body {
  padding: 20px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--px-text);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  border-radius: 8px;
  border-color: var(--px-border);
  background-color: var(--px-input-bg);
  color: var(--px-text);
  font-size: 0.9rem;
  color-scheme: inherit;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--px-primary);
  box-shadow: 0 0 0 3px var(--px-primary-soft);
  background-color: var(--px-input-bg);
  color: var(--px-text);
}

.form-control::placeholder {
  color: var(--px-muted);
  opacity: 1;
}

.form-select option,
select option {
  background-color: var(--px-input-bg);
  color: var(--px-text);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-actions-bar {
  position: sticky;
  bottom: 0;
  background: color-mix(in srgb, var(--px-surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--px-border);
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
  border-radius: 0 0 var(--px-radius) var(--px-radius);
  z-index: 10;
}

.quotation-editor-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: calc(100vh - 120px);
}

.ops-assign-embedded {
  min-height: 640px;
  margin-top: 4px;
}

.quotation-detail-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: calc(100vh - 180px);
  margin-top: 12px;
}

.quotation-detail-main {
  width: var(--quotation-form-width, 46%);
  min-width: 360px;
  max-width: 72%;
  flex-shrink: 0;
  min-height: 0;
  padding-right: 12px;
}

.quotation-detail-layout.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.quotation-detail-layout.is-resizing .quotation-detail-main,
.quotation-detail-layout.is-resizing .quotation-editor-preview {
  pointer-events: none;
}

.tour-customization-panel {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.tour-customization-panel.is-open {
  border-style: none;
}

#tourCustomizationModal .modal-body {
  max-height: min(70vh, 640px);
}

#tourCustomizationModal .tour-section-card {
  margin-bottom: 12px;
}

.tour-package-add-select {
  min-width: 220px;
  max-width: 320px;
}

.tour-sections-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-section-card {
  border: 1px solid var(--px-border);
  border-radius: 10px;
  padding: 10px;
  background: var(--px-surface);
}

.tour-section-card-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.tour-section-card-header .tour-section-title {
  flex: 1;
}

.quotation-editor-form {
  width: var(--quotation-form-width, 42%);
  min-width: 520px;
  max-width: 72%;
  flex-shrink: 0;
  min-height: 0;
  padding-right: 12px;
}

.quotation-editor-resizer {
  width: 10px;
  margin: 0 -2px;
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  z-index: 2;
  touch-action: none;
}

.quotation-editor-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #d7dee8;
  transition: background 0.15s ease, width 0.15s ease;
}

.quotation-editor-resizer:hover::before,
.quotation-editor-resizer.is-dragging::before {
  background: #94a3b8;
  width: 3px;
}

.quotation-editor-resizer:focus-visible {
  outline: none;
}

.quotation-editor-resizer:focus-visible::before {
  background: var(--px-primary);
  width: 3px;
}

.quotation-editor-layout.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.quotation-editor-layout.is-resizing .quotation-editor-form,
.quotation-editor-layout.is-resizing .quotation-editor-preview {
  pointer-events: none;
}

.quotation-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(260px, 1.15fr);
  gap: 12px;
  align-items: start;
}

.quotation-form-wide {
  grid-column: 1 / -1;
}

.quotation-editor-form .form-section-header {
  padding: 10px 14px;
}

.quotation-editor-form .form-section-header h3 {
  font-size: 0.88rem;
}

.quotation-editor-form .form-section-body {
  padding: 14px;
}

.quotation-editor-form .form-label {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.quotation-editor-form .form-control,
.quotation-editor-form .form-select {
  font-size: 0.84rem;
  padding: 0.4rem 0.55rem;
}

.quotation-editor-form textarea.form-control {
  min-height: 72px;
}

.quotation-editor-form .mb-3 {
  margin-bottom: 0.7rem !important;
}

.quotation-editor-form .form-actions-bar {
  padding: 10px 14px;
}

.quotation-editor-preview {
  position: sticky;
  top: 72px;
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: calc(100vh - 88px);
  padding-left: 12px;
}

.quotation-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  flex-shrink: 0;
}

.quotation-preview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quotation-preview-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--px-muted);
}

.quotation-preview-zoom {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--px-border);
  border-radius: 999px;
  background: var(--px-surface);
}

.quotation-preview-zoom-btn,
.quotation-preview-zoom-fit {
  border: 0;
  background: transparent;
  color: var(--px-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.quotation-preview-zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.quotation-preview-zoom-fit {
  height: 28px;
  padding: 0 10px;
  margin-left: 2px;
  border-left: 1px solid var(--px-border);
  border-radius: 0 999px 999px 0;
  font-size: 0.75rem;
  font-weight: 600;
}

.quotation-preview-zoom-btn:hover,
.quotation-preview-zoom-fit:hover {
  background: var(--px-row-hover);
  color: var(--px-text);
}

.quotation-preview-zoom-value {
  min-width: 44px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--px-text);
}

.quotation-preview-sync {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.quotation-editor-preview.is-syncing .quotation-preview-sync {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  opacity: 0.85;
}

.quotation-preview-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 16px 10px 20px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, var(--px-preview-stage-glow), transparent 55%),
    var(--px-preview-stage);
  overflow: auto;
}

.quotation-preview-zoom-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100%;
  padding-bottom: 24px;
}

.quotation-preview-paper {
  background: #fff;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 14px 34px rgba(15, 23, 42, 0.14),
    0 28px 54px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.25s ease;
}

.quotation-preview-paper.is-multipage {
  background: transparent;
  box-shadow: none;
}

.quotation-preview-pdf-page {
  background: #fff;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 14px 34px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.quotation-editor-preview.is-syncing .quotation-preview-paper {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 10px 24px rgba(15, 23, 42, 0.1);
}

.quotation-editor-preview.is-syncing .quotation-preview-paper.is-multipage {
  box-shadow: none;
}

.quotation-preview-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  image-rendering: auto;
}

.quotation-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #64748b;
}

.quotation-preview-placeholder i {
  font-size: 2rem;
  opacity: 0.4;
}

.quotation-preview-placeholder p {
  margin: 0;
  max-width: 240px;
  font-size: 0.88rem;
}

@media (max-width: 1199.98px) {
  .quotation-editor-layout,
  .quotation-detail-layout {
    flex-direction: column;
    min-height: 0;
  }

  .quotation-editor-form,
  .quotation-detail-main {
    width: 100% !important;
    min-width: 0;
    max-width: none;
    padding-right: 0;
  }

  .quotation-editor-resizer {
    display: none;
  }

  .quotation-form-grid {
    grid-template-columns: 1fr;
  }

  .quotation-editor-preview {
    position: static;
    height: auto;
    min-width: 0;
    padding-left: 0;
  }

  .quotation-preview-stage {
    min-height: 720px;
  }
}

/* Detail panels */
.detail-grid .detail-item {
  margin-bottom: 12px;
}

.detail-grid .detail-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--px-muted);
  margin-bottom: 2px;
}

.detail-grid .detail-value {
  font-weight: 500;
}

/* Calendar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-filter-select {
  width: auto;
  min-width: 140px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--px-muted);
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-grid.is-week .calendar-cell {
  min-height: 220px;
}

.calendar-cell {
  min-height: 110px;
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--px-shadow);
  overflow: hidden;
}

.calendar-cell.is-blank {
  background: var(--px-soft);
  box-shadow: none;
}

.calendar-cell.is-today {
  border-color: var(--px-primary);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.calendar-cell .day-num {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--px-text);
}

.calendar-event {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.72rem;
  background: var(--px-primary);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 4px 6px;
  margin-top: 4px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.calendar-event.is-exclusive {
  background: #d97706;
}

.calendar-event.is-middle,
.calendar-event.is-end {
  border-radius: 0 6px 6px 0;
}

.calendar-event.is-start:not(.is-single) {
  border-radius: 6px 0 0 6px;
}

.calendar-event.is-continuation {
  opacity: 0.85;
  font-weight: 600;
}

.calendar-event:hover {
  filter: brightness(1.05);
}

.calendar-grid.is-markers-dots .calendar-event,
.calendar-grid.is-markers-initials .calendar-event {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  margin: 2px 3px 0 0;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: top;
}

.calendar-grid.is-markers-dots .calendar-event {
  font-size: 0;
  color: transparent;
  text-indent: -999px;
}

.calendar-grid.is-markers-dots .calendar-event.is-start:not(.is-single),
.calendar-grid.is-markers-dots .calendar-event.is-middle,
.calendar-grid.is-markers-dots .calendar-event.is-end,
.calendar-grid.is-markers-initials .calendar-event.is-start:not(.is-single),
.calendar-grid.is-markers-initials .calendar-event.is-middle,
.calendar-grid.is-markers-initials .calendar-event.is-end {
  border-radius: 50%;
}

.calendar-grid.is-markers-overflow .calendar-event.is-marker-hidden {
  display: none;
}

.calendar-overflow-more {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--px-muted, #94a3b8);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.calendar-overflow-more:hover {
  color: var(--px-primary);
  text-decoration: underline;
}

.calendar-event-card {
  white-space: normal;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.calendar-day-list {
  max-width: 720px;
  margin: 0 auto;
}

.calendar-hover-tip {
  position: fixed;
  z-index: 1080;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.calendar-hover-tip__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.calendar-panel-pdf {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: var(--px-soft);
}

.calendar-panel-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--px-border);
  background: var(--px-surface);
}

.calendar-panel-pdf-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.calendar-panel-pdf-zoom-btn,
.calendar-panel-pdf-zoom-fit {
  border: 1px solid var(--px-border);
  background: var(--px-input-bg);
  color: var(--px-text);
  border-radius: 6px;
  line-height: 1;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.calendar-panel-pdf-zoom-btn {
  width: 28px;
  height: 28px;
}

.calendar-panel-pdf-zoom-fit {
  height: 28px;
}

.calendar-panel-pdf-zoom-btn:hover,
.calendar-panel-pdf-zoom-fit:hover {
  background: var(--px-row-hover);
}

.calendar-panel-pdf-zoom-value {
  min-width: 44px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--px-muted);
}

.calendar-panel-pdf-stage {
  flex: 1;
  min-height: 300px;
}

.calendar-panel-pdf-scroll {
  height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  padding: 10px;
  cursor: grab;
}

.calendar-panel-pdf-scroll.is-panning {
  cursor: grabbing;
}

.calendar-panel-pdf-paper {
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border-radius: 2px;
}

.calendar-panel-pdf-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
}

/* Package list in dashboard */
.package-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--px-border);
}

.package-rank-item:last-child {
  border-bottom: none;
}

.package-rank-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--px-border);
  overflow: hidden;
  margin-top: 6px;
}

.package-rank-bar span {
  display: block;
  height: 100%;
  background: var(--px-primary);
  border-radius: 999px;
}

/* Operations page */
.ops-metric-link {
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.ops-metric-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
  color: inherit;
}

.ops-section {
  scroll-margin-top: 88px;
}

.ops-template-card {
  background: var(--px-soft);
  border: 1px solid var(--px-border);
  border-radius: 10px;
  padding: 14px;
  height: 100%;
}

.ops-template-preview {
  font-size: 0.82rem;
  color: var(--px-muted);
  max-height: 72px;
  overflow: hidden;
}

.px-card-header .form-control-sm {
  max-width: 200px;
}

@media (max-width: 575.98px) {
  .px-card-header .form-control-sm {
    max-width: 100%;
    margin-top: 8px;
  }
}

.login-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(46, 230, 200, 0.18), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(0, 180, 240, 0.2), transparent 40%),
    linear-gradient(145deg, #eef8ff 0%, var(--brand-background, #f7fafd) 48%, #ffffff 100%);
}

body.auth-page .login-shell {
  background: transparent;
}

.login-panel {
  width: min(420px, 100%);
  margin: 0 auto;
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: calc(var(--px-radius) + 4px);
  padding: 32px;
  box-shadow: var(--px-shadow);
}

.login-form .form-control {
  max-width: 100%;
}

.login-form .btn {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-brand-centered {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand-logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
  max-height: 72px;
  object-fit: contain;
  filter: none;
}

.login-brand-logo--dark {
  display: none;
}

html[data-theme="dark"] .login-brand-logo--light {
  display: none;
}

html[data-theme="dark"] .login-brand-logo--dark {
  display: block;
}

.login-tagline {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-navy, var(--px-text));
}

.login-footer-note {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--px-muted);
}

.login-brand-centered .sidebar-brand-text {
  font-size: 1.5rem;
}

.forgot-password-link {
  font-size: 0.875rem;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.password-field {
  position: relative;
}

.password-field .password-input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--px-muted);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.search-hit:hover {
  background: #f8fafc;
}

/* Responsive */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
  }

  .topbar-toggle {
    display: inline-flex;
  }

  .topbar-search-wrap {
    display: block;
    max-width: none;
    flex: 1;
    min-width: 0;
    margin: 0 10px 0 0;
  }

  .topbar-title {
    display: none;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1035;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .page-content {
    padding: 16px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
  }
}

/* ── PDF Visual Builder (3-column: components | canvas | properties) ── */
/* Also loaded via static/css/pdf_builder.css on the editor page */
.pdf-builder-page .app-main {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-builder-page .topbar {
  display: none;
}

.pdf-builder-page .page-content {
  padding: 0;
  max-width: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-builder-page .alert {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2000;
  max-width: 360px;
  margin: 0;
}

.pdf-visual-builder {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #f4f5f7;
}

.pdf-builder-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.pdf-builder-topbar-left,
.pdf-builder-topbar-center,
.pdf-builder-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-builder-topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.pdf-builder-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #64748b;
  text-decoration: none;
}

.pdf-builder-back:hover {
  background: #f1f5f9;
  color: #334155;
}

.pdf-builder-doc-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
}

.pdf-builder-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.pdf-builder-icon-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.pdf-builder-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  margin: 0 4px;
}

.pdf-builder-zoom-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  min-width: 38px;
  text-align: center;
}

.pdf-builder-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.pdf-builder-btn.ghost {
  background: transparent;
  color: #475569;
  border-color: #e2e8f0;
}

.pdf-builder-btn.ghost:hover {
  background: #f8fafc;
}

.pdf-builder-btn.outline {
  background: #fff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.pdf-builder-btn.outline:hover {
  background: #eff6ff;
}

.pdf-builder-btn.primary {
  background: #2563eb;
  color: #fff;
}

.pdf-builder-btn.primary:hover {
  background: #1d4ed8;
}

.pdf-builder-layout {
  display: grid;
  grid-template-columns: 248px 1fr 336px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left — Components */
.pdf-builder-sidebar {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-builder-sidebar-head {
  padding: 16px 16px 12px;
  flex-shrink: 0;
}

.pdf-builder-sidebar-head h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
  color: #1e293b;
}

.pdf-block-palette {
  flex: 1;
  overflow: auto;
  padding: 0 12px 16px;
}

.pdf-palette-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.pdf-palette-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: grab;
  text-align: center;
  min-height: 68px;
  transition: background 0.12s;
}

.pdf-palette-tile:hover {
  background: #f1f5f9;
}

.pdf-palette-tile-icon {
  font-size: 1.25rem;
  color: #3b82f6;
  line-height: 1;
}

.pdf-palette-tile-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.15;
}

.pdf-palette-block-ghost,
.pdf-canvas-block-ghost {
  opacity: 0.5;
}

/* Center — Canvas */
.pdf-builder-canvas-area {
  min-width: 0;
  background: #dcdfe4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-visual-canvas-stage {
  flex: 1;
  overflow: auto;
  padding: 32px 24px 48px;
}

.pdf-visual-canvas-paper {
  width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
  transform-origin: top center;
  padding: 0 48px 48px;
  position: relative;
}

.pdf-canvas-accent-bar {
  height: 4px;
  margin: 0 -48px 28px;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 25%, #22c55e 50%, #3b82f6 75%, #8b5cf6 100%);
}

.pdf-canvas-blocks {
  min-height: 400px;
}

.pdf-canvas-empty {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 100px 24px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.88rem;
}

.pdf-canvas-block {
  position: relative;
  border: 2px solid transparent;
  border-radius: 4px;
  margin-bottom: 4px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.pdf-canvas-block:hover {
  border-color: #dbeafe;
}

.pdf-canvas-block.is-selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.pdf-canvas-block-toolbar {
  position: absolute;
  top: -28px;
  right: 0;
  display: flex;
  gap: 2px;
  padding: 2px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 5;
}

.pdf-canvas-block:hover .pdf-canvas-block-toolbar,
.pdf-canvas-block.is-selected .pdf-canvas-block-toolbar {
  opacity: 1;
  pointer-events: auto;
}

.pdf-canvas-block-toolbar .btn {
  padding: 2px 6px;
  font-size: 0.72rem;
  line-height: 1;
  border: none;
}

.pdf-canvas-block-type {
  display: none;
}

.pdf-canvas-block-preview {
  padding: 2px 0;
  font-size: 0.82rem;
  color: #1f2937;
  line-height: 1.5;
}

/* Right — Properties */
.pdf-builder-props-panel {
  background: #fff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-props-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.pdf-props-breadcrumb {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
}

.pdf-props-breadcrumb span {
  color: #94a3b8;
  font-weight: 400;
  margin: 0 4px;
}

.pdf-props-scroll {
  flex: 1;
  overflow: auto;
}

.pdf-block-inspector {
  padding: 0 16px 16px;
}

.pdf-props-empty {
  text-align: center;
  padding: 32px 12px;
  color: #94a3b8;
}

.pdf-props-empty i {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
}

.pdf-props-empty p {
  font-size: 0.8rem;
  margin: 0;
}

.pdf-prop-section {
  margin-bottom: 20px;
}

.pdf-prop-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 10px;
}

.pdf-prop-row {
  margin-bottom: 12px;
}

.pdf-prop-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.pdf-prop-row .form-control,
.pdf-prop-row .form-select {
  font-size: 0.82rem;
  border-radius: 6px;
  border-color: #e2e8f0;
}

.pdf-prop-row .form-control:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.pdf-prop-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pdf-prop-toggle-row .pdf-prop-label {
  margin-bottom: 0;
}

.pdf-inspector-subcard {
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fafbfc;
}

.pdf-props-variables {
  border-top: 1px solid #f1f5f9;
  padding: 12px 16px 16px;
}

.pdf-props-variables summary {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  margin-bottom: 8px;
}

.pdf-props-variables .pdf-template-variable-list {
  max-height: 200px;
  overflow: auto;
  margin-top: 8px;
}

.pdf-visual-preview-stage {
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-preview-modal-body {
  background: #dcdfe4;
  padding: 16px;
  min-height: 520px;
}

/* Canvas block previews */
.pv-merge-tag {
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78em;
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
}

.pv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.pv-header-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
}

.pv-header-meta {
  text-align: right;
  font-size: 0.78rem;
  color: #4b5563;
  line-height: 1.6;
}

.pv-header-logo {
  width: 80px;
  height: 40px;
  border: 1px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #9ca3af;
  border-radius: 4px;
}

.pv-section {
  margin: 12px 0;
}

.pv-section-h {
  background: #fecaca;
  padding: 5px 8px;
  font-weight: 700;
  font-size: 0.72rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.pv-section-b {
  padding: 8px;
  font-size: 0.78rem;
  border: 1px solid #e5e7eb;
  border-top: none;
  white-space: pre-wrap;
}

.pv-cols {
  display: flex;
  gap: 16px;
  margin: 8px 0;
}

.pv-col {
  flex: 1;
  font-size: 0.78rem;
}

.pv-col-title {
  font-weight: 700;
  font-size: 0.72rem;
  margin-bottom: 4px;
  color: #374151;
}

.pv-col-body {
  white-space: pre-wrap;
  color: #4b5563;
  line-height: 1.5;
}

.pv-text {
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.pv-kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 8px 0;
}

.pv-kv-table td {
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
}

.pv-kv-table td:first-child {
  font-weight: 600;
  background: #f9fafb;
  width: 35%;
}

.pv-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  margin: 8px 0;
}

.pv-data-table th,
.pv-data-table td {
  border: 1px solid #e5e7eb;
  padding: 5px 8px;
  text-align: left;
}

.pv-data-table th {
  background: #fecaca;
  font-weight: 700;
  font-size: 0.7rem;
}

.pv-table-title {
  font-weight: 700;
  text-align: center;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.pv-summary {
  margin-left: auto;
  width: 220px;
  font-size: 0.78rem;
}

.pv-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.pv-summary-row.is-bold {
  font-weight: 700;
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
  padding-top: 6px;
}

.pv-image-box {
  width: 100px;
  height: 48px;
  border: 1px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #9ca3af;
  border-radius: 4px;
}

.pv-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 12px 0;
}

.pv-spacer {
  background: repeating-linear-gradient(45deg, transparent, transparent 4px, #f3f4f6 4px, #f3f4f6 8px);
  border-radius: 2px;
}

.pv-signatures {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  font-size: 0.78rem;
}

.pv-sig-col {
  flex: 1;
}

.pv-sig-line {
  border-bottom: 1px solid #9ca3af;
  margin: 28px 0 4px;
}

.pv-sig-caption {
  font-size: 0.68rem;
  color: #9ca3af;
}

.pv-html {
  font-size: 0.78rem;
  padding: 8px;
  border: 1px dashed #e5e7eb;
  border-radius: 4px;
}

@media (max-width: 1200px) {
  .pdf-builder-layout {
    grid-template-columns: 220px 1fr 300px;
  }
}

@media (max-width: 992px) {
  .pdf-builder-layout {
    grid-template-columns: 200px 1fr;
  }

  .pdf-builder-props-panel {
    display: none;
  }

  .pdf-palette-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pdf-builder-topbar-center {
    display: none;
  }

  .pdf-builder-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .pdf-builder-sidebar {
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .pdf-visual-canvas-paper {
    width: 100%;
    padding: 0 20px 32px;
  }

  .pdf-canvas-accent-bar {
    margin: 0 -20px 20px;
  }
}

/* Legacy pdf builder classes */
.pdf-builder-toolbar {
  margin-bottom: 0;
}

.pdf-visual-grid {
  display: grid;
  grid-template-columns: 260px minmax(420px, 1fr) 320px;
  gap: 12px;
}

.pdf-visual-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.pdf-visual-panel-header {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
}

.pdf-visual-panel-header h3 {
  font-size: 0.92rem;
  margin: 0;
}

.pdf-palette-group-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 8px 4px 4px;
}

.pdf-palette-block {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: grab;
  background: #f8fafc;
}

.pdf-palette-block strong {
  display: block;
  font-size: 0.82rem;
}

.pdf-palette-block span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
}

.pdf-visual-canvas-wrap {
  min-width: 0;
}

.pdf-visual-canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

@media (max-width: 1400px) {
  .pdf-visual-grid {
    grid-template-columns: 1fr;
  }
}

.pdf-template-editor-grid {
  display: grid;
  grid-template-columns: 280px minmax(360px, 1fr) minmax(320px, 0.9fr);
  gap: 14px;
  min-height: calc(100vh - 180px);
}

.pdf-template-panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.pdf-template-panel-header h3 {
  font-size: 0.95rem;
  margin: 0;
}

.pdf-template-variables,
.pdf-template-code,
.pdf-template-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pdf-template-variable-search {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
}

.pdf-template-variable-list {
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 260px);
}

.pdf-variable-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdf-variable-item code {
  font-size: 0.72rem;
  color: #0f766e;
  word-break: break-all;
}

.pdf-variable-item strong {
  font-size: 0.82rem;
}

.pdf-variable-item span,
.pdf-variable-item em {
  font-size: 0.74rem;
  color: #64748b;
  font-style: normal;
}

.pdf-template-tab-panels {
  padding: 12px 14px 14px;
  flex: 1;
  overflow: auto;
}

.pdf-template-tab-panels textarea {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  min-height: 420px;
}

.pdf-template-preview-stage {
  flex: 1;
  overflow: auto;
  padding: 12px;
  background: #eef2f7;
  border-radius: 0 0 12px 12px;
  min-height: 520px;
}

@media (max-width: 1199.98px) {
  .pdf-template-editor-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .pdf-template-variable-list {
    max-height: 280px;
  }

  .pdf-template-preview-stage {
    min-height: 420px;
  }
}

/* Appearance settings */
.appearance-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.appearance-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid var(--px-border);
  border-radius: 12px;
  background: var(--px-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.appearance-mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.appearance-mode-card.is-selected {
  border-color: var(--px-primary);
  box-shadow: 0 0 0 3px var(--px-primary-soft);
}

.appearance-mode-preview {
  width: 100%;
  height: 72px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  border: 1px solid var(--px-border);
}

.appearance-mode-preview.is-light {
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  color: #0f172a;
}

.appearance-mode-preview.is-dark {
  background: linear-gradient(180deg, #0f172a, #020617);
  color: #e2e8f0;
}

.appearance-mode-preview.is-system {
  background: linear-gradient(90deg, #f8fafc 50%, #0f172a 50%);
  color: #64748b;
}

.appearance-mode-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.appearance-accent-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.appearance-accent-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--px-border);
  cursor: pointer;
  position: relative;
}

.appearance-accent-swatch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.appearance-accent-swatch.is-selected {
  box-shadow: 0 0 0 2px var(--px-surface), 0 0 0 4px var(--px-primary);
}

.appearance-accent-swatch.is-blue { background: #3b82f6; }
.appearance-accent-swatch.is-teal { background: #14b8a6; }
.appearance-accent-swatch.is-emerald { background: #10b981; }
.appearance-accent-swatch.is-amber { background: #f59e0b; }
.appearance-accent-swatch.is-rose { background: #f43f5e; }

/* Dark theme polish */
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .page-content {
  background: var(--px-bg);
  color: var(--px-text);
}

html[data-theme="dark"] .sidebar {
  background: var(--px-sidebar-bg);
  border-color: var(--px-border);
}

html[data-theme="dark"] .px-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .calendar-cell,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .user-menu .dropdown-toggle,
html[data-theme="dark"] .form-section-card,
html[data-theme="dark"] .appearance-mode-card,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .card,
html[data-theme="dark"] .ops-template-card {
  background: var(--px-surface) !important;
  color: var(--px-text);
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  background: var(--px-soft) !important;
}

html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .calendar-event-panel,
html[data-theme="dark"] .calendar-event-panel h3,
html[data-theme="dark"] .calendar-event-panel .h5,
html[data-theme="dark"] .calendar-event-panel dd {
  color: var(--px-text);
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-control-sm,
html[data-theme="dark"] .form-select-sm,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: var(--px-input-bg) !important;
  color: var(--px-text) !important;
  border-color: var(--px-border) !important;
  color-scheme: dark;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  background-color: var(--px-input-bg) !important;
  color: var(--px-text) !important;
  border-color: var(--px-primary) !important;
}

html[data-theme="dark"] .form-select option,
html[data-theme="dark"] select option {
  background-color: #1e293b;
  color: #e2e8f0;
}

html[data-theme="dark"] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%94a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-image: var(--bs-form-select-bg-img);
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--px-muted) !important;
  opacity: 1;
}

html[data-theme="dark"] .form-section-header:not(.is-ops) {
  background: var(--px-soft) !important;
  border-color: var(--px-border);
}

html[data-theme="dark"] .form-section-header.is-ops {
  background: var(--px-ops-header-bg) !important;
}

html[data-theme="dark"] .form-section-header.is-ops h3 {
  color: var(--px-ops-header-text) !important;
}

html[data-theme="dark"] .form-actions-bar {
  background: color-mix(in srgb, var(--px-surface) 94%, transparent);
  border-color: var(--px-border);
}

html[data-theme="dark"] .table-card,
html[data-theme="dark"] .table-card .table {
  background: var(--px-surface) !important;
  color: var(--px-text);
  --bs-table-bg: transparent;
  --bs-table-color: var(--px-text);
  --bs-table-hover-bg: var(--px-row-hover);
  --bs-table-hover-color: var(--px-text);
  --bs-table-border-color: var(--px-border);
}

html[data-theme="dark"] .table-card thead th {
  background: var(--px-soft) !important;
  color: var(--px-muted) !important;
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .table-card tbody td,
html[data-theme="dark"] .table-card tbody th,
html[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--px-text) !important;
  border-color: var(--px-border) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .table-card tbody tr:hover,
html[data-theme="dark"] .table-card tbody tr:hover > * {
  background-color: var(--px-row-hover) !important;
  color: var(--px-text) !important;
  --bs-table-bg-state: var(--px-row-hover);
  --bs-table-color-state: var(--px-text);
}

html[data-theme="dark"] .table-card tbody tr:hover a {
  color: var(--px-primary) !important;
}

html[data-theme="dark"] .sidebar-link {
  color: var(--px-link-idle);
}

html[data-theme="dark"] .sidebar-link:hover {
  background: var(--px-primary-soft);
  color: var(--px-primary);
}

html[data-theme="dark"] .sidebar-link.active {
  background: var(--px-primary);
  color: #fff;
}

html[data-theme="dark"] .sidebar-promo {
  background: var(--px-promo-bg) !important;
  color: var(--px-promo-text) !important;
}

html[data-theme="dark"] .topbar-search input,
html[data-theme="dark"] .calendar-cell.is-blank,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-light-subtle,
html[data-theme="dark"] .bg-body-tertiary,
html[data-theme="dark"] .bg-body-secondary,
html[data-theme="dark"] .global-search-empty,
html[data-theme="dark"] .global-search-suggestion-footer,
html[data-theme="dark"] .tour-customization-panel {
  background: var(--px-soft) !important;
  color: var(--px-text) !important;
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .ops-kpi-label,
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .metric-trend,
html[data-theme="dark"] .user-menu small,
html[data-theme="dark"] .quotation-preview-label {
  color: var(--px-muted) !important;
}

html[data-theme="dark"] .ops-kpi-value,
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .topbar-title,
html[data-theme="dark"] .px-card-header h2,
html[data-theme="dark"] .fw-semibold,
html[data-theme="dark"] .fw-bold,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: var(--px-text) !important;
}

html[data-theme="dark"] .dropdown-item {
  color: var(--px-text);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .dropdown-item.active {
  background: var(--px-row-hover);
  color: var(--px-text);
}

html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-danger {
  color: var(--px-text);
  border-color: var(--px-border);
  background: transparent;
}

html[data-theme="dark"] .btn-outline-primary {
  color: var(--px-primary);
  border-color: var(--px-primary);
}

html[data-theme="dark"] .btn-outline-danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.55);
}

html[data-theme="dark"] .btn-outline-secondary:hover {
  background: var(--px-row-hover);
  color: var(--px-text);
  border-color: var(--px-border);
}

html[data-theme="dark"] .btn-outline-primary:hover {
  background: var(--px-primary-soft);
  color: var(--px-primary);
}

html[data-theme="dark"] .btn-primary {
  background: var(--px-primary);
  border-color: var(--px-primary);
  color: #fff;
}

html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .text-bg-light {
  background: var(--px-soft) !important;
  color: var(--px-text) !important;
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .ops-chart-wrap,
html[data-theme="dark"] .calendar-panel-pdf,
html[data-theme="dark"] .calendar-panel-pdf-toolbar,
html[data-theme="dark"] .calendar-panel-pdf-scroll,
html[data-theme="dark"] .quotation-editor-preview,
html[data-theme="dark"] .quotation-preview-stage {
  background: var(--px-soft) !important;
}

html[data-theme="dark"] .package-rank-bar {
  background: #1e293b;
}

html[data-theme="dark"] .calendar-panel-pdf-zoom-btn,
html[data-theme="dark"] .calendar-panel-pdf-zoom-fit,
html[data-theme="dark"] .quotation-preview-zoom {
  background: var(--px-input-bg) !important;
  color: var(--px-text) !important;
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .calendar-panel-pdf-zoom-btn:hover,
html[data-theme="dark"] .calendar-panel-pdf-zoom-fit:hover,
html[data-theme="dark"] .quotation-preview-zoom-btn:hover,
html[data-theme="dark"] .quotation-preview-zoom-fit:hover {
  background: var(--px-row-hover) !important;
  color: var(--px-text) !important;
}

html[data-theme="dark"] .calendar-panel-pdf-paper {
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .calendar-cell.is-today {
  border-color: var(--px-primary);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.45);
}

html[data-theme="dark"] .tour-section-card {
  background: var(--px-surface) !important;
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .status-badge.deposit_paid,
html[data-theme="dark"] .status-badge.fully_paid,
html[data-theme="dark"] .status-badge.confirmed,
html[data-theme="dark"] .status-badge.accepted {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

html[data-theme="dark"] .status-badge.sent,
html[data-theme="dark"] .status-badge.completed,
html[data-theme="dark"] .status-badge.active {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

html[data-theme="dark"] .status-badge.draft,
html[data-theme="dark"] .status-badge.pending,
html[data-theme="dark"] .status-badge.unpaid {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

html[data-theme="dark"] .status-badge.cancelled,
html[data-theme="dark"] .status-badge.expired,
html[data-theme="dark"] .status-badge.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end,
html[data-theme="dark"] hr {
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .alert {
  border-color: var(--px-border);
}

html[data-theme="dark"] .alert-success {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

html[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

html[data-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

html[data-theme="dark"] .alert-info {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

html[data-theme="dark"] body.auth-page {
  background:
    radial-gradient(circle at 12% 18%, rgba(46, 230, 200, 0.1), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(0, 180, 240, 0.12), transparent 40%),
    linear-gradient(145deg, #020617 0%, #0f172a 50%, #111827 100%);
}

html[data-theme="dark"] .pdf-visual-builder,
html[data-theme="dark"] .pdf-builder-topbar,
html[data-theme="dark"] .pdf-builder-palette,
html[data-theme="dark"] .pdf-builder-props,
html[data-theme="dark"] .pdf-builder-canvas-wrap {
  background: var(--px-bg) !important;
  color: var(--px-text);
  border-color: var(--px-border) !important;
}

html[data-theme="dark"] .pdf-builder-topbar,
html[data-theme="dark"] .pdf-builder-palette,
html[data-theme="dark"] .pdf-builder-props {
  background: var(--px-surface) !important;
}

@media (max-width: 767.98px) {
  .appearance-mode-grid {
    grid-template-columns: 1fr;
  }
}
