:root {
  --ink: #17202a;
  --muted: #718096;
  --line: #e5e9ef;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --nav: #152721;
  --accent: #1f8a70;
  --accent-soft: #e4f4ef;
  --warning: #d97706;
  --danger: #c2413b;
  --shadow: 0 18px 55px rgba(24, 39, 34, .12);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #e3f4ed 0, transparent 32%), #f5f6f4; }
.login-card { width: min(440px, 100%); padding: 42px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.login-card h1 { margin: 8px 0; font-size: 34px; }
.login-card form { display: grid; gap: 16px; margin: 28px 0 18px; }
.login-card small { color: var(--muted); }
.app-logo { display: block; max-width: 100%; object-fit: contain; }
.login-logo { width: 230px; max-height: 126px; margin-bottom: 10px; }

label { display: grid; gap: 7px; color: #45505d; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid #d8dee6; border-radius: 10px; outline: none; color: var(--ink); background: white; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,138,112,.12); }
.primary, .secondary { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 800; }
.primary { background: var(--accent); color: white; }
.secondary { background: #edf0f3; color: var(--ink); }
.full { width: 100%; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; flex: 0 0 264px; width: 264px; min-width: 264px; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; border-right: 1px solid rgba(255,255,255,.08); background: var(--nav); color: white; box-shadow: 8px 0 28px rgba(17,35,29,.08); overflow: hidden; }
.sidebar-brand { display: flex; align-items: center; width: 100%; padding: 0 8px 27px; border: 0; border-bottom: 1px solid rgba(255,255,255,.1); background: transparent; cursor: pointer; }
.sidebar-brand:hover .sidebar-logo { box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.sidebar-brand:focus-visible { outline: 2px solid rgba(255,255,255,.55); outline-offset: 4px; border-radius: 16px; }
.sidebar-logo { width: 178px; padding: 8px; border-radius: 14px; background: white; }
#main-nav { min-height: 0; display: grid; gap: 6px; margin-top: 22px; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.nav-button, .logout { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 0; border-radius: 10px; color: #bed0ca; background: transparent; text-align: left; transition: background .18s ease, color .18s ease, box-shadow .18s ease; transform: none; }
.nav-button:hover { color: white; background: rgba(255,255,255,.07); box-shadow: inset 3px 0 0 rgba(80,201,166,.45); }
.nav-button.active { color: white; background: linear-gradient(90deg, rgba(31,138,112,.42), rgba(31,138,112,.18)); box-shadow: inset 3px 0 0 #50c9a6; }
.nav-icon { width: 22px; display: grid; place-items: center; font-size: 17px; }
.nav-label { font-weight: 700; }
.nav-active-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #6ee7c4; box-shadow: 0 0 0 4px rgba(110,231,196,.1); }
.account-actions { margin-top: auto; display: grid; gap: 4px; }
.logout { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); border-radius: 0; }

main { position: relative; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: none; }
.topbar h1 { margin: 0; font-size: 26px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 900; }
.user-chip div { display: grid; }
.user-chip small { color: var(--muted); }
#content { flex: 1; padding: 20px 26px 30px; }
.app-watermark { display: flex; justify-content: flex-end; padding: 0 26px 18px; pointer-events: none; user-select: none; }
.app-watermark img { width: 118px; opacity: .2; filter: grayscale(1); }

.page-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-bottom: 14px; }
.page-actions > div:first-child { display: none; }
.page-action-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.page-actions h2 { margin: 0; font-size: 20px; }
.empty-actions { margin-top: 12px; }
.module-tabs { display: flex; gap: 5px; margin: -8px 0 18px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.module-tab { padding: 11px 15px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; }
.module-tab:hover, .module-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.status-filter-menu { position: relative; margin: 3px 0 6px auto; }
.status-filter-trigger { min-width: 160px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: #45505d; background: white; font-size: 12px; font-weight: 800; }
.status-filter-trigger span { display: grid; min-width: 34px; height: 20px; place-items: center; border-radius: 99px; color: var(--accent); background: var(--accent-soft); font-size: 10px; }
.status-filter-panel { position: absolute; z-index: 8; top: calc(100% + 6px); right: 0; width: 250px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.status-filter-actions { display: flex; gap: 6px; margin-bottom: 7px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.status-filter-actions button { padding: 6px 8px; border: 0; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 900; }
.status-check { display: flex; grid-auto-flow: column; align-items: center; justify-content: start; gap: 9px; padding: 7px 5px; cursor: pointer; }
.status-check:hover { border-radius: 6px; background: #f6f8f9; }
.status-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.status-check span { color: var(--ink); font-size: 12px; font-weight: 700; }
.tab-count { display: inline-grid; min-width: 20px; height: 20px; margin-left: 5px; place-items: center; border-radius: 99px; color: var(--danger); background: #fae9e7; font-size: 10px; }
.bulk-service-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.bulk-service-actions > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.bulk-service-actions > span strong { color: var(--accent); }
.bulk-service-actions select { width: auto; min-width: 190px; padding-block: 9px; }
.bulk-service-actions button { padding-block: 9px; }
.select-column { width: 38px; text-align: center; }
.select-column input { width: 17px; height: 17px; accent-color: var(--accent); }
.bulk-service-actions button:disabled { cursor: default; opacity: .45; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.stat, .panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 5px 18px rgba(30,48,42,.04); }
.stat { padding: 19px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 8px; font-size: 29px; }
.stat small { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px; }
.panel { padding: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.text-button { border: 0; color: var(--accent); background: none; font-weight: 800; }
.dashboard-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, #ffffff 0%, #f4fbf8 100%); box-shadow: 0 8px 24px rgba(30,48,42,.05); }
.dashboard-hero h2 { margin: 2px 0 5px; font-size: 25px; }
.dashboard-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.dashboard-actions button { white-space: nowrap; }
.dashboard-values { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin: -8px 0 24px; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 20px; }
.dashboard-grid-balanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-panel-large { min-height: 310px; }
.value-stat strong { font-size: 24px; overflow-wrap: anywhere; }
.chart { display: grid; gap: 18px; min-height: 235px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-bars { height: 205px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 14px; padding-top: 8px; }
.chart-month { min-width: 0; display: grid; gap: 8px; align-items: end; }
.chart-group { height: 176px; display: flex; align-items: end; justify-content: center; gap: 5px; padding: 8px 7px 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfcfc, #f6f8f9); border-radius: 8px 8px 0 0; }
.chart-bar { width: 16px; min-height: 6px; border-radius: 5px 5px 0 0; transition: height .2s ease; }
.chart-month strong { color: var(--muted); font-size: 11px; text-align: center; text-transform: uppercase; }
.inserted { background: #356e9a; }
.ready { background: var(--warning); }
.done { background: var(--accent); }
.value-bars { display: grid; gap: 15px; }
.value-row { display: grid; gap: 8px; }
.value-row div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.value-row strong { font-size: 13px; }
.value-row span { color: var(--muted); font-size: 12px; font-weight: 800; }
.value-track { height: 10px; overflow: hidden; border-radius: 99px; background: #edf0f3; }
.value-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.task-list { display: grid; gap: 9px; }
.task-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fbfcfc; text-align: left; }
.task-item:hover { border-color: #b7ddd1; background: var(--accent-soft); }
.task-item span { min-width: 0; display: grid; gap: 3px; }
.task-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.task-item small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.task-item em { flex: 0 0 auto; font-style: normal; }
.dashboard-alert-item { border-color: #f0d2ce; background: #fffafa; }
.dashboard-status-list { display: grid; gap: 12px; }
.dashboard-status-row { display: grid; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.dashboard-status-row span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dashboard-status-row strong { font-size: 13px; }
.dashboard-status-row small { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.dashboard-status-row i { display: block; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #7bd8bd); }
.empty.compact { padding: 22px; }
.quote-panel { align-self: start; }
.quote-approval-list { display: grid; gap: 10px; }
.quote-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.quote-card-main { min-width: 0; display: grid; gap: 4px; }
.quote-card-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.quote-card-main small, .quote-card-value span, .quote-note { color: var(--muted); font-size: 12px; }
.quote-card-value { display: grid; gap: 3px; text-align: right; white-space: nowrap; }
.quote-card-value strong { color: var(--accent); font-size: 16px; }
.quote-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.quote-actions .primary { padding: 7px 10px; border-radius: 7px; font-size: 11px; }
.quote-note { margin: -2px 0 12px; }
.finance-history-panel { margin-top: 20px; }
.taxonomy-form { display: grid; grid-template-columns: 180px repeat(3, minmax(0, 1fr)); gap: 13px; align-items: end; }
.taxonomy-form label { display: grid; gap: 6px; color: #45505d; font-size: 12px; font-weight: 800; }
.master-table-form .taxonomy-value-field { grid-column: span 2; }
.taxonomy-form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; }
.taxonomy-help { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 12px; }
.taxonomy-editor { overflow: visible; }
.product-taxonomy-forms { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.product-family-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.table-mode-tabs { margin-bottom: 16px; flex-wrap: wrap; }
.notification-template-editor { padding: 14px 0; border-top: 1px solid var(--line); }
.notification-template-editor summary { cursor: pointer; font-weight: 700; margin-bottom: 12px; }
.notification-template-editor .form-grid { margin-bottom: 12px; }
.tables-selector-panel > .tables-selector-group { margin-bottom: 16px; }
.compact-stats { margin-bottom: 18px; }
.tables-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; align-items: start; }
.tables-selector-panel { position: sticky; top: 18px; max-height: calc(100vh - 160px); overflow: auto; }
.tables-selector-groups { display: grid; gap: 16px; }
.tables-selector-group { display: grid; gap: 8px; }
.tables-selector-group > strong { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.table-selector-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fbfcfc; text-align: left; }
.table-selector-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.table-selector-item.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.table-selector-item span { min-width: 0; display: grid; gap: 3px; }
.table-selector-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.table-selector-item small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.table-selector-item em { flex: 0 0 auto; min-width: 28px; padding: 4px 7px; border-radius: 99px; color: #45505d; background: #eef1f4; font-size: 11px; font-style: normal; font-weight: 900; text-align: center; }
.table-workspace-panel { display: grid; gap: 16px; }
.selected-table-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.selected-table-summary span { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; color: #45505d; font-size: 12px; }
.selected-table-summary strong { color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.table-form-block, .table-values-block { display: grid; gap: 12px; }
.table-form-block h4, .table-values-block h4 { margin: 0; color: #45505d; font-size: 13px; }
.product-field-labels { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfc; }
.product-field-labels .form-section-title { margin: 0; }
.product-field-labels > .muted { font-size: 12px; }
.product-field-label-grid { margin-top: 4px; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.products-layout { grid-template-columns: 330px minmax(0, 1fr); }
.products-workspace-panel { min-width: 0; }
.product-family-panel .table-selector-item em { min-width: 34px; }
.product-family-panel .table-selector-item em:not(:only-child) { white-space: nowrap; }
.product-characteristics-cell { max-width: 185px; }
.product-characteristics { max-width: 185px; display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.product-characteristics strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.product-characteristics small { flex: 0 0 auto; padding: 2px 6px; border-radius: 99px; color: var(--muted); background: #eef1f4; font-size: 10px; font-weight: 900; }
.product-characteristics.compact-muted strong { color: var(--muted); font-weight: 700; }
.supplier-form { display: grid; gap: 14px; }
.supplier-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.supplier-form-grid .wide { grid-column: 1 / -1; }
button:disabled { cursor: default; opacity: .45; }
.agenda-actions { align-items: flex-start; }
.agenda-action-buttons { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.agenda-filter { width: auto; min-width: 160px; padding-block: 9px; }
.calendar-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.agenda-week-controls { display: inline-flex; align-items: center; gap: 7px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.agenda-week-controls button { min-width: 34px; padding: 7px 10px; font-size: 18px; line-height: 1; }
.agenda-week-controls span { min-width: 168px; color: #45505d; font-size: 12px; font-weight: 900; text-align: center; white-space: nowrap; }
.agenda-stats .stat strong { font-size: 24px; }
.agenda-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.agenda-panel-large { min-height: 330px; }
.agenda-form-panel { margin-bottom: 20px; overflow: visible; }
.agenda-task-panel-head { gap: 12px; }
.agenda-task-title { min-width: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.agenda-completed-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.agenda-completed-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.agenda-task-form { display: grid; grid-template-columns: minmax(240px, 1.2fr) 170px 190px 150px; gap: 14px; align-items: end; }
.agenda-task-form .wide { grid-column: 1 / -1; }
.agenda-form-actions { display: flex; justify-content: flex-end; }
.agenda-form-actions .secondary { margin-right: auto; }
.agenda-task-list, .agenda-timeline { display: grid; gap: 10px; }
.agenda-task-card, .agenda-service-card { display: grid; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.agenda-task-card { grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 10px 12px; }
.agenda-task-card.overdue { border-color: #ef9a9a; background: #fff7f7; }
.agenda-task-card strong, .agenda-service-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-task-card small, .agenda-service-card small, .agenda-date span { color: var(--muted); font-size: 11px; }
.agenda-task-card p, .agenda-service-card p { margin: 7px 0 0; color: #45505d; font-size: 12px; line-height: 1.4; }
.agenda-task-info { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.agenda-task-info .overdue-text { color: #c62828; }
.agenda-task-history { display: grid; gap: 4px; margin-top: 9px; color: #45505d; font-size: 11px; }
.agenda-task-history small { color: var(--accent); font-weight: 900; }
.agenda-task-history span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-form-history { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.agenda-form-history > strong { font-size: 13px; }
.agenda-history-list { display: grid; gap: 8px; max-height: 210px; overflow: auto; }
.agenda-history-list div { display: grid; gap: 4px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.agenda-history-list strong { font-size: 12px; }
.agenda-history-list small, .agenda-history-list span { color: var(--muted); font-size: 11px; }
.agenda-history-list p { margin: 0; color: #45505d; font-size: 12px; line-height: 1.35; }
.agenda-task-meta { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.agenda-task-meta > span { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.agenda-task-meta > span.overdue-text { color: #c62828; }
.agenda-service-card { grid-template-columns: 125px minmax(0, 1fr) auto auto auto; align-items: center; }
.agenda-service-actions { justify-content: flex-end; flex-wrap: wrap; }
.agenda-date { display: grid; gap: 2px; padding-right: 11px; border-right: 1px solid var(--line); }
.agenda-date strong { color: var(--accent); font-size: 12px; }

.table-wrap { max-height: min(62vh, 680px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; z-index: 2; top: 0; padding: 11px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f8fafb; font-size: 11px; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
td { padding: 13px 11px; border-top: 1px solid var(--line); }
tbody tr:hover { background: #f8fbfa; }
tbody tr[hidden] { display: none; }
td strong { display: block; }
td small { color: var(--muted); }
.data-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.data-search { position: relative; width: min(380px, 100%); display: block; }
.data-search span { position: absolute; z-index: 1; left: 13px; top: 50%; color: var(--muted); font-size: 18px; transform: translateY(-50%); }
.data-search input { padding-left: 38px; background: #f8fafb; }
.data-toolbar-right { display: flex; align-items: center; gap: 9px; }
.data-toolbar-right { flex-wrap: wrap; justify-content: flex-end; }
.page-size-label { display: flex; grid-auto-flow: column; align-items: center; gap: 8px; white-space: nowrap; }
.page-size { width: 72px; padding-block: 9px; }
.search-field { width: auto; min-width: 170px; padding-block: 9px; }
.product-filter { width: auto; min-width: 125px; padding-block: 9px; }
.filter-button { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: #45505d; background: white; font-weight: 800; }
.filter-button:hover { color: var(--accent); border-color: var(--accent); }
.data-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 8px; }
.pagination button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font-size: 19px; }
.pagination button:disabled { cursor: default; opacity: .35; }
.page-indicator { min-width: 48px; text-align: center; font-weight: 800; }
.row-actions { width: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.row-actions .action-button[data-edit-service],
.row-actions .action-button[data-edit-client],
.row-actions .action-button[data-edit-project],
.row-actions .action-button[data-edit-supplier],
.row-actions .action-button[data-edit-stock],
.row-actions .action-button[data-edit-catalog-service],
.row-actions .action-button[data-edit-technician],
.row-actions .action-button[data-edit-user],
.row-actions .action-button[data-edit-agenda-task],
.row-actions .action-button[data-edit-master-table-key],
.row-actions .action-button[data-edit-product-family],
.row-actions .action-button[data-edit-product-table] { order: 99; margin-left: auto; }
.repair-print-actions { flex-wrap: wrap; white-space: normal; }
.action-button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: #45505d; background: white; font-size: 11px; font-weight: 800; }
.action-button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.action-button.danger:hover { color: var(--danger); border-color: #e8aaa6; background: #fae9e7; }
.action-button.primary-action { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.action-button.primary-action:hover { color: white; background: var(--accent); }
.print-model-grid { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 22px 26px; overflow-y: auto; }
.print-model-option { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcfc; text-align: left; }
.print-model-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.print-model-option strong { font-size: 14px; }
.print-model-option span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.badge { display: inline-block; padding: 5px 8px; border-radius: 99px; background: #eef1f4; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.em-curso, .badge.agendado { color: #176d5a; background: var(--accent-soft); }
.badge.urgente, .badge.stock-baixo { color: var(--danger); background: #fae9e7; }
.badge.atrasada, .badge.prazo { color: var(--danger); background: #fae9e7; }
.badge.concluido { color: #4d6477; background: #e9eef2; }
.badge.novo { color: #8b5a08; background: #fff2cf; }
.badge.orcamento-aceite { color: #176d5a; background: var(--accent-soft); }
.badge.orcamento-recusado { color: var(--danger); background: #fae9e7; }

.timeline { display: grid; gap: 15px; }
.timeline-item { display: grid; grid-template-columns: 10px 1fr; gap: 12px; }
.dashboard-activity { width: 100%; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.dashboard-activity:hover p { color: var(--accent); }
.dashboard-timeline { gap: 13px; }
.timeline-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-item p { margin: 0; font-size: 13px; }
.timeline-item small { color: var(--muted); }
.empty { padding: 38px; color: var(--muted); text-align: center; }

dialog { width: min(780px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
#service-dialog { width: min(1120px, calc(100% - 32px)); }
#project-dialog { width: min(1120px, calc(100% - 32px)); }
#detail-dialog { width: min(900px, calc(100% - 32px)); }
#detail-dialog.project-detail { width: min(1120px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(12,24,20,.55); backdrop-filter: blur(3px); }
dialog form { max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.detail-dialog-content { max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.dialog-head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: start; margin: 0; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); background: white; }
.dialog-head h2 { margin: 0; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #eef1f3; font-size: 22px; }
dialog form > .form-grid { flex: 1 1 auto; padding: 22px 26px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#service-dialog .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#service-dialog .wide { grid-column: 1 / -1; }
#project-dialog .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#project-dialog .wide { grid-column: 1 / -1; }
.repair-text-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wide { grid-column: 1 / -1; }
.checkbox-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f9fafb; cursor: pointer; }
.checkbox-label input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.checkbox-label span { display: grid; gap: 3px; }
.checkbox-label strong { color: var(--ink); font-size: 13px; }
.checkbox-label small { color: var(--muted); font-weight: 500; line-height: 1.35; }
.portal-credentials { padding: 16px; border: 1px solid #b7ddd1; border-radius: 11px; background: var(--accent-soft); }
.form-section-title { margin: 0 0 13px; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.technical-fields { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafb; }
.technical-fields > .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.line-items-section { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.line-items-head div { display: grid; gap: 3px; }
.line-items-head small { color: var(--muted); font-size: 11px; }
.line-item-adder { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; margin-top: 12px; }
.product-autocomplete { position: relative; min-width: 0; }
.product-search-results { position: absolute; z-index: 12; top: calc(100% + 5px); left: 0; right: 0; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.product-result { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; }
.product-result:last-child { border-bottom: 0; }
.product-result:hover, .product-result:focus { background: var(--accent-soft); outline: none; }
.product-result div { min-width: 0; display: grid; gap: 2px; }
.product-result strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.product-result small { color: var(--muted); font-size: 10px; }
.product-result > span { color: var(--accent); font-size: 11px; font-weight: 900; white-space: nowrap; }
.product-result-empty { padding: 16px; color: var(--muted); font-size: 12px; text-align: center; }
.product-autocomplete.has-selection input[type="search"] { border-color: var(--accent); background: var(--accent-soft); }
.selected-lines { display: grid; gap: 7px; margin-top: 10px; }
.selected-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.selected-line div { min-width: 0; display: grid; }
.selected-line strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selected-line small { color: var(--muted); font-size: 10px; }
.selected-line .line-quantity { color: var(--accent); font-size: 12px; font-weight: 900; white-space: nowrap; }
.line-value { min-width: 82px; font-size: 12px; font-weight: 900; text-align: right; white-space: nowrap; }
.remove-line { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 7px; color: var(--danger); background: #fae9e7; font-weight: 900; }
.selected-lines .empty-line { padding: 7px 0 0; color: var(--muted); font-size: 11px; }
.project-tags-section { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.project-tag-adder { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.project-tags-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.project-tag-item { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 12px; }
.project-tag-item label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.project-tag-item input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.project-tag-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-tag-item.done { color: var(--muted); background: var(--accent-soft); border-color: #b7ddd1; }
.project-tag-item.done span { text-decoration: line-through; }
.project-lock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 9px 10px; border: 1px solid #b7ddd1; border-radius: 9px; background: var(--accent-soft); }
.project-lock-row span { color: var(--accent); font-size: 12px; font-weight: 800; }
select.locked-select { color: var(--muted); background: #f4f7f6; cursor: not-allowed; }
.order-value-summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 17px; border: 1px solid #b7ddd1; border-radius: 11px; background: var(--accent-soft); }
.order-value-summary span { color: var(--accent); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.order-value-summary strong { color: var(--accent); font-size: 22px; }
.repair-photos-section { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.repair-photos-section .line-items-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.photo-upload-button { display: inline-flex; align-items: center; justify-content: center; padding: 9px 12px; border-radius: 8px; color: white; background: var(--accent); font-size: 12px; font-weight: 900; cursor: pointer; }
.photo-upload-button input { display: none; }
.repair-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; margin-top: 13px; }
.repair-photo-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; }
.repair-photo-card img { width: 100%; height: 110px; display: block; object-fit: cover; background: #eef1f3; }
.repair-photo-card div { padding: 7px 9px; }
.repair-photo-card strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.repair-photo-card small { color: var(--muted); font-size: 9px; }
.remove-photo { position: absolute; top: 6px; right: 6px; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 50%; color: white; background: rgba(161, 42, 35, .88); font-size: 17px; font-weight: 900; }
.repair-photo-empty { grid-column: 1 / -1; padding: 15px; border: 1px dashed #cad2da; border-radius: 8px; color: var(--muted); font-size: 11px; text-align: center; }
.project-file-list { display: grid; gap: 8px; margin-top: 13px; }
.project-file-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.project-file-card strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.project-file-card small { color: var(--muted); font-size: 10px; }
.project-file-actions { display: flex; align-items: center; gap: 6px; }
.detail-photos, .detail-history { grid-column: 1 / -1; }
.detail-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.detail-photo-grid a { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; }
.detail-photo-grid img { width: 100%; height: 125px; display: block; object-fit: cover; }
.detail-file-list { display: grid; gap: 8px; margin-top: 8px; }
.detail-file-list a { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; text-decoration: none; }
.detail-file-list a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.detail-file-list small { color: var(--muted); }
.dialog-actions { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 16px 26px; border-top: 1px solid var(--line); background: white; }
.detail-grid { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 22px 26px; overflow-y: auto; }
.detail-item { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; }
.detail-item span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.detail-item strong { display: block; overflow-wrap: anywhere; font-size: 13px; white-space: pre-line; }
.detail-action { margin-top: 9px; }
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 2147483647; max-width: min(440px, calc(100vw - 48px)); padding: 13px 17px; border-radius: 10px; color: white; background: var(--nav); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
#toast.toast-in-dialog { right: 30px; bottom: 30px; }
#toast.show { opacity: 1; transform: translateY(0); }

.mobile-navigation-bar, .mobile-menu-backdrop { display: none; }
.server-save-status { margin: 0; padding: 8px 18px; color: var(--accent); font-size: 12px; background: white; border-bottom: 1px solid var(--line); }
.server-save-status.save-error { color: var(--danger); font-weight: 700; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 76px 1fr; }
  .sidebar { flex-basis: 76px; width: 76px; min-width: 76px; padding-inline: 11px; }
  .nav-label, .nav-active-dot, .logout .nav-label { display: none; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-logo { width: 48px; height: 48px; padding: 5px; object-fit: contain; }
  #main-nav { gap: 8px; }
  .nav-button { justify-content: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .dashboard-hero { display: grid; }
  .dashboard-actions { justify-content: flex-start; }
  .dashboard-values { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quote-card { grid-template-columns: 1fr; align-items: start; }
  .quote-card-value { text-align: left; }
  .quote-actions { justify-content: flex-start; }
  .taxonomy-form { grid-template-columns: 1fr 1fr; }
  .product-taxonomy-forms { grid-template-columns: 1fr; }
  .tables-layout { grid-template-columns: 1fr; }
  .tables-selector-panel { position: static; max-height: none; }
  .tables-selector-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-field-label-grid { grid-template-columns: 1fr 1fr; }
  .supplier-form-grid { grid-template-columns: 1fr 1fr; }
  .agenda-grid { grid-template-columns: 1fr; }
  .agenda-task-form { grid-template-columns: 1fr 1fr; }
  .agenda-service-card { grid-template-columns: 1fr; }
  .agenda-date { padding-right: 0; border-right: 0; }
  #service-dialog .form-grid { grid-template-columns: 1fr 1fr; }
  #project-dialog .form-grid { grid-template-columns: 1fr 1fr; }
  .technical-fields > .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .app-shell { display: grid; grid-template-columns: 68px minmax(0, 1fr); }
  .sidebar { position: sticky; z-index: 5; top: 0; bottom: auto; flex-basis: 68px; width: 68px; min-width: 68px; height: 100vh; flex-direction: column; padding: 14px 8px; }
  .sidebar-brand { display: flex; padding: 0 6px 16px; }
  .sidebar-logo { width: 44px; height: 44px; padding: 4px; }
  #main-nav { width: 100%; display: grid; gap: 6px; margin-top: 14px; overflow-x: visible; overflow-y: auto; }
  .nav-button { min-height: 44px; padding: 10px 4px; }
  .logout { display: flex; justify-content: center; }
  .topbar, #content { padding-inline: 18px; }
  #content { padding-bottom: 40px; }
  .user-chip div { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat strong { font-size: 23px; }
  .chart-bars { gap: 7px; }
  .chart-group { gap: 3px; padding-inline: 4px; }
  .chart-bar { width: 10px; }
  .task-item { align-items: flex-start; flex-direction: column; }
  .task-item em { align-self: flex-start; }
  .taxonomy-form { grid-template-columns: 1fr; }
  .tables-selector-groups { grid-template-columns: 1fr; }
  .selected-table-summary { grid-template-columns: 1fr; }
  .product-field-label-grid { grid-template-columns: 1fr; }
  .supplier-form-grid { grid-template-columns: 1fr; }
  .master-table-form .taxonomy-value-field { grid-column: auto; }
  .taxonomy-form-actions { justify-content: flex-start; }
  .agenda-task-form { grid-template-columns: 1fr; }
  .print-model-grid { grid-template-columns: 1fr; }
  .agenda-task-card { grid-template-columns: 1fr; }
  .agenda-task-meta { justify-items: start; min-width: 0; }
  .page-actions { align-items: flex-start; }
  .module-tabs { flex-wrap: wrap; }
  .bulk-service-actions { align-items: stretch; flex-wrap: wrap; }
  .bulk-service-actions > span { width: 100%; margin-right: 0; }
  .bulk-service-actions select { flex: 1; min-width: 160px; }
  .status-filter-menu { width: 100%; margin-left: 0; }
  .status-filter-trigger { width: 100%; }
  .status-filter-panel { right: auto; left: 0; width: min(100%, 280px); }
  .data-toolbar { align-items: stretch; flex-direction: column; }
  .data-search { width: 100%; }
  .data-toolbar-right { justify-content: space-between; }
  .filter-button span { display: none; }
  .data-footer { align-items: flex-start; flex-direction: column; }
  .table-wrap { max-height: 58vh; }
  .form-grid { grid-template-columns: 1fr; }
  .technical-fields > .form-grid { grid-template-columns: 1fr; }
  #service-dialog .form-grid { grid-template-columns: 1fr; }
  #project-dialog .form-grid { grid-template-columns: 1fr; }
  .repair-text-fields { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .checkbox-options { grid-template-columns: 1fr; }
  .line-item-adder { grid-template-columns: 1fr 72px; }
  .line-item-adder button { grid-column: 1 / -1; }
}

@media screen and (max-width: 900px) {
  .app-shell { display: block; }
  .mobile-navigation-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; background: white; border-bottom: 1px solid var(--line); }
  .mobile-brand { border: 0; background: white; padding: 0; }
  .mobile-brand img { display: block; width: 112px; height: 48px; object-fit: contain; }
  .mobile-menu-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 29; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgba(12,24,20,.5); }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(290px, 86vw); min-width: 0; height: 100vh; height: 100dvh; padding: 18px 14px; transform: translateX(-100%); visibility: hidden; }
  .mobile-menu-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-brand { justify-content: flex-start; padding: 0 8px 16px; }
  .sidebar-logo { width: 160px; height: auto; max-height: 95px; }
  .sidebar .nav-label { display: inline; }
  .sidebar .nav-button, .sidebar .logout { justify-content: flex-start; padding: 12px; min-height: 44px; }
  #main-nav { margin-top: 14px; overflow-y: auto; flex: 1 1 auto; }
  .account-actions { flex-shrink: 0; }
  main, #content, .panel, .form-grid > *, fieldset { min-width: 0; }
  #content { padding: 16px 12px 32px; }
  .filter-button span { display: inline; }
  .task-item strong, .task-item small, .table-selector-item b, .table-selector-item small, .agenda-task-card strong, .agenda-service-card strong, .agenda-task-history span, .project-tag-item span, .selected-line strong, .product-result strong { white-space: normal; overflow-wrap: anywhere; }
  dialog, #service-dialog, #project-dialog, #detail-dialog, #detail-dialog.project-detail { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  dialog form, .detail-dialog-content { max-height: calc(100dvh - 16px); }
  input, select, textarea { font-size: 16px; min-width: 0; }
  button { min-height: 40px; }
}

@media screen and (max-width: 620px) {
  .panel { padding: 12px; }
  .page-actions, .panel-head, .page-action-group, .dialog-actions, .quote-actions { flex-wrap: wrap; gap: 8px; }
  .page-actions { justify-content: flex-end; }
  .page-action-group { display: flex; }
  .data-toolbar-right { justify-content: flex-start; width: 100%; }
  .search-field, .product-filter { width: 100%; min-width: 0; }
  .table-wrap:has(.mobile-records) { max-height: none; overflow: visible; border: 0; border-radius: 0; }
  .mobile-records, .mobile-records tbody { display: block; width: 100%; }
  .mobile-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mobile-records tbody tr:not([hidden]) { display: block; padding: 8px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
  .mobile-records td { display: block; width: 100%; padding: 8px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .mobile-records td:first-child { border-top: 0; }
  .mobile-records td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
  .mobile-records td[data-label=""]::before { display: none; }
  .mobile-records .row-actions { flex-wrap: wrap; gap: 8px; white-space: normal; }
  .mobile-records .action-button { min-height: 44px; }
  .dialog-head, dialog form > .form-grid, .detail-grid, .print-model-grid, .dialog-actions { padding: 14px; }
  .dialog-head h2 { font-size: 20px; overflow-wrap: anywhere; }
  .dialog-actions button { flex: 1 1 auto; min-height: 44px; }
  .line-item-adder { grid-template-columns: minmax(0, 1fr); }
  .line-item-adder button { grid-column: auto; }
  .selected-line { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .selected-line > div { grid-column: 1 / -1; }
  .selected-line .remove-line { grid-column: 2; justify-self: end; }
  .project-tag-item { flex-wrap: wrap; }
  .project-tag-adder { grid-template-columns: minmax(0, 1fr); }
  .agenda-week-controls { width: 100%; justify-content: space-between; }
  .agenda-week-controls span { min-width: 0; white-space: normal; }
  .product-characteristics-cell, .product-characteristics { max-width: none; }
  .product-characteristics strong { white-space: normal; overflow-wrap: anywhere; }
  .stats { gap: 8px; }
  .stat { padding: 12px; min-width: 0; }
  .stat strong { font-size: 22px; overflow-wrap: anywhere; }
  .login-shell { padding: 12px; }
  .login-card { padding: 24px 18px; }
  .login-card h1 { font-size: 28px; }
}

#bulk-print-area { display: none; }
@page { size: A4; margin: 8mm; }
@page repair-label-page { size: 60mm 25mm; margin: 0; }
@media print {
  body > *:not(#bulk-print-area) { display: none !important; }
  #bulk-print-area { display: block; color: #111; background: white; font-family: Arial, sans-serif; }
  .print-order { position: relative; box-sizing: border-box; width: 100%; min-height: 281mm; page-break-after: always; padding: 4mm 6mm 8mm; overflow: visible; break-after: page; }
  .print-order:last-child { page-break-after: auto; }
  .print-order:last-child { break-after: auto; }
  .print-watermark { position: absolute; z-index: 0; inset: 56mm 0 auto; display: flex; justify-content: center; opacity: .055; transform: rotate(-24deg); pointer-events: none; }
  .print-watermark-logo { width: 145mm; max-height: 82mm; object-fit: contain; filter: grayscale(1); }
  .print-order > *:not(.print-watermark) { position: relative; z-index: 1; }
  .print-order h1 { margin: 0 0 5mm; font-size: 20pt; break-after: avoid; page-break-after: avoid; }
  .print-order h2 { margin: 7mm 0 3mm; font-size: 13pt; break-after: avoid; page-break-after: avoid; }
  .print-order section { break-inside: avoid; page-break-inside: avoid; }
  .print-doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8mm; margin-bottom: 7mm; padding-bottom: 4mm; border-bottom: 2px solid #111; break-inside: avoid; page-break-inside: avoid; }
  .print-logo { display: block; width: 48mm; max-height: 26mm; margin-bottom: 2mm; object-fit: contain; }
  .print-doc-head h1 { margin: 0 0 2mm; }
  .print-doc-head span { color: #555; font-size: 10pt; font-weight: 700; }
  .print-doc-head > strong { padding: 2mm 3mm; border: 1px solid #111; border-radius: 2mm; font-size: 10pt; text-transform: uppercase; }
  .print-entry-doc { min-height: 281mm; display: flex; flex-direction: column; padding: 2mm 4mm 4mm; page-break-inside: avoid; break-inside: avoid; overflow: visible; }
  .print-entry-doc .entry-main { flex: 0 1 auto; break-inside: avoid; page-break-inside: avoid; }
  .print-entry-doc .print-doc-head { margin-bottom: 3mm; padding-bottom: 2.5mm; }
  .print-entry-doc .print-doc-head h1 { margin-bottom: 1mm; font-size: 17pt; }
  .print-entry-doc .print-doc-head span { font-size: 8.5pt; }
  .print-entry-doc .print-doc-head > strong { padding: 1.5mm 2.5mm; font-size: 8.5pt; }
  .print-entry-doc h2 { margin: 4mm 0 1.8mm; font-size: 11pt; }
  .print-entry-doc .print-meta { gap: 1.8mm 6mm; }
  .print-entry-doc .print-field { padding: 1.2mm 0; }
  .print-entry-doc .print-field span { font-size: 7pt; }
  .print-entry-doc .print-field strong { font-size: 8.8pt; line-height: 1.25; }
  .entry-fault-block { margin-top: 3mm; }
  .print-entry-doc .print-signatures { gap: 14mm; margin-top: 6mm; }
  .print-entry-doc .print-signatures div { height: 11mm; }
  .print-entry-doc .print-signatures span { bottom: -7.5mm; font-size: 7.2pt; }
  .print-entry-doc .print-footer { position: static; margin-top: 2.5mm; padding-top: 1.5mm; font-size: 6.8pt; }
  .entry-summary { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 3mm; margin-bottom: 4mm; }
  .entry-summary div { padding: 3mm; border: 1.3px solid #111; border-radius: 2mm; background: #f7f7f7; break-inside: avoid; page-break-inside: avoid; }
  .entry-summary span { display: block; margin-bottom: 1mm; color: #555; font-size: 7pt; font-weight: 700; text-transform: uppercase; }
  .entry-summary strong { font-size: 12pt; }
  .entry-tearoff { position: relative; flex: 0 0 auto; margin-top: auto; padding-top: 4mm; border-top: 1.5pt dashed #111; break-inside: avoid; page-break-inside: avoid; }
  .tearoff-cut { position: absolute; top: -3.2mm; left: 0; padding-right: 3mm; background: white; color: #555; font-size: 7pt; text-transform: uppercase; }
  .tearoff-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6mm; margin-bottom: 2.5mm; }
  .tearoff-head span { display: block; color: #666; font-size: 7pt; font-weight: 700; text-transform: uppercase; }
  .tearoff-head strong { font-size: 9pt; }
  .tearoff-head em { font-size: 8pt; font-style: normal; font-weight: 700; }
  .tearoff-rules { padding: 3mm; border: 1px solid #111; border-radius: 2mm; background: #fafafa; break-inside: avoid; page-break-inside: avoid; }
  .tearoff-rules strong { display: block; margin-bottom: 1.5mm; font-size: 8.5pt; text-transform: uppercase; }
  .tearoff-rules ul { margin: 0; padding-left: 4mm; font-size: 7.5pt; line-height: 1.25; }
  .tearoff-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 14mm; margin-top: 5mm; break-inside: avoid; page-break-inside: avoid; }
  .tearoff-signature { display: grid; align-content: end; min-height: 20mm; }
  .tearoff-signature i { display: block; height: 0; border-top: 1px solid #111; }
  .tearoff-signature span { display: block; margin-top: 1.5mm; color: #555; font-size: 7pt; line-height: 1.1; text-transform: uppercase; }
  .print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 8mm; break-inside: avoid; page-break-inside: avoid; }
  .print-field { padding: 2mm 0; border-bottom: 1px solid #ddd; break-inside: avoid; page-break-inside: avoid; }
  .print-field-wide { grid-column: 1 / -1; }
  .print-field span { display: block; color: #666; font-size: 8pt; text-transform: uppercase; }
  .print-field strong { font-size: 10pt; white-space: pre-line; }
  .print-lines { width: 100%; border-collapse: collapse; font-size: 9pt; break-inside: auto; page-break-inside: auto; }
  .print-lines thead { display: table-header-group; }
  .print-lines tfoot { display: table-footer-group; }
  .print-lines tr { break-inside: avoid; page-break-inside: avoid; }
  .print-lines th, .print-lines td { padding: 2.5mm; border: 1px solid #ccc; text-align: left; }
  .print-total { margin-top: 5mm; font-size: 14pt; text-align: right; break-inside: avoid; page-break-inside: avoid; }
  .quote-total { padding: 5mm; border: 2px solid #111; border-radius: 3mm; background: #f7f7f7; font-weight: 700; break-inside: avoid; page-break-inside: avoid; }
  .repair-exit-total { padding: 4mm; border: 2px solid #111; border-radius: 3mm; background: #f7f7f7; font-weight: 800; break-inside: avoid; page-break-inside: avoid; }
  .print-exit-doc .print-signatures { gap: 16mm; margin-top: 12mm; margin-bottom: 6mm; padding-bottom: 0; }
  .print-exit-doc .print-signatures div { display: flex; flex-direction: column; justify-content: flex-end; min-height: 18mm; height: auto; border-bottom: 0; }
  .print-exit-doc .print-signatures div::before { content: ""; display: block; border-top: 1px solid #111; margin-bottom: 2.5mm; }
  .print-exit-doc .print-signatures span { position: static; font-size: 7.2pt; }
  .print-exit-doc .print-footer { margin-top: auto; padding-top: 3mm; }
  .print-history { max-height: 55mm; overflow: hidden; padding: 4mm; border: 1px solid #ccc; background: #fafafa; font: 8.5pt/1.35 Arial, sans-serif; white-space: pre-wrap; break-inside: avoid; page-break-inside: avoid; }
  .print-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 18mm; margin-top: 16mm; break-inside: avoid; page-break-inside: avoid; }
  .print-signatures div { height: 18mm; border-bottom: 1px solid #111; position: relative; }
  .print-signatures span { position: absolute; left: 0; bottom: -6mm; color: #555; font-size: 8pt; text-transform: uppercase; }
  .print-client { margin-bottom: 7mm; break-inside: avoid; page-break-inside: avoid; }
  .print-client h2 { margin: 0 0 3mm; font-size: 15pt; }
  .print-orders-table th { background: #eee; }
  .print-orders-table small { color: #666; }
  .print-footer { position: static; margin-top: 8mm; padding-top: 3mm; border-top: 1px solid #ddd; color: #777; font-size: 8pt; text-align: right; break-inside: avoid; page-break-inside: avoid; }
  .print-label-page { page: repair-label-page; width: 60mm; height: 25mm; padding: 2mm; border: 0; color: #111; background: white; font-family: Arial, sans-serif; overflow: hidden; page-break-after: auto; }
  .label-simple { height: 100%; display: grid; align-content: center; justify-items: center; gap: 1.4mm; text-align: center; }
  .label-simple strong { font-size: 28pt; font-weight: 900; line-height: 1; letter-spacing: .04em; }
  .label-simple span { font-size: 8pt; font-weight: 800; }
}
