:root {
    --navy: #15324b; --blue: #1d6f8a; --cyan: #35a8bd; --ice: #edf7f8;
    --ink: #17242d; --muted: #667781; --line: #dce5e9; --white: #fff;
    --green: #20866c; --amber: #c98416; --red: #bc4b51;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f4f7f8; }
button, input, select { font: inherit; }
.topbar { display: grid; grid-template-columns: auto minmax(0,1fr); justify-content: space-between; align-items: center; gap: 18px; padding: 18px clamp(20px,4vw,64px); color: white; background: linear-gradient(120deg,var(--navy),var(--blue)); }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg,#15324b 0%,#1d6f8a 52%,#20866c 100%); }
.login-shell { width: min(460px,calc(100% - 32px)); margin: 0; }
.login-card { display: grid; gap: 18px; padding: 28px; border-radius: 8px; background: white; box-shadow: 0 24px 80px rgba(9,25,36,.28); }
.login-card h1 { color: var(--navy); font-size: 1.9rem; }
.login-card p { color: var(--muted); }
.login-form { display: grid; gap: 12px; }
.login-password-field { display: grid; gap: 6px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 5px; width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { color: var(--blue); background: var(--ice); }
.password-toggle:focus-visible { color: var(--blue); background: var(--ice); outline: 2px solid var(--cyan); outline-offset: 1px; }
.password-toggle svg { width: 21px; height: 21px; }
.password-toggle svg[hidden] { display: none; }
.two-factor-shell { width: min(560px,calc(100% - 32px)); }
.two-factor-setup { display: grid; gap: 14px; justify-items: center; }
.two-factor-setup ol { width: 100%; margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.7; }
.two-factor-qr { width: min(280px,100%); height: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.two-factor-manual { width: 100%; display: grid; gap: 6px; text-align: center; }
.two-factor-manual span,.security-note { color: var(--muted); font-size: .78rem; font-weight: 700; }
.two-factor-manual code { overflow-wrap: anywhere; padding: 10px; border-radius: 6px; color: var(--navy); background: var(--ice); font-size: .95rem; letter-spacing: .08em; }
h1,h2,p { margin-top: 0; } h1 { margin-bottom: 0; font-size: clamp(1.35rem,2.7vw,2rem); } h2 { margin-bottom: 8px; font-size: 1.1rem; }
.eyebrow { margin-bottom: 5px; color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.topbar .eyebrow { color: #9ee6ef; }
main { width: min(1880px,calc(100% - 20px)); margin: 24px auto 60px; display: grid; gap: 20px; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.home-hero { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: stretch; }
.home-hero-main,.home-today,.home-panel,.home-kpi { border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.home-hero-main { min-height: 260px; display: grid; align-content: center; gap: 12px; padding: clamp(22px,4vw,40px); background: linear-gradient(135deg,#ffffff 0%,#edf7f8 64%,#fff8e8 100%); }
.home-hero-main h2 { max-width: 760px; margin: 0; font-size: clamp(1.75rem,3vw,2.65rem); line-height: 1.05; }
.home-lead { max-width: 760px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.home-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 8px; }
.home-today { display: grid; align-content: space-between; gap: 16px; padding: 22px; border-top: 5px solid var(--green); }
.home-today span,.home-kpi span,.home-item span { color: var(--muted); font-size: .78rem; font-weight: 800; }
.home-today strong { display: block; font-size: 1.65rem; line-height: 1.08; }
.home-today small { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.home-kpi-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.home-kpi { min-height: 118px; display: grid; gap: 8px; align-content: start; padding: 16px; border-top: 5px solid var(--accent,var(--blue)); }
.home-kpi strong { display: block; font-size: 1.55rem; line-height: 1.05; overflow-wrap: anywhere; }
.home-kpi small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.home-kpi-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.home-kpi-configurable label { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.home-kpi-configurable select { min-height: 34px; padding: 6px 8px; border-radius: 7px; font-size: .78rem; font-weight: 800; }
.home-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.home-panel { min-width: 0; overflow: hidden; }
.home-panel header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: #fbfdfe; }
.home-panel h2 { margin: 0; font-size: 1.12rem; }
.home-list { display: grid; gap: 0; }
.home-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.home-item:last-child { border-bottom: 0; }
.home-item strong { overflow-wrap: anywhere; }
.home-item small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.home-item em { color: var(--blue); font-size: .74rem; font-style: normal; font-weight: 900; white-space: nowrap; }
.home-empty { padding: 24px 16px; color: var(--muted); font-size: .85rem; font-weight: 800; text-align: center; }
.home-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px 2px; }
.home-toolbar h2 { margin: 0; font-size: 1.35rem; }
.home-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.home-save-state { min-width: 76px; color: var(--muted); font-size: .76rem; font-weight: 800; text-align: right; }
.home-widget-grid { --home-grid-row: 18px; display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); grid-auto-flow: dense; grid-auto-rows: var(--home-grid-row); gap: 16px; align-items: stretch; }
.home-widget { --home-cols: 3; --home-rows: 5; position: relative; min-width: 0; min-height: 0; grid-column: span var(--home-cols); grid-row: span var(--home-rows); border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); overflow: hidden; }
.home-widget > .home-hero-main,.home-widget > .home-today,.home-widget > .home-kpi,.home-widget > .home-panel { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; overflow: hidden; }
.home-widget > .home-kpi { min-height: 132px; }
.home-widget-grid.editing .home-widget { outline: 2px dashed color-mix(in srgb,var(--blue) 45%,transparent); outline-offset: -4px; cursor: grab; }
.home-widget-grid.editing .home-widget:active { cursor: grabbing; }
.home-widget-controls { position: absolute; top: 8px; right: 8px; z-index: 4; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.96); box-shadow: 0 6px 18px rgba(21,50,75,.12); }
.home-widget-controls[hidden] { display: none; }
.home-widget-controls button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 5px; color: var(--blue); background: var(--ice); cursor: pointer; font-weight: 900; }
.home-widget-resize-handle { position: absolute; right: 0; bottom: 0; z-index: 5; width: 22px; height: 22px; cursor: nwse-resize; background: linear-gradient(135deg,transparent 0 45%,rgba(29,111,138,.18) 45% 55%,transparent 55% 100%); }
.home-widget-resize-handle[hidden] { display: none; }
.home-widget-resize-handle::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 9px; height: 9px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); }
.home-resizing,.home-resizing * { user-select: none; }
.home-quick-actions { height: 100%; }
.home-quick-actions header { padding: 16px; border-bottom: 1px solid var(--line); background: #fbfdfe; }
.home-quick-actions h2 { margin: 0; }
.home-quick-actions > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 16px; }
.home-widget-dialog { width: min(760px,calc(100% - 28px)); }
.home-widget-dialog form { display: grid; gap: 16px; }
.home-widget-catalog { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-height: min(58vh,560px); overflow: auto; }
.home-catalog-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.home-catalog-item strong,.home-catalog-item small { display: block; }
.home-catalog-item small { margin-top: 4px; color: var(--muted); font-size: .74rem; line-height: 1.35; }
.home-catalog-item .active { color: white; background: var(--blue); }
.import-panel { display: grid; grid-template-columns: minmax(220px,1.2fr) 1fr 1fr; gap: 16px; align-items: end; }
.upload-form { display: grid; gap: 8px; }
label,.filter-label,.field-like { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
input,select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cbd8dd; border-radius: 9px; color: var(--ink); background: white; }
.button { min-height: 42px; padding: 9px 16px; border: 0; border-radius: 9px; cursor: pointer; font-weight: 800; }
.button:disabled,.mini-button:disabled { opacity: .5; cursor: not-allowed; }
.primary { color: white; background: var(--blue); }.secondary { color: var(--blue); background: var(--ice); }.ghost { color: white; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); }
.danger { color: white; background: var(--red); }
.topnav { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }.nav-tab { position: relative; }.nav-tab.active { color: var(--navy); background: white; border-color: white; }
.nav-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid white; border-radius: 999px; color: white; background: var(--red); font-size: .66rem; font-weight: 900; line-height: 1; }
.nav-menu { position: relative; display: inline-flex; }
.nav-menu::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; z-index: 49; }
.nav-menu-root::after { content: "v"; margin-left: 8px; font-size: .72rem; }
.nav-dropdown { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; min-width: 210px; display: grid; gap: 4px; padding: 8px; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; background: white; box-shadow: 0 18px 42px rgba(9,25,36,.22); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .12s ease, transform .12s ease; }
.nav-dropdown-right { left: auto; right: 0; }
.nav-menu:hover .nav-dropdown,.nav-menu:focus-within .nav-dropdown,.nav-menu.open .nav-dropdown { opacity: 1; transform: translateY(0); pointer-events: auto; }
.nav-dropdown button { min-height: 38px; padding: 8px 10px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; font-weight: 800; }
.nav-dropdown button:hover,.nav-dropdown button:focus { color: var(--blue); background: var(--ice); outline: 0; }
.account-avatar-button { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.38); border-radius: 999px; background: rgba(255,255,255,.13); cursor: pointer; }
.account-avatar-button.active { background: white; border-color: white; }
.account-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; color: white; background: var(--user-color,var(--blue)); font-weight: 900; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.account-avatar.large { width: 104px; height: 104px; font-size: 2.2rem; box-shadow: 0 12px 34px rgba(21,50,75,.14), inset 0 0 0 4px rgba(255,255,255,.55); }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-menu { display: grid; gap: 5px; align-items: center; justify-items: end; min-width: 190px; }
.user-menu span { font-weight: 900; white-space: nowrap; }
.user-menu small { color: #bfeaf0; font-weight: 800; text-transform: uppercase; }
.user-menu div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.user-menu a { display: inline-flex; align-items: center; text-decoration: none; }
.app-section { display: none; }.app-section.active { display: grid; gap: 20px; }
.message { grid-column: 1/-1; padding: 12px; border-radius: 9px; background: var(--ice); }.message.error { color: #8d2429; background: #fdecee; }
.message.compact { margin-bottom: 12px; font-size: .84rem; }
.required-fields-notice { border: 1px solid #efb8be; font-weight: 800; }
.required-field-missing { border-color: #bc4b51 !important; box-shadow: 0 0 0 3px rgba(188,75,81,.14) !important; }
.runtime-error { position: sticky; top: 0; z-index: 9999; margin: 0; border-radius: 0; box-shadow: 0 8px 24px rgba(141,36,41,.18); }
.error-page { min-height: 100vh; display: grid; place-items: center; background: #f4f7f8; }
.error-page main.error-shell { width: min(760px,calc(100% - 32px)); margin: 0; display: block; }
.error-card { display: grid; gap: 14px; padding: clamp(24px,5vw,38px); border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 24px 80px rgba(9,25,36,.18); }
.error-card h1 { margin: 0; color: var(--navy); font-size: clamp(1.6rem,4vw,2.3rem); }
.error-card p { color: var(--muted); line-height: 1.55; }
.error-reference { padding: 10px 12px; border: 1px solid #f1d9dd; border-radius: 8px; color: #8d2429; background: #fff7f8; font-weight: 800; }
.error-details,.system-error-trace { max-height: 360px; margin: 0; overflow: auto; padding: 12px; border: 1px solid #d7e2e6; border-radius: 8px; color: #263943; background: #f8fbfc; font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }.section-heading h2 { margin: 0; font-size: 1.3rem; }.counter { padding: 7px 12px; border-radius: 20px; color: var(--blue); background: var(--ice); font-weight: 800; }
.filter-grid { display: grid; grid-template-columns: repeat(6,minmax(130px,1fr)); gap: 12px; margin-bottom: 16px; }
.analytics-filter-heading { margin-bottom: 14px; }
.analytics-filter-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.analytics-filter-actions .button { min-height: 36px; padding: 7px 12px; }
.analytics-filter-priority { display: grid; grid-template-columns: minmax(250px,.72fr) minmax(0,2fr); gap: 12px; margin-bottom: 12px; }
.analytics-manager-filter { align-content: start; padding: 14px; border: 2px solid var(--blue); border-radius: 12px; color: var(--navy); background: linear-gradient(145deg,var(--ice),white); box-shadow: 0 8px 22px rgba(29,111,138,.1); }
.analytics-manager-filter > span { font-size: .84rem; font-weight: 900; }
.analytics-manager-filter select { border-color: var(--blue); color: var(--navy); font-weight: 900; box-shadow: 0 0 0 3px rgba(29,111,138,.08); }
.analytics-manager-filter small { color: var(--muted); font-size: .7rem; line-height: 1.35; }
.analytics-filter-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.analytics-filter-group { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfc; }
.analytics-filter-group-title { margin: 0 0 10px; color: var(--navy); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.analytics-filter-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); gap: 10px; }
.analytics-period-grid { grid-template-columns: repeat(3,minmax(145px,1fr)); }
.analytics-filters .active-filters { margin: 12px 0; }
.analytics-status-filters { padding-top: 12px; border-top: 1px solid var(--line); }
.filter-help { position: relative; }
.filter-help::after { content: attr(data-filter-help); position: absolute; top: calc(100% + 8px); left: 0; z-index: 80; width: max-content; max-width: min(320px,calc(100vw - 32px)); padding: 9px 11px; border-radius: 8px; color: white; background: var(--navy); box-shadow: 0 10px 28px rgba(9,25,36,.24); font-size: .74rem; font-weight: 700; line-height: 1.4; text-align: left; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .12s ease,transform .12s ease,visibility .12s ease; pointer-events: none; }
.filter-help:hover,.filter-help:focus,.filter-help:focus-within { z-index: 79; }
.filter-help:hover::after,.filter-help:focus::after,.filter-help:focus-within::after { opacity: 1; visibility: visible; transform: translateY(0); }
.chart-metric-control.filter-help::after { right: 0; left: auto; }
.status-chip.filter-help::after,.status-kpi.filter-help::after { left: 50%; transform: translate(-50%,-4px); }
.status-chip.filter-help:hover::after,.status-chip.filter-help:focus::after,.status-kpi.filter-help:hover::after,.status-kpi.filter-help:focus::after { transform: translate(-50%,0); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -2px 0 16px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); background: #f8fbfc; font-size: .84rem; }
.active-filters.has-filters { color: var(--ink); border-color: #b8d7df; background: var(--ice); }
.active-filters strong { margin-right: 2px; }
.active-filters span { padding: 4px 8px; border-radius: 999px; background: white; color: var(--blue); font-weight: 800; }
.status-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: white; cursor: pointer; font-size: .8rem; }.status-chip.active { color: white; background: var(--blue); border-color: var(--blue); }
.kpi-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }.kpi,.status-kpi { padding: 16px; border-radius: 14px; background: white; border: 1px solid var(--line); }.kpi strong,.status-kpi strong { display: block; margin-top: 8px; font-size: 1.45rem; }.kpi span,.status-kpi span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.status-kpi-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }.status-kpi { cursor: pointer; border-left: 5px solid var(--blue); }.status-kpi small { color: var(--muted); }
.order-cycle-section .section-heading,.status-summary-section .section-heading { margin-bottom: 8px; }
.order-cycle-kpi-grid { display: grid; grid-template-columns: minmax(260px,420px); }
.order-cycle-kpi-grid .kpi { padding: 14px 16px; border-left: 5px solid var(--green); border-radius: 11px; }
.order-cycle-kpi-grid .kpi strong { margin-top: 5px; }
.status-kpi-grid.compact { grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 7px; }
.status-kpi-grid.compact .status-kpi { min-height: 72px; padding: 9px 11px; border-left-width: 4px; border-radius: 9px; }
.status-kpi-grid.compact .status-kpi span { font-size: .68rem; line-height: 1.2; }
.status-kpi-grid.compact .status-kpi strong { margin-top: 4px; font-size: 1.08rem; line-height: 1; }
.status-kpi-grid.compact .status-kpi small { font-size: .69rem; }
.chart-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }.chart-card { min-height: 350px; }.chart-card canvas { max-height: 290px; }.chart-card.wide { grid-column: 1/-1; }
.chart-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.chart-card-head h2 { margin: 0; }
.chart-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.chart-metric-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; font-weight: 800; }
.chart-metric-control select { width: auto; min-width: 190px; min-height: 34px; padding: 5px 30px 5px 9px; font-size: .78rem; font-weight: 800; }
.chart-expand { width: 34px; min-height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--blue); background: var(--ice); cursor: pointer; font-size: 1rem; font-weight: 900; }
.chart-expand:hover { color: white; background: var(--blue); border-color: var(--blue); }
.chart-expand-dialog { width: min(1500px,calc(100% - 24px)); max-height: 94vh; overflow: hidden; }
.chart-expand-canvas-wrap { height: min(72vh,780px); min-height: 520px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chart-expand-stage { position: relative; width: 100%; min-height: 520px; }
.chart-expand-stage canvas { width: 100% !important; height: 100% !important; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.table-wrap { overflow: auto; max-height: 650px; } table { width: 100%; border-collapse: collapse; font-size: .82rem; } th { position: sticky; top: 0; z-index: 2; padding: 11px 9px; text-align: left; color: white; background: var(--navy); cursor: pointer; white-space: nowrap; } td { padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: top; } tbody tr:hover { background: var(--ice); }.numeric { text-align: right; white-space: nowrap; }.quote-link { border: 0; padding: 0; color: var(--blue); background: none; cursor: pointer; font-weight: 800; }.tag { display: inline-block; padding: 3px 6px; margin: 1px; border-radius: 6px; color: #31505f; background: #eaf1f3; font-size: .7rem; }
.workspace-shell { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 18px; align-items: start; }
.quote-workspace { grid-template-columns: 250px minmax(0,1fr); }
.workspace-sidebar,.workspace-main,.workspace-detail { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.workspace-sidebar { position: sticky; top: 16px; display: grid; gap: 12px; padding: 16px; }
.workspace-sidebar-head,.workspace-toolbar,.detail-head,.detail-block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.quote-workspace .workspace-sidebar-head { align-items: flex-start; flex-direction: column; gap: 8px; }
.quote-workspace .workspace-sidebar-head .mini-button { align-self: flex-start; }
.workspace-sidebar-head h2,.workspace-toolbar h2,.detail-head h2 { margin: 0; }
.workspace-main { display: grid; gap: 14px; padding: 0 0 16px; overflow: hidden; }
.workspace-toolbar { padding: 16px; border-bottom: 1px solid var(--line); background: #fbfdfe; }
.workspace-actions,.detail-actions,.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.workspace-table-wrap { max-height: 500px; margin: 0 16px; border: 1px solid var(--line); border-radius: 8px; }
.quote-table-resize-shell { margin: 0 16px; }
.quote-table-resize-shell .workspace-table-wrap { height: 500px; min-height: 240px; max-height: none; margin: 0; }
.quote-table-resize-handle { display: flex; align-items: center; justify-content: center; width: 100%; height: 16px; padding: 0; border: 0; border-radius: 0 0 6px 6px; color: var(--blue); background: transparent; cursor: ns-resize; touch-action: none; }
.quote-table-resize-handle span,.quote-table-resize-handle span::before,.quote-table-resize-handle span::after { display: block; width: 44px; height: 2px; border-radius: 2px; background: currentColor; }
.quote-table-resize-handle span { position: relative; opacity: .55; }
.quote-table-resize-handle span::before,.quote-table-resize-handle span::after { content: ""; position: absolute; left: 0; }
.quote-table-resize-handle span::before { top: -4px; }
.quote-table-resize-handle span::after { top: 4px; }
.quote-table-resize-handle:hover,.quote-table-resize-handle:focus-visible { background: #eaf4f6; outline: none; }
.is-resizing-quote-table,.is-resizing-quote-table * { cursor: ns-resize !important; user-select: none !important; }
.workspace-table-wrap table { min-width: 1120px; }
.quote-workspace .workspace-table-wrap { overflow-x: hidden; }
.quote-workspace .workspace-table-wrap table { width: 100%; min-width: 0; table-layout: fixed; font-size: .74rem; }
.quote-workspace .workspace-table-wrap th,.quote-workspace .workspace-table-wrap td { padding: 7px 6px; white-space: normal; overflow-wrap: normal; word-break: normal; vertical-align: top; }
.quote-workspace .workspace-table-wrap th { font-size: .7rem; line-height: 1.12; }
.quote-workspace .workspace-table-wrap th:nth-child(1),.quote-workspace .workspace-table-wrap td:nth-child(1) { width: 30px; text-align: center; }
.quote-workspace .workspace-table-wrap th:nth-child(2),.quote-workspace .workspace-table-wrap td:nth-child(2) { width: 88px; white-space: nowrap; }
.quote-workspace .workspace-table-wrap th:nth-child(3),.quote-workspace .workspace-table-wrap td:nth-child(3) { width: 78px; }
.quote-workspace .workspace-table-wrap th:nth-child(4),.quote-workspace .workspace-table-wrap td:nth-child(4) { width: 230px; }
.quote-workspace .workspace-table-wrap th:nth-child(5),.quote-workspace .workspace-table-wrap td:nth-child(5) { width: 124px; }
.quote-workspace .workspace-table-wrap th:nth-child(6),.quote-workspace .workspace-table-wrap td:nth-child(6) { width: 32px; }
.quote-workspace .workspace-table-wrap th:nth-child(7),.quote-workspace .workspace-table-wrap td:nth-child(7) { width: 100px; }
.quote-workspace .workspace-table-wrap th:nth-child(8),.quote-workspace .workspace-table-wrap td:nth-child(8) { width: 164px; }
.quote-workspace .workspace-table-wrap th:nth-child(9),.quote-workspace .workspace-table-wrap td:nth-child(9) { width: 98px; }
.quote-workspace .workspace-table-wrap th:nth-child(10),.quote-workspace .workspace-table-wrap td:nth-child(10) { width: 96px; }
.quote-workspace .workspace-table-wrap th:nth-child(11),.quote-workspace .workspace-table-wrap td:nth-child(11),
.quote-workspace .workspace-table-wrap th:nth-child(12),.quote-workspace .workspace-table-wrap td:nth-child(12) { width: 54px; }
.quote-workspace .workspace-table-wrap td.numeric { white-space: nowrap; }
.quote-workspace .workspace-table-wrap th:nth-child(13),.quote-workspace .workspace-table-wrap td:nth-child(13) { width: 58px; white-space: nowrap; }
.quote-workspace .workspace-table-wrap th:nth-child(14),.quote-workspace .workspace-table-wrap td:nth-child(14) { width: 50px; }
.quote-workspace .workspace-table-wrap th:nth-child(15),.quote-workspace .workspace-table-wrap td:nth-child(15) { width: 142px; }
.quote-administration-workspace .workspace-table-wrap th:nth-child(15),.quote-administration-workspace .workspace-table-wrap td:nth-child(15) { width: 142px; }
.quote-administration-totals { position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: minmax(140px,1.3fr) repeat(5,minmax(92px,1fr)); gap: 8px; align-items: stretch; margin: -6px 16px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #f7fafb; box-shadow: 0 -8px 18px rgba(21,50,75,.08); }
.quote-administration-totals > div { min-width: 0; display: grid; gap: 3px; align-content: center; padding: 6px 8px; border-radius: 7px; background: white; }
.quote-administration-totals span { color: var(--muted); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.quote-administration-totals strong { font-size: .84rem; overflow-wrap: anywhere; }
.quote-administration-total-label { color: var(--blue); font-weight: 900; }
.deleted-quotes-workspace { grid-template-columns: minmax(0,1fr); }
.deleted-quotes-workspace .workspace-table-wrap th:nth-child(1),.deleted-quotes-workspace .workspace-table-wrap td:nth-child(1) { width: 140px; }
.deleted-quotes-workspace .workspace-table-wrap th:nth-child(2),.deleted-quotes-workspace .workspace-table-wrap td:nth-child(2) { width: 100px; }
.deleted-quotes-workspace .workspace-table-wrap th:nth-child(5),.deleted-quotes-workspace .workspace-table-wrap td:nth-child(5) { width: auto; }
.deleted-quotes-workspace .workspace-table-wrap th:nth-child(7),.deleted-quotes-workspace .workspace-table-wrap td:nth-child(7) { width: 100px; }
.deleted-quotes-workspace .workspace-table-wrap th:nth-child(8),.deleted-quotes-workspace .workspace-table-wrap td:nth-child(8) { width: 110px; }
.workspace-table-wrap th { background: #25465f; }
.selected-row { background: #e9f6f8; box-shadow: inset 4px 0 0 var(--blue); }
.quote-has-note { background: #fff8e8; box-shadow: inset 4px 0 0 var(--amber); }
.quote-has-note:hover { background: #fff1cd; }
.quote-status-inline { min-height: 32px; padding: 5px 2px 5px 9px; border-color: color-mix(in srgb, var(--quote-status-color,#7d8790) 46%, #cbd8dd); border-radius: 7px; color: #16313c; background: color-mix(in srgb, var(--quote-status-color,#7d8790) 14%, white); box-shadow: inset 4px 0 0 var(--quote-status-color,#7d8790); font-size: .66rem; font-weight: 900; line-height: 1.12; }
.quote-status-cell { display: grid; gap: 4px; }
.quote-status-cell .mini-button { min-height: 22px; padding: 3px 5px; font-size: .62rem; }
.quote-status-date { width: 100%; min-width: 0; min-height: 32px; padding: 5px 3px; border-radius: 7px; font-size: .66rem; font-weight: 800; }
.quote-status-date::-webkit-calendar-picker-indicator { width: 12px; height: 12px; margin: 0; padding: 0; }
.mini-icon-button { width: 26px; height: 26px; padding: 0; border: 1px solid #cbd8dd; border-radius: 7px; color: var(--blue); background: white; cursor: pointer; font-weight: 900; }
.quote-expanded-row td { padding: 0 !important; background: #fbfdfe; }
.quote-expanded-lines { display: grid; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--blue); }
.quote-expanded-title { margin: 0; line-height: 1.2; }
.quote-expanded-lines .detail-lines-wrap { max-height: 260px; }
.quote-expanded-lines table { table-layout: auto !important; min-width: 1040px !important; }
.quote-expanded-lines th,.quote-expanded-lines td { width: auto !important; text-align: left; }
.quote-expanded-lines .numeric { text-align: right; }
.quote-expanded-quantity small { display: block; margin-top: 2px; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: lowercase; }
.quote-expanded-lines td small { display: block; margin-top: 2px; color: var(--muted); font-size: .68rem; font-weight: 800; }
.quote-expanded-more,.muted-text { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 800; }
.workspace-detail { display: grid; gap: 14px; margin: 0 16px; padding: 16px; }
.workspace-detail.empty { min-height: 220px; place-items: center; text-align: center; }
.account-shell { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(320px,.85fr); gap: 18px; align-items: start; }
.account-panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.account-profile-panel form,.account-panel form { display: grid; gap: 16px; }
.account-profile-head { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 18px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.account-profile-head h2 { margin: 0; font-size: 1.45rem; }
.account-profile-head p { margin: 4px 0 0; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.account-avatar-editor { width: max-content; display: inline-grid; gap: 8px; cursor: pointer; }
.account-avatar-editor input { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; }
.account-form-grid { display: grid; grid-template-columns: minmax(220px,1fr) 140px minmax(140px,.6fr); gap: 12px; align-items: end; }
.account-theme-picker { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--theme-soft,#f5fafb); }
.account-theme-picker h3 { margin: 0; font-size: 1rem; }
.theme-swatches { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.theme-swatch,.theme-custom { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; }
.theme-swatch { border: 3px solid white; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.theme-swatch.active { box-shadow: 0 0 0 3px var(--ink); }
.theme-custom { position: relative; display: block; overflow: hidden; border: 2px dashed var(--muted); background: conic-gradient(#d44,#dc4,#4a6,#39c,#75b,#d44); cursor: pointer; }
.theme-custom input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.split-actions { justify-content: space-between; }
.system-errors-panel { display: grid; gap: 14px; }
.admin-home { display: grid; gap: 16px; }
.admin-hero,.admin-panel,.admin-kpi { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.admin-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: end; padding: clamp(22px,4vw,34px); background: linear-gradient(135deg,#ffffff 0%,#edf7f8 58%,#fff7ea 100%); border-top: 5px solid var(--blue); }
.admin-hero h2 { max-width: 760px; margin: 0; font-size: clamp(1.55rem,2.7vw,2.35rem); line-height: 1.08; }
.admin-lead { max-width: 680px; margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.admin-kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.admin-kpi { min-height: 112px; display: grid; gap: 7px; align-content: start; padding: 15px; border-top: 5px solid var(--accent,var(--blue)); }
.admin-kpi span,.admin-summary-item span { color: var(--muted); font-size: .76rem; font-weight: 800; }
.admin-kpi strong { display: block; font-size: 1.55rem; line-height: 1.05; overflow-wrap: anywhere; }
.admin-kpi small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.admin-home-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.admin-panel { overflow: hidden; }
.admin-panel.wide { grid-column: 1/-1; }
.admin-panel header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: #fbfdfe; }
.admin-panel h2 { margin: 0; font-size: 1.12rem; }
.admin-summary-list { display: grid; }
.admin-summary-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--blue); }
.admin-summary-item:last-child { border-bottom: 0; }
.admin-summary-item strong { overflow-wrap: anywhere; }
.admin-summary-item span { text-align: right; }
.admin-summary-security { box-shadow: inset 4px 0 0 var(--green); }
.admin-summary-settings { box-shadow: inset 4px 0 0 var(--amber); }
.admin-summary-quotes { box-shadow: inset 4px 0 0 var(--navy); }
.admin-summary-chats { box-shadow: inset 4px 0 0 var(--cyan); }
.admin-summary-errors { box-shadow: inset 4px 0 0 var(--red); }
.system-error-kpis { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.system-error-kpi { min-width: 0; padding: 14px; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 8px; background: #fbfdfe; }
.system-error-kpi-error { border-top-color: var(--red); }
.system-error-kpi-warning { border-top-color: var(--amber); }
.system-error-kpi-server { border-top-color: var(--navy); }
.system-error-kpi-client { border-top-color: var(--green); }
.system-error-kpi span { color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.system-error-kpi strong { display: block; margin-top: 6px; font-size: 1.45rem; }
.system-error-kpi small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.system-error-filters { grid-template-columns: minmax(260px,1fr) 170px 190px; margin-bottom: 0; }
.system-error-table-wrap table { min-width: 1180px; }
#systemErrorsTable td small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
#systemErrorsTable code { display: inline-block; max-width: 150px; overflow-wrap: anywhere; font-size: .76rem; }
.system-error-level { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; font-size: .72rem; font-weight: 900; white-space: nowrap; }
.system-error-level.level-error { color: #8d2429; background: #fdecee; }
.system-error-level.level-warning { color: #7a4d0b; background: #fff2d8; }
.system-error-dialog .detail-head { padding-right: 34px; }
.system-error-detail-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.system-error-request { margin: 0; overflow-wrap: anywhere; color: var(--muted); font-weight: 800; }
.workspace-empty { max-width: 560px; color: var(--muted); }
.workspace-empty h2 { color: var(--ink); font-size: 1.2rem; }
.detail-head { align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.detail-head p { margin: 5px 0 0; color: var(--muted); }
.quote-detail-toolbar { flex: 0 0 auto; }
.quote-detail-toolbar .button { min-height: 36px; padding: 8px 12px; }
.workspace-mini-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.workspace-mini-kpis article,.detail-grid article { min-width: 0; padding: 12px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fbfdfe; }
.workspace-mini-kpis span,.detail-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.workspace-mini-kpis strong,.detail-grid strong { display: block; overflow-wrap: anywhere; }
.workspace-mini-kpis small { color: var(--muted); font-size: .74rem; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.detail-grid.compact { grid-template-columns: repeat(3,minmax(0,1fr)); }
.quote-detail-box-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 12px; }
.quote-detail-box { min-width: 0; display: grid; gap: 10px; align-content: start; padding: 15px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fbfdfe; box-shadow: inset 4px 0 0 var(--blue); }
.quote-detail-box h3,.quote-detail-box p { margin: 0; }
.quote-detail-box p:not(.eyebrow),.quote-detail-box small { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.box-general,.box-customer,.box-status,.box-related { grid-column: span 6; }
.box-total,.box-cost,.box-margin { grid-column: span 4; }
.box-customer { box-shadow: inset 4px 0 0 var(--green); background: #f3fbf7; }
.box-total { box-shadow: inset 4px 0 0 var(--blue); background: #f2f9fb; }
.box-cost { box-shadow: inset 4px 0 0 #6a7680; background: #f6f8f9; }
.box-margin { box-shadow: inset 4px 0 0 var(--amber); background: #fff8e8; }
.box-status { box-shadow: inset 4px 0 0 #6f8b44; background: #f7fbf1; }
.box-related { box-shadow: inset 4px 0 0 var(--navy); }
.quote-big-number { display: block; color: var(--ink); font-size: clamp(1.25rem,2.5vw,1.9rem); line-height: 1.05; }
.quote-inline-link { display: inline; padding: 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; font: inherit; font-weight: 900; text-align: left; }
.quote-inline-link:hover { text-decoration: underline; }
.quote-copy-products { display: grid; gap: 10px; padding: 12px; border: 1px dashed #cbd8dd; border-radius: 8px; background: #fbfdfe; }
.quote-copy-filter-tools { display: grid; grid-template-columns: minmax(220px,1.5fr) repeat(4,minmax(130px,1fr)) auto auto; gap: 9px; align-items: end; padding: 10px; border: 1px solid #dce7eb; border-radius: 8px; background: white; }
.quote-copy-filter-tools > * { min-width: 0; }
.quote-copy-filter-tools label { display: grid; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 900; }
.quote-copy-filter-tools input,.quote-copy-filter-tools select { min-height: 38px; }
.quote-copy-filter-summary { min-height: 38px; display: flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid #dce7eb; border-radius: 7px; color: var(--muted); background: #f5f9fa; white-space: nowrap; font-size: .72rem; font-weight: 800; }
.quote-copy-filter-summary strong { color: var(--blue); font-size: 1rem; }
.quote-copy-filter-tools [data-copy-filter-reset] { min-height: 38px; white-space: nowrap; }
@media (max-width:1100px){.quote-copy-filter-tools{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}.quote-copy-filter-summary,.quote-copy-filter-tools [data-copy-filter-reset]{align-self:end}}
.quote-status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--quote-status-color,#7d8790) 46%, white); border-radius: 999px; color: #122a34; background: color-mix(in srgb, var(--quote-status-color,#7d8790) 17%, white); font-size: .74rem; font-weight: 900; line-height: 1.15; }
.quote-status-pill.compact { min-height: 24px; padding: 4px 8px; font-size: .68rem; }
.quote-timeline-block { padding: 14px; border: 1px solid #dce8ed; border-radius: 8px; background: linear-gradient(135deg,#fbfdfe,#f4f9fb); }
.quote-timeline { display: grid; gap: 10px; }
.quote-timeline article { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 10px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--quote-status-color,#7d8790) 30%, #dfe8ec); border-radius: 8px; background: color-mix(in srgb, var(--quote-status-color,#7d8790) 9%, white); box-shadow: inset 4px 0 0 var(--quote-status-color,#7d8790); }
.quote-timeline-dot { width: 12px; height: 12px; margin-top: 4px; border: 3px solid white; border-radius: 999px; background: var(--quote-status-color,#7d8790); box-shadow: 0 0 0 1px color-mix(in srgb, var(--quote-status-color,#7d8790) 55%, #cbd8dd); }
.quote-timeline-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.quote-timeline p,.quote-timeline small { margin: 3px 0 0; overflow-wrap: anywhere; }
.quote-timeline small { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; }
.detail-block { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.detail-block h3 { margin: 0; font-size: 1rem; }
.detail-lines-wrap { max-height: 340px; border: 1px solid var(--line); border-radius: 8px; }
.detail-lines-wrap table { min-width: 980px; }
.draft-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.report-sheet { display: grid; gap: 8px; padding: 18px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fff; }
.report-sheet h3,.report-sheet h4,.report-sheet p { margin: 0; }
.report-sheet ol { margin: 4px 0 0; padding-left: 22px; }
.client-workspace { grid-template-columns: 290px minmax(0,1fr); }
.client-map-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 14px; padding: 0 16px 16px; }
.client-map-panel,.client-map-results { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.client-map-canvas { width: 100%; height: min(68vh,720px); min-height: 620px; background: #dce9eb; }
.client-map-results { max-height: min(68vh,720px); overflow: auto; }
.client-map-list { display: grid; }
.client-map-item { display: grid; gap: 7px; padding: 12px; border-bottom: 1px solid var(--line); background: white; box-shadow: inset 4px 0 0 #ccdce2; }
.client-map-item:last-child { border-bottom: 0; }
.client-map-item.mapped { box-shadow: inset 4px 0 0 var(--green); }
.client-map-item.active { background: #fff5f4; box-shadow: inset 4px 0 0 #d73b2f; }
.client-map-item-head { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.client-map-item-head .quote-link { flex: 1 1 auto; min-width: 0; text-align: left; }
.client-map-item small { color: var(--muted); font-size: .76rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.client-map-phone { display: inline-flex; align-items: center; justify-content: center; flex: 0 1 auto; max-width: 148px; min-height: 24px; padding: 3px 7px; border-radius: 999px; color: #0d4f63; background: #e8f7fb; border: 1px solid #cce7ee; font-size: .72rem; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.client-map-item.active .client-map-phone { color: #9f1f18; background: #ffe8e5; border-color: #f3b4ae; }
.client-map-status { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 8px; border-radius: 999px; color: #17624d; background: #e6f4ef; font-size: .72rem; font-weight: 900; }
.client-map-empty { padding: 18px; }
.client-map-fallback { height: 100%; min-height: 420px; display: grid; place-content: center; gap: 6px; color: var(--muted); text-align: center; }
.client-map-fallback strong { color: var(--ink); }
.client-map-popup { display: grid; gap: 7px; min-width: 190px; }
.client-map-popup strong,.client-map-popup span { display: block; overflow-wrap: anywhere; }
.client-map-popup span { color: var(--muted); font-size: .78rem; font-weight: 800; }
.client-map-popup .client-map-phone { display: inline-flex; justify-self: start; max-width: none; color: #0d4f63; background: #e8f7fb; border-color: #cce7ee; }
.client-map-marker { position: relative; width: 30px !important; height: 42px !important; margin-left: -15px !important; margin-top: -38px !important; background: transparent; }
.client-map-marker::before { content: ""; position: absolute; left: 4px; top: 1px; width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #0d7188; box-shadow: 0 4px 13px rgba(22,43,58,.32); transform: rotate(-45deg); }
.client-map-marker::after { content: ""; position: absolute; left: 8px; top: 5px; width: 10px; height: 10px; border: 2px solid rgba(255,255,255,.88); border-radius: 999px; background: rgba(255,255,255,.36); box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.client-map-marker span { position: absolute; left: 11px; bottom: 1px; width: 8px; height: 8px; border-radius: 999px; background: rgba(22,43,58,.22); filter: blur(1px); }
.client-map-marker.selected { z-index: 600 !important; }
.client-map-marker.selected::before { background: #d73b2f; box-shadow: 0 0 0 4px rgba(215,59,47,.2), 0 5px 15px rgba(98,23,17,.36); }
.leaflet-container { font: inherit; }
.client-directory-table-wrap,.contact-directory-table-wrap { overflow-x: hidden; }
.client-directory-table-wrap table,.contact-directory-table-wrap table { width: 100%; table-layout: fixed; }
.client-directory-table-wrap th,.client-directory-table-wrap td,
.contact-directory-table-wrap th,.contact-directory-table-wrap td { overflow-wrap: anywhere; }
.supplier-directory-table-wrap table { min-width: 1080px; table-layout: fixed; }
.supplier-directory-table-wrap th,.supplier-directory-table-wrap td { overflow-wrap: anywhere; }
.supplier-price-list-list { display: grid; gap: 8px; }
.supplier-price-list-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fbfdfe; }
.supplier-price-list-file { min-width: 0; }
.supplier-price-list-file strong { display: block; overflow-wrap: anywhere; }
.supplier-price-list-file small { display: block; margin-top: 4px; color: var(--muted); font-size: .74rem; font-weight: 800; }
.supplier-price-list-dialog { width: min(760px,calc(100% - 24px)); }
.supplier-price-list-upload { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; margin-top: 12px; }
.supplier-price-list-upload label { min-width: 0; }
#clientDirectoryTable th:nth-child(2),#clientDirectoryTable td:nth-child(2) { width: 82px; }
#clientDirectoryTable th:nth-child(3),#clientDirectoryTable td:nth-child(3) { width: 160px; }
#clientDirectoryTable th:nth-child(5),#clientDirectoryTable td:nth-child(5) { width: 62px; }
#clientDirectoryTable th:nth-child(7),#clientDirectoryTable td:nth-child(7),
#clientDirectoryTable th:nth-child(8),#clientDirectoryTable td:nth-child(8) { width: 112px; }
#clientDirectoryTable th:nth-child(9),#clientDirectoryTable td:nth-child(9),
#clientDirectoryTable th:nth-child(10),#clientDirectoryTable td:nth-child(10) { width: 70px; }
#clientDirectoryTable th:last-child,#clientDirectoryTable td:last-child { width: 180px; }
#contactDirectoryTable th:nth-child(4),#contactDirectoryTable td:nth-child(4) { width: 115px; }
#contactDirectoryTable th:nth-child(5),#contactDirectoryTable td:nth-child(5) { width: 90px; }
#contactDirectoryTable th:last-child,#contactDirectoryTable td:last-child { width: 150px; }
.client-domain-chip { display: inline-flex; max-width: 100%; padding: 4px 7px; border-radius: 999px; color: #31505f; background: #eaf1f3; font-size: .72rem; font-weight: 900; overflow-wrap: anywhere; }
.client-directory-pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 0 16px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.client-email-list { display: flex; flex-wrap: wrap; gap: 8px; }
.client-email-list span { display: inline-flex; gap: 7px; align-items: center; max-width: 100%; padding: 7px 9px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fbfdfe; font-size: .78rem; font-weight: 800; }
.client-email-list a { overflow-wrap: anywhere; }
.client-location-form { margin-top: 0; }
.client-location-form small { color: var(--muted); font-size: .74rem; font-weight: 800; }
.client-location-grid { display: grid; grid-template-columns: minmax(220px,1.4fr) 90px minmax(160px,1fr) 90px minmax(120px,.8fr); gap: 10px; align-items: end; }
.client-contact-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.client-contact-list article { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-width: 0; padding: 12px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fbfdfe; }
.client-contact-list strong,.client-contact-list small { display: block; overflow-wrap: anywhere; }
.client-contact-list small { margin-top: 4px; color: var(--muted); font-size: .74rem; font-weight: 800; }
.client-quote-list { display: grid; gap: 8px; }
.client-quote-item { display: grid; grid-template-columns: minmax(105px,.65fr) minmax(190px,2fr) minmax(120px,.9fr) minmax(90px,.65fr); align-items: center; gap: 12px; min-width: 0; padding: 11px 12px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fbfdfe; }
.client-quote-identity,.client-quote-subject { min-width: 0; }
.client-quote-identity small,.client-quote-subject small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; overflow-wrap: anywhere; }
.client-quote-subject strong { display: block; overflow-wrap: anywhere; }
.client-quote-total { text-align: right; white-space: nowrap; }
dialog { width: min(1050px,calc(100% - 30px)); max-height: 85vh; border: 0; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.3); } dialog:not([open]) { display: none !important; pointer-events: none !important; } dialog::backdrop { background: rgba(9,25,36,.62); }.dialog-close { float: right; border: 0; background: none; cursor: pointer; font-size: 2rem; }
.workspace-dialog { width: min(1540px,calc(100% - 24px)); max-height: 94vh; padding: 18px; overflow: auto; }
.workspace-dialog .workspace-detail { margin: 0; box-shadow: none; }
.unsaved-changes-dialog { width: min(520px,calc(100% - 28px)); padding: 24px; border-radius: 8px; overflow: visible; }
.unsaved-changes-dialog::backdrop { background: rgba(9,25,36,.68); backdrop-filter: blur(2px); }
.unsaved-changes-content { display: grid; grid-template-columns: 54px 1fr; gap: 16px; align-items: start; }
.unsaved-changes-content h2 { margin: 3px 0 7px; font-size: 1.2rem; letter-spacing: 0; }
.unsaved-changes-content p:last-child { margin: 0; color: var(--muted); }
.unsaved-changes-symbol { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #7b5200; background: #fff0bd; border: 1px solid #e7c56c; font-size: 1.45rem; font-weight: 900; }
.unsaved-changes-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width:560px) { .unsaved-changes-actions { flex-direction: column; } .unsaved-changes-actions .button { width: 100%; } }
.quote-global-markup-control { display: grid; gap: 8px; margin: 8px 0; }
.quote-global-markup-control label { display: grid; gap: 5px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.quote-global-markup-control input { min-height: 38px; font-size: 1rem; font-weight: 900; color: var(--navy); }
.quote-global-markup-control .button { width: 100%; }
.quote-customer-dialog { width: min(1040px,calc(100% - 24px)); }
.quote-customer-switch-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.quote-small-dialog { width: min(720px,calc(100% - 24px)); }
.quote-danger-zone { display: flex; justify-content: flex-end; margin-top: 18px; padding: 14px 0 2px; border-top: 1px solid #e9c9cc; }
.quote-delete-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.draft-attachment-field small { display: block; margin-top: 6px; color: var(--muted); font-weight: 700; }
.quote-report-dialog { position: relative; width: min(620px,calc(100% - 32px)); padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: white; overflow: visible; }
.quote-report-dialog .dialog-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; float: none; border-radius: 999px; color: var(--muted); background: #f4f7f8; font-size: 1.35rem; line-height: 1; }
.quote-report-dialog .dialog-close:hover { color: var(--blue); background: var(--ice); }
.quote-report-form { display: grid; gap: 14px; background: white; }
.quote-report-head { padding: 0 42px 14px 0; border-bottom: 1px solid var(--line); }
.quote-report-head h2 { margin: 0; font-size: 1.2rem; }
.quote-report-head p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.quote-report-body { display: grid; gap: 12px; padding: 0; background: white; }
.quote-report-options { display: grid; gap: 8px; align-items: start; }
.quote-report-options > span { color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.quote-report-options strong,.required-note { color: #9c3035; }
.quote-report-choice-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; color: var(--muted); font-size: .84rem; }
.quote-report-choice-list label { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #dce6ea; border-radius: 8px; color: var(--ink); background: #fbfdfe; font-size: .82rem; font-weight: 800; cursor: pointer; }
.quote-report-choice-list label:has(input:checked) { border-color: #9dc7d2; color: var(--blue); background: var(--ice); box-shadow: inset 4px 0 0 var(--blue); }
.quote-report-choice-list input { width: 15px; min-height: 15px; padding: 0; accent-color: #1d6f8a; }
.quote-report-ready { margin: 0; padding: 11px 12px; border: 1px solid #dce6ea; border-radius: 8px; color: var(--muted); background: #fbfdfe; font-size: .84rem; line-height: 1.35; }
.quote-report-ready strong { color: var(--blue); }
.quote-report-form .message.compact { margin: 0; }
.required-note { margin: 0; font-size: .82rem; font-weight: 900; }
.quote-report-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.quote-report-actions .button { min-width: 84px; }
.ticket-economic-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; color: var(--muted); font-size: .82rem; }
.ticket-economic-summary span { display: grid; gap: 2px; text-align: right; }
.ticket-economic-summary strong { color: var(--ink); font-size: 1rem; }
.ticket-email-attachment { margin-bottom: 12px; }
.quote-form-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px; border: 1px solid #cfe0e6; border-radius: 8px; background: linear-gradient(90deg,#f3fbf7,#f4f7ff 55%,#fff8e8); }
.quote-form-tabs button { min-height: 36px; padding: 7px 11px; border: 1px solid #d6e1e5; border-radius: 7px; color: var(--muted); background: white; cursor: pointer; font-size: .78rem; font-weight: 900; box-shadow: 0 4px 10px rgba(21,50,75,.04); }
.quote-form-tabs button:hover { color: var(--blue); border-color: #a9c9d2; background: var(--ice); }
.quote-form-tabs button.quote-tab-main { color: var(--blue); border-color: #b9d4dd; background: #eef7fa; }
.quote-form-tabs button.quote-tab-data { color: #345f1c; border-color: #cfe3bf; background: #f1f8eb; }
.quote-form-tabs button.quote-tab-work { color: #0d5063; border-color: #c6dde4; background: #edf6f8; }
.quote-form-tabs button.quote-tab-output { color: #5c4307; border-color: #ead197; background: #fff7df; }
.quote-form-tabs button.quote-tab-internal { color: #4e5e68; border-color: #cad5da; background: #f0f4f5; }
.quote-form-tabs button.active { color: white; border-color: var(--blue); background: var(--blue); }
.quote-form-tabs button.quote-tab-data.active { border-color: #6f8b44; background: #6f8b44; }
.quote-form-tabs button.quote-tab-work.active { border-color: var(--blue); background: var(--blue); }
.quote-form-tabs button.quote-tab-output.active { color: #201600; border-color: #e1b94f; background: #f3cf78; }
.quote-form-tabs button.quote-tab-internal.active { color: white; border-color: #667985; background: #667985; }
.quote-tab-panel { display: none; }
.quote-tab-panel.active { display: grid; gap: 12px; }
.quote-note-tools { display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: 8px; align-items: end; }
.dual-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readonly-field { min-width: 0; padding: 12px; border: 1px solid #dfe8ec; border-radius: 8px; background: #fbfdfe; }
.readonly-field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.readonly-field strong { display: block; color: var(--ink); }
.detail-block textarea { width: 100%; resize: vertical; min-height: 120px; padding: 9px 11px; border: 1px solid #cbd8dd; border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.quote-line-dialog { width: min(1320px,calc(100% - 28px)); padding: 0; }
.quote-line-dialog .dialog-close { position: sticky; top: 8px; right: 12px; z-index: 5; float: right; width: 36px; height: 36px; margin: 8px 10px 0 0; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 4px 12px rgba(21,50,75,.12); font-size: 1.55rem; }
.quote-line-dialog .workspace-detail { padding: 0; }
.quote-line-form { display: grid; gap: 14px; padding-bottom: 18px; background: #fbfcfd; }
.quote-line-topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; min-height: 58px; padding: 14px 22px; color: white; background: #6d73ef; }
.quote-line-topbar h2,.quote-line-topbar p { margin: 0; color: white; }
.quote-line-topbar .eyebrow { opacity: .88; }
.quote-line-topbar strong { font-size: .82rem; white-space: nowrap; }
.quote-line-actions { display: flex; justify-content: center; gap: 8px; padding: 0 22px; }
.quote-line-panel { margin: 0 22px; padding: 18px 20px; border: 1px solid #e4edf1; border-radius: 8px; background: white; box-shadow: 0 12px 30px rgba(21,50,75,.04); }
.quote-line-main-grid { display: grid; grid-template-columns: repeat(3,minmax(180px,1fr)); gap: 12px 14px; align-items: start; }
.quote-line-wide { grid-column: 1 / -1; }
.quote-line-resource-grid { margin: 0 22px; }
.quote-line-image-list .product-attachment-card { cursor: grab; }
.quote-line-image-list .product-attachment-card.is-dragging { opacity: .55; cursor: grabbing; }
.quote-line-main-grid textarea { min-height: 62px; }
.quote-line-economic-grid { display: grid; grid-template-columns: 150px 170px repeat(3,minmax(140px,1fr)); gap: 14px 18px; align-items: start; }
.quote-line-economic-grid fieldset { min-height: 74px; margin: 0; padding: 6px 0 0; border: 0; }
.quote-line-economic-grid legend { margin-bottom: 4px; color: var(--muted); font-size: .74rem; font-weight: 800; }
.radio-line { min-height: 22px; display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: .8rem; font-weight: 700; }
.radio-line input { width: 14px; min-height: 14px; }
.rich-editor { overflow: hidden; border: 1px solid #bdc9cf; border-radius: 7px; background: white; box-shadow: 0 8px 22px rgba(21,50,75,.05); }
.rich-editor-toolbar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border-bottom: 1px solid #dce5e9; background: #f6fafb; }
.rich-editor-group { display: inline-flex; gap: 2px; align-items: center; padding-right: 5px; margin-right: 2px; border-right: 1px solid #d5e0e5; }
.rich-editor-toolbar button,.rich-editor-toolbar select { min-height: 30px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); background: transparent; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.rich-editor-toolbar button { min-width: 32px; padding: 4px 7px; }
.rich-editor-toolbar select { min-width: 130px; padding: 4px 8px; border-color: #d5e0e5; background: white; }
.rich-editor-toolbar button:hover { border-color: #cbd8dd; background: white; }
.rich-editor-toolbar button.active { border-color: var(--blue); color: white; background: var(--blue); }
.rich-editor-surface { min-height: 220px; max-height: 360px; overflow: auto; padding: 16px 15px; color: #102736; background: white; line-height: 1.55; outline: none; }
.rich-editor-surface:focus { box-shadow: inset 0 0 0 2px rgba(29,111,138,.18); }
.rich-editor-surface:empty::before { content: attr(data-placeholder); color: #7d8e98; }
.rich-editor-surface p,.rich-editor-surface ul,.rich-editor-surface ol,.rich-editor-surface blockquote,.rich-editor-surface h3,.rich-editor-surface h4 { margin: 0 0 10px; }
.rich-editor-surface ul,.rich-editor-surface ol { padding-left: 24px; }
.rich-editor-surface blockquote { padding-left: 12px; border-left: 3px solid #8aa9b7; color: #425967; }
.rich-editor-surface table { width: 100%; margin: 8px 0 12px; border-collapse: collapse; table-layout: fixed; }
.rich-editor-surface td,.rich-editor-surface th { min-width: 90px; padding: 7px 8px; border: 1px solid #cbd8dd; }
.rich-editor-surface th { background: #edf4f6; font-weight: 900; }
.rich-editor-surface img { max-width: 100%; height: auto; cursor: pointer; }
.rich-editor-surface img.is-selected { outline: 3px solid var(--blue); outline-offset: 2px; }
.rich-editor-surface hr { border: 0; border-top: 1px solid #cbd8dd; margin: 14px 0; }
.rich-editor-status { padding: 5px 10px; border-top: 1px solid #dce5e9; color: var(--muted); background: #fbfdfe; font-size: .72rem; font-weight: 800; text-align: right; }
.quote-content-line-row { background: #f6fbfc; }
.quote-content-line-preview { display: grid; gap: 5px; min-width: 0; padding: 3px 0; color: var(--ink); }
.quote-content-line-preview > strong { color: var(--blue); }
.quote-content-line-preview p,.quote-content-line-preview h3,.quote-content-line-preview h4 { margin: 0 0 5px; }
.quote-content-line-preview img { display: block; width: auto; max-width: min(260px,100%); max-height: 160px; object-fit: contain; }
.quote-content-line-preview table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.quote-content-line-preview td,.quote-content-line-preview th { padding: 4px 6px; border: 1px solid var(--line); }
.quote-content-line-form .quote-line-panel { display: grid; gap: 14px; }
.quote-content-editor-field { display: grid; gap: 6px; }
.quote-line-drag-handle { width: 31px; min-width: 31px; min-height: 29px; padding: 2px 5px; border: 1px solid #b8ccd4; border-radius: 6px; color: #496875; background: #f5fafb; cursor: grab; font: inherit; font-weight: 900; line-height: 1; }
.quote-line-drag-handle:hover { color: white; border-color: var(--blue); background: var(--blue); }
.quote-line-drag-handle:active { cursor: grabbing; }
[data-quote-line-sortable] [data-quote-line-row] { transition: opacity .12s ease,box-shadow .12s ease,transform .12s ease,background .12s ease; }
[data-quote-line-sortable].is-sorting [data-quote-line-row] { background: #f8fbfc; }
[data-quote-line-sortable] [data-quote-line-row].is-dragging { opacity: .42; background: #dceff4; box-shadow: inset 4px 0 0 var(--blue); }
[data-quote-line-sortable] [data-quote-line-row].is-drag-over { box-shadow: inset 0 3px 0 var(--blue); }
[data-quote-line-sortable].is-saving-order { pointer-events: none; opacity: .72; }
.checkbox-field { min-height: 42px; display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; padding-top: 20px; }
.checkbox-field input[type="checkbox"] { width: 16px; min-height: 16px; margin: 0; }
.product-picker-tools { display: grid; grid-template-columns: minmax(220px,1.5fr) repeat(4,minmax(145px,1fr)); gap: 10px; align-items: end; }
.product-picker-dialog .detail-lines-wrap { max-height: 520px; }
.product-picker-dialog table { min-width: 1120px; }
.product-picker-dialog th:first-child,.product-picker-dialog td:first-child { width: 42px; text-align: center; }
.product-picker-dialog th:last-child,.product-picker-dialog td:last-child { width: 150px; }
.product-picker-dialog input[type="checkbox"] { width: 16px; min-height: 16px; }
.product-file-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.product-preview-image { max-width: min(420px,100%); max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: white; }
.product-image-tag { color: #0f5946; background: #dff4ec; }
.product-image-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 10px; margin-top: 10px; }
.product-image-gallery a { min-width: 0; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); background: #fbfdfe; text-decoration: none; font-size: .74rem; font-weight: 800; }
.product-image-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: contain; border-radius: 6px; background: white; }
.product-image-gallery span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-attachments-block { display: grid; gap: 12px; }
.product-resource-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.product-resource-box { min-width: 0; display: grid; gap: 10px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.product-resource-box legend { padding: 0 6px; color: var(--blue); font-size: .82rem; font-weight: 900; }
.product-attachment-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 12px; }
.product-attachment-card { min-width: 0; display: grid; grid-template-rows: auto minmax(150px,1fr) auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.product-image-sort-card { transition: opacity .12s ease,transform .12s ease,box-shadow .12s ease,border-color .12s ease; }
.product-image-drag-handle { width: 31px; min-width: 31px; min-height: 29px; padding: 2px 5px; border: 1px solid #b8ccd4; border-radius: 6px; color: #496875; background: #f5fafb; cursor: grab; font: inherit; font-weight: 900; line-height: 1; }
.product-image-drag-handle:hover { color: white; border-color: var(--blue); background: var(--blue); }
.product-image-drag-handle:active { cursor: grabbing; }
.product-attachment-list.is-sorting .product-image-sort-card { background: #f8fbfc; }
.product-attachment-list .product-image-sort-card.is-dragging { opacity: .42; border-color: var(--blue); transform: scale(.985); }
.product-attachment-list .product-image-sort-card.is-drag-over { box-shadow: inset 3px 0 0 var(--blue),0 0 0 1px var(--blue); }
.product-attachment-list.is-saving-order { pointer-events: none; opacity: .72; }
.product-attachment-head { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.product-attachment-head > div:first-child { min-width: 0; display: grid; gap: 6px; }
.product-attachment-head strong { overflow-wrap: anywhere; }
.product-attachment-preview { min-height: 150px; display: flex; align-items: center; justify-content: center; padding: 8px; border: 1px solid #dce6ea; border-radius: 7px; background: white; overflow: auto; }
.product-attachment-preview img { display: block; width: auto; height: auto; object-fit: contain; transition: max-width .15s ease,max-height .15s ease; }
.product-image-scale-control { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 800; }
.product-image-scale-control > span { display: grid; grid-template-columns: minmax(0,1fr) 48px; gap: 10px; align-items: center; }
.product-image-scale-control input[type="range"] { width: 100%; min-height: 24px; padding: 0; }
.product-image-scale-control output { color: var(--blue); text-align: right; font-weight: 900; }
.product-image-layout-controls { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 12px; align-items: end; }
.product-image-align-control { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 800; }
.product-image-align-control select { min-height: 34px; }
.product-pdf-card { grid-template-rows: auto; align-content: start; }
.product-attachments-empty { grid-column: 1 / -1; min-height: 90px; }
.dialog-save { float: right; margin: 7px 12px 0 0; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.field-with-action { display: grid; gap: 6px; align-content: start; }
.field-with-action .mini-button { justify-self: start; }
.ticket-selected-contact-list { display: grid; gap: 7px; margin: 8px 0; }
.ticket-selected-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ticket-selected-contact p { margin: 0; }
.quote-client-lookup { position: relative; }
.quote-client-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; max-height: 260px; overflow: auto; padding: 6px; border: 1px solid #cbd8dd; border-radius: 8px; background: white; box-shadow: 0 18px 42px rgba(21,50,75,.18); }
.quote-client-result { width: 100%; display: grid; gap: 3px; padding: 9px 10px; border: 0; border-radius: 7px; color: var(--ink); background: white; text-align: left; cursor: pointer; font-size: .82rem; font-weight: 800; }
.quote-client-result:hover,.quote-client-result:focus { background: var(--ice); outline: 0; }
.quote-client-result span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.quote-client-result.muted,.quote-client-result.error { cursor: default; }
.quote-client-result.error { color: var(--red); }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.muted-tag { color: var(--muted); background: #f0f4f5; }
.google-settings-form { display: grid; gap: 12px; padding: 8px 4px 4px; }
.google-settings-form h2 { margin: 0; font-size: 1.25rem; }
.password-form { display: grid; gap: 12px; padding: 8px 4px 4px; }
.password-form h2 { margin: 0; font-size: 1.25rem; }
.two-factor-status { display: grid; gap: 4px; padding: 12px; border: 1px solid #b8ded4; border-radius: 7px; color: #176b57; background: #effaf6; }
.two-factor-status small { color: var(--muted); line-height: 1.45; }
.tag.success { color: #176b57; background: #dff4ed; }
.mini-button.danger { color: var(--red); border-color: #efc5c8; background: #fff5f5; }
.mini-button.danger.confirming { color: white; border-color: var(--red); background: var(--red); }
.security-policy-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,320px) auto; gap: 16px; align-items: end; margin: 0 0 18px; padding: 16px; border: 1px solid #b8ded4; border-radius: 8px; background: #effaf6; }
.security-policy-form h3 { margin: 0 0 5px; color: var(--navy); }
.security-policy-form p { margin: 0; color: var(--muted); line-height: 1.45; }
.security-policy-form .message { grid-column: 1 / -1; }
@media (max-width: 900px) { .security-policy-form { grid-template-columns: 1fr; align-items: stretch; } }
:root.dark-mode .security-policy-form { border-color: #31515f; background: #0f2028; }
.security-user-form { display: grid; gap: 14px; padding: 8px 4px 4px; }
.security-user-form h2 { margin: 0; font-size: 1.25rem; }
.security-permissions-group { display: grid; gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.security-permissions-group legend { padding: 0 6px; color: var(--navy); font-weight: 900; }
.security-permission-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.security-permission-heading p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.security-admin-notice { margin: 0; padding: 9px 11px; border-radius: 7px; color: #176b57; background: #effaf6; font-size: .8rem; font-weight: 800; }
.security-module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.security-module-checkbox { display: grid; grid-template-columns: 16px minmax(0,1fr); gap: 9px; align-items: start; align-content: start; min-width: 0; min-height: 76px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; }
.security-module-checkbox:has(input:checked) { border-color: #8ccbbb; background: #effaf6; }
.security-module-checkbox > input { width: 16px; min-width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 2px 0 0; border-radius: 4px; accent-color: var(--blue); }
.security-module-checkbox > span { width: 100%; overflow: hidden; overflow-wrap: anywhere; color: var(--ink); }
.security-module-checkbox span,.security-module-checkbox strong,.security-module-checkbox small { display: block; min-width: 0; }
.security-module-checkbox small { margin-top: 3px; color: var(--muted); font-size: .73rem; line-height: 1.3; }
.security-module-checkbox:has(input:disabled) { cursor: not-allowed; opacity: .75; }
@media (max-width: 900px) { .security-module-grid { grid-template-columns: 1fr 1fr; } .security-permission-heading { align-items: stretch; flex-direction: column; } }
@media (max-width: 560px) { .security-module-grid { grid-template-columns: 1fr; } }
:root.dark-mode .security-module-checkbox { background: #0f2028; }
:root.dark-mode .security-module-checkbox:has(input:checked) { border-color: #315f57; background: #102a25; }
.security-color { width: 16px; height: 16px; display: inline-block; margin-right: 8px; border-radius: 50%; vertical-align: middle; background: var(--user-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.16); }
.permission-help { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.permission-help article { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.permission-help strong,.permission-help span { display: block; }
.permission-help span { margin-top: 4px; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.settings-workspace { grid-template-columns: 290px minmax(0,1fr); }
.settings-section-list { display: grid; gap: 7px; }
.settings-group-label { margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.settings-section-list button { width: 100%; min-height: 34px; padding: 8px 10px; border: 1px solid #d8e4e8; border-radius: 7px; color: var(--ink); background: white; cursor: pointer; text-align: left; font: inherit; font-size: .82rem; font-weight: 850; }
.settings-section-list button.active { color: white; border-color: var(--blue); background: var(--blue); }
.settings-table-wrap table { min-width: 980px; }
.settings-table-wrap th:nth-child(1),.settings-table-wrap td:nth-child(1) { width: 110px; }
.settings-table-wrap th:nth-child(5),.settings-table-wrap td:nth-child(5),
.settings-table-wrap th:nth-child(6),.settings-table-wrap td:nth-child(6) { width: 86px; }
.settings-table-wrap th:nth-child(7),.settings-table-wrap td:nth-child(7) { width: 110px; }
.muted-row { color: var(--muted); background: #f8fbfc; }
.settings-option-form { display: grid; gap: 14px; padding: 8px 4px 4px; }
.settings-option-form h2 { margin: 0; font-size: 1.25rem; }

.calendar-workspace { display: grid; grid-template-columns: 310px minmax(0,1fr); gap: 18px; align-items: start; }
.calendar-sidebar,.calendar-board { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.calendar-sidebar { padding: 16px; position: sticky; top: 16px; }
.calendar-board { overflow: hidden; }
.calendar-sidebar-head,.calendar-toolbar,.calendar-nav,.segmented,.calendar-stats { display: flex; align-items: center; gap: 10px; }
.calendar-sidebar-head,.calendar-toolbar { justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.calendar-sidebar-head h2,.calendar-toolbar h2 { margin: 0; }
.calendar-toolbar h2 { flex: 1; text-align: center; font-size: 1.35rem; text-transform: capitalize; }
.calendar-create { padding: 16px 4px 4px; background: #fbfdfe; }
.calendar-create-head,.calendar-create-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.calendar-create-head h2 { margin: 0; font-size: 1.18rem; }
.calendar-create-grid { display: grid; grid-template-columns: minmax(180px,1.3fr) minmax(150px,1fr) repeat(2,minmax(150px,.8fr)) auto; gap: 10px; align-items: end; }
.calendar-create textarea { width: 100%; resize: vertical; min-height: 62px; padding: 9px 11px; border: 1px solid #cbd8dd; border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.checkbox-line { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 9px 0; color: var(--ink); white-space: nowrap; }
.checkbox-line input { width: 16px; min-height: 16px; }
.calendar-notes { margin-top: 10px; }
.calendar-create-agents { margin-top: 12px; }
.create-agent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.create-agent-choice { min-height: 34px; display: inline-flex; grid-auto-flow: column; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #d8e4e8; border-radius: 8px; color: var(--ink); background: white; cursor: pointer; font-size: .78rem; font-weight: 800; }
.create-agent-choice input { width: 15px; min-height: 15px; accent-color: var(--agent-color); }
.create-agent-choice span { width: 9px; height: 9px; border-radius: 50%; background: var(--agent-color); }
.calendar-warning { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; color: #8d2429; background: #fdecee; font-size: .84rem; font-weight: 800; }
.agent-bulk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.agent-list { display: grid; gap: 10px; }
.agent-row { padding: 11px; border: 1px solid #e2ebef; border-left: 5px solid var(--agent-color); border-radius: 8px; background: #fbfdfe; }
.agent-toggle { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center; color: var(--ink); font-size: .9rem; }
.agent-toggle input { width: 16px; min-height: 16px; accent-color: var(--agent-color); }
.agent-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--agent-color); }
.agent-row small { display: block; margin: 7px 0 9px 24px; color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.agent-actions { display: flex; gap: 7px; margin-left: 24px; flex-wrap: wrap; }
.mini-button { min-height: 30px; padding: 5px 9px; border: 1px solid #cbd8dd; border-radius: 8px; color: var(--blue); background: white; cursor: pointer; font-size: .74rem; font-weight: 800; }
.mini-button.muted { color: var(--muted); }
.mini-button.danger { color: white; border-color: var(--red); background: var(--red); }
.row-actions { gap: 5px; }
.row-actions .mini-button { min-height: 26px; padding: 4px 7px; border: 0; font-size: .68rem; }
.product-row-actions { flex-wrap: nowrap; min-width: 190px; }
.quote-row-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; align-items: stretch; }
.quote-row-actions .mini-button { width: 100%; min-width: 0; min-height: 25px; padding: 4px 5px; border: 0; border-radius: 6px; font-size: .62rem; line-height: 1.05; text-align: center; }
.action-open { color: white !important; background: var(--blue) !important; }
.action-attach { color: #0d5063 !important; background: #dcebf0 !important; }
.action-attach.has-attachments { color: #fff !important; border-color: #16836f !important; background: #16836f !important; box-shadow: 0 0 0 2px rgba(22,131,111,.16); }
.action-note { color: #0d5063 !important; background: #dcebf0 !important; }
.action-doc { color: #0d5063 !important; background: #dcebf0 !important; }
.action-copy { color: white !important; background: var(--green) !important; }
.action-revision { color: #332200 !important; background: #f3cf78 !important; }
.action-cycle { color: #332200 !important; background: #f3cf78 !important; }
.action-print { color: white !important; background: #6a7680 !important; }
.quote-row-actions .action-print,.quote-danea-menu { grid-column: 1 / -1; }
.quote-danea-menu { position: relative; min-width: 0; }
.quote-danea-menu summary { width: 100%; min-height: 25px; display: grid; place-items: center; padding: 4px 5px; border-radius: 6px; color: white; background: #46535d; cursor: pointer; font-size: .62rem; font-weight: 900; line-height: 1.05; list-style: none; text-align: center; }
.quote-danea-menu summary::-webkit-details-marker { display: none; }
.quote-danea-menu[open] summary { border-radius: 6px 6px 0 0; background: var(--blue); }
.quote-danea-menu button { width: 100%; min-height: 28px; padding: 5px; border: 0; border-top: 1px solid rgba(255,255,255,.55); color: #14313c; background: #edf7f8; cursor: pointer; font-size: .66rem; font-weight: 900; }
.quote-danea-menu button:hover { background: #d9eef3; }
@media (max-width:700px){.quote-administration-totals{grid-template-columns:1fr 1fr}.quote-administration-total-label{grid-column:1/-1}}
.action-output { color: white !important; background: #6a7680 !important; }
.error-text { color: #8d2429 !important; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 8px; color: var(--navy); background: var(--ice); cursor: pointer; font-size: 1.5rem; font-weight: 900; line-height: 1; }
.segmented { padding: 4px; border-radius: 8px; background: #edf2f5; }
.segmented button { min-height: 34px; padding: 6px 12px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.segmented button.active { color: white; background: var(--blue); }
.calendar-stats { padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.calendar-stats span { padding: 5px 9px; border-radius: 999px; color: #31505f; background: #eaf1f3; font-size: .78rem; font-weight: 800; }
.calendar-grid-host { min-height: 620px; background: #f8fbfc; }
.week-header { display: grid; grid-template-columns: 62px repeat(7,minmax(120px,1fr)); border-bottom: 1px solid var(--line); background: white; }
.week-header strong { min-height: 54px; padding: 10px; border-left: 1px solid var(--line); color: var(--muted); text-align: center; text-transform: capitalize; }
.week-header b { display: block; color: var(--ink); font-size: 1.1rem; }
.week-header .today b,.month-day.today .month-day-add { color: var(--blue); }
.week-body { display: grid; grid-template-columns: 62px repeat(7,minmax(120px,1fr)); overflow-x: auto; }
.time-rail { display: grid; grid-template-rows: repeat(14,80px); padding-top: 38px; color: var(--muted); background: #f1f5f8; font-size: .74rem; text-align: right; }
.time-rail span { padding: 0 9px 0 0; border-top: 1px solid #dfe8ec; }
.day-column { min-width: 120px; border-left: 1px solid var(--line); background: white; }
.day-column.today-column { background: #fffef4; }
.all-day-stack { min-height: 38px; padding: 5px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.all-day-slot { min-height: 24px; border: 1px dashed #cbd8dd; border-radius: 6px; color: var(--muted); background: #f8fbfc; cursor: pointer; font-size: .7rem; font-weight: 800; }
.all-day-slot:hover { color: var(--blue); border-color: #9dc7d2; background: var(--ice); }
.day-timeline { position: relative; height: 1040px; background-image: repeating-linear-gradient(to bottom,#ecf1f4 0,#ecf1f4 1px,transparent 1px,transparent 40px); }
.time-slot { position: absolute; left: 0; right: 0; z-index: 1; height: 3.846%; border: 0; border-radius: 0; background: transparent; cursor: cell; }
.time-slot:hover { background: rgba(53,168,189,.12); box-shadow: inset 0 0 0 1px rgba(53,168,189,.28); }
.calendar-event,.event-chip,.agenda-event { border: 0; cursor: pointer; text-align: left; }
.calendar-event { position: absolute; left: 5px; right: 5px; z-index: 2; min-height: 34px; padding: 7px 8px; border-left: 4px solid var(--event-color); border-radius: 7px; color: #13313b; background: color-mix(in srgb, var(--event-color) 16%, white); box-shadow: 0 6px 14px rgba(21,50,75,.09); overflow: hidden; }
.calendar-event.is-pending,.event-chip.is-pending,.agenda-event.is-pending { background: #fff8e8; }
.calendar-event.is-error,.event-chip.is-error,.agenda-event.is-error { background: #fdecee; }
.calendar-event strong,.calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event strong { font-size: .78rem; }.calendar-event span { margin-top: 2px; color: var(--muted); font-size: .7rem; }
.event-chip { width: 100%; min-height: 24px; padding: 4px 6px; border-left: 4px solid var(--event-color); border-radius: 6px; color: #13313b; background: color-mix(in srgb, var(--event-color) 14%, white); font-size: .72rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-calendar { display: grid; grid-template-columns: repeat(7,minmax(120px,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: white; }
.month-weekday { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: #f4f7f8; text-align: center; font-size: .78rem; }
.month-day { position: relative; min-height: 128px; padding: 32px 8px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; align-content: start; gap: 5px; }
.month-day.outside { color: #9aa8ae; background: #f9fbfc; }
.month-day-add { position: absolute; inset: 0; z-index: 0; padding: 8px; border: 0; color: inherit; background: transparent; cursor: cell; text-align: left; font-weight: 900; }
.month-day-add:hover { background: rgba(53,168,189,.1); }
.month-day .event-chip,.month-day small { position: relative; z-index: 1; }
.month-day small { color: var(--muted); font-weight: 800; }
.agenda-list { display: grid; gap: 14px; padding: 16px; }
.agenda-day h3 { margin: 0 0 8px; font-size: .95rem; text-transform: capitalize; }
.agenda-event { width: 100%; min-height: 54px; display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; padding: 10px; border-left: 5px solid var(--event-color); border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 4px 16px rgba(21,50,75,.05); }
.agenda-event span,.agenda-event small { color: var(--muted); font-size: .78rem; }
.agenda-event em { color: var(--amber); font-size: .72rem; font-style: normal; font-weight: 800; }
.empty-calendar { padding: 50px 20px; color: var(--muted); text-align: center; font-weight: 800; }
.inline-link { display: inline-flex; align-items: center; text-decoration: none; }
.todo-shell { display: grid; gap: 14px; }
.todo-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.todo-toolbar h2 { margin: 0; font-size: 1.35rem; }
.todo-actions { display: grid; grid-template-columns: minmax(160px,1fr) minmax(140px,.8fr) auto; gap: 10px; align-items: end; }
.todo-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.todo-stats span { padding: 7px 10px; border-radius: 999px; color: #31505f; background: #eaf1f3; font-size: .78rem; font-weight: 800; }
.todo-board { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; align-items: start; }
.todo-column { min-width: 0; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfc; overflow: hidden; }
.todo-column header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: white; }
.todo-column h3 { margin: 0; font-size: .95rem; }
.todo-column header span { min-width: 28px; padding: 4px 8px; border-radius: 999px; color: var(--blue); background: var(--ice); text-align: center; font-weight: 900; }
.todo-column-list { display: grid; gap: 10px; padding: 10px; }
.todo-card { display: grid; gap: 9px; padding: 11px; border: 1px solid #dce6ea; border-left: 5px solid var(--blue); border-radius: 8px; background: white; box-shadow: 0 4px 16px rgba(21,50,75,.05); }
.todo-card.priority-bassa { border-left-color: var(--green); }.todo-card.priority-media { border-left-color: var(--blue); }.todo-card.priority-alta { border-left-color: var(--amber); }.todo-card.priority-urgente { border-left-color: var(--red); }
.todo-card.is-overdue { background: #fff8e8; }
.todo-card-main { border: 0; padding: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.todo-card-main strong { display: block; margin-bottom: 5px; font-size: .92rem; overflow-wrap: anywhere; }
.todo-card-main small { display: -webkit-box; color: var(--muted); font-size: .76rem; line-height: 1.35; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.todo-card-meta,.todo-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.todo-card-meta span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; color: #31505f; background: #edf4f6; font-size: .7rem; font-weight: 800; }
.todo-card-meta i { width: 8px; height: 8px; border-radius: 50%; background: var(--agent-color); }
.todo-empty { padding: 22px 8px; color: var(--muted); text-align: center; font-size: .8rem; font-weight: 800; }
.todo-task-form { display: grid; gap: 12px; padding: 8px 4px 4px; }
.todo-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.todo-dialog-head h2 { margin: 0; font-size: 1.25rem; }
.todo-form-grid,.todo-detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.todo-task-form textarea,.todo-comments textarea { width: 100%; resize: vertical; min-height: 88px; padding: 9px 11px; border: 1px solid #cbd8dd; border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.todo-task-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .76rem; }
.todo-comments,.todo-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.todo-comments h3,.todo-history h3 { margin: 0 0 10px; font-size: 1rem; }
.todo-comments article { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; margin-bottom: 8px; }
.todo-comments article p,.todo-history p { margin: 5px 0; }
.todo-comments small,.todo-history small { color: var(--muted); }
.todo-comments form { display: grid; gap: 10px; margin-top: 12px; }
.chat-shell { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 16px; min-height: 680px; }
.chat-list-panel,.chat-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 28px rgba(21,50,75,.06); }
.chat-list-panel { display: grid; align-content: start; gap: 12px; padding: 16px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-head h2 { margin: 0; font-size: 1.35rem; }
.chat-direct-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.chat-thread-list { display: grid; gap: 8px; }
.chat-thread { width: 100%; min-height: 72px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 11px; border: 1px solid #dce6ea; border-radius: 8px; color: var(--ink); background: #fbfdfe; cursor: pointer; text-align: left; }
.chat-thread.active { border-color: #9dc7d2; background: var(--ice); box-shadow: inset 4px 0 0 var(--blue); }
.chat-thread strong,.chat-empty h2 { overflow-wrap: anywhere; }
.chat-thread small,.chat-thread span { color: var(--muted); font-size: .75rem; }
.chat-thread span { grid-column: 1/-1; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-panel { display: grid; grid-template-rows: 1fr auto; overflow: hidden; background: #eef5f3; }
.chat-panel.is-dragging-file { outline: 3px solid var(--cyan); outline-offset: -6px; background: #e0f4f6; }
.chat-panel.is-dragging-file .chat-composer { background: #f3fbfc; }
.chat-conversation { min-height: 0; overflow-y: auto; padding: 0; }
.chat-room-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); background: white; }
.chat-room-head h2 { margin: 0; font-size: 1.15rem; }
.chat-room-head p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.chat-room-head span { padding: 5px 9px; border-radius: 999px; color: var(--blue); background: var(--ice); font-size: .76rem; font-weight: 900; white-space: nowrap; }
.chat-room-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.chat-messages { display: grid; gap: 10px; padding: 18px; }
.chat-bubble { max-width: min(680px,78%); justify-self: start; display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #d9e5e4; border-radius: 8px; background: white; box-shadow: 0 4px 16px rgba(21,50,75,.05); }
.chat-bubble.own { justify-self: end; border-color: #b8d7df; background: #dff4ec; }
.chat-bubble header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.chat-bubble header i { width: 9px; height: 9px; display: inline-block; margin-right: 5px; border-radius: 50%; background: var(--agent-color); }
.chat-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-attachment { display: inline-flex; gap: 6px; align-items: center; max-width: 260px; padding: 6px 8px; border: 1px solid #cbd8dd; border-radius: 8px; color: var(--blue); background: white; font-size: .76rem; font-weight: 800; text-decoration: none; }
.chat-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-composer { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; padding: 12px; border-top: 1px solid var(--line); background: white; }
.chat-composer textarea,.chat-thread-form textarea { width: 100%; resize: vertical; min-height: 46px; max-height: 140px; padding: 10px 12px; border: 1px solid #cbd8dd; border-radius: 8px; color: var(--ink); background: white; font: inherit; }
.chat-file-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; border: 1px solid #cbd8dd; border-radius: 8px; color: var(--blue); background: var(--ice); cursor: pointer; font-weight: 900; }
.chat-file-button input { position: absolute; width: 1px; min-height: 1px; opacity: 0; pointer-events: none; }
.chat-attachment-preview { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 6px; }
.chat-attachment-preview span { max-width: 260px; padding: 5px 8px; border: 1px solid #cbd8dd; border-radius: 8px; color: #31505f; background: #edf4f6; font-size: .74rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment-preview small { color: var(--muted); font-weight: 700; }
.chat-empty { display: grid; place-items: center; min-height: 520px; padding: 28px; color: var(--muted); text-align: center; }
.chat-empty h2 { color: var(--ink); font-size: 1.25rem; }
.chat-thread-form { display: grid; gap: 14px; padding: 8px 4px 4px; }
.chat-participant-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.chat-participant-grid label { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #dce6ea; border-radius: 8px; color: var(--ink); background: #fbfdfe; cursor: pointer; }
.chat-participant-grid input { width: 16px; min-height: 16px; accent-color: var(--blue); }
.ticket-status,.ticket-priority { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; font-size: .72rem; font-weight: 900; white-space: nowrap; }
.ticket-status { color: #31505f; background: #eaf1f3; }
.ticket-status-select { width: 100%; max-width: 260px; min-height: 34px; padding: 5px 30px 5px 10px; border: 1px solid transparent; cursor: pointer; }
.ticket-status-select.compact { max-width: 190px; min-height: 30px; font-size: .7rem; }
.ticket-status-select:disabled { cursor: default; opacity: .72; }
.ticket-assignee-select { width: 100%; max-width: 260px; min-height: 34px; padding: 5px 30px 5px 10px; border: 1px solid #d7e2e6; border-radius: 8px; color: var(--ink); background: white; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 800; }
.ticket-assignee-select:disabled { cursor: default; opacity: .72; }
.ticket-status.status-offer_prepare,.ticket-status.status-waiting_customer { color: #7a4d0b; background: #fff2d8; }
.ticket-status.status-repairing,.ticket-status.status-repaired { color: #0f5946; background: #dff4ec; }
.ticket-status.status-blocked,.ticket-status.status-not_repairable,.ticket-status.status-rejected_by_customer { color: #8d2429; background: #fdecee; }
.ticket-status.status-closed { color: #5f6e76; background: #eef2f4; }
.ticket-priority { color: #31505f; background: #edf4f6; }
.ticket-priority.priority-low { color: #0f5946; background: #dff4ec; }
.ticket-priority.priority-high { color: #7a4d0b; background: #fff2d8; }
.ticket-priority.priority-urgent { color: #8d2429; background: #fdecee; }
.ticket-late-row { background: #fff8e8; }
.ticket-assigned-to-me { background: #e7f5ec; box-shadow: inset 4px 0 0 #2e8b57; }
.ticket-assigned-to-me:hover { background: #dff1e6; }
.ticket-assigned-to-me.ticket-late-row { background: #fff1cf; box-shadow: inset 4px 0 0 #2e8b57; }
.ticket-assigned-to-me.selected-row { background: #dff0f2; box-shadow: inset 4px 0 0 #2e8b57; }
.ticket-form,.ticket-email-detail { display: grid; gap: 12px; }
.ticket-detail-operations { grid-column: 1 / -1; }
.ticket-general-timeline { margin-top: 2px; }
.ticket-danger-zone { gap: 8px; }
.ticket-form textarea,.ticket-inline-form textarea,.ticket-offer-line-form textarea,.ticket-email-detail textarea { width: 100%; resize: vertical; min-height: 90px; padding: 9px 11px; border: 1px solid #cbd8dd; border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.ticket-customer-match { display: grid; gap: 8px; padding: 11px 12px; border: 1px solid #b8d7df; border-radius: 8px; background: var(--ice); font-size: .84rem; }
.ticket-customer-match.is-empty { color: #7a4d0b; border-color: #ead3a5; background: #fff8e8; }
.ticket-customer-match p,.ticket-customer-match small { margin: 0; }
.ticket-contact-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.ticket-inline-form { display: grid; grid-template-columns: minmax(150px,.35fr) minmax(260px,1fr) auto; gap: 10px; align-items: end; }
.ticket-offer-line-form { display: grid; grid-template-columns: minmax(130px,.75fr) minmax(110px,.6fr) minmax(220px,1.5fr) repeat(4,minmax(90px,.55fr)) auto; gap: 10px; align-items: end; }
.ticket-offer-line-form .wide { grid-column: 1/-2; }
.ticket-timeline { display: grid; gap: 12px; }
.ticket-timeline article { position: relative; display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.ticket-dot { width: 12px; height: 12px; margin-top: 3px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--ice); }
.ticket-timeline p,.ticket-timeline small,.ticket-note-list p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-timeline em,.ticket-note-list small { color: var(--muted); font-size: .75rem; font-style: normal; }
.ticket-note-list { display: grid; gap: 10px; }
.ticket-note-list article { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
@media (max-width:1100px){.home-hero{grid-template-columns:1fr}.home-kpi-grid,.system-error-kpis{grid-template-columns:repeat(3,1fr)}.filter-grid{grid-template-columns:repeat(3,1fr)}.system-error-filters{grid-template-columns:1fr 1fr}.kpi-grid,.status-kpi-grid{grid-template-columns:repeat(3,1fr)}.import-panel{grid-template-columns:1fr 1fr}.import-panel>div:first-child{grid-column:1/-1}}
@media (max-width:1100px){.client-location-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.client-map-layout{grid-template-columns:1fr}.client-map-canvas{height:560px; min-height:520px}.client-map-results{max-height:320px}}
@media (max-width:1100px){.calendar-workspace{grid-template-columns:1fr}.calendar-sidebar{position:static}.agent-list{grid-template-columns:repeat(2,minmax(0,1fr))}.calendar-create-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.checkbox-line{align-self:end}.todo-board{grid-template-columns:repeat(2,minmax(0,1fr))}.todo-toolbar{align-items:stretch; flex-direction:column}.todo-actions{width:100%; grid-template-columns:repeat(2,minmax(0,1fr))}.todo-actions .button{grid-column:1/-1}.todo-form-grid,.todo-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.chat-shell{grid-template-columns:1fr}.chat-list-panel{position:static}.chat-thread-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:1100px){.workspace-shell{grid-template-columns:1fr}.workspace-sidebar{position:static; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end}.workspace-sidebar-head{grid-column:1/-1}.workspace-mini-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-grid,.draft-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:1100px){.quote-line-main-grid,.quote-line-economic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quote-line-wide{grid-column:1/-1}}
@media (max-width:1100px){.quote-detail-box-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.box-general,.box-customer,.box-status,.box-related,.box-total,.box-cost,.box-margin{grid-column:span 6}}
@media (max-width:700px){.topbar{grid-template-columns:1fr; padding:18px; align-items:flex-start}.topnav{width:100%; justify-content:flex-start}.nav-dropdown{left:0; right:auto}.user-menu{width:100%; justify-items:start}.home-grid,.home-kpi-grid,.system-error-kpis,.filter-grid,.system-error-filters,.chart-grid,.import-panel,.account-shell,.account-form-grid{grid-template-columns:1fr}.account-profile-head{grid-template-columns:1fr}.home-hero-main{min-height:auto}.home-actions .button{width:100%}.home-item{grid-template-columns:1fr}.kpi-grid,.status-kpi-grid{grid-template-columns:repeat(2,1fr)}.chart-card.wide{grid-column:auto}.section-heading{align-items:flex-start}.topbar .button{padding:8px 10px}.calendar-create-head,.calendar-toolbar{align-items:stretch; flex-direction:column}.calendar-create-grid{grid-template-columns:1fr}.calendar-toolbar h2{text-align:left}.calendar-nav,.segmented{width:100%; justify-content:space-between}.segmented button{flex:1}.agent-list{grid-template-columns:1fr}.calendar-grid-host{min-height:auto}.week-calendar{overflow-x:auto}.week-header,.week-body{min-width:900px}.month-calendar{grid-template-columns:1fr}.month-weekday{display:none}.month-day{min-height:auto}.month-day.outside{display:none}.agenda-event{grid-template-columns:1fr}.table-actions{justify-content:flex-start}.todo-board,.todo-actions,.todo-form-grid,.todo-detail-grid,.system-error-detail-grid{grid-template-columns:1fr}.todo-column{min-height:auto}.todo-dialog-head{align-items:stretch; flex-direction:column}.chat-shell{min-height:auto}.chat-thread-list,.chat-participant-grid,.chat-composer,.chat-direct-form{grid-template-columns:1fr}.chat-bubble{max-width:100%}.chat-room-head{align-items:flex-start; flex-direction:column}.chat-room-actions{justify-content:flex-start}.chat-empty{min-height:320px}}
@media (max-width:700px){.home-toolbar,.account-theme-picker{align-items:stretch; flex-direction:column}.home-toolbar-actions,.theme-swatches{justify-content:flex-start}.home-save-state{text-align:left}.home-widget-grid{display:grid; grid-auto-rows:auto}.home-widget{grid-column:1/-1; grid-row:auto; min-height:auto}.home-widget-resize-handle{display:none}.home-widget-catalog{grid-template-columns:1fr}.home-quick-actions>div{grid-template-columns:1fr}}
@media (max-width:700px){.home-kpi-controls{grid-template-columns:1fr}}
@media (max-width:700px){.workspace-sidebar,.workspace-mini-kpis,.detail-grid,.draft-grid,.client-contact-list,.client-location-grid{grid-template-columns:1fr}.workspace-toolbar,.detail-head,.detail-block-head{align-items:flex-start; flex-direction:column}.workspace-actions,.detail-actions{width:100%; justify-content:flex-start}.workspace-actions .button,.detail-actions .button{width:100%}.workspace-table-wrap,.workspace-detail{margin:0 10px}.workspace-detail.empty{min-height:180px}.report-sheet{padding:14px}.client-contact-list article{align-items:flex-start; flex-direction:column}.client-quote-item{grid-template-columns:1fr;align-items:flex-start}.client-quote-total{text-align:left}.client-map-layout{padding:0 10px 14px}.client-map-canvas{height:430px; min-height:400px}.client-map-results{max-height:360px}}
@media (max-width:700px){.supplier-price-list-item{grid-template-columns:1fr;align-items:flex-start}.supplier-price-list-item>.button{width:100%}.supplier-price-list-upload{grid-template-columns:1fr}.supplier-price-list-upload .button{width:100%}}
@media (max-width:700px){.product-resource-grid{grid-template-columns:1fr}}
@media (max-width:700px){.quote-line-main-grid,.quote-line-economic-grid{grid-template-columns:1fr}.quote-line-panel,.quote-line-resource-grid{margin-left:10px;margin-right:10px}.quote-line-actions{align-items:stretch;flex-direction:column}.quote-line-actions .button{width:100%}}
@media (max-width:700px){.quote-detail-box-grid,.detail-grid.compact{grid-template-columns:1fr}.box-general,.box-customer,.box-status,.box-related,.box-total,.box-cost,.box-margin{grid-column:1/-1}}
@media (max-width:700px){.workspace-dialog{width:calc(100% - 16px); max-height:94vh; padding:10px}.workspace-dialog .workspace-detail{margin:0}.quote-form-tabs{display:grid; grid-template-columns:1fr 1fr}.quote-form-tabs button{min-width:0}}
@media (max-width:700px){.chart-card-head{align-items:flex-start}.chart-card-actions{align-items:flex-end; flex-direction:column}.chart-metric-control{align-items:flex-start; flex-direction:column; gap:4px}.chart-metric-control select{min-width:170px}}
@media (max-width:700px){.quote-report-dialog{width:calc(100% - 16px); padding:14px}.quote-report-choice-list{grid-template-columns:1fr}.quote-report-actions{justify-content:stretch}.quote-report-actions .button{flex:1}}
@media (max-width:700px){.product-picker-tools{grid-template-columns:1fr}}
@media (max-width:1100px){.ticket-inline-form,.ticket-offer-line-form{grid-template-columns:repeat(2,minmax(0,1fr))}.ticket-inline-form .button,.ticket-offer-line-form .button,.ticket-offer-line-form .wide{grid-column:1/-1}}
@media (max-width:700px){.ticket-inline-form,.ticket-offer-line-form{grid-template-columns:1fr}}
@media (max-width:1100px){.admin-hero{grid-template-columns:1fr}.admin-actions{justify-content:flex-start}.admin-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:700px){.admin-kpi-grid,.admin-home-grid{grid-template-columns:1fr}.admin-panel.wide{grid-column:auto}.admin-actions{width:100%; flex-direction:column; align-items:stretch}.admin-summary-item{grid-template-columns:1fr}.admin-summary-item span{text-align:left}.nav-dropdown-right{left:0; right:auto}}
.quote-status-date { min-width: 0; width: 100%; min-height: 32px; padding: 5px 3px; font-size: .66rem; }
.opportunity-panel { display: grid; gap: 14px; margin: 18px 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg,var(--theme-soft),#fff); }
.opportunity-board { display: grid; grid-template-columns: repeat(6,minmax(190px,1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.opportunity-column { display: grid; align-content: start; gap: 9px; min-width: 190px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.opportunity-column > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opportunity-column h4 { margin: 0; font-size: .9rem; }
.opportunity-card { display: grid; gap: 7px; padding: 10px; border: 1px solid #dce7eb; border-radius: 12px; background: #f9fcfd; }
.opportunity-card > button:first-child { display: grid; gap: 4px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.opportunity-card > div { display: flex; justify-content: space-between; gap: 8px; color: var(--navy); font-weight: 900; }
.opportunity-card small { color: var(--muted); line-height: 1.35; }
.kpi small { display: block; margin-top: 5px; color: var(--muted); font-size: .74rem; font-weight: 700; }
@media (max-width:1100px){.analytics-filter-groups{grid-template-columns:1fr}}
@media (max-width:700px){.analytics-filter-heading,.analytics-filter-actions{align-items:stretch; flex-direction:column}.analytics-filter-actions{width:100%}.analytics-filter-actions .counter{text-align:center}.analytics-filter-priority{grid-template-columns:1fr}.analytics-period-grid{grid-template-columns:1fr}.analytics-filter-grid{grid-template-columns:1fr}.order-cycle-kpi-grid{grid-template-columns:1fr}}

:root.dark-mode { --ink: #e7f0f3; --muted: #9eb3bd; --line: #27404c; --white: #12252e; --green: #2aa987; --amber: #d99a2b; --red: #d45a64; }
:root.dark-mode body { background: #0b151b; color: var(--ink); }
:root.dark-mode .topbar { background: linear-gradient(120deg,#071219,var(--navy)); }
:root.dark-mode .panel,:root.dark-mode .home-widget,:root.dark-mode .home-hero-main,:root.dark-mode .home-today,:root.dark-mode .home-panel,:root.dark-mode .home-kpi,:root.dark-mode .account-panel,:root.dark-mode .admin-panel,:root.dark-mode .admin-kpi,:root.dark-mode .admin-hero { background: #12252e; border-color: var(--line); box-shadow: 0 10px 34px rgba(0,0,0,.28); }
:root.dark-mode .home-hero-main,:root.dark-mode .admin-hero { background: linear-gradient(135deg,#12252e 0%,#10232c 62%,#181f20 100%); }
:root.dark-mode .home-panel header,:root.dark-mode .home-quick-actions header,:root.dark-mode .account-theme-picker,:root.dark-mode .account-dark-toggle,:root.dark-mode .home-catalog-item,:root.dark-mode .quote-expanded-row td { background: #0f2028; border-color: var(--line); }
:root.dark-mode input,:root.dark-mode select,:root.dark-mode textarea { color: var(--ink); background: #091821; border-color: #31515f; }
:root.dark-mode .secondary,:root.dark-mode .mini-button,:root.dark-mode .home-widget-controls button { color: #dff5fa; background: var(--ice); border-color: #31515f; }
:root.dark-mode .home-item,:root.dark-mode td { border-color: var(--line); }
.account-dark-toggle { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--theme-soft,#f5fafb); cursor: pointer; }
.account-dark-toggle span { display: grid; gap: 4px; color: var(--ink); }
.account-dark-toggle small { color: var(--muted); font-size: .78rem; font-weight: 800; }
.account-dark-toggle input { width: 52px; min-width: 52px; height: 28px; min-height: 28px; appearance: none; border: 0; border-radius: 999px; background: #cbd8dd; cursor: pointer; position: relative; }
.account-dark-toggle input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.22); transition: transform .16s ease; }
.account-dark-toggle input:checked { background: var(--blue); }
.account-dark-toggle input:checked::after { transform: translateX(24px); }

.admin-export-panel { display: grid; gap: 18px; }
.admin-export-form { display: grid; grid-template-columns: minmax(230px,300px) minmax(0,1fr); gap: 18px; align-items: start; }
.admin-export-sidebar { position: sticky; top: 16px; display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.admin-export-sidebar p,.admin-export-fields header p { margin: 0; color: var(--muted); line-height: 1.5; }
.admin-export-selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-export-fields { min-width: 0; }
.admin-export-fields > section { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.admin-export-fields h3 { margin: 0 0 6px; font-size: 1.25rem; }
.admin-export-field-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 18px; }
.admin-export-field-grid label { min-width: 0; display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #dce7eb; border-radius: 8px; background: #fbfdfe; cursor: pointer; font-size: .8rem; font-weight: 800; }
.admin-export-field-grid input { width: 16px; min-width: 16px; min-height: 16px; margin: 1px 0 0; accent-color: var(--blue); }
.admin-export-field-grid span { overflow-wrap: anywhere; }
:root.dark-mode .admin-export-sidebar,:root.dark-mode .admin-export-fields > section,:root.dark-mode .admin-export-field-grid label { color: var(--ink); background: #0f2028; border-color: var(--line); }
@media (max-width:1100px){.admin-export-form{grid-template-columns:1fr}.admin-export-sidebar{position:static}.admin-export-field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:700px){.admin-export-field-grid,.admin-export-selection-actions{grid-template-columns:1fr}}

:root.dark-mode .nav-tab {
    color: #f2fbff;
    border-color: rgba(190,222,232,.35);
    background: rgba(255,255,255,.08);
}
:root.dark-mode .nav-tab:hover,
:root.dark-mode .nav-tab:focus {
    color: #ffffff;
    background: rgba(255,255,255,.14);
}
:root.dark-mode .nav-tab.active {
    color: #06151c;
    background: #f4fbff;
    border-color: #f4fbff;
}
:root.dark-mode .nav-menu-root::after {
    color: currentColor;
}
:root.dark-mode .nav-dropdown {
    color: #e7f0f3;
    border-color: #31515f;
    background: #10242e;
    box-shadow: 0 18px 42px rgba(0,0,0,.42);
}
:root.dark-mode .nav-dropdown button {
    color: #e7f0f3;
    background: transparent;
}
:root.dark-mode .nav-dropdown button:hover,
:root.dark-mode .nav-dropdown button:focus {
    color: #ffffff;
    background: rgba(255,255,255,.10);
}
:root.dark-mode select,
:root.dark-mode select option,
:root.dark-mode option,
:root.dark-mode optgroup {
    color: #e7f0f3;
    background-color: #091821;
}
:root.dark-mode select:focus,
:root.dark-mode input:focus,
:root.dark-mode textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(101,198,215,.18);
    outline: 0;
}
:root.dark-mode .theme-swatch {
    border-color: #d9edf4;
}
:root.dark-mode .message.compact {
    color: #f0fbff;
    background: #07151d;
}

:root.dark-mode .workspace-sidebar,
:root.dark-mode .workspace-main,
:root.dark-mode .workspace-detail,
:root.dark-mode .table-wrap,
:root.dark-mode .workspace-table-wrap,
:root.dark-mode .detail-lines-wrap {
    color: var(--ink);
    background: #0f2028;
    border-color: var(--line);
}
:root.dark-mode .workspace-toolbar,
:root.dark-mode .quote-copy-filter-tools,
:root.dark-mode .quote-copy-products,
:root.dark-mode .quote-administration-totals,
:root.dark-mode .quote-administration-totals > div,
:root.dark-mode .workspace-mini-kpis article,
:root.dark-mode .detail-grid article,
:root.dark-mode .quote-detail-box,
:root.dark-mode .system-error-kpi {
    color: var(--ink);
    background: #12252e;
    border-color: var(--line);
}
:root.dark-mode table,
:root.dark-mode tbody,
:root.dark-mode tbody tr {
    color: var(--ink);
    background: #0f2028;
}
:root.dark-mode th,
:root.dark-mode .workspace-table-wrap th {
    color: #f7fbff;
    background: #17384b;
    border-bottom: 1px solid #31515f;
}
:root.dark-mode td {
    color: var(--ink);
    border-bottom-color: var(--line);
}
:root.dark-mode tbody tr:hover {
    background: #142f3a;
}
:root.dark-mode .selected-row,
:root.dark-mode .selected-row:hover {
    background: #123242;
}
:root.dark-mode .quote-has-note,
:root.dark-mode .quote-has-note:hover,
:root.dark-mode .ticket-late-row,
:root.dark-mode .ticket-late-row:hover {
    background: #2a2314;
}
:root.dark-mode .ticket-assigned-to-me,
:root.dark-mode .ticket-assigned-to-me:hover {
    background: #102d24;
    box-shadow: inset 4px 0 0 #2aa987;
}
:root.dark-mode .ticket-assigned-to-me.ticket-late-row,
:root.dark-mode .ticket-assigned-to-me.ticket-late-row:hover {
    background: #2b2818;
    box-shadow: inset 4px 0 0 #2aa987;
}
:root.dark-mode .ticket-assigned-to-me.selected-row,
:root.dark-mode .ticket-assigned-to-me.selected-row:hover {
    background: #123242;
    box-shadow: inset 4px 0 0 #2aa987;
}
:root.dark-mode .quote-expanded-row td,
:root.dark-mode .quote-expanded-lines {
    background: #0f2028 !important;
    border-color: var(--line);
}
:root.dark-mode .quote-link,
:root.dark-mode .quote-inline-link {
    color: #77d7eb;
}
:root.dark-mode .tag,
:root.dark-mode .quote-copy-filter-summary,
:root.dark-mode .chat-attachment-preview span {
    color: #dff5fa;
    background: #19313b;
    border-color: #31515f;
}
:root.dark-mode .mini-icon-button {
    color: #dff5fa;
    background: #091821;
    border-color: #31515f;
}
:root.dark-mode .quote-table-resize-handle:hover,
:root.dark-mode .quote-table-resize-handle:focus-visible {
    background: #132d38;
}
:root.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
:root.dark-mode input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.4);
}

/* Dark mode coverage for the remaining app modules. */
:root.dark-mode {
    --muted: #b6c9d2;
    --line: #345464;
    --ice: #17313c;
    --theme-soft: #10232c;
}
:root.dark-mode .panel,
:root.dark-mode .calendar-sidebar,
:root.dark-mode .calendar-board,
:root.dark-mode .todo-toolbar,
:root.dark-mode .todo-column,
:root.dark-mode .chat-list-panel,
:root.dark-mode .chat-panel,
:root.dark-mode .admin-panel,
:root.dark-mode .admin-kpi,
:root.dark-mode .system-errors-panel,
:root.dark-mode .analytics-manager-filter,
:root.dark-mode .analytics-filter-group,
:root.dark-mode .active-filters,
:root.dark-mode .kpi,
:root.dark-mode .status-kpi,
:root.dark-mode .chart-card,
:root.dark-mode .opportunity-panel,
:root.dark-mode .opportunity-column {
    color: var(--ink);
    background: #11252e;
    border-color: var(--line);
    box-shadow: 0 10px 30px rgba(0,0,0,.26);
}
:root.dark-mode .calendar-toolbar,
:root.dark-mode .calendar-sidebar-head,
:root.dark-mode .calendar-create,
:root.dark-mode .calendar-stats,
:root.dark-mode .week-header,
:root.dark-mode .todo-column header,
:root.dark-mode .chat-room-head,
:root.dark-mode .chat-composer,
:root.dark-mode .admin-panel header,
:root.dark-mode .admin-summary-item,
:root.dark-mode .rich-editor-toolbar,
:root.dark-mode .rich-editor-status {
    color: var(--ink);
    background: #0d1e26;
    border-color: var(--line);
}
:root.dark-mode .calendar-grid-host,
:root.dark-mode .week-body,
:root.dark-mode .month-calendar,
:root.dark-mode .agenda-list,
:root.dark-mode .chat-conversation,
:root.dark-mode .chat-messages {
    color: var(--ink);
    background: #08161d;
}
:root.dark-mode .week-header strong,
:root.dark-mode .time-rail,
:root.dark-mode .time-rail span,
:root.dark-mode .day-column,
:root.dark-mode .month-weekday,
:root.dark-mode .month-day,
:root.dark-mode .all-day-stack {
    color: var(--muted);
    background: #0f2028;
    border-color: var(--line);
}
:root.dark-mode .day-column.today-column,
:root.dark-mode .month-day.today {
    background: #142b2d;
}
:root.dark-mode .month-day.outside {
    color: #78909a;
    background: #0b1a21;
}
:root.dark-mode .day-timeline {
    background-color: #0f2028;
    background-image: repeating-linear-gradient(to bottom,#294553 0,#294553 1px,transparent 1px,transparent 40px);
}
:root.dark-mode .all-day-slot,
:root.dark-mode .create-agent-choice,
:root.dark-mode .agent-row,
:root.dark-mode .todo-card,
:root.dark-mode .todo-comments article,
:root.dark-mode .chat-thread,
:root.dark-mode .chat-participant-grid label,
:root.dark-mode .ticket-timeline article,
:root.dark-mode .ticket-note-list article,
:root.dark-mode .permission-help article,
:root.dark-mode .settings-section-list button,
:root.dark-mode .quote-client-results,
:root.dark-mode .quote-client-result,
:root.dark-mode .product-resource-box,
:root.dark-mode .product-attachment-card,
:root.dark-mode .product-image-gallery a,
:root.dark-mode .product-attachment-preview,
:root.dark-mode .rich-editor,
:root.dark-mode .rich-editor-surface {
    color: var(--ink);
    background: #132a34;
    border-color: #345464;
}
:root.dark-mode .todo-card.is-overdue,
:root.dark-mode .calendar-event.is-pending,
:root.dark-mode .event-chip.is-pending,
:root.dark-mode .agenda-event.is-pending,
:root.dark-mode .calendar-warning,
:root.dark-mode .ticket-customer-match.is-empty {
    color: #ffe3a3;
    background: #2e2412;
    border-color: #6f5520;
}
:root.dark-mode .calendar-event.is-error,
:root.dark-mode .event-chip.is-error,
:root.dark-mode .agenda-event.is-error,
:root.dark-mode .error-reference {
    color: #ffd5da;
    background: #34171d;
    border-color: #7a3540;
}
:root.dark-mode .calendar-event,
:root.dark-mode .event-chip,
:root.dark-mode .agenda-event {
    color: #eef9fc;
    background: color-mix(in srgb, var(--event-color) 28%, #11252e);
    box-shadow: 0 8px 18px rgba(0,0,0,.24);
}
:root.dark-mode .calendar-event span,
:root.dark-mode .agenda-event span,
:root.dark-mode .agenda-event small {
    color: #c5d7de;
}
:root.dark-mode .todo-card-meta span,
:root.dark-mode .todo-stats span,
:root.dark-mode .calendar-stats span,
:root.dark-mode .chat-room-head span,
:root.dark-mode .status-chip,
:root.dark-mode .active-filters span,
:root.dark-mode .muted-tag,
:root.dark-mode .ticket-status,
:root.dark-mode .ticket-priority {
    color: #dff5fa;
    background: #19313b;
    border-color: #345464;
}
:root.dark-mode .status-chip.active,
:root.dark-mode .segmented button.active,
:root.dark-mode .settings-section-list button.active {
    color: #ffffff;
    background: var(--blue);
    border-color: var(--blue);
}
:root.dark-mode .segmented,
:root.dark-mode .icon-button,
:root.dark-mode .chat-file-button,
:root.dark-mode .chart-expand,
:root.dark-mode .quote-client-result:hover,
:root.dark-mode .quote-client-result:focus {
    color: #dff5fa;
    background: #17313c;
    border-color: #345464;
}
:root.dark-mode .chat-thread.active,
:root.dark-mode .chat-bubble,
:root.dark-mode .chat-attachment {
    color: var(--ink);
    background: #142d38;
    border-color: #3d6171;
}
:root.dark-mode .chat-bubble.own {
    color: #eef9f5;
    background: #12352f;
    border-color: #2aa987;
}
:root.dark-mode .admin-summary-item:hover,
:root.dark-mode .status-kpi:hover,
:root.dark-mode .settings-section-list button:hover,
:root.dark-mode .chat-thread:hover {
    background: #17313c;
}
:root.dark-mode .analytics-manager-filter {
    background: linear-gradient(145deg,#132f3b,#10232c);
}
:root.dark-mode .analytics-filter-group-title,
:root.dark-mode .security-policy-form h3 {
    color: #8ee5f2;
}
:root.dark-mode .two-factor-status,
:root.dark-mode .tag.success {
    color: #bff7dd;
    background: #102d24;
    border-color: #2aa987;
}
:root.dark-mode .system-error-trace,
:root.dark-mode .error-details,
:root.dark-mode .muted-row {
    color: var(--ink);
    background: #0d1e26;
    border-color: var(--line);
}
:root.dark-mode .rich-editor-surface th {
    color: #f7fbff;
    background: #17384b;
}
:root.dark-mode .rich-editor-surface td,
:root.dark-mode .rich-editor-surface th {
    border-color: #345464;
}
:root.dark-mode .product-preview-image,
:root.dark-mode .product-image-gallery img {
    background: #0d1e26;
    border-color: var(--line);
}

/* Complete dark-theme surface, interaction and semantic-state coverage. */
:root.dark-mode {
    color-scheme: dark;
    --surface: #11252e;
    --surface-soft: #0d1e26;
    --surface-raised: #132a34;
    --text: #e7f0f3;
    --focus-ring: rgba(126,215,232,.3);
}
:root.dark-mode body,
:root.dark-mode dialog {
    color: var(--ink);
}
:root.dark-mode dialog {
    background: #11252e;
    border: 1px solid #345464;
    box-shadow: 0 30px 90px rgba(0,0,0,.58);
}
:root.dark-mode dialog::backdrop {
    background: rgba(2,8,12,.78);
}
:root.dark-mode a:not(.button) { color: #7ed7e8; }
:root.dark-mode a:not(.button):visited { color: #beaef7; }
:root.dark-mode input::placeholder,
:root.dark-mode textarea::placeholder { color: #8098a3; opacity: 1; }
:root.dark-mode input:disabled,
:root.dark-mode select:disabled,
:root.dark-mode textarea:disabled,
:root.dark-mode button:disabled { color: #8198a2; opacity: .68; }
:root.dark-mode input[type="checkbox"],
:root.dark-mode input[type="radio"] { accent-color: var(--cyan); }
:root.dark-mode button:focus-visible,
:root.dark-mode a:focus-visible,
:root.dark-mode summary:focus-visible,
:root.dark-mode [tabindex]:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}
:root.dark-mode * { scrollbar-color: #527080 #0b1a21; }

:root.dark-mode .home-widget-controls {
    color: var(--ink);
    background: rgba(13,30,38,.97);
    border-color: #345464;
    box-shadow: 0 8px 22px rgba(0,0,0,.38);
}
:root.dark-mode .message {
    color: #dff5fa;
    background: #17313c;
    border-color: #345464;
}
:root.dark-mode .message.error,
:root.dark-mode .required-fields-notice {
    color: #ffd5da;
    background: #34171d;
    border-color: #7a3540;
}
:root.dark-mode .required-field-missing {
    border-color: #e06a74 !important;
    box-shadow: 0 0 0 3px rgba(224,106,116,.2) !important;
}
:root.dark-mode .counter {
    color: #bdeef6;
    background: #19313b;
}
:root.dark-mode .dialog-close {
    color: #dff5fa;
    background: #17313c;
    border-color: #466676;
}
:root.dark-mode .dialog-close:hover {
    color: #fff;
    background: #214250;
}

:root.dark-mode .quote-detail-box,
:root.dark-mode .quote-detail-box.box-customer,
:root.dark-mode .quote-detail-box.box-total,
:root.dark-mode .quote-detail-box.box-cost,
:root.dark-mode .quote-detail-box.box-margin,
:root.dark-mode .quote-detail-box.box-status,
:root.dark-mode .quote-timeline-block,
:root.dark-mode .report-sheet,
:root.dark-mode .readonly-field,
:root.dark-mode .supplier-price-list-item,
:root.dark-mode .client-email-list span,
:root.dark-mode .client-contact-list article,
:root.dark-mode .client-quote-item {
    color: var(--ink);
    background: #132a34;
    border-color: #345464;
}
:root.dark-mode .quote-timeline article {
    color: var(--ink);
    background: color-mix(in srgb,var(--quote-status-color,#7d8790) 18%,#11252e);
    border-color: color-mix(in srgb,var(--quote-status-color,#7d8790) 42%,#345464);
}
:root.dark-mode .quote-timeline-dot { border-color: #11252e; }
:root.dark-mode .quote-status-inline,
:root.dark-mode .quote-status-pill {
    color: #f2fbff;
    background: color-mix(in srgb,var(--quote-status-color,#7d8790) 30%,#10242e);
    border-color: color-mix(in srgb,var(--quote-status-color,#7d8790) 58%,#466676);
}
:root.dark-mode .quote-form-tabs {
    background: linear-gradient(90deg,#102922,#111d31 55%,#2a2314);
    border-color: #345464;
}
:root.dark-mode .quote-form-tabs button,
:root.dark-mode .quote-form-tabs button.quote-tab-main,
:root.dark-mode .quote-form-tabs button.quote-tab-data,
:root.dark-mode .quote-form-tabs button.quote-tab-work,
:root.dark-mode .quote-form-tabs button.quote-tab-output,
:root.dark-mode .quote-form-tabs button.quote-tab-internal {
    color: #dff5fa;
    background: #17313c;
    border-color: #466676;
    box-shadow: none;
}
:root.dark-mode .quote-form-tabs button:hover { color: #fff; background: #214250; }
:root.dark-mode .quote-form-tabs button.active,
:root.dark-mode .quote-form-tabs button.quote-tab-main.active,
:root.dark-mode .quote-form-tabs button.quote-tab-work.active { color: #fff; background: var(--blue); border-color: var(--cyan); }
:root.dark-mode .quote-form-tabs button.quote-tab-data.active { color: #fff; background: #46752f; border-color: #83bd65; }
:root.dark-mode .quote-form-tabs button.quote-tab-output.active { color: #201600; background: #f3cf78; border-color: #ffe09a; }
:root.dark-mode .quote-form-tabs button.quote-tab-internal.active { color: #fff; background: #667985; border-color: #91a8b5; }
:root.dark-mode .quote-report-dialog,
:root.dark-mode .quote-report-form,
:root.dark-mode .quote-report-body,
:root.dark-mode .quote-line-form,
:root.dark-mode .quote-line-panel {
    color: var(--ink);
    background: #11252e;
    border-color: #345464;
}
:root.dark-mode .quote-report-choice-list label,
:root.dark-mode .quote-report-ready {
    color: var(--ink);
    background: #132a34;
    border-color: #345464;
}
:root.dark-mode .quote-report-choice-list label:has(input:checked) {
    color: #aeeaf4;
    background: #17313c;
    border-color: var(--cyan);
}
:root.dark-mode .quote-report-options strong,
:root.dark-mode .required-note { color: #ff9ca5; }
:root.dark-mode .quote-line-dialog .dialog-close { background: rgba(23,49,60,.96); }
:root.dark-mode .quote-line-topbar { background: #4149bd; }
:root.dark-mode .quote-content-line-row,
:root.dark-mode [data-quote-line-sortable].is-sorting [data-quote-line-row],
:root.dark-mode .product-attachment-list.is-sorting .product-image-sort-card { background: #10232c; }
:root.dark-mode [data-quote-line-sortable] [data-quote-line-row].is-dragging { background: #173746; }
:root.dark-mode .quote-line-drag-handle,
:root.dark-mode .product-image-drag-handle {
    color: #dff5fa;
    background: #17313c;
    border-color: #466676;
}

:root.dark-mode .client-map-panel,
:root.dark-mode .client-map-results,
:root.dark-mode .client-map-item {
    color: var(--ink);
    background: #11252e;
    border-color: #345464;
}
:root.dark-mode .client-map-item.active { background: #321c1e; }
:root.dark-mode .client-map-phone {
    color: #aeeaf4;
    background: #12313d;
    border-color: #2d6474;
}
:root.dark-mode .client-map-item.active .client-map-phone {
    color: #ffc8c3;
    background: #3a1d1b;
    border-color: #7a3f3a;
}
:root.dark-mode .client-map-status {
    color: #bff7dd;
    background: #102d24;
}
:root.dark-mode .leaflet-popup-content-wrapper,
:root.dark-mode .leaflet-popup-tip {
    color: var(--ink);
    background: #132a34;
}
:root.dark-mode .client-domain-chip {
    color: #dff5fa;
    background: #19313b;
}

:root.dark-mode .system-error-level.level-error,
:root.dark-mode .ticket-status.status-blocked,
:root.dark-mode .ticket-status.status-not_repairable,
:root.dark-mode .ticket-status.status-rejected_by_customer,
:root.dark-mode .ticket-priority.priority-urgent {
    color: #ffd5da;
    background: #34171d;
}
:root.dark-mode .system-error-level.level-warning,
:root.dark-mode .ticket-status.status-offer_prepare,
:root.dark-mode .ticket-status.status-waiting_customer,
:root.dark-mode .ticket-priority.priority-high {
    color: #ffe3a3;
    background: #2e2412;
}
:root.dark-mode .ticket-status.status-repairing,
:root.dark-mode .ticket-status.status-repaired,
:root.dark-mode .ticket-priority.priority-low,
:root.dark-mode .product-image-tag {
    color: #bff7dd;
    background: #102d24;
}
:root.dark-mode .ticket-status.status-closed { color: #d2dee3; background: #26343b; }
:root.dark-mode .security-admin-notice {
    color: #bff7dd;
    background: #102d24;
    border: 1px solid #315f57;
}
:root.dark-mode .security-policy-form h3,
:root.dark-mode .security-permissions-group legend,
:root.dark-mode .quote-global-markup-control input { color: #8ee5f2; }
:root.dark-mode .mini-button.danger {
    color: #ffb4bb;
    background: #34171d;
    border-color: #7a3540;
}
:root.dark-mode .unsaved-changes-symbol {
    color: #ffe3a3;
    background: #2e2412;
    border-color: #6f5520;
}

:root.dark-mode .action-attach,
:root.dark-mode .action-note,
:root.dark-mode .action-doc {
    color: #bdeef6 !important;
    background: #17313c !important;
    border-color: #466676 !important;
}
:root.dark-mode .action-revision,
:root.dark-mode .action-cycle {
    color: #ffe7a7 !important;
    background: #4a3917 !important;
    border-color: #806321 !important;
}
:root.dark-mode .quote-danea-menu button {
    color: #dff5fa;
    background: #17313c;
    border-top-color: #466676;
}
:root.dark-mode .chat-panel.is-dragging-file { background: #12313d; }
:root.dark-mode .chat-panel.is-dragging-file .chat-composer { background: #17313c; }
:root.dark-mode .opportunity-card {
    color: var(--ink);
    background: #132a34;
    border-color: #345464;
}
:root.dark-mode .opportunity-card > div { color: #8ee5f2; }
