:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --nav-bg: #111827;
  --nav-muted: #94a3b8;
  --page-bg: #f3f6fa;
  --surface: #ffffff;
  --line: #e2e8f0;
  --text: #172033;
  --muted: #64748b;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 10px;
}

html { font-size: 15px; min-height: 100%; }
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; color: var(--text); font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif; background: var(--page-bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 18px; background: var(--nav-bg); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 32px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 9px; background: var(--brand); }
.brand-mark svg { width: 25px; fill: #fff; }
.brand strong, .brand small { display: block; line-height: 1.25; }
.brand strong { font-size: 16px; letter-spacing: .04em; }
.brand small { margin-top: 3px; color: var(--nav-muted); font-size: 11px; letter-spacing: .18em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-section-title { margin: 17px 12px 7px; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.nav-section-title:first-child { margin-top: 0; }
.sidebar-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 13px; border-radius: 8px; color: var(--nav-muted); font-size: 14px; font-weight: 500; }
.sidebar-link svg { width: 19px; height: 19px; flex: 0 0 19px; fill: currentColor; }
.sidebar-link:hover { color: #fff; background: #1f2937; }
.sidebar-link.active { color: #fff; background: var(--brand); }
.sidebar-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid #263244; color: #64748b; font-size: 11px; }

.app-workspace { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.app-topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.app-topbar strong, .topbar-eyebrow { display: block; }
.app-topbar strong { font-size: 16px; }
.topbar-eyebrow { margin-bottom: 2px; color: var(--muted); font-size: 11px; }
.topbar-account { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.topbar-account a, .topbar-account button { color: var(--muted); }
.topbar-account a:hover, .topbar-account button:hover { color: var(--brand); }
.topbar-account form { margin: 0; }
.topbar-account button { padding: 0; border: 0; background: transparent; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.user-name { color: var(--text); font-weight: 600; }
.app-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 30px 32px 44px; flex: 1; }
.app-footer { padding: 16px 32px; color: #94a3b8; font-size: 12px; text-align: center; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0 0 5px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.surface-panel, .filter-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.surface-panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 55px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 15px; font-weight: 700; }
.panel-heading small { color: var(--muted); }
.panel-body { padding: 20px; }
.filter-panel { padding: 15px; margin-bottom: 18px; }

.stat-card { position: relative; min-height: 126px; padding: 21px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { margin-top: 9px; font-size: 32px; line-height: 1; font-weight: 750; letter-spacing: -.04em; }
.stat-meta { margin-top: 11px; color: #94a3b8; font-size: 11px; }
.stat-mark { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 9px; background: var(--brand-soft); }
.stat-mark::before { content: ""; position: absolute; inset: 11px; border: 2px solid var(--brand); border-radius: 4px; }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.warning .stat-mark { background: #fff7ed; }
.stat-card.warning .stat-mark::before { border-color: var(--warning); border-radius: 50%; }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.danger .stat-mark { background: #fef2f2; }
.stat-card.danger .stat-mark::before { border-color: var(--danger); transform: rotate(45deg); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.success .stat-mark { background: #ecfdf5; }
.stat-card.success .stat-mark::before { border-color: var(--success); }

.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none !important; }
.card-header { padding: 13px 18px; border-color: var(--line); background: #f8fafc; }
.card-body { padding: 22px; }
.list-group { border-radius: 0; }
.list-group-item { padding: 13px 18px; border-color: var(--line); }
.list-group-item-action:hover { background: #f8fafc; }

.table-responsive { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { margin: 0; color: var(--text); }
.table > :not(caption) > * > * { padding: 13px 15px; border-bottom-color: var(--line); vertical-align: middle; }
.table thead th { border-top: 0; border-bottom-width: 1px; color: #526176; background: #f8fafc !important; font-size: 12px; font-weight: 700; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover > * { background: #f8fbff; }
.table-bordered > :not(caption) > * { border-width: 0; }
.table-bordered > :not(caption) > * > * { border-right: 0; border-left: 0; }
.table-sm > :not(caption) > * > * { padding: 10px 12px; }
.surface-panel .table-responsive { border: 0; border-radius: 0; }
.surface-panel > .table, .tab-pane > .table { border: 1px solid var(--line); border-radius: var(--radius); }

.btn { min-height: 38px; padding: 7px 15px; border-radius: 7px; font-size: 13px; font-weight: 600; box-shadow: none !important; }
.btn-sm { min-height: 32px; padding: 5px 11px; }
.btn-primary { border-color: var(--brand); background: var(--brand); }
.btn-primary:hover, .btn-primary:focus { border-color: var(--brand-dark); background: var(--brand-dark); }
.btn-outline-primary { color: var(--brand); border-color: #b9cdfb; }
.btn-outline-primary:hover { border-color: var(--brand); background: var(--brand); }
.btn-secondary, .btn-outline-secondary { color: #475569; border-color: #cbd5e1; background: #fff; }
.btn-secondary:hover, .btn-outline-secondary:hover { color: var(--text); border-color: #94a3b8; background: #f8fafc; }
.btn-link { min-height: 0; padding: 0; border: 0; }

.form-label { margin-bottom: 7px; color: #475569; font-size: 12px; font-weight: 700; }
.form-control, .form-select { min-height: 40px; border-color: #cbd5e1; border-radius: 7px; color: var(--text); font-size: 13px; }
.form-control::placeholder { color: #94a3b8; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #7da5f7; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.form-control { min-height: 82px; }
.form-check-input:checked { border-color: var(--brand); background-color: var(--brand); }
.form-text, .text-muted { color: var(--muted) !important; }

.nav-tabs { gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); }
.nav-tabs .nav-link { padding: 9px 15px; border: 0; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.nav-tabs .nav-link:hover { color: var(--text); background: #f1f5f9; }
.nav-tabs .nav-link.active { color: var(--brand); background: var(--brand-soft); }
.tab-content { border-color: var(--line) !important; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); }
.tab-pane dl dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.tab-pane dl dd { min-height: 36px; margin-bottom: 10px; color: var(--text); }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 999px; color: #1e40af; background: #dbeafe; font-size: 11px; font-weight: 700; }
.person-cell strong, .person-cell small { display: block; }
.person-cell small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.cv-sheet { max-width: 1400px; margin: 0 auto; padding: 34px; border: 1px solid #d5dce5; border-radius: 4px; background: #fff; }
.cv-title { position: relative; padding: 2px 0 26px; text-align: center; }
.cv-title h2 { margin: 0 0 4px; color: #111827; font-size: 27px; font-weight: 750; letter-spacing: .12em; }
.cv-title p { margin: 0; color: #475569; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.cv-document-no { position: absolute; top: 8px; right: 0; color: #64748b; font-size: 10px; letter-spacing: .04em; }
.cv-section { margin-top: 26px; }
.cv-section:first-of-type { margin-top: 0; }
.cv-section-heading { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 2px 9px; }
.cv-section-heading h3, .cv-section-heading span { display: inline; margin: 0; }
.cv-section-heading h3 { color: #111827; font-size: 16px; font-weight: 750; }
.cv-section-heading span { margin-left: 8px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.cv-table-wrap { border-color: #aeb8c5; border-radius: 2px; }
.cv-table { width: 100%; margin: 0; border-collapse: collapse; color: #1e293b; font-size: 12px; table-layout: fixed; }
.cv-table th, .cv-table td { padding: 9px 10px; border-right: 1px solid #c5cdd7; border-bottom: 1px solid #c5cdd7; vertical-align: middle; word-break: break-word; }
.cv-table tr:last-child > * { border-bottom: 0; }
.cv-table tr > *:last-child { border-right: 0; }
.cv-table thead th { color: #1e293b; background: #eaf0f7; text-align: center; font-size: 11px; }
.cv-table th b, .cv-table th small, .cv-table thead small { display: block; }
.cv-table th b { font-size: 12px; }
.cv-table th small, .cv-table thead small { margin-top: 2px; color: #64748b; font-size: 9px; font-weight: 600; letter-spacing: .02em; }
.cv-info-table th { width: 14%; background: #f4f7fa; }
.cv-info-table td { width: 24%; }
.cv-info-table .cv-photo-cell { width: 16%; padding: 10px; text-align: center; border-left: 1px solid #c5cdd7; border-bottom: 1px solid #c5cdd7; }
.cv-value-strong { font-size: 15px; font-weight: 700; }
.cv-photo-cell img { display: block; width: 100%; max-width: 118px; height: 148px; margin: 0 auto; object-fit: cover; border: 1px solid #cbd5e1; }
.cv-photo-placeholder { display: grid; width: 100%; max-width: 118px; height: 148px; margin: 0 auto; place-content: center; border: 1px dashed #aeb8c5; color: #64748b; background: #f8fafc; }
.cv-photo-placeholder span, .cv-photo-placeholder small { display: block; }
.cv-photo-placeholder span { font-size: 15px; }
.cv-photo-placeholder small { margin-top: 4px; font-size: 9px; }
.cv-photo-action { display: block; margin-top: 8px; font-size: 11px; }
.cv-cell-note { display: block; margin-top: 4px; color: #64748b; font-size: 10px; }
.cv-empty { padding: 24px !important; color: #64748b; text-align: center; }
.cv-interviews div { padding: 3px 0; border-bottom: 1px dotted #d5dce5; }
.cv-interviews div:last-child { border-bottom: 0; }
.cv-interviews a { margin-left: 6px; font-size: 10px; }
.cv-actions { width: 84px; text-align: center; white-space: nowrap; }
.cv-actions a, .cv-actions form, .cv-actions button { display: inline; }
.cv-actions a, .cv-actions button { margin: 0 3px; padding: 0; border: 0; color: var(--brand); background: transparent; font-size: 11px; }
.cv-actions button { color: var(--danger); }

.alert { border: 0; border-radius: 8px; font-size: 13px; }
.app-alert { margin-bottom: 20px; padding: 12px 16px; }
.alert-success { color: #065f46; background: #d1fae5; }
.alert-danger { color: #991b1b; background: #fee2e2; }
.validation-summary-valid { display: none; }
.text-danger { color: var(--danger) !important; }

.auth-body { background: #eaf0f7; }
.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 30px; }
.login-layout { display: grid; width: min(920px, 100%); min-height: 540px; grid-template-columns: 1.05fr .95fr; overflow: hidden; border: 1px solid #dbe3ee; border-radius: 16px; background: #fff; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; overflow: hidden; color: #fff; background: #14233d; }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.login-brand::before { width: 330px; height: 330px; top: -140px; right: -110px; }
.login-brand::after { width: 210px; height: 210px; top: -75px; right: -50px; }
.login-brand-mark { position: absolute; top: 46px; left: 48px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--brand); font-size: 22px; }
.login-brand h1 { position: relative; margin: 0 0 13px; font-size: 30px; font-weight: 750; }
.login-brand p { position: relative; max-width: 310px; margin: 0; color: #b8c5d8; line-height: 1.8; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 52px; }
.login-panel h2 { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.login-panel > p { margin-bottom: 30px; color: var(--muted); font-size: 13px; }
.login-panel .btn { min-height: 43px; }
.login-note { margin-top: 22px; color: #94a3b8; font-size: 11px; text-align: center; }

@media (max-width: 991.98px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: static; height: auto; padding: 15px 18px; }
  .brand { margin: 0 0 14px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .brand-mark svg { width: 21px; }
  .brand small, .nav-section-title, .sidebar-foot { display: none; }
  .sidebar-nav { display: flex; flex-direction: row; flex-wrap: wrap; }
  .sidebar-link { min-height: 38px; padding: 0 11px; }
  .sidebar-link svg { width: 16px; height: 16px; }
  .app-topbar { height: 62px; padding: 0 20px; }
  .app-content { padding: 24px 20px 36px; }
}

@media (max-width: 767.98px) {
  html { font-size: 14px; }
  .app-topbar > div:first-child, .user-name { display: none; }
  .app-topbar { justify-content: flex-end; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-actions .btn { flex: 1; }
  .login-layout { min-height: auto; grid-template-columns: 1fr; }
  .login-brand { min-height: 190px; padding: 34px; }
  .login-brand-mark { top: 28px; left: 34px; }
  .login-brand h1 { font-size: 24px; }
  .login-brand p { display: none; }
  .login-panel { padding: 36px 28px; }
  .cv-sheet { padding: 20px 16px; }
  .cv-title { text-align: left; }
  .cv-title h2 { font-size: 22px; }
  .cv-document-no { position: static; margin-bottom: 14px; }
  .cv-section-heading { align-items: flex-start; }
  .cv-info-table { min-width: 760px; }
  .cv-table { min-width: 840px; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { color: #000; background: #fff; }
  .app-sidebar, .app-topbar, .app-footer, .cv-page-heading, .print-hidden { display: none !important; }
  .app-shell, .app-workspace { display: block; min-height: 0; }
  .app-content { max-width: none; padding: 0; }
  .cv-sheet { max-width: none; padding: 0; border: 0; }
  .cv-section { break-inside: avoid; margin-top: 18px; }
  .cv-title { padding-bottom: 16px; }
  .cv-table-wrap { overflow: visible; }
  .cv-table { min-width: 0; font-size: 9px; }
  .cv-table th, .cv-table td { padding: 5px 6px; }
  .cv-table th small, .cv-table thead small { color: #333 !important; font-size: 7px; }
  .status-badge { color: #000; border: 1px solid #888; background: #fff; }
}
