/* ==========================================================================
   S16 Time & Billing Reports (Mockup 8) - finance/ops report surface.
   DataRipple tokens from chrome.css. Reuses APPR.ENTRIES (crew week) + EST
   (Willow Court estimate). Plain English, every number drills, SOC 2 evidence
   subordinated to a human summary. Review-only mockup. No Date().
   ========================================================================== */

/* ---- drillable table + share bars ------------------------------------- */
.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-table thead th { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3);
  text-align: right; padding: 8px 12px; border-bottom: 2px solid var(--border-default); white-space: nowrap; }
.rep-table thead th.l { text-align: left; }
.rep-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); text-align: right; vertical-align: middle; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.rep-table tbody td.l { text-align: left; }
.rep-table tbody tr.row { cursor: pointer; }
.rep-table tbody tr.row:hover td { background: #fafbfd; }
.rep-table tbody tr.row:hover td.l .nm { text-decoration: underline; text-underline-offset: 2px; }
.rep-table .nm { color: var(--fg-1); font-weight: 500; }
.rep-table .ph { color: var(--fg-3); font-size: 11.5px; }
.rep-table td.strong { font-weight: 700; color: var(--fg-1); }
.rep-table tfoot td { padding: 9px 12px; text-align: right; font-weight: 700; color: var(--fg-1); border-top: 2px solid var(--border-default); font-variant-numeric: tabular-nums; }
.rep-table tfoot td.l { text-align: left; }
.sharebar { display: inline-flex; align-items: center; gap: 9px; width: 190px; }
.sharebar .track { flex: 1; height: 7px; border-radius: 999px; background: var(--surface-secondary); overflow: hidden; }
.sharebar .fill { height: 100%; border-radius: 999px; background: var(--sky); }
.sharebar .pct { font-size: 11.5px; color: var(--fg-3); width: 34px; text-align: right; }
.drillchev { color: var(--fg-3); }

/* ---- margin-by-project (quoted vs projected) -------------------------- */
.mproj { display: flex; flex-direction: column; gap: 10px; }
.mrow { display: grid; grid-template-columns: 200px 1fr 260px; gap: 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--border-default); border-radius: var(--r-md); cursor: pointer; }
.mrow:hover { background: #fafbfd; }
.mrow .pn { font-size: 14px; font-weight: 600; color: var(--fg-1); }
.mrow .pn .sub { display: block; font-size: 11.5px; color: var(--fg-3); font-weight: 400; margin-top: 1px; }
.mtrack { position: relative; height: 26px; border-radius: var(--r-sm); background: var(--surface-secondary); overflow: hidden; }
.mtrack .mfill { position: absolute; top: 0; left: 0; bottom: 0; border-radius: var(--r-sm); background: var(--sky); }
.mtrack .mfill.under { background: var(--brand); }
.mtrack .target { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg-1); }
.mnums { text-align: right; font-size: 12.5px; color: var(--fg-3); }
.mnums .big { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mnums .big.ok { color: var(--info); } .mnums .big.under { color: var(--brand); }
.mnums .vs { font-size: 11.5px; }

/* ---- SOC 2 evidence (subordinated) ------------------------------------ */
.soc2 { border: 1px solid var(--border-default); border-radius: var(--r-lg); overflow: hidden; }
.soc2 .head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface-secondary); border-bottom: 1px solid var(--border-default); }
.soc2 .head .t { font-size: 13.5px; font-weight: 600; color: var(--fg-1); }
.soc2 .head .grow { flex: 1; }
.soc2 .head .ev { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); background: #fff; border: 1px solid var(--border-default); border-radius: 999px; padding: 3px 9px; }
.soc2 .line { font-size: 13px; color: var(--fg-2); padding: 12px 16px; line-height: 1.55; border-bottom: 1px solid var(--border-subtle); }
.soc2 .line b { color: var(--fg-1); }
.soc2 .line .late { color: var(--danger); font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.chip.ontime { background: var(--info-soft); color: var(--info); }
.chip.late { background: var(--danger-soft); color: var(--danger); }
.chip.pending { background: var(--surface-secondary); color: var(--fg-3); border: 1px solid var(--border-default); }
.chip.gate { background: var(--surface-secondary); color: var(--fg-3); border: 1px dashed var(--border-default); }

/* ---- drill modal ------------------------------------------------------ */
.backdrop { position: fixed; inset: 0; background: rgba(11,18,32,0.45); display: none; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.backdrop.show { display: flex; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; }
.modal .mhead { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border-default); }
.modal .mhead h3 { font-size: 15.5px; }
.modal .mhead .sub { font-size: 12px; color: var(--fg-3); margin-top: 1px; }
.modal .mhead .x { font-size: 20px; color: var(--fg-3); cursor: pointer; background: none; border: none; line-height: 1; }
.modal .mbody { padding: 6px 18px 16px; }
.drow { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.drow:last-child { border-bottom: none; }
.drow .dl { color: var(--fg-2); } .drow .dl .dm { color: var(--fg-3); font-size: 11.5px; }
.drow .dd { color: var(--fg-3); font-size: 12px; }
.drow .dv { font-weight: 600; color: var(--fg-1); font-variant-numeric: tabular-nums; text-align: right; }
.drow .fl { font-size: 11px; color: var(--warning); }
.dnote { font-size: 11.5px; color: var(--fg-3); padding: 10px 0 0; line-height: 1.5; }

/* ---- period dropdown -------------------------------------------------- */
.period-wrap { position: relative; }
.period-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 232px; background: #fff; border: 1px solid var(--border-default);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 5px; display: none; z-index: 50; }
.period-menu.show { display: block; }
.pm-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font-family: inherit; font-size: 13px; color: var(--fg-1);
  background: none; border: none; border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; }
.pm-item.on { background: var(--brand-subtle); color: var(--brand); font-weight: 500; }
.pm-item .ck { margin-left: auto; }
.pm-note { font-size: 11.5px; color: var(--fg-3); padding: 8px 10px 4px; line-height: 1.45; }

/* ==== command-center layout (v2) ====================================== */
.mockbar { position: static; }  /* let the app chrome own the sticky top on this page */

.rep-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.rep-title { font-size: 24px; font-weight: 600; color: var(--fg-1); letter-spacing: -.01em; }
.rep-sub { font-size: 14px; color: var(--fg-3); margin: 5px 0 0; max-width: 68ch; line-height: 1.5; }
.rep-head-r { display: flex; gap: 8px; flex-shrink: 0; }

/* guided START HERE band */
.rep-guide { display: flex; align-items: center; gap: 16px; padding: 15px 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border-default); box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.rep-guide .gi { width: 40px; height: 40px; border-radius: 11px; background: rgba(230,83,40,0.12); color: var(--brand-warm); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rep-guide .gt { flex: 1; min-width: 0; }
.rep-guide .lab { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.rep-guide .hl { font-size: 16.5px; font-weight: 600; color: var(--fg-1); margin-top: 2px; line-height: 1.3; }
.rep-guide .hl .under { color: var(--brand); }
.rep-guide .gs { font-size: 13px; color: var(--fg-3); margin-top: 3px; line-height: 1.5; }
.rep-guide .ga { display: flex; gap: 8px; flex-shrink: 0; }

/* compact stat bar (semantic, drillable, sub-context) */
.rep-stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--border-default); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-sm); margin-bottom: 26px; overflow: hidden; }
.rep-stats .st { padding: 14px 16px; border-left: 1px solid var(--border-subtle); cursor: pointer; }
.rep-stats .st:first-child { border-left: none; }
.rep-stats .st:hover { background: #fafbfd; }
.rep-stats .st .n { font-size: 22px; font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rep-stats .st .n.under { color: var(--brand); }
.rep-stats .st .n.warn { color: var(--brand-warm); }
.rep-stats .st .l { font-size: 12.5px; color: var(--fg-2); font-weight: 500; margin-top: 2px; }
.rep-stats .st .s { font-size: 11.5px; color: var(--fg-3); margin-top: 1px; }
.rep-stats .st .drill { font-size: 11px; color: var(--info); margin-top: 8px; opacity: 0; transition: opacity .12s ease; }
.rep-stats .st:hover .drill { opacity: 1; }

/* section blocks */
.rep-block { margin-bottom: 26px; }
.rep-bh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.rep-bh h3 { font-size: 16px; font-weight: 600; color: var(--fg-1); }
.rep-bh .sub { font-size: 12.5px; color: var(--fg-3); }
.rep-bh .grow { flex: 1; }
.rep-bh .hint { font-size: 11.5px; color: var(--fg-3); }
.rep-count { font-size: 12px; font-weight: 700; background: var(--surface-secondary); border: 1px solid var(--border-default); border-radius: 999px; padding: 2px 10px; color: var(--fg-2); }

/* needs attention cards */
.rep-attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.attn { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-default); border-radius: var(--r-md); background: var(--card); cursor: pointer; transition: box-shadow .12s ease, transform .12s ease; }
.attn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.attn .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.attn.high .dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-subtle); }
.attn.med .dot { background: var(--brand-warm); box-shadow: 0 0 0 3px rgba(230,83,40,0.15); }
.attn .ab { flex: 1; min-width: 0; }
.attn .atag { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.attn .att { font-size: 14px; font-weight: 600; color: var(--fg-1); margin-top: 2px; line-height: 1.3; }
.attn .ad { font-size: 12.5px; color: var(--fg-3); margin-top: 3px; line-height: 1.45; }
.attn .drillchev { color: var(--fg-3); align-self: center; }

/* signature chart: labor vs estimate by phase */
.rep-chart { display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.cbar { display: grid; grid-template-columns: 128px 1fr 148px; gap: 14px; align-items: center; cursor: pointer; padding: 3px 5px; border-radius: var(--r-sm); }
.cbar:hover { background: #fafbfd; }
.cbar .cl { font-size: 13px; font-weight: 500; color: var(--fg-1); }
.ctrack { position: relative; height: 22px; border-radius: var(--r-sm); background: var(--surface-secondary); overflow: hidden; }
.ctrack .cfill { position: absolute; top: 0; left: 0; bottom: 0; border-radius: var(--r-sm); background: var(--sky); transition: width .3s cubic-bezier(.22,1,.36,1); }
.ctrack .cfill.over { background: var(--brand-warm); }
.ctrack .cest { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg-1); }
.cbar .cv { text-align: right; font-size: 13px; }
.cbar .cv b { font-variant-numeric: tabular-nums; color: var(--fg-1); }
.cbar .cv b.over { color: #C2410C; }  /* darker orange: AA-readable as small bold text */
.cbar .cv .est { display: block; font-size: 11px; color: var(--fg-3); margin-top: 1px; }
.lens { display: inline-flex; gap: 2px; background: var(--surface-secondary); border-radius: 999px; padding: 2px; }
.lens button { font-family: inherit; font-size: 12px; color: var(--fg-3); background: none; border: none; border-radius: 999px; padding: 4px 13px; cursor: pointer; }
.lens button.on { background: #fff; color: var(--fg-1); font-weight: 500; box-shadow: var(--shadow-sm); }

.rep-explain { font-size: 12.5px; color: var(--fg-3); margin-top: 12px; padding: 10px 14px; background: var(--surface-secondary); border-radius: var(--r-md); line-height: 1.5; }
.rep-explain b { color: var(--fg-2); }
.dph { margin: 9px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--fg-3); }

@media (max-width: 1080px) { .rep-stats { grid-template-columns: repeat(2, 1fr); } .cbar { grid-template-columns: 110px 1fr 120px; } }
