* { box-sizing: border-box; }
.order-repair-app { margin: 0; min-height: 100vh; }
.order-repair-main { min-width: 0; padding: 28px 32px 48px; }
.workspace-heading { max-width: 1500px; margin: 0 auto 18px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.workspace-heading h1 { margin: 2px 0 4px; }
.workspace-heading p:last-child { margin: 0; color: var(--heritage-muted); font-size: 13px; }
.heading-actions { display: flex; gap: 8px; }
.primary-button, .secondary-button, .icon-button, .record-pagination button { min-height: 44px; border: 1px solid var(--heritage-line); padding: 0 14px; font: inherit; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; }
.primary-button { color: white; border-color: var(--heritage-teal); background: var(--heritage-teal); }
.secondary-button, .icon-button, .record-pagination button { color: var(--heritage-ink); background: white; }
.icon-button { width: 44px; padding: 0; }
.primary-button svg, .secondary-button svg, .icon-button svg { width: 17px; height: 17px; }
.workspace-layout { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); align-items: start; gap: 18px; }
.record-panel { position: sticky; top: 18px; min-width: 0; border: 1px solid var(--heritage-line); background: white; }
.record-panel-heading { min-height: 78px; padding: 14px; border-top: 3px solid var(--heritage-teal); border-bottom: 1px solid var(--heritage-line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.record-panel h2 { margin: 2px 0 0; font-size: 18px; }
.search-control { height: 44px; margin: 12px; border: 1px solid var(--heritage-line); padding: 0 10px; display: flex; align-items: center; gap: 8px; }
.search-control svg { width: 16px; color: var(--heritage-muted); }
.search-control input { width: 100%; min-width: 0; border: 0; outline: 0; }
.record-filters { padding: 0 12px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.record-filters select { min-width: 0; border: 1px solid var(--heritage-line); padding: 0 8px; background: white; font: inherit; font-size: 11px; }
.record-state { margin: 0 12px 12px; padding: 12px; color: var(--heritage-muted); background: var(--heritage-canvas); font-size: 12px; }
.record-state.hidden { display: none; }
.record-list { border-top: 1px solid var(--heritage-line); }
.record-item { width: 100%; min-height: 92px; border: 0; border-bottom: 1px solid var(--heritage-line); padding: 13px 14px; color: inherit; background: white; display: block; text-align: left; cursor: pointer; }
.record-item:hover, .record-item.active { background: var(--heritage-teal-soft); }
.record-item.active { box-shadow: inset 3px 0 var(--heritage-teal); }
.record-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.record-item strong { font-size: 13px; }
.record-item p { margin: 7px 0 3px; font-size: 12px; font-weight: 600; }
.record-item small { color: var(--heritage-muted); }
.type-badge, .status-badge { padding: 3px 6px; color: var(--heritage-teal-dark); background: var(--heritage-teal-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.status-badge { color: #755116; background: var(--heritage-gold-soft); }
.record-pagination { min-height: 54px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.record-pagination button { min-height: 34px; padding: 0 8px; }
.record-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.paper-form { min-width: 0; border: 1px solid #b8bdc1; border-top: 7px solid var(--heritage-nav); background: #fcfcfa; box-shadow: var(--heritage-shadow); }
.paper-form form { padding: 22px; }
.paper-banner { min-height: 88px; border-bottom: 2px solid var(--heritage-nav); padding: 0 2px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; }
.paper-brand { color: var(--heritage-nav); display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 5px; font-family: "Newsreader", serif; font-size: 18px; font-weight: 700; letter-spacing: 0; text-align: center; }
.paper-brand-mark { width: 40px; height: 40px; border: 1px solid #c9a75e; color: #c9a75e; display: grid; place-items: center; }
.paper-brand-mark svg { width: 21px; }
.paper-banner p { margin: 0 0 3px; color: var(--heritage-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.paper-banner h2 { margin: 0; font-family: "Newsreader", serif; font-size: 28px; text-transform: uppercase; }
.form-number { min-width: 150px; border: 1px solid #b8bdc1; padding: 10px 12px; display: flex; align-items: baseline; justify-content: space-between; justify-self: end; gap: 12px; }
.form-number span { color: var(--heritage-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.form-number strong { color: var(--heritage-red); font-size: 14px; }
.paper-contact { min-height: 24px; padding-top: 7px; color: var(--heritage-muted); display: flex; justify-content: flex-end; gap: 14px; font-size: 10px; }
.paper-contact:empty { min-height: 0; padding: 0; }
.form-controls { padding: 16px 0 4px; display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.form-controls > label { width: 180px; }
.type-selector { margin: 0; border: 0; padding: 0; }
.type-selector legend, .form-controls > label { color: var(--heritage-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.type-selector label { display: inline-block; }
.type-selector input { position: absolute; opacity: 0; pointer-events: none; }
.type-selector span { min-height: 44px; border: 1px solid var(--heritage-line); padding: 0 15px; color: var(--heritage-muted); display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.type-selector input:checked + span { border-color: var(--heritage-teal); color: var(--heritage-teal-dark); background: var(--heritage-teal-soft); }
.type-selector svg { width: 16px; }
.paper-section { margin: 16px 0 0; border: 2px solid #aeb4b8; padding: 18px; display: grid; gap: 14px; }
.paper-section legend { padding: 0 9px; color: var(--heritage-nav); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.service-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.customer-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.customer-name { grid-column: 1 / -1; }
.signature-field { grid-column: 1 / -1; }
.item-section { grid-template-columns: 190px minmax(0, 1fr); }
.item-section label:nth-of-type(n + 3) { grid-column: 1 / -1; }
.paper-section label, .signature-field, .form-controls > label { min-width: 0; display: flex; flex-direction: column; gap: 6px; color: #4f5861; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.paper-section input, .paper-section textarea, .form-controls select { width: 100%; min-width: 0; border: 0; border-bottom: 1px dashed #747c82; border-radius: 0; padding: 8px 4px; color: var(--heritage-ink); background: transparent; font: 500 14px "DM Sans", sans-serif; text-transform: none; resize: vertical; }
.form-controls select { border: 1px solid var(--heritage-line); padding: 0 10px; background: white; }
.signature-field span { color: var(--heritage-muted); font-size: 9px; font-weight: 500; text-transform: none; }
.signature-field .field-label { color: #4f5861; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.signature-pad { position: relative; height: 92px; border-bottom: 1px dashed #747c82; background: linear-gradient(to bottom, transparent 72px, rgba(8, 127, 120, .05) 72px); }
.signature-pad canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.signature-pad button { position: absolute; top: 6px; right: 6px; min-height: 30px; border: 1px solid var(--heritage-line); padding: 0 9px; color: var(--heritage-muted); background: rgba(255, 255, 255, .92); font: 700 10px "DM Sans", sans-serif; text-transform: uppercase; cursor: pointer; }
.money-input { display: flex; align-items: center; border-bottom: 1px dashed #747c82; }
.money-input span { padding-left: 4px; font-size: 14px; }
.money-input input { border: 0; }
.tax-included-note { grid-column: 1 / -1; margin: -2px 0 0; color: var(--heritage-muted); font-size: 10px; font-weight: 600; }
.form-message { min-height: 20px; margin: 14px 0 0; color: var(--heritage-teal-dark); font-size: 12px; font-weight: 700; }
.form-message.error { color: var(--heritage-red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
    .order-repair-main { padding: 20px; }
    .workspace-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 12px; }
    .paper-form form { padding: 16px; }
    .paper-banner { grid-template-columns: 1fr auto; }
    .paper-brand { display: none; }
    .item-section { grid-template-columns: 150px minmax(0, 1fr); }
}
@media (max-width: 850px) {
    .workspace-layout { grid-template-columns: 1fr; }
    .record-panel { position: static; }
    .record-list { max-height: 260px; overflow-y: auto; }
    .record-panel-heading { min-height: 64px; }
}
@media (max-width: 620px) {
    .order-repair-main { padding: 16px 10px 82px; }
    .workspace-heading { align-items: stretch; flex-direction: column; }
    .heading-actions { display: grid; grid-template-columns: 44px 1fr 1fr; }
    .paper-form form { padding: 11px; }
    .paper-banner { grid-template-columns: 1fr; gap: 10px; }
    .paper-banner h2 { font-size: 23px; }
    .form-number { min-width: 0; }
    .form-controls { align-items: stretch; flex-direction: column; }
    .form-controls > label { width: 100%; }
    .service-section, .customer-section, .item-section { grid-template-columns: 1fr; }
    .customer-name, .signature-field, .item-section label:nth-of-type(n + 3) { grid-column: auto; }
    .paper-section { padding: 13px 11px; }
}
@media print {
    @page { size: letter portrait; margin: .35in; }
    body { background: white !important; }
    .heritage-sidebar, .workspace-heading, .record-panel, .form-controls, .form-message { display: none !important; }
    .heritage-app #app-container { display: block !important; }
    .order-repair-main { padding: 0; }
    .workspace-layout { display: block; }
    .paper-form { border-top-width: 5px; box-shadow: none; }
    .paper-form form { padding: 14px; }
    .paper-banner { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    .paper-brand { display: flex !important; }
    .paper-brand-mark { width: 54px; height: 54px; border: 0; }
    .paper-section { break-inside: avoid; margin-top: 10px; padding: 12px; }
    .paper-section textarea { resize: none; }
    .signature-pad button { display: none; }
}