/* Tabler 1.7.0 application tokens and legacy component adapters. */
:root {
  --tblr-font-sans-serif: "Inter Variable", Inter, "Segoe UI", sans-serif;
  --tblr-body-font-family: var(--tblr-font-sans-serif);
  --tblr-body-bg: #f8fafc;
  --tblr-body-color: #0f172a;
  --tblr-primary: #28745c;
  --tblr-primary-rgb: 40, 116, 92;
  --tblr-border-color: #e2e8f0;
  --tblr-border-radius: 6px;
  --tblr-card-border-radius: 8px;
  --heading-font: var(--tblr-font-sans-serif);
  --body-font: var(--tblr-font-sans-serif);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-control: 6px; --radius-panel: 8px;
  --motion-fast: 140ms; --motion-hover: 160ms; --motion-layout: 220ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus-ring: #28745c66;
  --background: var(--tblr-body-bg); --background-soft: #f1f5f9;
  --surface: #fff; --surface-soft: #f1f5f9; --surface-hover: #f0f7f3;
  --primary: var(--tblr-primary); --primary-dark: #205c49; --primary-light: #eaf4ee;
  --secondary: #326f9e; --border: var(--tblr-border-color); --border-soft: #e8edf1;
  --text-primary: var(--tblr-body-color); --text-secondary: #64748b; --text-muted: #64748b; --text-on-secondary: #536277;
  --success: #247348; --success-strong: #1f5d3c; --success-soft: #edf8f1;
  --warning: #98620d; --warning-strong: #7a4f09; --warning-soft: #fff8e9;
  --danger: #bf3545; --danger-strong: #a12332; --danger-soft: #fff0f1;
  --review: #9d6327; --review-soft: #fff6e9;
  --info: #276eaa; --info-strong: #215884; --info-soft: #eef6ff;
  --event: #6b5a94; --event-soft: #f4f1fa; --money: var(--success); --money-soft: var(--success-soft);
  --bg: var(--background); --panel: var(--surface); --panel-soft: var(--surface-soft);
  --text: var(--text-primary); --muted: var(--text-secondary); --line: var(--border);
  --accent: var(--primary); --accent-strong: var(--primary-dark); --rose: var(--danger);
  --amber: var(--warning); --green: var(--success); --ink: var(--text-primary);
  --warm-shadow: #0f172a08; --shadow: 0 4px 16px #0f172a08; --shadow-soft: 0 1px 3px #0f172a08;
  --shadow-hover: 0 4px 12px #0f172a0f; --shadow-drag: 0 12px 28px #0f172a26;
}
html { scroll-padding-top: 24px; }
body.crm-app { background: var(--background); color: var(--text); font: 14px/1.5 var(--body-font); letter-spacing: 0; }
.crm-app :is(h1,h2,h3,h4,button,th,label) { letter-spacing: 0; }
.crm-app h1 { font-size: 24px; line-height: 1.3; }
.crm-app :is(h3,h4) { font-size: 15px; line-height: 1.4; font-weight: 650; }
.crm-app :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 2000; padding: 12px 20px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.skip-link:focus { top: 8px; }
.crm-app button { box-shadow: none; transform: none; font-weight: 550; border-radius: 6px; }
.crm-app button:hover { transform: none; box-shadow: none; }
.crm-app .btn { min-height: 38px; padding: 8px 12px; gap: 7px; font: 550 13px/1.35 var(--body-font); border: 1px solid transparent; border-radius: 6px; box-shadow: none; }
.crm-app .btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.crm-app .btn-primary:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.crm-app .btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.crm-app :is(.small-button,.btn-outline-secondary) { color: var(--text); border: 1px solid var(--border); background: #fff; }
.crm-app :is(.small-button,.btn-outline-secondary):hover { background: var(--surface-soft); border-color: #b8c5d0; color: var(--text); }
.crm-app .btn-ghost-secondary { color: var(--muted); background: transparent; }
.crm-app .btn-ghost-secondary:hover { color: var(--text); background: #eaf0f5; }
.crm-app .btn-icon { padding: 8px; width: 38px; height: 38px; flex-shrink: 0; }
.crm-app :is(button,summary,a.small-button) svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.8; }
.crm-app :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { min-height: 38px; border: 1px solid var(--border); background-color: #fff; color: var(--text); border-radius: 6px; padding: 8px 11px; font-size: 13px; box-shadow: none; }
.crm-app select { padding-right: 30px; }
.crm-app :is(input,textarea)::placeholder { color: #7e8a96; }
.crm-app label { font-size: 12px; font-weight: 550; color: var(--text-secondary); gap: 6px; }
.crm-app input[type=checkbox] { appearance: none; width: 18px; height: 18px; min-width: 18px; min-height: 18px; padding: 0; margin: 0; border: 1.5px solid #98a7b6; border-radius: 4px; background: #fff; vertical-align: middle; flex: 0 0 18px; }
.crm-app input[type=checkbox]:checked { border-color: var(--primary); background-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2' d='m3 8 3 3 7-7'/%3E%3C/svg%3E"); }
.crm-app input[type=checkbox]:indeterminate { background: var(--primary); }
.crm-app .form-error { color: var(--danger); font-size: 13px; }
.crm-app .form-error:empty { min-height: 0; }
.crm-app .login-screen { background: var(--background); }
.crm-app .login-box { padding: 32px; gap: 22px; border-radius: 8px; border-color: var(--border); box-shadow: var(--shadow); }
.crm-app .login-box h1 { font-size: 25px; color: var(--text); }
.crm-app .app-shell { grid-template-columns: 236px minmax(0,1fr); }
.crm-app .sidebar { padding: 20px 12px 12px; background: #fff; border-right: 1px solid var(--border); gap: 16px; }
.crm-app .brand { gap: 10px; }
.crm-app .brand-row { padding: 0 8px 18px; }
.crm-app .brand strong { font-size: 12px; font-weight: 700; line-height: 1.5; }
.crm-app .brand small { font-size: 10px; color: var(--text-muted); }
.crm-app .brand-mark { background: var(--primary); width: 34px; height: 34px; border-radius: 6px; }
.crm-app .nav-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; scrollbar-width: thin; }
.crm-app .nav-item { min-height: 40px; padding: 9px 12px; gap: 10px; border: 0; border-radius: 6px; color: var(--text-secondary); background: transparent; font-size: 13px; font-weight: 500; line-height: 1.45; text-align: left; }
.crm-app .nav-item svg { color: #778796; width: 18px; height: 18px; }
.crm-app .nav-item.active { color: var(--primary-dark); background: var(--primary-light); box-shadow: none; font-weight: 650; }
.crm-app .nav-item.active svg { color: var(--primary); }
.crm-app .nav-item:hover { color: var(--text); background: #f1f5f8; }
.nav-group { border: 0; margin: 8px 0 0; min-width: 0; }
.nav-group > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; min-height: 32px; margin: 0 4px 4px; padding: 6px 8px; color: var(--text-muted); font-size: 11px; font-weight: 650; cursor: pointer; border-radius: 4px; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary svg { width: 13px; height: 13px; transform: rotate(-90deg); }
.nav-group[open] > summary svg { transform: none; }
.nav-group-items { display: grid; gap: 2px; }
.crm-app .sidebar-footer { padding: 10px 8px 0; gap: 4px; border: 0; border-top: 1px solid var(--border); background: transparent; }
.crm-app .sidebar-footer .ghost-button { min-height: 32px; padding: 5px 8px; border: 0; justify-content: flex-start; font-size: 11px; }
.crm-app #currentUser { font-size: 12px; padding: 8px; color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.crm-app .topbar { display: flex; position: relative; min-height: 76px; padding: 18px 28px; border-bottom: 1px solid var(--border); background: #fff; z-index: 30; backdrop-filter: none; }
.crm-app .topbar h2 { font-size: 20px; font-weight: 650; white-space: normal; }
.crm-app #viewKicker { display: block; font-size: 10px; color: var(--text-muted); margin: 0 0 3px; }
.crm-app .topbar-actions { display: flex; align-items: center; width: auto; max-width: none; flex: 0 1 650px; min-width: 0; gap: 12px; }
.crm-app .contract-finder { flex: 1; min-width: 200px; }
.crm-app .contract-search { padding-left: 36px !important; background-color: var(--surface-soft) !important; text-overflow: ellipsis; }
.crm-app #newContractBtn { width: auto; min-width: auto; white-space: nowrap; }
.crm-app .view-root { padding: 24px 28px 36px; }
.crm-app .section { gap: 24px; min-width: 0; max-width: 100%; }
.crm-app .pipeline-board { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: 12px; }
.crm-app .pipeline-column { min-width: 0; }
.crm-app :is(.panel,.filter-card,.table-panel,.report-config-panel) { border-color: var(--border); border-radius: 8px; box-shadow: none; background: #fff; }
.crm-app :is(.panel,.filter-card) .panel { border: 0; border-radius: 0; box-shadow: none; }
.crm-app .section-header { gap: 14px; padding-bottom: 12px; }
.crm-app .section-header h3 { font-size: 15px; font-weight: 650; color: var(--text); }
.crm-app .grid.two { gap: 20px; }
.crm-app .metrics-grid { gap: 16px; }
.dashboard-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
.dashboard-section-heading h3 { margin: 0; }
.dashboard-section-heading>span { font-size: 12px; color: var(--muted); }
.dashboard-periods { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.crm-app .dashboard-period-button { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; min-height: 108px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); text-align: left; transition: border-color var(--motion-fast) var(--motion-ease),background-color var(--motion-fast) var(--motion-ease); }
.crm-app .dashboard-period-button:hover { background: var(--primary-light); border-color: var(--primary); }
.dashboard-period-heading { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dashboard-period-heading svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--primary); }
.dashboard-period-heading svg:last-child { margin-left: auto; color: var(--muted); }
.dashboard-period-button strong { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; font-size: 28px; line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; }
.dashboard-period-button strong>span { font-size: 12px; font-weight: 500; color: var(--muted); }
.dashboard-period-button small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.crm-app .dashboard-home #dashboardFiltersForm { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto auto; align-items: end; gap: 12px; padding: 0 0 18px; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.crm-app .dashboard-home #dashboardFiltersForm :is(label,input,select) { min-width: 0; width: 100%; }
.crm-app .dashboard-home #dashboardFiltersForm button { min-width: 0; }
@media (max-width: 1100px) {
  .crm-app .dashboard-home #dashboardFiltersForm { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-periods { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 480px) {
  .dashboard-periods { gap: 10px; }
  .crm-app .dashboard-period-button { padding: 12px; gap: 8px; min-height: 100px; }
  .dashboard-period-heading { align-items: start; font-size: 12px; }
  .dashboard-period-heading svg:last-child { display: none; }
  .dashboard-period-button small { line-height: 1.5; }
}
.crm-app .metric-card { position: relative; border: 1px solid var(--border); border-left-width: 1px; border-top: 3px solid var(--metric-tone,var(--info)); border-radius: 8px; padding: 18px; min-height: 108px; box-shadow: none; background: #fff; }
.crm-app .metric-link { position: absolute; top: 10px; right: 8px; min-height: 24px; width: 24px; padding: 4px; background: transparent; color: var(--text-muted); border: 0; }
.crm-app .metric-link:hover { background: var(--background-soft); color: var(--text); }
.crm-app .metric-card::before,.crm-app .metric-card::after { display: none; }
.crm-app .metric-card strong { font-size: 23px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.crm-app .metric-card span { color: var(--text-secondary); font-size: 12px; font-weight: 500; line-height: 1.5; }
.crm-app .metric-card:has(.metric-link) > span { padding-right: 20px; }
.crm-app .metric-card--success { --metric-tone: var(--success); }
.crm-app .metric-card--money { --metric-tone: var(--success); }
.crm-app .metric-card--warning { --metric-tone: var(--warning); }
.crm-app .metric-card--review { --metric-tone: var(--review); }
.crm-app .metric-card--danger { --metric-tone: var(--danger); }
.crm-app :is(.action-card,.action-card.has-items) { border-radius: 8px; border-color: var(--border); background: #fff; box-shadow: none; padding: 16px; }
.crm-app .action-card:hover { border-color: var(--action-tone); background: #fafcfd; }
.crm-app .quick-panel,.crm-app .agenda-panel { border-top: 1px solid var(--border); }
.crm-app :is(.quick-list-link,.agenda-item) { min-height: 68px; border-radius: 6px; padding: 12px; }
.crm-app .quick-list-link { text-align: left; }
.crm-app :is(.quick-list,.agenda-list) { gap: 8px; padding: 10px 0; }
.crm-app :is(.quick-list-link,.agenda-item) strong { font-size: 13px; font-weight: 600; line-height: 1.4; }
.crm-app :is(.quick-list-link,.agenda-item) small { line-height: 1.4; }
.crm-app .contract-tone { --contract-tone-border: var(--border); --contract-tone-background: var(--surface); --contract-tone-background-hover: var(--surface-hover); }
.crm-app table { margin: 0; font-size: 13px; }
.crm-app table th { color: var(--text-on-secondary); background: #f7f9fb; padding: 12px 14px; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; text-align: left; }
.crm-app table td { padding: 12px 14px; vertical-align: middle; line-height: 1.4; font-variant-numeric: tabular-nums; }
.crm-app table td small { color: var(--text-secondary); font-size: 12px; display: block; margin-top: 4px; line-height: 1.4; }
.crm-app table .numeric-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crm-app .table-scroll { scrollbar-width: thin; }
.crm-app .table-scroll thead { position: sticky; top: 0; z-index: 3; }
.crm-app .status-pill { display: inline-flex; align-items: center; white-space: nowrap; overflow-wrap: normal; word-break: normal; line-height: 1.4; font-size: 12px; padding: 4px 8px; min-height: 26px; border-radius: 4px; letter-spacing: 0; font-weight: 600; }
.crm-app .record-link { color: var(--text); font-weight: 600; text-decoration: none; padding: 0; }
.crm-app .record-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.crm-app .workspace-toolbar { margin: 0; gap: 12px; }
.crm-app .workspace-toolbar h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.crm-app .workspace-toolbar .badge { color: var(--text-secondary); }
.crm-app .wedding-filter-bar { display: grid; gap: 12px; margin: 0; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
.secondary-filter-fields { display: contents; }
.primary-filters { display: grid; grid-template-columns: minmax(230px,2fr) repeat(5,minmax(120px,1fr)) auto; gap: 12px; align-items: end; }
.order-billing-date { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.more-filters > summary { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; min-height: 28px; width: fit-content; }
.more-filters .workspace-filters { padding-top: 14px; grid-template-columns: repeat(4,minmax(0,1fr)); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.active-filters:empty { display: none; }
.crm-app .filter-chip { background: #eaf1f6; color: #3f5a71; border: 1px solid #d3e0eb; border-radius: 4px; padding: 5px 8px; min-height: 28px; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; max-width: 100%; overflow-wrap: anywhere; }
.filter-chip svg { width: 13px; height: 13px; }
.column-picker,.action-menu { position: relative; }
.crm-app :is(.column-picker,.action-menu) > summary { display: inline-flex; cursor: pointer; list-style: none; }
.crm-app :is(.column-picker,.action-menu) > summary::-webkit-details-marker { display: none; }
.column-picker > fieldset,.action-menu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 240px; max-width: calc(100vw - 32px); border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: #fff; box-shadow: 0 8px 24px #25313c1a; }
.column-picker legend { font-size: 12px; font-weight: 650; padding: 0; float: none; margin-bottom: 10px; }
.column-picker label { display: flex; align-items: center; gap: 10px; padding: 7px 4px; cursor: pointer; }
.action-menu > div { display: grid; gap: 4px; }
.action-menu > div .btn { justify-content: flex-start; width: 100%; border: 0; }
.crm-app .wedding-list-panel { padding: 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; }
.crm-app .wedding-desktop-table { max-height: 65vh; }
.crm-app .wedding-data-table { min-width: 900px; table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); }
.crm-app .wedding-data-table :is(th,td) { position: static; min-width: 0; border-right: 0; }
.crm-app .wedding-data-table th { height: 44px; padding: 8px 12px; background: #f7f9fb; white-space: nowrap; }
.crm-app .wedding-data-table td { height: 78px; padding: 10px 12px; border-top: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.crm-app .wedding-data-table td:first-child { border-left: 0; border-radius: 0; }
.crm-app .wedding-data-table td:last-child { border-right: 0; border-radius: 0; }
.crm-app .wedding-data-table [data-column=action] { padding: 6px; }
.crm-app .wedding-data-table :is([data-column=financial],[data-column=guests]) { text-align: right; }
.crm-app .wedding-data-table [data-column=financial] .wedding-cell { align-items: flex-end; }
.crm-app .wedding-data-table [data-column=financial] small { white-space: nowrap; }
.crm-app .table-sort { display: inline-flex; gap: 5px; min-height: 28px; padding: 0; border: 0; color: inherit; background: transparent; font-size: inherit; }
.crm-app .table-sort svg { width: 12px; height: 12px; color: #8393a1; }
.crm-app .table-sort::after { display: none; }
.record-clamp,.record-name,.record-name .record-link { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.record-name { max-height: 37px; line-height: 18px; }
.wedding-cell { max-height: 54px; overflow: hidden; overflow-wrap: anywhere; }
.crm-app .pagination-bar { border-top: 1px solid var(--border); padding: 12px 16px; }
.page-size { display: flex !important; align-items: center; gap: 8px !important; white-space: nowrap; }
.page-size select { width: 72px; }
.wedding-mobile-list { display: none; }
.empty-list { display: grid; justify-items: center; padding: 40px 20px; gap: 12px; color: var(--muted); text-align: center; }
.empty-list svg { width: 28px; height: 28px; }
.crm-app .dossier-open .view-root { padding-top: 0; }
.crm-app .dossier-hero { background: var(--background); position: relative; padding: 18px 0 0; border-bottom: 1px solid var(--border); }
.crm-app .dossier-breadcrumb { margin-bottom: 12px; }
.crm-app .dossier-title-row h1 { font-size: 23px; letter-spacing: 0; margin: 0 0 8px; }
.crm-app .dossier-title-row p { font-size: 13px; line-height: 1.7; }
.crm-app .dossier-status-strip { gap: 8px 18px; padding: 14px 0 18px; }
.crm-app .dossier-jumps { gap: 0; margin: 0; }
.crm-app .dossier-jumps button { position: relative; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--text-secondary); background: transparent; min-height: 44px; padding: 10px 12px; font-size: 13px; }
.crm-app .dossier-jumps button.is-active { color: var(--primary); background: transparent; }
.crm-app .dossier-jumps button.is-active::after { content: ''; position: absolute; inset: auto 0 -2px; height: 2px; background: var(--primary); transform-origin: left center; pointer-events: none; }
.crm-app .dossier-jumps button:hover { background: var(--primary-light); }
.crm-app .dossier-quick-actions { padding: 14px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crm-app .dossier-layout { padding-top: 6px; gap: 24px; grid-template-columns: minmax(0,1fr) 260px; }
.crm-app .dossier-section { border: 0; border-radius: 0; background: transparent; overflow: visible; scroll-margin-top: 20px; }
.crm-app .dossier-section > header { padding: 16px 0; border-bottom: 1px solid var(--border); }
.crm-app .dossier-section-body { padding: 24px 0; }
.crm-app .dossier-fields { gap: 22px 28px; }
.crm-app .dossier-fields dt { font-size: 12px; }
.crm-app .dossier-fields dd { font-size: 13px; font-weight: 550; }
.crm-app .dossier-aside { border-left: 1px solid var(--border); padding-left: 24px; }
.crm-app .dossier-aside-sticky { position: sticky; top: 20px; max-height: none; overflow: visible; }
.crm-app .dossier-summary { background: transparent; padding: 0; border: 0; border-radius: 0; }
.crm-app .dossier-countdown { font-size: 19px; }
.crm-app .dossier-summary .dossier-fields { gap: 14px; }
.crm-app .dossier-alerts { padding: 20px 0 0; margin-top: 20px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.crm-app .dossier-alerts h3 { color: var(--warning); font-size: 13px; }
.crm-app .dossier-alerts summary { display: flex; gap: 8px; align-items: center; color: var(--warning); font-size: 12px; font-weight: 600; min-height: 36px; cursor: pointer; }
.dossier-alerts summary svg { width: 16px; height: 16px; }
.dossier-alerts summary > span { margin-left: auto; }
.crm-app .dossier-alerts a { padding: 12px 0; font-size: 12px; line-height: 1.5; }
.crm-app .dossier-money { gap: 16px; }
.crm-app .dossier-money > div { border-radius: 6px; background: #fff; border: 1px solid var(--border); padding: 16px; }
.crm-app .dossier-money strong { font-size: 20px; }
.crm-app .workspace-editor { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(760px,100vw); height: 100dvh; max-height: none; max-width: none; padding: 0; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: #fff; color: var(--text); overflow: hidden; box-shadow: -12px 0 40px #172b3a20; }
.workspace-editor::backdrop { background: #172b3a55; }
.workspace-editor > form { display: flex; flex-direction: column; height: 100%; }
.editor-header { display: flex; gap: 20px; justify-content: space-between; align-items: center; padding: 22px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.editor-header h2 { font-size: 19px; margin: 4px 0 0; }
.editor-body { flex: 1; overflow: auto; padding: 28px; display: grid; gap: 18px; align-content: start; }
.editor-footer { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); padding: 16px 28px; background: #fff; flex-shrink: 0; }
.crm-app .workspace-editor .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.crm-app .form-grid { gap: 18px; }
.crm-app .import-start-grid { gap: 24px; grid-template-columns: minmax(0,1fr); }
.import-review-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start; }
.import-review-fields { display: grid; gap: 16px; min-width: 0; }
.import-review-documents { position: sticky; top: 20px; min-width: 0; }
.crm-app .upload-slot { background: #f8fbfd; border: 1px dashed #9eb2c3; border-radius: 6px; padding: 20px; }
.crm-app .document-preview-grid { grid-template-columns: 1fr; }
.crm-app .flow-steps { background: transparent; border: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; gap: 8px 24px; }
.crm-app .flow-steps span { border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.crm-app .flow-steps span:first-child { color: var(--primary); font-weight: 650; }
.crm-app .calendar-event { border-radius: 4px; background: var(--info-soft); border-left: 2px solid var(--info); color: var(--info-strong); }
.crm-app .wedding-calendar { border-color: var(--border); }
.crm-app .calendar-day { background: #fff; border-color: var(--border); }
.crm-app .calendar-day.today { background: #f0f7fc; }
.crm-app .calendar-weekday { background: #f7f9fb; color: var(--text-secondary); }
.crm-app .environment-banner { margin: 0; padding: 7px 28px; border: 0; border-bottom: 1px solid #c8dcf0; border-radius: 0; background: var(--info-soft); color: var(--info-strong); font-size: 11px; }
.crm-app .toast { z-index: 1100; }
.crm-app .change-reason-dialog { z-index: 1200; border-radius: 8px; padding: 28px; border: 1px solid var(--border); }
/* Layout refinements use the existing palette, including seller and route colors. */
.crm-app .metrics-grid--primary { grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); }
.crm-app .nav-item svg { flex-shrink: 0; }
.crm-app .nav-group > summary { margin-block: 6px; }
.crm-app .sidebar-footer .ghost-button { font-size: 12px; }
.crm-app .wedding-cell { max-height: 62px; }
.crm-app .wedding-data-table td { height: 84px; }
.crm-app .wedding-data-table [data-column=status] { min-width: 150px; }
.crm-app .record-name { max-height: 40px; line-height: 20px; }
.crm-app :is(.finance-overview-table,.review-table) td { height: 76px; }
.crm-app .finance-overview-table { min-width: 1100px; }
.crm-app .finance-overview-table th:first-child { width: auto; }
.crm-app .finance-overview-table th:nth-child(2) { width: 112px; }
.crm-app .finance-overview-table th:nth-child(n+3):nth-child(-n+5) { width: 160px; }
.crm-app .finance-overview-table th:nth-child(6) { width: 150px; }
.crm-app .finance-overview-table th:nth-child(7) { width: 56px; }
.crm-app :is(.review-filter-bar,.production-filter-bar,.driver-closing-filters) { gap: 12px; align-items: end; }
.crm-app :is(.review-table-heading,.workspace-toolbar) { gap: 16px; }
.crm-app :is(.review-areas,.active-filters) { gap: 8px; }
.crm-app :is(.review-progress-track,.production-progress) > span { transform-origin: left center; }
.crm-app :is(.review-progress,.production-overview,.driver-closing-totals) strong { font-variant-numeric: tabular-nums; }
.crm-app .production-center { gap: 24px; }
.crm-app .production-filter-bar { padding: 16px 0; border-width: 0 0 1px; border-radius: 0; background: transparent; }
.crm-app .production-reports { padding: 20px 0; border-width: 0 0 1px; border-radius: 0; background: transparent; }
.crm-app .production-reports-heading { gap: 20px; align-items: start; }
.crm-app .production-report-columns { gap: 16px; }
.crm-app .production-report-columns td[colspan] { text-align: center; white-space: normal; }
.crm-app :is(.production-report-caption,.production-report-note) { font-size: 13px; line-height: 1.6; margin-block: 16px; }
.crm-app .production-report-periods button small { font-size: 12px; line-height: 1.5; }
.crm-app :is(.production-periods,.production-print-source,.production-report-periods) button { position: relative; min-height: 40px; }
.crm-app :is(.production-periods,.production-print-source,.production-report-periods) button.active { font-weight: 700; box-shadow: inset 0 -3px 0 currentColor; }
.crm-app :is(.production-metric,.production-release) { padding: 18px; }
.crm-app :is(.production-metric,.production-release) small { font-size: 12px; line-height: 1.5; }
.crm-app .agenda-toolbar { align-items: start; flex-wrap: wrap; }
.crm-app .agenda-title { min-width: 210px; }
.crm-app .agenda-title h3 { margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.crm-app .agenda-toolbar .actions-row { flex-wrap: wrap; gap: 8px; }
.crm-app .agenda-modes { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; }
.crm-app .agenda-modes button { min-width: 64px; border-color: transparent; }
.crm-app .agenda-modes button[aria-pressed=true] { font-weight: 700; box-shadow: inset 0 -3px 0 currentColor; }
.crm-app .calendar-event { padding: 8px; }
.crm-app .calendar-event strong { font-size: 12px; line-height: 1.4; }
.crm-app .calendar-event small { font-size: 11px; line-height: 1.5; }
.crm-app .calendar-day.today > time { font-weight: 750; text-decoration: underline; text-underline-offset: 5px; }
.crm-app .dispatch-routes > header { align-items: start; padding: 20px; gap: 16px; }
.crm-app .dispatch-routes > header > div:first-child { flex: 1 1 240px; }
.crm-app .dispatch-routes > header .actions-row { gap: 8px; }
.crm-app #dispatchSaveStatus { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.crm-app #dispatchSaveStatus [data-save-state] { display: inline-flex; align-items: center; gap: 6px; min-width: 104px; min-height: 28px; font-weight: 600; }
.crm-app #dispatchSaveStatus [data-save-state] svg { width: 16px; height: 16px; }
.crm-app #dispatchSaveStatus small { font-size: 12px; line-height: 1.5; }
.crm-app .dispatch-route-ends { padding: 12px; font-size: 12px; gap: 8px; }
.crm-app .dispatch-execution-summary { gap: 12px 20px; padding-block: 16px; }
.crm-app .dispatch-execution-summary strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.crm-app .dispatch-route li { padding-block: 16px; }
.crm-app .dispatch-route li strong { font-size: 13px; }
.crm-app .dispatch-route :is(header small,li small) { font-size: 12px; line-height: 1.5; }
.crm-app .dispatch-api-hint { font-size: 12px; line-height: 1.6; max-width: 110ch; }
.crm-app .driver-closings { gap: 24px; }
.crm-app .driver-closings .panel { padding: 0; }
.crm-app .driver-closing-totals strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.crm-app :is(.editor-body,.operation-dialog) label { line-height: 1.5; }
.crm-app .operation-dialog { border-radius: 8px; padding: 24px; }
.crm-app .operation-dialog h2 { font-size: 20px; line-height: 1.4; margin-bottom: 20px; }
.crm-app .form-grid > label { min-width: 0; }
.crm-app #manualImportForm .form-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px 24px; }
.crm-app .dossier-order-summary { gap: 12px; padding-block: 16px; }
.crm-app :is(.empty,.empty-list) { line-height: 1.6; }
.crm-app .pipeline-column > h3 > span { display: inline-grid; place-items: center; min-width: 28px; min-height: 28px; font-size: 13px; }
.crm-app .pipeline-record { grid-template-rows: 60px 36px 22px 28px 36px; }
.crm-app .pipeline-record :is(p,select,.pipeline-delivery,.pipeline-seller) { font-size: 12px; }
.crm-app .pipeline-record p { line-height: 18px; }
.crm-app .pipeline-feedback { min-height: 24px; font-size: 13px; line-height: 1.5; }
/* Shared interaction layer: color feedback never changes control geometry. */
.crm-app :is(button,a,input,select,textarea,summary,.status-pill) { transition: background-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-hover) var(--motion-ease); }
.crm-app :is(input:not([type=checkbox]):not([type=radio]),select,textarea):focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.crm-app :is(button,select,input):disabled { cursor: not-allowed; }
.crm-app :is(.nav-group,.wedding-mobile-record) > summary svg:last-child { transition: transform var(--motion-hover) var(--motion-ease); }
.crm-app .wedding-mobile-record[open] > summary svg:last-child { transform: rotate(180deg); }
.crm-app :is(.column-picker[open]>fieldset,.action-menu[open]>div,.contract-search-results:not(.hidden)) { animation: eg-menu-in var(--motion-hover) var(--motion-ease); }
.crm-app dialog[open]:not(.workspace-editor) { animation: eg-menu-in var(--motion-layout) var(--motion-ease); }
.crm-app .workspace-editor[open] { animation: eg-panel-in var(--motion-layout) var(--motion-ease); }
.crm-app dialog[open]::backdrop { animation: eg-fade-in var(--motion-hover) var(--motion-ease); }
.crm-app .toast:not(.hidden) { animation: eg-menu-in var(--motion-hover) var(--motion-ease); background: var(--text-primary); color: white; border-radius: var(--radius-panel); box-shadow: var(--shadow-hover); }
.crm-app :is(table,.table-panel table) { border-spacing: 0; }
.crm-app :is(table,.table-panel table) tbody tr.contract-tone > td { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; background: var(--surface); }
.crm-app :is(table,.table-panel table) tbody tr.contract-tone > td:is(:first-child,:last-child) { border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
.crm-app :is(table,.table-panel table) tbody tr > td { transition: background-color var(--motion-fast) var(--motion-ease); }
.crm-app :is(table,.table-panel table) tbody tr:is(:hover,:focus-within) > td { background-color: var(--surface-hover); }
.crm-app :is(table,.table-panel table) tbody tr.contract-tone:is(:hover,:focus-within) > td { background-color: var(--surface-hover); }
.crm-app :is(.row-open-button,[data-column=action] button) svg { transition: transform var(--motion-fast) var(--motion-ease); }
.crm-app tr:is(:hover,:focus-within) :is(.row-open-button,[data-column=action] button) svg { transform: translateX(2px); }
.crm-app .table-seller { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; max-width: 100%; }
.table-seller::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--seller-color); flex: 0 0 7px; }
.crm-app .ui-loading { min-height: 340px; display: grid; gap: var(--space-4); align-content: start; padding-block: var(--space-4); }
.ui-loading-shapes { display: grid; gap: 12px; }
.ui-loading--metrics .ui-loading-shapes { grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); }
.ui-loading--calendar .ui-loading-shapes { grid-template-columns: repeat(7,minmax(0,1fr)); }
.ui-loading--metrics .ui-skeleton { height: 108px; }
.ui-loading--calendar .ui-skeleton { height: 110px; }
.ui-loading>span { color: var(--text-secondary); font-size: 13px; }
.ui-skeleton { height: 54px; border-radius: var(--radius-control); background: var(--surface-soft); animation: eg-skeleton 1.2s ease-in-out infinite alternate; }
.crm-app .btn { transition: transform 100ms var(--motion-ease),background-color var(--motion-fast) var(--motion-ease),color var(--motion-fast) var(--motion-ease),border-color var(--motion-fast) var(--motion-ease),box-shadow var(--motion-hover) var(--motion-ease); }
.crm-app .dashboard-period-button { transition: transform var(--motion-hover) var(--motion-ease),box-shadow var(--motion-hover) var(--motion-ease),border-color var(--motion-fast) var(--motion-ease),background-color var(--motion-fast) var(--motion-ease); }
.crm-app .btn:active:not(:disabled):not([aria-pressed]):not(.pipeline-grip) { transform: translateY(1px); }
.crm-app .dashboard-period-heading svg:last-child { transition: transform var(--motion-hover) var(--motion-ease); }
.crm-app .dashboard-period-button:focus-visible { box-shadow: var(--shadow-hover); }
.crm-app .filter-chip.is-new { animation: eg-menu-in var(--motion-hover) var(--motion-ease); }
.crm-app [data-save-state=saving] svg { animation: eg-saving 900ms linear infinite; }
.crm-app [data-save-state=saved] svg { animation: eg-menu-in var(--motion-hover) var(--motion-ease); }
@media (hover:hover) {
  .crm-app .dashboard-period-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
  .crm-app .dashboard-period-button:hover .dashboard-period-heading svg:last-child { transform: translate(2px,-2px); }
}
@supports (transition-behavior: allow-discrete) {
  .crm-app dialog:is(.workspace-editor,.operation-dialog) { opacity: 0; transform: translateY(4px); transition: opacity 160ms var(--motion-ease),transform 160ms var(--motion-ease),display 160ms allow-discrete,overlay 160ms allow-discrete; }
  .crm-app dialog.workspace-editor { transform: translateX(12px); }
  .crm-app dialog:is(.workspace-editor,.operation-dialog)[open] { opacity: 1; transform: none; animation: none; }
  .crm-app dialog:is(.workspace-editor,.operation-dialog)::backdrop { opacity: 0; transition: opacity 160ms var(--motion-ease),display 160ms allow-discrete,overlay 160ms allow-discrete; }
  .crm-app dialog:is(.workspace-editor,.operation-dialog)[open]::backdrop { opacity: 1; animation: none; }
  @starting-style {
    .crm-app dialog:is(.workspace-editor,.operation-dialog)[open] { opacity: 0; transform: translateY(4px); }
    .crm-app dialog.workspace-editor[open] { transform: translateX(12px); }
    .crm-app dialog:is(.workspace-editor,.operation-dialog)[open]::backdrop { opacity: 0; }
  }
}
@keyframes eg-saving { to { transform: rotate(360deg); } }
@keyframes eg-menu-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes eg-panel-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes eg-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes eg-skeleton { from { opacity: .5; } to { opacity: 1; } }
@media (min-width:861px) {
  .crm-app .app-shell.sidebar-collapsed { grid-template-columns: 72px minmax(0,1fr); }
  .sidebar-collapsed .nav-group > summary { font-size: 0; height: 8px; min-height: 8px; margin: 4px 0; border-top: 1px solid var(--border); padding: 0; }
  .sidebar-collapsed .nav-group > summary svg { display: none; }
  .sidebar-collapsed .nav-group > .nav-group-items { display: grid; }
  .sidebar-collapsed .nav-group:not([open]) > .nav-group-items { content-visibility: visible; }
}
@media (max-width:1200px) {
  .crm-app #manualImportForm .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .primary-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .primary-filters > .filter-wide { grid-column: span 2; }
  .primary-filters > button { grid-column: 3; }
  .crm-app .topbar { padding: 16px 20px; }
  .crm-app .view-root { padding: 20px; }
  .crm-app .dossier-layout { grid-template-columns: minmax(0,1fr) 220px; gap: 20px; }
  .crm-app .dossier-aside { padding-left: 20px; }
}
@media (max-width:860px) {
  .crm-app .app-shell,.crm-app .app-shell.sidebar-collapsed { grid-template-columns: minmax(0,1fr); }
  .crm-app .sidebar { height: auto; position: sticky; top: 0; z-index: 70; display: block; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--border); }
  .crm-app .brand-row { padding: 0; border: 0; display: flex; justify-content: space-between; align-items: center; }
  .crm-app .brand strong { font-size: 12px; }
  .crm-app .brand small { font-size: 10px; }
  .crm-app .mobile-menu-button { display: inline-flex; width: 44px; height: 44px; padding: 10px; background: transparent; color: var(--text); border: 1px solid var(--border); }
  .crm-app .sidebar .nav-list { display: none; }
  .crm-app .sidebar .sidebar-footer { display: none; }
  .crm-app .sidebar.menu-open .nav-list { display: flex; max-height: 60vh; padding: 12px 0; }
  .crm-app .sidebar.menu-open .sidebar-footer { display: grid; }
  .crm-app .nav-item { min-height: 44px; }
  .crm-app .nav-group { grid-column: 1/-1; }
  .crm-app .topbar { position: relative; min-height: 0; padding: 18px 16px; flex-wrap: wrap; gap: 14px; z-index: 40; }
  .crm-app .topbar-actions { flex: 1 0 100%; width: 100%; max-width: none; gap: 10px; }
  .crm-app .topbar h2 { font-size: 19px; }
  .crm-app .contract-finder { min-width: 0; }
  .crm-app #newContractBtn { width: 44px; min-width: 44px; flex: 0 0 44px; }
  .crm-app #newContractBtn span { display: none; }
  .crm-app .view-root { padding: 20px 16px; }
  .crm-app .btn { min-height: 44px; }
  .crm-app .btn-icon { width: 44px; height: 44px; }
  .crm-app :is(input:not([type=checkbox]):not([type=radio]),select) { min-height: 44px; }
  .primary-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .primary-filters > .filter-wide { grid-column: 1/-1; }
  .primary-filters > button { grid-column: 2; grid-row: auto; }
  .more-filters .workspace-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-app .metrics-grid,.crm-app .metrics-grid--primary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-app .metric-card { padding: 14px; min-height: 96px; }
  .crm-app .metric-card strong { font-size: 20px; }
  .crm-app .dossier-hero { position: relative; top: auto; }
  .crm-app .dossier-title-row h1 { font-size: 21px; }
  .crm-app .dossier-layout { grid-template-columns: minmax(0,1fr); }
  .crm-app .dossier-aside { grid-row: auto; border: 0; border-top: 1px solid var(--border); padding: 0; }
  .crm-app .dossier-alerts { margin: 0; padding-top: 18px; border: 0; }
  .crm-app .dossier-alerts ul { grid-template-columns: minmax(0,1fr); }
  .crm-app .dossier-summary { display: none; }
  .crm-app .dossier-jumps button { min-height: 44px; }
  .crm-app .dossier-fields { gap: 20px; }
  .crm-app .environment-banner { padding: 7px 16px; }
}
@media (max-width:700px) {
  .import-review-workspace { grid-template-columns: minmax(0,1fr); }
  .import-review-documents { position: static; }
  .wedding-desktop-table { display: none; }
  .wedding-mobile-list { display: grid; gap: 10px; padding: 10px; }
  .wedding-mobile-record { border: 1px solid var(--contract-tone-border,var(--border)); border-radius: 6px; background: var(--contract-tone-background,#fff); padding: 14px; }
  .wedding-mobile-record > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; list-style: none; }
  .wedding-mobile-record > summary strong { font-size: 13px; display: block; }
  .wedding-mobile-record > summary small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
  .wedding-mobile-record > summary svg { width: 16px; height: 16px; flex-shrink: 0; }
  .wedding-mobile-record dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding-top: 18px; margin: 0 0 16px; }
  .wedding-mobile-record :is(dt,dd) { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
  .wedding-mobile-record dt { color: var(--muted); margin-bottom: 4px; font-size: 10px; }
  .crm-app .workspace-toolbar > .actions-row { flex-wrap: wrap; }
  .crm-app .pagination-bar { align-items: flex-start; gap: 14px; }
  .crm-app .grid.two,.crm-app .workspace-editor .form-grid,.crm-app .dossier-fields,.crm-app .import-start-grid,.crm-app #manualImportForm .form-grid { grid-template-columns: minmax(0,1fr); }
  .crm-app .dossier-quick-actions { gap: 8px; }
  .crm-app .dossier-jumps { margin-right: -16px; }
  .editor-header,.editor-body { padding: 20px; }
  .editor-footer { padding: 14px 20px; }
  .crm-app .workspace-editor { width: 100%; }
}
@media (prefers-reduced-motion:reduce) { .crm-app *, .crm-app *::before, .crm-app *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } .crm-app :is(.pipeline-record:hover,.dashboard-period-button:hover,.btn:active,.dashboard-period-heading svg:last-child) { transform: none !important; } }
@media print {
  .crm-app { background: #fff; }
  .skip-link,.workspace-editor { display: none !important; }
}

@media (max-width: 860px) {
  .crm-app :is(.admin-page,.users-center,.couple-workspace,.catalog-section,.review-page) { grid-template-columns: minmax(0,1fr); }
  .crm-app :is(.admin-page,.couple-workspace,.catalog-section,.review-page,[data-couple-body]) > *, .crm-app .table-scroll { min-width: 0; max-width: 100%; }
  .crm-app .review-filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-app .review-filter-bar > :first-child { grid-column: 1/-1; }
  .crm-app .review-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-app .review-table-heading { flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 700px) {
  .wedding-index .column-picker { display: none; }
  .crm-app .primary-filters > button { grid-column: 1/-1; }
  .wedding-filter-bar .more-filters > summary { min-height: 44px; align-content: center; }
  .crm-app .catalog-toolbar, .crm-app .users-center .section-header { flex-wrap: wrap; }
}
.response-editor { width: min(720px,calc(100vw - 32px)); max-height: 90vh; }
.response-step { padding: 14px 0; border-bottom: 1px solid #dbe3e9; }
.response-step .actions-row strong { margin-right:auto; }
