/* hours module: Hours & Billing page and the job Hours / Invoices tabs */

.hz-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.hz-js .hz-nojs{display:none}
.hz-opt{color:var(--dim);font-weight:400}
.hz-red{color:#ff9a9a}

/* page tabs */
.hz-tabs{display:flex;gap:6px;padding:6px;align-self:flex-start;border-radius:16px}
.hz-tabs a{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px;border-radius:12px;color:var(--muted);font-weight:600;font-size:14px;transition:background .2s,color .2s}
.hz-tabs a svg{width:17px;height:17px}
.hz-tabs a:hover{color:var(--text);background:rgba(255,255,255,.06)}
.hz-tabs a.on{color:#fff;background:linear-gradient(90deg,rgba(30,155,255,.3),rgba(30,155,255,.1));box-shadow:inset 0 0 0 1px rgba(79,180,255,.38)}

/* log form: one line on wide screens */
.hz-fields{display:grid;grid-template-columns:minmax(220px,2.2fr) 150px 100px 150px minmax(160px,2fr) auto;gap:12px;align-items:end}
.hz-fields.lock{grid-template-columns:1.2fr .8fr 1.2fr}
.hz-fields.lock .hz-note{grid-column:1/3}
.hz-fields.lock .hz-go{grid-column:3;justify-content:stretch}
.hz-fields.lock .hz-go .btn{flex:1;justify-content:center}
.hz-go{display:flex;gap:8px}
.hz-go .btn{height:44px}
.hz-hint{font-size:12.5px;color:var(--muted)}
@media (max-width:1180px){
  .hz-fields{grid-template-columns:1fr 1fr 1fr}
  .hz-fields .hz-job,.hz-fields .hz-note{grid-column:1/-1}
  .hz-go{grid-column:1/-1;justify-content:flex-end}
}
@media (max-width:520px){
  .hz-fields,.hz-fields.lock{grid-template-columns:1fr 1fr}
  .hz-fields.lock .hz-note,.hz-fields.lock .hz-go{grid-column:1/-1}
  .hz-fields .field:nth-child(n){min-width:0}
  .hz-go .btn{flex:1;justify-content:center}
}
input[type=date].input{color-scheme:dark}

/* stats */
.hz-stats .stat .bar{margin:10px 0 4px}

/* week navigation */
.hz-weeknav{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.hz-weeknav .btn.sm{height:44px;min-width:44px}
.hz-who{display:flex;gap:6px;align-items:center}
.hz-who select.input{height:44px;width:auto;min-width:170px}

.hz-scroll{position:relative;overflow-x:auto;-webkit-overflow-scrolling:touch}

/* week grid */
.hz-week{min-width:680px}
.hz-week th small{display:block;font-family:var(--mono);font-size:12px;letter-spacing:0;color:var(--muted);text-transform:none;font-weight:500}
.hz-week tbody th{font-weight:400;text-align:left;padding:12px 10px;border-bottom:1px solid rgba(255,255,255,.06);letter-spacing:0;text-transform:none;color:var(--text);font-size:14px}
.hz-week td.zero{color:var(--dim)}
.hz-week .today{background:rgba(30,155,255,.08)}
.hz-week thead th.today{color:var(--blue-2)}
.hz-week .tot{font-weight:700;color:var(--text)}
.hz-week tfoot th,.hz-week tfoot td{border-top:1px solid var(--line);padding:12px 10px;font-weight:700;color:var(--text)}
.hz-week tfoot th{text-align:left;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.hz-week tbody tr.hz-none{cursor:default}
.hz-week tbody tr.hz-none:hover{background:none}
@media (max-width:860px){
  .hz-week tbody th,.hz-week thead th:first-child,.hz-week tfoot th{position:sticky;left:0;z-index:1;background:#0d1d38}
  .hz-week tbody th{max-width:140px}
  .hz-week tbody th small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* tables */
.hz-entries tbody tr,.hz-inv tbody tr{cursor:default}
.hz-editing{background:rgba(30,155,255,.1)!important;box-shadow:inset 3px 0 0 var(--blue-2)}
.hz-notecell{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hz-mtask{display:none}
@media (max-width:860px){.hz-mtask{display:inline}}
.hz-clip{display:block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hz-inv td.job a:hover b{text-decoration:underline}
.hz-acts{display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:nowrap}
.hz-acts form{display:inline}
.hz-acts .btn.sm{height:36px}
@media (pointer:coarse){.hz-acts .btn.sm{height:44px}}

/* mark paid */
.hz-pay{position:relative;display:inline-block}
.hz-pay summary{list-style:none;cursor:pointer}
.hz-pay summary::-webkit-details-marker{display:none}
.hz-pay summary svg{width:14px;height:14px}
.hz-pay[open] summary{filter:brightness(.85)}
.hz-payform{display:flex;gap:6px;align-items:center;margin-top:8px}
.hz-payform .input{height:38px;width:150px;padding:0 10px}

/* filter segmented links */
.hz-seg a{display:inline-flex;align-items:center;min-height:36px;padding:0 14px;border-radius:7px;font-size:13px;color:var(--muted)}
.hz-seg a.on{background:rgba(255,255,255,.12);color:#fff}
.hz-seg a:hover{color:#fff}

/* ---------- job tab partials ---------- */
.hz-tab{display:flex;flex-direction:column;gap:18px}
.hz-sum{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.hz-box{border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.03);padding:14px 16px}
.hz-box>small{color:var(--muted);font-size:12.5px;display:block}
.hz-box>b{display:block;font-size:22px;font-weight:700;font-variant-numeric:tabular-nums;margin-top:2px}
.hz-box .bar{margin:10px 0 6px}
.hz-box .bar.over i{background:linear-gradient(90deg,#c43d3d,var(--bad));box-shadow:0 0 12px rgba(255,107,107,.5)}
.hz-box .bar.paid{position:relative}
.hz-box .bar.paid i.pd{position:absolute;left:0;top:0;background:linear-gradient(90deg,#1f9c66,var(--ok));box-shadow:none}
.hz-h3{font-size:14px;font-weight:600;margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.hz-h3 .tag{font-size:11.5px;color:var(--muted);font-weight:500}
.hz-split{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.hz-brk{display:flex;flex-direction:column;gap:10px}
.hz-brk .it{display:grid;grid-template-columns:minmax(90px,1fr) 2fr auto;gap:10px;align-items:center;font-size:14px}
.hz-brk .it .bar{min-width:0}
.hz-brk .it span.num{min-width:48px;text-align:right}
.hz-legend{display:flex;gap:14px;font-size:12px;color:var(--muted);flex-wrap:wrap}
.hz-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}
@media (max-width:860px){.hz-split{grid-template-columns:1fr}}
@media (max-width:520px){.hz-sum{grid-template-columns:1fr 1fr;gap:10px}.hz-sum .hz-box:first-child{grid-column:1/-1}}

/* phone tweaks */
.hz-entries td.hz-d,.hz-inv td.num{white-space:nowrap}
@media (max-width:520px){
  .hz-stats{grid-template-columns:repeat(3,1fr);gap:10px}
  .hz-stats .stat{padding:12px}
  .hz-stats .stat b{font-size:18px}
  .hz-stats .stat small{font-size:11.5px}
  .hz-stats .stat .bar{min-width:0}
  .hz-entries .hz-acts{flex-direction:column;align-items:stretch;gap:4px}
  .hz-entries .hz-acts .btn{justify-content:center}
  .hz-entries td,.hz-entries th{padding-left:6px;padding-right:6px}
  .hz-weeknav{width:100%}
  .hz-who{flex:1 1 100%}
  .hz-who select.input{flex:1}
}
/* v0.6: a client reported a payment in the portal */
.hz-acts{flex-wrap:wrap}
.hz-rep{flex-basis:100%;display:flex;align-items:center;justify-content:flex-end;gap:6px;font-size:12px;color:var(--blue-2);white-space:nowrap}
.hz-rep svg{width:14px;height:14px;flex:none}

/* dashboard: payments clients reported in the portal (v0.6.0) */
.ci-dash{border-color:rgba(30,155,255,.35)!important}
.ci-dash .head h2{display:flex;align-items:center;gap:10px}
.ci-dash .head h2 svg{width:18px;height:18px;flex:none;color:var(--blue-2)}
.ci-dash-note{margin:-6px 0 12px;max-width:860px}
.ci-dash-list{list-style:none;display:flex;flex-direction:column;gap:8px}
.ci-dash-list li{display:flex;align-items:center;justify-content:space-between;gap:10px 16px;flex-wrap:wrap;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.035)}
.ci-dash-what{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;min-width:0;flex:1}
.ci-dash-what small{flex-basis:100%;font-size:12.5px;overflow-wrap:anywhere}
.ci-dash-what b{font-size:15px}
.ci-dash-acts{display:flex;gap:8px;flex-wrap:wrap}
.ci-dash-acts .btn{min-height:40px}
.ci-dash-acts svg{width:16px;height:16px;flex:none}
/* job Invoices tab: actions on their own line under each invoice, so they never hide off to the side (v0.6.0) */
.hz-inv .hz-invgrp td{border-bottom:0}
.hz-inv .hz-invgrp{border-bottom:1px solid rgba(255,255,255,.06)}
.hz-inv .hz-invgrp:last-child{border-bottom:0}
.hz-inv .hz-invgrp tr:hover{background:none}
.hz-inv .hz-invgrp:hover{background:rgba(255,255,255,.035)}
.hz-inv .hz-invgrp tr:first-child td{padding-bottom:4px}
.hz-inv .hz-actrow td{padding-top:0}
.hz-inv .hz-actrow .hz-acts{display:flex;justify-content:flex-end}
.hz-inv .hz-actrow .hz-rep{flex-basis:auto;margin-right:auto;white-space:normal}
.hz-inv .hz-invgrp .hz-clip{white-space:normal;max-width:none}
@media (max-width:1400px){.hz-inv .hz-iss{display:none}}
@media (max-width:860px){.hz-inv .hz-actrow .hz-acts{justify-content:flex-start}.hz-inv .hz-actrow .hz-rep{flex-basis:100%;margin-right:0}}
@media (max-width:860px){
  .hz-inv:has(.hz-invgrp),.hz-inv .hz-invgrp,.hz-inv .hz-invgrp tr,.hz-inv .hz-invgrp td{display:block}
  .hz-inv:has(.hz-invgrp) thead{display:none}
  .hz-inv .hz-invgrp tr:first-child{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px;align-items:start;padding:10px 4px 6px}
  .hz-inv .hz-invgrp tr:first-child td{padding:0}
  .hz-inv .hz-invgrp td.job{grid-column:1;grid-row:1/span 3}
  .hz-inv .hz-invgrp td.job~td{grid-column:2;text-align:right}
  .hz-inv .hz-invgrp td.hz-iss{display:none}
  .hz-inv .hz-actrow td{padding:0 4px 12px}
  .hz-inv .hz-actrow .hz-rep{justify-content:flex-start}
}

/* job Change orders tab (v0.7.0) */
.co-tbl td.job b + b{margin-left:4px}
.co-tbl .co-desc{white-space:normal;max-width:620px;color:var(--silver);margin-top:2px}
.co-tab .co-rec[open]{flex-basis:100%;display:flex;flex-direction:column;align-items:flex-end}
.co-recform{flex-wrap:wrap;justify-content:flex-end}
.co-recform .input{width:220px}
.co-dec.co-approved{color:var(--ok)}
.co-dec.co-rejected{color:#ff9b9b}
.co-scopenote{display:flex;align-items:flex-start;gap:8px;margin:-6px 0 0}
.co-scopenote svg{width:16px;height:16px;flex:none;margin-top:1px;color:var(--ok)}
@media (max-width:860px){.co-tab .co-rec[open]{align-items:stretch}.co-recform .input{width:100%}}

/* v0.13: "Show older entries" under the entries tables */
.hz-more{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px}
.hz-more .btn.busy{opacity:.6;pointer-events:none}
@media (pointer:coarse){.hz-more .btn.sm{min-height:44px}}
.hz-entries tr[tabindex="-1"]:focus{outline:none}
/* v0.13.0: on the Invoices tab the action buttons wrap inside their column, so the table fits at 1280 px without sideways scrolling */
.hz-inv tr:not(.hz-actrow) > td:last-child > .hz-acts{max-width:240px}
.hz-inv tr:not(.hz-actrow) .hz-rep{white-space:normal;text-align:right}
/* v0.13.0: long change order titles wrap, so the Change orders tab fits beside the job's side box at 1280 px */
.co-tbl td.job b{white-space:normal}
