:root {
    --paper: #F7F6F3;
    --panel: #FFFFFF;
    --ink: #1C1917;
    --muted: #57534E;
    --faint: #A8A29E;
    --line: #E7E5E1;
    --line-soft: #F0EEEA;
    --navy: #1E3A5F;
    --green: #15803D;
    --orange: #C2410C;
    --amber: #B45309;
    --shell-border: rgba(255, 255, 255, 0.08);

    /* dataviz: validated categorical palette (fixed order, never cycled/reordered per-render) */
    --viz-grid: #E7E5E1;
    --viz-ink: #1C1917;
    --viz-ink-muted: #9CA3AF;
    --viz-series-1: #2a78d6; /* blue */
    --viz-series-2: #1baf7a; /* aqua */
    --viz-series-3: #eda100; /* yellow */
    --viz-series-4: #008300; /* green */
    --viz-series-5: #4a3aa7; /* violet */
    --viz-series-6: #e34948; /* red */
    --viz-series-7: #e87ba4; /* magenta */
    --viz-series-8: #eb6834; /* orange */
  }

  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

  body {
    font-size: 13px;
    color: var(--ink);
    background: var(--paper);
    letter-spacing: 0;
  }

  .dashboard-shell { background: transparent; }
  .dashboard-sidebar {
    width: 228px;
    background: var(--ink);
    border-right: 1px solid var(--shell-border);
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--navy);
  }
  .sidebar-caption {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0 12px;
    margin-bottom: 6px;
  }
  .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.68);
    border-radius: 6px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    font-size: 12.5px;
    font-weight: 500;
  }
  .menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
  }
  .menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
  }
  .dashboard-main {
    min-width: 0;
    background: var(--paper);
  }
  .dashboard-topbar {
    height: 64px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .dashboard-content {
    padding: 20px 24px 28px;
    overflow-x: hidden;
  }
  /* 總覽版面：右欄固定寬，窄幅時降級為單欄，不用 12 欄硬撐 */
  .overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
  }
  .overview-main { min-width: 0; }
  .overview-rail {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
  }
  .pipeline-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: stretch;
  }
  .page-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .surface-card,
  .surface-panel,
  .surface-panel-strong {
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: none;
  }
  .section-head {
    padding: 14px 20px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .section-head h2 { font-size: 14px; font-weight: 700; color: var(--ink); }
  .section-title {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0;
  }
  .section-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: var(--faint);
    margin-top: 3px;
  }
  /* 今日作業列：數字連到下一步行動，不做大數字裝飾 */
  .ops-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0;
  }
  .ops-item {
    padding: 14px 20px 12px;
    min-width: 0;
  }
  .ops-item + .ops-item { border-left: 1px solid var(--line-soft); }
  .ops-label { font-size: 11px; color: var(--muted); font-weight: 500; }
  .ops-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.15;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
  }
  .ops-num .ops-unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
  .ops-action { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ops-action .ops-link { color: var(--navy); font-weight: 600; cursor: pointer; }
  .ops-action .ops-link:hover { text-decoration: underline; }
  .ops-action .ops-warn { color: var(--orange); font-weight: 600; }
  .dashboard-top-search {
    width: 340px;
    max-width: 36vw;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel);
    font-size: 13px;
    color: var(--ink);
  }
  .dashboard-top-search::placeholder { color: var(--faint); }
  @media (max-width: 1100px) {
    .dashboard-top-search { width: 200px; max-width: 22vw; }
  }
  .ghost-button,
  .ghost-button-icon {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  .ghost-button:hover,
  .ghost-button-icon:hover {
    color: var(--navy);
    border-color: #D6D3CD;
  }
  .primary-chip {
    border: none;
    background: var(--navy);
    color: #fff;
  }
  .filter-chip {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
  }
  .tbl-compact th {
    padding: 9px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.03em;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
    background-color: transparent;
  }
  .tbl-compact td {
    padding: 11px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    color: var(--ink);
  }
  .tbl-compact tr:last-child td { border-bottom: none; }
  .tbl-compact tr:hover td { background-color: #FBFAF8; }
  /* 各單位招募進度表 */
  .dept-table th {
    padding: 9px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }
  .dept-table th.num, .dept-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .dept-table td {
    padding: 9px 16px;
    font-size: 13px;
    color: var(--ink);
    border-bottom: 1px solid var(--line-soft);
  }
  .dept-table tr:last-child td { border-bottom: none; }
  .dept-table tr.dept-group { cursor: default; }
  .dept-table tr.dept-group.expandable { cursor: pointer; }
  .dept-table tr.dept-group.expandable:hover td { background: #FBFAF8; }
  .dept-table tr.dept-group td:first-child { font-weight: 600; }
  .dept-table tr.dept-sub td {
    font-size: 12px;
    color: var(--muted);
    padding-top: 6px;
    padding-bottom: 6px;
    background: #FBFAF8;
  }
  .dept-table tr.dept-sub td:first-child { padding-left: 38px; }
  .dept-table .caret {
    display: inline-block;
    width: 14px;
    color: var(--faint);
    font-size: 10px;
    margin-right: 4px;
  }
  .dept-table .zero { color: #D6D3CD; }
  .dept-table .n-intv { color: var(--navy); font-weight: 600; }
  .dept-table .n-on { color: var(--green); font-weight: 600; }
  .dept-table .n-total { font-weight: 700; }
  .dept-table .dept-subhint { font-size: 11px; color: var(--faint); font-weight: 400; margin-left: 6px; }
  /* 候選人焦點 */
  .focus-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
  .focus-kv:last-child { border-bottom: none; }
  .focus-kv .k { color: var(--muted); flex-shrink: 0; white-space: nowrap; }
  .focus-kv .v { color: var(--ink); font-weight: 500; text-align: right; min-width: 0; word-break: break-word; }
  .focus-history { max-height: 250px; overflow-y: auto; }
  .focus-caption { font-size: 11px; font-weight: 600; color: var(--faint); margin: 14px 0 6px; }
  .focus-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 12px; font-weight: 500; color: var(--ink); background: var(--panel);
  }
  .focus-link:hover { border-color: #D6D3CD; color: var(--navy); }
  .focus-link.disabled { opacity: 0.4; pointer-events: none; }

  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
  .cal-day { background: #FFFFFF; padding: 9px 7px; min-height: 62px; position: relative; cursor: pointer; transition: background 0.15s; }
  .cal-day:hover { background: var(--paper); }
  .cal-day.other { color: var(--faint); background: var(--paper); }
  .cal-day.today { background: #FFFFFF; font-weight: 700; color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
  .cal-day-num { font-size: 11px; margin-bottom: 4px; }
  .cal-dots { display: flex; flex-wrap: wrap; gap: 2px; }
  .cal-dot { width: 6px; height: 6px; border-radius: 2px; }
  .schedule-shell { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.82fr); gap: 0; }
  .schedule-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
  .schedule-day { background: #FFFFFF; min-height: 144px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
  .schedule-day:hover { background: var(--paper); }
  .schedule-day.other { background: var(--paper); color: var(--faint); }
  .schedule-day.today { background: #FFFFFF; }
  .schedule-day.today .schedule-day-num { color: var(--navy); }
  .schedule-day.selected { box-shadow: inset 0 0 0 2px var(--navy); background: #FFFFFF; }
  .schedule-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .schedule-day-num { font-size: 13px; font-weight: 800; color: var(--ink); }
  .schedule-day.other .schedule-day-num { color: var(--faint); }
  .schedule-count { font-size: 10px; font-weight: 700; color: var(--muted); }
  .schedule-items { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
  .schedule-pill { border-radius: 5px; padding: 7px 8px 6px; font-size: 11px; line-height: 1.25; color: var(--ink); overflow: hidden; }
  .schedule-pill-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .schedule-pill-time { font-size: 10px; color: var(--muted); margin-top: 2px; }
  .schedule-pill-more { font-size: 10px; color: var(--muted); padding-top: 2px; }
  .schedule-pane { border-left: 1px solid #F3F4F6; background: transparent; }
  .schedule-pane-list { max-height: 760px; overflow-y: auto; }
  .schedule-pane-empty { padding: 48px 24px; text-align: center; color: var(--faint); font-size: 12px; }
  .schedule-type-interview { background: var(--navy); }
  .schedule-type-interview .schedule-pill-name { color: #fff; }
  .schedule-type-interview .schedule-pill-time { color: rgba(255, 255, 255, 0.72); }
  .schedule-type-onboard { background: rgba(21, 128, 61, 0.08); }
  .schedule-type-resign { background: rgba(194, 65, 12, 0.08); }
  @media (max-width: 860px) {
    .schedule-shell { grid-template-columns: 1fr; }
    .schedule-pane { border-left: 0; border-top: 1px solid #F3F4F6; }
  }

  /* Drawer */
  .drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(17, 24, 39, 0.4); backdrop-filter: blur(2px); z-index: 50; }
  .drawer-overlay.open { display: block; }
  .drawer-panel { position: fixed; top: 0; right: 0; height: 100%; width: 440px; max-width: 100vw; background: white; box-shadow: -4px 0 24px rgba(0,0,0,0.1); z-index: 51; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
  .drawer-panel.open { transform: translateX(0); }

  /* Utilities — 狀態樣式：履歷待審=琥珀、面試中=藏青、確認到職=綠、結案/不安排=灰 */
  .badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 1.2; border: none; }
  .badge-blue { background: rgba(30, 58, 95, 0.08); color: var(--navy); }
  .badge-green { background: rgba(21, 128, 61, 0.09); color: var(--green); }
  .badge-amber { background: rgba(180, 83, 9, 0.10); color: var(--amber); }
  .badge-orange { background: rgba(180, 83, 9, 0.10); color: var(--amber); }
  .badge-red { background: rgba(194, 65, 12, 0.09); color: var(--orange); }
  .badge-gray { background: #F1F0ED; color: var(--muted); }
  .badge-purple { background: rgba(180, 83, 9, 0.10); color: var(--amber); }
  .badge-teal { background: rgba(21, 128, 61, 0.09); color: var(--green); }

  .soft-note {
    border-radius: 8px;
    padding: 16px 18px;
    background: var(--paper);
  }

  .page .rounded-lg { border-radius: 8px; }
  .page .rounded-t-lg { border-top-left-radius: 8px; border-top-right-radius: 8px; }
  .page button {
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  }
  .page select,
  .page input[type="text"] {
    border-radius: 6px;
  }
  .page .text-brand {
    color: var(--navy);
  }
  .page .border-brand {
    border-color: var(--navy);
  }
  .page .bg-brand {
    background: var(--navy);
  }
  .page .bg-gray-50\/50 {
    background: transparent;
  }
  .page .border-border {
    border-color: var(--line-soft);
  }
  .page .text-gray-800 { color: var(--ink); }
  .page .text-gray-700 { color: var(--ink); }
  .page .text-gray-600 { color: var(--muted); }
  .page .text-gray-500 { color: var(--muted); }
  .page .text-gray-400 { color: var(--faint); }
  .page .p-3.bg-purple-50,
  .page .p-3.bg-red-50,
  .page .p-3.bg-amber-50 {
    border-radius: 12px;
    background: var(--paper);
  }

  /* ===== Editorial palette discipline：舊 utility 色一律映射到規範色 ===== */
  body .text-blue-500, body .text-blue-600, body .text-blue-700,
  body .text-indigo-600, body .text-indigo-700,
  body .hover\:text-blue-600:hover { color: var(--navy); }
  body .text-amber-500, body .text-amber-600, body .text-amber-800,
  body .text-red-400, body .text-red-500, body .text-red-600 { color: var(--orange); }
  body .text-emerald-600, body .text-emerald-700,
  body .text-green-600, body .text-green-700 { color: var(--green); }
  body .bg-blue-500, body .bg-indigo-400, body .bg-indigo-500 { background-color: var(--navy); }
  body .bg-red-400, body .bg-amber-400 { background-color: var(--orange); }
  body .bg-green-500, body .bg-emerald-400 { background-color: var(--green); }
  body .bg-blue-50, body .bg-blue-100, body .bg-blue-200,
  body .bg-indigo-50, body .bg-indigo-100, body .bg-indigo-200 { background-color: rgba(30, 58, 95, 0.08); }
  body .bg-red-50, body .bg-amber-50, body .hover\:bg-red-100:hover { background-color: rgba(194, 65, 12, 0.08); }
  body .bg-green-50, body .bg-emerald-50 { background-color: rgba(21, 128, 61, 0.08); }
  body .border-blue-100, body .border-red-100, body .border-red-200,
  body .border-amber-200, body .border-green-100 { border-color: transparent; }
  body .hover\:border-blue-400:hover { border-color: var(--navy); }
  body .border-gray-200 { border-color: var(--line); }
  body .text-slate-400 { color: var(--faint); }
  #global-results { border: none; border-radius: 12px; }
  /* 今日活動：一行統計 + 單一垂直 timeline */
  .today-stats-line {
    font-size: 12.5px;
    color: var(--muted);
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
  }
  .today-stats-line b {
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .today-stats-line .sep { margin: 0 8px; color: var(--line); }
  .today-timeline { position: relative; }
  .today-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: #F3F4F6;
  }
  .today-tl-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.6rem 0.45rem 1.4rem;
    border-radius: 8px;
    transition: background 0.15s ease;
  }
  .today-tl-row:hover { background: var(--paper); }
  .today-tl-dot {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--faint);
    box-shadow: 0 0 0 2px var(--panel);
    flex-shrink: 0;
  }
  .today-tl-time {
    font-size: 11px;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    flex-shrink: 0;
  }
  .today-tl-dept {
    font-size: 10px;
    color: var(--faint);
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* 月份 tab 導覽列：底線式 tab，active = navy 文字 + 2px navy 底線，整條去框線 */
  #dept-month-tabs { border: none; }
  #dept-month-tabs button {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 4px 4px 7px;
    color: var(--muted);
  }
  #dept-month-tabs button:hover {
    color: var(--navy);
    background: transparent;
    transform: none;
  }
  #dept-month-tabs button.bg-brand {
    background: transparent;
    color: var(--navy);
    border-bottom-color: var(--navy);
  }
  /* 月度招募儀表板 */
  .analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .analytics-span-full { grid-column: 1 / -1; }
  .analytics-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px 18px;
    color: var(--faint);
    font-size: 12px;
    text-align: center;
  }
  .analytics-chart-empty[hidden] { display: none; }
  .job-recommendation-dashboard {
    min-width: 0;
    overflow: hidden;
  }
  .job-recommendation-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--line-soft);
  }
  .job-recommendation-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
  }
  .job-recommendation-title svg { width: 17px; height: 17px; color: #2563EB; }
  .job-recommendation-subtitle {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
  }
  .job-recommendation-period {
    display: flex;
    align-items: flex-end;
    gap: 8px;
  }
  .job-recommendation-select {
    min-width: 94px;
    height: 34px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }
  .job-recommendation-select:focus-visible,
  .job-recommendation-toggle:focus-visible,
  .job-recommendation-action:focus-visible,
  .recommendation-dialog button:focus-visible,
  .recommendation-dialog select:focus-visible,
  .recommendation-dialog input:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
  }
  .job-recommendation-body {
    padding: 12px 18px 14px;
    background: #FBFAF8;
  }
  .job-recommendation-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
  }
  .job-recommendation-summary strong {
    color: var(--ink);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }
  .job-recommendation-ledger {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .job-recommendation-row {
    display: grid;
    grid-template-columns: minmax(220px, 38%) minmax(140px, 1fr) 48px;
    align-items: center;
    gap: 14px;
    min-height: 36px;
    padding: 5px 10px 5px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    background: var(--panel);
  }
  .job-recommendation-row:hover { border-color: #BFDBFE; background: #F8FBFF; }
  .job-recommendation-label {
    min-width: 0;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
  }
  .job-recommendation-label small {
    display: block;
    margin-bottom: 2px;
    overflow: hidden;
    color: var(--faint);
    font-size: 9px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .job-recommendation-track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 2px;
    background: #EEF2F7;
  }
  .job-recommendation-bar {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #1E4E86, #3B82C4);
  }
  .job-recommendation-value {
    color: #173F6B;
    font-size: 16px;
    font-weight: 800;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .job-recommendation-value small { margin-left: 2px; color: var(--faint); font-size: 9px; font-weight: 500; }
  .job-recommendation-empty {
    display: grid;
    min-height: 152px;
    place-items: center;
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--faint);
    font-size: 12px;
    text-align: center;
  }
  .job-recommendation-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
    color: var(--faint);
    font-size: 10px;
    line-height: 1.5;
  }
  .job-recommendation-foot-start {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
  }
  .job-recommendation-toggle {
    display: inline-flex;
    min-height: 32px;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #B8CCE2;
    border-radius: 6px;
    background: var(--panel);
    color: #1D4F82;
    font-size: 11px;
    font-weight: 700;
  }
  .job-recommendation-toggle:hover { border-color: #7FA6CF; background: #F4F8FC; }
  .job-recommendation-toggle svg { width: 13px; height: 13px; }
  .job-recommendation-toggle[hidden] { display: none; }
  .job-recommendation-detail-note { min-width: 0; }
  .job-recommendation-dashboard:not(.is-expanded) .job-recommendation-detail-note { display: none; }
  .job-recommendation-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #BFDBFE;
    border-radius: 6px;
    background: #EFF6FF;
    color: #1D4F82;
    font-size: 11px;
    font-weight: 600;
  }
  .job-recommendation-action.has-unassigned {
    border-color: #F3C98B;
    background: #FFF7E8;
    color: #9A5A10;
  }
  .job-recommendation-action svg { width: 13px; height: 13px; }
  .recommendation-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(15, 39, 66, 0.22);
  }
  .recommendation-dialog::backdrop { background: rgba(15, 23, 42, 0.42); }
  .recommendation-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line-soft);
  }
  .recommendation-dialog-head h2 { font-size: 15px; font-weight: 700; }
  .recommendation-dialog-head p { margin-top: 4px; color: var(--muted); font-size: 11px; }
  .recommendation-dialog-close {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
  }
  .recommendation-dialog-close svg { width: 15px; height: 15px; }
  .recommendation-dialog-body {
    max-height: calc(100vh - 150px);
    padding: 16px 20px 20px;
    overflow-y: auto;
    background: #FBFAF8;
  }
  .recommendation-dialog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  .recommendation-dialog-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
  }
  .recommendation-event-list { display: flex; flex-direction: column; gap: 8px; }
  .recommendation-event-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
  }
  .recommendation-event-person { min-width: 0; }
  .recommendation-event-person strong { display: block; font-size: 12px; }
  .recommendation-event-person span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--faint);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .recommendation-event-controls { min-width: 0; }
  .recommendation-event-controls select {
    width: 100%;
    height: 34px;
    padding: 0 30px 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font-size: 10px;
  }
  .recommendation-event-state {
    margin-top: 4px;
    color: var(--faint);
    font-size: 9px;
  }
  .recommendation-event-save {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--navy);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
  }
  .recommendation-event-save:disabled { cursor: wait; opacity: 0.55; }
  .candidate-job-editor { display: flex; flex-direction: column; gap: 14px; }
  .candidate-job-editor select {
    width: 100%;
    height: 38px;
    padding: 0 32px 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    font-size: 11px;
  }
  .candidate-job-save {
    align-self: flex-end;
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 6px;
    background: var(--navy);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
  }
  .monthly-funnel-dashboard {
    min-width: 0;
    overflow: hidden;
  }
  .funnel-dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--line-soft);
  }
  .funnel-dashboard-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
  }
  .funnel-dashboard-title svg { width: 17px; height: 17px; color: var(--navy); }
  .funnel-reporting-period {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .funnel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
  }
  .funnel-control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .funnel-control-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--faint);
    letter-spacing: 0.03em;
  }
  .funnel-segmented {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
  }
  .funnel-segmented button {
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }
  .funnel-segmented button:hover { color: var(--navy); }
  .funnel-segmented button.is-active {
    background: var(--panel);
    color: var(--navy);
    box-shadow: 0 0 0 1px var(--line);
  }
  .funnel-segmented button:focus-visible,
  .funnel-filter-select:focus-visible,
  .funnel-detail-toggle:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
  }
  .funnel-filter-select {
    width: min(240px, 30vw);
    min-width: 170px;
    height: 34px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font-size: 11px;
  }
  .funnel-dashboard-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 18px 20px 20px;
    background: #FBFAF8;
  }
  .funnel-granularity-note {
    margin-top: -10px;
    color: var(--faint);
    font-size: 11px;
    line-height: 1.5;
  }
  .funnel-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .funnel-kpi-card {
    position: relative;
    min-width: 0;
    padding: 14px 14px 13px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--metric-color);
    border-radius: 8px;
    background: var(--panel);
  }
  .metric-recommend { --metric-color: #2563EB; --metric-tint: #EFF6FF; }
  .metric-interview { --metric-color: #7C3AED; --metric-tint: #F5F3FF; }
  .metric-onboard { --metric-color: #15803D; --metric-tint: #F0FDF4; }
  .metric-resign { --metric-color: #B91C1C; --metric-tint: #FEF2F2; }
  .funnel-kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .funnel-kpi-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }
  .funnel-kpi-label svg { width: 14px; height: 14px; color: var(--metric-color); }
  .funnel-kpi-month { color: var(--faint); font-size: 10px; }
  .funnel-kpi-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: 9px;
  }
  .funnel-kpi-value {
    color: var(--ink);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
  }
  .funnel-kpi-value span {
    margin-left: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
  }
  .funnel-kpi-delta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 7px;
    margin-top: 7px;
    font-size: 10px;
    line-height: 1.3;
  }
  .funnel-kpi-delta strong { font-size: 11px; font-variant-numeric: tabular-nums; }
  .tone-positive { color: #047857 !important; }
  .tone-negative { color: #B91C1C !important; }
  .tone-neutral { color: var(--faint) !important; }
  .funnel-sparkline { width: 116px; max-width: 46%; height: 38px; flex-shrink: 1; }
  .funnel-sparkline-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    max-width: 42%;
    height: 38px;
    border-bottom: 1px dashed var(--line);
    color: var(--faint);
    font-size: 9px;
  }
  .funnel-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
  }
  .funnel-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 8px;
  }
  .funnel-section-head h3 { color: var(--ink); font-size: 13px; font-weight: 700; }
  .funnel-section-head p { color: var(--faint); font-size: 10px; }
  .funnel-trend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border-top: 1px solid var(--line-soft);
    background: var(--line-soft);
  }
  .funnel-trend-card {
    min-width: 0;
    padding: 14px 16px 12px;
    background: var(--panel);
  }
  .funnel-trend-card:nth-child(-n+2) { border-bottom: 0; }
  .funnel-trend-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
  }
  .funnel-trend-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--metric-color);
  }
  .funnel-chart-canvas-wrap {
    position: relative;
    height: 184px;
  }
  .funnel-chart-canvas-wrap.is-unavailable::after {
    content: attr(data-unavailable-message);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--faint);
    font-size: 11px;
  }
  .funnel-empty-state {
    grid-column: 1 / -1;
    padding: 34px 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--faint);
    text-align: center;
    background: var(--panel);
  }
  .funnel-empty-state.compact { padding: 24px 16px; border: 0; }
  .funnel-conversion-content {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
    gap: 20px;
    padding: 10px 16px 16px;
  }
  .funnel-stage-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 0.78fr) 20px minmax(0, 0.56fr);
    align-items: center;
    gap: 5px;
  }
  .funnel-stage {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon label" "icon value";
    align-items: center;
    gap: 1px 9px;
    min-width: 0;
    padding: 13px 12px;
    border-left: 3px solid var(--metric-color);
    border-radius: 6px;
    background: var(--metric-tint);
  }
  .funnel-stage-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--metric-color);
    background: var(--panel);
  }
  .funnel-stage-icon svg { width: 15px; height: 15px; }
  .funnel-stage-label { grid-area: label; color: var(--muted); font-size: 10px; }
  .funnel-stage strong {
    grid-area: value;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
  }
  .funnel-stage strong small { margin-left: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
  .funnel-stage-arrow { width: 16px; height: 16px; color: var(--faint); }
  .funnel-rate-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line-soft);
    border-radius: 7px;
  }
  .funnel-rate-list > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    text-align: center;
  }
  .funnel-rate-list > div + div { border-left: 1px solid var(--line-soft); }
  .funnel-rate-list dt { color: var(--muted); font-size: 9px; line-height: 1.25; }
  .funnel-rate-list dd {
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .funnel-details {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
  }
  .funnel-detail-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .funnel-detail-toggle::-webkit-details-marker { display: none; }
  .funnel-detail-toggle svg { width: 15px; height: 15px; color: var(--muted); transition: transform 0.15s ease; }
  .funnel-details[open] .funnel-detail-toggle svg { transform: rotate(180deg); }
  .funnel-detail-caption {
    margin-left: auto;
    color: var(--faint);
    font-size: 10px;
    font-weight: 400;
  }
  .funnel-detail-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border-top: 1px solid var(--line-soft);
  }
  .funnel-detail-table th,
  .funnel-detail-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 10px;
    text-align: right;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
  }
  .funnel-detail-table thead th { color: var(--faint); font-weight: 600; background: #FBFAF8; }
  .funnel-detail-table th:first-child { width: 13%; text-align: left; }
  .funnel-detail-table tbody th { color: var(--ink); font-weight: 600; text-align: left; }
  .funnel-detail-table tbody tr.is-latest { background: #F8FAFC; }
  .funnel-detail-table tbody tr:last-child th,
  .funnel-detail-table tbody tr:last-child td { border-bottom: 0; }
  .funnel-detail-empty { padding: 24px !important; text-align: center !important; color: var(--faint) !important; }
  /* ===== Responsive（置於樣式表末端，確保覆蓋基礎規則） ===== */
  .ghost-button { white-space: nowrap; }
  .dept-table td:first-child { white-space: nowrap; }
  /* 管線區：主欄不夠寬時（右欄佔走 340px），圖表落到表格下方 */
  @media (max-width: 1599px) {
    .pipeline-grid { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 1279px) {
    .overview-layout { grid-template-columns: minmax(0, 1fr); }
    /* 焦點與月曆移到主內容下方，並排成全寬兩欄 */
    .overview-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    /* 右欄收走後主欄變寬，管線恢復並排 */
    .pipeline-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  }
  @media (max-width: 1023px) {
    /* 全部單欄：焦點、月曆各自全寬，今日面試表保留表格內橫向捲動 */
    .pipeline-grid { grid-template-columns: minmax(0, 1fr); }
    .overview-rail { grid-template-columns: minmax(0, 1fr); }
    .ops-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-item + .ops-item { border-left: 0; }
    .ops-item:nth-child(even) { border-left: 1px solid var(--line-soft); }
    .ops-item:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
    .funnel-dashboard-head { flex-direction: column; }
    .funnel-toolbar { width: 100%; justify-content: flex-start; }
    .funnel-filter-select { width: min(280px, 45vw); }
    .funnel-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .funnel-conversion-content { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 767px) {
    .dashboard-sidebar { width: 54px; }
    .dashboard-sidebar > div:first-child {
      justify-content: center;
      padding-left: 0;
      padding-right: 0;
    }
    .dashboard-sidebar > div:first-child > div:last-child,
    .dashboard-sidebar > div:last-child,
    .sidebar-caption { display: none; }
    .dashboard-sidebar > .p-3 { padding: 8px; }
    .dashboard-sidebar .menu-item {
      justify-content: center;
      gap: 0;
      min-height: 38px;
      padding: 8px;
      font-size: 0;
    }
    .dashboard-sidebar .menu-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
    .dashboard-sidebar .brand-mark { margin-right: 0; }
    .dashboard-topbar {
      height: 56px;
      padding-left: 12px;
      padding-right: 12px;
    }
    .dashboard-topbar > div:last-child { display: none; }
    .dashboard-topbar #page-title { font-size: 17px; }
    .dashboard-content { padding: 12px 10px 20px; }
    .analytics-grid { grid-template-columns: minmax(0, 1fr); }
    .analytics-span-full { grid-column: auto; }
    .job-recommendation-head { flex-direction: column; }
    .job-recommendation-period { width: 100%; }
    .job-recommendation-period .funnel-control-group { flex: 1; }
    .job-recommendation-select { width: 100%; }
    .job-recommendation-row {
      grid-template-columns: minmax(0, 1fr) 42px;
      gap: 8px;
    }
    .job-recommendation-track { grid-column: 1 / -1; grid-row: 2; }
    .job-recommendation-foot,
    .job-recommendation-foot-start { align-items: flex-start; flex-direction: column; }
    .job-recommendation-action { align-self: stretch; justify-content: center; }
    .recommendation-event-row { grid-template-columns: minmax(0, 1fr); }
    .recommendation-event-save { justify-self: end; }
    .funnel-dashboard-head { padding: 16px; }
    .funnel-dashboard-body { padding: 14px; gap: 14px; }
    .funnel-toolbar { align-items: stretch; }
    .funnel-control-group { flex: 1 1 100%; }
    .funnel-segmented { align-self: flex-start; }
    .funnel-filter-select { width: 100%; min-width: 0; }
    .funnel-kpi-grid,
    .funnel-trend-grid { grid-template-columns: minmax(0, 1fr); }
    .funnel-kpi-main { min-height: 66px; }
    .funnel-chart-canvas-wrap { height: 176px; }
    .funnel-stage-flow {
      grid-template-columns: minmax(0, 1fr);
      gap: 6px;
    }
    .funnel-stage-arrow { justify-self: center; transform: rotate(90deg); }
    .funnel-rate-list { grid-template-columns: minmax(0, 1fr); }
    .funnel-rate-list > div { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
    .funnel-rate-list > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
    .funnel-detail-caption { display: none; }
    .funnel-detail-table thead { display: none; }
    .funnel-detail-table,
    .funnel-detail-table tbody,
    .funnel-detail-table tr,
    .funnel-detail-table th,
    .funnel-detail-table td { display: block; width: 100%; }
    .funnel-detail-table tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
    .funnel-detail-table th,
    .funnel-detail-table td {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 5px 0;
      border-bottom: 0;
      text-align: right;
    }
    .funnel-detail-table th::before,
    .funnel-detail-table td::before {
      content: attr(data-label);
      color: var(--faint);
      font-weight: 500;
      text-align: left;
    }
  }
