:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #d7dde3;
  --brand: #0f7777;
  --brand-dark: #075a5a;
  --danger: #b42318;
  --warn: #b7791f;
  --ok: #207245;
  --soft: #eef6f6;
  --shadow: 0 12px 30px rgba(12, 30, 33, .08);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; }
textarea { min-height: 96px; resize: vertical; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  width: 100%;
}
input[type="checkbox"] { width: auto; transform: scale(1.15); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
.topbar {
  min-width: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-wrap img { width: 92px; height: auto; display: block; }
.brand-title { font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.brand-subtitle { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 100%; overflow-x: auto; }
.nav button, .btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: .15s ease;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
.nav button.active, .btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.main { padding: 22px 24px 80px; max-width: 1500px; min-width: 0; width: 100%; margin: 0 auto; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 18px;
}
.panel.flat { box-shadow: none; }
.panel-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.panel-title-row h2, h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.stat-value { font-size: 34px; font-weight: 800; color: var(--brand); }
.stat-label { color: var(--muted); margin-top: 4px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { background: #f8fafb; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.data-table tr:hover td { background: #fbfefe; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; border: 1px solid var(--line); background: #f8fafb; color: var(--ink); }
.badge.ok { background: #e9f7ef; color: var(--ok); border-color: #bde5cb; }
.badge.warn { background: #fff7e6; color: var(--warn); border-color: #f3d28b; }
.badge.danger { background: #fff1f0; color: var(--danger); border-color: #ffc7c2; }
.badge.brand { background: var(--soft); color: var(--brand); border-color: #b7e1e1; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: min(480px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; }
.login-logo { width: 150px; display: block; margin-bottom: 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.notice { background: #fffbe6; border: 1px solid #f6df87; border-radius: 14px; padding: 12px 14px; color: #6b4b00; }
.notice.info { background: var(--soft); border-color: #c9e7e7; color: var(--brand-dark); }
.notice.danger { background: #fff1f0; border-color: #ffc7c2; color: var(--danger); }
.searchbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.searchbar input { max-width: 420px; }
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(820px, calc(100vw - 30px)); box-shadow: 0 20px 70px rgba(0,0,0,.25); }
dialog.modal.wide { width: min(1120px, calc(100vw - 30px)); }
dialog.modal::backdrop { background: rgba(15,23,42,.45); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; max-height: min(78vh, 880px); overflow: auto; }
.icon-close { border: 0; background: transparent; font-size: 26px; cursor: pointer; line-height: 1; }
.inline-table { width: 100%; border-collapse: collapse; }
.inline-table th, .inline-table td { padding: 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
.inline-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.row-editor-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.report-editor { display: grid; gap: 16px; }
.report-section { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.report-section h3 { font-size: 16px; margin-bottom: 12px; color: var(--brand-dark); }
.signature-pad { border: 1px dashed #9ca3af; border-radius: 12px; background: #fff; height: 170px; width: 100%; touch-action: none; }
.link-chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 500px; }
.timeline { display: grid; gap: 12px; }
.timeline-day { border-left: 4px solid var(--brand); padding-left: 14px; }
.timeline-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 8px 0; }
.client-page { padding: 20px; max-width: 1120px; margin: 0 auto; }
.client-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 0; }
.public-form { max-width: 980px; margin: 24px auto; }
.footer-note { margin-top: 22px; color: var(--muted); font-size: 12px; }

.paper-report {
  background: #fff;
  color: #222;
  border: 1px solid #333;
  font-family: Arial, Helvetica, sans-serif;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  font-size: 11px;
  line-height: 1.22;
}
.report-header-grid { display: grid; grid-template-columns: 290px 1fr; border-bottom: 1px solid #333; }
.company-cell { border-right: 1px solid #333; text-align: center; padding: 10px 8px; min-height: 175px; display: flex; flex-direction: column; justify-content: center; }
.print-logo-wrap img { max-width: 230px; max-height: 130px; object-fit: contain; }
.company-fallback { font-size: 10px; margin-top: 4px; display: none; }
.title-cell { display: grid; grid-template-rows: minmax(42px, auto) repeat(4, 1fr); }
.report-title-line { display: grid; grid-template-columns: 1fr 110px 44px 1fr; align-items: center; border-bottom: 1px solid #333; font-size: 16px; font-weight: bold; }
.report-title-line span, .report-title-line strong { padding: 7px 10px; border-right: 1px solid #333; min-height: 42px; display: flex; align-items: center; }
.report-title-line strong:last-child { border-right: 0; }
.report-number { color: #d85f65; font-size: 22px; justify-content: center; }
.report-line { display: grid; border-bottom: 1px solid #333; min-height: 32px; }
.report-line:last-child { border-bottom: 0; }
.report-line.one { grid-template-columns: 110px 1fr; }
.report-line.two { grid-template-columns: 80px 1fr 170px 1fr; }
.report-line.three { grid-template-columns: 80px 1fr 70px 100px 70px 1fr; }
.report-line label { color: #555; font-weight: bold; margin: 0; border-right: 1px solid #333; padding: 8px; font-size: 11px; }
.report-line span { padding: 8px; border-right: 1px solid #333; min-height: 31px; }
.report-line span:last-child { border-right: 0; }
.print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.print-table th, .print-table td { border: 1px solid #333; padding: 5px 6px; vertical-align: top; height: 26px; }
.print-table th { font-size: 10px; text-align: left; color: #555; font-weight: bold; background: #fff; }
.print-table.compact th, .print-table.compact td { height: 28px; }
.machine-table { border-left: 0; border-right: 0; }
.machine-table th:first-child, .machine-table td:first-child, .date-table th:first-child, .date-table td:first-child { border-left: 0; }
.machine-table th:last-child, .machine-table td:last-child, .date-table th:last-child, .date-table td:last-child { border-right: 0; }
.check-box { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid #333; font-weight: bold; font-size: 13px; }
.description-block { border-top: 0; }
.block-label { border-bottom: 1px solid #333; padding: 5px 6px; color: #555; font-weight: bold; font-size: 10px; }
.lined-box { min-height: 180px; padding: 8px; background-image: linear-gradient(to bottom, transparent 25px, #333 26px); background-size: 100% 26px; }
.description-lines { min-height: 220px; }
.materials-costs-grid { display: grid; grid-template-columns: 1fr 220px; border-top: 1px solid #333; }
.materials-table, .costs-table { border: 0; }
.materials-table th, .materials-table td { height: 31px; }
.materials-table th:first-child, .materials-table td:first-child { border-left: 0; }
.materials-table th { text-align: center; }
.qty-cell { width: 60px; text-align: center !important; }
.costs-table th, .costs-table td { border-right: 0; height: 34px; }
.costs-table td { height: 58px; }
.legal-note { margin: 7px 18px; text-align: center; font-size: 9px; }
.hours-table th, .hours-table td { text-align: center; height: 34px; }
.hours-table th { font-size: 10px; }
.signature-grid { display: grid; grid-template-columns: 1.05fr .7fr 1.6fr; border-top: 1px solid #333; min-height: 76px; }
.signature-grid > div { border-right: 1px solid #333; padding: 8px; min-height: 76px; }
.signature-grid > div:last-child { border-right: 0; }
.signature-img { max-height: 55px; max-width: 100%; display: block; margin-top: 2px; }
.signature-name { display: inline-block; margin-top: 5px; }
.customer-notes { border-top: 1px solid #333; padding: 7px 8px; }
.copy-label { text-align: right; font-weight: bold; color: var(--brand); padding: 8px 10px 10px; letter-spacing: .04em; }

@media screen and (max-width: 980px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .stats, .grid.four, .grid.three, .grid.two { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .report-header-grid { grid-template-columns: 1fr; }
  .company-cell { border-right: 0; border-bottom: 1px solid #333; }
  .materials-costs-grid { grid-template-columns: 1fr; }
  .costs-table th, .costs-table td { border-right: 1px solid #333; }
  .signature-grid { grid-template-columns: 1fr; }
  .signature-grid > div { border-right: 0; border-bottom: 1px solid #333; }
}
@media print {
  body { background: #fff; }
  .no-print, .topbar, .nav, .panel-title-row .actions, .form-actions, .client-header, .login-screen { display: none !important; }
  .main, .client-page { padding: 0; max-width: none; }
  .panel { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .paper-report { border: 1px solid #333; max-width: none; width: 100%; page-break-inside: avoid; }
  @page { size: A4 portrait; margin: 9mm; }
}
.grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media screen and (max-width: 980px) { .grid.five { grid-template-columns: 1fr; } }

/* DIMAG workspace: clear hierarchy, readable forms and touch-friendly controls. */
:root { --bg: #f3f5f6; --ink: #183339; --muted: #65767b; --brand: #087b79; --brand-dark: #104749; --line: #dce5e6; --shadow: 0 3px 16px rgba(20, 47, 53, .025); }
body { line-height: 1.5; }
button, .btn, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 3px solid #26a8a2; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input[readonly] { background: #f0f4f5; color: #566b71; cursor: default; }
input:disabled, textarea:disabled, select:disabled { color: #40575b; opacity: 1; background: #f4f7f7; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
fieldset:disabled .row-editor-actions, fieldset:disabled .material-row button, fieldset:disabled .labor-row button { display: none; }
.btn { border-radius: 9px; font-size: 13px; font-weight: 600; min-height: 39px; }
.btn:hover { background: #edf4f4; border-color: #b2c7c8; transform: translateY(-1px); }
.btn.primary:hover { background: #09615f; border-color: #09615f; }
.btn.danger:hover { background: #8f201a; border-color: #8f201a; }
.btn.small { min-height: 33px; font-size: 12px; padding: 6px 9px; }
.panel { border-radius: 15px; padding: 24px; margin-bottom: 22px; }
.panel-title-row h2 { font-size: 22px; letter-spacing: -.035em; font-weight: 700; }
.panel-title-row p { margin: 7px 0 0; max-width: 720px; font-size: 13px; }
.workspace-heading { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 28px; }
.eyebrow { display: block; font-size: 10px; letter-spacing: .16em; font-weight: 750; color: var(--brand); }
.dashboard-intro { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin: 0 0 30px; }
.dashboard-intro h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.18; font-weight: 700; letter-spacing: -.04em; margin-top: 9px; }
.dashboard-intro p { font-size: 14px; margin: 12px 0 0; }
.intro-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 15px; }
.date-label { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.stats { margin-bottom: 26px; gap: 12px; }
.stat-card { border-radius: 12px; padding: 17px 19px; position: relative; overflow: hidden; }
.stat-card:before { content: ''; display: block; width: 20px; height: 3px; border-radius: 2px; background: #5aafa8; margin-bottom: 11px; }
.stat-value { font-size: 32px; line-height: 1.15; font-weight: 650; letter-spacing: -.05em; }
.stat-label { font-size: 12px; }
.data-table td { font-size: 13px; padding: 15px 12px; }
.data-table th { font-size: 10px; padding: 12px; font-weight: 700; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td.actions { min-width: 205px; gap: 5px; }
.badge { font-weight: 600; font-size: 10px; padding: 4px 8px; white-space: nowrap; }
.request-filters { margin-top: 18px; }
.request-filters label { font-size: 12px; }
.request-filters select { margin-top: 6px; }
.searchbar input { max-width: 600px; }
.report-section { border-radius: 12px; margin-bottom: 15px; padding: 20px; }
.report-section h3 { font-weight: 700; font-size: 15px; margin-bottom: 17px; }
.report-section > .grid + .grid, .modal-body .grid + .grid { margin-top: 16px; }
.report-section > label, .modal-body form > label { margin-top: 15px; }
.report-section label, .modal-body label { font-size: 12px; font-weight: 550; color: #486068; }
.report-section > textarea { margin-bottom: 8px; }
.report-editor { gap: 10px; }
.report-editor > * { min-width: 0; max-width: 100%; }
#reportForm { min-width: 0; max-width: 100%; width: 100%; }
#reportForm fieldset, details.report-section { min-width: 0; max-width: 100%; }
.report-editor .table-wrap { min-width: 0; max-width: 100%; overflow: auto; }
.report-editor #reportPreview { min-width: 0; max-width: 100%; overflow-x: auto; }
.report-editor > .notice { margin-bottom: 12px; }
.inline-table { min-width: 740px; }
.inline-table th { text-align: left; font-size: 10px; }
.inline-table input { font-size: 12px; padding: 9px 7px; min-height: 38px; }
.materials-editor td:first-child { width: 40%; min-width: 220px; }
.materials-editor td:nth-child(2) { width: 85px; }
.material-total { min-width: 100px; white-space: nowrap; font-size: 12px; font-weight: 650; }
.labor-editor { min-width: 1110px; }
.labor-editor input[type=number] { min-width: 75px; }
.labor-editor input[type=date] { min-width: 140px; }
.labor-editor input[type=time] { min-width: 106px; }
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.summary-grid > div { background: #f3f7f7; border-radius: 10px; padding: 14px; }
.summary-grid span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.summary-grid strong { display: block; font-size: 22px; font-weight: 650; letter-spacing: -.03em; }
.summary-grid .summary-total { background: #e3f1ee; color: #0a625a; }
.saved-signature { display: block; max-height: 160px; max-width: 100%; object-fit: contain; margin: 12px 0; background: white; border: 1px solid var(--line); border-radius: 10px; }
.paper-report { overflow-wrap: anywhere; }
.report-view, .report-scroll { min-width: 0; max-width: 100%; }
.mobile-report-summary, .report-scroll-hint { display: none; }
.paper-report [class*="grid"] > *, .report-line > * { min-width: 0; }
.print-logo-wrap { width: 230px; height: 80px; overflow: hidden; margin: 0 auto 4px; flex: 0 0 auto; }
.print-logo-wrap img { display: block; width: 230px; max-width: none; max-height: none; height: auto; object-fit: initial; object-position: left top; }
.report-title-line > span:nth-child(3) { padding-left: 4px; padding-right: 4px; white-space: nowrap; overflow-wrap: normal; }
.company-fallback { display: block; font-size: 9px; }
details.report-section summary { color: var(--brand-dark); font-weight: 650; cursor: pointer; }
details.report-section[open] summary { margin-bottom: 20px; }
.login-screen { background: radial-gradient(ellipse at 75% 10%, #dcece8 0%, transparent 45%), #f3f5f6; }
.login-card { border-top: 4px solid var(--brand); border-radius: 16px; padding: 36px; box-shadow: 0 18px 80px rgba(20, 50, 55, .09); }
.login-card h1 { font-size: 26px; letter-spacing: -.035em; }
.login-card p { font-size: 13px; }
.login-card .btn { width: 100%; min-height: 46px; }
.login-logo { width: 142px; margin-bottom: 28px; }
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 1000; background: #154f49; color: white; box-shadow: 0 8px 28px #12333030; padding: 14px 20px; border-radius: 12px; max-width: min(520px, calc(100vw - 32px)); font-size: 13px; }
.toast.danger { background: #8b2c25; }
.conflict-notice { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); width: min(780px, calc(100vw - 24px)); z-index: 1200; box-shadow: 0 10px 40px #3333; }
.conflict-notice .btn { margin-top: 8px; }
.skip-link { position: fixed; top: -60px; left: 10px; z-index: 2000; background: white; padding: 10px; }
.skip-link:focus { top: 10px; }
@media screen and (min-width: 1100px) {
  .app-shell { grid-template-columns: 224px minmax(0, 1fr); grid-template-rows: 1fr; }
  .topbar { min-width: 0; height: 100vh; align-self: start; padding: 34px 18px 22px; flex-direction: column; align-items: stretch; justify-content: flex-start; border-bottom: 0; border-right: 1px solid var(--line); background: #fff; }
  .brand-wrap { align-items: flex-start; flex-direction: column; gap: 21px; padding: 0 15px 26px; border-bottom: 1px solid #edf1f1; }
  .brand-wrap img { width: 126px; }
  .brand-title { font-size: 21px; letter-spacing: -.035em; }
  .brand-subtitle { font-size: 11px; margin-top: 3px; }
  .nav { margin-top: 27px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
  .nav button { width: 100%; justify-content: flex-start; border: 0; background: transparent; color: #596e73; font-size: 13px; padding: 12px 15px; border-radius: 8px; font-weight: 550; }
  .nav button:hover { background: #f2f6f5; }
  .nav button.active { background: #e6f2ef; color: #126860; font-weight: 700; }
  .nav button.active:before { content: ''; display: block; width: 5px; height: 5px; border-radius: 100%; background: var(--brand); }
  .nav button[data-action=logout] { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0; padding-top: 20px; }
  .main { padding: 27px 32px 70px; max-width: 1700px; }
}
@media screen and (max-width: 1099px) {
  .topbar { flex-direction: column; align-items: stretch; padding: 15px 20px 0; }
  .brand-wrap { margin-bottom: 13px; }
  .brand-wrap img { width: 84px; }
  .nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 12px; gap: 6px; }
  .nav button { border-radius: 8px; font-size: 12px; padding: 8px 10px; }
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main { padding: 22px 18px 70px; }
  .panel { padding: 19px; }
  .panel-title-row { flex-wrap: wrap; }
}
@media screen and (max-width: 620px) {
  .client-page { padding: 12px; min-width: 0; }
  .client-header { flex-direction: column; align-items: stretch; }
  .client-header .brand-wrap, .public-form .brand-wrap { min-width: 0; }
  .client-header .brand-wrap > div, .public-form .brand-wrap > div { min-width: 0; }
  .client-page .panel { min-width: 0; }
  #clientRoot > .panel.flat { padding: 0; border: 0; }
  .paper-report .title-cell { display: block; }
  .paper-report .report-title-line { grid-template-columns: minmax(0, 1fr) 95px; font-size: 13px; }
  .paper-report .report-title-line > * { min-width: 0; padding: 5px 6px; }
  .paper-report .report-line.one, .paper-report .report-line.two, .paper-report .report-line.three { grid-template-columns: minmax(70px, .65fr) minmax(0, 1fr); }
  .paper-report .print-logo-wrap { max-width: 100%; }
  .mobile-report-summary { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); overflow-wrap: anywhere; }
  .mobile-report-summary > div { display: grid; gap: 2px; }
  .mobile-report-summary span { color: var(--muted); font-size: 12px; }
  .mobile-report-summary strong { font-size: 14px; }
  .report-scroll-hint { display: block; font-size: 12px; color: var(--muted); margin: 12px 0; }
  .report-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .report-scroll > .paper-report { width: 760px; min-width: 760px; max-width: none; margin: 0; }
  .report-scroll .report-header-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .report-scroll .company-cell { border-right: 1px solid #333; border-bottom: 0; }
  .report-scroll .print-logo-wrap img { width: 100%; }
  .report-scroll .report-title-line { grid-template-columns: minmax(0, 1fr) 80px 35px 95px; }
  .report-scroll .report-line.one { grid-template-columns: 110px minmax(0, 1fr); }
  .report-scroll .report-line.two { grid-template-columns: 80px minmax(0, 1fr) 170px minmax(0, 1fr); }
  .report-scroll .report-line.three { grid-template-columns: 80px minmax(0, 1fr) 70px 100px 70px minmax(0, 1fr); }
  .report-scroll .materials-costs-grid { grid-template-columns: minmax(0, 1fr) 220px; }
  .report-scroll .signature-grid { grid-template-columns: 1.05fr .7fr 1.6fr; }
  .report-scroll .signature-grid > div { border-right: 1px solid #333; border-bottom: 0; }
  .report-scroll .signature-grid > div:last-child { border-right: 0; }
  .topbar { position: static; padding: 14px 14px 0; }
  .workspace-heading { margin-bottom: 20px; }
  .workspace-heading .eyebrow { font-size: 8px; }
  .workspace-heading .tiny { font-size: 10px; }
  .dashboard-intro { align-items: flex-start; flex-direction: column; }
  .intro-actions { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .date-label { font-size: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat-card:last-child { grid-column: 1 / -1; }
  .grid.two, .grid.three, .grid.four, .grid.five { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid .summary-total { grid-column: 1 / -1; }
  .main { padding: 18px 12px 60px; }
  .panel { padding: 16px; }
  .report-section { padding: 14px; }
  .panel-title-row h2 { font-size: 20px; }
  .searchbar { flex-wrap: wrap; }
  .searchbar input { flex-basis: 100%; }
  .modal-body { padding: 16px; }
  .copy-field { flex-wrap: wrap; }
  .copy-field input { min-width: 0; }
  .signature-pad { height: 180px; }
}
@media print {
  .toast, .skip-link, .conflict-notice, .workspace-heading { display: none !important; }
  .report-scroll { overflow: visible; outline: none; }
  .paper-report { page-break-inside: auto; break-inside: auto; line-height: 1.15; font-size: 9px; }
  .report-header-grid { grid-template-columns: 220px 1fr; }
  .company-cell { min-height: 130px; padding: 6px; }
  .print-logo-wrap { width: 180px; height: 62px; }
  .print-logo-wrap img { width: 180px; max-width: none; max-height: none; }
  .title-cell { grid-template-rows: 34px repeat(4, 1fr); }
  .report-title-line { grid-template-columns: 1fr 85px 45px 90px; font-size: 12px; }
  .report-title-line span, .report-title-line strong { padding: 4px 6px; min-height: 34px; }
  .report-number { font-size: 16px; }
  .report-line { min-height: 24px; }
  .report-line label, .report-line span { font-size: 9px; min-height: 24px; padding: 5px; }
  .print-table th, .print-table td, .print-table.compact th, .print-table.compact td { height: 20px; padding: 3px 5px; font-size: 9px; }
  .print-table tr { break-inside: avoid; page-break-inside: avoid; }
  .lined-box { min-height: 100px; background-size: 100% 22px; }
  .description-lines { min-height: 120px; }
  .materials-costs-grid { grid-template-columns: 1fr 235px; }
  .costs-table th, .costs-table td { height: 23px; }
  .hours-table th, .hours-table td { height: 22px; font-size: 8px; }
  .signature-grid { grid-template-columns: 1.05fr .7fr 1.6fr; min-height: 65px; break-inside: avoid; }
  .signature-grid > div { min-height: 65px; padding: 5px; }
  .signature-img { max-height: 43px; }
  .legal-note { margin: 5px 10px; font-size: 8px; }
  .copy-label { font-size: 8px; padding: 5px 8px; }
}
