:root { color-scheme: light; --ink: #183331; --muted: #62736f; --green: #245b4c; --paper: #f4f6f2; --line: #dce3dc; --white: #fff; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Segoe UI', Arial, sans-serif; font-size: 16px; line-height: 1.6; }
a { color: var(--green); text-underline-offset: 4px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #bb7c27; outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.2; letter-spacing: -.035em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 14px; }
h2 { font-size: 1.6rem; margin-bottom: 16px; }
.muted { color: var(--muted); }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .15em; margin-bottom: 14px; color: var(--green); }
.brand { display: flex; gap: 12px; align-items: center; font-weight: 650; text-decoration: none; color: var(--ink); font-size: 1.15rem; }
.brand-mark { display: grid; place-items: center; background: var(--green); color: white; border-radius: 12px; width: 44px; height: 44px; font-size: 1.4rem; }
.brand small { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); }
.app-name { color: var(--ink); font-size: 1.15rem; font-weight: 650; text-decoration: none; }
.topbar { min-height: 96px; padding: 20px max(24px, calc((100vw - 1120px) / 2)); background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
nav { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
nav a, .nav-logout { display: block; border: 0; background: none; border-radius: 7px; text-decoration: none; padding: 10px 15px; font-weight: 600; font-size: .92rem; color: var(--muted); cursor: pointer; }
nav a[aria-current], nav a:hover, .nav-logout:hover { background: #eaf0e9; color: var(--green); }
nav form { margin: 0; }
.workspace { max-width: 1168px; margin: 0 auto; padding: 54px 24px 80px; min-height: calc(100vh - 160px); }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 34px; }
.page-heading p:last-child { margin-bottom: 0; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 34px; box-shadow: 0 3px 10px #18333103; }
.records-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.records-heading h1 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 0; }
.records-heading a { min-height: 44px; display: inline-flex; align-items: center; }
.records-empty { margin: 24px 0 0; padding: 30px 0; border-top: 1px solid var(--line); text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.card-icon { width: 48px; height: 48px; border-radius: 12px; background: #d8e5d4; color: var(--green); display: grid; place-items: center; font-size: 1.75rem; margin-bottom: 26px; }
.button { display: inline-flex; gap: 20px; justify-content: center; align-items: center; min-height: 48px; padding: 12px 20px; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: white; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; }
.button:hover { background: #194637; }
.button.secondary { background: transparent; color: var(--green); border-color: #bccabd; }
.button.secondary:hover { background: #e3eadf; }
.button.print-primary { background: #a72d27; border-color: #a72d27; gap: 9px; }
.button.print-primary:hover { background: #84221e; }
.button.full { width: 100%; justify-content: space-between; }
.text-link { font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: .75fr 1.5fr; gap: 24px; max-width: 1000px; align-items: start; }
.account-card h2 { overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.stack { display: grid; gap: 22px; margin-top: 28px; }
.stack .button { justify-self: start; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 7px; }
input, select { display: block; width: 100%; min-height: 49px; border: 1px solid #bac8be; border-radius: 7px; background: #fff; padding: 10px 13px; color: var(--ink); }
textarea { display: block; width: 100%; border: 1px solid #bac8be; border-radius: 7px; background: #fff; padding: 10px 13px; color: var(--ink); font: inherit; resize: vertical; }
input:focus, select:focus { border-color: var(--green); }
.field-help { font-size: .82rem; color: var(--muted); margin: 7px 0 0; }
.alert { padding: 12px 16px; border: 1px solid; border-radius: 7px; margin: 22px 0; font-size: .92rem; }
.alert.error { background: #fff2ef; border-color: #eac3bb; color: #922e24; }
.alert.success { background: #edf5eb; border-color: #c3d9bd; color: #2c5834; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 65px 24px; }
.empty-state p { max-width: 470px; }
.empty-state .button { margin-top: 18px; }
.login-layout { min-height: 100vh; min-height: 100dvh; padding: 24px; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 440px; padding: 36px; }
.login-card .brand { justify-content: center; margin-bottom: 28px; }
.login-card h1 { font-size: 1.8rem; text-align: center; margin-bottom: 0; }
.login-card .button.full { justify-content: center; }
.error-page { grid-column: 1 / -1; }
.list-controls, .records-heading, .section-heading, .form-actions, .heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.quotation-form .form-actions { justify-content: flex-start; }
.quotation-form .quotation-edit-actions { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; width: 100%; }
.quotation-edit-actions .quotation-save-action { grid-column: 1; }
.quotation-edit-actions .quotation-invoice-action { grid-column: 2; }
.quotation-edit-actions .quotation-discard-action { grid-column: 3; justify-self: start; }
.quotation-edit-actions .quotation-cancel-action { grid-column: 4; justify-self: end; }
@media (max-width: 768px) {
  .quotation-form .quotation-edit-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 10px; row-gap: 12px; }
  .quotation-edit-actions .quotation-save-action { grid-column: 1; grid-row: 1; justify-self: start; }
  .quotation-edit-actions .quotation-cancel-action { grid-column: 2; grid-row: 1; justify-self: end; }
  .quotation-edit-actions .quotation-invoice-action { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .quotation-edit-actions .quotation-discard-action { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
}
.quotation-form #cancel-quotation { margin-left: auto; }
#discard-draft-button[hidden] { display: none; }
.draft-warning { display: inline-block; padding: 2px 8px; border-radius: 5px; background: #9b2f26; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.4; vertical-align: middle; }
.search-form { display: flex; gap: 8px; width: min(100%, 430px); }.search-form input { flex: 1; }
.table-wrap { overflow-x: auto; margin-top: 24px; }.invoice-table-wrap { overflow: visible; }.data-table { width: 100%; border-collapse: collapse; background: white; }.data-table th,.data-table td { padding: 14px; border-bottom: 1px solid var(--line); text-align: left; }.data-table th { font-size: .82rem; color: var(--muted); }.data-table tbody tr[data-row-link] { cursor: pointer; }.data-table tbody tr:hover { background: #f8faf7; }.money { white-space: nowrap; }
.actions { width: 100px; }.actions details { position: relative; }.actions summary { cursor: pointer; color: var(--green); }.action-menu { position: absolute; right: 0; z-index: 2; min-width: 135px; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px #18333122; }.action-menu a,.action-menu button { display: block; width: 100%; border: 0; background: none; padding: 8px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; }.action-menu form { margin: 0; }.action-menu .danger-link { color: #9b2f26; }
.simple-empty { margin-top: 24px; padding: 45px 20px; background: white; border: 1px solid var(--line); border-radius: 12px; text-align: center; }.simple-empty p { margin: 0; }
.form-section { margin-bottom: 26px; padding: 28px; background: white; border: 1px solid var(--line); border-radius: 12px; }.form-section h2 { font-size: 1.25rem; margin-bottom: 20px; }.section-heading h2 { margin: 0; }.info-grid { display: grid; grid-template-columns: .65fr 1fr 1.2fr; gap: 18px; }.work-head,.work-row { display: grid; grid-template-columns: 42px minmax(260px,2.3fr) minmax(100px,.7fr) minmax(110px,.8fr) minmax(120px,.9fr) 65px; gap: 10px; align-items: start; }.work-head { padding: 0 0 8px; font-size: .8rem; color: var(--muted); }.work-row { padding: 10px 0; border-top: 1px solid var(--line); }.row-number { padding-top: 12px; text-align: center; }.remove-row { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: #9b2f26; font-size: 1.5rem; cursor: pointer; }.mobile-label { display: none; }.quotation-summary { display: grid; justify-content: end; gap: 12px; padding-top: 22px; }.quotation-summary > div { display: grid; grid-template-columns: 150px 150px; gap: 18px; align-items: center; }.quotation-summary strong { text-align: right; }.discount-field input { width: 150px; }.quotation-total { font-size: 1.2rem; }.addon-row { display: grid; grid-template-columns: 42px 1fr 65px; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; }.field-error { margin: 5px 0 0; color: #9b2f26; font-size: .82rem; }.discount-field .field-error { grid-column: 1 / -1; }.danger { background: #9b2f26; border-color: #9b2f26; }.confirm-card { max-width: 600px; }.settings-defaults { margin-top: 24px; max-width: 1000px; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px; z-index: 100; background: white; }
.skip-link:focus { top: 10px; }
@media (max-width: 800px) {
  .invoice-table-wrap { overflow-x: auto; }
  .actions .action-menu { position: static; margin-top: 6px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 18px; padding: 20px; }
  nav { width: 100%; gap: 2px; }
  nav a, .nav-logout { padding: 10px 12px; }
  .settings-grid { grid-template-columns: 1fr; }
  .workspace { padding-top: 32px; }
  .card { padding: 26px; }
  .page-heading { flex-direction: column; }
  .info-grid { grid-template-columns: 1fr; }.work-head { display: none; }.work-row { grid-template-columns: 34px 1fr 44px; padding: 18px 0; }.work-row > div { grid-column: 2; }.work-row .remove-row { grid-column: 3; grid-row: 1; }.mobile-label { display: block; }.addon-row { grid-template-columns: 34px 1fr 44px; }.search-form { width: 100%; }.list-controls { align-items: stretch; }
}
@media (max-width: 768px) {
  .work-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 14px 10px; padding: 18px 0 22px; }
  .work-row .row-number { grid-column: 1; grid-row: 1; padding: 8px 0; text-align: left; font-weight: 700; }
  .work-row .row-number::before { content: 'Work Item #'; }
  .work-row .remove-row { grid-column: 2; grid-row: 1; justify-self: end; }
  .work-row > div { grid-column: 1 / -1; min-width: 0; }
  .work-row > div textarea { min-height: 120px; padding: 12px 13px; }
  .work-row > div input, .work-row > div textarea { width: 100%; min-width: 0; }
  .quotation-summary { width: 100%; justify-content: stretch; gap: 14px; }
  .quotation-summary > div { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(96px, 42%); gap: 10px; }
  .quotation-summary > div > :first-child { min-width: 0; overflow-wrap: anywhere; }
  .quotation-summary strong { min-width: 0; text-align: right; white-space: nowrap; }
  .discount-field input { width: 100%; min-width: 0; text-align: right; }
}
@media (prefers-reduced-motion: no-preference) { .button, nav a, input, select { transition: background .15s, border-color .15s; } }
.print-option { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; }.print-option input { display: inline-block; width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; flex: 0 0 auto; }
.invoice-signature-option { margin: -8px 0 26px; padding: 0 2px; }
