/* Revenue Rollforward — Earned / GAAP Basis dashboard styles.
   Adapted from new-gl-setup/dashboard_template.html; Figtree from existing shell. */

*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Figtree',Arial,sans-serif;font-size:12px;color:#111;padding:6px}
.topbar{display:flex;align-items:flex-start;justify-content:space-between;padding:0 0 5px;border-bottom:1px solid #ddd;margin-bottom:5px;flex-wrap:wrap;gap:8px}
.title{font-size:14px;font-weight:500;color:#1f3864}
.subtitle{font-size:11px;color:#888;margin-top:2px}
.btn{font-size:10px;padding:5px 11px;border:0.5px solid #1f3864;border-radius:4px;cursor:pointer;background:#fff;color:#1f3864;font-weight:600}
.btn:hover{background:#1f3864;color:#fff}
/* Top-level view switcher (MRR / Invoice) — a segmented control, deliberately
   distinct from the product tabs below it so the two levels don't read alike. */
.view-tabs{display:inline-flex;gap:2px;padding:2px;background:#eef1f6;border:0.5px solid #d6dde8;border-radius:6px;margin:0 0 6px}
.view-tab{padding:4px 18px;font-size:11px;font-weight:600;cursor:pointer;color:#5a6a80;border-radius:4px;white-space:nowrap;letter-spacing:.02em}
.view-tab:hover{color:#1f3864;background:#e2e8f2}
.view-tab.active{background:#1f3864;color:#fff}
.prod-tabs{display:flex;gap:0;border-bottom:2px solid #1f3864;margin-bottom:4px;flex-wrap:wrap}
.prod-tab{padding:5px 16px;font-size:11px;font-weight:500;cursor:pointer;color:#555;border:0.5px solid #ddd;border-bottom:none;border-radius:4px 4px 0 0;background:#f7f7f6;white-space:nowrap}
.prod-tab.active,.prod-tab:hover{background:#1f3864;color:#fff;border-color:#1f3864}
.controls{display:flex;align-items:center;gap:8px;margin:6px 0;flex-wrap:wrap}
.ctrl-label{font-size:11px;color:#666}
select{font-size:11px;padding:4px 8px;border:0.5px solid #bbb;border-radius:4px}
.presets{display:flex;gap:4px;flex-wrap:wrap}
.pre{font-size:10px;padding:3px 9px;border:0.5px solid #ccc;border-radius:3px;cursor:pointer;background:#f7f7f6;color:#666}
.pre:hover,.pre.act{background:#1f3864;color:#fff;border-color:#1f3864}
.tbl-wrap{overflow:auto;border:0.5px solid #ddd;border-radius:8px;height:calc(100vh - 236px);width:fit-content;max-width:100%;scroll-padding-top:52px}
table{border-collapse:collapse;font-size:11px;width:auto}
thead tr.hdr-dates th{background:#1f3864;color:#fff;padding:4px 8px;text-align:right;font-weight:500;font-size:10px;white-space:nowrap;position:sticky;top:0;z-index:4;min-width:88px}
thead tr.hdr-dates th:first-child{text-align:left;min-width:210px;width:210px;left:0;z-index:5}
td{padding:2px 8px;border-bottom:0.5px solid #eee;white-space:nowrap;text-align:right;min-width:88px}
.tbl-wrap td:first-child{text-align:left;position:sticky;left:0;background:#fff;z-index:1;font-size:10.5px;width:210px;min-width:210px}
tr.sec td{background:#2f5597;color:#fff;font-weight:600;font-size:10px;letter-spacing:.03em;padding:3px 8px}
.tbl-wrap tr.sec td:first-child{background:#2f5597;color:#fff;position:sticky;left:0;z-index:2}
tr.bold td{font-weight:700}tr.bold td:first-child{font-weight:700}
tr.sub td{border-top:0.5px solid #c9d3e0;font-weight:600}tr.sub td:first-child{font-weight:600}
tr.eom td{background:#e8f0fa;font-weight:700;border-top:1.5px solid #1f3864}tr.eom td:first-child{background:#e8f0fa;font-weight:700}
tr.pct td{color:#666;font-style:italic}tr.pct td:first-child{color:#666;font-style:italic}
tr.memo td{color:#999;font-style:italic}tr.memo td:first-child{color:#999;font-style:italic}
.mv{cursor:pointer;border-bottom:1px dotted #9bb3cf}
.mv:hover{background:#eaf2fc}
td.gv{color:#1e7b34}td.rv{color:#c00000}
.recon{font-size:11px;color:#555;background:#eef4fb;border:0.5px solid #cfe0f2;border-radius:6px;padding:7px 11px;margin:6px 0}
.recon b{color:#1f3864}
.drill-panel{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:96vw;max-width:1400px;height:90vh;max-height:90vh;background:#fff;border-radius:10px;box-shadow:0 8px 40px rgba(0,0,0,.28);z-index:100;flex-direction:column}
.drill-panel.open{display:flex}
.dp-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:99}
.dp-backdrop.open{display:block}
.dp-head{display:flex;align-items:center;gap:10px;padding:11px 16px;border-bottom:1px solid #eee;background:#f8fafc;border-radius:10px 10px 0 0}
#dp-title{font-weight:600;font-size:12.5px;flex:1;color:#1f3864}
#dp-count{font-size:10px;color:#888}.dp-exp{color:#1f3864;cursor:pointer;font-weight:600}.dp-exp:hover{text-decoration:underline}#dp-close{cursor:pointer;font-size:16px;color:#888}
.dp-body{overflow:auto;flex:1}
.dtbl{width:100%;border-collapse:collapse;font-size:11px}
.dtbl th{background:#f0f4f8;padding:6px 12px;text-align:left;font-weight:600;font-size:11px;border-bottom:1px solid #ddd;position:sticky;top:0;cursor:pointer}
.dtbl th.r{text-align:right}
.dtbl td{padding:5px 12px;border-bottom:0.5px solid #eee;text-align:left;font-variant-numeric:tabular-nums}
.dtbl td:first-child{position:static;left:auto;width:auto;min-width:0;z-index:auto;background:transparent}
.dtbl td.r{text-align:right}
.dtbl tfoot td{position:sticky;bottom:0;background:#e8f0fa;border-top:1.5px solid #1f3864;font-weight:700;color:#1f3864}
.dtbl tfoot td.rv{color:#c00000}.dtbl tfoot td.gv{color:#1e7b34}
/* Customer / subscription ids, linked into the Chargebee admin console where the
   record has one. A TAM id has no such page and renders as the same plain text
   it always did. */
.idc{font-family:monospace;font-size:10px;color:#666}
a.cb-link{color:#2f5597;text-decoration:underline dotted;text-underline-offset:2px}
a.cb-link:hover{color:#1f3864;text-decoration:underline}
/* Customer 360 drill-down (stacks above the movement drill panel) */
.cust-link{cursor:pointer;color:#1f3864;text-decoration:underline dotted;text-underline-offset:2px}
.cust-link:hover{color:#12264a;text-decoration:underline}
#cust{z-index:102}
#custbd{z-index:101}
.cust-back{font-size:11px;color:#1f3864;cursor:pointer;font-weight:600}
.cust-back:hover{text-decoration:underline}
#cust-title{font-weight:600;font-size:12.5px;flex:1;color:#1f3864}
#cust-sub{font-size:10px;color:#888}
#cust-close{cursor:pointer;font-size:16px;color:#888}
.cust-stats{display:flex;gap:22px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid #eee}
.cust-stat{display:flex;flex-direction:column;gap:2px}
.cust-stat .k{font-size:9.5px;color:#888;text-transform:uppercase;letter-spacing:.04em}
.cust-stat .v{font-size:15px;font-weight:700;color:#1f3864}
.cust-section{padding:12px 16px}
.cust-section h4{font-size:11px;color:#2f5597;text-transform:uppercase;letter-spacing:.03em;margin-bottom:8px}
.cust-spark{margin:2px 0 12px}
.cust-empty{padding:18px 16px;color:#888;font-size:12px}
.mv-tag{display:inline-block;padding:1px 7px;border-radius:3px;font-size:10px;font-weight:600}
.mv-NEW{background:#e6f4ea;color:#1e7b34}
.mv-EXPANSION{background:#e6f4ea;color:#1e7b34}
.mv-CONTRACTION{background:#fdeaea;color:#c00000}
.mv-CHURN{background:#fdeaea;color:#c00000}
