/* Sierra Commercial Lighting: design mock-up styles */
:root {
  --ink: #13202c; --ink2: #24384a; --muted: #55626f; --line: #dde2e8; --bg: #f2f4f7; --card: #fff;
  --amber: #f6a609; --amber-soft: #fff4d6; --amber-ink: #7a4d00;
  --blue: #1a5fb4; --blue-soft: #e4eefb; --green: #1b7441; --green-soft: #e1f3e8; --red: #b3261e; --red-soft: #fbe6e4; --gray-soft: #e9edf1;
  --bar: 38px; --r: 12px;
  --shadow: 0 1px 2px rgba(19, 32, 44, .06), 0 4px 14px rgba(19, 32, 44, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-top: var(--bar); background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body.modal-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 16px; margin-bottom: 10px; }
a { color: var(--blue); }
small { display: block; color: var(--muted); font-size: 12.500px; font-weight: 400; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #c3cbd4; border-radius: 8px; background: #fff; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--ink2); }
input[readonly] { background: var(--bg); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo { width: 36px; height: 36px; flex: none; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .num { text-align: right; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.empty { color: var(--muted); padding: 18px 16px; }

/* mock-up bar */
#demobar { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--bar); display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--amber-soft); border-bottom: 1px solid #ecd28b; color: var(--amber-ink); font-size: 13px; white-space: nowrap; overflow: hidden; }
#demobar .db-note { flex: 1; overflow: hidden; text-overflow: ellipsis; }
#demobar label { display: flex; align-items: center; gap: 6px; }
#demobar select, #demobar button { width: auto; min-height: 28px; padding: 2px 8px; border: 1px solid #d9b95c; border-radius: 6px; background: #fff; color: var(--ink); font-size: 13px; }
#demobar select { max-width: 170px; }

/* buttons, pills, fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid #c3cbd4; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: #f6f8fa; }
.btn.primary { background: var(--amber); border-color: #d99000; }
.btn.primary:hover { background: #ffb41f; }
.btn.go { background: var(--green); border-color: var(--green); color: #fff; }
.btn.xl { width: 100%; min-height: 58px; font-size: 17px; border-radius: 14px; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--gray-soft); color: var(--ink); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.500px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: #3d4a57; vertical-align: middle; }
.p-sent, .p-scheduled, .p-invited { background: var(--blue-soft); color: #134a8e; }
.p-approved, .p-completed, .p-paid, .p-active { background: var(--green-soft); color: #14592f; }
.p-in-progress, .p-partial { background: var(--amber-soft); color: var(--amber-ink); }
.p-declined, .p-overdue { background: var(--red-soft); color: #8c1d18; }
.field { display: block; }
.field > span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field.inline { display: flex; align-items: center; gap: 8px; } .field.inline > span { margin: 0; white-space: nowrap; } .field.inline select { width: auto; max-width: 260px; }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 14px; margin-bottom: 20px; }
.form-grid.two { grid-template-columns: 1fr 1fr; margin: 0; }
.search { position: relative; flex: 1; min-width: 180px; max-width: 340px; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 34px; padding: 4px 12px; border: 1px solid #c3cbd4; border-radius: 99px; background: #fff; cursor: pointer; font-weight: 600; font-size: 13.500px; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--ink2); color: #fff; font-size: 13px; font-weight: 700; }
.filebtn input, .tile input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; min-height: 0; padding: 0; }
.filebtn { position: relative; } .filebtn:focus-within, .tile:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }

/* cards and rows */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; } .card.flush > .row:first-child { border-top: 0; }
.card h2.pad { padding: 16px 16px 12px; margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; } .card-head h2 { margin: 0; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
a.row:hover { background: #f7f9fb; }
.r-main { min-width: 0; } .r-main strong, .r-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-id { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink2); }
.r-date { color: var(--muted); font-size: 13.500px; }
.r-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.r-time { font-weight: 700; }
.doc-row { grid-template-columns: 84px minmax(0, 1fr) 150px 108px 112px; }
.sched { grid-template-columns: 78px minmax(0, 1fr) auto; }
.cust-row { grid-template-columns: minmax(0, 1fr) 130px 130px; }
.file-row { grid-template-columns: minmax(0, 1fr) 190px auto; }
.file-name { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.file-name:hover strong { text-decoration: underline; }
.fbadge { display: inline-grid; place-items: center; width: 40px; height: 44px; flex: none; border-radius: 6px; background: #5b6876; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.k-pdf { background: #b3261e; } .k-xlsx { background: #1b7441; } .k-docx { background: #1a5fb4; } .k-img { background: #6a3fa0; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.user-row .r-main { flex: 1; } .user-row select { width: auto; }
.invite { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; margin-top: 14px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); } .kv:first-of-type { border-top: 0; }
.kv + .btn { margin: 6px 0 18px; }

/* page furniture */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 .pill { margin-left: 6px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { display: block; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; } .stat strong { display: block; font-size: 26px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat.warn strong { color: var(--red); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* sign-in */
.login { min-height: calc(100dvh - var(--bar)); display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #13202c 0%, #24384a 60%, #3a4f5f 100%); }
.login-card { width: 100%; max-width: 440px; padding: 28px; background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; } .brand .logo { width: 48px; height: 48px; } .brand h1 { font-size: 21px; }
.login-pick { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; } .login-pick p { color: var(--muted); font-size: 13.500px; }
.pickcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.pickcard:hover { border-color: var(--amber); background: #fffaf0; } .pickcard span { flex: 1; }
.install { margin-top: 16px; }

/* office shell */
.office { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100dvh - var(--bar)); }
.side { position: sticky; top: var(--bar); height: calc(100dvh - var(--bar)); display: flex; flex-direction: column; padding: 16px 12px; background: var(--ink); color: #dfe6ec; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; color: #fff; font-weight: 700; line-height: 1.2; text-decoration: none; }
.side-brand .logo rect { fill: #24384a; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #c6d0d9; font-weight: 600; text-decoration: none; }
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a[aria-current] { background: var(--amber); color: var(--ink); }
.side-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, .12); } .side-user small { color: #9fb0bf; } .side-user .avatar { background: #3a4f5f; }
.main { width: 100%; max-width: 1240px; padding: 26px 28px 60px; }
.botnav, .t-tabs { display: none; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.notes { margin-top: 20px; }
.sig { display: block; width: 100%; max-width: 260px; height: auto; border-bottom: 2px solid var(--ink); margin-bottom: 6px; }

/* totals */
.totals { margin: 0; } .totals div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; } .totals dt { color: var(--muted); } .totals dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px; font-size: 18px; } .totals .grand dt { color: var(--ink); font-weight: 700; } .totals .grand dd { font-weight: 800; }
.totals .due dd { color: var(--red); }

/* line items */
.lines-head, .line { display: grid; grid-template-columns: minmax(0, 1fr) 84px 62px 104px 36px 104px 76px; gap: 8px; align-items: center; }
.lines-head { padding: 0 0 6px; color: var(--muted); font-size: 12.500px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.line { padding: 5px 0; } .line label > span, .item label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.l-tax, .i-tax { display: grid; place-items: center; } .l-total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; } .l-act { display: flex; justify-content: flex-end; }
.l-qty input, .l-price input { text-align: right; }
.lines-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.item-head, .item { display: grid; grid-template-columns: 130px minmax(0, 1fr) 140px 70px 104px 40px 36px; gap: 8px; align-items: center; padding: 6px 14px; }
.item-head { padding-top: 14px; color: var(--muted); font-size: 12.500px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; } .item { border-top: 1px solid var(--line); }

/* modal, toast */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(19, 32, 44, .55); }
.modal { position: relative; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.modal.wide { max-width: 640px; } .modal h2 { font-size: 19px; padding-right: 40px; overflow-wrap: anywhere; } .modal-x { position: absolute; top: 12px; right: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; } .modal > .search { max-width: none; margin: 12px 0; }
.pick-list { display: grid; gap: 6px; max-height: 46dvh; overflow: auto; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
.pick:hover { border-color: var(--amber); } .pick-n { color: var(--green); font-weight: 700; font-size: 13px; white-space: nowrap; } .pick-plus { color: var(--muted); }
.pv-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.pv { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 18px; }
.pv-page { background: #fff; max-width: 420px; margin: 0 auto; padding: 28px; } .pv-page b { display: block; width: 55%; height: 14px; margin-bottom: 14px; background: #b9c2cc; border-radius: 4px; } .pv-page i { display: block; height: 8px; margin: 9px 0; background: #e3e7ec; border-radius: 4px; }
.pv-sheet { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; padding: 1px; background: #c9d1d9; } .pv-sheet i { height: 26px; background: #fff; } .pv-sheet i.h { background: var(--green-soft); }
.pv-img { padding: 0; overflow: hidden; } .pv-img svg { display: block; width: 100%; height: auto; }
#toast { position: fixed; left: 50%; bottom: 96px; z-index: 70; transform: translate(-50%, 20px); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* field tech (phone) */
body[data-area=tech] { background: #c9d0d7; }
.tech { position: relative; max-width: 430px; min-height: calc(100dvh - var(--bar)); margin: 0 auto; padding-bottom: 96px; background: var(--bg); box-shadow: 0 0 40px rgba(19, 32, 44, .25); font-size: 16px; }
.t-top { position: sticky; top: var(--bar); z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px; background: var(--ink); color: #fff; }
.t-top h1 { flex: 1; font-size: 19px; } .t-top .logo rect { fill: #24384a; }
.t-back { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; border-radius: 10px; color: #fff; } .t-back .ic { width: 26px; height: 26px; }
.t-online { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #c6d0d9; } .t-online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ecf7a; }
.t-main { display: grid; gap: 12px; padding: 14px; }
.t-date { color: var(--muted); } .t-date strong { color: var(--ink); } .t-h { margin: 8px 0 0; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.t-tabs { position: fixed; bottom: 0; left: 50%; z-index: 10; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 430px); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.t-tabs a, .botnav a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; color: var(--muted); font-size: 12.500px; font-weight: 700; text-decoration: none; }
.t-tabs a .ic { width: 26px; height: 26px; } .t-tabs a[aria-current], .botnav a[aria-current] { color: var(--ink); background: var(--amber-soft); }
.jobcard, .t-card { display: grid; gap: 4px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.jobcard strong { font-size: 18px; line-height: 1.25; } .jobcard > span { color: var(--muted); }
.jc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .jc-time { font-weight: 800; color: var(--amber-ink); }
.jc-site { display: flex; align-items: center; gap: 6px; }
.t-card h2 { font-size: 21px; line-height: 1.2; margin: 4px 0; } .t-card.center { justify-items: center; text-align: center; padding: 24px 16px; }
.t-note { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); }
.t-big { font-size: 22px; font-weight: 800; } .t-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.t-done { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; border-radius: 14px; background: var(--green-soft); color: #14592f; font-weight: 700; font-size: 17px; }
.tiles { display: grid; gap: 10px; }
.tile { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.tile > .ic:first-child { width: 28px; height: 28px; color: var(--ink2); } .tile > span { flex: 1; min-width: 0; } .tile strong { display: block; font-size: 17px; } .tile small { font-size: 14px; } .tile > .ic:last-child { color: var(--muted); }
.tile.tall { min-height: 92px; } .tile.done { background: var(--green-soft); border-color: #b5dcc4; } .tile.done > .ic:first-child { color: var(--green); }
.lines.big { display: grid; gap: 10px; }
.tline { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.tl-top { display: flex; gap: 6px; } .tl-name { font-weight: 700; border-color: transparent; padding-left: 4px; } .tl-name:hover, .tl-name:focus { border-color: #c3cbd4; }
.tl-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 8px; }
.stepper { display: grid; grid-template-columns: 48px 62px 48px; } .stepper button { height: 48px; border: 1px solid #c3cbd4; background: var(--gray-soft); font-size: 24px; font-weight: 700; cursor: pointer; }
.stepper button:first-child { border-radius: 12px 0 0 12px; } .stepper button:last-child { border-radius: 0 12px 12px 0; }
.stepper input { height: 48px; border-radius: 0; border-left: 0; border-right: 0; text-align: center; font-weight: 700; font-size: 18px; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { display: none; }
.tl-price { width: 98px; } .tl-price span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tl-price input { height: 48px; }
.tl-total { flex: 1; text-align: right; font-size: 17px; padding-bottom: 12px; font-variant-numeric: tabular-nums; }
.lines.big .lines-add { display: grid; margin: 0; }
.field.big > span { font-size: 15px; } .field.big input, .search.big input { min-height: 54px; font-size: 17px; border-radius: 12px; } .search.big { max-width: none; }
.pad-wrap { position: relative; } #sig-pad { display: block; width: 100%; height: 220px; background: #fff; border: 2px dashed #9aa7b4; border-radius: 16px; touch-action: none; cursor: crosshair; }
.pad-line { position: absolute; left: 20px; right: 20px; bottom: 44px; border-bottom: 2px solid #c3cbd4; color: #8795a2; font-size: 13px; padding-bottom: 4px; pointer-events: none; }
.amount span { display: block; color: var(--muted); font-weight: 600; } .amount input { max-width: 240px; min-height: 64px; margin-top: 6px; border-radius: 14px; text-align: center; font-size: 30px; font-weight: 800; }
.pulse, .bigcheck { display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 8px; border-radius: 50%; background: var(--amber-soft); color: var(--amber-ink); }
.pulse .ic, .bigcheck .ic { width: 44px; height: 44px; } .bigcheck { background: var(--green); color: #fff; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 16px rgba(246, 166, 9, .22); } }

/* customer portal */
.p-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.p-top { background: #fff; border-bottom: 1px solid var(--line); } .p-top > .p-wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 10px; }
.p-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; line-height: 1.2; }
.p-user { display: flex; align-items: center; gap: 12px; text-align: right; }
.p-nav .p-wrap { display: flex; gap: 4px; overflow-x: auto; }
.p-nav a { padding: 10px 12px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.p-nav a:hover { color: var(--ink); } .p-nav a[aria-current] { color: var(--ink); border-color: var(--amber); }
.p-main { padding-top: 24px; padding-bottom: 60px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; } .proj { display: grid; gap: 8px; margin: 0; color: inherit; text-decoration: none; } .proj:hover { border-color: var(--amber); } .proj h2 { margin: 0; font-size: 17px; }
.bar { height: 10px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--amber); border-radius: 99px; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; } .paper-actions .btn.xl { width: auto; padding: 8px 22px; }
.paper { max-width: 860px; padding: 40px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.paper > header { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 3px solid var(--ink); } .paper-id { text-align: right; } .paper-id h1 { font-size: 22px; }
.paper-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; } .paper h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.table-wrap { overflow-x: auto; margin: 10px 0 18px; } table { width: 100%; border-collapse: collapse; } th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; } th { font-size: 12.500px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); } th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paper .totals { max-width: 340px; margin-left: auto; } .paper-notes { margin-top: 18px; color: var(--muted); } .paper-sig { margin-top: 22px; }
.stripe-mock { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }

/* rows inside a narrow card (two-column pages) fold the same way they do on a phone */
.card.flush { container-type: inline-size; }
@container (max-width: 600px) {
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; } .doc-row .r-id { grid-area: 1 / 1; } .doc-row .r-status { grid-area: 1 / 2; justify-self: end; } .doc-row .r-main { grid-area: 2 / 1 / 3 / 3; } .doc-row .r-date { grid-area: 3 / 1; } .doc-row .r-amt { grid-area: 3 / 2; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; } .file-row .r-date { display: none; } .file-row .r-main strong { white-space: normal; overflow-wrap: anywhere; }
}

/* smaller screens */
@media (max-width: 980px) {
  .stats { grid-template-columns: 1fr 1fr; } .cols, .doc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  #demobar .db-note { visibility: hidden; }
  .office { display: block; } .side { display: none; } .main { padding: 18px 14px 110px; }
  .botnav { position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .head-actions { width: 100%; } .head-actions .btn { flex: 1 1 auto; }
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; } .doc-row .r-id { grid-area: 1 / 1; } .doc-row .r-status { grid-area: 1 / 2; justify-self: end; } .doc-row .r-main { grid-area: 2 / 1 / 3 / 3; } .doc-row .r-date { grid-area: 3 / 1; } .doc-row .r-amt { grid-area: 3 / 2; }
  .cust-row { grid-template-columns: minmax(0, 1fr) auto; } .cust-row .r-date { display: none; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; } .file-row .r-date { display: none; } .file-row .switch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .invite { grid-template-columns: 1fr 1fr; } .user-row { flex-wrap: wrap; } .user-row .r-main { flex-basis: 60%; }
  .lines-head, .item-head { display: none; }
  .line { grid-template-columns: 1fr 1fr 1fr auto; gap: 6px 8px; padding: 12px 0; border-top: 1px solid var(--line); align-items: end; }
  .line label > span, .item label > span { position: static; width: auto; height: auto; clip-path: none; display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
  .line .l-name { grid-column: 1 / -1; } .line .l-total { grid-column: 1 / 3; text-align: left; font-size: 16px; align-self: center; } .line .l-act { grid-column: 3 / 5; }
  .item { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; padding: 12px 14px; } .item .i-name { grid-column: 1 / -1; }
  .paper { padding: 20px 16px; } .paper-meta { grid-template-columns: 1fr; } .paper-id { text-align: left; }
  .p-user span { display: none; } .p-wrap { padding: 0 14px; } .p-nav .p-wrap { flex-wrap: wrap; overflow: visible; } .p-nav a { padding: 8px 10px; }
  .botnav a { font-size: 11.5px; white-space: nowrap; }
  .file-row .btn { display: none; } .file-row .r-main strong { white-space: normal; overflow-wrap: anywhere; }
  #demobar select { max-width: 118px; }
  .modal-back { place-items: end center; padding: 0; } .modal { border-radius: 18px 18px 0 0; max-height: calc(100dvh - var(--bar) - 20px); padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  #demobar strong { display: none; } #demobar { gap: 8px; }
  .stat strong { font-size: 21px; } .tech { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } #toast { transition: none; } }
@media print { #demobar, .side, .botnav, .p-top, .paper-actions, .backlink { display: none; } body { padding: 0; background: #fff; } }
