/* Live-app additions on top of the mockup's cc.css */
.nav a .p2{margin-left:auto;font-size:10px;font-weight:600;color:#9A9EB5;background:#F1F2F8;border-radius:8px;padding:1px 6px}
.cc-empty{color:#9A9EB5;font-size:12.5px;padding:8px 0}
.cc-pend{font-size:15px;color:var(--am)}
.cc-pmbar{display:flex;gap:8px;align-items:center;background:#FFF7ED;border-bottom:1px solid #FED7AA;color:#9A3412;font-size:12px;padding:8px 32px}
.cc-logout{margin-left:auto}
.cc-toast{position:fixed;right:24px;bottom:24px;z-index:99;background:var(--nv);color:#fff;padding:12px 16px;border-radius:12px;font-size:13px;box-shadow:0 10px 30px rgba(20,24,61,.25);max-width:420px}
.cc-toast.bad{background:#B91C1C}
.cc-modal{position:fixed;inset:0;z-index:90;background:rgba(15,23,41,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.cc-mbox{background:#fff;border-radius:16px;padding:22px;width:100%;max-width:440px;box-shadow:0 20px 60px rgba(20,24,61,.3)}
.cc-mbox h3{margin:0 0 8px;font-size:17px;color:var(--nv)}
.cc-mbox label{display:block;font-size:12.5px;font-weight:600;color:var(--nv);margin:12px 0 0}
.cc-mbox input,.cc-mbox textarea,.cc-login input{display:block;width:100%;margin-top:6px;border:1px solid var(--bd);border-radius:10px;padding:10px 12px;font:inherit;font-size:14px;color:var(--nv);background:#fff;box-sizing:border-box}
.cc-mbox input:focus,.cc-mbox textarea:focus,.cc-login input:focus{outline:2px solid var(--tint);border-color:var(--in)}
.cc-mact{display:flex;gap:8px;justify-content:flex-end;margin-top:16px}.cc-mact .btn{flex:0 0 auto}
.btn.gh{background:#fff;color:var(--nv);border:1px solid var(--bd)}
.btn.no{background:#fff;color:#B91C1C;border:1px solid #FECACA}
.cc-pre{white-space:pre-wrap;word-break:break-word;font-size:12px;margin:6px 0 0;max-height:240px;overflow:auto}
.cc-md{font-size:13.5px;line-height:1.6;color:var(--gr);overflow-wrap:anywhere}
.cc-md h3,.cc-md h4,.cc-md h5,.cc-md h6{color:var(--nv);margin:16px 0 6px}
.cc-md p{margin:6px 0}.cc-md ul,.cc-md ol{padding-left:20px;margin:6px 0}.cc-md li{margin:3px 0}
.cc-md code{background:#F1F2F8;border-radius:5px;padding:0 4px;font-size:12px}
.cc-md table.md{margin:10px 0;font-size:12.5px;display:block;overflow-x:auto}
.cc-md a{color:var(--in)}
.cc-rowlink{text-decoration:none;color:inherit}.cc-rowlink.on{background:var(--tint);border-radius:10px}
.cc-dgrp{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#9A9EB5;margin:12px 0 4px}
.cc-ul{margin:0;padding-left:16px;font-size:12.5px}
.cc-p2{display:flex;gap:16px;align-items:flex-start;padding:10px 4px}.cc-p2 h2{margin:0 0 6px;color:var(--nv)}.cc-p2 .i{width:28px;height:28px;color:var(--in)}
/* login */
body.cc-loginpage{background:var(--bg);display:flex;min-height:100vh;align-items:center;justify-content:center;margin:0}
.cc-login{background:#fff;border:1px solid var(--bd);border-radius:18px;padding:30px;width:100%;max-width:380px;box-shadow:0 10px 40px rgba(20,24,61,.08)}
.cc-login img{height:30px;margin-bottom:18px}
.cc-login h1{font-size:20px;margin:0 0 4px;color:var(--nv)}.cc-login p{margin:0 0 14px;font-size:13px;color:var(--gr)}
.cc-login label{display:block;font-size:12.5px;font-weight:600;color:var(--nv);margin-top:12px}
.cc-login .btn{width:100%;margin-top:18px;height:44px;border:0;cursor:pointer}
.cc-login .err{color:#B91C1C;font-size:12.5px;min-height:18px;margin-top:10px}
.cc-login small{display:block;margin-top:14px;color:#9A9EB5;font-size:11.5px}

.cc-stage{display:grid;grid-template-columns:120px 1fr minmax(150px,auto);gap:10px;align-items:center;padding:7px 0;font-size:13px;border-bottom:1px solid #EEF0F6}
.cc-stage:last-of-type{border-bottom:0}.cc-stage .n{font-weight:600;color:var(--nv)}
.cc-stage .bar{height:8px;border-radius:5px;background:#EEF0F6;overflow:hidden}.cc-stage .bar i{display:block;height:100%;background:var(--bl,#4F46E5);border-radius:5px}
.cc-stage .v{text-align:right}.cc-stage .v small{display:block;color:var(--gr);font-size:11.5px}
.cc-src{margin:10px 0 0;font-size:12px;color:var(--gr)}
.cc-mini{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}.cc-mini div{background:#F6F7FB;border-radius:10px;padding:10px;text-align:center}
.cc-mini b{display:block;font-size:20px;color:var(--nv)}.cc-mini small{font-size:11.5px;color:var(--gr)}
.tbl td small.muted{display:block}
@media(max-width:700px){.cc-stage{grid-template-columns:90px 1fr}.cc-stage .v{grid-column:1/-1;text-align:left}.cc-mini{grid-template-columns:repeat(2,1fr)}}

/* ---------- mobile shell (responsive adaptation; desktop rules unchanged) ---------- */
.nav-bd, .cc-navbtn, .cc-navclose, .cc-side-viewas { display: none; }
.cc-side-top { display: contents; }
html { -webkit-text-size-adjust: 100%; }
.tbl-sc { max-width: 100%; }
@media (max-width: 820px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  body.nav-open, body.sheet-open { overflow: hidden; }
  .cc-navbtn, .cc-navclose { display: inline-flex; }
  .nav-bd { display: none; position: fixed; inset: 0; z-index: 70; background: rgba(20, 24, 61, .4); }
  body.nav-open .nav-bd { display: block; }
  .side {
    display: flex;
    transform: translateX(-110%);
    transition: transform .2s ease;
    width: min(320px, 88vw);
    max-width: 100%;
    z-index: 80;
    padding-top: max(16px, env(safe-area-inset-top));
    box-shadow: none;
  }
  body.nav-open .side { transform: translateX(0); box-shadow: 16px 0 40px rgba(20, 24, 61, .18); }
  .cc-side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
  .cc-side-top .logo { margin: 0; height: 26px; }
  .nav a { min-height: 44px; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .cc-side-viewas { display: flex; margin: 12px 0 0; width: 100%; }
  .cc-side-viewas a { flex: 1; min-height: 44px; justify-content: center; }
  .side .me { gap: 10px; }
  .side .cc-logout, .ib { width: 44px; height: 44px; }
  .mtop { padding-top: env(safe-area-inset-top); min-height: 60px; height: auto; }
  .tabbar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; font: inherit; font-size: 10.5px; font-weight: 600; color: var(--gr); background: none; border: 0; cursor: pointer; position: relative; padding: 0; }
  .tabbar a.on, .tabbar button.on { color: var(--in); }
  .tabbar button .i, .tabbar a .i { width: 22px; height: 22px; }
  .tabbar em { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--or); color: #fff; font-style: normal; font-size: 10px; border-radius: 8px; padding: 0 5px; font-weight: 700; }

  .g4, .agents, .board, .pipe, .ck, .calg, .reps, .stagebar, .tdl, .camp { grid-template-columns: 1fr !important; }
  .kpi b { white-space: normal; overflow-wrap: anywhere; font-size: 18px; }
  .ph p, .cc-src, .why, .job p, .job small, .hold .t, .feed .t, .cc-md, .node .nh .t, .agf { overflow-wrap: anywhere; }
  .hold, .cc-rowlink, .agf .lnk { min-height: 44px; }
  .hold.cc-rowlink, a.hold { padding-top: 10px; padding-bottom: 10px; }
  .tabs { width: 100%; }
  .tabs a, .tabs button { min-height: 44px; min-width: 44px; height: auto; padding: 8px 12px; }
  .viewas a { min-height: 44px; height: auto; }
  .cc-pmbar { padding: 10px 14px; overflow-wrap: anywhere; }
  .cc-toast { left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); max-width: none; }
  .cc-modal { padding: 0; align-items: flex-end; }
  .cc-mbox { max-width: 100%; border-radius: 16px 16px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .cc-mbox input, .cc-mbox textarea { min-height: 44px; font-size: 16px; } /* 16px avoids iOS zoom */
  .cc-mact { gap: 10px; }
  .cc-mact .btn { flex: 1; min-height: 44px; }
  .cc-loginpage { padding: 24px 16px; align-items: flex-start; }
  .cc-login { max-width: 100%; padding: 24px 18px; }
  .cc-login input { min-height: 44px; font-size: 16px; }
  .cc-login .btn { min-height: 44px; height: 44px; }
  .apcard .h { flex-wrap: wrap; }
  .apcard .cost { text-align: left; }
  .apcard .cost b { white-space: normal; }
  .apbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .apbar .btn { flex: 1 1 calc(50% - 8px); }
  .legend { gap: 8px; }
  .node.abdul, .node.ceo, .node.head { width: 100%; max-width: 100%; }
  .drawer {
    inset: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .drawer .dh { padding: 14px 14px 14px; min-height: 64px; padding-top: max(14px, env(safe-area-inset-top)); }
  .drawer .df .btn { min-height: 44px; }
  .d4 { grid-template-columns: 1fr 1fr; }
  .orgbar { align-items: stretch; }
  .orgbar .legend { width: 100%; }


  .lnk { white-space: normal; overflow-wrap: anywhere; }
  .agf { flex-wrap: wrap; min-width: 0; }
  .agf .lnk { max-width: 100%; }
  .chip { max-width: 100%; white-space: normal; height: auto; min-height: 24px; line-height: 1.3; padding: 4px 9px; }
  .apcard .cost { flex: 1 1 100%; }

  /* tables: stacked cards; .tbl-sc is a safety scroll container */
  .tbl-sc { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .card.flush .tbl-sc { overflow: visible; }
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody { display: block; width: 100%; }
  table.tbl tr { display: block; border: 1px solid var(--bd); border-radius: 12px; margin: 0 0 10px; padding: 6px 12px; background: #fff; }
  table.tbl td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--ln); padding: 10px 0; text-align: right; width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
  table.tbl td:last-child { border-bottom: 0; }
  table.tbl td::before { content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #8A8FA8; text-align: left; flex: 0 0 42%; max-width: 42%; }
  .card.flush .tbl th:first-child, .card.flush .tbl td:first-child,
  .card.flush .tbl th:last-child, .card.flush .tbl td:last-child { padding-left: 0; padding-right: 0; }
  table.tbl tr.bad td:first-child { box-shadow: none; }
  table.tbl tr.bad { box-shadow: inset 3px 0 0 var(--rd); }
  .cc-stage { grid-template-columns: 1fr; gap: 4px 10px; }
  .cc-stage .v { grid-column: 1 / -1; text-align: left; }
  .cc-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis[style] { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 430px) {
  .kpis { gap: 8px; }
  .kpi { padding: 12px 12px; }
  h1 { font-size: 20px; }
}
