.boot-screen, .login-page { min-height: 100vh; display: grid; place-items: center; }
.boot-screen { align-content: center; color: var(--ink-500); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #ef4d42, var(--brand-700)); font-weight: 800; box-shadow: 0 8px 20px rgba(217,45,32,.24); }
.boot-screen .brand-mark { width: 52px; height: 52px; border-radius: 14px; }

.login-page { grid-template-columns: minmax(420px, 1.05fr) minmax(390px, .95fr); background: #fff; }
.login-context { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(42px, 6vw, 84px); color: #fff; background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.18), transparent 30%), linear-gradient(145deg, #8f1b15, #d92d20 56%, #f97066); }
.login-context h1 { max-width: 700px; margin: 22px 0 16px; font-size: clamp(34px, 4.1vw, 58px); line-height: 1.1; letter-spacing: -.035em; }
.login-context p { max-width: 630px; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.8; }
.eyebrow { font-size: 12px; font-weight: 750; letter-spacing: .12em; }
.truth-points { display: grid; gap: 10px; max-width: 650px; }
.truth-point { padding: 13px 15px; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-md); background: rgba(255,255,255,.08); }
.truth-point b, .truth-point span { display: block; }
.truth-point span { margin-top: 3px; color: rgba(255,255,255,.74); font-size: 12px; line-height: 1.6; }
.login-panel { width: min(420px, calc(100% - 42px)); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 38px; }
.login-brand b, .login-brand small { display: block; }
.login-brand small { color: var(--ink-500); }
.login-panel h2 { margin: 0 0 8px; font-size: 28px; }
.login-panel > p { margin: 0 0 26px; color: var(--ink-500); line-height: 1.7; }
.field { display: grid; gap: 7px; margin-bottom: 16px; color: var(--ink-700); font-size: 13px; font-weight: 650; }
.field input, .field select, .field textarea, .control { width: 100%; min-height: 38px; border: 1px solid #cfd5dc; border-radius: 7px; color: var(--ink-800); background: #fff; }
.field input, .control { padding: 0 11px; }
.field textarea { min-height: 88px; padding: 10px 11px; resize: vertical; }
.login-submit, .button-primary, .button-secondary, .button-quiet, .icon-button { min-height: 34px; border-radius: 7px; font-weight: 650; }
.login-submit, .button-primary { border: 1px solid var(--brand-600); color: #fff; background: var(--brand-600); }
.login-submit { width: 100%; min-height: 44px; }
.button-primary, .button-secondary, .button-quiet { padding: 0 12px; }
.button-secondary { border: 1px solid #cfd5dc; color: var(--ink-700); background: #fff; }
.button-quiet { border: 1px solid transparent; color: var(--ink-600); background: transparent; }
.login-submit:disabled, button:disabled { opacity: .55; cursor: not-allowed; }
.credential-note, .login-error { margin-top: 14px; padding: 11px 12px; border-radius: 7px; font-size: 12px; line-height: 1.6; }
.credential-note { color: var(--amber-800); background: var(--amber-50); }
.login-error { color: var(--danger-700); background: var(--danger-50); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; display: flex; flex-direction: column; overflow: hidden; color: #d0d5dd; background: var(--sidebar); }
.side-brand { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 11px 15px; border-bottom: 1px solid #293343; color: #fff; }
.side-brand b, .side-brand small { display: block; }
.side-brand small { margin-top: 2px; color: #98a2b3; font-size: 10px; }
.nav-scroll { flex: 1; overflow: auto; padding: 10px 9px; }
.nav-group + .nav-group { margin-top: 12px; }
.nav-group-label { padding: 7px 9px 5px; color: #7f8998; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.nav-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; margin: 2px 0; padding: 0 10px; border: 0; border-radius: 7px; color: #c8d0dc; background: transparent; text-align: left; }
.nav-item:hover { color: #fff; background: #293445; }
.nav-item.active { color: #fff; background: var(--sidebar-active); }
.nav-icon { width: 20px; color: #98a2b3; text-align: center; font-size: 13px; }
.nav-item.active .nav-icon { color: #fda29b; }
.sidebar-foot { padding: 11px 14px; border-top: 1px solid #293343; }
.sidebar-foot b, .sidebar-foot span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot span { margin-top: 2px; color: #98a2b3; font-size: 11px; }
.logout { margin-top: 8px; padding: 0; border: 0; color: #c8d0dc; background: transparent; font-size: 12px; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.global-search { position: relative; flex: 1; max-width: 480px; }
.global-search input { width: 100%; height: 36px; padding: 0 34px 0 12px; border: 1px solid #cfd5dc; border-radius: 8px; background: var(--soft); }
.global-search kbd { position: absolute; right: 9px; top: 8px; color: var(--ink-400); font-size: 10px; }
.top-select { width: min(210px, 19vw); height: 36px; padding: 0 9px; border: 1px solid #cfd5dc; border-radius: 7px; background: #fff; }
.top-task { min-height: 36px; padding: 0 10px; border: 1px solid #cfd5dc; border-radius: 7px; color: var(--ink-700); background: #fff; white-space: nowrap; }
.mode-label { padding: 5px 8px; border-radius: 999px; color: var(--amber-800); background: #fff3d6; font-size: 10px; font-weight: 750; white-space: nowrap; }
.content { padding: 18px 20px 28px; }
.page-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 13px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--ink-500); font-size: 12px; line-height: 1.55; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.subnav { display: flex; gap: 3px; margin-bottom: 12px; padding: 3px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.subnav button { min-height: 31px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--ink-600); background: transparent; white-space: nowrap; font-size: 12px; }
.subnav button.active { color: var(--brand-700); background: var(--brand-100); font-weight: 700; }
.truth-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #fedf89; border-radius: 8px; color: #7a2e0e; background: var(--amber-50); font-size: 12px; line-height: 1.55; }
.truth-banner b, .truth-banner span { display: block; }
.truth-banner span { color: #98520b; }

.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); box-shadow: 0 1px 2px rgba(16,24,40,.025); }
.metric-card { min-height: 102px; padding: 13px 14px; }
.metric-card span, .metric-card small { display: block; color: var(--ink-500); font-size: 11px; }
.metric-card b { display: block; margin: 8px 0 5px; font-size: 23px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.7fr); gap: 12px; }
.dashboard-grid + .dashboard-grid, .dashboard-grid + .panel, .panel + .dashboard-grid { margin-top: 12px; }
.trend-chart { min-height: 220px; display: flex; align-items: flex-end; gap: 5px; padding: 18px 12px 10px; overflow-x: auto; }
.trend-column { min-width: 18px; height: 180px; flex: 1 0 18px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.trend-column i { width: min(22px,80%); min-height: 3px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg,var(--brand-600),#f97066); }
.trend-column small { color: var(--ink-400); font-size: 8px; writing-mode: vertical-rl; }
.ranking-list { display: grid; gap: 8px; margin: 0; padding-left: 24px; }
.ranking-list li { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 7px; background: var(--soft); font-size: 11px; }
.ranking-list b { color: var(--ink-800); }
.ranking-list small { color: var(--ink-500); }
.role-work-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.role-work-card { min-height: 108px; display: grid; gap: 5px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink-700); background: #fff; text-align: left; }
.role-work-card:hover { border-color: #fda29b; box-shadow: 0 4px 14px rgba(217,45,32,.08); }
.role-work-card span, .role-work-card b, .role-work-card small { display: block; }
.role-work-card b { color: var(--brand-700); font-size: 24px; }
.role-work-card small { color: var(--ink-500); }
.privacy-strip { margin-bottom: 12px; padding: 9px 12px; border: 1px solid #b2ddff; border-radius: 8px; color: var(--blue-700); background: var(--blue-50); font-size: 12px; }
.big-state { display: grid; place-items: center; min-height: 140px; color: var(--danger-700); font-size: 38px; font-weight: 800; }
.big-state small { display: block; color: var(--ink-500); font-size: 11px; font-weight: 500; }
.panel { overflow: hidden; }
.panel-head { min-height: 48px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-head small { display: block; margin-top: 2px; color: var(--ink-500); font-size: 10px; }
.panel-body { padding: 12px; }
.filter-bar { display: grid; grid-template-columns: minmax(180px,1.2fr) repeat(3,minmax(120px,.65fr)) auto; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); background: var(--soft); }
.filter-bar input, .filter-bar select { width: 100%; height: 32px; padding: 0 9px; border: 1px solid #cfd5dc; border-radius: 6px; background: #fff; font-size: 12px; }
.batch-bar { min-height: 42px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.batch-count { margin-right: auto; color: var(--ink-500); font-size: 11px; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.data-table th, .data-table td { height: 40px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; font-size: 12px; }
.data-table th { position: sticky; top: 0; z-index: 1; color: var(--ink-500); background: #fafbfc; font-weight: 700; white-space: nowrap; }
.data-table td { color: var(--ink-700); }
.data-table tbody tr:hover { background: #fafbfc; }
.row-main { color: var(--ink-800); font-weight: 650; }
.row-sub { display: block; margin-top: 2px; color: var(--ink-500); font-size: 10px; }
.row-open { padding: 3px 0; border: 0; color: var(--blue-700); background: transparent; font-size: 12px; }
.pagination { min-height: 45px; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 10px; color: var(--ink-500); font-size: 11px; }
.pagination-controls { display: flex; align-items: center; gap: 5px; }
.pagination button { min-width: 30px; height: 29px; border: 1px solid #cfd5dc; border-radius: 6px; background: #fff; }
.empty-state { min-height: 220px; display: grid; place-items: center; padding: 30px; color: var(--ink-500); text-align: center; }
.empty-state b, .empty-state span { display: block; }
.empty-state b { color: var(--ink-700); }
.empty-state span { max-width: 480px; margin-top: 5px; font-size: 12px; line-height: 1.65; }
.error-state { color: var(--danger-700); background: var(--danger-50); }
.badge { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.local { color: var(--blue-700); background: var(--blue-50); }
.badge.simulated { color: var(--purple-700); background: var(--purple-50); }
.badge.success { color: var(--green-700); background: var(--green-50); }
.badge.warning { color: var(--amber-800); background: #fff3d6; }
.badge.danger { color: var(--danger-700); background: var(--danger-50); }
.badge.neutral { color: var(--ink-600); background: #f2f4f7; }
.task-list, .timeline { display: grid; gap: 8px; }
.task-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 7px; }
.task-item b, .task-item span, .task-item small { display: block; }
.task-item span { margin-top: 3px; color: var(--ink-500); font-size: 11px; }
.task-item small { margin-top: 5px; color: var(--ink-400); }
.progress { width: 120px; height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #eaecf0; }
.progress i { display: block; height: 100%; background: var(--blue-700); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(16,24,40,.34); }
.detail-drawer { position: fixed; top: 0; right: 0; z-index: 41; width: min(560px, 100vw); height: 100vh; display: flex; flex-direction: column; background: #fff; box-shadow: -18px 0 42px rgba(16,24,40,.18); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0 0 4px; font-size: 18px; }
.drawer-head p { margin: 0; color: var(--ink-500); font-size: 11px; }
.icon-button { width: 34px; border: 1px solid #cfd5dc; color: var(--ink-700); background: #fff; }
.drawer-body { flex: 1; overflow: auto; padding: 16px; }
.action-form { display: grid; gap: 13px; }
.action-form .field { display: grid; gap: 6px; color: var(--ink-700); font-size: 12px; font-weight: 650; }
.action-form .field input, .action-form .field select, .action-form .field textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #cfd5dc; border-radius: 7px; color: var(--ink-800); background: #fff; font: inherit; font-weight: 400; }
.action-form .field textarea { resize: vertical; line-height: 1.55; }
.action-form .field small { color: var(--ink-500); font-weight: 400; line-height: 1.5; }
.form-actions, .drawer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.drawer-actions { margin-bottom: 18px; }
.button-danger { min-height: 34px; padding: 0 11px; border: 1px solid #fecdca; border-radius: 7px; color: var(--danger-700); background: var(--danger-50); }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 7px; color: var(--ink-700); background: var(--soft); font-size: 11px; font-weight: 500; line-height: 1.45; }
.check-row input { flex: 0 0 auto; margin-top: 2px; }
.stepper { display: grid; grid-template-columns: repeat(8,1fr); gap: 5px; margin-bottom: 16px; }
.stepper span { display: grid; place-items: center; height: 28px; border-radius: 6px; color: var(--ink-500); background: var(--soft); font-size: 11px; }
.stepper span.active { color: #fff; background: var(--blue-700); }
.review-card { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.review-card b, .review-card p { display: block; margin: 0 0 8px; }
.review-card pre { max-height: 330px; overflow: auto; padding: 10px; border-radius: 6px; background: #101828; color: #d0d5dd; font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.candidate-evidence-list { display: grid; gap: 14px; }
.candidate-compare { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 10px; }
.candidate-compare pre, .candidate-evidence-list pre { max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.json-preview { max-height: 480px; overflow: auto; padding: 12px; border-radius: 7px; background: #101828; color: #d0d5dd; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 18px; }
.detail-field { padding: 9px 10px; border-radius: 7px; background: var(--soft); }
.detail-field b, .detail-field span { display: block; }
.detail-field b { color: var(--ink-500); font-size: 10px; }
.detail-field span { margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.timeline { position: relative; padding-left: 15px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 10px 8px; }
.timeline-item::before { content: ""; position: absolute; left: -15px; top: 4px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--blue-700); box-shadow: 0 0 0 1px var(--blue-700); }
.timeline-item b, .timeline-item span, .timeline-item small { display: block; }
.timeline-item b { font-size: 12px; }
.timeline-item span { margin-top: 2px; color: var(--ink-600); font-size: 11px; line-height: 1.55; }
.timeline-item small { margin-top: 2px; color: var(--ink-400); font-size: 10px; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; }
.toast { max-width: 390px; padding: 11px 13px; border-radius: 8px; color: #fff; background: #253149; box-shadow: var(--shadow-md); font-size: 12px; }
.toast.danger { background: #8f1b15; }

@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 214px minmax(0,1fr); }
  .content { padding-inline: 16px; }
  .filter-bar { grid-template-columns: minmax(170px,1fr) repeat(2,minmax(115px,.6fr)) auto; }
  .filter-bar > :nth-child(4) { display: none; }
}
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .role-work-grid { grid-template-columns: 1fr; }
  .mode-label { display: none; }
}
@media (max-width: 820px) {
  .candidate-compare { grid-template-columns: 1fr; }
  .login-page { display: block; padding: 48px 0; }
  .login-context { display: none; }
  .login-panel { margin: 5vh auto 0; }
  .app-shell { grid-template-columns: 64px minmax(0,1fr); }
  .side-brand { justify-content: center; padding-inline: 8px; }
  .side-brand > div, .nav-group-label, .nav-item span:last-child, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .topbar { flex-wrap: wrap; padding: 8px 12px; }
  .global-search { order: 3; flex-basis: 100%; max-width: none; }
  .top-select { flex: 1; width: auto; }
  .content { padding: 14px 12px 24px; }
  .filter-bar { grid-template-columns: minmax(150px,1fr) minmax(110px,.7fr) auto; }
  .filter-bar > :nth-child(3) { display: none; }
  .page-head { align-items: center; }
}
@media (max-width: 590px) {
  .metric-grid { grid-template-columns: 1fr; }
  .page-head { display: block; }
  .page-actions { margin-top: 10px; }
  .filter-bar { grid-template-columns: 1fr auto; }
  .filter-bar > :nth-child(2) { display: none; }
  .batch-bar { flex-wrap: wrap; }
  .batch-count { flex-basis: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}
