/* Visual system: neutral work surfaces, Media Rent teal actions (logo) and meaningful state colors. */
:root {
  --nav-bg:#ffffff; --nav-line:#dce1ed; --nav-ink:#34405a; --nav-muted:#67738c; --nav-hover:#f1f3fa; --nav-active:#e3f3f4; --nav-active-ink:#00707a; --nav-active-line:#bfe2e5; --nav-inset:#f4f6fb;
  --paper:#f3f4f8; --ink:#202a43; --muted:#616d84; --line:#dce1ed;
  --ui-surface:#fff; --ui-soft:#eceff6; --ui-hover:#e9f5f6; --kanban-surface:#eceff6;
  --ui-accent:#00737e; --green:#00737e; --green-dark:#005a63; --mint:#e3f3f4; --accent-soft:#e3f3f4;
  --surface:var(--ui-surface); --surface-soft:var(--ui-soft);
  --section-accent:#00737e; --section-soft:#e3f3f4;
  --ui-shadow:0 2px 3px #17234503,0 6px 18px #17234505;
  --ui-raised:0 8px 24px #17234512;
  --positive:#15734f; --positive-soft:#e7f6ed; --warning:#88520e; --warning-soft:#fff2d9;
  --danger:#b53150; --danger-soft:#fcebf0; --info:#245fc2; --info-soft:#eaf1ff;
  --violet:#7545c1; --violet-soft:#f1eafb; --teal:#11776c; --teal-soft:#e5f6ef;
  --control-height:40px; --text-title:29px; --space-panel:22px;
  --chatter-surface:#f1f3fa; --chatter-border:#d7dfee; --chatter-head:#e8edf8;
}
:root[data-theme=dark] {
  --nav-bg:#17213b; --nav-line:#34425f; --nav-ink:#d1daed; --nav-muted:#a4b3cf; --nav-hover:#25314c; --nav-active:#1d4047; --nav-active-ink:#ffffff; --nav-active-line:#2f6a72; --nav-inset:#212e49;
  --paper:#111624; --ink:#eff2fb; --muted:#b2bfd7; --line:#35415a;
  --ui-surface:#1d2537; --ui-soft:#252f45; --ui-hover:#21404a; --kanban-surface:#171e2e;
  --surface:var(--ui-surface); --surface-soft:var(--ui-soft); --accent-soft:#1d4047;
  --ui-accent:#7fd3db; --green:#7fd3db; --green-dark:#a9e4e9; --mint:#1d4047;
  --section-accent:#7fd3db; --section-soft:#1d4047;
  --positive:#9ce3bc; --positive-soft:#203e35; --warning:#f5d18c; --warning-soft:#443522;
  --danger:#ffb2c4; --danger-soft:#462b3c; --info:#a8c9ff; --info-soft:#243958;
  --violet:#d2b4fa; --violet-soft:#382e4c; --teal:#96dfce; --teal-soft:#203f3a;
  --ui-shadow:0 3px 16px #00000016; --ui-raised:0 8px 28px #00000032;
  --chatter-surface:#192135; --chatter-border:#394563; --chatter-head:#263149;
}
:root[data-workspace=quotes] { --section-accent:var(--violet); --section-soft:var(--violet-soft); }
:root[data-workspace=clients] { --section-accent:var(--info); --section-soft:var(--info-soft); }
:root[data-workspace=day] { --section-accent:var(--warning); --section-soft:var(--warning-soft); }
:root[data-workspace=finance] { --section-accent:var(--positive); --section-soft:var(--positive-soft); }
:root:is([data-workspace=agenda],[data-workspace=products]) { --section-accent:var(--info); --section-soft:var(--info-soft); }
:root:is([data-workspace=audit],[data-workspace=settings],[data-workspace=roadmap]) { --section-accent:var(--ui-accent); --section-soft:var(--mint); }
:root[data-theme=dark][data-workspace=quotes] { --section-accent:var(--violet); --section-soft:var(--violet-soft); }
:root[data-theme=dark][data-workspace=clients] { --section-accent:var(--info); --section-soft:var(--info-soft); }
:root[data-theme=dark][data-workspace=day] { --section-accent:var(--warning); --section-soft:var(--warning-soft); }
:root[data-theme=dark]:is([data-workspace=agenda],[data-workspace=products],[data-workspace=audit],[data-workspace=settings]) { --section-accent:var(--info); --section-soft:var(--info-soft); }
html[data-theme] body { color:var(--ink); background:var(--paper); }
html[data-theme] h1 { letter-spacing:-1px; font-weight:730; }
html[data-theme] h2 { font-weight:680; }
html[data-theme] #content { padding:26px 28px; }

/* A steady navigation rail makes the workspace feel distinct from its contents. */
html[data-theme] .sidebar { background:var(--nav-bg); border-right:1px solid var(--nav-line); color:var(--nav-ink); padding-top:26px; scrollbar-color:var(--nav-line) var(--nav-bg); }
html[data-theme] .sidebar .brand { background:transparent; padding:0 12px; }
html[data-theme=light] .sidebar .logo-light,html[data-theme=dark] .sidebar .logo-dark { display:block; }
html[data-theme=light] .sidebar .logo-dark,html[data-theme=dark] .sidebar .logo-light { display:none; }
html[data-theme] .sidebar .brand-caption { color:var(--nav-muted); margin-top:14px; }
html[data-theme] .sidebar .nav-caption { color:var(--nav-muted); letter-spacing:1.5px; margin-top:30px; }
html[data-theme] .sidebar .nav-item { color:var(--nav-ink); min-height:43px; margin-bottom:5px; border-radius:9px; font-weight:500; font-size:13px; }
html[data-theme] .sidebar .nav-item>svg { color:var(--nav-muted); width:19px; height:19px; }
html[data-theme] .sidebar .nav-item:hover { background:var(--nav-hover); color:var(--nav-ink); }
html[data-theme] .sidebar .nav-item.active { background:var(--nav-active); color:var(--nav-active-ink); box-shadow:inset 0 0 0 1px var(--nav-active-line); font-weight:650; }
html[data-theme] .sidebar .nav-item.active svg { color:var(--nav-active-ink); }
html[data-theme] .sidebar .nav-item.active:before { background:var(--ui-accent); height:22px; top:11px; border-radius:4px; }
html[data-theme] .sidebar .nav-count { background:#f4cb8e; color:#50340e; font-size:11px; }
html[data-theme] .environment-card { background:var(--nav-inset); border:1px solid var(--nav-line); border-radius:10px; }
html[data-theme] .environment-card strong { color:var(--nav-ink); }
html[data-theme] .environment-card p { color:var(--nav-muted); font-size:11px; }
html[data-theme] .profile { border-color:var(--nav-line); }
html[data-theme] .profile strong { color:var(--nav-ink); }
html[data-theme] .profile small { color:var(--nav-muted); }
html[data-theme] .profile .avatar { color:var(--nav-active-ink); background:var(--nav-active); }
html[data-theme] .sidebar .profile .icon-button { color:var(--nav-muted); }
html[data-theme] .topbar { background:var(--ui-surface); height:62px; border-bottom:1px solid var(--line); }
html[data-theme] .quick-search-launcher { background:var(--paper); border-color:var(--line); min-height:36px; }
html[data-theme] .theme-toggle { border-color:var(--line); min-height:36px; }
html[data-theme] .test-chip { color:var(--muted); background:var(--ui-soft); }
html[data-theme] .breadcrumbs li { font-size:13px; }

/* Every screen has a recognizable title and a restrained module accent. */
html[data-theme] .page-heading { margin-bottom:24px; align-items:center; gap:18px; }
html[data-theme] .page-title-group { display:flex; gap:14px; align-items:center; min-width:0; }
.page-title-group>div { min-width:0; }
html[data-theme] .page-heading .eyebrow { display:block; color:var(--section-accent); font-size:10px; letter-spacing:1.4px; margin:0 0 5px; font-weight:750; }
html[data-theme] .page-heading p,html[data-theme] .page-heading[data-page=crm] p { color:var(--muted); font-size:14px; margin-top:7px; }
.page-symbol { display:grid; place-items:center; width:48px; height:48px; flex:0 0 48px; border:1px solid color-mix(in srgb,var(--section-accent) 16%,transparent); border-radius:14px; color:var(--section-accent); background:var(--section-soft); }
.page-symbol svg { width:24px; height:24px; }
html[data-theme] .btn { border-radius:9px; font-weight:600; }
html[data-theme] .btn.primary { background:var(--ui-accent); border-color:var(--ui-accent); color:#fff; box-shadow:0 3px 7px #00737e22; }
html[data-theme] .btn.primary:not(:disabled):hover { background:var(--green-dark); border-color:var(--green-dark); box-shadow:0 4px 12px #00737e33; }
html[data-theme=dark] .btn.primary { background:var(--ui-accent); border-color:var(--ui-accent); color:#0b2a2e; }
html[data-theme=dark] .btn.primary:not(:disabled):hover { background:var(--green-dark); border-color:var(--green-dark); }
html[data-theme=dark] :is(.cal-views button.active,.cal-cell.today .cal-daynum) { color:#0b2a2e; }
html[data-theme] .btn.secondary { background:var(--ui-surface); border-color:var(--line); color:var(--ink); }
html[data-theme] .btn.secondary:not(:disabled):hover { background:var(--ui-hover); color:var(--ui-accent); border-color:var(--ui-accent); }
html[data-theme] .text-button { color:var(--ui-accent); }
html[data-theme] :is(input,select,textarea,.search-box) { background:var(--ui-surface); color:var(--ink); border-color:var(--line); border-radius:8px; }
html[data-theme] :is(input,textarea)::placeholder { color:var(--muted); opacity:.85; }
html[data-theme] .search-box input { border:0; background:transparent; }
html[data-theme] :is(input,select,textarea):focus,html[data-theme] .search-box:focus-within { border-color:var(--ui-accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-accent) 12%,transparent); }
html[data-theme] .panel { background:var(--ui-surface); border-color:var(--line); box-shadow:var(--ui-shadow); border-radius:13px; }
html[data-theme] .panel-heading h2 { font-size:17px; color:var(--ink); }
html[data-theme] .panel-heading>svg,html[data-theme] .panel-heading h2>svg { color:var(--section-accent); }

/* Read the amounts first, then the operational counts. */
html[data-theme] .workspace-summary { display:grid; grid-template-columns:1.35fr 1fr 1fr 1fr; align-items:stretch; gap:14px; padding:0; margin:0 0 22px; }
.summary-card { position:relative; display:grid; grid-template-columns:1fr 34px; gap:6px; min-width:0; padding:15px 18px; background:var(--ui-surface); border:1px solid var(--line); border-radius:13px; box-shadow:var(--ui-shadow); color:var(--ink); }
.summary-label { grid-column:1; grid-row:1; align-self:center; font-size:13px; font-weight:600; color:var(--muted); }
.summary-icon { grid-column:2; grid-row:1/3; display:grid; place-items:center; width:34px; height:34px; border-radius:10px; color:var(--info); background:var(--info-soft); }
.summary-icon svg { width:18px; height:18px; }
html[data-theme] .workspace-summary .summary-card>strong { grid-column:1; font-size:29px; letter-spacing:-.8px; line-height:1.2; font-weight:730; font-variant-numeric:tabular-nums; color:var(--ink); }
.summary-card>small { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; color:var(--muted); margin-top:1px; }
.summary-card>small svg { width:15px; height:15px; }
.summary-card.summary-pipeline { background:#29345d; border-color:#364773; }
html[data-theme] .workspace-summary .summary-pipeline>strong { color:#fff; }
.summary-pipeline .summary-label,.summary-pipeline>small { color:#d5dff8; }
.summary-pipeline .summary-icon { background:#404b78; color:#ddd9ff; }
.summary-pending .summary-icon { background:var(--violet-soft); color:var(--violet); }
.summary-followup .summary-icon { background:var(--warning-soft); color:var(--warning); }
html[data-theme] .workspace-summary a:hover { border-color:var(--ui-accent); box-shadow:var(--ui-raised); }

/* Controls are one surface; each stage and card has its own visual boundary. */
html[data-theme] .pipeline-panel { display:block; background:transparent; border:0; padding:0; box-shadow:none; }
.pipeline-controls { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:12px; padding:13px; background:var(--ui-surface); border:1px solid var(--line); border-radius:12px; margin-bottom:22px; box-shadow:var(--ui-shadow); }
html[data-theme] .pipeline-controls>.filters { display:grid; grid-template-columns:minmax(180px,1.8fr) .85fr 1.1fr 1fr .95fr; gap:8px; margin:0; padding:0; border:0; background:transparent; min-width:0; grid-column:1; grid-row:1; }
html[data-theme] .pipeline-controls>.filters :is(select,.search-box) { width:100%; max-width:none; min-width:0; margin:0; min-height:38px; font-size:13px; background:var(--paper); }
html[data-theme] .pipeline-controls>.filters select { padding:8px; }
html[data-theme] .pipeline-controls .search-box input { width:100%; min-width:0; font-size:13px; }
html[data-theme] .pipeline-controls>.section-toolbar { grid-column:2; grid-row:1; margin:0; padding:0; background:transparent; border:0; }
.pipeline-controls .segmented { display:none; }
.pipeline-controls .toolbar-end { display:flex; gap:3px; margin:0; padding:2px; border:1px solid var(--line); border-radius:8px; background:var(--paper); }
.pipeline-controls .view-label { display:none; }
html[data-theme] .pipeline-controls .icon-button { width:32px; height:32px; min-height:32px; color:var(--muted); border-radius:6px; }
html[data-theme] .pipeline-controls .icon-button.selected { background:var(--ui-surface); color:var(--ui-accent); box-shadow:0 1px 4px #1625411a; }
.board-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; margin:0 0 14px; }
.board-heading h2 { font-size:16px; }
.board-heading>span { font-size:12px; color:var(--muted); }
html[data-theme] .kanban { gap:14px; align-items:start; }
html[data-theme] .kanban-column { --stage-color:var(--info); --stage-soft:var(--info-soft); padding:0 9px 10px; background:var(--kanban-surface); border:1px solid var(--line); border-radius:12px; min-height:260px; }
html[data-theme] :is(.kanban-column,.opportunity-card)[data-stage=conversation] { --stage-color:var(--teal); --stage-soft:var(--teal-soft); }
html[data-theme] :is(.kanban-column,.opportunity-card)[data-stage=quoted] { --stage-color:var(--violet); --stage-soft:var(--violet-soft); }
html[data-theme] :is(.kanban-column,.opportunity-card)[data-stage=pending] { --stage-color:var(--warning); --stage-soft:var(--warning-soft); }
html[data-theme] :is(.kanban-column,.opportunity-card)[data-stage=won] { --stage-color:var(--positive); --stage-soft:var(--positive-soft); }
html[data-theme] :is(.kanban-column,.opportunity-card)[data-stage=lost] { --stage-color:var(--danger); --stage-soft:var(--danger-soft); }
html[data-theme] .column-header { padding:16px 4px 0; gap:8px; }
html[data-theme] .column-header h2 { font-size:14px; font-weight:700; color:var(--ink); }
html[data-theme] .kanban-column .stage-dot { width:8px; height:8px; background:var(--stage-color); }
html[data-theme] .kanban-column[data-stage] .column-count { background:var(--stage-soft); color:var(--stage-color); border:1px solid color-mix(in srgb,var(--stage-color) 15%,transparent); min-width:23px; font-size:12px; }
html[data-theme] .column-total { padding:0 4px; margin:7px 0 16px; color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
html[data-theme] .cards { gap:12px; }
html[data-theme] .opportunity-card { background:var(--ui-surface); padding:14px 14px 0; border:1px solid var(--line); border-radius:10px; box-shadow:0 2px 6px #17234506; color:var(--ink); }
.opportunity-card:before { left:0; top:0; right:auto; width:3px; height:100%; opacity:1; background:var(--stage-color,var(--info)); }
html[data-theme] .opportunity-card:hover { border-color:var(--stage-color,var(--info)); box-shadow:var(--ui-raised); transform:translateY(-2px); }
html[data-theme] .opportunity-card .company { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; font-weight:600; margin:0 0 12px; }
.company-monogram { display:grid; place-items:center; flex:0 0 25px; width:25px; height:25px; font-size:10px; font-weight:750; letter-spacing:.2px; background:var(--stage-soft,var(--info-soft)); color:var(--stage-color,var(--info)); border-radius:7px; }
html[data-theme] .opportunity-card h3 { font-size:15px; line-height:1.45; font-weight:650; color:var(--ink); }
.card-numbers { display:block; margin:14px 0 12px; }
html[data-theme] .card-value { font-size:22px; line-height:1.2; letter-spacing:-.5px; font-weight:720; color:var(--ink); }
html[data-theme] .card-numbers .card-date { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); margin-top:8px; }
.card-date svg { width:13px; height:13px; }
html[data-theme] .card-followup { margin:0; }
html[data-theme] .task-hint { display:grid; grid-template-columns:15px minmax(0,1fr); align-items:start; gap:4px 6px; color:var(--muted); border:0; background:transparent; font-size:12px; padding:8px 0; margin:0; }
.task-hint>svg { width:14px; height:14px; margin-top:2px; }
.task-hint-title { min-width:0; line-height:1.5; }
html[data-theme] .task-hint small { grid-column:2; margin:0; padding:0; color:var(--ui-accent); font-size:11px; font-weight:650; }
html[data-theme] .task-hint.overdue,html[data-theme] .task-hint.overdue small { color:var(--danger); background:transparent; }
html[data-theme][data-workspace] .task-hint.muted { display:flex; align-items:center; color:var(--muted); }
html[data-theme] .pending-send-label { display:flex; align-items:center; gap:6px; padding:7px 8px; background:var(--warning-soft); color:var(--warning); border-radius:6px; font-weight:600; font-size:11px; line-height:1.4; margin:0 0 4px; }
.pending-send-label>svg { width:13px; height:13px; flex:0 0 13px; }
html[data-theme] .card-footer { border-top:1px solid var(--line); color:var(--muted); margin-top:10px; padding:10px 0; font-size:11px; }
html[data-theme] .avatar.tiny { width:23px; height:23px; font-size:10px; }
html[data-theme] .column-empty { margin:0; border:1px dashed var(--line); border-radius:8px; min-height:108px; display:grid; place-items:center; color:var(--muted); font-size:12px; background:color-mix(in srgb,var(--ui-surface) 40%,transparent); text-align:center; padding:16px; }

/* Consistent state language across tables, opportunities and reservations. */
html[data-theme][data-workspace] :is(.badge.new,.badge.draft) { background:var(--ui-soft); color:var(--muted); }
html[data-theme][data-workspace] .badge.conversation { background:var(--teal-soft); color:var(--teal); }
html[data-theme][data-workspace] .badge.quoted { background:var(--violet-soft); color:var(--violet); }
html[data-theme][data-workspace] :is(.badge.pending,.badge.send_pending,.badge.test_captured) { background:var(--warning-soft); color:var(--warning); }
html[data-theme][data-workspace] :is(.badge.won,.badge.accepted) { background:var(--positive-soft); color:var(--positive); }
html[data-theme][data-workspace] .badge.lost { background:var(--danger-soft); color:var(--danger); }
html[data-theme=dark] :is(.quote-register-row,.detail-quote) .badge.send_pending { background:var(--warning-soft); color:var(--warning); }
html[data-theme] .stock-warning,html[data-theme] .unsent-inline { color:var(--warning); background:var(--warning-soft); }
html[data-theme] .stock-ok { color:var(--positive); background:var(--positive-soft); }
html[data-theme] .count-pill { background:var(--section-soft); color:var(--section-accent); }
html[data-theme] .count-pill.overdue { background:var(--danger-soft); color:var(--danger); }
html[data-theme] .warm-text { color:var(--danger); }
html[data-theme] .notice { color:var(--warning); background:var(--warning-soft); border-color:color-mix(in srgb,var(--warning) 22%,var(--line)); }
html[data-theme] .notice.subtle { color:var(--info); background:var(--info-soft); border-color:color-mix(in srgb,var(--info) 20%,var(--line)); }

/* Registers use headers, breathing room and clear row ownership. */
html[data-theme] .register-panel { overflow:hidden; padding:0 20px 12px; }
html[data-theme] .directory-toolbar { padding:18px 0; gap:14px; }
html[data-theme] .directory-toolbar .search-box { background:var(--paper); }
.register-head { background:var(--ui-soft); color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.3px; padding:11px 12px; border-radius:7px; margin-bottom:4px; }
.quote-register-head { display:grid; grid-template-columns:minmax(200px,2fr) minmax(140px,1fr) minmax(130px,1fr) 120px auto; gap:16px; }
.quote-register-head>span:nth-child(4) { text-align:right; }
.quote-register-head>span:last-child { min-width:77px; text-align:center; }
.quote-register-row { padding:17px 12px; border-top:0; border-bottom:1px solid var(--line); }
.quote-register-row:hover,.finance-overview-row:hover { background:var(--paper); }
html[data-theme] .quote-code { color:var(--violet); font-size:12px; font-weight:750; letter-spacing:.3px; }
.quote-register-row>a:first-child>span { color:var(--ink); font-weight:650; font-size:15px; }
.quote-register-row small { font-size:12px; line-height:1.5; }
.register-amount { font-size:16px; }
.register-count { padding:6px 0 12px; font-size:12px; }
html[data-theme] .unsent-notice { background:var(--warning-soft); border-color:color-mix(in srgb,var(--warning) 22%,var(--line)); border-left:3px solid var(--warning); padding:16px 18px; box-shadow:none; }
html[data-theme] .unsent-notice .panel-heading { margin:0 0 6px; }
html[data-theme] .unsent-notice h2 { color:var(--warning); font-size:15px; }
html[data-theme] .unsent-notice .field-help { margin:0; }
.unsent-notice summary { padding:8px 0 0; font-size:13px; }
html[data-theme] .client-record { margin:0 0 10px; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
html[data-theme] .client-record>summary { padding:17px 38px 17px 18px; background:var(--ui-surface); grid-template-columns:minmax(180px,1.5fr) minmax(180px,1fr) auto; }
.client-record>summary:after { right:16px; }
.client-record-name strong { font-size:15px; color:var(--ink); font-weight:650; }
.client-record[open]>summary { background:var(--info-soft); }
.client-record-body { background:var(--paper); border-top:1px solid var(--line); padding:20px; }
html[data-theme] .company-contact { background:var(--ui-surface); border:1px solid var(--line); padding:16px; }
html[data-theme] .company-contact strong { font-size:14px; }
html[data-theme] .company-contact :is(small,span) { font-size:12px; }

/* Details, finance and editors share the same data hierarchy. */
html[data-theme] .detail-heading { margin:4px 0 20px; padding-left:16px; border-left:4px solid var(--section-accent); }
html[data-theme] .detail-heading h1 { font-size:27px; }
html[data-theme] .commercial-progress { padding:16px 18px; border:1px solid var(--line); border-radius:12px; background:var(--ui-surface); margin-bottom:14px; }
html[data-theme] .status-strip { display:grid; grid-template-columns:1fr 1fr 1.3fr; gap:16px; padding:18px 20px; margin:0 0 20px; box-shadow:var(--ui-shadow); }
html[data-theme] .status-strip>div { display:flex; flex-direction:column; align-items:start; gap:6px; min-width:0; }
html[data-theme] .status-strip .status-amount { margin:0; align-items:end; text-align:right; }
html[data-theme] .status-strip small { font-size:12px; color:var(--muted); }
html[data-theme] .status-amount strong { font-size:26px; color:var(--section-accent); }
html[data-theme] .detail-tabs { background:var(--ui-surface); border:1px solid var(--line); border-radius:11px; padding:5px; gap:4px; margin-bottom:20px; }
html[data-theme] .detail-tabs button { padding:10px 12px; font-size:13px; color:var(--muted); border-radius:7px; }
html[data-theme] .detail-tabs button.active { color:var(--ui-accent); background:var(--mint); box-shadow:none; }
html[data-theme] .data-grid { gap:18px; }
html[data-theme] .data-grid>div { background:var(--paper); border:1px solid var(--line); padding:12px 14px; border-radius:8px; }
html[data-theme] .data-grid dt { color:var(--muted); font-size:12px; margin-bottom:7px; }
html[data-theme] .data-grid dd { font-size:14px; color:var(--ink); line-height:1.5; }
html[data-theme] .next-action { border-left:3px solid var(--ui-accent); }
html[data-theme] .task-row { border-color:var(--line); padding:15px 0; }
html[data-theme] .complete-circle { background:var(--ui-surface); border-color:var(--line); }
html[data-theme] .finance-metrics>div,html[data-theme] .metric { position:relative; background:var(--ui-surface); border:1px solid var(--line); border-top:3px solid var(--info); box-shadow:var(--ui-shadow); padding:18px; border-radius:11px; }
html[data-theme] .finance-metrics>div:nth-child(2),html[data-theme] .metric:nth-child(2) { border-top-color:var(--positive); }
html[data-theme] .finance-metrics>div:nth-child(3),html[data-theme] .metric:nth-child(3) { border-top-color:var(--warning); }
html[data-theme] .finance-metrics>div:nth-child(4),html[data-theme] .metric:nth-child(4) { border-top-color:var(--violet); }
html[data-theme] .metric:first-child .metric-top,html[data-theme] .metric:first-child>small { color:var(--muted); }
html[data-theme] .metric:first-child>strong { color:var(--ink); }
.finance-metrics strong { font-size:25px; color:var(--ink); }
html[data-theme] .finance-record { padding:18px 0; border-color:var(--line); }
.finance-overview-row { padding:19px 8px; }
html[data-theme] .quote-version-details>summary { padding:4px 0; }
html[data-theme] .detail-quote.chosen { border-color:var(--positive); box-shadow:0 0 0 1px color-mix(in srgb,var(--positive) 20%,transparent); }
html[data-theme] .selected-proposal { background:var(--positive-soft); color:var(--positive); padding:12px; border-radius:8px; }
html[data-theme] dialog { background:var(--ui-surface); border-color:var(--line); border-radius:16px; box-shadow:0 24px 100px #0b132b55; }
html[data-theme] dialog::backdrop { background:#111b3a80; backdrop-filter:blur(4px); }
html[data-theme] .modal-heading { padding-bottom:16px; border-bottom:1px solid var(--line); }
html[data-theme] .modal-heading h2 { font-size:22px; letter-spacing:-.4px; }
html[data-theme] .modal-error { color:var(--danger); background:var(--danger-soft); }
html[data-theme] .form-actions { border-color:var(--line); background:var(--ui-surface); }
html[data-theme] .quote-workbench .editor-section>h3,html[data-theme] .quote-editor-heading h3 { color:var(--ink); font-size:16px; }
html[data-theme] .quote-workbench .editor-line { background:var(--paper); border-color:var(--line); }
html[data-theme] .quote-workbench .delivery-line { background:var(--info-soft); border-color:color-mix(in srgb,var(--info) 20%,var(--line)); }
html[data-theme] .quote-workbench .delivery-line .product-label { color:var(--info)!important; }
html[data-theme] .quote-workbench .editor-line label { color:var(--muted); }
html[data-theme] .quote-workbench .editor-line input { background:var(--ui-surface); color:var(--ink); }
html[data-theme] .quote-workbench-summary { background:var(--ui-soft); border-color:var(--line); border-radius:12px; }
html[data-theme] .payment-suggestion { background:var(--paper); }
html[data-theme] .empty-state { color:var(--muted); }
html[data-theme] .empty-state>svg { color:var(--section-accent); background:var(--section-soft); border-radius:16px; padding:12px; width:50px; height:50px; }
html[data-theme] :is(.btn,.icon-button,.summary-card,.client-record>summary,a):focus-visible { outline:3px solid var(--ui-accent); outline-offset:3px; }
html[data-theme] .sidebar a:focus-visible { outline-color:#bfb9ff; }

@media(max-width:1250px) {
  html[data-theme] .pipeline-controls>.filters { grid-template-columns:minmax(180px,1.6fr) 1fr 1fr; }
  html[data-theme] .workspace-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .summary-card { padding:16px 18px; }
  .quote-register-head { display:none; }
}
@media(max-width:1000px) {
  html[data-theme] #content { padding:22px; }
  html[data-theme] .page-heading { flex-wrap:wrap; }
  html[data-theme] .page-title-group { flex:1; }
  html[data-theme] .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html[data-theme] .status-strip { grid-template-columns:1fr 1fr 1.2fr; }
  html[data-theme] .detail-tabs { overflow-x:auto; }
}
@media(max-width:760px) {
  html[data-theme] #content { padding:20px 16px; }
  html[data-theme] .topbar { height:58px; padding:0 16px; }
  html[data-theme] .page-heading { margin-bottom:20px; gap:16px; }
  html[data-theme] .page-heading h1,html[data-theme] .page-heading[data-page=crm] h1 { font-size:25px; }
  html[data-theme] .page-heading .eyebrow { display:none; }
  html[data-theme] .page-heading p,html[data-theme] .page-heading[data-page=crm] p { display:none; }
  .page-symbol { width:39px; height:39px; flex-basis:39px; border-radius:11px; }
  .page-symbol svg { width:20px; height:20px; }
  html[data-theme] .page-title-group { gap:10px; flex:auto; }
  html[data-theme] .page-heading>.btn { width:auto; margin-left:0; min-height:38px; font-size:13px; }
  html[data-theme] .workspace-summary { gap:10px; margin-bottom:18px; }
  .summary-card { padding:14px; grid-template-columns:1fr 27px; gap:8px; border-radius:10px; }
  .summary-icon { width:27px; height:27px; border-radius:8px; }
  .summary-icon svg { width:15px; height:15px; }
  .summary-label { font-size:11px; }
  html[data-theme] .workspace-summary .summary-card>strong { font-size:25px; }
  .summary-card>small { font-size:11px; line-height:1.45; }
  .summary-pipeline { grid-column:1/-1; }
  .summary-opportunities { grid-column:1/-1; display:none; }
  .pipeline-controls { padding:10px; gap:8px; margin-bottom:18px; }
  html[data-theme] .pipeline-controls>.filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html[data-theme] .pipeline-controls .search-box { grid-column:1/-1; }
  .pipeline-controls .toolbar-end { flex-direction:column; }
  .board-heading>span { display:none; }
  .board-heading h2 { font-size:15px; }
  html[data-theme] .opportunity-row { background:var(--ui-surface); border-bottom:1px solid var(--line); padding:16px; gap:10px; }
  html[data-theme] .opportunity-row .row-next-action { grid-column:1/-1; }
  html[data-theme] .opportunity-row .pending-send-label { display:inline-flex; margin:0; }
  html[data-theme] .opportunity-row .task-hint { display:grid; }
  html[data-theme] .opportunity-row .task-hint small { margin:0; }
  html[data-theme] .register-panel { padding:0 12px 12px; }
  .register-head { display:none; }
  .quote-register-row { padding:16px 4px; }
  html[data-theme] .client-record>summary { grid-template-columns:minmax(0,1fr) auto; gap:10px; padding:15px 30px 15px 14px; }
  .client-record-contact { grid-column:1; }
  .client-record-count { grid-column:1; font-size:11px; }
  .client-record-body { padding:14px; }
  html[data-theme] .status-strip { padding:16px; grid-template-columns:1fr 1fr; }
  html[data-theme] .status-strip .status-amount { grid-column:1/-1; border-top:1px solid var(--line); padding-top:12px; align-items:start; text-align:left; }
  html[data-theme] .detail-heading { padding-left:12px; }
  html[data-theme] .detail-heading h1 { font-size:24px; }
  html[data-theme] .data-grid { gap:10px; }
  html[data-theme] .data-grid>div { padding:10px; }
  html[data-theme] .commercial-progress { padding:14px; }
  html[data-theme] .panel { padding:18px; }
  html[data-theme] .register-panel { padding:0 12px 12px; }
  .finance-metrics { gap:10px; }
  html[data-theme] .finance-metrics>div { padding:14px; }
  .finance-metrics strong { font-size:21px; }
  html[data-theme] .quote-editor-dialog { border-radius:0; }
}
@media(prefers-reduced-motion:reduce) { html[data-theme] .opportunity-card:hover { transform:none; } }

html[data-theme] .product-row-main>p { color:var(--muted); font-size:13px; line-height:1.6; }

html[data-theme][data-workspace] .opportunity-card .task-hint { background:var(--paper); color:var(--muted); border-radius:7px; padding:8px; }
html[data-theme][data-workspace] .opportunity-card .task-hint small { color:var(--ui-accent); }
html[data-theme][data-workspace] .opportunity-card .task-hint.overdue,html[data-theme][data-workspace] .opportunity-card .task-hint.overdue small { color:var(--danger); }
html[data-theme][data-workspace] .opportunity-card .task-hint.muted { background:transparent; padding:8px 0; }

html[data-theme][data-workspace] .quote-code { color:var(--violet); }
html[data-theme][data-workspace] .search-box { background:var(--paper); border-color:var(--line); }
html[data-theme][data-workspace] .search-box input { background:transparent; border:0; box-shadow:none; }
html[data-theme][data-workspace] :is(input[name],select,textarea) { background:var(--ui-surface); color:var(--ink); border-color:var(--line); }
html[data-theme][data-workspace] .unsent-notice .count-pill { color:var(--warning); background:var(--ui-surface); }
html[data-theme][data-workspace] .unsent-notice .panel-heading h2>svg { color:var(--warning); }

@media(max-width:760px) {
  .summary-card>small { display:none; }
  .summary-card.summary-pipeline { grid-template-columns:minmax(0,1fr) auto; align-items:center; padding:14px; }
  .summary-pipeline .summary-icon { display:none; }
  .summary-pipeline .summary-label { grid-row:1; grid-column:1; }
  html[data-theme] .workspace-summary .summary-pipeline>strong { grid-row:1; grid-column:2; font-size:24px; }
  .summary-pipeline>small { display:block; grid-row:2; }
  html[data-theme] .detail-heading h1 { font-size:22px; }
  html[data-theme] .detail-heading>.btn { margin-top:12px; min-height:38px; }
  html[data-theme] .commercial-progress { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px; }
  html[data-theme] .commercial-progress ol { display:none; }
  html[data-theme] .commercial-progress-action { display:contents; }
  html[data-theme] .commercial-progress-action .field-help { display:none; }
  html[data-theme] .commercial-progress-action .btn { min-height:34px; font-size:12px; }
  html[data-theme] .status-strip { padding:12px 14px; gap:10px; margin-bottom:16px; }
  html[data-theme] .status-strip .status-amount { padding-top:10px; }
  html[data-theme] .status-amount strong { font-size:23px; }
}
html[data-theme][data-workspace] .opportunity-row .task-hint { background:var(--paper); color:var(--muted); border-radius:7px; padding:8px; }
html[data-theme][data-workspace] .opportunity-row .task-hint small { color:var(--ui-accent); }
@media(max-width:760px) {
  html[data-theme] .pipeline-controls>.filters :is(select,.search-box) { min-height:40px; }
  html[data-theme] .page-heading>.btn { min-height:42px; }
}
html[data-theme][data-workspace] .kanban-column { background:var(--kanban-surface); }
html[data-theme][data-workspace] :is(.pending-send-label,.stock-warning,.unsent-inline) { background:var(--warning-soft); color:var(--warning); }
html[data-theme][data-workspace] .stock-ok { background:var(--positive-soft); color:var(--positive); }

/* Work areas, stage groups and a single persistent conversation column. */
html[data-theme] .sidebar>.nav-caption { display:none; }
.nav-group { padding:14px 0 8px; }
.nav-group+.nav-group { border-top:1px solid var(--nav-line); }
.nav-group-label { display:block; padding:0 13px 10px; color:var(--nav-muted); font-size:10px; font-weight:750; letter-spacing:1px; text-transform:uppercase; }
html.navigation-compact .nav-group-label { display:none; }
html.navigation-compact .nav-group { padding:10px 0 5px; }
html[data-theme=light] .sidebar a:focus-visible { outline-color:var(--ui-accent); }
html[data-theme] .detail-tabs { gap:0; align-items:stretch; padding:8px; margin-bottom:18px; }
.detail-tab-group { flex:0 0 auto; padding:0 10px; }
.detail-tab-group+.detail-tab-group { border-left:1px solid var(--line); }
.detail-group-label { display:block; color:var(--muted); font-size:10px; font-weight:750; letter-spacing:.7px; text-transform:uppercase; padding:2px 7px 7px; }
.detail-group-buttons { display:flex; gap:3px; }
html[data-theme] .detail-tabs button { padding:8px 10px; min-height:37px; }
html[data-theme] .detail-grid.with-chatter { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,360px); gap:22px; align-items:start; }
.detail-grid.with-chatter>.detail-main { min-width:0; container:record / inline-size; }
html[data-theme] .detail-main>.section-context { display:flex; margin:0 0 16px; padding:14px 16px; background:var(--section-soft); border:1px solid color-mix(in srgb,var(--section-accent) 18%,var(--line)); border-left:4px solid var(--section-accent); }
html[data-theme] .section-context strong { color:var(--section-accent); }
html[data-theme] .section-context>span { color:var(--muted); }
.opportunity-chatter { min-width:0; position:sticky; top:16px; max-height:calc(100dvh - 32px); overflow-y:auto; scrollbar-width:thin; scrollbar-color:var(--chatter-border) transparent; border-radius:13px; }
html[data-theme] .opportunity-chatter .history-panel { padding:18px; margin:0; background:var(--chatter-surface); border:1px solid var(--chatter-border); box-shadow:none; }
html[data-theme] .opportunity-chatter .chatter-heading h2 { font-size:17px; }
html[data-theme] .opportunity-chatter .chatter-heading p { display:block; color:var(--muted); font-size:11px; }
html[data-theme] .opportunity-chatter .chatter-record { display:block; margin-bottom:12px; padding-bottom:12px; font-size:12px; }
html[data-theme] .opportunity-chatter .chatter-symbol { width:32px; height:32px; border-radius:8px; }
html[data-theme] .opportunity-chatter .chatter-symbol svg { width:18px; height:18px; }
html[data-theme] .opportunity-chatter .history-filters { gap:4px; }
html[data-theme] .opportunity-chatter .history-filters button { padding:6px 7px; font-size:11px; }
html[data-theme] .opportunity-chatter .history-filters button.active { color:var(--ui-surface); }
html[data-theme] .opportunity-chatter .timeline-entry { grid-template-columns:24px minmax(0,1fr); gap:7px; }
html[data-theme] .opportunity-chatter .timeline-icon { width:24px; height:24px; }
html[data-theme] .opportunity-chatter .timeline-entry p { font-size:13px; }
html[data-theme] .opportunity-chatter .timeline-body { padding:11px; }
html[data-theme] .detail-grid.with-chatter[data-active-tab=history] { grid-template-columns:minmax(0,1fr); }
.detail-grid.with-chatter[data-active-tab=history]>.detail-main { display:none; }
.detail-grid.with-chatter[data-active-tab=history]>.opportunity-chatter { position:static; max-height:none; width:100%; max-width:980px; margin-inline:auto; }
@container record (max-width:750px) {
  .finance-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .finance-heading { align-items:start; }
  .finance-record-main { flex-wrap:wrap; }
  .quote-period>span { margin-left:0; }
}
@media(max-width:1120px) {
  html[data-theme] .detail-grid.with-chatter { grid-template-columns:minmax(0,1fr); }
  .opportunity-chatter { position:static; max-height:none; }
  html[data-theme] .opportunity-chatter .history-panel { border-top:3px solid var(--chatter-accent); }
}
@media(max-width:760px) {
  html[data-theme] .detail-tabs { padding:7px 3px; }
  .detail-tab-group { padding:0 6px; }
  .detail-group-label { font-size:9px; padding-bottom:5px; }
  html[data-theme] .detail-tabs button { padding:8px; }
  html[data-theme] .detail-grid.with-chatter { gap:18px; }
  html[data-theme] .detail-main>.section-context { padding:12px; }
}

html[data-theme] .opportunity-chatter .history-filters button.active { color:var(--ui-surface)!important; background:var(--chatter-accent); }

/* Reservar y autorizar despacho son decisiones independientes. */
html[data-theme] .workflow-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:20px; }
html[data-theme] .logistics-plan-fields { border:0; margin:0; padding:0; min-width:0; }
.logistics-plan-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin:20px 0; }
.logistics-plan-grid>section { min-width:0; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--ui-soft); }
.logistics-plan-panel .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.logistics-plan-panel .form-grid>label,.logistics-plan-panel input { min-width:0; max-width:100%; }
.logistics-plan-grid h3 { display:flex; align-items:center; gap:8px; margin:0 0 18px; font-size:15px; }
.logistics-plan-grid h3 svg { width:18px; height:18px; }
.logistics-time-group { border-bottom:1px solid var(--line); padding-bottom:14px; margin-bottom:16px; }
.logistics-time-group h4 { margin:0 0 10px; color:var(--ink); }
.logistics-plan-panel .crew-fieldset { margin:18px 0; }
.logistics-plan-fields:disabled { opacity:.8; }
.job-authorization { color:var(--section-accent); font-size:13px; font-weight:650; }
html[data-theme] .exception-choice { display:flex; flex-direction:row; align-items:center; gap:10px; margin:18px 0; padding:12px; border:1px solid var(--line); border-radius:10px; }
.exception-choice input { width:18px; height:18px; }
.reservation-alerts h2 { display:flex; align-items:center; gap:8px; }
.reservation-alerts h2 svg { width:18px; height:18px; }
@container record (max-width:750px) { .logistics-plan-grid { grid-template-columns:1fr; } }
@container record (max-width:500px) { .logistics-plan-panel .form-grid { grid-template-columns:minmax(0,1fr); } }
@media(max-width:760px) {
  html[data-theme] .workflow-strip { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  .workflow-strip .status-amount { align-items:flex-start; text-align:left; }
  .logistics-plan-grid { grid-template-columns:1fr; gap:14px; }
  .logistics-plan-panel .form-grid { grid-template-columns:minmax(0,1fr); }
  .logistics-plan-panel>.panel-heading { flex-direction:column; align-items:flex-start; gap:12px; }
}

/* Revisión 24-10-2026 */
label small.muted{display:inline;font-weight:400;margin-left:4px;font-size:.85em}
.danger-text{color:var(--danger,#b42318)}
.addon-tag{display:inline-block;padding:1px 8px;border-radius:999px;background:var(--accent-soft,#ede9fe);color:var(--accent-strong,#5b21b6);font-size:.75em;font-weight:600;vertical-align:middle}
.replace-acceptance{border:1px solid var(--warning-border,#f5d48a);background:var(--warning-soft,#fff8e6);border-radius:12px;padding:12px 16px}
.quote-workbench .editor-section.replace-acceptance{padding:14px 18px;margin-bottom:8px}

/* ---------- Terreno: calendario, avisos, técnicos y guía firmada ---------- */
.cal-panel{padding:16px}
.cal-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.cal-nav{display:flex;align-items:center;gap:6px}
.cal-nav .icon-button{width:36px;height:36px}
.cal-title{font-size:1.15rem;margin:0 0 0 8px}
.cal-title::first-letter,.cal-list-day h3::first-letter{text-transform:uppercase}
.pending-row{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.pending-row small{display:block;color:var(--muted)}
.pending-actions{display:flex;gap:6px;flex-wrap:wrap}
.cal-views{display:inline-flex;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--surface)}
.cal-views button{border:0;background:transparent;padding:8px 14px;font:inherit;font-weight:600;color:var(--muted);cursor:pointer}
.cal-views button+button{border-left:1px solid var(--line)}
.cal-views button.active{background:var(--ui-accent,#4f46e5);color:#fff}
.cal-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:14px}
.cal-filters .search-box{flex:1 1 240px}
.cal-filters select{flex:0 1 220px}
.cal-legend{display:inline-flex;gap:8px;align-items:center;color:var(--muted);font-size:.85rem}
.cal-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-left:6px}
.kind-delivery{--event:var(--teal,#008996);--event-soft:var(--teal-soft,#e0f4f5)}
.kind-pickup{--event:var(--violet,#7c3aed);--event-soft:var(--violet-soft,#f1e9ff)}
.cal-legend i.kind-delivery,.cal-legend i.kind-pickup{background:var(--event)}
.cal-event{display:flex;align-items:center;gap:6px;width:100%;min-width:0;border:0;border-left:3px solid var(--event);background:var(--event-soft);color:var(--ink);border-radius:6px;padding:3px 6px;font:inherit;font-size:.78rem;text-align:left;cursor:pointer;margin-top:3px}
.cal-event span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.cal-event time{font-weight:700;color:var(--event)}
.cal-event.status-draft{background:transparent;border:1px dashed var(--event);border-left-width:3px;opacity:.85}
.cal-event.status-done{opacity:.6}
.cal-event.has-rejection{box-shadow:inset 0 0 0 1px var(--danger,#b42318)}
.cal-flag{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--danger,#b42318);color:#fff;font-size:.7rem}
.cal-flag.soft{background:var(--warning,#b54708)}
.cal-month{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--line);border-radius:12px;overflow:hidden}
.cal-month .cal-head{padding:8px;font-size:.78rem;font-weight:700;color:var(--muted);text-transform:uppercase;background:var(--surface-soft);border-bottom:1px solid var(--line)}
.cal-cell{min-height:108px;padding:6px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);min-width:0}
.cal-cell:nth-child(7n){border-right:0}
.cal-cell.other-month{background:var(--surface-soft);color:var(--muted)}
.cal-cell.today .cal-daynum{background:var(--ui-accent,#4f46e5);color:#fff}
.cal-daynum{border:0;background:transparent;font:inherit;font-weight:700;width:28px;height:28px;border-radius:50%;cursor:pointer;color:inherit}
.cal-more{border:0;background:transparent;color:var(--ui-accent,#4f46e5);font:inherit;font-size:.78rem;cursor:pointer;padding:2px 4px}
.cal-grid{border:1px solid var(--line);border-radius:12px;overflow:hidden}
.cal-grid-head,.cal-grid-body{display:grid;grid-template-columns:56px repeat(7,minmax(0,1fr))}
.cal-grid.cols-1 .cal-grid-head,.cal-grid.cols-1 .cal-grid-body{grid-template-columns:56px minmax(0,1fr)}
.cal-grid-head{background:var(--surface-soft);border-bottom:1px solid var(--line)}
.cal-grid-head .cal-head{border:0;background:transparent;padding:10px 6px;font:inherit;font-weight:700;color:var(--muted);text-transform:capitalize;cursor:pointer}
.cal-grid-head .cal-head.today{color:var(--ui-accent,#4f46e5)}
.cal-grid-body{max-height:640px;overflow:auto}
.cal-hours div{height:48px;font-size:.72rem;color:var(--muted);text-align:right;padding:2px 6px 0 0;box-sizing:border-box}
.cal-day-col{position:relative;border-left:1px solid var(--line)}
.cal-day-col.today{background:color-mix(in srgb,var(--ui-accent,#4f46e5) 5%,transparent)}
.cal-hour-line{height:48px;border-bottom:1px solid var(--line);box-sizing:border-box}
.cal-slot{position:absolute;left:3px;right:3px;display:flex}
.cal-slot .cal-event{margin:0;height:100%;align-items:flex-start;flex-direction:column;gap:0;overflow:hidden}
.cal-slot .cal-event span{white-space:normal}
.cal-list-day h3{font-size:1rem;margin:18px 0 8px}
.cal-day-cards{margin-top:14px}
.cal-unscheduled{margin:0 0 12px;border:1px dashed var(--line);border-radius:10px;padding:8px 12px}
.cal-unscheduled summary{cursor:pointer;font-weight:600}
.pending-assignments{border-left:4px solid var(--warning,#b54708)}
.pending-assignments h2{display:flex;gap:8px;align-items:center}
.crew-responses{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.crew-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:var(--surface-soft);border:1px solid var(--line);font-size:.82rem}
.crew-chip svg{width:14px;height:14px}
.crew-chip small{color:var(--muted)}
.crew-chip em{font-style:normal;color:var(--danger,#b42318);font-size:.78rem}
.crew-chip.response-accepted{background:var(--positive-soft,#e7f6ec);border-color:transparent;color:var(--positive,#067647)}
.crew-chip.response-pending{background:var(--warning-soft,#fff6e5);border-color:transparent}
.crew-chip.response-rejected{background:var(--danger-soft,#fdecea);border-color:transparent}
.crew-alert{margin:6px 0}
.job-response{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0;padding:10px 12px;border-radius:10px;background:var(--warning-soft,#fff6e5)}
.job-response p{margin:0 8px 0 0;flex:1 1 100%}
.publish-all-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;margin:12px 0;border-radius:12px;background:var(--section-soft,var(--accent-soft));border:1px solid var(--line)}
.publish-all-bar small{display:block;color:var(--muted)}
.publish-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.publish-pair div{padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.publish-pair small{display:block;color:var(--muted)}
.notification-bell{position:relative}
.bell-count{position:absolute;top:2px;right:2px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--danger,#d92d20);color:#fff;font-size:.7rem;font-weight:700;display:grid;place-items:center;box-sizing:border-box}
.notification-panel{position:fixed;top:64px;right:16px;width:min(380px,calc(100vw - 32px));max-height:70vh;overflow:auto;background:var(--surface,#fff);border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 48px rgba(15,23,42,.18);z-index:1000;padding:8px}
.notification-head{display:flex;justify-content:space-between;align-items:center;padding:6px 8px 10px}
.notification-item{display:flex;gap:10px;width:100%;text-align:left;border:0;background:transparent;padding:10px 8px;border-radius:10px;font:inherit;color:inherit;cursor:pointer}
.notification-item:hover{background:var(--ui-hover,var(--surface-soft))}
.notification-item.unread{background:var(--info-soft,#eef4ff)}
.notification-item strong{display:block;font-size:.9rem}
.notification-item small,.notification-item time{display:block;color:var(--muted);font-size:.8rem;margin-top:2px}
.notification-kind{flex:0 0 32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--surface-soft)}
.notification-kind svg{width:16px;height:16px}
.notification-kind.kind-rejected{background:var(--danger-soft,#fdecea);color:var(--danger,#b42318)}
.notification-kind.kind-assignment{background:var(--teal-soft,#e0f4f5);color:var(--teal,#008996)}
.guide-summary{padding:12px 14px;border-radius:12px;background:var(--surface-soft);margin-bottom:12px}
.guide-summary h3{margin:4px 0}
.guide-summary p{margin:2px 0;color:var(--muted)}
.guide-items div{display:flex;justify-content:space-between;padding:8px 2px;border-bottom:1px solid var(--line)}
.guide-signed{margin:12px 0}
.signature-box{margin-top:10px}
#signature-canvas{display:block;width:100%;height:200px;border:2px dashed var(--line);border-radius:12px;background:#fff;touch-action:none;cursor:crosshair}
.signature-actions{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:6px}
@media (max-width:760px){
  .cal-toolbar{flex-direction:column;align-items:stretch}
  .cal-views{width:100%}.cal-views button{flex:1;padding:8px 6px}
  .cal-cell{min-height:64px;padding:3px}
  .cal-month .cal-event span{display:none}
  .cal-month .cal-event{justify-content:center;padding:2px}
  .cal-month .cal-event time{font-size:.68rem}
  .publish-pair{grid-template-columns:1fr}
  .cal-filters select{flex:1 1 45%}
}

/* ---------- Comisiones ---------- */
.commission-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:14px}
.commission-toolbar label{min-width:180px}
.commission-actions{display:flex;gap:8px;margin-left:auto;flex-wrap:wrap}
.commission-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0 16px}
.commission-metrics div{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.commission-metrics small{display:block;color:var(--muted)}
.commission-metrics strong{font-size:1.25rem}
.commission-metrics .highlight{background:var(--section-soft,var(--accent-soft));border-color:transparent}
.commission-row{display:grid;grid-template-columns:1fr 1.6fr 1fr 1fr .8fr 1fr 1fr;gap:10px;align-items:center;padding:10px 12px}
.commission-row.head{font-size:.78rem;font-weight:700;color:var(--muted);text-transform:uppercase;border-bottom:1px solid var(--line)}
.commission-row small{display:block;color:var(--muted);font-size:.8rem}
.commission-item{border-bottom:1px solid var(--line)}
.commission-item summary{cursor:pointer;list-style:none}
.commission-item summary::-webkit-details-marker{display:none}
.commission-item[open] summary{background:var(--surface-soft)}
.commission-lines{padding:6px 12px 12px 24px}
.commission-lines div{display:grid;grid-template-columns:2fr 1fr 1fr .8fr 1fr;gap:10px;padding:6px 0;border-top:1px dashed var(--line);font-size:.88rem}
.commission-lines small{display:block;color:var(--muted)}
.checkbox-line{display:flex;align-items:center;gap:8px;font-weight:500}
.checkbox-line input{width:auto;height:auto}
@media (max-width:760px){
  .commission-metrics{grid-template-columns:1fr 1fr}
  .commission-row{grid-template-columns:1fr 1fr;row-gap:4px}
  .commission-row.head{display:none}
  .commission-lines div{grid-template-columns:1fr 1fr}
  .commission-actions{margin-left:0}
}
.ops-conditions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px}
.ops-conditions>div:first-child{display:flex;gap:10px;align-items:center}
.ops-conditions svg{width:22px;height:22px;flex:0 0 22px}
.ops-conditions small{display:block;color:var(--muted)}
/* Corrige contraste: la primera métrica hereda fondo turquesa de una capa anterior y texto oscuro de otra. */
html[data-theme] .metric:first-child{background:var(--surface);border-color:var(--line)}
html[data-theme] .metric:first-child .metric-top svg{color:var(--section-accent,var(--teal));background:var(--section-soft,var(--teal-soft))}
/* Productos en tabla alineada */
.product-table-head,.product-row{display:grid;grid-template-columns:minmax(0,2.4fr) 90px 120px minmax(250px,auto);gap:14px;align-items:center}
.product-table-head{padding:8px 0;border-bottom:1px solid var(--line);font-size:.75rem;font-weight:700;color:var(--muted);text-transform:uppercase}
.product-row .product-row-main p{margin:4px 0 0;color:var(--muted);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:520px}
.product-row .product-row-main p.import-review-notice{white-space:normal;color:var(--warning,#b54708)}
.product-stock,.product-price{text-align:right}
.product-actions{display:flex;justify-content:flex-end;gap:6px;align-items:center}
.row-menu{position:relative}
.row-menu summary{list-style:none;cursor:pointer;border:1px solid var(--line);border-radius:8px;padding:6px 10px;font-weight:700;line-height:1}
.row-menu summary::-webkit-details-marker{display:none}
.row-menu[open]>div{position:absolute;right:0;top:calc(100% + 4px);z-index:20;display:flex;flex-direction:column;min-width:190px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 30px rgba(15,23,42,.14);padding:6px}
.row-menu[open]>div button{border:0;background:transparent;text-align:left;padding:8px 10px;border-radius:8px;font:inherit;color:inherit;cursor:pointer}
.row-menu[open]>div button:hover{background:var(--ui-hover,var(--surface-soft))}
.review-pill{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:var(--warning-soft,#fff6e5);color:var(--warning,#b54708);font-size:.72rem;font-weight:700}
@media (max-width:900px){.product-table-head{display:none}.product-row{grid-template-columns:1fr auto auto}.product-actions{grid-column:1/-1;justify-content:flex-start;flex-wrap:wrap}}
.directory-toolbar .checkbox-line{flex-direction:row;align-self:center;white-space:nowrap;margin:0}
.directory-toolbar .checkbox-line input{margin:0}

/* Acciones y siguientes pasos del arriendo. */
.first-deal{max-width:820px;margin:28px auto;padding:36px;text-align:center}
.first-deal-icon{display:inline-flex;padding:16px;border-radius:18px;color:var(--section-accent,var(--teal));background:var(--section-soft,var(--teal-soft))}
.first-deal-icon svg{width:32px;height:32px}
.first-deal h2{font-size:25px;margin:18px 0 10px}
.first-deal p{max-width:600px;margin:0 auto 20px;line-height:1.65;color:var(--muted)}
.first-deal .quote-actions{justify-content:center;margin-bottom:14px}
.first-deal small{display:block;color:var(--muted)}
.quote-next-actions{align-items:center;gap:8px;overflow:visible}
.quote-action-menu{position:relative;margin-left:auto}
.quote-action-menu>summary{display:block;list-style:none;cursor:pointer;border:1px solid var(--line);border-radius:9px;padding:9px 12px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:600}
.quote-action-menu>summary::-webkit-details-marker{display:none}
.quote-action-menu[open]{z-index:25}
.quote-action-menu[open]>div{position:absolute;right:0;bottom:calc(100% + 6px);display:flex;flex-direction:column;align-items:stretch;gap:4px;min-width:245px;max-width:calc(100vw - 48px);max-height:min(350px,65vh);overflow:auto;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 12px 32px rgba(15,23,42,.22)}
.quote-action-menu[open]>div .btn{text-align:left;justify-content:flex-start;border-color:transparent;white-space:normal}
.quote-action-menu[open]>div .btn:hover{background:var(--surface-soft)}
.publication-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px}
.publication-grid:empty{display:none}
.publication-readiness{padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin:10px 0}
.publication-grid>.publication-readiness{margin:0}
.publication-readiness h3{font-size:15px;margin:0}
.publication-readiness .panel-heading{gap:12px;align-items:center;margin-bottom:10px}
.publication-readiness small{color:var(--muted);line-height:1.5}
.publication-readiness ul{list-style:none;margin:0 0 10px;padding:0;display:grid;gap:9px}
.publication-readiness li{display:flex;align-items:center;gap:8px;font-size:14px;min-height:24px}
.publication-readiness li>svg{width:18px;height:18px;flex:0 0 18px}
.publication-readiness .is-ready>svg{color:var(--positive)}
.publication-readiness .is-pending>svg{color:var(--warning)}
.publication-readiness .text-button{display:inline-flex;align-items:center;gap:5px;text-align:left;white-space:normal}
.publication-readiness .text-button svg{width:14px;height:14px;flex:0 0 14px}
.return-next-step{border-left:4px solid var(--warning);background:var(--surface)}
.return-next-step h2{display:flex;align-items:center;gap:8px;font-size:19px}
.return-next-step h2 svg{width:23px;height:23px;flex:0 0 23px}
.return-next-step p{color:var(--muted);line-height:1.6}
.return-next-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px 0;border-top:1px solid var(--line)}
.return-next-row small{display:block;color:var(--muted);margin-top:4px}
.commercial-finance-summary{margin-bottom:18px}
html[data-theme] .pipeline-controls>.filters{grid-template-columns:minmax(220px,1.5fr) repeat(4,minmax(170px,1fr))}
@media(max-width:1440px){
  html[data-theme] .pipeline-controls{position:relative;grid-template-columns:minmax(0,1fr)}
  html[data-theme] .pipeline-controls>.section-toolbar{position:absolute;top:13px;right:13px}
  html[data-theme] .pipeline-controls .toolbar-end{flex-direction:row}
  html[data-theme] .pipeline-controls>.filters{grid-column:1;grid-row:1;grid-template-columns:repeat(2,minmax(0,1fr))}
  html[data-theme] .pipeline-controls>.filters .search-box{grid-column:1/-1;width:calc(100% - 86px)}
}
@media(max-width:760px){
  .first-deal{padding:24px 18px;margin:10px 0}.first-deal h2{font-size:22px}
  .first-deal .quote-actions{flex-direction:column;align-items:stretch}
  .publication-grid{grid-template-columns:1fr}.publication-readiness{padding:13px}
  .quote-action-menu{margin-left:0}.quote-action-menu[open]>div{left:0;right:auto}
  .return-next-row{flex-direction:column;align-items:stretch;gap:10px}
}
@media(max-width:480px){html[data-theme] .pipeline-controls>.filters{grid-template-columns:1fr}}

/* Comunicaciones y cobranza en pruebas. */
.communication-mode{align-items:center;margin-bottom:20px}.communication-mode small{display:block;margin-top:5px;color:var(--muted);line-height:1.5}
.communication-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:20px 0}
.communication-toolbar .segmented{display:flex;max-width:100%;overflow:auto;white-space:nowrap}
.communication-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.opportunity-communications{display:grid;gap:16px;margin:18px 0}.opportunity-communications:empty{display:none}
.communication-inbox-filter{display:flex;align-items:center;gap:10px;max-width:340px;margin-bottom:18px}.communication-inbox-filter select{margin:0}
.communication-card{margin:0;border-top:3px solid var(--violet)}.communication-card.incoming{border-top-color:var(--teal)}
.communication-card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}.communication-card h3{font-size:17px;line-height:1.45;overflow-wrap:anywhere;margin:7px 0}
.communication-card .field-help{overflow-wrap:anywhere}.communication-card .quote-actions{margin-top:18px}
.communication-opportunity{display:inline-flex;align-items:center;gap:6px;font-size:14px;line-height:1.5}.communication-opportunity svg{width:16px;height:16px;flex:0 0 16px}
.communication-content{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}.communication-content summary{cursor:pointer;font-weight:600;font-size:14px}
.communication-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;font-size:14px;max-height:340px;overflow:auto;margin-top:14px}
.communication-error{font-size:14px;color:var(--warning);line-height:1.5}.communication-pagination{display:flex;gap:12px;margin-top:20px}
.communication-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.communication-settings .checkbox-line{display:flex;flex-direction:row;align-items:center;gap:10px}.communication-settings .checkbox-line input{width:auto}
.collection-row{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:18px 0;border-top:1px solid var(--line)}.collection-row small{display:block;color:var(--muted);margin-top:7px}.collection-row a{display:inline-flex;align-items:center;gap:5px;font-size:14px}.collection-row svg{width:16px;height:16px}
@media(max-width:1000px){.communication-list,.communication-settings{grid-template-columns:1fr}}
@media(max-width:760px){.communication-toolbar{align-items:stretch;gap:12px}.communication-toolbar>.quote-actions{flex-wrap:wrap}.communication-card{padding:18px}.collection-row{flex-direction:column;align-items:stretch}.communication-pagination{flex-wrap:wrap}.collection-panel>.panel-heading{flex-direction:column;align-items:stretch;gap:14px}.collection-panel>.panel-heading .btn{width:100%;white-space:normal;min-height:44px}}

/* Cuentas de correo: identidad y acciones legibles en escritorio y celular. */
.mailbox-row{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:20px 0;border-bottom:1px solid var(--border)}
.mailbox-row:last-of-type{border-bottom:0}.mailbox-row strong,.mailbox-row small{display:block;overflow-wrap:anywhere}.mailbox-row small{margin-top:5px;color:var(--muted)}
.mailbox-options{display:grid;gap:10px;margin:18px 0}.mailbox-panel>.field-help{margin-top:20px}
@media(max-width:650px){.mailbox-row{align-items:stretch;flex-direction:column;gap:10px}.mailbox-row .quote-actions{justify-content:flex-start}.mailbox-panel>.panel-heading{align-items:stretch;flex-direction:column}}
/* 25-10-2026: las seis etapas en una fila en escritorio; con poco ancho se desplazan en horizontal. */
@media(min-width:900px){html[data-theme] .kanban{grid-template-columns:repeat(6,minmax(168px,1fr));overflow-x:auto;padding-bottom:6px}}
.publication-missing{display:flex;gap:8px;align-items:flex-start}
.return-all-list{margin:4px 0 12px;padding-left:18px}
.return-all-list li{margin:2px 0}
.page-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
@media(min-width:1001px){.finance-overview-row{grid-template-columns:minmax(180px,2fr) repeat(5,minmax(96px,1fr)) 18px}}
.test-tools{position:relative}
.test-tools>summary{cursor:pointer;color:var(--muted);font-size:13px;list-style:none;padding:6px 0}
.test-tools[open]>div{position:absolute;right:0;top:100%;z-index:5;background:var(--paper,#fff);border:1px solid var(--line,#ddd);border-radius:10px;padding:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);white-space:nowrap}
.job-detail dd a{color:var(--accent,#4f46e5);text-decoration:underline;text-underline-offset:2px}
/* Móvil: la franja de etapa muestra la indicación en vez de quedar vacía. */
@media(max-width:760px){html[data-theme] .commercial-progress-action .field-help{display:block;font-size:13px;margin:0}html[data-theme] .commercial-progress{flex-wrap:wrap}}
.detail-tabs,.detail-navigation{scrollbar-width:thin}
@media(max-width:760px){html[data-theme] .detail-group-buttons{overflow-x:auto;flex-wrap:nowrap;-webkit-mask-image:linear-gradient(90deg,#000 85%,transparent);mask-image:linear-gradient(90deg,#000 85%,transparent);padding-right:28px}}

/* Revisión 25-10-2026: celular más corto y legible. */
@media (max-width:760px) {
  html[data-theme] #content:not([data-detail-tab=history]) .opportunity-chatter { display:none; }
  /* Todas las pestañas a la vista, en dos filas, en vez de una franja que se corta. */
  html[data-theme] .detail-tab-group { flex:1 1 auto; min-width:0; padding:0; }
  html[data-theme] .detail-group-buttons { flex-wrap:wrap; overflow:visible; -webkit-mask-image:none; mask-image:none; }
  html[data-theme] .detail-group-buttons button { flex:1 1 30%; justify-content:center; }
  #guide-form .form-grid { grid-template-columns:1fr; }
  #modal { width:100vw; max-width:100vw; max-height:100dvh; margin:0; border-radius:0; }
}
/* Coordinación: horarios en una fila completa para que las fechas no se corten. */
html[data-theme] .logistics-plan-grid { grid-template-columns:1fr; }
html[data-theme] .logistics-time-group .form-grid { grid-template-columns:repeat(2,minmax(190px,1fr)); }
@media (max-width:560px) { html[data-theme] .logistics-time-group .form-grid { grid-template-columns:1fr; } }
.company-filter { margin:6px 0; }
.archived-toggle { margin:8px auto 0; display:block; font-size:13px; }
.job-response-hint { margin:8px 0 0; }
.backup-panel code { font-size:12px; }

/* Búsqueda por RUT en fichas de empresa */
html[data-theme] .rut-lookup { display:grid; gap:6px; margin:-4px 0 4px; }
html[data-theme] .rut-lookup[hidden] { display:none; }
html[data-theme] .rut-lookup-line { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:var(--info-soft); color:var(--ink); font-size:13px; line-height:1.5; }
html[data-theme] .rut-lookup-line > span { flex:1 1 220px; min-width:0; overflow-wrap:anywhere; }
html[data-theme] .rut-lookup-line small { display:block; color:var(--muted); font-size:12px; }
html[data-theme] .rut-lookup-line svg { color:var(--info); }
html[data-theme] .rut-lookup-line.muted { background:transparent; color:var(--muted); }
html[data-theme] .rut-lookup-warn { background:var(--warning-soft); border-color:color-mix(in srgb,var(--warning) 22%,var(--line)); }
html[data-theme] .rut-lookup-warn svg { color:var(--warning); }
