/* mod-money: estimates, job Budget tab, Billing & Profit, printable proposal */

.mo .r{text-align:right}
.mo-js .mo-nojs{display:none}
.mo-h3{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:14px;font-weight:600;margin:4px 0 10px}
.mo-h3 .tag{font-size:11.5px;color:var(--muted);font-weight:500}
.mo-h3 .btn{margin-left:auto}
.mo-tab{display:flex;flex-direction:column;gap:14px}
.mo-sec{border-top:1px solid var(--line);padding-top:14px}
.mo-scroll{position:relative;overflow-x:auto;-webkit-overflow-scrolling:touch}
.mo-acts{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;align-items:center}
.mo-acts form{display:inline}
.mo-sub{display:block;font-size:11.5px;color:var(--muted);font-family:var(--font);white-space:nowrap}
.mo-sub.amber{color:var(--warn)} .mo-sub.down{color:var(--bad)}
.mo-note{margin-top:8px}
.mo-crumbs{margin-bottom:-6px}

/* summary boxes */
.mo-sum{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.mo-sum6{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.mo-box{padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid var(--line);min-width:0}
.mo-box>small:first-child{color:var(--muted);font-size:12.5px;display:block}
.mo-box b{display:block;font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;margin:2px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mo-box .bar{margin:6px 0 2px;min-width:0}
.mo-box small.small{display:block}
@media (max-width:620px){.mo-sum,.mo-sum6{grid-template-columns:1fr 1fr}.mo-box b{font-size:17px}}

/* tables */
.mo-tbl{font-size:14px}
.mo-tbl tbody tr{cursor:default}
.mo-tbl tbody tr[data-href]{cursor:pointer}
.mo-tbl tfoot th,.mo-tbl tfoot td{border-top:1px solid var(--line);padding:10px;font-weight:600;color:var(--text);text-transform:none;letter-spacing:0;font-size:13.5px}
.mo-tbl tbody th{font-weight:500;text-transform:none;letter-spacing:0;color:var(--text);font-size:14px;border-bottom:1px solid rgba(255,255,255,.06)}
.mo-tbl .job a{display:block}
.mo-tbl .job a:hover b{color:var(--blue-2)}
.mo-late td{background:rgba(255,107,107,.05)}

/* estimate */
.mo-esthead h2{flex-wrap:wrap}
.mo-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 18px;font-size:14px}
.mo-meta dt{font-size:12px;color:var(--muted)}
.mo-meta dd{font-weight:600;overflow-wrap:anywhere}
.mo-status{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.mo-status form{display:inline}
.mo-status .btn.sm,.mo-acts .btn.sm{min-height:44px;height:auto}
.mo-lines{min-width:620px}
.mo-lines td{padding:6px 6px;border-bottom:0}
.mo-lines th{padding:8px 6px}
.mo-lines td:first-child{width:52%}
.mo-lines td:nth-child(2),.mo-lines td:nth-child(3){width:14%}
.mo-lines .input{height:44px}
.mo-lines .input.num{text-align:right}
.mo-lines .mo-amt{white-space:nowrap;color:var(--text)}
.mo-lines tfoot th,.mo-lines tfoot td{padding:12px 6px}
.mo-total{font-size:15px;color:#fff!important}
.mo-rm{min-width:44px;height:44px!important;justify-content:center}
.mo-add{margin-top:8px;min-height:44px}

/* assignments */
.mo-arows{display:flex;flex-direction:column;gap:8px}
.mo-arow{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1.4fr) 76px 84px 90px 70px;gap:10px;align-items:end;padding:10px;border-radius:14px;background:rgba(255,255,255,.03);border:1px solid var(--line)}
.mo-arow .field{min-width:0}
.mo-arow .field label{font-size:12px;margin-bottom:4px}
.mo-arow .input.r{text-align:right}
.mo-arow .mo-acts{grid-column:1/-1}
.mo-ahead{display:none}
.mo-cell{min-height:44px;display:flex;flex-direction:column;justify-content:center;font-size:14px}
.mo-cell:empty{display:none}
.mo-lbl{font-size:12px;color:var(--muted)}
.mo-anew{border-style:dashed;background:none}
.mo-anew .mo-acts{grid-column:auto}
.mo-anew{grid-template-columns:minmax(0,1.6fr) minmax(0,1.4fr) 76px 84px auto}
.mo-arow .mo-acts .btn.sm{min-height:44px}
.mo .help{font-size:12px;color:var(--dim)}
@media (max-width:760px){
  .mo-arow,.mo-anew{grid-template-columns:1fr 1fr}
  .mo-anew .mo-acts{grid-column:1/-1}
}

/* billing */
.mo-monthbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.mo-mnav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mo-mnav h2{font-size:19px;min-width:150px;text-align:center}
.mo-mnav .btn.sm,.mo-monthbar .btn.sm{min-height:44px}
.mo-pick{display:flex;gap:6px;align-items:center}
.mo-pick .input{width:auto;min-width:160px;color-scheme:dark}
.mo-seg a{padding:8px 12px;border-radius:7px;font-size:12.5px;color:var(--muted);min-height:36px;display:inline-flex;align-items:center}
.mo-seg a.on{background:rgba(255,255,255,.12);color:#fff}
.mo-client,.mo-person{padding:12px 0;border-top:1px solid var(--line)}
.mo-client:first-of-type{border-top:0}
.mo-chead{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:6px}
.mo-chead h3{font-size:15px;font-weight:650}
.mo-ctot b{font-size:16px;color:#fff}
.mo-bill{min-width:820px}
.mo-terms{display:inline-block;font-size:12px;font-weight:600;padding:2px 9px;border-radius:20px;border:1px solid var(--line-2);color:var(--silver);white-space:nowrap}
.mo-t-monthly{color:#7cc4ff;border-color:rgba(79,180,255,.45)}
.mo-t-delivery{color:#ffd27a;border-color:rgba(255,194,75,.45)}
.mo-pop{display:inline-block;text-align:left}
.mo-pop[open]{display:block}
.mo-pop[open] summary{margin-left:auto;width:max-content}
.mo-pop summary{list-style:none;min-height:44px;height:auto}
.mo-pop summary::-webkit-details-marker{display:none}
.mo-popform{margin-top:8px;width:min(320px,80vw);padding:14px;gap:10px;border-radius:14px;background:#0d1a33;border:1px solid var(--line-2);box-shadow:0 20px 50px -10px rgba(0,0,0,.7)}
.mo-popform .two{grid-template-columns:1fr 1fr;gap:10px}
.mo-popl{margin-top:8px}
.mo-inline{display:inline}
.mo-x{min-width:44px;min-height:44px;justify-content:center;margin-left:4px}
.mo-payrow td{font-size:13.5px}
.mo-team{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:0 24px}
.mo-split{display:grid;grid-template-columns:1.1fr 1fr;gap:20px;align-items:end}
@media (max-width:980px){.mo-split{grid-template-columns:1fr}}
.mo-chart{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;height:190px;align-items:end}
.mo-col{display:flex;flex-direction:column;align-items:center;gap:4px;height:100%;min-width:0}
.mo-col span{font-size:12px;color:var(--muted)}
.mo-col.on span{color:#fff;font-weight:600}
.mo-col small{font-size:11px;white-space:nowrap}
.mo-bars{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:3px;border-bottom:1px solid var(--line)}
.mo-bars i{display:block;width:38%;max-width:22px;min-height:2px;border-radius:5px 5px 0 0}
.mo-bars i.b{background:linear-gradient(180deg,var(--blue-2),var(--blue-deep))}
.mo-bars i.c{background:linear-gradient(180deg,var(--warn),#c98a12)}
.mo-col.on .mo-bars{background:rgba(30,155,255,.07);border-radius:8px 8px 0 0}
.mo-legend{margin-top:10px;flex-wrap:wrap}
.mo-settings summary{list-style:none;cursor:pointer;min-height:44px;display:flex;align-items:center}
.mo-settings summary::-webkit-details-marker{display:none}
.mo-settings summary h2::after{content:"▾";color:var(--muted);font-size:12px}
.mo-settings[open] summary{margin-bottom:14px}

/* ================= printable proposal (standalone page) ================= */
.mo-printpage{margin:0;background:#e9edf2;color:#111;font:14px/1.5 "Inter","Segoe UI",system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;overflow-x:hidden}
.mo-printpage *{box-sizing:border-box}
.mo-printbar{display:flex;justify-content:space-between;align-items:center;gap:12px;max-width:820px;margin:0 auto;padding:14px 16px}
.mo-printbar a{color:#0b5fd1;text-decoration:none;min-height:44px;display:inline-flex;align-items:center}
.mo-printbar button{font:inherit;font-weight:600;color:#fff;background:#1580ef;border:0;border-radius:10px;padding:0 18px;min-height:44px;cursor:pointer}
.mo-printbar button:focus-visible,.mo-printbar a:focus-visible{outline:2px solid #0b5fd1;outline-offset:2px}
.mo-sheet{max-width:820px;margin:0 auto 40px;background:#fff;padding:48px 56px;box-shadow:0 10px 40px rgba(0,0,0,.12)}
.mo-ph{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding-bottom:18px;border-bottom:2px solid #0b5fd1}
.mo-brand{display:flex;align-items:center;gap:12px}
.mo-brand img{width:64px;height:auto}
.mo-brand b{display:block;font-size:22px;letter-spacing:.06em;color:#0a1630}
.mo-brand span{font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:#4a5568}
.mo-co{text-align:right;font-size:13px;color:#333}
.mo-sheet h1{font-size:26px;margin:26px 0 18px;color:#0a1630}
.mo-sheet h1 span{font-size:16px;color:#4a5568;font-weight:600;margin-left:8px}
.mo-sheet h2{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#4a5568;margin:0 0 6px}
.mo-pgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-bottom:20px}
.mo-pgrid p{margin:0}
.mo-blankline{border-bottom:1px solid #999;height:40px}
.mo-intro{margin:0 0 20px}
.mo-ptable{width:100%;border-collapse:collapse;margin:8px 0 24px;font-size:14px}
.mo-ptable th{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:#4a5568;text-align:left;padding:8px 10px;border-bottom:2px solid #222}
.mo-ptable td{padding:9px 10px;border-bottom:1px solid #ddd;color:#111;font-variant-numeric:tabular-nums}
.mo-ptable .r{text-align:right}
.mo-ptable tfoot th,.mo-ptable tfoot td{border-top:2px solid #222;border-bottom:0;padding:12px 10px;font-size:15px;color:#111;letter-spacing:0;text-transform:none}
.mo-pterms{margin-bottom:24px}
.mo-pterms p{margin:0 0 6px}
.mo-sign p{margin:0 0 20px}
.mo-sigs{display:grid;grid-template-columns:2fr 2fr 1fr;gap:24px;margin-bottom:26px}
.mo-sigs span{display:block;border-bottom:1px solid #222;height:36px}
.mo-sigs small{font-size:12px;color:#4a5568}
.mo-pf{margin-top:30px;padding-top:12px;border-top:1px solid #ddd;font-size:11.5px;color:#555;text-align:center}
@media (max-width:700px){
  .mo-sheet{padding:24px 16px;margin:0 0 20px}
  .mo-ph{flex-direction:column}.mo-co{text-align:left}
  .mo-pgrid{grid-template-columns:1fr}
  .mo-sigs{grid-template-columns:1fr}
  .mo-ptable{font-size:13px}.mo-ptable td,.mo-ptable th{padding:8px 5px}
}
@media print{
  @page{margin:14mm 14mm 16mm;@bottom-right{content:"Page " counter(page) " of " counter(pages);font-size:7.5pt;color:#556;font-family:Inter,Arial,sans-serif}}
  .mo-printpage{background:#fff}
  .mo-printbar{display:none}
  .mo-sheet{box-shadow:none;margin:0;padding:0;max-width:none}
  .mo-ptable tr,.mo-sigs{break-inside:avoid}
}

/* hours form: admins pick whose hours (extra "Person" field) */
.hz-fields.who{grid-template-columns:minmax(190px,2fr) 170px 150px 96px 150px minmax(140px,1.6fr) auto}
.hz-fields.lock.who{grid-template-columns:1fr 1fr 1fr}
.hz-fields.lock.who .hz-note,.hz-fields.lock.who .hz-go{grid-column:auto}
@media (max-width:1180px){.hz-fields.who{grid-template-columns:1fr 1fr 1fr}}
@media (max-width:520px){.hz-fields.who,.hz-fields.lock.who{grid-template-columns:1fr 1fr}.hz-fields.lock.who .hz-note,.hz-fields.lock.who .hz-go,.hz-fields.who .hz-person{grid-column:1/-1}}
.mo-estform,.mo-popform,.mo-settings .form{grid-template-columns:minmax(0,1fr)}
.mo-estform>*{min-width:0}

/* ================= team pay: My pay / Team pay (v0.5.0) ================= */
.tp-intro{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.tp-period{display:flex;align-items:center;gap:12px;min-width:0}
.tp-period b{display:block;font-size:16px}
.tp-period small{display:block;color:var(--muted);font-size:13px}
.tp-ic{width:38px;height:38px;flex:none;border-radius:12px;display:grid;place-items:center;background:rgba(30,155,255,.15);color:var(--blue-2);box-shadow:inset 0 0 0 1px rgba(79,180,255,.25)}
.tp-ic svg{width:18px;height:18px}
.tp-kpis{grid-template-columns:repeat(3,1fr)}
.tp-crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.tp-off td{opacity:.6}
.mo-stno{display:inline-flex;align-items:center;gap:6px;font-weight:600;color:var(--blue-2);text-decoration:none;min-height:32px}
.mo-stno svg{width:15px;height:15px}
.mo-stno:hover{text-decoration:underline}
.mo-ctot{display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px}
.mo-adjrow td{font-size:13.5px;color:var(--muted)}
.tp-hours{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}
.tp-hours summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:var(--blue-2);font-weight:600;font-size:14px}
.tp-adjlist{list-style:none;margin:0 0 14px;padding:0}
.tp-adjlist li{display:flex;align-items:center;gap:12px;padding:6px 0;border-bottom:1px solid var(--line)}
.tp-adjlist li span{flex:1;min-width:0}
.tp-adjform{display:grid;grid-template-columns:minmax(150px,1.2fr) minmax(110px,.8fr) minmax(180px,2fr) auto;gap:12px;align-items:end}
.tp-adjform .field{margin:0}
@media (max-width:1180px){.tp-kpis{grid-template-columns:repeat(3,1fr)}}
@media (max-width:820px){.tp-kpis{grid-template-columns:1fr}.tp-adjform{grid-template-columns:1fr 1fr}.tp-adjform .tp-wide,.tp-adjform .tp-go{grid-column:1/-1}}
.mo-info{display:flex;align-items:flex-start;gap:8px;margin:0 0 12px;color:var(--muted);font-size:13.5px}
.mo-info svg{width:16px;height:16px;flex:none;margin-top:2px;color:var(--blue-2)}

/* ================= Billing & Profit > Monthly invoices (v0.9.0) ================= */
.mi .mo-info span{min-width:0}
.mi-warn,.mi-warn svg{color:var(--warn)!important}
.mi-tbl td{vertical-align:top}
.mi-tbl th.mi-ck,.mi-tbl td.mi-ck{width:52px;padding-left:4px;padding-right:4px}
.mi-ckl{display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-top:-4px;cursor:pointer}
.mi-ckl input{width:20px;height:20px;accent-color:var(--blue-2);color-scheme:dark;cursor:pointer}
.mi-na{color:var(--dim);cursor:default}
.mi-tbl .job small,.mi-clip{display:block;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mi-tbl .job small{font-size:12px;color:var(--muted)}
.mi-amt{min-width:170px}
.mi-amt .input{width:150px;height:40px;text-align:right;margin-left:auto;display:block;font-variant-numeric:tabular-nums}
.mi-amt .input:invalid{border-color:var(--bad)}
.mi-amt .mo-sub{margin-top:4px}
.mi-wrap{white-space:normal!important;max-width:240px;margin-left:auto}
.mi-state{font-weight:600;color:var(--text);font-size:13.5px}
.mi-lbl{display:none}
.mi-off td.job,.mi-off td.mi-client,.mi-off td.mi-h,.mi-off td.mi-raw,.mi-off .mi-amt .input,.mi-off .mi-amt .mo-sub:not(.amber){opacity:.5}
.mi-dim td{opacity:.62}
.mi-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px 18px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.mi-foot .btn{min-height:44px}
.mi-foot .btn svg{width:16px;height:16px;flex:none}
.mi-foot .btn:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.4)}
.mi-sum{display:flex;align-items:baseline;gap:10px;margin:0}
.mi-sum b{font-size:20px;color:#fff}
.mi-err{flex-basis:100%}
.mi-done{scroll-margin-top:16px}
.mi-done .head h2{flex-wrap:wrap}
.mi .help{margin-top:12px}
@media (max-width:760px){
  .mi-tbl,.mi-tbl tbody{display:block}
  .mi-tbl thead{display:none}
  .mi-tbl tr{display:grid;grid-template-columns:44px minmax(0,1fr) minmax(0,1fr);gap:2px 12px;padding:12px 0;border-bottom:1px solid rgba(255,255,255,.06)}
  .mi-tbl td{border:0;padding:0;min-width:0}
  .mi-tbl td.mi-ck{grid-row:1/span 3;width:auto;padding:0}
  .mi-tbl td.job,.mi-tbl td.mi-client,.mi-tbl td.mi-amt{grid-column:2/-1}
  .mi-tbl td.mi-client{font-size:13px;color:var(--muted)}
  .mi-tbl td.mi-h,.mi-tbl td.mi-raw{text-align:left;font-size:13.5px;margin-top:4px}
  .mi-lbl{display:block;font-size:11px;color:var(--dim);font-family:var(--font)}
  .mi-tbl td.mi-amt{text-align:left;margin-top:8px;min-width:0}
  .mi-amt .input{width:100%;max-width:220px;margin-left:0;text-align:left}
  .mi-wrap{margin-left:0;max-width:none}
  .mi-tbl .job small,.mi-clip{max-width:none}
  .mi-foot{justify-content:space-between}
  .mi-foot .btn{flex:1 1 100%;justify-content:center}
}
/* v0.13.0: Monthly invoices scope picker (jobs with 2+ scopes) */
.mi-amt select.mi-scope{width:220px;text-align:left;margin-bottom:6px}
@media (max-width:760px){.mi-amt select.mi-scope{width:100%;max-width:260px}}
/* v0.13.0: job Invoices tab, Edit opens the form right under the invoice */
.hz-inv .ji-editrow td{padding:4px 0 16px}
.ji-edit{white-space:normal;padding:12px 14px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(255,255,255,.03);scroll-margin-top:16px}
.ji-edit .form{margin-top:8px}
/* v0.13.0: estimate Accept with a scope picker (jobs with 2+ scopes) */
.mo-status form.mo-accept{display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px}
.mo-accscope{width:auto;max-width:100%;min-height:44px}
