/*
 * Bart's BD Atlas prototype design system for "View 2", scoped under .view2 so
 * the bare body/table/a rules can't clobber the app's global Tailwind chrome.
 * Linked (fingerprinted by Propshaft) only on the View 2 pages — see
 * app/views/tools/healthcare_market_explorer/_view2_styles.html.erb.
 */
.view2{
  --navy:#0F2A4A;--navy-light:#1B3A5C;--gold:#D4A843;--teal:#0D9488;--accent:#b42318;
  --slate:#64748B;--bg:#F8FAFC;--white:#fff;--border:#E2E8F0;--text:#1E293B;--muted:#64748B;--cream:#FBF9F4;
  font-family:'DM Sans',-apple-system,sans-serif;color:var(--text);background:var(--bg);line-height:1.5;
}
.view2 *{box-sizing:border-box;}
.view2 a{color:var(--teal);text-decoration:none;}

/* hero + kpi strip */
.view2 .hero{background:linear-gradient(135deg,var(--navy),var(--navy-light));color:#fff;padding:44px 48px 30px;}
.view2 .hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;}
.view2 .hero-tag{font-family:'Space Mono',monospace;font-size:12px;letter-spacing:.18em;text-transform:uppercase;color:var(--gold);}
.view2 .hero h1{font-family:'DM Sans',sans-serif;font-size:36px;margin:8px 0 6px;font-weight:700;letter-spacing:-0.02em;}
.view2 .hero p{max-width:760px;color:#cfdae6;font-size:15px;margin:0;}
.view2 .view-toggle{font-family:'Space Mono',monospace;font-size:12px;letter-spacing:.04em;text-transform:uppercase;
  padding:7px 13px;border-radius:20px;border:1px solid rgba(255,255,255,.35);color:#fff;white-space:nowrap;background:rgba(255,255,255,.08);}
.view2 .view-toggle:hover{background:rgba(255,255,255,.18);}
.view2 .kpi-strip{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--border);
  margin:-22px 48px 0;border-radius:10px;overflow:hidden;box-shadow:0 6px 24px rgba(15,42,74,.12);}
.view2 .kpi{background:var(--white);padding:16px 14px;}
.view2 .kpi .v{font-family:'Space Mono',monospace;font-size:22px;font-weight:700;color:var(--navy);}
.view2 .kpi .l{font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-top:2px;}

/* sections + controls */
.view2 .container{padding:26px 48px 60px;}
.view2 .section-title{font-family:'DM Sans',sans-serif;font-size:24px;font-weight:700;letter-spacing:-0.01em;color:var(--navy);margin:30px 0 4px;}
.view2 .section-desc{color:var(--muted);font-size:13px;margin:0 0 14px;max-width:820px;}
.view2 .controls{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:10px 0 14px;}
.view2 .controls input,.view2 .controls select{font-family:'DM Sans';font-size:13px;padding:7px 10px;border:1px solid var(--border);border-radius:7px;background:#fff;color:var(--text);}
.view2 .controls input[type=search]{min-width:240px;}
.view2 .chip{font-size:13px;padding:6px 11px;border:1px solid var(--border);border-radius:20px;background:#fff;cursor:pointer;color:var(--slate);user-select:none;}
.view2 .chip.on,.view2 .chip.active{background:var(--navy);color:#fff;border-color:var(--navy);}
/* filter chips are labels wrapping a hidden checkbox; checked = same look as .chip.on */
.view2 label.chip input{position:absolute;opacity:0;pointer-events:none;}
.view2 label.chip:has(input:checked){background:var(--navy);color:#fff;border-color:var(--navy);}
.view2 .btn{font-family:'DM Sans';font-size:13.5px;font-weight:600;padding:7px 14px;border-radius:7px;border:1px solid var(--navy);background:var(--navy);color:#fff;cursor:pointer;}
.view2 .btn.ghost{background:#fff;color:var(--navy);}
/* Soft action buttons — subtle blue tint (the summary-sec palette). */
.view2 .btn.soft{background:#eef4fb;color:var(--navy);border-color:#d6e2f0;}
.view2 .btn.soft:hover{background:#dfeaf7;}
/* Gold call-to-action (the prototype's phone button). */
.view2 .btn.gold{background:var(--gold);border-color:var(--gold);color:#3a2c08;}
.view2 .btn.gold:hover{background:#c99a35;}

/* map */
.view2 .map-card{height:600px;border-radius:12px;border:1px solid var(--border);box-shadow:0 2px 12px rgba(15,42,74,.06);overflow:hidden;background:#fff;}
.view2 .map-card > div{height:100%;}
/* marker mini-profile popup (content is DOM-built in the pin-map controller) */
.view2-popup .leaflet-popup-content{margin:12px 14px;font-family:'DM Sans',-apple-system,sans-serif;min-width:230px;line-height:1.4;}
.view2-popup .pop-name{font-size:15px;font-weight:700;color:#0F2A4A;line-height:1.2;}
.view2-popup .pop-row{font-size:11.5px;color:#64748B;margin-top:2px;}
.view2-popup .pop-row b{color:#0F2A4A;}
.view2-popup .pop-pill{font-family:'Space Mono',monospace;font-weight:700;font-size:11px;padding:2px 7px;border-radius:5px;color:#fff;display:inline-block;margin-top:7px;}
.view2-popup .pop-act{font-size:11px;font-weight:600;padding:4px 9px;margin-top:8px;border-radius:5px;border:1px solid #E2E8F0;color:#0F2A4A;background:#fff;cursor:pointer;font-family:'DM Sans',sans-serif;display:block;}
.view2-popup .pop-act:hover{background:#eef4fb;}
.view2 .legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12.5px;color:var(--slate);margin:10px 2px 0;}
.view2 .legend i{width:11px;height:11px;border-radius:50%;display:inline-block;margin-right:5px;vertical-align:-1px;}

/* table */
/* No overflow:hidden here — it would make the table the scroll container for the
   sticky header below, pinning it 64px into the table instead of the viewport.
   Rounded corners come from the corner cells instead, which requires
   border-collapse:separate (radius is ignored on cells under collapse). */
.view2 table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px;background:#fff;border:1px solid var(--border);border-radius:10px;}
/* sticky below the app's 64px sticky navbar (nav is z-50, so stay under it) */
.view2 thead th{background:var(--navy);color:#fff;text-align:left;padding:9px 10px;font-size:11px;text-transform:uppercase;letter-spacing:.04em;cursor:pointer;white-space:nowrap;position:sticky;top:64px;z-index:10;}
.view2 thead th:first-child{border-top-left-radius:9px;}
.view2 thead th:last-child{border-top-right-radius:9px;}
.view2 thead th a{color:#fff;display:inline-flex;align-items:center;gap:4px;}
.view2 thead th .ar{opacity:.7;font-size:10px;}
.view2 tbody td{padding:8px 10px;border-bottom:1px solid var(--border);vertical-align:middle;}
/* the table's own border draws the bottom edge; a td border there would double it */
.view2 tbody tr:last-child td{border-bottom:none;}
.view2 tbody tr:last-child td:first-child{border-bottom-left-radius:9px;}
.view2 tbody tr:last-child td:last-child{border-bottom-right-radius:9px;}
.view2 tbody tr{cursor:pointer;}
.view2 tbody tr:nth-child(even){background:var(--cream);}
.view2 tbody tr:hover{background:#eef4fb;}
.view2 tbody tr.empty{cursor:default;}
.view2 .num{font-family:'Space Mono',monospace;text-align:right;}
.view2 .neg{color:var(--accent);}
.view2 .tytag{font-family:'Space Mono';font-size:11px;font-weight:700;padding:2px 6px;border-radius:4px;color:#fff;}
.view2 .bd-pill{font-family:'Space Mono';font-weight:700;font-size:13px;padding:2px 8px;border-radius:5px;color:#fff;display:inline-block;min-width:30px;text-align:center;}
.view2 .row-arrow{color:#cbd5e1;font-weight:700;}
.view2 tbody tr:hover .row-arrow{color:var(--teal);}
.view2 .pager{display:flex;gap:8px;align-items:center;justify-content:center;margin:16px 0;font-size:14px;color:var(--slate);}
.view2 .pager a,.view2 .pager span.btnish{padding:5px 12px;border:1px solid var(--border);border-radius:6px;background:#fff;cursor:pointer;color:var(--navy);}
.view2 .pager span.disabled{opacity:.4;}

/* profile modal */
.view2 .modal-bk{position:fixed;inset:0;background:rgba(15,42,74,.55);z-index:9999;display:none;align-items:flex-start;justify-content:center;padding:38px 16px;overflow:auto;}
.view2 .modal-bk.open{display:flex;}
.view2 .modal{background:#fff;max-width:800px;width:100%;border-radius:14px;box-shadow:0 24px 70px rgba(15,42,74,.4);overflow:hidden;animation:view2-popin .15s ease;}
@keyframes view2-popin{from{transform:translateY(10px);opacity:.5}to{transform:none;opacity:1}}
.view2 .modal-hd{background:linear-gradient(135deg,var(--navy),var(--navy-light));color:#fff;padding:18px 22px;position:relative;}
.view2 .modal-hd h2{font-family:'DM Sans',sans-serif;font-size:22px;margin:0 42px 4px 0;font-weight:700;letter-spacing:-0.01em;line-height:1.18;}
.view2 .modal-hd .sub{font-size:13.5px;color:#cfdae6;}
.view2 .modal-x{position:absolute;top:14px;right:15px;width:30px;height:30px;border:none;background:rgba(255,255,255,.16);color:#fff;border-radius:50%;font-size:22px;cursor:pointer;line-height:1;}
.view2 .modal-x:hover{background:rgba(255,255,255,.32);}
.view2 .mmeta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px;}
.view2 .mtag{font-family:'Space Mono',monospace;font-size:12px;font-weight:700;padding:3px 9px;border-radius:5px;color:#fff;}
.view2 .mkv{font-size:12.5px;color:#fff;background:rgba(255,255,255,.16);padding:3px 9px;border-radius:5px;}
.view2 .modal-bd{padding:16px 22px 20px;max-height:calc(90vh - 96px);overflow:auto;}
.view2 .mcols{display:grid;grid-template-columns:1fr 1fr;gap:6px 22px;align-items:start;}
.view2 .modal-side{position:fixed;top:50%;transform:translateY(-50%);width:46px;height:46px;border-radius:50%;border:none;background:rgba(255,255,255,.92);color:var(--navy);font-size:28px;line-height:1;cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,.28);z-index:10000;align-items:center;justify-content:center;display:flex;padding:0 0 3px;}
.view2 .modal-prev{left:24px;}.view2 .modal-next{right:24px;}
.view2 .modal-side:hover{background:#fff;}
.view2 .modal-side:disabled{opacity:.3;cursor:default;}

/* profile sections (financials / quality / affiliation / billers) */
.view2 .summary-sec{background:#eef4fb;border:1px solid #d6e2f0;border-radius:8px;padding:10px 12px;margin-bottom:12px;font-size:13.5px;line-height:1.55;color:var(--navy);}
.view2 .summary-sec .lbl{font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:3px;font-weight:700;}
.view2 .hc-sec{margin-top:6px;padding-top:6px;border-top:1px solid #e8e4db;}
.view2 .hc-title{font-size:12px;font-weight:700;color:var(--navy);letter-spacing:.02em;text-transform:uppercase;margin-bottom:3px;}
.view2 .hc-grid{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;font-size:13px;}
.view2 .hc-grid .k{color:#5a6b7a;}.view2 .hc-grid .v{color:var(--navy);font-weight:600;text-align:left;}
.view2 .fin-neg{color:var(--accent);}
.view2 .stars{color:var(--gold);letter-spacing:1px;}
.view2 .spec-chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:3px;}
.view2 .spec-chip{font-size:12px;background:#eef4fb;border:1px solid #d6e2f0;color:var(--navy);border-radius:10px;padding:1px 7px;}
.view2 .spec-chip b{font-family:'Space Mono';}
.view2 .np-badge{font-size:10px;font-weight:700;background:var(--teal);color:#fff;border-radius:9px;padding:1px 6px;letter-spacing:.03em;}
.view2 .pen-badge{font-size:10px;font-weight:700;background:var(--accent);color:#fff;border-radius:9px;padding:1px 6px;letter-spacing:.03em;}
.view2 .due-badge{font-size:10px;font-weight:700;background:var(--gold);color:#3a2c08;border-radius:9px;padding:1px 6px;letter-spacing:.03em;}
.view2 .due-badge.overdue{background:var(--accent);color:#fff;}
.view2 .bl-list{display:flex;flex-direction:column;gap:3px;}
.view2 .bl-row{display:flex;justify-content:space-between;gap:8px;font-size:12.5px;align-items:baseline;}
.view2 .bl-nm{color:var(--navy);}
.view2 .bl-ty{color:var(--muted);font-size:10.5px;}
.view2 .bl-pay{font-family:'Space Mono',monospace;color:var(--navy);font-weight:700;white-space:nowrap;}
.view2 .bar{height:6px;flex:1;border-radius:4px;background:#e6ecf2;overflow:hidden;}
.view2 .bar > i{display:block;height:100%;background:var(--teal);border-radius:4px;}
.view2 .factor{display:flex;align-items:center;gap:8px;font-size:12.5px;margin:3px 0;}
.view2 .factor .fl{width:120px;color:#5a6b7a;}
.view2 .factor .fv{width:30px;text-align:right;font-family:'Space Mono';color:var(--navy);}

.view2 .none{font-size:13px;color:#9aa;font-style:italic;}

@media(max-width:900px){
  .view2 .hero,.view2 .container{padding-left:18px;padding-right:18px;}
  .view2 .kpi-strip{grid-template-columns:repeat(3,1fr);margin-left:18px;margin-right:18px;}
}
@media(max-width:640px){.view2 .mcols{grid-template-columns:1fr;}}
@media(max-width:760px){.view2 .modal-side{top:auto;bottom:18px;width:42px;height:42px;}.view2 .modal-prev{left:18px;}.view2 .modal-next{right:18px;}}
