/* JobManager — single stylesheet for public site, candidate portal and admin. */
:root {
  --brand: #4f46e5;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --brand-ink: color-mix(in srgb, var(--brand) 80%, black);
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 26px; letter-spacing: -.01em; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0 0 .9em; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.icon { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1; min-width: 0; }
.text-right { text-align: right; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; font-size: 16px; font-weight: 650; }
.card-title .muted { font-weight: 400; font-size: 13px; }
.card-flush { padding: 0; overflow: hidden; }
.card-section { padding: 16px 20px; border-top: 1px solid var(--border); }
.card-section:first-child { border-top: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-danger { color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: rgba(0,0,0,.06); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-danger { color: #b91c1c; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.req { color: #dc2626; margin-left: 2px; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type=file] { font: inherit; font-size: 14px; max-width: 100%; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 15px; cursor: pointer; margin-bottom: 8px; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; background: #fff; }
.choice:hover { border-color: var(--brand); }
.choice input { accent-color: var(--brand); width: 17px; height: 17px; margin: 0; flex: none; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.honey { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0; }
.form-section { margin-bottom: 28px; }
.form-section > h2 { font-size: 17px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ---------- Alerts & badges ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; font-size: 14px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, white); color: var(--brand-ink); }
.alert strong { font-weight: 650; }
.alert-icon { display: flex; gap: 12px; align-items: flex-start; }
.alert-icon > .icon { margin-top: 2px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-indigo { background: #e0e7ff; color: #3730a3; }
.badge-teal { background: #ccfbf1; color: #115e59; }
.badge-violet { background: #ede9fe; color: #5b21b6; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .title-cell a { font-weight: 600; color: var(--text); }
.row-link { cursor: pointer; }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 12px; flex: none; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.person { display: flex; align-items: center; gap: 10px; }
.person-name { font-weight: 600; color: var(--text); }
.unread-dot { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; }

.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: 0; padding: 2px; cursor: pointer; color: #d1d5db; }
.stars button.on, .stars .on { color: #f59e0b; }
.stars button.on svg, .stars .on svg { fill: #f59e0b; }
.stars button:hover { color: #f59e0b; }

/* ---------- Public site ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.site-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none !important; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.site-nav { display: flex; gap: 18px; }
.site-nav a { color: var(--text-2); font-weight: 500; font-size: 14px; }
.site-main { padding-top: 28px; padding-bottom: 60px; min-height: calc(100vh - 140px); }
.site-footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: 13px; background: var(--surface); }

.hero { padding: 28px 0 22px; }
.hero h1 { font-size: 34px; margin-bottom: 8px; }
.hero p { font-size: 17px; color: var(--text-2); max-width: 640px; }
.filters { display: grid; grid-template-columns: 1fr 200px 160px auto; gap: 10px; margin-bottom: 20px; }
.job-list { display: grid; gap: 12px; }
.job-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.job-card:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.job-card h2 { margin: 0 0 6px; font-size: 18px; }
.job-card .meta { display: flex; gap: 8px; flex-wrap: wrap; }
.job-card .arrow { color: var(--brand); flex: none; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state h1, .empty-state h2 { margin-bottom: 8px; }

.job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.job-head { margin-bottom: 20px; }
.job-head .company { font-weight: 600; color: var(--brand); margin-bottom: 6px; }
.job-head h1 { font-size: 30px; }
.job-summary { position: sticky; top: 82px; }
.summary-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.summary-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.summary-list .icon { color: var(--muted); margin-top: 2px; }
.summary-list b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.prose { font-size: 15.5px; color: #1f2937; }
.prose h3 { margin-top: 1.4em; font-size: 17px; }
.prose ul { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 4px; }
.presence-banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: #fffbeb; border: 1px solid #fde68a; color: #78350f; margin-bottom: 20px; }
.presence-banner .icon { color: #d97706; margin-top: 2px; }
.loc-box { border-radius: var(--radius); padding: 16px; margin: 4px 0 20px; }
.loc-box.warn { background: #fffbeb; border: 1px solid #fde68a; }
.loc-box.stop { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.loc-box.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; padding: 10px 14px; font-size: 14px; }
.loc-box h3 { margin-bottom: 6px; font-size: 15px; }
.apply-card { scroll-margin-top: 80px; }

/* Candidate portal */
.portal { max-width: 860px; margin: 0 auto; }
.site-main > .alert:has(~ .portal) { max-width: 860px; margin-left: auto; margin-right: auto; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.steps { display: flex; margin: 18px 0 6px; counter-reset: step; }
.step { flex: 1; text-align: center; position: relative; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.step::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 6px; border-radius: 50%; background: #fff; border: 2px solid var(--border-strong); position: relative; z-index: 1; }
.step::after { content: ""; position: absolute; top: 12px; left: calc(-50% + 13px); right: calc(50% + 13px); height: 2px; background: var(--border-strong); }
.step:first-child::after { display: none; }
.step.done { color: var(--text); }
.step.done::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--brand); }
.step.done::after { background: var(--brand); }
.step.current { color: var(--brand); font-weight: 700; }
.step.current::before { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--brand) ; }
.status-hero { display: flex; gap: 14px; align-items: flex-start; }
.link-box { display: flex; gap: 8px; margin-top: 10px; }
.link-box input { font-size: 13px; background: var(--surface-2); }

.interview { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: #fff; }
.interview + .interview { margin-top: 12px; }
.interview-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.interview-head h3 { margin: 0; }
.interview dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 10px 0; font-size: 14px; }
.interview dt { color: var(--muted); }
.interview dd { margin: 0; word-break: break-word; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-weight: 650; }
.chat-head .live { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 0 3px #dcfce7; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; height: 380px; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; max-width: 280px; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg .bubble { padding: 9px 13px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .msg-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.msg-mine { align-self: flex-end; align-items: flex-end; }
.msg-mine .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-mine .bubble a { color: #fff; text-decoration: underline; }
.msg-theirs { align-self: flex-start; }
.msg-theirs .bubble { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-system { align-self: center; max-width: 92%; align-items: center; }
.msg-system .bubble { background: #eef2ff; color: #3730a3; font-size: 13px; border-radius: 10px; text-align: center; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-form textarea { min-height: 42px; max-height: 140px; height: 42px; resize: none; padding: 10px 12px; font-size: 14.5px; overflow-y: hidden; }
.chat-form .btn { height: 42px; }
.chat-closed { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; background: var(--surface-2); }
.chat-error { color: #b91c1c; font-size: 13px; padding: 0 12px 8px; }

/* ---------- Admin ---------- */
body.admin { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none !important; }
.sidebar-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { display: grid; gap: 2px; padding: 8px 10px; }
.sidebar a { color: #cbd5e1; text-decoration: none !important; }
.sidebar-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav a.active .icon { color: color-mix(in srgb, var(--brand) 55%, white); }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; min-width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot > a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.sidebar-foot > a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; }
.sidebar-user .avatar { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-user-name { flex: 1; font-size: 14px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .icon-btn { color: #94a3b8; }
.sidebar-user .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; min-height: 68px; }
.topbar h1 { font-size: 20px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }
.admin-content { padding: 24px 28px 60px; max-width: 1280px; width: 100%; }
.sidebar-backdrop { display: none; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: var(--text); text-decoration: none !important; display: block; }
a.stat:hover { border-color: var(--brand); }
.stat .stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .grow a { color: var(--text); font-weight: 600; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.detail-aside { display: grid; gap: 16px; position: sticky; top: 84px; }
.detail-aside .card + .card { margin-top: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.qa { padding: 12px 0; border-top: 1px solid var(--border); }
.qa:first-child { border-top: 0; padding-top: 0; }
.qa-q { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.qa-a { white-space: pre-wrap; }
.qa.knocked { background: #fef2f2; margin: 0 -20px; padding: 12px 20px; }
.resume-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.timeline li { position: relative; padding: 0 0 12px 20px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.note { padding: 12px 0; border-top: 1px solid var(--border); }
.note:first-of-type { border-top: 0; }
.note-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
.note-body { white-space: pre-wrap; font-size: 14px; }
details.disclosure > summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--brand); }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { margin-bottom: 14px; }
.pipeline-bar { display: flex; gap: 4px; flex-wrap: wrap; }

/* Question builder */
.qb-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); margin-bottom: 12px; }
.qb-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; }
.qb-tools { display: flex; gap: 4px; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }
.qb-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.qb-extra label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.preset-btn { font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--border-strong); background: #fff; cursor: pointer; font: inherit; font-size: 12.5px; }
.preset-btn:hover { border-color: var(--brand); color: var(--brand); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar > * { width: auto; min-width: 150px; }
.filter-bar input[type=search] { flex: 1; min-width: 200px; }
.share-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-box input { flex: 1; min-width: 220px; font-size: 13.5px; background: var(--surface-2); }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.inbox-list { max-height: calc(100vh - 150px); overflow-y: auto; }
.inbox-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.active { background: var(--brand-soft); }
.inbox-item .snippet { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox .chat-messages { height: calc(100vh - 290px); min-height: 320px; }
.day-head { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.day-head:first-child { margin-top: 0; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }

/* Auth pages */
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--brand-soft), var(--bg) 60%); }
.auth-wrap { width: 100%; max-width: 440px; padding: 24px 16px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.auth-wrap .card { padding: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { position: static; }
}
@media (max-width: 900px) {
  .job-layout, .dash-grid, .inbox { grid-template-columns: minmax(0, 1fr); }
  .job-summary { position: static; order: -1; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters > :first-child { grid-column: 1 / -1; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .admin-content { padding: 16px 16px 60px; }
  .inbox-list { max-height: 320px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .grid-2, .grid-3, .qb-row, .qb-extra, .filters { grid-template-columns: 1fr; }
  .filters > span:empty { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 27px; }
  .job-head h1 { font-size: 24px; }
  .card { padding: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .interview dl { grid-template-columns: 1fr; gap: 0; }
  .interview dd { margin-bottom: 6px; }
  .step { font-size: 11px; }
  .msg { max-width: 92%; }
  .topbar-actions .btn span { display: none; }
  .qa.knocked { margin: 0 -16px; padding: 12px 16px; }
  .resume-frame { height: 480px; }
}
