/* ==========================================================================
   Clear Brew — WAMRAD wireframe chrome
   Screen-only. Three portal themes driven by body[data-theme].
   ========================================================================== */

:root{
  --cb-teal:#03B39D;  --cb-teal-d:#018C7C;  --cb-teal-l:#2FD3BE;
  --cb-mag:#A54C9D;   --cb-mag-d:#7E3578;
  --cb-green:#00A65A; --cb-green-d:#007F43;
  --cb-grey:#A5A7A9;  --cb-ink:#2B3137;
  --cb-body:#ECF0F5;  --cb-line:#E2E7ED;
  --sb-w:232px;
  --radius:10px;
  --shadow:0 1px 2px rgba(16,24,40,.05), 0 6px 18px -8px rgba(16,24,40,.18);
}

body[data-theme="admin"],body[data-theme="site"]{
  --brand:var(--cb-teal); --brand-d:var(--cb-teal-d); --brand-l:var(--cb-teal-l);
  --sb-top:#101A22; --sb-bot:#070D13;
  --bar:linear-gradient(100deg,var(--cb-teal-d) 0%,var(--cb-teal) 48%,#5E8FA8 78%,var(--cb-mag) 100%);
}
body[data-theme="tech"]{
  --brand:var(--cb-green); --brand-d:var(--cb-green-d); --brand-l:#2FCB80;
  --sb-top:#2A363C; --sb-bot:#1A2227;
  --bar:linear-gradient(100deg,var(--cb-green-d) 0%,var(--cb-green) 48%,#4E9B8A 76%,var(--cb-mag) 100%);
}

*{ -webkit-font-smoothing:antialiased }
body{
  margin:0; background:var(--cb-body); color:var(--cb-ink);
  font-family:"Source Sans 3","Segoe UI",system-ui,-apple-system,Helvetica,Arial,sans-serif;
  font-size:14px;
}
a{ color:var(--brand-d); text-decoration:none }
a:hover{ color:var(--brand); text-decoration:underline }

/* ---------- Sidebar ---------------------------------------------------- */
.wf-sidebar{
  position:fixed; inset:0 auto 0 0; width:var(--sb-w); z-index:1040;
  background:linear-gradient(180deg,var(--sb-top),var(--sb-bot));
  display:flex; flex-direction:column; overflow:hidden;
}
.wf-sidebar::after{ content:""; position:absolute; inset:0 0 0 auto; width:1px;
  background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,0)) }
.wf-brand{
  height:56px; display:flex; align-items:center; justify-content:center; flex:0 0 56px;
  background:#070D13; position:relative;
}
.wf-brand::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:2px; background:var(--bar) }
.wf-brand img{ height:34px; width:auto; display:block }
.wf-user{
  display:flex; gap:11px; align-items:center; padding:16px 16px 15px;
  border-bottom:1px solid rgba(255,255,255,.07);
}
.wf-user .av{
  width:38px;height:38px;border-radius:50%;flex:0 0 38px;
  background:linear-gradient(135deg,var(--brand),var(--cb-mag));
  display:grid;place-items:center;color:#fff;font-size:15px;
  box-shadow:0 0 0 2px rgba(255,255,255,.14);
}
.wf-user .nm{ color:#fff; font-weight:600; font-size:13.5px; line-height:1.25 }
.wf-user .st{ color:#8C9AA5; font-size:11.5px; display:flex; align-items:center; gap:5px }
.wf-user .st i{ color:#39D98A; font-size:7px }

.wf-consult{ padding:13px 14px; border-bottom:1px solid rgba(255,255,255,.07) }
.wf-consult select,.wf-consult input{
  width:100%; margin-bottom:7px; border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.05); color:#CFD8DE; border-radius:6px;
  padding:6px 9px; font-size:12.5px;
}
.wf-consult .go{
  width:100%; border:0; border-radius:6px; color:#fff; font-size:12.5px; padding:6px;
  background:linear-gradient(100deg,var(--cb-mag-d),var(--cb-mag));
}

.wf-nav{ list-style:none; margin:0; padding:9px 0 26px; overflow-y:auto; flex:1 1 auto }
.wf-nav::-webkit-scrollbar{ width:6px } .wf-nav::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.12);border-radius:3px }
.wf-nav a{
  display:flex; align-items:center; gap:11px; padding:10px 16px;
  color:#AFBCC6; font-size:13.5px; border-left:3px solid transparent; position:relative;
}
.wf-nav a:hover{ background:rgba(255,255,255,.055); color:#fff; text-decoration:none }
.wf-nav a i.ic{ width:17px; text-align:center; font-size:14px; opacity:.85 }
.wf-nav a .so{ margin-left:auto; font-size:9.5px; color:#5E6E79; letter-spacing:.2px; font-style:italic }
.wf-nav li.on>a{
  color:#fff; border-left-color:var(--brand);
  background:linear-gradient(90deg,rgba(3,179,157,.17),rgba(165,76,157,.05) 70%,transparent);
}
body[data-theme="tech"] .wf-nav li.on>a{
  background:linear-gradient(90deg,rgba(0,166,90,.2),rgba(165,76,157,.05) 70%,transparent);
}
.wf-nav .cvr{ margin-left:auto; font-size:10px; opacity:.6; transition:transform .18s }
.wf-nav li.open .cvr{ transform:rotate(90deg) }
.wf-sub{ list-style:none; margin:0; padding:0; max-height:0; overflow:hidden; transition:max-height .22s ease;
  background:rgba(0,0,0,.28) }
.wf-nav li.open .wf-sub{ max-height:820px }
.wf-sub a{ padding:8px 16px 8px 44px; font-size:12.8px; color:#95A4AF }

/* ---------- Topbar ----------------------------------------------------- */
.wf-top{
  position:fixed; top:0; left:var(--sb-w); right:0; height:56px; z-index:1030;
  background:var(--bar); display:flex; align-items:center; gap:4px; padding:0 16px 0 10px;
  box-shadow:0 1px 0 rgba(0,0,0,.08);
}
.wf-top .tb{ color:#fff; opacity:.92; background:none; border:0; padding:9px 11px; font-size:15px; border-radius:7px }
.wf-top .tb:hover{ background:rgba(255,255,255,.15) }
.wf-top .portal{
  margin-left:10px; color:#fff; font-size:11px; letter-spacing:.9px; text-transform:uppercase;
  background:rgba(255,255,255,.17); padding:4px 11px; border-radius:30px; font-weight:600;
}
.wf-top .sp{ margin-left:auto }
.wf-top .bell{ position:relative }
.wf-top .bell .ct{
  position:absolute; top:3px; right:4px; background:#F0A202; color:#3A2A00;
  font-size:9px; font-weight:700; border-radius:9px; padding:0 4px; line-height:14px;
}
.wf-top .who{ display:flex; align-items:center; gap:8px; color:#fff; font-size:13.5px; padding:0 4px 0 10px }
.wf-top .who .av{ width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,.22);
  display:grid;place-items:center;font-size:13px }

/* ---------- Page ------------------------------------------------------- */
.wf-main{ margin-left:var(--sb-w); padding:56px 0 0 }
.wf-wrap{ padding:18px 20px 40px; max-width:1680px }
.wf-h1{ font-size:24px; font-weight:600; letter-spacing:-.2px; margin:4px 0 16px; color:#333B42 }
.wf-h1{ display:flex; align-items:baseline; flex-wrap:wrap; gap:0 4px }
.wf-h1 .act{ margin-left:auto; align-self:center }
.wf-h1 .sub{ font-size:13px; color:#7B858E; font-weight:400; margin-left:10px }

/* Sprint banner */
.wf-banner{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px;
  background:linear-gradient(100deg,#FFF8DC,#FFFDF2);
  border:1px solid #F0DFA0; border-left:4px solid #E8B931;
  border-radius:var(--radius); padding:10px 14px; margin:0 0 16px; font-size:12.5px; color:#6B5618;
}
.wf-banner .tag{
  background:#E8B931; color:#4A3A05; font-weight:700; font-size:10.5px; letter-spacing:.6px;
  text-transform:uppercase; padding:3px 9px; border-radius:20px;
}
.wf-banner .bnav{ margin-left:auto; display:flex; gap:7px }
.wf-banner .bnav a{
  font-size:12px; border:1px solid #DFC97A; background:#fff; color:#6B5618;
  padding:4px 11px; border-radius:20px;
}
.wf-banner .bnav a:hover{ background:#E8B931; color:#fff; text-decoration:none }

/* Cards / panels */
.wf-card{ background:#fff; border:1px solid var(--cb-line); border-radius:var(--radius);
  box-shadow:var(--shadow); margin-bottom:18px; overflow:hidden }
.wf-card>.top{ height:3px; background:var(--bar) }
.wf-card.c-mag>.top{ background:linear-gradient(90deg,var(--cb-mag-d),var(--cb-mag),#D58FCB) }
.wf-card.c-amber>.top{ background:linear-gradient(90deg,#D98B00,#F0A202,#FFD37A) }
.wf-card.c-rose>.top{ background:linear-gradient(90deg,#C0392B,#E05C4B,#F0A79E) }
.wf-card.c-sky>.top{ background:linear-gradient(90deg,#1D7FA8,#38A3CC,#9BD8EE) }
.wf-card.c-lime>.top{ background:linear-gradient(90deg,#4C9A2A,#73B74E,#BFE3A8) }
.wf-card>.hd{
  display:flex; align-items:center; gap:10px; padding:13px 16px; border-bottom:1px solid var(--cb-line);
  font-size:15.5px; font-weight:600; color:#3A434B;
}
.wf-card>.hd .r{ margin-left:auto; display:flex; gap:7px; align-items:center }
.wf-card>.bd{ padding:16px }
.wf-card>.bd.flush{ padding:0 }
.wf-empty{ padding:18px 16px; color:#98A2AC; font-size:13px }

/* Section strip (grey bar used on the Add Visit form) */
.wf-strip{
  background:linear-gradient(100deg,#D7DEE5,#E7EDF2); color:#3E474F; font-weight:600; font-size:15px;
  padding:9px 16px; border-top:1px solid #CBD4DC; border-bottom:1px solid #CBD4DC;
}

/* Tables */
.wf-tbl{ width:100%; border-collapse:collapse; font-size:13.3px }
.wf-tbl th{
  text-align:left; font-weight:600; color:#3F4850; padding:11px 14px; white-space:nowrap;
  border-bottom:2px solid var(--cb-line); background:#FAFBFC;
}
.wf-tbl td{ padding:10px 14px; border-bottom:1px solid #EFF2F5; vertical-align:middle; white-space:nowrap }
.wf-tbl td.wrap{ white-space:normal }
.wf-tbl tbody tr:hover{ background:#F7FAFB }
.wf-tbl .mut{ color:#98A2AC }
.wf-tbl td.act{ white-space:nowrap }
.wf-tbl .yes{ color:#2EA043 } .wf-tbl .no{ color:#D4453A }
.wf-scroll{ overflow-x:auto }
.wf-scroll::-webkit-scrollbar{ height:9px }
.wf-scroll::-webkit-scrollbar-thumb{ background:#C8D1D9; border-radius:5px }
.wf-scroll::-webkit-scrollbar-track{ background:#F2F5F7 }
.ico-btn{
  display:inline-grid; place-items:center; width:28px; height:28px; border-radius:7px;
  border:1px solid var(--cb-line); background:#fff; color:#6A747D; font-size:12.5px; margin-right:4px;
}
.ico-btn:hover{ color:#fff; text-decoration:none; border-color:transparent;
  background:linear-gradient(135deg,var(--brand),var(--brand-d)) }
.ico-btn.dgr:hover{ background:linear-gradient(135deg,#E05C4B,#C0392B) }

/* Buttons */
.wf-btn{
  display:inline-flex; align-items:center; gap:7px; border:0; border-radius:8px; cursor:pointer;
  padding:8px 16px; font-size:13.5px; font-weight:500; color:#fff;
  background:linear-gradient(100deg,var(--brand-d),var(--brand)); box-shadow:0 1px 2px rgba(16,24,40,.12);
}
.wf-btn:hover{ filter:brightness(1.07); color:#fff; text-decoration:none }
.wf-btn.mag{ background:linear-gradient(100deg,var(--cb-mag-d),var(--cb-mag)) }
.wf-btn.sky{ background:linear-gradient(100deg,#1D7FA8,#38A3CC) }
.wf-btn.lime{ background:linear-gradient(100deg,#3E8A22,#5CA93C) }
.wf-btn.ghost{ background:#fff; color:#5A646D; border:1px solid var(--cb-line); box-shadow:none }
.wf-btn.ghost:hover{ background:#F4F7F9; color:#3A434B; filter:none }
.wf-btn.sm{ padding:6px 12px; font-size:12.5px }

/* Forms (all locked by wf.js) */
.wf-lbl{ font-size:13px; font-weight:600; color:#495158; margin:0 0 6px; display:block }
.wf-lbl .req{ color:#D4453A }
.wf-lbl .key{
  font-size:9.5px; font-weight:700; letter-spacing:.5px; color:var(--cb-mag);
  background:rgba(165,76,157,.1); border-radius:4px; padding:1px 5px; margin-left:6px; vertical-align:1px;
}
.wf-in,.wf-sel,.wf-ta{
  width:100%; border:1px solid #D5DCE3; border-radius:8px; padding:8px 11px; font-size:13.5px;
  background:#fff; color:#3A434B;
}
.wf-in::placeholder,.wf-ta::placeholder{ color:#A9B3BC }
.wf-sel{ appearance:none; background-image:linear-gradient(45deg,transparent 50%,#8A949D 50%),linear-gradient(135deg,#8A949D 50%,transparent 50%);
  background-position:calc(100% - 17px) 17px,calc(100% - 12px) 17px; background-size:5px 5px,5px 5px; background-repeat:no-repeat; }
.wf-fg{ margin-bottom:15px }
.wf-note{ color:#D4453A; font-size:12px; font-weight:600; margin:2px 0 6px }
.wf-sw{ width:34px; height:19px; border-radius:20px; background:#D5DCE3; position:relative; display:inline-block; vertical-align:-4px }
.wf-sw::after{ content:""; position:absolute; top:2px; left:2px; width:15px; height:15px; border-radius:50%; background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.2) }

/* Tabs */
.wf-tabs{ display:flex; gap:2px; border-bottom:1px solid var(--cb-line); padding:0 10px; background:#FAFBFC }
.wf-tabs a{
  padding:11px 18px; font-size:13.8px; color:#6A747D; border-bottom:3px solid transparent; margin-bottom:-1px;
}
.wf-tabs a:hover{ color:var(--brand-d); text-decoration:none }
.wf-tabs a.on{ color:#333B42; font-weight:600; border-bottom-color:var(--brand); background:#fff;
  border-radius:8px 8px 0 0 }
.wf-pane{ display:none } .wf-pane.on{ display:block }

/* Definition rows (site details) */
.wf-dl{ display:grid; grid-template-columns:minmax(130px,42%) 1fr; gap:0 14px; font-size:13.4px }
.wf-dl dt{ text-align:right; font-weight:600; color:#4A535B; padding:7px 0; border-bottom:1px solid #F2F5F7 }
.wf-dl dd{ margin:0; padding:7px 0; color:#333B42; border-bottom:1px solid #F2F5F7 }
.wf-dl dd.lnk{ color:var(--brand-d) }

/* Site-portal circle tiles */
.wf-tiles{ display:flex; flex-wrap:wrap; justify-content:center; gap:26px 34px; padding:26px 0 8px }
.wf-tile{ width:168px; text-align:center; color:#3A434B }
.wf-tile .ring{
  width:132px; height:132px; margin:0 auto 14px; border-radius:50%;
  background:linear-gradient(145deg,#E6E9EB,#CFD4D7); border:4px solid var(--brand);
  display:grid; place-items:center; color:var(--cb-mag); font-size:46px;
  box-shadow:0 8px 20px -10px rgba(16,24,40,.45); transition:transform .18s, box-shadow .18s;
}
.wf-tile:hover{ text-decoration:none; color:#1E252B }
.wf-tile:hover .ring{ transform:translateY(-4px); box-shadow:0 14px 26px -12px rgba(16,24,40,.55);
  background:linear-gradient(145deg,#fff,#E3E7EA) }
.wf-tile .cap{ font-size:15px; font-weight:600; line-height:1.3 }

/* Hero / login */
.wf-hero{ text-align:center; padding:4px 0 10px }
.wf-hero img{ height:92px }
.wf-hero h2{ font-size:26px; font-weight:600; margin:16px 0 4px; color:#333B42 }
.wf-social{ display:flex; gap:9px; justify-content:center; margin:14px 0 4px }
.wf-social a{ width:34px;height:34px;border-radius:7px;display:grid;place-items:center;color:#fff;font-size:15px }
.wf-social a:hover{ filter:brightness(1.1); text-decoration:none }

.wf-login{ min-height:100vh; display:grid; place-items:center; padding:34px 16px;
  background:radial-gradient(1100px 620px at 50% -12%,rgba(3,179,157,.17),transparent 62%),
             radial-gradient(900px 520px at 88% 108%,rgba(165,76,157,.15),transparent 60%),#F3F6F8 }
.wf-login .box{ width:100%; max-width:960px }
.wf-login .cards{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:22px }
.wf-login .pcard{
  background:#fff; border:1px solid var(--cb-line); border-radius:14px; padding:22px 20px; text-align:center;
  box-shadow:var(--shadow); color:#3A434B; transition:transform .18s, box-shadow .18s;
}
.wf-login .pcard:hover{ transform:translateY(-3px); text-decoration:none; color:#1E252B;
  box-shadow:0 14px 30px -14px rgba(16,24,40,.42) }
.wf-login .pcard .ic{ width:54px;height:54px;border-radius:14px;margin:0 auto 13px;display:grid;place-items:center;
  color:#fff;font-size:22px }
.wf-login .pcard h4{ font-size:16.5px; font-weight:600; margin:0 0 5px }
.wf-login .pcard p{ font-size:12.8px; color:#7B858E; margin:0 0 12px; min-height:34px }
.wf-login .pcard .go{ font-size:12.5px; font-weight:600; color:var(--cb-teal-d) }

/* Footer */
.wf-foot{ margin-left:var(--sb-w); padding:14px 20px 26px; color:#8A949D; font-size:12px;
  display:flex; flex-wrap:wrap; gap:8px 16px; border-top:1px solid var(--cb-line); background:#fff }
.wf-foot .r{ margin-left:auto }

/* Toast */
#wf-toast{ position:fixed; right:18px; bottom:18px; z-index:2000; display:flex; flex-direction:column; gap:9px }
#wf-toast .t{
  background:#232B32; color:#EAF0F4; border-radius:10px; padding:11px 15px; font-size:13px; max-width:360px;
  box-shadow:0 12px 28px -12px rgba(0,0,0,.6); border-left:3px solid var(--brand);
  animation:wfin .22s ease; display:flex; gap:10px; align-items:flex-start;
}
#wf-toast .t i{ color:var(--brand-l); margin-top:2px }
@keyframes wfin{ from{ opacity:0; transform:translateY(8px) } }

/* Stub page */
.wf-stub{ text-align:center; padding:46px 20px 54px }
.wf-stub .ic{ width:76px;height:76px;border-radius:22px;margin:0 auto 18px;display:grid;place-items:center;
  color:#fff;font-size:30px;background:linear-gradient(135deg,var(--brand),var(--cb-mag)) }
.wf-stub h3{ font-size:21px; font-weight:600; margin:0 0 8px }
.wf-stub p{ color:#7B858E; max-width:560px; margin:0 auto 8px; font-size:13.6px }

@media (max-width:1100px){
  .wf-sidebar{ transform:translateX(-100%); transition:transform .2s }
  body.sb-open .wf-sidebar{ transform:none }
  .wf-top{ left:0 } .wf-main,.wf-foot{ margin-left:0 }
  .wf-login .cards{ grid-template-columns:1fr }
}

/* ==========================================================================
   v2 — WAMRAD listing chrome, modals, stepper, mobile
   ========================================================================== */

/* ---- Page header bar with the WAMRAD left accent tick ------------------ */
.wf-pagehd{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:13px 16px 13px 14px; border-bottom:1px solid var(--cb-line);
  background:linear-gradient(90deg,#FAFBFC,#fff); position:relative;
  font-size:17px; font-weight:600; color:#333B42;
}
.wf-pagehd::before{ content:""; position:absolute; left:0; top:10px; bottom:10px; width:4px;
  border-radius:0 3px 3px 0; background:linear-gradient(180deg,var(--brand),var(--cb-mag)) }
.wf-pagehd .cnt{
  font-size:11.5px; font-weight:700; color:var(--brand-d); background:rgba(3,179,157,.12);
  border-radius:20px; padding:3px 10px; letter-spacing:.3px;
}
body[data-theme="tech"] .wf-pagehd .cnt{ color:var(--brand-d); background:rgba(0,166,90,.13) }

/* ---- Toolbar: exports left, Filters + Add right ------------------------ */
.wf-toolbar{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  padding:12px 14px; border-bottom:1px solid var(--cb-line);
}
.wf-toolbar .exp{ display:flex; flex-wrap:wrap; gap:7px }
.wf-toolbar .rgt{ margin-left:auto; display:flex; flex-wrap:wrap; gap:7px }
.wf-btn.out{
  background:#fff; color:var(--brand-d); border:1px solid var(--brand);
  box-shadow:none; font-weight:600;
}
.wf-btn.out:hover{ background:var(--brand); color:#fff; filter:none }
.wf-btn .fcount{
  background:var(--cb-mag); color:#fff; font-size:10px; font-weight:700; border-radius:20px;
  padding:1px 6px; margin-left:2px;
}

/* ---- Active-filter chips ----------------------------------------------- */
.wf-chips{ display:none; flex-wrap:wrap; gap:7px; align-items:center;
  padding:10px 14px; border-bottom:1px solid var(--cb-line); background:#FBFCFD }
.wf-chips.on{ display:flex }
.wf-chips .lb{ font-size:11.5px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:#8A949D }
.wf-chips .chip{
  display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:#3A434B;
  background:#fff; border:1px solid var(--cb-line); border-radius:20px; padding:4px 6px 4px 12px;
}
.wf-chips .chip b{ font-weight:600 }
.wf-chips .chip i{ color:#9AA4AD; font-size:11px; width:19px; height:19px; border-radius:50%;
  display:grid; place-items:center; background:#F1F4F6 }
.wf-chips .chip:hover i{ background:var(--cb-mag); color:#fff }

/* ---- Show entries / search row ----------------------------------------- */
.wf-showrow{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:12px 14px }
.wf-showrow .lhs{ display:flex; align-items:center; gap:8px; font-size:13px; color:#5A646D }
.wf-showrow .srch{ margin-left:auto; position:relative; min-width:230px }
.wf-showrow .srch i{ position:absolute; left:12px; top:50%; transform:translateY(-50%);
  color:#9AA4AD; font-size:13px }
.wf-showrow .srch input{ padding-left:34px }

/* ---- Sortable headers --------------------------------------------------- */
.wf-tbl th.srt{ cursor:pointer; padding-right:26px; position:relative }
.wf-tbl th.srt::after{
  content:"\f0dc"; font-family:"Font Awesome 6 Free"; font-weight:900; font-size:10px;
  color:#B6BFC7; position:absolute; right:11px; top:50%; transform:translateY(-50%);
}
.wf-tbl th.srt.asc::after{ content:"\f0de"; color:var(--brand-d); top:58% }
.wf-tbl th.chk,.wf-tbl td.chk{ width:40px; padding-right:0 }
.wf-tbl th.actcell{ text-align:center; font-size:12px }
.wf-tbl td.actcell{ text-align:center; width:56px; padding-left:4px; padding-right:4px }

/* ---- Status pills -------------------------------------------------------- */
.pill{
  display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600;
  border-radius:20px; padding:3px 10px; white-space:nowrap; line-height:1.5;
}
.pill i{ font-size:6px }
.pill.ok{   background:rgba(46,160,67,.13);  color:#1F7A31 }
.pill.off{  background:rgba(107,116,125,.14); color:#5A646D }
.pill.warn{ background:rgba(240,162,2,.16);  color:#8A5D00 }
.pill.bad{  background:rgba(212,69,58,.13);  color:#B0362C }
.pill.info{ background:rgba(29,127,168,.13); color:#1A6E90 }

/* ---- Pager: First / Previous / n / Next / Last -------------------------- */
.wf-pagerbar{
  display:flex; flex-wrap:wrap; gap:10px; align-items:center;
  padding:12px 14px; border-top:1px solid var(--cb-line); background:#FBFCFD;
}
.wf-pagerbar .cnt{ font-size:12.5px; color:#7B858E }
.wf-pagerbar .pp{ font-size:11.5px; color:#A1AAB3; margin-left:auto }
.wf-pagerbar .pgs{ display:flex; gap:4px; flex-wrap:wrap }
.wf-pagerbar .pgs a{
  min-width:38px; height:38px; display:inline-grid; place-items:center; padding:0 11px;
  border:1px solid var(--cb-line); background:#fff; color:#5A646D; font-size:13px; border-radius:8px;
}
.wf-pagerbar .pgs a:hover{ background:#F2F6F8; color:#333B42; text-decoration:none }
.wf-pagerbar .pgs a.on{ background:linear-gradient(100deg,var(--brand-d),var(--brand));
  border-color:transparent; color:#fff; font-weight:600 }

/* ---- Modal (Advanced Filters, add/edit) --------------------------------- */
.wf-modal{
  position:fixed; inset:0; z-index:1200; display:none; align-items:flex-start; justify-content:center;
  padding:40px 16px; overflow-y:auto; background:rgba(16,24,40,.55); backdrop-filter:blur(2px);
}
.wf-modal.on{ display:flex }
.wf-modal .dlg{
  width:100%; max-width:860px; background:#fff; border-radius:14px; overflow:hidden;
  box-shadow:0 28px 60px -20px rgba(16,24,40,.55); animation:wfpop .18s ease;
}
@keyframes wfpop{ from{ opacity:0; transform:translateY(-10px) scale(.99) } }
.wf-modal .mh{
  display:flex; align-items:center; gap:10px; padding:16px 20px; border-bottom:1px solid var(--cb-line);
  font-size:18px; font-weight:600; color:#333B42;
}
.wf-modal .mh .x{ margin-left:auto; width:34px; height:34px; border-radius:9px; border:0; background:#F2F5F7;
  color:#6A747D; font-size:14px }
.wf-modal .mh .x:hover{ background:var(--cb-mag); color:#fff }
.wf-modal .mb{ padding:20px; max-height:64vh; overflow-y:auto }
.wf-modal .mf{
  display:flex; gap:9px; justify-content:flex-end; padding:14px 20px;
  border-top:1px solid var(--cb-line); background:#FAFBFC;
}
.wf-modal .sechd{
  font-size:11.5px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:#7B858E;
  margin:4px 0 12px; padding-bottom:7px; border-bottom:1px solid var(--cb-line);
}
.wf-modal .sechd:not(:first-child){ margin-top:18px }
/* WAMRAD dark tab strip inside add/edit modals */
.wf-mtabs{ display:flex; gap:2px; background:linear-gradient(100deg,#131C23,#243038 70%,#3A2B43);
  border-radius:10px; padding:5px; margin-bottom:18px; overflow-x:auto }
.wf-mtabs a{ flex:0 0 auto; padding:9px 17px; border-radius:7px; color:#B4C0C9; font-size:13.3px;
  display:flex; align-items:center; gap:8px; white-space:nowrap }
.wf-mtabs a:hover{ color:#fff; text-decoration:none }
.wf-mtabs a.on{ background:linear-gradient(100deg,var(--brand-d),var(--brand)); color:#fff; font-weight:600 }

/* ---- Stepper (Add Visit) ------------------------------------------------ */
.wf-stepper{ display:flex; align-items:center; padding:18px 20px; border-bottom:1px solid var(--cb-line);
  background:linear-gradient(100deg,#FAFBFC,#fff) }
.wf-stepper .st{ display:flex; align-items:center; gap:11px; flex:0 0 auto }
.wf-stepper .n{
  width:34px; height:34px; border-radius:50%; display:grid; place-items:center; flex:0 0 34px;
  background:#E7ECF0; color:#8A949D; font-weight:700; font-size:13.5px; border:2px solid transparent;
}
.wf-stepper .st.on .n{ background:linear-gradient(135deg,var(--brand-d),var(--brand)); color:#fff;
  box-shadow:0 0 0 4px rgba(3,179,157,.16) }
body[data-theme="tech"] .wf-stepper .st.on .n{ box-shadow:0 0 0 4px rgba(0,166,90,.17) }
.wf-stepper .st.done .n{ background:rgba(46,160,67,.15); color:#1F7A31 }
.wf-stepper .tx b{ display:block; font-size:13.8px; color:#333B42; font-weight:600; line-height:1.2 }
.wf-stepper .tx span{ font-size:11.5px; color:#8A949D }
.wf-stepper .ln{ flex:1 1 auto; height:3px; border-radius:3px; background:#E7ECF0; margin:0 16px }
.wf-stepper .ln.done{ background:linear-gradient(90deg,var(--brand),var(--cb-mag)) }
.wf-mobstep{ display:none; padding:14px 16px; border-bottom:1px solid var(--cb-line); background:#FAFBFC }
.wf-mobstep .r{ display:flex; align-items:baseline; gap:8px; margin-bottom:8px }
.wf-mobstep .r b{ font-size:15px; color:#333B42 }
.wf-mobstep .r span{ font-size:12px; color:#8A949D; margin-left:auto }
.wf-mobstep .bar{ height:5px; border-radius:4px; background:#E7ECF0; overflow:hidden }
.wf-mobstep .bar i{ display:block; height:100%; border-radius:4px;
  background:linear-gradient(90deg,var(--brand),var(--cb-mag)); transition:width .25s }

/* step footer */
.wf-stickybar{
  display:flex; gap:9px; align-items:center; flex-wrap:wrap;
  padding:12px 16px; background:rgba(255,255,255,.96); backdrop-filter:blur(6px);
  border-top:1px solid var(--cb-line); box-shadow:0 -6px 18px -12px rgba(16,24,40,.35);
}
.wf-stickybar .sp{ margin-left:auto }

/* ---- Sidebar scrim + collapse ------------------------------------------- */
.wf-scrim{ position:fixed; inset:0; background:rgba(10,18,27,.55); z-index:1035; display:none }
body.sb-open .wf-scrim{ display:block }
.wf-sidebar .cls{ display:none; position:absolute; top:11px; right:11px; z-index:2;
  width:34px; height:34px; border-radius:9px; border:0; background:rgba(255,255,255,.14); color:#fff }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width:1100px){
  .wf-sidebar .cls{ display:grid; place-items:center }
}

@media (max-width:767.98px){
  .wf-wrap{ padding:12px 12px 24px }
  .wf-h1{ font-size:20px }
  .wf-h1 .sub{ margin-left:0; flex-basis:100% }
  .wf-top{ padding:0 8px 0 4px }
  .wf-top .portal{ font-size:9.5px; padding:3px 8px; margin-left:4px }
  .wf-top .who span:not(.av){ display:none }
  .wf-foot{ flex-direction:column; gap:4px }
  .wf-foot .r{ margin-left:0 }

  /* 16px inputs stop iOS zooming on focus; 44px minimum touch target */
  .wf-in,.wf-sel,.wf-ta{ font-size:16px; padding:11px 13px; border-radius:10px }
  .wf-sel{ background-position:calc(100% - 17px) 21px,calc(100% - 12px) 21px }
  .wf-btn{ padding:11px 16px; font-size:14px; min-height:44px }
  .wf-btn.sm{ padding:9px 13px; min-height:40px }
  .ico-btn{ width:44px; height:44px; font-size:15px }
  .wf-nav a{ padding:13px 16px; font-size:14.5px }
  .wf-sub a{ padding:11px 16px 11px 44px }

  /* Toolbar stacks; Filters + Add go full width and first */
  .wf-toolbar{ flex-direction:column-reverse; align-items:stretch; gap:9px }
  .wf-toolbar .rgt,.wf-toolbar .exp{
    margin-left:0; width:100%; display:grid; grid-template-columns:1fr 1fr; gap:8px;
  }
  .wf-toolbar .rgt .wf-btn,.wf-toolbar .exp .wf-btn{ width:100%; justify-content:center; min-width:0 }
  .wf-showrow{ flex-direction:column; align-items:stretch }
  .wf-showrow .srch{ margin-left:0; min-width:0; order:-1 }
  .wf-showrow .lhs{ font-size:12.5px }

  /* ---- Listings become cards ------------------------------------------- */
  table.wf-tbl[data-cards]{ display:block; min-width:0 }
  table.wf-tbl[data-cards] thead{ display:none }
  table.wf-tbl[data-cards] tbody,
  table.wf-tbl[data-cards] tr{ display:block }
  table.wf-tbl[data-cards] tr{
    border:1px solid var(--cb-line); border-radius:12px; margin:0 12px 12px; padding:6px 0 0;
    background:#fff; box-shadow:0 1px 2px rgba(16,24,40,.05);
  }
  table.wf-tbl[data-cards] tr:hover{ background:#fff }
  table.wf-tbl[data-cards] td{
    display:flex; gap:12px; align-items:flex-start; white-space:normal;
    padding:7px 14px; border:0; font-size:14px;
  }
  table.wf-tbl[data-cards] td::before{
    content:attr(data-label); flex:0 0 42%; max-width:42%; color:#7B858E; font-size:12.5px;
    font-weight:600; padding-top:1px;
  }
  table.wf-tbl[data-cards] td.chk{ display:none }
  table.wf-tbl[data-cards] td.wf-lead{
    font-size:15.5px; font-weight:600; padding:10px 14px 8px; border-bottom:1px solid #F2F5F7;
    margin-bottom:5px; display:block;
  }
  table.wf-tbl[data-cards] td.wf-lead::before{ display:none }
  table.wf-tbl[data-cards] td.wf-lead a{ color:#1E252B }
  /* action cells regroup into one button row */
  table.wf-tbl[data-cards] td.actcell{
    display:inline-flex; width:auto; text-align:left; padding:4px;
  }
  table.wf-tbl[data-cards] td.actcell::before{ display:none }
  table.wf-tbl[data-cards] td.actcell:first-of-type{ margin-left:10px }
  table.wf-tbl[data-cards] td.actfirst{ margin-top:6px; border-top:1px solid #F2F5F7; padding-top:9px }
  .wf-scroll{ overflow:visible }

  /* Pager */
  .wf-pagerbar{ flex-direction:column; align-items:stretch; gap:9px }
  .wf-pagerbar .pp{ display:none }
  .wf-pagerbar .pgs{ justify-content:center }
  .wf-pagerbar .pgs a{ min-width:44px; height:44px }
  .wf-pagerbar .cnt{ text-align:center }

  /* Modal → full-screen sheet */
  .wf-modal{ padding:0; align-items:stretch }
  .wf-modal .dlg{ max-width:none; border-radius:0; min-height:100%; display:flex; flex-direction:column }
  .wf-modal .mb{ max-height:none; flex:1 1 auto; padding:16px }
  .wf-modal .mh{ position:sticky; top:0; background:#fff; z-index:2 }
  .wf-modal .mf{ position:sticky; bottom:0 }
  .wf-modal .mf .wf-btn{ flex:1 1 0; justify-content:center }

  /* Step footer pinned to the viewport on a phone */
  .wf-stickybar{
    position:fixed; left:0; right:0; bottom:0; z-index:1100; border-radius:0;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom));
    box-shadow:0 -8px 22px -14px rgba(16,24,40,.5);
  }
  .wf-stickybar .wf-btn{ flex:1 1 0; justify-content:center; padding-left:10px; padding-right:10px }
  .wf-stickybar .sp{ display:none }
  .wf-stickybar [data-msg]{ display:none }          /* Save draft hidden on a phone */
  body.has-stickybar .wf-wrap{ padding-bottom:84px }

  /* Stepper → compact progress */
  .wf-stepper{ display:none }
  .wf-mobstep{ display:block }
  .wf-strip{ font-size:14px; padding:9px 14px }
  .wf-dl{ grid-template-columns:1fr; gap:0 }
  .wf-dl dt{ text-align:left; padding:8px 0 0; border:0; font-size:12.5px; color:#7B858E }
  .wf-dl dd{ padding:1px 0 9px; border-bottom:1px solid #F2F5F7 }
  .wf-tiles{ gap:18px }
  .wf-tile{ width:132px } .wf-tile .ring{ width:104px; height:104px; font-size:36px }
  .wf-hero img{ height:68px } .wf-hero h2{ font-size:20px }
  .wf-banner{ font-size:12px } .wf-banner .bnav{ margin-left:0; width:100% }
  .wf-banner .bnav a{ flex:1 1 0; text-align:center }
}

/* ==========================================================================
   v3 — Video login hero, parameter pages, help pages, visit detail
   ========================================================================== */

/* ---- Sign in: video background, card on top ----------------------------- */
.wf-signin{
  position:relative; min-height:100vh; display:grid; place-items:center;
  padding:34px 16px; overflow:hidden; background:#070D13;
}
.wf-signin>video,.wf-signin>img.pstr{
  position:fixed; inset:0; width:100%; height:100%; object-fit:cover; z-index:0;
}
.wf-signin::after{
  content:""; position:fixed; inset:0; z-index:1;
  background:
    linear-gradient(180deg,rgba(7,13,19,.70) 0%,rgba(7,13,19,.58) 50%,rgba(7,13,19,.80) 100%),
    linear-gradient(115deg,rgba(1,140,124,.45) 0%,rgba(7,13,19,.10) 55%,rgba(165,76,157,.38) 100%);
}
body[data-theme="tech"] .wf-signin::after{
  background:
    linear-gradient(180deg,rgba(7,13,19,.70) 0%,rgba(7,13,19,.58) 50%,rgba(7,13,19,.80) 100%),
    linear-gradient(115deg,rgba(0,127,67,.50) 0%,rgba(7,13,19,.10) 55%,rgba(165,76,157,.34) 100%);
}

.wf-signin .card-wrap{ position:relative; z-index:2; width:100%; max-width:404px }
.wf-signin .box{
  background:rgba(255,255,255,.97); border-radius:16px; padding:34px 32px 30px;
  box-shadow:0 30px 70px -22px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.14);
  backdrop-filter:blur(3px);
}
.wf-signin .wf-mark{ text-align:center; margin-bottom:22px }
.wf-signin .wf-mark img{ height:62px }
.wf-signin .wf-mark .kind{
  display:block; margin-top:13px; font-size:10.5px; font-weight:700; letter-spacing:1.4px;
  text-transform:uppercase; color:var(--brand-d);
}
.wf-signin h2{ font-size:21px; font-weight:600; margin:0 0 4px; text-align:center; color:#2B3137 }
.wf-signin .sub{ font-size:12.8px; color:#7B858E; text-align:center; margin:0 0 22px }
.wf-signin .ifield{ position:relative }
.wf-signin .ifield i{ position:absolute; right:14px; top:50%; transform:translateY(-50%);
  color:#A9B3BC; font-size:14px }
.wf-signin .ifield input{ padding-right:40px }
.wf-signin .help{
  margin-top:22px; padding:13px 15px; border-radius:10px; background:#F6F9FA;
  border:1px solid var(--cb-line); font-size:12.3px; color:#5A646D; text-align:center; line-height:1.6;
}
.wf-signin .help b{ color:#333B42 }
.wf-signin .switch{ margin-top:18px; text-align:center; font-size:12.5px; color:rgba(255,255,255,.78) }
.wf-signin .switch a{ margin:0 6px; color:#fff; text-decoration:underline; text-underline-offset:3px }
.wf-signin .switch a:hover{ color:var(--brand-l) }
.wf-signin .foot{ margin-top:12px; text-align:center; font-size:11px; color:rgba(255,255,255,.55) }

@media (max-width:575.98px){
  .wf-signin{ padding:22px 14px }
  .wf-signin .box{ padding:28px 20px 24px; border-radius:14px }
  .wf-signin .wf-mark img{ height:52px }
}

/* ---- Parameter (Miscellaneous) pages ------------------------------------ */
.wf-ordercell{ width:92px }
.wf-ordercell input{ text-align:center; padding:6px 8px }
.wf-paramnote{ font-size:12.5px; color:#7B858E; padding:0 14px 12px }

/* ---- Help pages ---------------------------------------------------------- */
.wf-steps{ counter-reset:hstep; list-style:none; margin:0; padding:0 }
.wf-steps>li{ position:relative; padding:0 0 26px 54px; border-left:2px solid var(--cb-line); margin-left:17px }
.wf-steps>li:last-child{ border-left-color:transparent; padding-bottom:4px }
.wf-steps>li::before{
  counter-increment:hstep; content:counter(hstep);
  position:absolute; left:-18px; top:-2px; width:34px; height:34px; border-radius:50%;
  background:linear-gradient(135deg,var(--brand-d),var(--brand)); color:#fff;
  display:grid; place-items:center; font-weight:700; font-size:14px;
  box-shadow:0 0 0 4px #fff;
}
.wf-steps h4{ font-size:16px; font-weight:600; margin:4px 0 7px; color:#333B42 }
.wf-steps p{ font-size:13.8px; color:#5A646D; line-height:1.65; margin:0 0 11px; max-width:760px }
.wf-shot{
  border:1px solid var(--cb-line); border-radius:12px; overflow:hidden; background:#fff; max-width:620px;
  box-shadow:var(--shadow);
}
.wf-shot .bar{ height:26px; background:linear-gradient(100deg,var(--brand-d),var(--brand));
  display:flex; align-items:center; padding:0 9px; gap:4px }
.wf-shot .bar i{ width:7px; height:7px; border-radius:50%; background:rgba(255,255,255,.45) }
.wf-shot .bd{ display:flex; min-height:104px }
.wf-shot .sb{ width:54px; background:#0A121B; flex:0 0 54px }
body[data-theme="tech"] .wf-shot .sb{ background:#222D32 }
.wf-shot .sb span{ display:block; height:7px; margin:9px 8px; border-radius:3px; background:rgba(255,255,255,.14) }
.wf-shot .ct{ flex:1 1 auto; padding:11px 13px }
.wf-shot .ct span{ display:block; height:8px; border-radius:3px; background:#E7ECF0; margin-bottom:8px }
.wf-shot .ct span.t{ width:38%; height:11px; background:#CFD7DE }
.wf-shot .ct span.hl{ background:linear-gradient(90deg,rgba(3,179,157,.45),rgba(165,76,157,.25)); width:62% }
.wf-shot .cap{ font-size:11.5px; color:#8A949D; padding:0 13px 11px }
.wf-callout{
  display:flex; gap:11px; align-items:flex-start; background:linear-gradient(100deg,#F3FBFA,#FBF6FA);
  border:1px solid #CDE9E4; border-left:3px solid var(--brand); border-radius:10px;
  padding:12px 15px; font-size:13.3px; color:#3A535A; max-width:760px; margin:0 0 11px;
}
.wf-callout i{ color:var(--brand-d); margin-top:2px }

/* ---- Visit detail definition blocks -------------------------------------- */
.wf-dl.tight dt{ padding:6px 0 } .wf-dl.tight dd{ padding:6px 0 }

/* ==========================================================================
   v4 — Rota / Leave calendars
   ========================================================================== */
.wf-calwrap{ overflow-x:auto }
.wf-cal{ width:100%; min-width:720px; border-collapse:collapse; table-layout:fixed }
.wf-cal th{
  background:var(--bar); color:#fff; font-size:13px; font-weight:600; letter-spacing:.4px;
  padding:10px 8px; text-align:center; border:1px solid rgba(255,255,255,.14);
}
.wf-cal td{
  border:1px solid var(--cb-line); vertical-align:top; height:112px; padding:0;
  background:#FBFCFD; position:relative;
}
.wf-cal td.out{ background:#fff }
.wf-cal td.today{ background:#F2FBFA; box-shadow:inset 0 0 0 2px var(--brand) }
body[data-theme="tech"] .wf-cal td.today{ background:#F1FAF4 }
.wf-cal .dn{ display:block; text-align:right; font-size:12.5px; font-weight:600; color:#6A747D;
  padding:6px 9px 3px }
.wf-cal td.today .dn{ color:var(--brand-d) }
.wf-cal .evs{ padding:0 6px 6px; display:flex; flex-direction:column; gap:3px }
.wf-cal .ev{
  display:block; font-size:11px; line-height:1.35; border-radius:5px; padding:3px 6px;
  background:rgba(3,179,157,.13); color:#1A6E64; border-left:3px solid var(--brand);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.wf-cal .ev:hover{ text-decoration:none; filter:brightness(.97) }
.wf-cal .ev.mag{ background:rgba(165,76,157,.13); color:#7E3578; border-left-color:var(--cb-mag) }
.wf-cal .ev.amb{ background:rgba(240,162,2,.16); color:#8A5D00; border-left-color:#F0A202 }
.wf-cal .ev.grey{ background:#EEF1F4; color:#5A646D; border-left-color:#B6BFC7 }
.wf-cal .more{ font-size:10.5px; color:#8A949D; padding-left:3px }
.wf-cal .addday{
  position:absolute; right:6px; bottom:5px; width:22px; height:22px; border-radius:6px;
  display:grid; place-items:center; color:#2E8FB8; background:rgba(46,143,184,.1); font-size:11px;
}
.wf-cal .addday:hover{ background:var(--brand); color:#fff; text-decoration:none }

.wf-leavebar{
  display:flex; flex-wrap:wrap; gap:10px 28px; padding:14px 16px;
  border-bottom:1px solid var(--cb-line); background:linear-gradient(100deg,#FAFBFC,#fff);
}
.wf-leavebar div b{ display:block; font-size:19px; font-weight:600; line-height:1.15 }
.wf-leavebar div span{ font-size:11.5px; color:#8A949D; letter-spacing:.3px }
.wf-leavebar .alloc b{ color:#333B42 }
.wf-leavebar .used b{ color:#1D7FA8 }
.wf-leavebar .left b{ color:#B0362C }

/* Week rota grid */
.wf-week{ width:100%; min-width:960px; border-collapse:collapse }
.wf-week th{
  background:#FAFBFC; border-bottom:2px solid var(--cb-line); padding:10px 12px; font-size:13px;
  font-weight:600; color:#3F4850; text-align:left; white-space:nowrap;
}
.wf-week th.who{ width:150px }
.wf-week td{ border-bottom:1px solid #EFF2F5; border-left:1px solid #F2F5F7; padding:7px;
  vertical-align:top; height:88px }
.wf-week td.who{ font-weight:600; font-size:13.3px; color:#333B42; background:#FBFCFD;
  border-left:0; vertical-align:middle }
.wf-week td.off{ background:repeating-linear-gradient(45deg,#FAFBFC,#FAFBFC 7px,#F2F5F7 7px,#F2F5F7 14px) }
.wf-week .evs{ display:flex; flex-direction:column; gap:3px }

@media (max-width:767.98px){
  .wf-cal td{ height:84px }
  .wf-cal .ev{ font-size:10px }
  .wf-leavebar{ gap:10px 18px }
  .wf-leavebar div b{ font-size:16px }
}

/* Week rota → day-at-a-time on a phone */
@media (max-width:767.98px){
  .wf-week{ min-width:0; display:block }
  .wf-week thead{ display:none }
  .wf-week tbody,.wf-week tr{ display:block }
  .wf-week td{ display:block; height:auto; border:0; padding:0 }
  .wf-week td.who{
    background:linear-gradient(100deg,#FAFBFC,#fff); border-bottom:1px solid var(--cb-line);
    padding:10px 14px; font-size:14px;
  }
  .wf-week td[data-day]{ border-bottom:1px solid #EFF2F5; padding:9px 14px 11px }
  .wf-week td[data-day]::before{
    content:attr(data-day); display:block; font-size:12px; font-weight:700; letter-spacing:.5px;
    text-transform:uppercase; color:#8A949D; margin-bottom:6px;
  }
  .wf-week td.off[data-day]::after{
    content:"Non-working day"; font-size:12px; color:#A1AAB3; font-style:italic;
  }
  .wf-week td[data-day]:not(.off) .evs:empty::after{
    content:"No visits booked"; font-size:12px; color:#A1AAB3; font-style:italic;
  }
  .wf-week td.off{ background:#FAFBFC }
  .wf-week .ev{ font-size:13px; padding:7px 10px }
}
