/* ============================================================
   Tripate ICRM — navy + gold admin theme
   ============================================================ */
:root{
  --navy:#0a1628; --navy2:#112240; --ink:#0a1628; --body:#1b2733;
  --gold:#f0b429; --gold2:#ffd96a;
  --bg:#f4f5f7; --panel:#ffffff; --line:#e4e9f0; --muted:#64748b; --muted2:#94a3b8;
  --red:#dc2626; --redbg:#fef2f2; --amber:#d97706; --amberbg:#fffbeb;
  --green:#16a34a; --greenbg:#f0fdf4; --blue:#2563eb; --chip:#eef2f7;
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
body{font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:var(--bg);color:var(--body);font-size:14px;line-height:1.5}
a{color:inherit;text-decoration:none}

/* ---------- app shell ---------- */
.app{display:grid;grid-template-columns:224px 1fr;min-height:100vh}
.side{background:linear-gradient(180deg,var(--navy) 0%,var(--navy2) 100%);
  color:#fff;display:flex;flex-direction:column;border-right:1px solid #08111f;position:sticky;top:0;height:100vh}
.side-brand{padding:18px 20px 16px;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:10px}
.side-brand img{height:30px;width:auto;border-radius:6px}
.side-brand .mark{font-size:18px;font-weight:800;letter-spacing:-.3px}
.side-brand .mark .accent{color:var(--gold)}
.side-brand .tag{font-size:9px;font-weight:700;color:rgba(255,255,255,.5);letter-spacing:1.5px;text-transform:uppercase}
.side-nav{flex:1;padding:14px 12px;overflow-y:auto}
.side-nav .grp{font-size:10px;text-transform:uppercase;letter-spacing:.9px;color:rgba(255,255,255,.35);margin:14px 12px 6px}
.side-nav a{display:flex;align-items:center;gap:11px;padding:9px 13px;margin-bottom:2px;
  color:rgba(255,255,255,.72);font-size:13px;font-weight:500;border-radius:8px;transition:.12s}
.side-nav a:hover{color:#fff;background:rgba(255,255,255,.06)}
.side-nav a.active{color:#fff;background:rgba(240,180,41,.14);border-left:3px solid var(--gold);padding-left:10px}
.side-nav a .ic{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;opacity:.8}
.side-nav a:hover .ic{opacity:1}
.side-nav a.active .ic{opacity:1;color:var(--gold)}
.side-nav a .badge{margin-left:auto;background:var(--red);color:#fff;font-size:10px;font-weight:700;padding:1px 7px;border-radius:10px}
.newbtn{display:flex;align-items:center;gap:10px;justify-content:center;background:var(--gold);color:var(--navy)!important;font-weight:700;padding:10px 13px;border-radius:8px;margin-bottom:10px}
.newbtn:hover{background:var(--gold2)}
.newbtn .ic{color:var(--navy);opacity:1}
.side-foot{padding:13px 16px;border-top:1px solid rgba(255,255,255,.08);font-size:12px}
.side-foot .name{font-weight:600;color:#fff}
.side-foot .role{font-size:10px;font-weight:700;color:var(--navy);background:var(--gold);padding:2px 8px;border-radius:10px;text-transform:uppercase;margin-top:5px;display:inline-block}
.side-foot form{margin:10px 0 0}
.logout-btn{width:100%;font:inherit;font-size:11px;font-weight:600;color:rgba(255,255,255,.7);
  background:transparent;border:1px solid rgba(255,255,255,.16);padding:6px 10px;border-radius:6px;cursor:pointer}
.logout-btn:hover{background:rgba(255,255,255,.08);color:#fff}

/* ---------- main ---------- */
main{padding:24px 30px;max-width:1320px;width:100%}

/* Customer Chats. A conversation should meet the edges of the space it is
   given, so this one page drops the usual padding and width cap and the
   framed inbox fills the column. */
/* A PDF proof cannot be a thumbnail, so it gets a shape of its own rather than
   a broken image. */
.proof-pdf{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  width:56px;height:56px;border-radius:6px;border:1px solid var(--line);background:#fef2f2;
  color:#b91c1c;font-size:10px;font-weight:800;letter-spacing:.5px}
/* Their reference is what the customer typed; ours is what Approve records. */
.ref-cust{color:#64748b}
.ref-cust b{color:var(--body);font-variant-numeric:tabular-nums}

/* Needs attention: each item is a filter, so it must look pressable. Colour

   only carries emphasis - the words say what is wrong, because colour alone
   is not a message. */
.att{display:flex;flex-wrap:wrap;gap:8px}
.att-i{display:flex;align-items:baseline;gap:8px;padding:9px 13px;border:1px solid var(--line);
  border-radius:8px;background:#fff;text-decoration:none;transition:border-color .12s ease}
.att-i:hover{border-color:var(--navy)}
.att-i.on{border-color:var(--navy);box-shadow:0 0 0 2px rgba(10,22,40,.10)}
.att-n{font-size:18px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.att-l{font-size:12.5px;color:var(--body)}
.att-clear{color:var(--muted)}

/* The column is exactly the viewport and nothing inside it measures the
   viewport again. The frame used to be a flat 100vh, which is only the right
   height when it is the only thing in the column - a flash message above it
   pushed the bottom of the chat, message box included, off the screen and put
   a scrollbar on a page that should never scroll. */
main:has(.chat-frame),
.chat-page main{padding:0;max-width:none;height:100vh;min-height:0;
  display:flex;flex-direction:column;overflow:hidden}

.chat-frame{flex:1 1 auto;width:100%;min-height:0}
.chat-frame iframe{display:block;width:100%;height:100%;border:0}

.page-h{display:flex;align-items:flex-end;justify-content:space-between;margin:0 0 20px;gap:16px;flex-wrap:wrap}
.page-h h1{margin:0 0 3px;font-size:21px;font-weight:800;color:var(--navy);letter-spacing:-.3px}
.page-h p{margin:0;font-size:13px;color:var(--muted)}

/* ---------- cards / panels ---------- */
.panel{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px 18px;margin-bottom:18px;
  box-shadow:0 1px 3px rgba(0,0,0,.03),0 4px 14px rgba(0,0,0,.03)}
.panel h2,.panel h3{margin:0 0 13px;font-size:14px;font-weight:700;color:var(--navy);display:flex;align-items:center;gap:9px}
.panel .count{background:var(--chip);color:var(--muted);font-size:11px;font-weight:600;padding:1px 8px;border-radius:10px}
.row2{display:grid;grid-template-columns:1.5fr 1fr;gap:18px}
.row2>*{margin-bottom:0}
.detail{display:grid;grid-template-columns:1.6fr 1fr;gap:18px}
@media(max-width:980px){.row2,.detail{grid-template-columns:1fr}}

/* ---------- KPIs ---------- */
.kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:20px}
@media(max-width:1100px){.kpis{grid-template-columns:repeat(2,1fr)}}
.kpi{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:15px 16px}
.kpi .lab{color:var(--muted);font-size:12px;margin-bottom:6px}
.kpi .val{font-size:24px;font-weight:800;color:var(--navy);letter-spacing:-.5px}
.kpi .delta{font-size:12px;margin-top:4px;color:var(--muted)}
.kpi.alert .lab{color:var(--red);font-weight:700}.kpi.alert .val{color:var(--red)}
.up{color:var(--green)}.down{color:var(--red)}

/* ---------- tables ---------- */
table.t{width:100%;border-collapse:collapse;font-size:13px}
table.t th{position:sticky;top:0;z-index:2;text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.5px;
  color:var(--muted);padding:11px 12px;border-bottom:1px solid var(--line);background:#f8fafc}
table.t td{padding:12px;border-bottom:1px solid var(--line);vertical-align:middle}
table.t tbody tr:last-child td{border-bottom:0}
table.t tbody tr.clk{cursor:pointer;transition:background .1s}
table.t tbody tr.clk:hover{background:#fbfaf2}
table.t tbody tr.clk:hover td:first-child{box-shadow:inset 3px 0 0 var(--gold)}
.cust{font-weight:600;color:var(--navy)}
.ucell{display:flex;align-items:center;gap:11px;min-width:0}
.ucell>div{min-width:0}
.ucell .cust{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.avt{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  color:#fff;font-weight:700;font-size:12px;flex-shrink:0;box-shadow:0 1px 2px rgba(0,0,0,.12)}
@media(max-width:760px){ .panel{overflow-x:auto} table.t{min-width:560px} }
.small{color:var(--muted);font-size:12px}
.empty{padding:22px;text-align:center;color:var(--muted2);font-size:13px}

/* ---------- chips / pills ---------- */
.chip{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11.5px;font-weight:600;white-space:nowrap}
.c-new{background:#eef2ff;color:#4338ca}
.c-await{background:var(--amberbg);color:var(--amber)}
.c-pay{background:#ecfeff;color:#0e7490}
.c-proc{background:#f0f9ff;color:#0369a1}
.c-del{background:var(--greenbg);color:var(--green)}
.c-lost{background:#f1f5f9;color:#64748b}
.pill{display:inline-block;padding:2px 8px;border-radius:6px;font-size:11px;font-weight:700;white-space:nowrap}
.od{background:var(--redbg);color:var(--red)}
.due{background:var(--amberbg);color:var(--amber)}
.ok{background:var(--greenbg);color:var(--green)}
.flag{font-size:11px;font-weight:700;color:var(--red)}

/* ---------- buttons ---------- */
.btn{font:inherit;font-size:13px;font-weight:600;padding:8px 15px;border-radius:8px;cursor:pointer;
  border:1.5px solid transparent;display:inline-flex;align-items:center;gap:7px;transition:.12s;white-space:nowrap}
.btn-primary{background:linear-gradient(90deg,var(--navy),var(--navy2));color:#fff}
.btn-primary:hover{box-shadow:0 4px 12px rgba(10,22,40,.28)}
.btn-gold{background:var(--gold);color:var(--navy)}.btn-gold:hover{background:var(--gold2)}
.btn-secondary{background:#fff;color:var(--navy);border-color:var(--line)}.btn-secondary:hover{background:#f8fafc}
.btn-danger{background:#fff;color:#991b1b;border-color:#fecaca}.btn-danger:hover{background:var(--redbg)}
.btn-wa{background:#25d366;color:#fff}.btn-wa:hover{background:#1fb957}
.btn-sm{padding:5px 11px;font-size:12px}
.btn[disabled]{opacity:.5;cursor:not-allowed}

/* ---------- forms ---------- */
label{display:block;font-size:12px;font-weight:600;color:var(--navy);margin:0 0 5px}
.input,select.input,textarea.input{width:100%;font:inherit;font-size:13px;padding:9px 11px;border:1.5px solid var(--line);
  border-radius:8px;background:#fff;color:var(--body);outline:none;transition:.12s}
.input:focus{border-color:var(--gold);box-shadow:0 0 0 3px rgba(240,180,41,.15)}
textarea.input{resize:vertical;min-height:64px}
.field{margin-bottom:13px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:13px}
@media(max-width:700px){.grid2,.grid3{grid-template-columns:1fr}}

/* ---------- bars ---------- */
.bar{height:8px;background:#eef2f6;border-radius:6px;overflow:hidden;margin:6px 0}
.bar>i{display:block;height:100%;background:var(--gold)}

/* ---------- kanban ---------- */
.kanban{display:flex;gap:13px;overflow-x:auto;padding-bottom:10px}
.col{background:#eef2f6;border-radius:12px;padding:10px;min-width:215px;flex:1}
.col h4{margin:2px 4px 10px;font-size:12.5px;font-weight:700;color:var(--navy);display:flex;justify-content:space-between}
.col h4 .n{color:var(--muted);font-weight:600}
.kcard{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px;margin-bottom:9px;display:block}
.kcard:hover{box-shadow:0 2px 8px rgba(0,0,0,.08)}
.kcard .t{font-weight:600;color:var(--navy);margin-bottom:3px;font-size:13px}
.kcard .m{font-size:12px;color:var(--muted)}
.kcard .foot{display:flex;justify-content:space-between;align-items:center;margin-top:8px}

/* ---------- timeline ---------- */
.timeline{list-style:none;margin:0;padding:0}
.timeline li{padding:0 0 15px 22px;position:relative;border-left:2px solid var(--line);margin-left:6px}
.timeline li:last-child{border-left-color:transparent}
.timeline li::before{content:"";position:absolute;left:-7px;top:2px;width:12px;height:12px;border-radius:50%;background:#cbd5e1}
.timeline li.done::before{background:var(--green)}
.timeline li.cur::before{background:var(--blue);box-shadow:0 0 0 4px #dbeafe}
.timeline .ti{font-weight:600;color:var(--navy);font-size:13px}
.timeline .td{font-size:12px;color:var(--muted)}

/* ---------- key-value ---------- */
.kv{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px dashed var(--line)}
.kv:last-child{border-bottom:0}.kv .k{color:var(--muted)}
.money{font-weight:800;font-size:17px;color:var(--navy)}

/* ---------- notes ---------- */
.note{background:#f8fafc;border:1px solid var(--line);border-radius:8px;padding:9px 11px;margin-bottom:8px;font-size:13px}
.note .h{font-size:11px;color:var(--muted);margin-bottom:3px;display:flex;gap:8px;align-items:center}

/* ---------- banners / flash ---------- */
.banner{border-radius:10px;padding:10px 14px;margin-bottom:16px;font-weight:600;display:flex;align-items:center;gap:9px;font-size:13px}
.banner.warn{background:var(--redbg);border:1px solid #fca5a5;color:#991b1b}
.banner.info{background:#eff6ff;border:1px solid #bfdbfe;color:#1e40af}
.flash{position:fixed;top:16px;right:16px;z-index:50;display:flex;flex-direction:column;gap:8px;max-width:360px}
.toast{padding:11px 15px;border-radius:9px;font-size:13px;font-weight:600;box-shadow:0 6px 20px rgba(0,0,0,.15);animation:slidein .2s ease}
.toast.ok{background:#052e16;color:#bbf7d0}.toast.error{background:#450a0a;color:#fecaca}
@keyframes slidein{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:none}}
.hint{font-size:12px;color:var(--muted);font-style:italic;margin-top:6px}
.right{text-align:right}.mt{margin-top:12px}.mb0{margin-bottom:0}
.flexbtns{display:flex;gap:8px;flex-wrap:wrap}

/* ---------- role badges + users screen ---------- */
.rb{display:inline-flex;align-items:center;gap:6px;padding:4px 11px;border-radius:20px;font-size:11.5px;font-weight:700;white-space:nowrap;line-height:1.4}
.rb::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.rb-owner{background:#fdf2d6;color:#9a6a05}
.rb-admin{background:#e6ecf7;color:#1e3a8a}
.rb-accounts{background:var(--greenbg);color:var(--green)}
.rb-visa{background:#eef2ff;color:#4338ca}
.rb-tour{background:#f6f0fe;color:#7c3aed}
.rb-customer_exec{background:#ecfeff;color:#0e7490}
.sdot{display:inline-flex;align-items:center;gap:8px;font-weight:600;font-size:12.5px}
.sdot::before{content:"";width:8px;height:8px;border-radius:50%;flex-shrink:0}
.sdot.on{color:var(--green)}.sdot.on::before{background:var(--green);box-shadow:0 0 0 3px var(--greenbg)}
.sdot.off{color:var(--muted2)}.sdot.off::before{background:#cbd5e1;box-shadow:0 0 0 3px #eef2f6}
.rolepick{display:inline-block}
.rolepick summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:7px;border-radius:20px;transition:.12s}
.rolepick summary::-webkit-details-marker{display:none}
.rolepick summary .pen{color:var(--muted2);opacity:0;transition:.12s;display:inline-flex}
.rolepick:hover summary .pen{opacity:1}
.rolepick[open] summary{margin-bottom:9px}
.rolepick[open] summary .pen{opacity:1;color:var(--gold)}
.rolepick form{display:flex;gap:7px;align-items:center}
.rolepick select.input{min-width:168px;padding:7px 10px}
.invite{border:1px solid var(--line);border-left:3px solid var(--gold);background:linear-gradient(90deg,#fffdf5,#fff 60%)}
.invite h3 .ic{color:var(--gold)}
.muted-cell{color:var(--muted2);font-size:12px}

/* ---------- login ---------- */
.login-wrap{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,var(--navy),var(--navy2))}
.login-card{background:#fff;border-radius:16px;padding:34px 32px;width:360px;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.login-card .brand{text-align:center;margin-bottom:22px}
.login-card .brand .mark{font-size:24px;font-weight:800;color:var(--navy)}
.login-card .brand .mark .accent{color:var(--gold)}
.login-card .brand .tag{font-size:10px;font-weight:700;letter-spacing:2px;color:var(--muted2);text-transform:uppercase}
.login-card .err{background:var(--redbg);border:1px solid #fca5a5;color:#991b1b;padding:9px 12px;border-radius:8px;font-size:13px;margin-bottom:14px}
.login-card .sub{text-align:center;color:var(--muted);font-size:12px;margin-top:16px}

/* ============================================================
   SIDEBAR NAVIGATION - grouped, searchable, collapsible
   ------------------------------------------------------------
   The CRM grew to roughly thirty destinations in one flat scroll.
   Three changes, no URL touched:
     - five named groups that remember whether you closed them
     - a filter box, because scanning thirty labels is slower than
       typing three letters
     - an icon-only mode for narrow desktops
   Everything degrades: with no javascript every group is open and
   the filter box simply does nothing.
   ============================================================ */

/* ---- search / filter ---- */
.side-search{padding:12px 12px 6px;position:relative}
.side-search input{width:100%;font:inherit;font-size:12.5px;color:#fff;padding:8px 10px 8px 31px;
  background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.12);border-radius:8px}
.side-search input::placeholder{color:rgba(255,255,255,.42)}
.side-search input:focus{outline:none;border-color:var(--gold);background:rgba(255,255,255,.11)}
.side-search .mag{position:absolute;left:22px;top:50%;transform:translateY(-40%);
  color:rgba(255,255,255,.42);pointer-events:none}
.side-search kbd{position:absolute;right:22px;top:50%;transform:translateY(-42%);font-size:10px;font-weight:700;
  color:rgba(255,255,255,.35);border:1px solid rgba(255,255,255,.16);border-radius:4px;padding:1px 5px;font-family:inherit}
.side-search input:focus~kbd{display:none}
.side-nomatch{display:none;padding:10px 20px;font-size:12px;color:rgba(255,255,255,.45)}
.side-nav.no-match .side-nomatch{display:block}

/* ---- group headers ---- */
.side-nav .grp-h{display:flex;align-items:center;gap:6px;width:100%;font:inherit;
  font-size:10px;text-transform:uppercase;letter-spacing:.9px;color:rgba(255,255,255,.35);
  margin:14px 0 6px;padding:4px 12px;background:none;border:0;cursor:pointer;text-align:left;border-radius:6px}
.side-nav .grp-h:hover{color:rgba(255,255,255,.62);background:rgba(255,255,255,.04)}
.side-nav .grp-h .chev{transition:transform .15s;opacity:.7;flex:none}
.side-nav .grp-h[aria-expanded="false"] .chev{transform:rotate(-90deg)}
/* A count rolled up onto a closed group, so shutting one never hides work. */
.side-nav .grp-h .rollup{margin-left:auto;background:var(--red);color:#fff;font-size:9.5px;font-weight:700;
  padding:1px 6px;border-radius:9px;display:none}
.side-nav .grp-h[aria-expanded="false"] .rollup.has{display:inline-block}
.side-grp[hidden]{display:none}

/* ---- filtering ---- */
.side-nav a[hidden]{display:none}

/* ============================================================
   ICON-ONLY MODE
   Set on <html> by an inline script so the rail never flashes wide
   before collapsing.
   ============================================================ */
.side-toggle{margin-left:auto;background:none;border:0;color:rgba(255,255,255,.45);cursor:pointer;
  padding:5px;border-radius:6px;display:flex;align-items:center}
.side-toggle:hover{color:#fff;background:rgba(255,255,255,.08)}

html.nav-mini .app{grid-template-columns:64px 1fr}
html.nav-mini .side-brand{padding:16px 0;justify-content:center}
html.nav-mini .side-brand>div,
html.nav-mini .side-search,
html.nav-mini .side-nav .grp-h,
html.nav-mini .side-nav a span:not(.ic):not(.badge),
html.nav-mini .newbtn span:not(.ic),
html.nav-mini .side-foot .name,
html.nav-mini .side-foot .role{display:none}
html.nav-mini .side-toggle{margin:0}
html.nav-mini .side-nav{padding:10px 8px}
html.nav-mini .side-nav a,
html.nav-mini .newbtn{justify-content:center;padding:10px 0;position:relative}
html.nav-mini .side-nav a.active{border-left:0;padding-left:0;box-shadow:inset 2px 0 0 var(--gold)}
/* A group boundary still has to read as a boundary. */
html.nav-mini .side-grp{border-top:1px solid rgba(255,255,255,.09);margin-top:8px;padding-top:8px}
html.nav-mini .side-grp:first-of-type{border-top:0;margin-top:0}
html.nav-mini .side-nav .badge{position:absolute;top:4px;right:9px;padding:0 5px;font-size:9px;line-height:15px;min-width:15px;text-align:center}
html.nav-mini .side-foot{padding:11px 8px;text-align:center}
html.nav-mini .logout-btn{padding:6px 4px;font-size:10px}
/* The label has to come back somehow, so it comes back on hover. */
html.nav-mini .side-nav a::after{content:attr(data-label);position:absolute;left:calc(100% + 10px);top:50%;
  transform:translateY(-50%);background:var(--navy);color:#fff;font-size:12px;font-weight:600;white-space:nowrap;
  padding:6px 10px;border-radius:7px;border:1px solid rgba(255,255,255,.14);box-shadow:0 6px 18px rgba(0,0,0,.3);
  opacity:0;pointer-events:none;transition:opacity .12s;z-index:60}
html.nav-mini .side-nav a:hover::after,
html.nav-mini .side-nav a:focus-visible::after{opacity:1}

/* Narrow desktops start collapsed unless the user has said otherwise. */
@media(max-width:1180px){
  html:not(.nav-wide) .app{grid-template-columns:64px 1fr}
  html:not(.nav-wide) .side-brand{padding:16px 0;justify-content:center}
  html:not(.nav-wide) .side-brand>div,
  html:not(.nav-wide) .side-search,
  html:not(.nav-wide) .side-nav .grp-h,
  html:not(.nav-wide) .side-nav a span:not(.ic):not(.badge),
  html:not(.nav-wide) .side-foot .name,
  html:not(.nav-wide) .side-foot .role{display:none}
  html:not(.nav-wide) .side-nav a{justify-content:center;padding:10px 0;position:relative}
}

/* Keyboard users must always be able to see where they are. */
.side-nav a:focus-visible,.side-search input:focus-visible,
.grp-h:focus-visible,.side-toggle:focus-visible,.logout-btn:focus-visible{
  outline:2px solid var(--gold);outline-offset:1px}

/* ── Runs ────────────────────────────────────────────────────────────────
   A runner reads this on a phone, one hand, standing at a counter. So the
   action for each passport sits inside that passport's own card and never
   below a scroll: hunting for the right button next to somebody else's
   passport is how the wrong file gets marked handed over. */
.r-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px }
.r-card {
  flex: 1 1 140px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
}
.r-card.is-live { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240,180,41,.14) }
.r-card .r-n { display: block; font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1 }
.r-card .r-l { display: block; font-size: 12px; color: var(--muted); margin-top: 2px }

.r-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px }
.r-item.is-done { opacity: .62; background: var(--wash, #fafbfc) }
.r-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px }
.r-item-head .small { display: block; color: var(--muted) }
.r-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px }
.r-act input, .r-act select {
  flex: 1 1 150px; min-width: 0; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 7px; font-size: 14px;
}
.r-act .chk { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted) }
.r-act .chk input { flex: 0 0 auto }
.r-skip { margin-top: 8px }
.r-skip > summary { cursor: pointer; font-size: 12px; color: var(--muted) }
.r-skip form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap }
.r-skip input { flex: 1 1 200px; padding: 8px; border: 1px solid var(--line); border-radius: 7px }

.r-form { display: grid; gap: 10px; max-width: 460px }
.r-form label { font-size: 12px; color: var(--muted) }
.r-form input, .r-form select {
  display: block; width: 100%; margin-top: 3px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 7px; font-size: 14px; color: var(--ink);
}
.r-add, .r-people { list-style: none; padding: 0; margin: 6px 0 0 }
.r-add li, .r-people li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.r-add .small, .r-people .small { display: block; color: var(--muted) }
.r-skill { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line) }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0 }

/* Thumbs, not cursors: on a phone every control here is one-handed. */
@media (max-width: 640px) {
  .r-act, .r-skip form { flex-direction: column; align-items: stretch }
  .r-act .btn, .r-skip .btn { width: 100% }
  .r-item-head { flex-direction: column }
}

/* When a customer is actually about. Sits inside their own card, because a
   suggestion detached from the person it is about invites ringing the wrong
   one. */
.c-when { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px }
.c-when strong { color: var(--navy) }
.c-when .small { color: var(--muted); display: block; margin-top: 2px }
.c-when input[type=datetime-local] {
  padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px;
}

/* No extension is the ordinary case here, not an error state, so it reads as
   an instruction rather than a warning. */
.c-dial { font-size: 13px; color: var(--ink) }
.c-dial .small { display: block; color: var(--muted); margin-top: 2px }

/* The form is folded away until somebody has actually spoken to them: an open
   questionnaire on every card is a wall to scroll past to reach the phone. */
.c-form { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px }
.c-form > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--navy) }
.c-form .r-form { margin-top: 10px; max-width: 520px }

/* ── Quality feedback ─────────────────────────────────────────────────────
   Built for somebody making twenty calls an hour. Every control is big
   enough to hit without aiming, and the whole form is one page so a
   half-typed answer is never lost to a navigation. */
.fb-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px }
.fb-tab {
  padding: 8px 14px; border-radius: 8px 8px 0 0; text-decoration: none;
  color: var(--muted); border: 1px solid var(--line); border-bottom: none; background: #fafbfc;
}
.fb-tab.is-on { background: #fff; color: var(--navy); font-weight: 700; border-bottom: 2px solid var(--gold) }
.fb-n { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--muted) }
.fb-tab.is-on .fb-n { color: var(--navy) }

.fb-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px }
.fb-filters label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 3px }
.fb-filters input, .fb-filters select {
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
}
.fb-score {
  display: inline-block; min-width: 30px; text-align: center; padding: 4px 6px;
  border-radius: 6px; font-weight: 800; color: #fff;
}
.fb-score.good { background: #15803d } .fb-score.ok { background: #b45309 }
.fb-score.bad  { background: #b91c1c }

.fb-head { display: flex; justify-content: space-between; align-items: flex-start;
           gap: 14px; flex-wrap: wrap; margin-bottom: 12px }
.fb-head-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.fb-about { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 14px; background: #f6f8fa;
            border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; font-size: 13px }
.fb-about span span.small { display: block; color: var(--muted); font-size: 11px }

.fb-sec { background: #fff; border: 1px solid var(--line); border-radius: 12px;
          padding: 14px 16px; margin-bottom: 12px }
.fb-sec h3 { margin: 0 0 10px }
.fb-sec h3 .small { color: var(--muted); font-weight: 400 }

.q { padding: 8px 0; border-top: 1px solid var(--line) }
.fb-sec .q:first-of-type { border-top: none }
.q-l label { font-weight: 600; font-size: 14px; color: var(--ink) }
.q-h { display: block; font-size: 12px; color: var(--muted); margin-top: 1px }
.q input[type=text], .q input:not([type]), .q input[type=datetime-local], .q select {
  width: 100%; max-width: 520px; margin-top: 6px; padding: 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}

/* 1-10 as radios: arrow keys work with no javascript at all. */
.scale, .yn, .pick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px }
.scale input, .yn input, .pick input { position: absolute; opacity: 0; width: 0; height: 0 }
.scale label {
  min-width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
  font-weight: 800; font-size: 16px; color: var(--navy); background: #fff;
}
.yn label, .pick label {
  padding: 10px 16px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--navy); background: #fff;
}
.scale input:checked + label, .yn input:checked + label, .pick input:checked + label {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
/* The focus ring is the whole point on a keyboard-driven form. */
.scale input:focus-visible + label, .yn input:focus-visible + label,
.pick input:focus-visible + label { box-shadow: 0 0 0 3px rgba(240,180,41,.55) }

/* Sticky, because the save button should never be somewhere you have to go
   and find after a long call. */
.fb-save {
  position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--navy);
  padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border-radius: 0 0 12px 12px; z-index: 5;
}
.fb-save .small { color: var(--muted) }

@media (max-width: 640px) {
  .scale label { min-width: 40px; height: 44px }
  .fb-filters label { flex: 1 1 45% }
}
