/* Shared interface refinements. Print/document layout remains independent. */
/* Ocean pairs deep petrol with amber accents and warm sand surfaces. */
@media screen {
  html[data-theme="ocean"] .app-shell { background: var(--color-background); }
  html[data-theme="ocean"] .app-shell .sidebar { background: radial-gradient(ellipse at 0 0, #bd955f35, transparent 48%), linear-gradient(165deg, var(--sidebar-start), var(--sidebar-end)); }
  html[data-theme="ocean"] .sidebar .nav-label { color: #d0dccc; }
  html[data-theme="ocean"] .sidebar .nav-item { color: #eef7f4; }
  html[data-theme="ocean"] .sidebar .nav-icon { color: #c6e3dc; }
  html[data-theme="ocean"] .sidebar .nav-item.active { background: #ffffff14; border-color: #f4c16f40; box-shadow: inset 3px 0 0 var(--color-accent); }
  html[data-theme="ocean"] .sidebar .nav-item.active .nav-icon { color: var(--color-accent); }
  html[data-theme="ocean"] .app-header { border-color: var(--color-border); background: #fffefaf2; }
  html[data-theme="ocean"] .app-header .search { background: #f8f7f0; border-color: var(--color-border); }
  html[data-theme="ocean"] .dashboard-hero { background: radial-gradient(ellipse at 95% 10%, #f4c16f40, transparent 60%), linear-gradient(110deg, #fffefb, #e4f4f3); border-color: var(--color-border); }
  html[data-theme="ocean"] .button.primary { background: linear-gradient(120deg, #0f6874, #14505c); box-shadow: 0 4px 12px #0f687426; }
  html[data-theme="ocean"] .button.primary:hover { background: linear-gradient(120deg, #0d5964, #103d48); }
  html[data-theme="ocean"] .panel, html[data-theme="ocean"] .table-wrap, html[data-theme="ocean"] .kpi-card { border-color: var(--color-border); }
  html[data-theme="ocean"] .data-table th { background: #edf3ee; color: #3c5b59; }
  html[data-theme="ocean"] .data-table td, html[data-theme="ocean"] .sig-footer { border-color: #e7ece5; }
}
/* Aurora adds a second accent without changing semantic status/error colors. */
@media screen {
  html[data-theme="aurora"] .app-shell { background: var(--color-background); }
  html[data-theme="aurora"] .app-shell .sidebar { background: radial-gradient(ellipse at 0 0, #93556165, transparent 48%), linear-gradient(165deg, var(--sidebar-start), var(--sidebar-end)); }
  html[data-theme="aurora"] .sidebar .nav-label { color: #e5c6dd; }
  html[data-theme="aurora"] .sidebar .nav-item { color: #f1eafa; }
  html[data-theme="aurora"] .sidebar .nav-icon { color: #d9c5f2; }
  html[data-theme="aurora"] .sidebar .nav-item.active { background: #ffffff14; border-color: #ffc9b635; box-shadow: inset 3px 0 0 var(--color-accent); }
  html[data-theme="aurora"] .sidebar .nav-item.active .nav-icon { color: var(--color-accent); }
  html[data-theme="aurora"] .app-header { border-color: var(--color-border); background: #fffcfff2; }
  html[data-theme="aurora"] .app-header .search { background: #faf7fd; border-color: var(--color-border); }
  html[data-theme="aurora"] .dashboard-hero { background: radial-gradient(ellipse at 95% 10%, #ffb4a229, transparent 60%), linear-gradient(110deg, #fff, #f1e9ff); border-color: var(--color-border); }
  html[data-theme="aurora"] .button.primary { background: linear-gradient(120deg, #7041bd, #5d388f); box-shadow: 0 4px 12px #7041bd26; }
  html[data-theme="aurora"] .button.primary:hover { background: linear-gradient(120deg, #6035a6, #492771); }
  html[data-theme="aurora"] .panel, html[data-theme="aurora"] .table-wrap, html[data-theme="aurora"] .kpi-card { border-color: var(--color-border); }
  html[data-theme="aurora"] .data-table th { background: #f3edf9; color: #59446d; }
  html[data-theme="aurora"] .data-table td, html[data-theme="aurora"] .sig-footer { border-color: #ece4f3; }
}
body { line-height: 1.5; font-feature-settings: "cv11", "ss01"; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
button, input, select, textarea { accent-color: var(--color-primary); }
button:disabled { cursor: not-allowed; opacity: .6; }
.app-shell { grid-template-columns: 232px minmax(0, 1fr); background: #f5f7fa; }
.app-shell .sidebar { padding: 1.25rem .8rem; background: linear-gradient(170deg, color-mix(in srgb, var(--sidebar-start) 65%, #152337), #131f30); }
.sidebar .brand-logo { padding: .2rem 1.25rem 1.2rem; margin-bottom: .7rem; border-bottom: 1px solid #ffffff1a; }
.sidebar .brand-logo img { width: 150px; max-height: 112px; object-fit: contain; }
.sidebar .nav-group { margin-top: 1.15rem; }
.sidebar .nav-label { color: #b9c8d8; font-size: .64rem; letter-spacing: .11em; }
.sidebar .nav-item { min-height: 43px; padding: .65rem .8rem; border: 1px solid transparent; font-size: .83rem; color: #e6edf5; box-shadow: none; }
.sidebar .nav-item.active { background: #ffffff18; border-color: #ffffff2e; color: white; font-weight: 650; box-shadow: inset 3px 0 0 var(--color-primary); }
.sidebar .nav-item:hover { background: #ffffff12; }
.sidebar .nav-item::before, .sidebar .nav-item::after { display: none; }
.sidebar .nav-icon { color: #c9d8e7; }
.sidebar .nav-upcoming { opacity: .65; }
.app-main { display: flex; flex-direction: column; min-height: 100vh; }
.app-header { height: 68px; padding-inline: 1.75rem; background: #fffffff2; border-color: #e5eaf0; }
.app-header .search { width: min(390px, 36vw); background: #f7f9fc; border-color: #e0e6ee; border-radius: 10px; }
.app-header .search input { min-width: 0; width: 100%; font-size: .82rem; }
.profile-button { border-radius: 999px; padding: .35rem .65rem .35rem .35rem; gap: .55rem; }
.profile-button:hover { background: var(--color-primary-soft); }
.profile-name { max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.page-content { width: 100%; flex: 1; padding: 2rem 2rem 2.5rem; animation: none; }
.page-heading { align-items: center; margin-bottom: 1.5rem; }
.page-heading h1 { font-size: 1.7rem; font-weight: 720; letter-spacing: -.04em; }
.page-heading .muted { margin-bottom: 0; font-size: .88rem; }
.eyebrow { font-size: .66rem; letter-spacing: .12em; }
.button { min-height: 42px; border-radius: 9px; font-size: .82rem; font-weight: 650; }
.button.primary { box-shadow: 0 3px 8px #172b4d16; }
.button.primary:hover { transform: none; box-shadow: 0 4px 12px #172b4d24; }
.button.secondary { color: var(--color-text); }
.panel, .table-wrap { border-color: #e0e6ee; box-shadow: 0 2px 5px #172b4d03; }
.panel-header { padding: 1.1rem 1.25rem; gap: 1rem; }
.panel-header h2 { font-size: .95rem; font-weight: 650; }
.panel-caption { color: var(--color-muted); font-size: .72rem; }
.panel-link { color: var(--color-primary-strong); font-size: .76rem; font-weight: 650; white-space: nowrap; }
.field { gap: .4rem; align-content: start; font-size: .77rem; font-weight: 600; }
.field input, .field textarea, .field select { font-weight: 450; color: var(--color-text); font-size: .85rem; }
.field input, .field select { min-height: 43px; }
.field textarea { resize: vertical; }
.data-table { font-size: .82rem; }
.data-table th { padding: .9rem 1rem; background: #f1f4f8; color: #526278; font-size: .64rem; font-weight: 750; letter-spacing: .08em; }
.data-table td { padding: 1rem; vertical-align: middle; border-color: #edf0f5; line-height: 1.5; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--color-primary-soft) 40%, white); }
.data-table td:first-child { font-weight: 550; }
.data-table select { max-width: 100%; min-height: 35px; padding: .35rem .5rem; border: 1px solid var(--color-border); border-radius: 7px; background: white; font: inherit; }
.table-action { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: .3rem .6rem; margin: .15rem; font-weight: 600; font-size: .73rem; }
.table-action[data-action], .table-action.table-icon { color: var(--color-primary-strong); border-color: var(--color-border); background: white; }
.status-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .24rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-success { color: #176345; background: #e8f5ef; }
.status-info { color: #285b9d; background: #edf3fc; }
.status-warning { color: #815710; background: #fff5da; }
.status-danger { color: #a03039; background: #fcecef; }
.status-neutral { color: #586579; background: #eef1f5; }
.dashboard-hero { padding: 1.6rem; border: 1px solid #e0e6ee; border-radius: 15px; background: linear-gradient(110deg, white, var(--color-primary-soft)); box-shadow: none; margin-bottom: 1.4rem; }
.dashboard-hero h1 { margin: .5rem 0 .4rem; font-size: clamp(1.4rem, 2.3vw, 2rem); font-weight: 720; line-height: 1.2; letter-spacing: -.04em; }
.dashboard-hero p { margin: 0; font-size: .85rem; color: var(--color-muted); }
.dashboard-date { min-width: 150px; padding: .85rem 1rem; border: 1px solid #ffffff; border-radius: 12px; display: grid; gap: .4rem; background: #ffffff99; }
.dashboard-date span { font-size: .74rem; text-transform: none; font-weight: 500; }
.dashboard-date a { color: var(--color-primary-strong); font-size: .76rem; font-weight: 650; }
.kpi-card { padding: 1.1rem 1.2rem; border: 1px solid #e0e6ee; border-radius: 12px; box-shadow: 0 2px 5px #172b4d03; animation: none; }
.kpi-card::before, .kpi-card::after { display: none; }
.kpi-card:hover { transform: none; box-shadow: 0 4px 14px #172b4d09; }
.kpi-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-heading .kpi-label { font-size: .75rem; color: #596a7f; }
.kpi-symbol { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: var(--color-primary-strong); background: var(--color-primary-soft); flex-shrink: 0; }
.kpi-value { margin: .7rem 0 .15rem; font-size: 1.8rem; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.kpi-meta { color: #778398; font-size: .65rem; font-weight: 400; }
.dashboard-list { padding: .4rem 1.25rem; }
.dashboard-list ul { gap: 0; }
.dashboard-list li { padding: 1rem 0; border: 0; border-radius: 0; border-bottom: 1px solid #edf0f5; background: transparent; font-size: .78rem; }
.dashboard-list li:last-child { border-bottom: 0; }
.dashboard-list p { margin: 0 0 .35rem; }
.dashboard-list .activity-target { display: block; color: var(--color-muted); font-size: .73rem; }
.dashboard-list small { font-size: .67rem; }
.dashboard-list .agenda-item { display: flex; gap: .85rem; }
.agenda-item time { color: var(--color-primary-strong); background: var(--color-primary-soft); padding: .35rem .5rem; border-radius: 7px; align-self: flex-start; font-weight: 700; font-size: .75rem; }
.agenda-item p { margin-top: .65rem; font-size: .71rem; color: var(--color-muted); }
.dashboard-empty-visual { display: flex; flex-direction: column; justify-content: center; min-height: 200px; gap: .4rem; }
.dashboard-empty-visual::before { display: none; }
.dashboard-empty-visual p { font-size: .8rem; color: var(--color-muted); }
.empty-symbol { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary-strong); margin-bottom: .4rem; font-size: 1.2rem; }
.empty .button { margin-top: 1rem; }
.sig-footer { position: static; margin-top: auto; padding: .9rem 1.5rem; background: transparent; border-top: 1px solid #e0e6ee; color: #748195; box-shadow: none; font-size: .65rem; font-weight: 450; letter-spacing: .015em; }
.settings-collapsible > .panel-header::after { display: none; }
.settings-collapsible > .panel-header:hover h2 { text-shadow: none; transform: none; letter-spacing: normal; }
.order-filters .field { min-width: 0; }
.order-filters .field input, .order-filters .field select { width: 100%; }
.sidebar-scrim { display: none; }
@media (max-width: 1150px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  .page-content { padding: 1.5rem; }
  .order-filters { grid-template-columns: 1fr 1fr; }
  .quote-layout { grid-template-columns: 1fr; }
  .quote-paper { max-width: 794px; }
  .dashboard-lane { grid-template-columns: 1fr; }
  .dashboard-operational .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .app-shell .sidebar { width: 232px; z-index: 50; }
  .sidebar-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 49; border: 0; background: #13203366; }
  .app-header { padding-inline: 1rem; }
  .app-header .search { width: min(52vw,390px); }
  .profile-name { display: none; }
  .page-content { padding: 1.25rem 1rem; }
  .page-heading { flex-wrap: wrap; }
  .page-heading .form-actions { flex-wrap: wrap; }
  .dashboard-hero { padding: 1.2rem; gap: 1rem; }
  .dashboard-date { min-width: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; }
  .kpi-card { padding: .9rem; }
  .kpi-value { font-size: 1.5rem; }
  .kpi-heading { align-items: flex-start; }
  .kpi-symbol { display: none; }
  .module-screen .data-table th:last-child, .module-screen .data-table td:last-child { min-width: 110px; }
  .panel-caption { display: none; }
  .order-filters { grid-template-columns: 1fr; }
  .form-actions { gap: .5rem; }
}
@media print {
  .sig-footer, .sidebar-scrim { display: none !important; }
  .app-shell { display: block; background: white; }
  .app-main { min-height: 0; display: block; }
  .page-content { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.order-filters { overflow: visible; }
.order-filters .field { position: relative; }
.order-filters .localized-calendar { top: 100%; margin-top: .4rem; left: 0; }
[data-module="orders"] .data-table { min-width: 900px; }
[data-module="orders"] .data-table td:first-child { white-space: nowrap; }
[data-module="orders"] .data-table td:nth-child(2) { min-width: 145px; }
[data-module="orders"] .data-table td:nth-child(4) { min-width: 190px; }
@media (max-width: 760px) {
  .app-shell .sidebar { visibility: hidden; }
  .app-shell .sidebar.open { visibility: visible; }
}
.sidebar .brand-logo img { animation: none; transform: none; }
.calendar-footer { display: flex; justify-content: space-between; gap: .5rem; padding-top: .65rem; margin-top: .4rem; border-top: 1px solid var(--color-border); }
.calendar-footer button { border: 0; border-radius: 6px; padding: .4rem .65rem; background: var(--color-primary-soft); color: var(--color-primary-strong); cursor: pointer; font: inherit; font-size: .75rem; font-weight: 600; }
/* Shared month controls: symmetric hit areas, no font-dependent arrow baseline. */
.calendar-head { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: .4rem; }
.calendar-head button { display: grid; place-items: center; justify-self: center; width: 36px; height: 36px; min-height: 36px; margin: 0; padding: 0; line-height: 1; }
.calendar-head button svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.localized-calendar [aria-current="date"]:not(.selected) { outline: 1px solid var(--color-primary); outline-offset: -3px; }
.localized-calendar button:disabled { opacity: .4; cursor: not-allowed; }
.localized-date-input { font-variant-numeric: tabular-nums; }

/* Theme pairings: the accent is decorative; important text keeps strong contrast. */
:root { --ui-accent: #4e7a9b; --ui-ease: cubic-bezier(.22,.68,.26,1); }
html[data-theme="blue"] { --ui-accent: #7567a8; }
html[data-theme="green"] { --ui-accent: #668b72; }
html[data-theme="red"] { --ui-accent: #925974; }
html[data-theme="black"] { --ui-accent: #62748a; }
html[data-theme="gray"] { --ui-accent: #3e7b85; }
html[data-theme="laser-night"] { --ui-accent: #7a8940; --color-primary-strong: #4a5d16; }
.app-shell { background: linear-gradient(145deg, color-mix(in srgb, var(--color-primary-soft) 25%, #f5f7fa), #f5f7fa 65%); }
.app-shell .sidebar { background: linear-gradient(165deg, color-mix(in srgb, var(--sidebar-start) 55%, #152337), #131f30 80%); }
.app-shell .sidebar nav { background: none; box-shadow: none; border: 0; backdrop-filter: none; }
.sidebar .nav-item.active { background: linear-gradient(110deg, #ffffff20, #ffffff0b); border-color: #ffffff26; box-shadow: inset 3px 0 0 var(--nav-glow); }
.sidebar .nav-item.active .nav-icon { color: var(--nav-glow); }
.dashboard-hero { background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--ui-accent) 12%, transparent), transparent 65%), linear-gradient(115deg, white, var(--color-primary-soft)); }
.dashboard-hero::after { animation: none; opacity: .3; }
.data-table th::after { display: none; }
.data-table th { background: color-mix(in srgb, var(--color-primary-soft) 42%, #f1f4f8); }
.button.primary { background: linear-gradient(125deg, var(--color-primary-strong), color-mix(in srgb, var(--color-primary-strong) 65%, var(--color-primary))); }
.button, .table-action, .sidebar .nav-item, .profile-button, .panel-toggle, .kpi-card { transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s var(--ui-ease); }
.field input, .field select, .field textarea { transition: border-color .18s, box-shadow .18s; }
.button:active:not(:disabled), .table-action:active:not(:disabled) { transform: translateY(1px); }
.panel-toggle svg { transition: transform .2s var(--ui-ease); }
.panel-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
@media (hover: hover) {
  .button.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 15px color-mix(in srgb, var(--color-primary) 22%, transparent); }
  .kpi-card:hover { transform: translateY(-2px); border-color: var(--color-border); box-shadow: 0 7px 20px #172b4d0c; }
  .sidebar .nav-item:hover { transform: translateX(2px); }
}
@media (prefers-reduced-motion: no-preference) {
  .page-content > section { animation: workspace-enter .24s var(--ui-ease); }
  .profile-drawer:not([hidden]) .profile-card, .edit-card, .modal-card { animation: surface-enter .2s var(--ui-ease); }
  .localized-calendar:not([hidden]), .global-search-results { animation: surface-enter .16s var(--ui-ease); }
  .settings-collapsible:not(.is-collapsed) .settings-panel-body { animation: workspace-enter .2s var(--ui-ease); }
}
@keyframes workspace-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes surface-enter { from { opacity: 0; transform: translateY(4px) scale(.99); } to { opacity: 1; transform: none; } }

/* Mobile layouts keep forms fluid and wide data tables in their own scroll region. */
.module-screen, .quote-screen, .quote-layout > *, .two-col > * { min-width: 0; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.field:has(> .localized-calendar) { position: relative; }
.field > .localized-calendar { top: 100%; margin-top: .3rem; }
.quote-controls .field > .localized-calendar { top: auto; }
.localized-date-input:focus-visible { outline: 2px solid var(--color-primary-strong); outline-offset: 2px; }
.settings-collapsible:not(.is-collapsed) { max-height: none; }
.service-picker-modal { position: relative; }
.service-picker-header { padding-right: 2rem; }
.field input.sr-only { width: 1px; min-width: 1px; max-width: 1px; height: 1px; min-height: 1px; padding: 0; border: 0; }
.panel:has(.localized-calendar:not([hidden])) { overflow: visible; }
.settings-panel-body:has(.localized-calendar:not([hidden])) { overflow: visible; }
@media screen and (max-width: 760px) {
  body { min-width: 0; }
  .app-header { gap: .5rem; padding-inline: .75rem; }
  .app-header > .header-actions:first-child { flex: 1; min-width: 0; gap: .5rem; }
  .app-header .search { display: flex; flex: 1; width: auto; min-width: 0; padding: .5rem; }
  .app-header .search input { font-size: 16px; }
  .app-header .button.icon, .profile-button { min-width: 44px; min-height: 44px; flex-shrink: 0; }
  .profile-button { padding: .25rem; }
  .global-search-results { position: fixed; top: 66px; left: 12px; right: 12px; width: auto; max-height: 65dvh; overflow-y: auto; }
  .page-heading { gap: .8rem; }
  .page-heading > div { min-width: 0; max-width: 100%; }
  .page-heading h1 { font-size: clamp(1.45rem, 6vw, 1.7rem); overflow-wrap: anywhere; }
  .order-filters { gap: .85rem; }
  .order-filters .field { margin: 0; }
  .order-filters .form-actions { margin-top: .2rem; }
  .page-heading > .button, .page-heading > .form-actions { width: 100%; }
  .page-heading .form-actions { display: grid; grid-template-columns: 1fr; margin-top: 0; }
  .form-actions { flex-wrap: wrap; }
  .form-actions > .button { flex: 1 1 140px; }
  .button, .table-action, .status-select, .panel-toggle { min-height: 44px; }
  .panel-toggle { min-width: 44px; }
  .field input, .field textarea, .field select, .data-table select { font-size: 16px; }
  .field input:not([type="checkbox"]):not([type="radio"]):not(.sr-only), .field select { width: 100%; min-width: 0; max-width: 100%; }
  .field input[type="checkbox"], .field input[type="radio"] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; }
  .field input.sr-only { width: 1px; min-width: 1px; max-width: 1px; }
  .file-picker { max-width: 100%; flex-wrap: wrap; }
  .file-picker span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .file-picker em { min-width: 0; max-width: 100%; }
  .service-check { min-height: 44px; }
  .field:has(.appointment-time-wrap) .localized-date-input { width: 100%; }
  .field:has(.appointment-time-wrap) .appointment-time-wrap { position: static; display: grid; grid-template-columns: 1fr auto 1fr; width: 100%; padding: 0; margin-top: .2rem; }
  .service-picker-trigger { flex-wrap: wrap; padding: .75rem; gap: .45rem; }
  .service-picker-trigger small { font-size: .68rem; }
  .service-picker-modal { padding: 1rem; max-height: calc(100dvh - 1.5rem); }
  .service-picker-options { grid-template-columns: 1fr; }
  .service-picker-search { font-size: 16px; min-height: 44px; }
  .panel-header, .quote-controls-inner, .module-create { padding: 1rem; }
  .two-col:has(> .settings-collapsible) { gap: .75rem; }
  .settings-collapsible.access-panel { margin-top: .75rem; }
  .settings-collapsible > .panel-header { min-height: 60px; padding: .45rem .8rem; }
  .settings-collapsible > .panel-header h2 { font-size: .88rem; }
  .settings-collapsible.is-collapsed { max-height: 62px; }
  .panel-padding { padding: 1rem; }
  .table-wrap .data-table { min-width: 660px; }
  .table-wrap:has(.data-table)::before { content: 'Desliza para ver todas las columnas ↔'; display: block; width: calc(100vw - 34px); max-width: 100%; padding: .65rem 1rem; color: var(--color-muted); font-size: .7rem; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
  html[lang="pt-BR"] .table-wrap:has(.data-table)::before { content: 'Deslize para ver todas as colunas ↔'; }
  .data-table td { padding: .85rem; }
  .edit-backdrop, .modal-backdrop { padding: .65rem; }
  .edit-card, .modal-card { padding: 1.1rem; max-height: calc(100dvh - 1.3rem); overflow: auto; }
  .profile-drawer { padding: .75rem; }
  .profile-card { max-width: 100%; margin-top: 56px; max-height: calc(100dvh - 80px); overflow: auto; }
  .toast { z-index: 100; left: .75rem; right: .75rem; bottom: max(.75rem, env(safe-area-inset-bottom)); max-width: none; }
  .field > .localized-calendar, .quote-controls .field > .localized-calendar, .order-filters .localized-calendar { position: fixed; z-index: 75; left: .75rem; right: .75rem; top: auto; bottom: max(.75rem, env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: calc(100dvh - 90px); overflow-y: auto; padding: .85rem; margin: 0; box-shadow: 0 12px 60px #172b4d35; }
  .calendar-grid { gap: .1rem; }
  .calendar-grid button, .calendar-grid span { width: 100%; height: 35px; }
  .calendar-head button, .calendar-footer button { min-height: 36px; }
  .calendar-head { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .calendar-head button { width: 44px; height: 44px; }
  .quote-preview-wrap { padding: .5rem; overflow: visible; }
  .quote-paper { min-width: 0; width: 100%; min-height: 700px; padding: 1.25rem; box-shadow: 0 5px 20px #172b4d10; font-size: .78rem; }
  .quote-logo { width: 130px; margin-bottom: 1.5rem; }
  .quote-document-head { flex-wrap: wrap; gap: .8rem; padding-bottom: 1rem; }
  .quote-document-head h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
  .quote-date { text-align: left; font-size: .75rem; }
  .quote-client { margin: 1rem 0; overflow-wrap: anywhere; }
  .quote-items { table-layout: fixed; font-size: .73rem; }
  .quote-items th, .quote-items td { padding: .7rem .45rem; overflow-wrap: anywhere; }
  .quote-items th:last-child { width: 34%; }
  .quote-items td:last-child:not([colspan]), .quote-total strong { white-space: nowrap; }
  .quote-total { gap: 1rem; padding: 1rem .45rem; font-size: .86rem; }
  .quote-notes { margin-top: 1.2rem; overflow-wrap: anywhere; }
  .quote-paper footer { font-size: .62rem; }
  .sig-footer { padding-bottom: max(1rem, env(safe-area-inset-bottom)); text-align: center; line-height: 1.6; }
}
@media screen and (max-width: 370px) {
  .kpi-grid, .dashboard-operational .kpi-grid { grid-template-columns: 1fr; }
  .quote-paper { padding: 1rem; }
}
/* A single document layout for live quotes, saved quotes and order details. */
.quote-product-field { padding: 0; border: 0; min-width: 0; }
.quote-product-field legend { padding: 0; margin-bottom: .4rem; font-weight: 650; }
[data-quote-products] { grid-template-columns: 1fr; }
.quote-product-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; align-items: center; gap: .5rem; }
.quote-product-row + .quote-product-row { padding-top: .65rem; border-top: 1px solid var(--color-border); }
.quote-product-row .service-check { min-width: 0; margin: 0; }
.quote-product-description { min-width: 0; overflow-wrap: anywhere; }
.quote-product-description small { display: block; margin-top: .25rem; font-weight: 500; }
.quote-product-quantity { display: grid; gap: .25rem; font-size: .72rem; color: var(--color-muted); }
.quote-product-quantity input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: .55rem; border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-text); background: var(--color-surface); font: inherit; font-size: .9rem; }
.quote-product-quantity input:disabled { opacity: .5; }
.quote-product-quantity input:enabled:invalid { border-color: #b42318; }
.quote-quantity-error { grid-column: 1 / -1; color: #b42318; font-weight: 500; }
.quote-quantity-error[hidden] { display: none; }
.quote-manual-products { padding: 1rem; margin: 1rem 0; border: 1px dashed var(--color-border); border-radius: 12px; background: var(--color-surface-subtle); }
.quote-manual-products h3 { font-size: .9rem; margin: 0; }
.quote-manual-products > p { font-size: .78rem; line-height: 1.5; }
.quote-manual-products summary { cursor: pointer; font-size: .85rem; font-weight: 650; color: var(--color-primary-strong); padding: .6rem 0; }
.manual-product-values { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.manual-product-supplied { display: flex; gap: .5rem; align-items: center; font-size: .8rem; margin: .5rem 0 1rem; }
.manual-product-supplied input { width: auto; }
.manual-products-list { padding-left: 1.1rem; margin: .5rem 0; }
.manual-products-list li { padding: .6rem .1rem; border-bottom: 1px solid var(--color-border); font-size: .82rem; overflow-wrap: anywhere; }
.manual-products-list li::marker { color: var(--color-primary); }
.manual-products-list small { display: block; color: var(--color-muted); margin-top: .3rem; }
.manual-product-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.manual-product-actions button { min-height: 36px; padding: .25rem .65rem; border: 1px solid var(--color-border); border-radius: 7px; background: var(--color-surface); color: var(--color-primary-strong); font: inherit; cursor: pointer; }
.quote-item-origin { display: block; font-size: .72em; margin-top: .3rem; color: var(--color-primary-strong); }
.quote-item-section { margin-top: 1.1rem; }
.quote-item-section h3 { font-size: .95rem; margin: 0 0 .6rem; }
.quote-item-duration, .quote-item-unit-price { display: block; margin-top: .3rem; color: #58655f; font-size: .75em; }
.quote-items tfoot th, .quote-items tfoot td { background: #f4f7f5; color: #1f2c28; padding: .7rem .75rem; font-size: .85em; border-bottom: 1px solid #e0e7e3; }
.quote-items tfoot th { text-align: left; }
.quote-items td:last-child:not([colspan]) { white-space: nowrap; }
.quote-items .quote-section-empty { text-align: left; color: #58655f; font-size: .85em; }
.quote-labor-estimate { padding: 1rem; border: 1px solid #dfe7e2; border-radius: 10px; background: #f8faf9; }
.quote-labor-estimate > div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.quote-labor-estimate [data-quote-duration] { white-space: nowrap; }
.quote-labor-estimate p { color: #58655f; font-size: .75em; line-height: 1.5; margin: .5rem 0 0; }
.quote-history-link { padding: .35rem 0; border: 0; background: transparent; color: var(--color-primary-strong); font: inherit; font-weight: 650; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.quote-history-link:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 3px; }
.quote-document-dialog { width: min(880px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; padding: 1rem; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-background); color: var(--color-text); overflow: auto; }
.quote-document-dialog::backdrop { background: #152b3b88; backdrop-filter: blur(3px); }
.quote-document-actions { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; align-items: center; margin-bottom: 1rem; padding: .4rem 0; background: var(--color-background); }
.quote-document-actions > strong { margin-right: auto; }
.quote-document-actions [aria-pressed="true"] { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary-strong); }
@media screen and (max-width: 760px) {
  .quote-document-dialog { padding: .5rem; }
  .quote-labor-estimate > div { flex-wrap: wrap; gap: .5rem; }
  .quote-document-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-document-actions .button { width: 100%; min-height: 44px; padding: .6rem; }
  .quote-document-actions > strong { grid-column: 1 / -1; padding: .4rem; }
  .quote-history-link { min-height: 44px; }
}
@media print {
  .quote-screen > .page-heading { display: none !important; }
  body:has(.quote-document-dialog[open]) .app-shell { display: none !important; }
  .quote-document-dialog[open] { position: static; display: block; width: auto; max-width: none; height: auto; max-height: none; overflow: visible; padding: 0; margin: 0; border: 0; background: white; }
  .quote-document-dialog::backdrop { display: none; }
  .quote-items thead { display: table-header-group; }
  .quote-items tr, .quote-labor-estimate, .quote-total { break-inside: avoid; }
  .quote-item-section h3 { break-after: avoid; }
}
/* Record timestamps remain readable and selectable, but never editable. */
.edit-card .record-created-field { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.record-created-field > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; }
.record-created-field small { color: var(--color-muted); font-weight: 400; }
.edit-card .record-created-field input[readonly] { background: var(--color-background); color: var(--color-text); font-variant-numeric: tabular-nums; cursor: text; }
/* Work-in-progress protection and compact list tools. */
.draft-recovery { margin: 1rem; padding: 1rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); display: flex; flex-wrap: wrap; gap: .6rem; }
.draft-recovery p { flex-basis: 100%; margin: 0 0 .25rem; }
.draft-hint { margin: 0; color: var(--color-muted); font-size: .75rem; line-height: 1.5; }
.mobile-records { scroll-margin-top: 84px; }
.unsaved-dialog { width: min(480px, calc(100vw - 32px)); border: 1px solid var(--color-border); border-radius: 18px; padding: 24px; color: var(--color-text); background: var(--color-surface); box-shadow: 0 24px 80px #0003; }
.unsaved-dialog::backdrop { background: #152b3b66; backdrop-filter: blur(3px); }
.unsaved-dialog h2 { margin-top: 0; }
.unsaved-dialog p { line-height: 1.6; }
.quick-date-filters { display: flex; flex-wrap: wrap; gap: .5rem; grid-column: 1 / -1; }
.quick-date-filters .button { padding: .45rem .8rem; font-size: .8rem; min-height: 36px; box-shadow: none; }
.quick-date-filters .button[aria-pressed="true"] { background: var(--color-primary-soft); color: var(--color-primary-strong); border-color: var(--color-primary); }
.range-error { grid-column: 1 / -1; color: #b42318; margin: 0; }
.table-sort { border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; background: transparent; cursor: pointer; text-align: left; }
.table-sort:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }
.table-sort::after { content: ' ↕'; opacity: .6; }
[aria-sort="ascending"] .table-sort::after { content: ' ↑'; opacity: 1; }
[aria-sort="descending"] .table-sort::after { content: ' ↓'; opacity: 1; }
.list-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; padding: 1rem; border-top: 1px solid var(--color-border); }
.list-pagination span { margin-right: auto; font-size: .8rem; color: var(--color-muted); }
.list-pagination .button { padding: .45rem .8rem; min-height: 36px; box-shadow: none; }
.data-table tr[hidden] { display: none !important; }
.mobile-list-sort, .mobile-filter-toggle { display: none; }
@media (max-width: 760px) {
  .mobile-list-sort { display: grid; margin: 12px; }
  .mobile-filter-toggle { display: inline-flex; }
  #order-filters.mobile-filters-collapsed > .field, #order-filters.mobile-filters-collapsed > .form-actions { display: none; }
  .table-wrap:has(> .mobile-records)::before { display: none; }
  .table-wrap:has(> .mobile-records) { overflow: visible; background: transparent; }
  .mobile-records, .mobile-records tbody { display: block; width: 100%; min-width: 0 !important; }
  .mobile-records thead { display: none; }
  .mobile-records tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 14px; margin: 0 0 12px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); box-shadow: 0 3px 12px #00000005; }
  .mobile-records tbody td { display: grid; grid-template-columns: 95px minmax(0, 1fr); align-items: start; gap: 12px; width: auto !important; min-width: 0 !important; white-space: normal !important; overflow-wrap: anywhere; border: 0; padding: 8px 0; }
  .mobile-records tbody td::before { content: attr(data-label); color: var(--color-muted); font-size: .75rem; font-weight: 600; }
  .mobile-records tbody td:last-child { display: flex; justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--color-border); margin-top: 6px; padding-top: 12px; }
  .mobile-records tbody td:last-child::before { flex-basis: 100%; }
  .mobile-records select { max-width: 100%; min-height: 44px; flex: 1; }
  .mobile-records .table-action { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .quick-date-filters .button, .list-pagination .button { min-height: 44px; }
  .list-pagination { justify-content: space-between; }
  .unsaved-dialog .form-actions { display: grid; }
}
@media print {
  .data-table tr[hidden] { display: table-row !important; }
}
.profile-card { max-height: calc(100dvh - 100px); overflow-y: auto; }
.profile-help-links { display: grid; gap: 8px; margin: 18px 0; }
.profile-help-links button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); color: var(--color-text); text-align: left; cursor: pointer; font: inherit; }
.profile-help-links button:hover { background: var(--color-primary-soft); }
.profile-help-dialog { width: min(780px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--color-border); border-radius: 20px; background: var(--color-surface, #fff); color: var(--color-text); box-shadow: 0 24px 80px #0003; }
.profile-help-dialog::backdrop { background: #0b172970; backdrop-filter: blur(3px); }
.profile-help-dialog > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 1; padding: 22px 24px; border-bottom: 1px solid var(--color-border); background: var(--color-surface, #fff); }
.profile-help-dialog h2 { margin: 6px 0 0; font-size: clamp(21px, 4vw, 26px); }
.profile-help-dialog [data-close-help] { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary); font-size: 24px; cursor: pointer; }
.profile-help-body { padding: 24px; }
.help-search { margin-bottom: 20px; }
.help-questions details { border: 1px solid var(--color-border); border-radius: 12px; padding: 16px; margin-bottom: 10px; }
.help-questions summary { cursor: pointer; font-weight: 650; line-height: 1.5; }
.help-questions p, .help-legal-section p { line-height: 1.7; color: var(--color-muted); }
.help-questions .button { min-height: 44px; white-space: normal; text-align: left; }
.help-questions [hidden] { display: none; }
.help-review-note { padding: 14px 16px; background: var(--color-primary-soft); border-left: 3px solid var(--color-primary); border-radius: 8px; line-height: 1.6; }
.help-identity { display: grid; gap: 12px; margin: 24px 0; padding-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.help-identity dt { font-size: 12px; color: var(--color-muted); }
.help-identity dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.help-legal-section { margin: 24px 0; }
.help-legal-section h3 { font-size: 16px; }
.help-legal-section ul { padding-left: 20px; line-height: 2; }
@media (max-width: 600px) { .profile-help-dialog > header, .profile-help-body { padding: 18px; } .help-questions details { padding: 14px; } }
