/* ============================================================
   JobsClass Demo — styles
   ============================================================ */
:root {
  --navy: #16337a;
  --navy-dark: #0f2557;
  --blue: #2563eb;
  --blue-soft: #e8effc;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f8fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.05);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px; height: 60px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand .jc {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px;
  background: linear-gradient(135deg, #e11d48 0%, #16a34a 100%);
}
.brand small { font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 2px; }
.topbar .spacer { flex: 1; }

.role-switch { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.role-switch a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.role-switch a.active { background: var(--navy); color: #fff; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; font-weight: 700; }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.side { grid-template-columns: 320px 1fr; }
.grid.stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid.two, .grid.side, .grid.stats { grid-template-columns: 1fr; }
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card.pad0 { padding: 0; overflow: hidden; }
.card h3 .sub { font-weight: 500; font-size: 13px; color: var(--muted); }

.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; background: var(--navy); color: #fff;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--navy-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.green { background: var(--green); }
.btn.green:hover { background: #15803d; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Inputs ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; }

/* ---------- Badges & chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
}
.chip.skill { background: var(--blue-soft); border-color: #cddffb; color: var(--navy); }
.chip.matched { background: var(--green-soft); border-color: #bbf7d0; color: #166534; }
.chip.missing { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.pill { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.new { background: var(--amber-soft); color: var(--amber); }

/* ---------- Match donut / bar ---------- */
.match-badge {
  display: inline-flex; flex-direction: column; align-items: center;
  min-width: 62px; padding: 6px 10px; border-radius: 12px; font-weight: 800;
}
.match-badge .num { font-size: 20px; line-height: 1; }
.match-badge .lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.match-high { background: var(--green-soft); color: #166534; }
.match-mid  { background: var(--amber-soft); color: #92400e; }
.match-low  { background: var(--red-soft); color: #991b1b; }

.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--blue); transition: width .5s ease; }
.bar.green > span { background: var(--green); }

/* ---------- Progress ring (profile completion) ---------- */
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--line) 0); }
.ring::before { content: ""; position: absolute; }
.ring .inner { width: 70px; height: 70px; background: #fff; border-radius: 50%; display: grid; place-items: center; }
.ring .inner b { font-size: 22px; }
.ring .inner small { font-size: 10px; color: var(--muted); }

/* ---------- Job / candidate cards ---------- */
.list-item {
  display: flex; gap: 16px; padding: 16px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; align-items: flex-start;
}
.list-item + .list-item { margin-top: 12px; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; margin: 6px 0; }
.list-item.highlight { border-color: #bbf7d0; box-shadow: 0 0 0 2px var(--green-soft); }

.meta-item { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Credits header ---------- */
.credit-bar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--navy) 0%, #23499f 100%); color: #fff;
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.credit-bar .big { font-size: 28px; font-weight: 800; }
.credit-bar .lbl { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.credit-bar .divider { width: 1px; height: 40px; background: rgba(255,255,255,.25); }
.credit-bar .spacer { flex: 1; }
.credit-bar .btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.credit-bar .btn.ghost:hover { background: rgba(255,255,255,.22); }

/* ---------- Chatbot ---------- */
.chatbot {
  position: fixed; right: 22px; bottom: 22px; width: 360px; max-width: calc(100vw - 44px);
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden; z-index: 50;
}
.chatbot .head { background: var(--navy); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.chatbot .head .bot-ava { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; font-size: 16px; }
.chatbot .head .t { font-weight: 700; font-size: 14px; }
.chatbot .head .s { font-size: 11px; opacity: .8; }
.chatbot .head .mini { margin-left: auto; cursor: pointer; opacity: .8; font-size: 18px; }
.chat-body { padding: 14px; height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1; }
.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; background: #fff; }
.quick-replies .qr { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--blue-soft); background: var(--blue-soft); color: var(--navy); cursor: pointer; }
.quick-replies .qr:hover { background: #d8e6fd; }
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 26px;
  box-shadow: var(--shadow-lg); cursor: pointer; z-index: 50; border: none;
}

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; place-items: center; z-index: 60; padding: 20px; }
.modal-overlay.open { display: grid; }
.modal { background: #fff; border-radius: 16px; max-width: 620px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal .m-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal .m-head h3 { margin: 0; }
.modal .m-head .x { margin-left: auto; cursor: pointer; font-size: 22px; color: var(--muted); background: none; border: none; }
.modal .m-body { padding: 22px; }
.modal .m-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
.toast.ok { background: var(--green); }
.toast.warn { background: var(--amber); }
.toast.err { background: var(--red); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Misc ---------- */
.stat { text-align: left; }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.divider-h { height: 1px; background: var(--line); margin: 14px 0; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.tag.blur { filter: blur(4px); user-select: none; }
.locked { position: relative; }
.hero {
  background: linear-gradient(180deg, #eef3fb, #f6f8fb); border-radius: var(--radius);
  padding: 26px; text-align: center; margin-bottom: 18px; border: 1px solid var(--line);
}
.hero h1 { font-size: 30px; } .hero h1 .accent { color: var(--blue); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.checklist li:last-child { border-bottom: none; }
.check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.check.done { background: var(--green); color: #fff; }
.check.todo { background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.pct-inline { font-weight: 800; color: var(--green); }
table.simple { width: 100%; border-collapse: collapse; }
table.simple th, table.simple td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.simple th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.status.pending { background: var(--amber-soft); color: var(--amber); }
.status.progress { background: var(--blue-soft); color: var(--navy); }
.status.delivered { background: #ede9fe; color: #6d28d9; }
.status.approved { background: var(--green-soft); color: #166534; }
.plan-card { border: 2px solid var(--line); border-radius: 14px; padding: 18px; }
.plan-card.current { border-color: var(--green); }
.plan-card .price { font-size: 26px; font-weight: 800; }
.plan-card .price small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ============================================================
   PHASE 3 — RM / Freelancer / Admin shared components
   ============================================================ */

/* ---- Stat tiles row ---- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.tile .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tile.accent { background: linear-gradient(135deg, var(--navy) 0%, #23499f 100%); color: #fff; border: none; }
.tile.accent .l, .tile.accent .sub { color: rgba(255,255,255,.82); }
.tile.green-tile { background: linear-gradient(135deg, #15803d 0%, #22a352 100%); color: #fff; border: none; }
.tile.green-tile .l, .tile.green-tile .sub { color: rgba(255,255,255,.85); }

/* ---- Priority pills ---- */
.prio { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.prio.urgent { background: var(--red); color: #fff; }
.prio.high { background: var(--red-soft); color: #991b1b; }
.prio.medium { background: var(--amber-soft); color: #92400e; }
.prio.normal { background: var(--amber-soft); color: #92400e; }
.prio.low { background: var(--blue-soft); color: var(--navy); }

/* ---- JD status ---- */
.status.open { background: var(--blue-soft); color: var(--navy); }
.status.assigned { background: var(--green-soft); color: #166534; }
.status.rotated { background: #ede9fe; color: #6d28d9; }
.status.filled { background: #e2e8f0; color: #334155; }
.status.returned { background: var(--red-soft); color: #991b1b; }

/* ---- Pipeline stepper ---- */
.pipeline { display: flex; align-items: center; gap: 0; margin: 4px 0; }
.pipeline .step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; position: relative; }
.pipeline .step .dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; background: var(--bg); border: 2px solid var(--line); color: var(--muted); z-index: 2;
}
.pipeline .step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.pipeline .step.current .dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 4px var(--blue-soft); }
.pipeline .step .cap { font-size: 10px; font-weight: 700; color: var(--muted); }
.pipeline .step.done .cap, .pipeline .step.current .cap { color: var(--ink); }
.pipeline .step::before, .pipeline .step::after {
  content: ""; position: absolute; top: 11px; height: 2px; background: var(--line); z-index: 1;
}
.pipeline .step::before { left: 0; right: 50%; }
.pipeline .step::after  { left: 50%; right: 0; }
.pipeline .step:first-child::before, .pipeline .step:last-child::after { display: none; }
.pipeline .step.done::before, .pipeline .step.done::after,
.pipeline .step.current::before { background: var(--green); }

/* ---- Earning state chips ---- */
.earn { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.earn.payable { background: var(--green-soft); color: #166534; }
.earn.pending { background: var(--amber-soft); color: #92400e; }
.earn.paid { background: #e2e8f0; color: #334155; }

/* ---- Admin config rows ---- */
.cfg-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cfg-row:last-child { border-bottom: none; }
.cfg-row .cfg-label { font-weight: 600; }
.cfg-row .cfg-label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.cfg-row .cfg-input { display: flex; align-items: center; gap: 6px; }
.cfg-row .cfg-input input { width: 90px; text-align: right; }
.cfg-row .cfg-input .unit { color: var(--muted); font-size: 13px; min-width: 14px; }

/* ---- Split % bar (stage allocation preview) ---- */
.splitbar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.splitbar > span { display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.splitbar > span.s0 { background: #64748b; }
.splitbar > span.s1 { background: #2563eb; }
.splitbar > span.s2 { background: #7c3aed; }
.splitbar > span.s3 { background: #16a34a; }

/* ---- Simple avatar list rows ---- */
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.person .avatar { width: 36px; height: 36px; }
.person .grow { flex: 1; min-width: 0; }
.loadbar { width: 90px; }

/* ---- Section grid for RM ---- */
.grid.rmside { grid-template-columns: 1fr 300px; gap: 18px; }
@media (max-width: 900px) { .grid.rmside { grid-template-columns: 1fr; } }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.activity li:last-child { border-bottom: none; }
.activity li .when { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ============================================================
   APP SHELL — JobsClass-style fixed sidebar + header
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  width: 220px; min-width: 220px; height: 100vh;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px;
  overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: inherit; }
.side-brand .jc {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 14px;
  background: linear-gradient(135deg, #e11d48 0%, #16a34a 100%);
}
.side-brand .bt { display: flex; flex-direction: column; line-height: 1.1; }
.side-brand .bt b { font-size: 17px; font-weight: 800; color: var(--ink); }
.side-brand .bt small { font-size: 11px; color: var(--muted); font-weight: 600; }

.role-picker { padding: 4px 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.role-picker label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.role-picker select { padding: 7px 9px; font-size: 13px; border-radius: 8px; }

.side-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin-bottom: 12px; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 4px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: #334155; margin-bottom: 1px;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--blue-soft); color: var(--navy); font-weight: 700; }
.nav-ico { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.nav-item.active .nav-ico { opacity: 1; }

.side-logout {
  display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: #475569; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px;
}
.side-logout:hover { background: var(--red-soft); color: var(--red); }

/* ---- Main column ---- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.app-header .hi { font-size: 20px; font-weight: 700; }
.app-header .hi b { font-weight: 800; }
.app-header .hi-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.topav { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.app-content { padding: 24px 28px 40px; }
/* Neutralize the old centered wrap once it lives inside the shell */
.app-content .wrap { max-width: none; margin: 0; padding: 0; }
/* Old page hero becomes a plain heading block inside the shell */
.app-content .hero { background: none; border: none; padding: 0 0 8px; margin-bottom: 18px; }
.app-content .hero h1 { font-size: 26px; }

.page-head { margin-bottom: 18px; scroll-margin-top: 84px; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; }
/* Any element the sidebar can target keeps clear of the sticky header. */
[id] { scroll-margin-top: 84px; }

/* ---- JobsClass-style dashboard stat cards ---- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card .sc-top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .sc-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-card .sc-ico { font-size: 16px; opacity: .5; }
.stat-card .sc-num { font-size: 34px; font-weight: 800; line-height: 1.1; margin-top: 10px; }
.stat-card .sc-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-card.tint-blue  { background: linear-gradient(135deg, #eff5ff 0%, #f8fbff 100%); }
.stat-card.tint-green { background: linear-gradient(135deg, #eafaf0 0%, #f6fdf9 100%); }
.stat-card.tint-amber { background: linear-gradient(135deg, #fff7ea 0%, #fffdf8 100%); }
.stat-card.tint-purple{ background: linear-gradient(135deg, #f4f0ff 0%, #faf8ff 100%); }
.stat-card.tint-blue .sc-num  { color: #1d4ed8; }
.stat-card.tint-green .sc-num { color: #15803d; }
.stat-card.tint-amber .sc-num { color: #b45309; }
.stat-card.tint-purple .sc-num{ color: #6d28d9; }

/* ---- Dashboard two-column (overview + activity) ---- */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---- Horizontal pipeline overview bars (dashboard) ---- */
.pipe-rows { display: flex; flex-direction: column; gap: 10px; }
.pipe-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; }
.pipe-row .plabel { font-size: 13px; color: #475569; font-weight: 600; }
.pipe-track { height: 26px; background: var(--bg); border-radius: 8px; position: relative; overflow: hidden; }
.pipe-fill { height: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: #fff; font-size: 12px; font-weight: 800; min-width: 26px; }

/* ---- Kanban ATS board (7-stage) ---- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 120px; }
.kcol .khead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 2px; }
.kcol .khead .kname { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.kcol .khead .kcount { font-size: 11px; font-weight: 800; color: #fff; background: var(--navy); border-radius: 999px; padding: 1px 8px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.kcard .kc-name { font-weight: 700; font-size: 13px; }
.kcard .kc-role { font-size: 11px; color: var(--muted); }
.kcard .kc-actions { display: flex; gap: 6px; margin-top: 8px; }
.kcard .kc-actions button { font-size: 11px; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--navy); font-weight: 600; }
.kcard .kc-actions button:hover { background: var(--blue-soft); }
.kcard .kc-actions button:disabled { opacity: .4; cursor: not-allowed; }

/* ---- Recruiter "My Job Postings" priority kanban ---- */
.prio-kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.pk-col { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 140px; border-top: 3px solid var(--line); }
.pk-col.urgent { border-top-color: var(--red); }
.pk-col.high { border-top-color: #f97316; }
.pk-col.normal { border-top-color: var(--amber); }
.pk-col.low { border-top-color: var(--blue); }
.pk-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 8px; }
.pk-head .kname { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.pk-head .kcount { font-size: 11px; font-weight: 800; color: #fff; background: var(--navy); border-radius: 999px; padding: 1px 8px; }
.pk-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.pk-card .pk-title { font-weight: 700; font-size: 13px; line-height: 1.3; }
.pk-card .pk-co { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.pk-card .pk-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.pk-card .chips .chip { font-size: 10px; padding: 1px 7px; }
.pk-assigner { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pk-assigner .av { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.pk-assigner .av.self { background: var(--green); }
.pk-assigner .who { font-size: 11px; line-height: 1.25; }
.pk-assigner .who b { display: block; color: var(--ink); }
.pk-assigner .who span { color: var(--muted); }
/* JD pipeline milestones: green ✓ dots joined by a line */
.jd-miles { display: flex; margin-top: 10px; }
.jd-miles .jm { flex: 1; min-width: 0; text-align: center; position: relative; }
.jd-miles .jm::before { content: ""; position: absolute; top: 9px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.jd-miles .jm:first-child::before { display: none; }
.jd-miles .jm.done::before { background: var(--green); }
.jd-miles .jm-dot { position: relative; z-index: 1; width: 20px; height: 20px; line-height: 20px; margin: 0 auto; border-radius: 50%; background: #fff; border: 2px solid var(--line); box-sizing: border-box; font-size: 10px; font-weight: 800; color: #94a3b8; }
.jd-miles .jm.done .jm-dot { background: var(--green); border-color: var(--green); color: #fff; }
.jd-miles .jm-l { display: block; margin-top: 2px; font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); white-space: nowrap; }
.jd-miles .jm.done .jm-l { color: #166534; }
.chip.svc { background: #ede9fe; color: #6d28d9; font-weight: 700; }

/* Placement cooling-period highlight (internal roles only) */
.placed-banner { background: var(--amber-soft); border: 1px dashed var(--amber); color: #92400e; border-radius: 9px; padding: 7px 12px; font-size: 12px; margin-bottom: 8px; }
.chip.placed { background: var(--amber-soft); color: #92400e; font-weight: 700; border: 1px dashed var(--amber); }
.list-item.was-placed { border-left: 4px solid var(--amber); }

/* Contact balloon (staff popover) */
.contact-pop { position: absolute; z-index: 210; width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; }
.contact-pop::after { content: ""; position: absolute; left: var(--arrow-x, 50%); margin-left: -6px; width: 12px; height: 12px; background: #fff; border: 1px solid var(--line); transform: rotate(45deg); }
.contact-pop.below-arrow::after { bottom: -7px; border-top: none; border-left: none; }
.contact-pop.above-arrow::after { top: -7px; border-bottom: none; border-right: none; }
.contact-pop .cp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.contact-pop .cp-head .avatar { width: 34px; height: 34px; flex: none; }
.contact-pop .cp-x { margin-left: auto; border: none; background: none; font-size: 16px; color: var(--muted); cursor: pointer; line-height: 1; }
.contact-pop .cp-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; }
.contact-pop .cp-row a { font-weight: 600; }
.contact-pop .cp-row .when { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.contact-pop .cp-list { max-height: 200px; overflow: auto; }

/* JD interview questions + screening interview room */
.q-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.q-row .grow { flex: 1; }
.q-row .q-del { cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 4px; }
.q-row .q-del:hover { color: var(--red); }
.iv-qs { max-height: 46vh; overflow: auto; padding-right: 4px; }
.iv-q { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.iv-q .ivq-text { font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.q-ans, .ivq-ans { background: var(--green-soft); border: 1px dashed #bbe7c8; color: #166534; border-radius: 8px; padding: 5px 10px; font-size: 11.5px; font-weight: 500; margin: 4px 0 7px; }
.iv-q .ivq-actions { display: flex; gap: 8px; margin-bottom: 7px; }
.ivq-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 11px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.ivq-btn.ok.on { background: var(--green-soft); color: #166534; border-color: var(--green); }
.ivq-btn.bad.on { background: var(--red-soft); color: #991b1b; border-color: var(--red); }
.ivq-cmt { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 12px; box-sizing: border-box; }

/* Floating selection action bar (sourcing multi-select) */
.sel-bar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 150; display: none; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.sel-bar.on { display: flex; }
.sel-bar b { font-size: 13.5px; white-space: nowrap; }
.sel-bar .sb-btn { background: #fff; color: var(--navy); border: none; border-radius: 9px; padding: 7px 13px; font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.sel-bar .sb-btn:hover { background: var(--blue-soft); }
.sel-bar .sb-x { background: transparent; color: #cbd5e1; border: none; font-size: 16px; cursor: pointer; padding: 0 2px; }
.sel-bar .sb-x:hover { color: #fff; }
.cand-check { width: 17px; height: 17px; cursor: pointer; }

/* Candidate-card engagement stats (sourcing results) */
.cstats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: flex-end; }
.cstat { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: #334155; cursor: pointer; }
.cstat:hover { background: var(--blue-soft); border-color: #c7d7f5; }
.cstat.ok { background: var(--green-soft); color: #166534; border-color: #bbe7c8; }
.cstat.bad { background: var(--red-soft); color: #991b1b; border-color: #f5c9c9; }
.cstat.link { background: var(--blue-soft); color: var(--navy); border-color: #c7d7f5; }
.cstat.link:hover { background: #d8e5fa; text-decoration: underline; }
.cstat.last { cursor: default; background: #fff; color: var(--muted); font-weight: 600; }
.cstat.last .adot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; display: inline-block; }
.cstat.last.on .adot { background: var(--green); }
.contact-link { cursor: pointer; border-radius: 8px; }
.contact-link:hover { background: var(--blue-soft); }
.contact-link .who b { text-decoration: underline dotted; text-underline-offset: 2px; }
.dl-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e2e8f0; color: #334155; }
.dl-chip.soon { background: var(--amber-soft); color: #92400e; }
.dl-chip.overdue { background: var(--red-soft); color: #991b1b; }

/* ---- Job posting cards (JobsClass style) ---- */
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.job-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.job-card .jc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.job-card h3 { margin: 0 0 2px; font-size: 17px; }
.job-card .jc-co { font-size: 13px; color: var(--muted); }
.job-card .jc-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; margin: 12px 0; }
.job-card .jc-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 6px; }
.job-card .jc-apps { text-align: center; }
.job-card .jc-apps .n { font-size: 22px; font-weight: 800; color: var(--green); line-height: 1; }
.job-card .jc-apps .l { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.job-actions { display: flex; gap: 8px; }

/* ---- Filter toolbar (candidate mgmt / jobs) ---- */
.toolbar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.toolbar .tb-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .tb-row > * { flex: 1; min-width: 140px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; flex: 0 0 auto; }
.seg button { border: none; background: none; padding: 7px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }

/* ---- Compact per-JD stage strip (RM oversight) ---- */
.stage-strip { display: flex; gap: 3px; height: 20px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.stage-strip > span { display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; min-width: 18px; }
.stage-strip > span[data-n="0"] { display: none; }
.ss-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ss-legend .li { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.ss-legend .dot { width: 9px; height: 9px; border-radius: 3px; }

/* ---- Recruiter performance table extras ---- */
.perf-score { font-weight: 800; }
.perf-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.perf-bar > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }

/* ---- Task type chips ---- */
.tt { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.tt.screen { background: var(--blue-soft); color: var(--navy); }
.tt.schedule { background: #ede9fe; color: #6d28d9; }
.tt.followup { background: var(--amber-soft); color: #92400e; }
.tt.offer { background: var(--green-soft); color: #166534; }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.task-row:last-child { border-bottom: none; }
.task-row .t-main { flex: 1; min-width: 0; }
.task-row .t-title { font-size: 13px; font-weight: 600; }
.task-row .t-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.task-row .t-due { font-size: 11px; font-weight: 700; white-space: nowrap; }
.task-row .t-due.overdue { color: var(--red); }

/* ---- Settings panel rows ---- */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.set-row:last-of-type { border-bottom: none; }
.set-copy .set-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.set-copy .set-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.set-toggle {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 40px; height: 22px; border-radius: 999px; background: #cbd5e1;
  position: relative; cursor: pointer; transition: background .15s; border: none;
}
.set-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s;
}
.set-toggle:checked { background: var(--green, #16a34a); }
.set-toggle:checked::after { left: 20px; }

/* Compact view — tighter spacing when the preference is on. */
body.compact .app-content { padding: 14px 20px 28px; }
body.compact .card { padding: 12px 14px; }
body.compact .stat-cards { gap: 10px; margin-bottom: 14px; }

/* ---- Candidate 360° detail page ---- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 14px;
}
.back-link:hover { color: var(--navy); }

.cd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cd-id { display: flex; gap: 16px; align-items: flex-start; }
.cd-avatar {
  width: 60px; height: 60px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, #e11d48 0%, #16a34a 100%);
  color: #fff; font-weight: 800; font-size: 22px; display: grid; place-items: center;
}
.cd-id-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.cd-snapshot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cd-snapshot .divider { width: 1px; align-self: stretch; background: var(--line); }
.cd-snapshot .cd-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.cd-snapshot .cd-v { font-size: 16px; font-weight: 700; margin-top: 3px; }

.cd-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cd-comments li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.cd-comment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cd-comment-author { font-size: 13px; font-weight: 700; }
.cd-comment-body { font-size: 13px; margin-top: 5px; color: var(--ink); white-space: pre-wrap; }
.cd-comments .when { font-size: 11px; color: var(--muted); }
#commentInput { width: 100%; resize: vertical; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }

.cd-similar {
  display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line);
  border-radius: 11px; margin-bottom: 10px; color: inherit; transition: border-color .12s, box-shadow .12s;
}
.cd-similar:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.cd-similar-av {
  width: 40px; height: 40px; border-radius: 10px; flex: none; background: var(--navy);
  color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center;
}
.cd-similar .grow { flex: 1; min-width: 0; }
.cd-overlap {
  flex: none; font-weight: 800; font-size: 15px; color: var(--green, #16a34a);
  background: #16a34a15; border-radius: 9px; padding: 6px 9px;
}

@media (max-width: 720px) {
  .sidebar { position: fixed; left: -240px; z-index: 100; transition: left .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .app-header { padding: 14px 16px; }
  .app-content { padding: 16px; }
}
