/**
 * 3D Security — Premium Light Mode SaaS Theme
 * Stripe / modern task-management aesthetic
 */

@import url("./theme.css");

:root {
  --app-bg: #faf8ff;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-ring: rgba(79, 70, 229, 0.18);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 8px 30px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 16rem;
}

/* ── Base ─────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  background: var(--app-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar (frosted glass · indigo brand) ───────── */
.app-sidebar {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 4px 0 24px rgba(79, 70, 229, 0.06);
  color: #1e293b;
}

.app-sidebar .border-gray-100,
.app-sidebar .border-gray-200,
.app-sidebar .border-slate-100 {
  border-color: rgba(255, 255, 255, 0.45) !important;
}

.app-sidebar #sidebar-company-name {
  color: #1e293b;
}

.app-sidebar .sidebar-tagline,
.app-sidebar .sidebar-footer-brand {
  color: #64748b !important;
}

.app-sidebar #current-user-phone {
  color: #334155 !important;
}

.app-sidebar #active-user-role,
.app-sidebar #sidebar-session .text-slate-400 {
  color: #64748b !important;
}

.app-sidebar .nav-item {
  color: #475569;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  box-shadow: none !important;
}

.app-sidebar .nav-item svg {
  color: #64748b;
  transition: color 0.15s ease;
}

.app-sidebar .nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.45);
  color: #4338ca;
}

.app-sidebar .nav-item:hover:not(.active) svg {
  color: #6366f1;
}

.app-sidebar .nav-item.active {
  background: rgba(238, 242, 255, 0.75);
  color: #4338ca;
  font-weight: 600;
}

.app-sidebar .nav-item.active svg {
  color: #4f46e5;
}

.app-sidebar .nav-group-toggle {
  color: #475569;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar .nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.45);
  color: #4338ca;
}

.app-sidebar .nav-sub-item {
  color: #64748b;
}

.app-sidebar .nav-sub-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.35);
  color: #4338ca;
}

.app-sidebar .nav-sub-item.active {
  background: rgba(238, 242, 255, 0.65);
  color: #4338ca;
  font-weight: 600;
}

.app-sidebar #company-switcher-btn {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #1e293b;
}

.app-sidebar #company-switcher-btn:hover {
  border-color: rgba(199, 210, 254, 0.8);
  background: rgba(255, 255, 255, 0.55);
}

.app-sidebar #company-switcher-label {
  color: #1e293b !important;
}

.app-sidebar #logout-btn {
  color: #dc2626;
}

.app-sidebar #logout-btn:hover {
  background: rgba(254, 226, 226, 0.45);
  color: #b91c1c;
}

.app-sidebar #btn-back-control-room {
  color: #4338ca !important;
}

.app-sidebar #btn-back-control-room:hover {
  background: rgba(238, 242, 255, 0.65) !important;
}

/* Subscription plan locks (sidebar + action buttons) */
.nav-item.subscription-locked,
.nav-group-toggle.subscription-locked,
[data-subscription-feature].subscription-locked {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.nav-item.subscription-locked {
  color: rgb(156 163 175) !important;
}

[data-subscription-feature].subscription-locked:not(:disabled) {
  pointer-events: auto;
}

#sidebar-logo-wrap #sidebar-logo:not(.hidden) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  border: none;
  background: transparent;
}

/* ── Cards / panels ───────────────────────────────── */
.shadow-panel,
.saas-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* ── Inputs & buttons ─────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  border-color: var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px var(--accent-ring) !important;
}

button,
.btn {
  border-radius: var(--radius-sm);
}

/* Primary brand buttons keep Tailwind; soften hover globally */
.bg-brand-600 {
  background-color: var(--accent) !important;
}

.bg-brand-600:hover,
.hover\:bg-brand-700:hover {
  background-color: var(--accent-hover) !important;
}

.text-brand-600,
.text-brand-700 {
  color: var(--accent) !important;
}

.bg-brand-50 {
  background-color: var(--accent-soft) !important;
}

.border-brand-500,
.border-brand-600,
.focus\:border-brand-500:focus {
  border-color: var(--accent) !important;
}

.ring-brand-100 {
  --tw-ring-color: var(--accent-ring) !important;
}

/* ── AI Command Bar (view header integration) ───── */
#ai-command-center .ai-composer {
  min-height: 2.75rem;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.spa-view > header > .view-ai-slot {
  flex: 1 1 0%;
  max-width: 42rem;
  min-width: 0;
}

.spa-view > header > *:not(.view-ai-slot) {
  flex-shrink: 0;
}

#ai-command-center #ai-chat-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

#ai-command-center #ai-chat-input:focus {
  box-shadow: none !important;
  border: none !important;
}

#ai-command-center #ai-chat-input:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

#ai-command-center .ai-composer.ai-composer-busy {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

#ai-command-center .ai-composer.ai-composer-busy::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #6366f1;
  animation: ai-composer-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ai-composer-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Tables ───────────────────────────────────────── */
table.min-w-full {
  border-collapse: separate;
  border-spacing: 0;
}

table.min-w-full thead {
  background: #fafafa;
}

table.min-w-full thead th {
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

table.min-w-full tbody {
  background: var(--surface);
}

table.min-w-full tbody tr {
  transition: background 0.12s ease;
}

table.min-w-full tbody td {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

table.min-w-full tbody tr:last-child td {
  border-bottom: none;
}

table.min-w-full tbody tr:hover {
  background: #f9fafb !important;
}

/* Soften harsh divide-y utility borders */
.divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border-subtle);
}

/* ── Status pills ─────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill--paid,
.status-pill--active,
.status-pill--on {
  background: #ecfdf5;
  color: #047857;
}

.status-pill--pending {
  background: #fffbeb;
  color: #b45309;
}

.status-pill--cancelled,
.status-pill--expired {
  background: #fef2f2;
  color: #b91c1c;
}

.status-pill--draft,
.status-pill--off {
  background: #f3f4f6;
  color: #4b5563;
}

.status-pill--expiring {
  background: #fff7ed;
  color: #c2410c;
}

/* ── View headers (frosted glass) ─────────────────── */
.spa-view > header.view-header,
.spa-view > header.sticky,
.spa-view > header {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.view-header #btn-alerts-bell {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.view-header #btn-alerts-bell:hover {
  background: rgba(238, 242, 255, 0.65);
  border-color: rgba(199, 210, 254, 0.75);
}

.spa-view > header h2 {
  color: var(--text-primary);
}

.spa-view > header p {
  color: var(--text-secondary);
}

/* ── Tabs / filters ───────────────────────────────── */
.sales-doc-tab.active,
.sales-status-filter.active,
.sales-invoice-type-btn.active,
.doc-settings-tab.active {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-color: #c7d2fe !important;
  box-shadow: none;
}

.template-card.selected {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

.template-card.selected .template-radio {
  background: var(--accent) !important;
}

.template-card.selected span.flex {
  border-color: var(--accent) !important;
}

/* ── Drawers / modals ─────────────────────────────── */
#customer-drawer,
#vendor-drawer {
  transform: translateX(100%);
  transition: transform 0.28s ease;
  box-shadow: var(--shadow-float);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

#customer-drawer.open,
#vendor-drawer.open {
  transform: translateX(0);
}

#drawer-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

#drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.action-menu {
  display: none;
  position: fixed;
  z-index: 9999;
  min-width: 14rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: 0.35rem;
}

.action-menu.open {
  display: block;
}

.coa-ledger-action-menu {
  min-width: 11rem;
}

.action-menu button {
  border-radius: 6px;
}

.coa-detail-row .coa-detail-panel {
  animation: coaDetailIn 0.22s ease-out;
}

@keyframes coaDetailIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#company-switcher-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  max-height: 16rem;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  padding: 0.35rem;
}

#company-switcher-root.open #company-switcher-menu {
  display: block;
}

#company-switcher-root.open #company-switcher-chevron {
  transform: rotate(180deg);
}

.company-switcher-item:hover,
.company-switcher-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

#custom-field-modal-overlay,
#business-modal-overlay,
#product-modal-overlay,
#product-ledger-modal-overlay,
#purchase-modal-overlay,
#payment-modal-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#custom-field-modal-overlay.open,
#product-modal-overlay.open,
#product-ledger-modal-overlay.open,
#purchase-modal-overlay.open,
#payment-modal-overlay.open,
#business-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#product-modal,
#product-ledger-modal,
#purchase-modal,
#payment-modal,
#modal-record-payment,
#business-modal,
#contract-modal > div,
#edit-customer-modal > div {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}

#product-modal,
#product-ledger-modal,
#purchase-modal,
#payment-modal,
#modal-record-payment,
#business-modal {
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#product-modal-overlay.open #product-modal,
#product-ledger-modal-overlay.open #product-ledger-modal,
#purchase-modal-overlay.open #purchase-modal,
#payment-modal-overlay.open #payment-modal,
#payment-modal-overlay.open #modal-record-payment,
#business-modal-overlay.open #business-modal {
  transform: scale(1);
  opacity: 1;
}

/* ── KPI cards ────────────────────────────────────── */
.spa-view .grid > div.rounded-xl,
.spa-view .kpi-card {
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}

.spa-view .kpi-card:hover {
  box-shadow: var(--shadow-float);
  transform: translateY(-1px);
}

.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-float);
  transform: translateY(-1px);
  border-color: rgba(199, 210, 254, 0.55);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.5), rgba(147, 51, 234, 0.35));
  opacity: 0.85;
}

.kpi-card__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.kpi-card__icon {
  display: inline-flex;
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.kpi-card__icon svg {
  height: 1.125rem;
  width: 1.125rem;
}

.kpi-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.kpi-card__value {
  margin-top: 0.75rem;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}

.kpi-card__meta {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.kpi-card--neutral::before {
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

.kpi-card--neutral .kpi-card__icon {
  background: rgba(238, 242, 255, 0.95);
  color: #4f46e5;
}

.kpi-card--brand::before {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.kpi-card--brand .kpi-card__icon {
  background: rgba(238, 242, 255, 0.95);
  color: #4f46e5;
}

.kpi-card--emerald::before {
  background: linear-gradient(90deg, #059669, #34d399);
}

.kpi-card--emerald {
  border-color: rgba(167, 243, 208, 0.65);
  background: linear-gradient(145deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.88));
}

.kpi-card--emerald .kpi-card__icon {
  background: rgba(209, 250, 229, 0.95);
  color: #059669;
}

.kpi-card--emerald .kpi-card__label {
  color: rgba(4, 120, 87, 0.85);
}

.kpi-card--emerald .kpi-card__value {
  color: #047857;
}

.kpi-card--amber::before {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.kpi-card--amber {
  border-color: rgba(253, 230, 138, 0.7);
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.92), rgba(255, 255, 255, 0.88));
}

.kpi-card--amber .kpi-card__icon {
  background: rgba(254, 243, 199, 0.95);
  color: #d97706;
}

.kpi-card--amber .kpi-card__label {
  color: rgba(180, 83, 9, 0.85);
}

.kpi-card--amber .kpi-card__value {
  color: #b45309;
}

.kpi-card--rose::before {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

.kpi-card--rose {
  border-color: rgba(254, 205, 211, 0.7);
  background: linear-gradient(145deg, rgba(255, 241, 242, 0.92), rgba(255, 255, 255, 0.88));
}

.kpi-card--rose .kpi-card__icon {
  background: rgba(255, 228, 230, 0.95);
  color: #e11d48;
}

.kpi-card--rose .kpi-card__label {
  color: rgba(190, 18, 60, 0.85);
}

.kpi-card--rose .kpi-card__value {
  color: #be123c;
}

.kpi-card--indigo::before {
  background: linear-gradient(90deg, #4338ca, #818cf8);
}

.kpi-card--indigo {
  border-color: rgba(199, 210, 254, 0.75);
  background: linear-gradient(145deg, rgba(238, 242, 255, 0.92), rgba(255, 255, 255, 0.88));
}

.kpi-card--indigo .kpi-card__icon {
  background: rgba(224, 231, 255, 0.95);
  color: #4338ca;
}

.kpi-card--indigo .kpi-card__label {
  color: rgba(67, 56, 202, 0.85);
}

.kpi-card--indigo .kpi-card__value {
  color: #4338ca;
}

.kpi-card--alert::before {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.kpi-card--alert {
  border-color: rgba(254, 202, 202, 0.75);
  background: linear-gradient(145deg, rgba(254, 242, 242, 0.92), rgba(255, 255, 255, 0.88));
}

.kpi-card--alert .kpi-card__icon {
  background: rgba(254, 226, 226, 0.95);
  color: #dc2626;
}

.kpi-card--alert .kpi-card__label {
  color: rgba(185, 28, 28, 0.85);
}

/* ── Invoice / data list panel ────────────────────── */
.invoice-list-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.06);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.invoice-list-panel__tabs,
.invoice-list-panel__toolbar,
.invoice-list-panel__table-head {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
}

.invoice-list-panel__tabs {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.invoice-list-panel__toolbar {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.invoice-list-panel__table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.75rem 1.25rem;
}

.invoice-list-panel table.min-w-full thead {
  background: transparent !important;
  backdrop-filter: none;
}

.invoice-list-panel table.min-w-full thead th {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
}

.invoice-list-panel table.min-w-full tbody {
  background: transparent !important;
}

.invoice-list-panel .sales-doc-tab,
.invoice-list-panel .sales-status-filter {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.invoice-list-panel .sales-doc-tab.active,
.invoice-list-panel .sales-status-filter.active {
  background: rgba(238, 242, 255, 0.85) !important;
  border-color: rgba(129, 140, 248, 0.55) !important;
  color: #4338ca !important;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.1);
}

.invoice-list-panel table.min-w-full tbody tr:hover {
  background: rgba(238, 242, 255, 0.35) !important;
}

.invoice-list-panel .panel-field {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Dashboard canvas & view chrome ───────────────── */
.dashboard-canvas {
  position: relative;
}

.spa-view .overflow-hidden.rounded-xl.border.bg-white,
.spa-view .overflow-hidden.rounded-xl.shadow-panel,
.spa-view .rounded-xl.border.border-slate-200.bg-white.shadow-panel {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(226, 232, 240, 0.85) !important;
}

.spa-view table.min-w-full thead {
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(8px);
}

.spa-view table.min-w-full tbody {
  background: rgba(255, 255, 255, 0.75);
}

#stats-date-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

/* ── Alerts bell dropdown ─────────────────────────── */
#alerts-bell-dropdown {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-float);
}

#btn-alerts-bell {
  border-radius: var(--radius-sm);
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-soft);
}

/* ── Secondary text helpers ───────────────────────── */
.text-slate-500,
.text-slate-400 {
  color: var(--text-secondary);
}

.text-slate-900,
.text-slate-800 {
  color: var(--text-primary);
}

/* ── Settings: PDF template live preview (A4 document viewer) ── */
.template-preview-viewport {
  --preview-doc-width: 420px;
  --preview-scale: 0.72;
  overflow: hidden;
  position: relative;
  width: 100%;
  min-height: 580px;
  height: 580px;
  padding: 18px 22px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #f1f5f9 0%, #e8edf4 100%);
}

.template-preview-scaler-host {
  flex-shrink: 0;
  overflow: visible;
  max-width: 100%;
}

.template-preview-scaler {
  transform: scale(var(--preview-scale));
  transform-origin: top center;
  will-change: transform;
}

.template-preview-pane {
  width: var(--preview-doc-width);
  max-width: 100%;
  box-sizing: border-box;
}

.template-preview-document {
  width: 100%;
  min-height: calc(var(--preview-doc-width) * 297 / 210);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.12), 0 1px 4px rgba(15, 23, 42, 0.06);
}

@media (min-width: 1024px) {
  .template-preview-viewport {
    min-height: 600px;
    height: 600px;
  }
}
