:root {
  --bg: #0b1d36; --bg2: #09172b; --card: #132744; --card2: #183154; --line: #25406a;
  --orange: #ff8c00; --orange-d: #e07b00; --text: #eaf0f8; --muted: #9db0c9;
  --ok: #3ddc97; --warn: #fbbf24; --err: #ff6b6b; --blue: #5aa9ff;
  --r: 14px; --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 8px 24px rgba(0,0,0,.25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --side: 232px; --tab: 62px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(1200px 600px at 80% -10%, #14305a 0%, transparent 60%), var(--bg); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; } a { color: var(--orange); text-decoration: none; } a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .tiny { font-size: .76rem; } .center { text-align: center; } .right { text-align: right; }
.hidden { display: none !important; } .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.err { color: var(--err); min-height: 1.2em; margin: 0; } .ok { color: var(--ok); } .warn { color: var(--warn); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.icon { flex: none; vertical-align: middle; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---- controls ---- */
input, select, textarea { width: 100%; background: #0e2240; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; min-height: 44px; }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--orange); }
input[type=search] { max-width: 420px; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(255,140,0,.25); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; text-decoration: none; }
.btn:hover { border-color: var(--orange); text-decoration: none; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #1a1000; } .btn.primary:hover { background: var(--orange-d); }
.btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn.danger { color: var(--err); border-color: rgba(255,107,107,.45); } .btn.danger:hover { background: rgba(255,107,107,.12); }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .9rem; } .btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.as-btn { font: inherit; }
.field { display: flex; flex-direction: column; gap: 4px; } .lbl { font-size: .85rem; color: var(--muted); font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; } .inline-form > input:first-child { flex: 2 1 200px; } .inline-form > * { flex: 1 1 130px; width: auto; }
.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar select { width: auto; }
.segs { display: inline-flex; background: #0e2240; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg { background: transparent; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 14px; border-radius: 8px; cursor: pointer; min-height: 36px; }
.seg.on { background: var(--orange); color: #1a1000; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- layout ---- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.sidebar { background: var(--bg2); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.topbar, .tabbar { display: none; }
.main { padding: 24px clamp(16px, 3vw, 36px) 48px; min-width: 0; outline: none; }
.view { max-width: 1280px; margin: 0 auto; } .narrow { max-width: 860px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); } .brand:hover { text-decoration: none; }
.brand small { display: block; color: var(--muted); font-size: .75rem; }
.brand.center { justify-content: center; margin-bottom: 18px; }
.brand-text { min-width: 0; }
.brand .biz { font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.brand.center .brand-text { text-align: left; } .auth-card h1.biz { font-size: 1.5rem; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.topbar .brand { min-width: 0; flex: 1; } .topbar .brand .biz { font-size: 1.1rem; -webkit-line-clamp: 2; }
.topbar-r { flex: none; margin-left: 10px; }
.logo { display: block; line-height: 0; flex: none; border-radius: 10px; } .logo img { display: block; border-radius: 10px; } .logo.big img { border-radius: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.nav-link:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; } .nav-link.active { background: rgba(255,140,0,.15); color: var(--orange); }
.badge { margin-left: auto; background: var(--orange); color: #1a1000; border-radius: 999px; font-size: .72rem; font-weight: 800; padding: 1px 7px; }
.side-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.who { display: flex; gap: 10px; align-items: center; } .who small { display: block; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--text); flex: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; } .page-head p { margin: 0; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .sec-head h2 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; width: fit-content; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.empty { text-align: center; padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--r); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; } .auth-card { width: min(420px, 100%); }
.auth-card h1 { margin: 0; }

/* ---- chips ---- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: rgba(255,255,255,.08); color: var(--text); border: 1px solid transparent; white-space: nowrap; margin-left: 4px; }
.chip:first-child { margin-left: 0; }
.chip.st-lead { background: rgba(90,169,255,.18); color: var(--blue); } .chip.st-scheduled { background: rgba(255,140,0,.18); color: var(--orange); }
.chip.st-in_progress { background: rgba(251,191,36,.18); color: var(--warn); } .chip.st-completed { background: rgba(61,220,151,.18); color: var(--ok); }
.chip.st-cancelled { background: rgba(255,255,255,.08); color: var(--muted); }
.chip.ty-epoxy { background: rgba(150,130,255,.2); color: #b6a8ff; } .chip.ty-roofing { background: rgba(255,107,107,.18); color: #ff9c9c; } .chip.ty-solar { background: rgba(251,191,36,.2); color: #ffd36b; }
.chip.ds-draft, .chip.cs-pending { background: rgba(255,255,255,.1); color: var(--muted); } .chip.ds-sent, .chip.cs-approved { background: rgba(90,169,255,.2); color: var(--blue); }
.chip.ds-accepted, .chip.ds-paid, .chip.cs-paid { background: rgba(61,220,151,.2); color: var(--ok); } .chip.late { background: rgba(255,107,107,.2); color: var(--err); }
.chip.demo { background: rgba(251,191,36,.18); color: var(--warn); }

/* ---- board ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; scroll-snap-type: x proximity; }
.col { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; scroll-snap-align: start; min-height: 120px; }
.col.over { border-color: var(--orange); background: rgba(255,140,0,.07); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.count { background: var(--card2); border-radius: 999px; padding: 0 9px; font-size: .8rem; font-weight: 700; }
.col-body { display: flex; flex-direction: column; gap: 8px; }
.jcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: grab; }
.jcard:hover { border-color: var(--orange); } .jcard.dragging { opacity: .4; }
.jc-top, .jc-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.jc-title { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.move { min-height: 36px; padding: 4px 8px; font-size: .85rem; margin-top: 4px; }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid rgba(37,64,106,.6); vertical-align: middle; } .tbl tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card .tbl { box-shadow: none; }

/* ---- job detail ---- */
.jd-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; } .jd-head h1 { margin: 0; overflow-wrap: anywhere; }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 0; } .facts dt { color: var(--muted); font-weight: 600; font-size: .9rem; } .facts dd { margin: 0; overflow-wrap: anywhere; }
.tasks, .rems, .log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tasks li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid rgba(37,64,106,.5); } .tasks li .chk { flex: 1 1 200px; } .tasks li.done .tt { text-decoration: line-through; color: var(--muted); }
.log li { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; } .log li.log-note { border-left-color: var(--orange); } .log .note { background: rgba(255,255,255,.04); padding: 8px 10px; border-radius: 8px; margin-top: 2px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 8px; }
.ph { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; aspect-ratio: 1; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; } .ph-l { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 6px; text-transform: capitalize; }
.ph-big { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto 10px; border-radius: 8px; }
.line { display: grid; grid-template-columns: 1fr 70px 100px auto auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.line .l-desc { grid-column: 1; } .l-qty, .l-price { display: flex; flex-direction: column; } .l-tax { padding-bottom: 8px; }
.totals { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 200px; } .totals > div { display: flex; justify-content: space-between; gap: 24px; } .totals dt { color: var(--muted); } .totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 6px; } .totals .grand dt { color: var(--text); }
.right-align { margin-left: auto; width: min(320px, 100%); }
.toolbar-card { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.pin-once { font: 700 2rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .2em; text-align: center; padding: 18px; background: #0e2240; border: 2px dashed var(--orange); border-radius: 12px; margin: 12px 0; user-select: all; }

/* ---- paper (estimate/invoice) ---- */
.paper { background: #fff; color: #111; border-radius: 10px; padding: clamp(18px, 4vw, 40px); display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.paper .muted { color: #555; } .paper h1 { font-size: 1.6rem; margin: 0; letter-spacing: .08em; } .paper h2 { margin: 0; }
.paper-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.paper-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.paper .tbl { background: #fff; border: 0; border-radius: 0; } .paper .tbl th { color: #444; border-bottom: 2px solid #111; } .paper .tbl td { border-bottom: 1px solid #ddd; }
.paper .totals dt { color: #444; } .paper .totals .grand { border-top: 2px solid #111; } .paper .chip { background: #eee; color: #222; }

/* ---- calendar ---- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dow { background: var(--bg2); text-align: center; padding: 6px 0; font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.cell { background: var(--card); min-height: 108px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; } .cell.out { background: var(--bg2); opacity: .65; } .cell.today { box-shadow: inset 0 0 0 2px var(--orange); }
.cell-day { align-self: flex-start; background: transparent; border: 0; color: var(--muted); font: inherit; font-weight: 700; font-size: .85rem; padding: 2px 6px; border-radius: 6px; cursor: pointer; } .cell.today .cell-day { background: var(--orange); color: #1a1000; }
.cell-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-item { display: flex; flex-direction: column; background: rgba(255,140,0,.16); border-left: 3px solid var(--orange); color: var(--text); border-radius: 6px; padding: 2px 6px; font-size: .78rem; min-width: 0; overflow: hidden; }
.cal-item:hover { text-decoration: none; background: rgba(255,140,0,.28); } .cal-item.ty-epoxy { border-left-color: #b6a8ff; background: rgba(150,130,255,.16); } .cal-item.ty-roofing { border-left-color: #ff9c9c; background: rgba(255,107,107,.15); } .cal-item.ty-solar { border-left-color: #ffd36b; background: rgba(251,191,36,.15); }
.cal-item.task { border-left-color: var(--blue); background: rgba(90,169,255,.15); } .ci-t { font-weight: 700; font-size: .7rem; color: var(--muted); } .ci-x { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-link { background: transparent; border: 0; color: var(--orange); font: inherit; font-size: .75rem; text-align: left; cursor: pointer; padding: 0 4px; } .dots { display: none; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } .wday { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; } .wday.today { border-color: var(--orange); }
.wday-h { background: transparent; border: 0; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; padding: 0 0 4px; }
.day { display: flex; flex-direction: column; gap: 8px; } .day .cal-item { font-size: .95rem; padding: 8px 12px; }
.flip { display: inline-flex; transform: scaleX(-1); }

/* ---- pipeline / inbox ---- */
.big { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; } .stat-card .big { margin: 4px 0; }
.pipe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.pstage { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; } .pstage-total { font-weight: 800; color: var(--orange); font-size: 1.15rem; }
.pjob { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); } .pjob:hover { border-color: var(--orange); text-decoration: none; }
.rem { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; } .rem.late { border-color: rgba(255,107,107,.5); }
.rem-main { flex: 1 1 260px; } .rem-text { font-weight: 700; } .rem-actions { display: flex; gap: 6px; }

/* ---- modal / toast ---- */
.modal { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal.wide { width: min(760px, calc(100vw - 24px)); } .modal::backdrop { background: rgba(3, 10, 22, .72); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; } .modal-head h2 { margin: 0; }
.modal-body { padding: 18px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 32px); }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); } .toast.err { border-left-color: var(--err); }
.more-list { display: flex; flex-direction: column; gap: 4px; } .more-item { display: flex; gap: 12px; align-items: center; padding: 14px 10px; border-radius: 10px; color: var(--text); background: transparent; border: 0; font-weight: 600; width: 100%; text-align: left; cursor: pointer; } .more-item:hover { background: rgba(255,255,255,.06); text-decoration: none; }

/* ---- tablet / mobile ---- */
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } .week { grid-template-columns: 1fr; } .paper-meta { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; justify-content: space-between; align-items: center; padding: 8px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab); background: var(--bg2); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .68rem; font-weight: 700; background: transparent; border: 0; cursor: pointer; position: relative; min-width: 0; } .tab:hover { text-decoration: none; } .tab.active { color: var(--orange); }
  .tab .badge { position: absolute; top: 4px; left: 54%; margin: 0; }
  .main { padding: 14px 12px calc(var(--tab) + 28px); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .board { grid-auto-columns: 82%; }
  .toasts { bottom: calc(var(--tab) + 10px); right: 8px; left: 8px; }
  .btn { min-height: 44px; } .btn.sm { min-height: 40px; }
  .line { grid-template-columns: 1fr 1fr auto auto; } .line .l-desc { grid-column: 1 / -1; }
  .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 8px; }
  .cell { min-height: 54px; align-items: center; } .cell .cell-items { display: none; } .cell .dots { display: flex; gap: 3px; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); } .dots i.task { background: var(--blue); }
  .cell-day { padding: 8px 10px; }
  /* tables become cards */
  .tbl.stack-sm, .tbl.stack-sm tbody, .tbl.stack-sm tr, .tbl.stack-sm td { display: block; width: 100%; }
  .tbl.stack-sm { background: transparent; border: 0; }
  .tbl.stack-sm thead { position: absolute; left: -9999px; }
  .tbl.stack-sm tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .tbl.stack-sm td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  .tbl.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; text-align: left; flex: none; }
  .tbl.stack-sm td[data-label=""]::before { content: none; } .tbl.stack-sm td[data-label=""]:empty { display: none; }
  .row-actions { justify-content: flex-start; }
}
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .tabbar, .no-print, .toasts, dialog { display: none !important; }
  .shell { display: block; } .main { padding: 0; } .view, .narrow { max-width: none; }
  .paper { box-shadow: none; padding: 0; border-radius: 0; }
}
td select[aria-label="Commission status"] { min-width: 104px; padding-left: 8px; padding-right: 4px; }

/* estimate/invoice paper on narrow phones: the 4-column line table must fit inside the paper (was 18px too wide at 390px) */
@media (max-width: 520px) {
  .paper { min-width: 0; }
  .paper .tbl.paper-lines { table-layout: fixed; }
  .paper .tbl.paper-lines th, .paper .tbl.paper-lines td { padding: 8px 4px; font-size: .86rem; }
  .paper .tbl.paper-lines th { font-size: .68rem; letter-spacing: 0; }
  .paper .tbl.paper-lines th:nth-child(1), .paper .tbl.paper-lines td:nth-child(1) { width: 40%; overflow-wrap: anywhere; }
  .paper .tbl.paper-lines th.num, .paper .tbl.paper-lines td.num { width: 20%; text-align: right; overflow-wrap: anywhere; }
  .paper .tbl.paper-lines th:nth-child(2), .paper .tbl.paper-lines td:nth-child(2) { width: 12%; }
}
