/* office-page.css: pages on the Office frame outside office.html (Labour rates, LOA approvals): cards, tables,
   dialogs. Office colours only; every control 44px on a phone. */
body { background: var(--gray-100); }
  .lr-page { max-width: 1180px; padding: 24px 28px 60px; }
  .lr-back { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--gray-300); border-radius: 8px; background: #fff;
    color: var(--dark); font-size: 14px; font-weight: 600; text-decoration: none; min-height: 40px; box-sizing: border-box; }
  .lr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
  .lr-head h1 { font-size: 22px; font-weight: 800; margin: 0; }
  .lr-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .lr-intro { color: var(--gray-500); font-size: 13.5px; margin: 0 0 16px; }
  .lr-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; overflow: hidden; }
  .lr-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 20px 10px; }
  .lr-card-head h2 { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); margin: 0; }
  .lr-card-head p { margin: 0; color: var(--gray-500); font-size: 13px; }
  .lr-card-body { padding: 0 20px 18px; }
  .lr-wrap { overflow-x: auto; }
  .lr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .lr-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--gray-500); background: var(--gray-50);
    padding: 10px 12px; border-top: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
  .lr-table td { padding: 11px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
  .lr-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .lr-table tr:last-child td { border-bottom: none; }
  .lr-muted { color: var(--gray-500); font-size: 12.5px; }
  .lr-mult { color: var(--gray-500); font-size: 12px; margin-left: 3px; }
  .lr-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--gray-100); color: var(--gray-700); white-space: nowrap; }
  .lr-pill.ok { background: #dcfce7; color: #166534; }
  .lr-pill.todo { background: #fef3c7; color: #92400e; }
  .lr-pill.bad { background: #fee2e2; color: #991b1b; }
  .lr-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
  .lr-note { font-size: 12.5px; color: var(--gray-500); margin-top: 8px; }
  .lr-sel, .lr-in { min-height: 40px; padding: 7px 10px; border: 1px solid var(--gray-300); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; box-sizing: border-box; }
  .lr-in.money { width: 96px; text-align: right; }
  .lr-row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
  .lr-empty { padding: 18px 20px; color: var(--gray-500); font-size: 14px; }
  .lr-err { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; display: none; }
  .lr-warn { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0; }
  .lr-modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 600; display: flex; align-items: center; justify-content: center; padding: 16px; }
  .lr-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 760px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
  .lr-modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-100); }
  .lr-modal header h3 { margin: 0; font-size: 17px; font-weight: 800; }
  .lr-modal .lr-modal-body { padding: 16px 20px; overflow-y: auto; }
  .lr-modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--gray-100); }
  .lr-x { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--gray-500); min-width: 40px; min-height: 40px; }
  .lr-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
  .lr-field label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
  .lr-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
  .lr-check input { width: 18px; height: 18px; accent-color: var(--orange); }
  .lr-phone-only { display: none; }
  @media (max-width: 768px) {
    .lr-page { padding: 14px 16px 60px; }
    .lr-table a { display: inline-flex; align-items: center; min-height: 44px; }
    .lr-back, .lr-head-actions .btn, .lr-row-actions .btn, .lr-card .btn, .lr-modal .btn, .lr-sel, .lr-in, .lr-x, .lr-check { min-height: 44px; }
    .lr-head-actions { width: 100%; }
    .lr-head-actions .btn { flex: 1; justify-content: center; }
    .lr-table { font-size: 13.5px; }
    .lr-in.money { width: 84px; }
    /* the ticket-levels table: one card per level */
    .lr-stack thead { display: none; }
    .lr-stack tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
    .lr-stack td { padding: 0; border: none; }
    .lr-stack td.lr-full { grid-column: 1 / -1; }
    .lr-stack td.lr-full .lr-sel { width: 100%; }
    .lr-phone-only { display: inline; }
    /* Ready to invoice: the money columns keep their names on a phone */
    .ri-table td[data-label]::before { content: attr(data-label) ": "; color: var(--gray-500); font-weight: 400; font-size: 12px; }
  }
/* Ready to invoice / invoice view: profit (Owners and Managers) */
.ri-loss, .ri-loss b { color: #b91c1c; }
.iv-profit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.iv-profit div { background: var(--gray-50, #f8fafc); border-radius: 8px; padding: 10px 12px; }
.iv-profit span { display: block; font-size: 12px; color: var(--gray-500); }
.iv-profit b { font-size: 18px; }
@media (max-width: 768px) { .iv-profit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* job tracker (docs/JOBS-PLAN.md §5) */
.jt-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.jt-big { font-size: 28px; font-weight: 800; }
.jt-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 12px; }
.jt-chip { border: 1px solid var(--gray-300); background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 36px; }
.jt-chip[aria-pressed="true"] { background: var(--dark); color: #fff; border-color: var(--dark); }
.jt-total td { font-weight: 800; border-top: 2px solid var(--gray-300); }
.jt-np { color: #92400e; font-size: 12px; }
.lr-table tr.jt-locked td { background: #f9fafb; }
.lr-table tr.jt-group td { border-top: 1px solid var(--gray-200); }
.lr-table tr.jt-child td { background: #fafafa; font-size: 13px; }
.lr-table tr.jt-child td:first-child { border-left: 3px solid var(--gray-200); }
.jt-expand { border: none; background: none; color: var(--orange); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 0; }
@media (max-width: 768px) { .jt-expand { min-height: 44px; } }
@media (max-width: 768px) { .jt-chip { min-height: 44px; } }
@media (max-width: 900px) { .jt-grid { grid-template-columns: 1fr !important; gap: 0 !important; } }
@media (max-width: 768px) { .lr-page .btn, .lr-page a.btn { min-height: 44px; } }
/* roles */
.ro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 0 20px 18px; }
.ro-role { border: 1px solid var(--gray-100); border-radius: 10px; padding: 12px 14px; }
.ro-role h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.ro-role ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--gray-700); }
/* Before job costing (owner Oct 18 2026): history only, greyed */
.jt-history { opacity: .85; }
.jt-before td { color: var(--gray-500); }
/* Quote on the job (owner Oct 18 2026) */
.jt-quote { font-size: 16px; line-height: 1.5; }
.jt-quote a, .jt-qrev a { display: inline-flex; align-items: center; min-height: 44px; }
.jt-qva { margin-top: 6px; font-size: 15px; }
.jt-qrev, .jt-qform { margin-top: 10px; }
.jt-qrev summary, .jt-qform summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
/* Ready to invoice and the invoice view (owner Oct 18 2026) */
.ri-open { min-height: 44px; display: inline-flex; align-items: center; }
.ri-actions { margin-top: 8px; }
.ri-after { margin-top: 6px; padding: 4px 8px; border-radius: 6px; background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 700; }
.iv-qva { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.iv-qva div { background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; }
.iv-qva span { display: block; font-size: 13px; color: var(--gray-500); }
.iv-qva b { font-size: 18px; }
.iv-cat { border-top: 1px solid var(--gray-200); padding: 12px 18px; }
.iv-cat-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.iv-cat-head h3 { margin: 0; font-size: 16px; }
.iv-cat-sum { font-size: 15px; }
.iv-lump { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.iv-lump label { width: 100%; font-size: 13px; font-weight: 700; }
.iv-lump .lr-in { max-width: 160px; min-height: 44px; }
.iv-lump .btn { min-height: 44px; }
.iv-returned td { color: #166534; }
.iv-voided td { color: var(--gray-500); text-decoration: line-through; }
.iv-tot { width: 100%; font-size: 16px; border-collapse: collapse; }
.iv-tot td { padding: 6px 0; border-bottom: 1px solid var(--gray-100); }
.iv-tot .big td { font-size: 19px; font-weight: 800; }
.iv-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; font-weight: 600; margin-top: 8px; }
.iv-check input { width: 22px; height: 22px; }
.iv-adj-form { margin-top: 12px; }
/* Profit (Owner only) */
.pf-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 14px; }
.pf-filters .lr-field span { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.pf-filters .lr-sel, .pf-filters .lr-in { width: 100%; }
.pf-filters .pf-custom[hidden] { display: none; }
.pf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pf-tile { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 14px 18px; }
.pf-tile .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); }
.pf-tile .v { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pf-tile .s { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.pf-neg { color: #b91c1c; }
.pf-chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 10px 20px 0; border-bottom: 1px solid var(--gray-200); margin: 0 20px; }
.pf-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 18px; }
.pf-bar i { display: block; width: 100%; max-width: 46px; background: var(--orange); border-radius: 4px 4px 0 0; }
.pf-bar i.neg { background: #ef4444; }
.pf-bar b { font-size: 11px; font-weight: 700; color: var(--gray-700); margin-bottom: 3px; white-space: nowrap; }
.pf-months { display: flex; gap: 6px; padding: 6px 40px 16px; }
.pf-months span { flex: 1; text-align: center; font-size: 11.5px; color: var(--gray-500); min-width: 18px; }
.pf-sort { border: none; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; }
.pf-search { margin: 0 20px 10px; }
.pf-search input { width: 100%; max-width: 420px; }
.pf-check li { padding: 6px 0; font-size: 14px; }
.pf-check { margin: 0; padding: 0 20px 16px 38px; }
@media (max-width: 768px) {
  .pf-sort { min-height: 44px; }
  .pf-tile .v { font-size: 22px; }
  .pf-chart { margin: 0 12px; padding: 10px 6px 0; height: 150px; }
  .pf-months { padding: 6px 18px 14px; }
  .pf-bar b { font-size: 9.5px; }
}
