:root {
    --bg: #eef1f6;
    --panel: #ffffff;
    --line: #dde2ea;
    --line-strong: #c2cbd9;
    --text: #232a36;
    --muted: #67707d;
    --head: #f6f8fb;
    --filter: #eef5ff;
    --blue: #2f5fdb;
    --blue-dark: #2447b3;
    --blue-tint: #eef2ff;
    --green: #16a34a;
    --danger: #c2413b;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(23, 32, 51, 0.05), 0 1px 8px rgba(23, 32, 51, 0.04);
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Segoe UI", Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.4; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.top { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 max(18px, calc((100vw - 1260px) / 2)); background: #fff; border-bottom: 1px solid var(--line); box-shadow: inset 0 -2px 0 var(--blue); position: sticky; top: 0; z-index: 5; }
.brand { font-size: 18px; font-weight: 700; color: #1a2233; }
.brand:hover { text-decoration: none; color: var(--blue); }
.crumb { color: var(--muted); margin-left: 7px; }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a { color: #3f4652; padding: 7px 10px; border-radius: 6px; font-weight: 600; }
.top nav a:hover { background: var(--blue-tint); color: var(--blue-dark); text-decoration: none; }
.top nav a.logout { color: var(--muted); font-weight: 500; }

.page { width: min(1260px, calc(100% - 48px)); margin: 0 auto; padding: 20px 0 32px; }
.titlebar { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.titlebar h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.titlebar p { margin: 4px 0 0; color: var(--muted); }
.buttonbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.subnav { display: flex; gap: 6px; align-items: center; padding: 8px max(18px, calc((100vw - 1260px) / 2)); background: #f8fafc; border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 4; }
.subnav a { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid transparent; border-radius: 6px; color: #344054; font-weight: 600; }
.subnav a:hover { background: #fff; border-color: var(--line); text-decoration: none; }
.subnav a.back { color: var(--muted); font-weight: 500; padding-left: 4px; }
.subnav .sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; }

.filters { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 10px; background: var(--filter); border-bottom: 1px solid #b9d3f7; overflow-x: auto; }
.filters input[type="text"], .filters input:not([type]), .filters input[name="q"] { flex: 1 1 420px; min-width: 320px; }
.filters select { flex: 0 0 190px; }
.filters .btn, .filters button { flex: 0 0 auto; white-space: nowrap; }
.bulk { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); background: #fbfcfe; overflow-x: auto; }
.bulk select { flex: 0 0 190px; }
.bulk input[type="datetime-local"] { flex: 0 0 190px; }
.bulk input[name="bulk_meeting_link"] { flex: 1 0 260px; }
.bulk .btn, .bulk button { flex: 0 0 auto; white-space: nowrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); }
.form-panel { padding: 18px; }
.form-panel h2 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 33px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: #2f3a49; padding: 7px 13px; font: inherit; font-weight: 600; cursor: pointer; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 120ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.btn:hover { background: #f4f7fb; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.primary { color: #fff; background: var(--blue); border-color: var(--blue-dark); box-shadow: 0 1px 2px rgba(47, 95, 219, 0.35); }
.btn.primary:hover { background: var(--blue-dark); }
.btn.secondary { background: #fff; color: var(--blue-dark); }
.btn.row { min-height: 28px; padding: 4px 10px; font-weight: 500; }
.btn-danger, .btn.danger { background: #fff; color: var(--danger); border-color: #eab3ae; }
.btn-danger:hover, .btn.danger:hover { background: #fdf1f0; }

input, select, textarea { width: 100%; border: 1px solid #c7d1df; border-radius: 6px; background: #fff; color: var(--text); padding: 8px 9px; font: inherit; transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-weight: 700; margin-bottom: 5px; color: #3a4250; font-size: 12px; }

.table-wrap { overflow-x: auto; }
.bo-table { width: 100%; border-collapse: collapse; min-width: 1100px; }
.bo-table th, .bo-table td { border-bottom: 1px solid #e5e9ef; padding: 9px 10px; text-align: left; vertical-align: middle; }
.bo-table th { background: var(--head); color: #4b5563; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.bo-table td { background: #fff; }
.bo-table tbody tr[data-href] { cursor: pointer; }
.bo-table tbody tr[data-href] td { cursor: pointer; }
.bo-table tbody tr[data-href]:hover td { background: var(--blue-tint); }
.bo-table .actions { width: 86px; text-align: right; }
.bo-table input[type="checkbox"] { width: 15px; height: 15px; }

.muted { color: var(--muted); font-size: 12px; margin-top: 2px; }
.empty { color: var(--muted); text-align: center; padding: 28px !important; }
.badge { display: inline-flex; align-items: center; min-height: 22px; border-radius: 999px; padding: 2px 9px; color: #fff; background: var(--badge); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.selected-dot { display: inline-flex; margin-left: 6px; color: #0f7a3d; background: #e8f7ed; border: 1px solid #b7e2c5; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide, .settings-grid .wide { grid-column: 1 / -1; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 82px; gap: 8px; margin-bottom: 8px; }
.skill-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 8px; margin-bottom: 8px; }
.actions-line { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.stack { display: grid; gap: 10px; }
.pastebox { min-height: 360px; font-family: Consolas, Monaco, monospace; font-size: 12px; }
.check { display: flex; align-items: center; gap: 7px; margin-top: 23px; font-weight: 600; }
.check input { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; margin: 0; background: #fff; font-weight: 600; transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out); }
.chips label:has(input:checked) { background: var(--blue-tint); border-color: var(--blue); color: var(--blue-dark); }
.chips input { width: auto; }

/* Sectioned candidate/job editor: groups fields under a labelled header so the
   form reads as a few short questions instead of one long wall of inputs. */
.form-section { grid-column: 1 / -1; background: var(--head); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px 4px; margin-bottom: 2px; }
.form-section + .form-section { margin-top: 6px; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--blue-dark); margin: 0 0 12px; padding-left: 9px; border-left: 3px solid var(--blue); }
.form-section .form-grid { gap: 12px 14px; margin-bottom: 14px; }

.portfolio-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.portfolio-files li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; }
.portfolio-files li .muted { margin: 0; margin-left: auto; }
.btn-link-delete { border: none; background: none; color: var(--danger); font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; }
.btn-link-delete:hover { text-decoration: underline; }

.flash { margin-bottom: 10px; border: 1px solid #a7d8b7; background: #effaf3; border-radius: 6px; padding: 10px 12px; color: #176335; }
.flash.error { border-color: #efb2ad; background: #fff1f0; color: #9f2f29; }

.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #eef1f6 0%, #e3e9f7 100%); }
.login-box { width: min(430px, calc(100vw - 28px)); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 26px; box-shadow: 0 20px 56px rgba(23, 32, 51, 0.14); }
.login-box h1 { margin: 0 0 16px; font-size: 21px; }

@media (max-width: 920px) {
    .top { height: auto; align-items: flex-start; padding: 10px 12px; flex-direction: column; }
    .top nav { flex-wrap: wrap; }
    .page { width: calc(100% - 24px); padding: 12px 0; }
    .titlebar { display: block; }
    .buttonbar { justify-content: flex-start; margin-top: 10px; }
    .form-grid, .settings-grid { grid-template-columns: 1fr; }
    .check { margin-top: 0; }
}
