/* HunterBase global UI refresh — brings the whole product to the Smart Match reading scale. */
:root {
  --bg: #07090c;
  --surface: #0a0d11;
  --card: #0f1318;
  --card2: #141920;
  --line: rgba(148, 163, 184, 0.12);
  --line2: rgba(148, 163, 184, 0.23);
  --text: #f1f5f9;
  --muted: #8b96a7;
  --muted2: #bac3d0;
  --blue: #268cff;
  --radius: 10px;
  --sidebar: 252px;
  --shadow-card: 0 16px 42px rgba(0, 0, 0, 0.16);
}

html { font-size: 16px; }
body {
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  background:
    radial-gradient(circle at 76% -12%, rgba(38, 140, 255, 0.08), transparent 28rem),
    var(--surface);
}
button, input, select, textarea { line-height: 1.4; }
:focus-visible { outline: 2px solid rgba(38, 140, 255, 0.9); outline-offset: 2px; }

/* Navigation and shell */
.sidebar {
  background: linear-gradient(180deg, #07090c 0%, #090b0f 100%);
  border-right-color: rgba(148, 163, 184, 0.13);
}
.brand { height: 88px; padding: 0 26px; font-size: 21px; }
.nav { padding: 10px 14px; gap: 5px; }
.nav-label { padding: 16px 12px 8px; color: #596273; font-size: 10px; }
.nav-item {
  height: 48px;
  gap: 13px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #8994a5;
  font-size: 14px;
}
.nav-item:hover { color: #e9eef5; background: rgba(255,255,255,.035); }
.nav-item.active {
  color: #fff;
  border-color: rgba(38,140,255,.2);
  background: linear-gradient(90deg, rgba(38,140,255,.14), rgba(38,140,255,.035));
  box-shadow: inset 0 0 24px rgba(38,140,255,.035);
}
.nav-item.active::before { left: -14px; width: 3px; height: 28px; border-radius: 0 4px 4px 0; }
.nav-count { padding: 3px 7px; background: rgba(148,163,184,.1); color: #a4afbd; font-size: 10px; }
.side-user { padding: 18px; gap: 12px; }
.avatar { width: 38px; height: 38px; }
.user-name { font-size: 13px; }
.user-role { color: #758092; font-size: 11px; }
.account-menu { width: 242px; border-radius: 12px; box-shadow: 0 26px 80px rgba(0,0,0,.48); }
.account-menu-copy span, .account-menu-item { font-size: 12px; }
.account-menu-item { height: 42px; border-radius: 7px; }

.topbar {
  height: 68px;
  padding: 0 clamp(22px, 2.4vw, 38px);
  background: rgba(10,13,17,.84);
  border-bottom-color: rgba(148,163,184,.12);
  backdrop-filter: blur(22px) saturate(1.15);
}
.breadcrumb { color: #697486; font-size: 11px; }
.breadcrumb b { color: #c2cad5; }
.top-search { width: min(340px, 30vw); height: 40px; border-radius: 8px; background: rgba(255,255,255,.025); }
.top-search input { font-size: 13px; }
.icon-btn { width: 40px; height: 40px; border-radius: 8px; }
.content { max-width: 1500px; padding: 42px clamp(24px, 3vw, 48px) 72px; }

/* Global type hierarchy and controls */
.page-head { gap: 24px; margin-bottom: 32px; }
.page-head h1 { margin-top: 6px; font-size: clamp(32px, 2.6vw, 40px); line-height: 1.12; font-weight: 650; }
.eyebrow { font-size: 11px; letter-spacing: .18em; }
.page-sub { max-width: 720px; margin-top: 10px; color: #8792a2; font-size: 14px; line-height: 1.7; }
.btn {
  min-height: 42px;
  height: 42px;
  padding: 0 17px;
  border-radius: 8px;
  color: #d7dde6;
  font-size: 13px;
  transition: border-color .16s, background .16s, transform .16s, box-shadow .16s;
}
.btn:hover { border-color: rgba(148,163,184,.42); background: rgba(255,255,255,.045); transform: translateY(-1px); }
.btn.primary { box-shadow: 0 9px 26px rgba(38,140,255,.16); }
.btn.primary:hover { box-shadow: 0 12px 32px rgba(38,140,255,.23); }
.btn.small { min-height: 34px; height: 34px; padding: 0 12px; font-size: 12px; border-radius: 7px; }
.input, .select, .search-box, .match-job-select {
  min-height: 44px;
  height: 44px;
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(7,9,12,.78);
  color: #dce3ec;
  font-size: 13px;
}
.search-box { padding: 0 14px; }
.search-box input { font-size: 13px; }
.field label { margin-bottom: 8px; color: #929dae; font-size: 12px; }
textarea.input { min-height: 112px; height: auto; padding-top: 12px; line-height: 1.65; }

/* Shared surfaces */
.panel, .metric, .dashboard-kpi, .health-card, .client-kpi, .client-card,
.client-job-card, .candidate-card, .settings-section, .tag-tree, .tag-detail,
.table-wrap, .match-command, .match-layout {
  border-color: var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16,20,26,.98), rgba(13,17,22,.98));
  box-shadow: var(--shadow-card);
}
.panel-head { height: 64px; padding: 0 20px; }
.panel-title { font-size: 15px; }
.panel-meta { color: #687385; font-size: 10px; }
.text-link { font-size: 12px; }

/* Dashboard */
.dashboard-kpis { gap: 14px; margin-bottom: 18px; }
.dashboard-kpi { min-height: 136px; padding: 20px; }
.dashboard-kpi:hover { background: #141920; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.dashboard-kpi-label { color: #9aa5b5; font-size: 13px; }
.dashboard-kpi-value { margin: 20px 0 11px; font-size: 34px; }
.dashboard-kpi-foot { color: #778294; font-size: 11px; }
.dashboard-kpi-foot b { color: #c0c8d3; }
.dashboard-workspace, .dashboard-stack { gap: 16px; }
.trust-briefing { border-radius: var(--radius); box-shadow: var(--shadow-card); }
.trust-briefing-head b, .trust-section-head b { font-size: 15px; }
.trust-briefing-head span, .trust-section-head span { font-size: 12px; }
.trust-briefing-list { gap: 10px; }
.trust-action { min-height: 112px; padding: 15px; border-radius: 8px; }
.trust-action b { font-size: 13px; }
.trust-action p { color: #8a95a5; font-size: 12px; line-height: 1.65; }
.trust-action small { color: #717d8f; font-size: 11px; }
.work-item { min-height: 76px; padding: 14px 20px; }
.work-copy b, .activity-copy b { font-size: 13px; }
.work-copy span, .activity-copy span { color: #7f8a9b; font-size: 11px; line-height: 1.55; }
.quick-panel h3 { font-size: 17px; }
.quick-panel > p { color: #7b8798; font-size: 12px; }
.dashboard-shortcut { min-height: 78px; padding: 15px; border-radius: 8px; }
.dashboard-shortcut b { font-size: 13px; }
.dashboard-shortcut span { color: #788495; font-size: 11px; }
.activity-time, .sync-summary, .sync-summary b, .funnel-step span { font-size: 10px; }

/* Resume library and all product tables */
.library-health, .client-kpis { gap: 12px; margin-bottom: 18px; }
.health-card { min-height: 112px; padding: 17px 18px; }
.health-card span, .client-kpi span { color: #8994a4; font-size: 12px; }
.health-card b { margin-top: 12px; font-size: 24px; }
.health-card small { color: #717c8e; font-size: 11px; }
.toolbar { gap: 10px; margin-bottom: 16px; }
.view-btn { width: 44px; height: 42px; }
.table th { height: 48px; padding: 0 15px; color: #788395; font-size: 10px; }
.table td { height: 74px; padding: 0 15px; color: #aeb7c3; font-size: 13px; }
.table .name-cell { color: #f0f4f8; font-size: 14px; }
.person-avatar { width: 38px; height: 38px; border-radius: 7px; }
.person-name { font-size: 14px; }
.person-role, .cell-sub { color: #7f8a9a; font-size: 12px; line-height: 1.5; }
.cell-main { color: #b2bbc7; font-size: 13px; }
.badge { padding: 5px 8px; border-radius: 5px; font-size: 10px; }
.tag { padding: 5px 8px; border-radius: 5px; color: #9faaba; font-size: 11px; line-height: 1.4; }
.candidate-grid { gap: 16px; }
.candidate-card { padding: 20px; }
.candidate-card h3 { font-size: 18px; }
.candidate-card p { color: #8490a1; font-size: 13px; }
.candidate-meta { color: #748092; font-size: 10px; }
.empty { color: #7b8697; font-size: 14px; line-height: 1.7; }

/* Tag management */
.tag-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 18px; }
.group-head { height: 52px; padding: 0 12px 0 16px; color: #d0d7e0; font-size: 14px; }
.group-total, .tag-count { color: #748092; font-size: 10px; }
.tree-tag { min-height: 44px; height: auto; padding: 10px 10px 10px 40px; color: #8d98a8; font-size: 13px; }
.detail-kpi { font-size: 10px; }
.detail-kpi b { font-size: 17px; }
.selection-bar { padding: 12px 14px; border-radius: 8px; font-size: 12px; }

/* CRM and recommendation log */
.client-kpi { min-height: 118px; padding: 18px; }
.client-kpi b { margin-top: 13px; font-size: 31px; }
.client-kpi::after { font-size: 10px; }
.client-list { gap: 13px; }
.client-card, .client-job-card { padding: 20px; }
.client-name { font-size: 18px; }
.client-jobs, .client-job-owner { color: #8490a0; font-size: 11px; }
.client-meta, .client-job-stats { color: #8490a1; font-size: 12px; line-height: 1.55; }
.client-view-head b { font-size: 15px; }
.client-view-head span { color: #798596; font-size: 12px; }
.client-tabs { gap: 14px; }
.client-tab { height: 54px; font-size: 13px; }
.client-pane-toolbar h4 { font-size: 14px; }
.client-pane-toolbar span { font-size: 11px; }
.client-info { padding: 16px; border-radius: 8px; }
.client-info span { color: #7d8999; font-size: 11px; }
.client-info b { margin-top: 8px; color: #d2d9e2; font-size: 13px; }
.client-note { padding: 15px; color: #a4aeba; font-size: 13px; line-height: 1.75; }

/* Settings, calibration and admin */
.settings-grid { gap: 18px; }
.settings-section { padding: 24px; }
.settings-section h3 { font-size: 18px; }
.settings-section > p { color: #7d8899; font-size: 12px; line-height: 1.65; }
.profile-settings-copy b { font-size: 14px; }
.profile-settings-copy span, .protection-state span { font-size: 11px; }
.theme-option { height: 68px; font-size: 12px; border-radius: 8px; }
.data-action h4 { font-size: 13px; }
.data-action p { color: #748092; font-size: 11px; }
.field-calibration-row { grid-template-columns: 132px minmax(0,1fr) 120px; padding: 13px; border-radius: 8px; }
.field-calibration-row label, .field-calibration-row .verify-field { font-size: 12px; }
.calibration-agent-note { padding: 15px; font-size: 13px; line-height: 1.75; }
.calibration-row { padding: 16px; border-radius: 8px; }
.calibration-row b { font-size: 14px; }
.calibration-row span, .calibration-row small { font-size: 11px; }
.admin-user-row { min-height: 74px; font-size: 13px; }

/* AI-native business modules */
.advisor-brief { padding: 18px; border-radius: 10px; }
.advisor-brief-head b { font-size: 15px; }
.advisor-brief-card { padding: 15px; border-radius: 8px; }
.advisor-brief-card b { font-size: 13px; }
.advisor-brief-card p, .advisor-brief-card li { color: #aab4c1; font-size: 13px; line-height: 1.75; }
.trust-score { padding: 6px 9px; border-radius: 5px; font-size: 11px; }
.trust-readiness { padding: 16px; border-radius: 9px; }
.trust-readiness-copy b { font-size: 14px; }
.trust-readiness-copy span { color: #8792a2; font-size: 12px; line-height: 1.65; }
.trust-readiness-missing i { padding: 5px 7px; border-radius: 5px; font-size: 10px; }
.record-owner-state { color: #758092; font-size: 11px; line-height: 1.5; }
.excluded-panel { border-radius: 9px; }
.excluded-panel summary { padding: 14px 16px; font-size: 13px; }
.excluded-item { padding: 13px; }
.excluded-item b { font-size: 13px; }
.excluded-item span { color: #8792a2; font-size: 12px; line-height: 1.65; }
.feedback-reason, .job-ready-chip { font-size: 10px; }
.notice-item { padding: 15px 17px; color: #9ca7b5; font-size: 12px; line-height: 1.7; }
.notice-item b { font-size: 13px; }

/* Candidate and job workspaces */
.profile-hero { padding: 28px 30px 23px; background: linear-gradient(180deg, #11161c, #0e1217); }
.profile-avatar { width: 68px; height: 68px; border-radius: 10px; }
.profile-name h3 { font-size: 26px; }
.profile-roleline { font-size: 14px; }
.profile-facts, .profile-contact { gap: 10px 24px; color: #a9b3c0; font-size: 13px; }
.profile-tabs { gap: 34px; padding: 0 30px; }
.profile-tab { height: 56px; font-size: 14px; }
.profile-pane { padding: 28px 30px; }
.profile-section h4 { font-size: 14px; }
.profile-summary, .timeline-highlights { color: #aeb7c2; font-size: 13px; line-height: 1.8; }
.timeline-title { font-size: 14px; }
.timeline-date { font-size: 10px; }
.candidate-side-tab { font-size: 13px; }
.candidate-note-item p, .candidate-delivery-card p { font-size: 13px; line-height: 1.7; }
.resume-inline-toolbar b { font-size: 13px; }
.resume-inline-toolbar span { font-size: 11px; }
.resume-preview-fallback {
  margin: 16px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-left-color: var(--orange) !important;
  background: color-mix(in srgb, var(--orange) 8%, transparent);
}
.resume-preview-fallback > div { min-width: 0; }
.resume-preview-fallback span { display: block; margin-top: 5px; line-height: 1.65; }
.resume-preview-fallback .resume-preview-retry { flex: 0 0 auto; }
.resume-paper-structured { min-height: 560px; }
.resume-paper-structured header { padding-bottom: 18px; border-bottom: 2px solid #1f66b2; }
.resume-paper-structured header .candidate-tags { margin-top: 14px; }
.resume-paper-structured section + section { margin-top: 26px; }
.resume-paper-structured .timeline-date { color: #697386; }
@media (max-width: 720px) {
  .resume-preview-fallback { align-items: stretch; flex-direction: column; }
  .resume-preview-fallback .resume-preview-retry { width: 100%; }
  .resume-paper-structured { width: calc(100% - 20px); margin: 10px; padding: 24px; }
}
.job-tabs { padding: 0 20px; }
.job-tab { height: 56px; font-size: 14px; }
.job-facts { gap: 10px 24px; color: #98a3b2; font-size: 12px; line-height: 1.6; }
.job-overview-card, .job-kpi { padding: 16px; border-radius: 8px; }
.job-overview-card span, .job-kpi span { color: #7f8a9a; font-size: 11px; }
.job-overview-card b { color: #d3dae3; font-size: 13px; }
.job-kpi small { color: #737f90; font-size: 10px; line-height: 1.5; }
.pipeline-tab { min-height: 38px; height: 38px; padding: 0 13px; border-radius: 7px; font-size: 12px; }
.pipeline-person b, .recommend-option b, .recommend-upload-head b, .timeline-event b { font-size: 13px; }
.pipeline-person span, .recommend-option span, .recommend-upload-head span { color: #7f8a9a; font-size: 11px; line-height: 1.55; }
.timeline-event p, .job-list-card p { color: #8792a2; font-size: 12px; line-height: 1.65; }
.job-owner-chip, .job-risk { padding: 6px 9px; border-radius: 6px; font-size: 11px; }
.job-health-copy, .job-section-head span { color: #758092; font-size: 11px; line-height: 1.55; }
.quality-alert, .result-summary-bar { font-size: 12px; line-height: 1.6; }
.version-item { padding: 13px; border-radius: 7px; }
.version-item b { font-size: 12px; }
.version-item span { color: #758092; font-size: 11px; }
.advanced-label, .quality-filters { color: #8792a2; font-size: 11px; }
.quick-filter { min-height: 32px; height: 32px; padding: 0 11px; border-radius: 6px; font-size: 11px; }
.clear-search { font-size: 11px; }

/* Taxonomy governance and date/interview utilities */
.tag-governance-kpi span { font-size: 11px; }
.tag-audit-note { padding: 12px 14px; color: #8390a1; font-size: 11px; line-height: 1.65; }
.tag-summary-card { padding: 14px; border-radius: 8px; }
.tag-summary-card span { color: #748092; font-size: 10px; }
.tag-summary-card b { font-size: 13px; }
.tag-merge-impact { padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.7; }
.date-wheel-trigger .date-wheel-hint, .date-wheel-column label { font-size: 10px; }
.interview-form-note { padding: 13px 15px; border-radius: 0 8px 8px 0; color: #8d98a8; font-size: 12px; line-height: 1.7; }
.candidate-tag-group-head span { font-size: 12px; }

/* Dialogs */
.modal-backdrop { background: rgba(2,5,9,.8); backdrop-filter: blur(9px); }
.modal { border-radius: 14px; background: #0f1318; box-shadow: 0 32px 100px rgba(0,0,0,.58); }
.modal-head { height: 70px; padding: 0 24px; }
.modal-head h2 { font-size: 21px; }
.modal-close { width: 42px; height: 42px; border-radius: 8px; font-size: 22px; }
.modal-body { padding: 24px; }
.modal-foot { min-height: 70px; padding: 14px 24px; }
.dialog-copy { color: #a3adba; font-size: 13px; line-height: 1.8; }
.dialog-option { padding: 15px; border-radius: 8px; font-size: 13px; }
.preview-head { padding: 15px; border-radius: 0 8px 8px 0; }
.preview-head b { font-size: 14px; }
.preview-head span { color: #8490a0; font-size: 12px; line-height: 1.6; }
.dropzone { border-radius: 10px; }
.dropzone h3 { font-size: 16px; }
.dropzone p, .analysis-view p { color: #7f8b9c; font-size: 12px; }
.toast { padding: 14px 17px; border-radius: 8px; font-size: 13px; }

/* Keep Smart Match as the typography source of truth while polishing its shell. */
#match .match-command { padding: 15px; }
#match .match-layout { border-radius: 12px; }
#match .chat-head, #match .results-head { background: rgba(255,255,255,.012); }
#match .bubble { border-radius: 9px; }
#match .business-match-card { border-radius: 10px; background: rgba(7,9,12,.7); }
#match .match-profile, #match .match-evidence { border-radius: 8px; }

html[data-theme="light"] {
  --bg: #eef2f7;
  --surface: #f6f8fb;
  --card: #ffffff;
  --card2: #f2f5f9;
  --line: rgba(15,23,42,.1);
  --line2: rgba(15,23,42,.19);
  --text: #172033;
  --muted: #637083;
  --muted2: #445064;
}
html[data-theme="light"] body { background: #f6f8fb; }
html[data-theme="light"] .sidebar { background: #f1f4f8; }
html[data-theme="light"] .panel,
html[data-theme="light"] .metric,
html[data-theme="light"] .dashboard-kpi,
html[data-theme="light"] .health-card,
html[data-theme="light"] .client-kpi,
html[data-theme="light"] .client-card,
html[data-theme="light"] .client-job-card,
html[data-theme="light"] .candidate-card,
html[data-theme="light"] .settings-section,
html[data-theme="light"] .tag-tree,
html[data-theme="light"] .tag-detail,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .match-command,
html[data-theme="light"] .match-layout { background: #fff; }

@media (max-width: 1180px) {
  :root { --sidebar: 232px; }
  .content { padding-left: 26px; padding-right: 26px; }
  .trust-briefing-list { grid-template-columns: repeat(2, 1fr); }
  .table td { font-size: 12px; }
}

@media (max-width: 900px) {
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { margin-left: 0; flex-wrap: wrap; }
  .tag-layout { grid-template-columns: 1fr; }
  .client-kpis, .library-health { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .candidate-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .content { padding: 28px 16px 56px; }
  .page-head h1 { font-size: 32px; }
  .page-sub { font-size: 13px; }
  .btn { min-height: 40px; height: 40px; }
  .topbar { height: 60px; padding: 0 14px; }
  .trust-briefing-list, .client-kpis, .library-health { grid-template-columns: 1fr; }
  .table th { height: 46px; }
  .table td { height: 70px; }
  .modal-backdrop { padding: 8px; }
  .modal { border-radius: 11px; }
  .profile-pane, .client-pane { padding: 20px 16px; }
  .profile-tabs { gap: 18px; padding: 0 16px; overflow-x: auto; }
  .field-calibration-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Tag space — friendly, consumer-facing organization experience */
#tags { --tag-blue: #248cff; --tag-blue-soft: rgba(36,140,255,.12); }
#tags .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
#tags .tag-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
#tags .tag-page-title { max-width: 660px; }
#tags .tag-page-kicker { margin-bottom: 10px; color: #54a5ff; font-size: 13px; font-weight: 700; letter-spacing: .08em; }
#tags .tag-page-title h1 { margin: 0; color: #f6f8fc; font-size: clamp(30px,3vw,42px); font-weight: 720; line-height: 1.15; letter-spacing: -.035em; }
#tags .tag-page-title p { margin: 12px 0 0; color: #8994a4; font-size: 15px; line-height: 1.7; }
#tags .tag-page-actions { display: flex; flex: 0 0 auto; gap: 10px; }
#tags .tag-page-actions .btn { min-width: 104px; border-radius: 10px; }
#tags .tag-page-actions .primary { box-shadow: 0 10px 30px rgba(10,132,255,.2); }

#tags .tag-command-card { margin-bottom: 18px; padding: 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: linear-gradient(145deg,rgba(22,27,35,.96),rgba(13,16,22,.96)); box-shadow: 0 18px 48px rgba(0,0,0,.16); }
#tags .tag-governance-toolbar { display: grid; grid-template-columns: minmax(260px,1fr) 148px auto; gap: 10px; margin: 0; }
#tags .tag-search { position: relative; display: flex; min-width: 0; }
#tags .tag-search input { width: 100%; height: 48px; padding: 0 18px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; outline: none; background: rgba(6,9,13,.65); color: #edf2f8; font: inherit; font-size: 14px; transition: border-color .18s, background .18s, box-shadow .18s; }
#tags .tag-search input::placeholder { color: #667284; }
#tags .tag-search input:focus { border-color: rgba(36,140,255,.72); background: rgba(9,16,25,.9); box-shadow: 0 0 0 4px rgba(36,140,255,.1); }
#tags .tag-governance-toolbar .select,#tags .tag-audit-button { height: 48px; border-radius: 12px; }
#tags .tag-audit-button { padding: 0 18px; }
#tags .tag-governance-kpis { display: flex; gap: 7px; margin-top: 13px; }
#tags .tag-governance-kpi { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: #8490a1; cursor: pointer; transition: color .16s,background .16s,border-color .16s,transform .16s; }
#tags .tag-governance-kpi:hover { color: #c8d1dc; background: rgba(255,255,255,.045); transform: translateY(-1px); }
#tags .tag-governance-kpi.active { border-color: rgba(36,140,255,.28); background: var(--tag-blue-soft); color: #74b7ff; }
#tags .tag-governance-kpi span,#tags .tag-governance-kpi b { display: inline; margin: 0; color: inherit; font: inherit; font-size: 13px; }
#tags .tag-governance-kpi b { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.06); font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; }
#tags .tag-governance-kpi.active b { background: rgba(36,140,255,.18); }
#tags .tag-audit-note { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 13px; border: 0; border-radius: 10px; background: rgba(36,140,255,.055); color: #7e8998; font-size: 12px; line-height: 1.55; }
#tags .tag-audit-note b { color: #bdc7d3; font-size: 12px; }
#tags .tag-audit-note span { min-width: 0; }

#tags .tag-layout { display: grid; grid-template-columns: minmax(310px,350px) minmax(0,1fr); align-items: start; gap: 18px; }
#tags .tag-tree,#tags .tag-detail { overflow: hidden; border: 1px solid rgba(255,255,255,.075); border-radius: 18px; background: linear-gradient(180deg,rgba(18,22,29,.98),rgba(13,16,21,.98)); box-shadow: 0 20px 60px rgba(0,0,0,.13); }
#tags .tag-tree { min-height: 600px; padding: 0 12px 16px; }
#tags .tag-section-head { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 0 8px; border-bottom: 1px solid rgba(255,255,255,.065); }
#tags .tag-section-head > div { display: grid; gap: 4px; }
#tags .tag-section-head span { color: #e7ecf2; font-size: 16px; font-weight: 680; }
#tags .tag-section-head small,#tags .tag-section-count { color: #707b8b; font-size: 11px; font-weight: 500; }
#tags .tag-section-count { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.045); white-space: nowrap; }
#tags #tagTree { padding-top: 10px; }
#tags #tagTree .group { margin: 0 0 8px; overflow: hidden; border: 1px solid transparent; border-radius: 13px; background: rgba(255,255,255,.016); }
#tags #tagTree .group:has(.tree-tag.active) { border-color: rgba(36,140,255,.16); background: rgba(36,140,255,.035); }
#tags #tagTree .group-head { display: flex; align-items: center; min-height: 60px; height: auto; padding: 9px 9px 9px 12px; border: 0; border-radius: 12px; color: #d5dbe4; cursor: pointer; }
#tags #tagTree .group-head:hover { background: rgba(255,255,255,.035); }
#tags #tagTree .group-head .chev { flex: 0 0 auto; min-width: 36px; height: 26px; margin: 0 8px 0 0; padding: 0 7px; border-radius: 8px; background: rgba(255,255,255,.045); color: #758191; font-size: 9px; font-weight: 650; line-height: 26px; text-align: center; transition: background .18s,color .18s; }
#tags #tagTree .group-head:hover .chev { background: rgba(255,255,255,.07); color: #b8c2ce; }
#tags #tagTree .group-copy { display: grid; min-width: 0; gap: 3px; }
#tags #tagTree .group-copy b { overflow: hidden; color: #d9e0e8; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
#tags #tagTree .group-copy small { color: #6f7a8a; font-size: 10px; font-weight: 500; }
#tags #tagTree .tree-actions-mini { display: flex; gap: 3px; margin-left: auto; opacity: 0; transition: opacity .15s; }
#tags #tagTree .group-head:hover .tree-actions-mini,#tags #tagTree .tree-tag:hover .tree-actions-mini,#tags #tagTree .tree-actions-mini:focus-within { opacity: 1; }
#tags #tagTree .tree-mini { width: auto; min-width: 36px; height: 28px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: #707b8a; font-size: 10px; cursor: pointer; }
#tags #tagTree .tree-mini:hover { background: rgba(255,255,255,.06); color: #dce3eb; }
#tags #tagTree .tree-mini.danger:hover { background: rgba(255,69,58,.08); color: #ff6961; }
#tags #tagTree .group-tags { padding: 0 5px 7px; }
#tags #tagTree .tree-tag { display: flex; align-items: center; min-height: 46px; height: auto; margin-top: 3px; padding: 8px 9px 8px 12px; border: 0; border-radius: 10px; color: #8b96a5; font-size: 13px; cursor: pointer; }
#tags #tagTree .tree-tag:hover { background: rgba(255,255,255,.035); color: #c9d1dc; }
#tags #tagTree .tree-tag.active { background: linear-gradient(90deg,rgba(36,140,255,.16),rgba(36,140,255,.07)); color: #e9f3ff; }
#tags #tagTree .tree-tag-name { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#tags #tagTree .tag-color-dot { flex: 0 0 9px; width: 9px; height: 9px; margin-right: 10px; border-radius: 50%; background: var(--tag-color,var(--tag-blue)); box-shadow: 0 0 0 4px color-mix(in srgb,var(--tag-color,var(--tag-blue)) 12%,transparent); }
#tags #tagTree .tag-count { margin-left: auto; padding-left: 8px; color: #687483; font-size: 10px; white-space: nowrap; }
#tags #tagTree .tag-health { flex: 0 0 auto; margin-left: 7px; padding: 3px 6px; border: 0; border-radius: 999px; background: rgba(255,255,255,.045); font-size: 9px; }
#tags #tagTree .tree-actions-mini + * { margin-left: 0; }
#tags #tagTree .tag-group-empty { padding: 8px 12px 16px 50px; color: #5f6a79; font-size: 11px; }

#tags .tag-detail { min-height: 600px; }
#tags .tag-detail-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px 22px; min-height: 116px; padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,.07); background: radial-gradient(circle at 8% 20%,rgba(36,140,255,.09),transparent 34%); }
#tags .tag-detail-heading { min-width: 0; }
#tags .tag-detail-label { display: block; margin-bottom: 8px; color: #6d7888; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
#tags #selectedTag { display: flex; align-items: center; gap: 8px; color: #f2f5f9; font-size: 22px; font-weight: 710; letter-spacing: -.02em; white-space: nowrap; }
#tags .selected-tag-dot { flex: 0 0 11px; width: 11px; height: 11px; border-radius: 50%; background: var(--tag-color,var(--tag-blue)); box-shadow: 0 0 0 5px color-mix(in srgb,var(--tag-color,var(--tag-blue)) 14%,transparent); }
#tags #selectedTagPath { margin-top: 7px; overflow: hidden; color: #7d8898; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#tags .tag-detail-heading .tag-health { padding: 4px 8px; border: 0; border-radius: 999px; background: rgba(255,255,255,.05); font-size: 9px; font-weight: 650; }
#tags .detail-kpi { display: flex; grid-column: 1; align-items: center; gap: 7px; margin: 0; font: inherit; }
#tags .detail-kpi span { display: inline-flex; align-items: baseline; gap: 4px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); color: #758192; font-size: 10px; white-space: nowrap; }
#tags .detail-kpi b { display: inline; margin: 0; color: #e5ebf2; font-size: 15px; }
#tags .tag-detail-actions { display: flex; grid-column: 2; grid-row: 1; gap: 7px; margin: 0; }
#tags .tag-detail-actions .btn { border-radius: 9px; }
#tags .tag-detail-summary { display: grid; grid-template-columns: minmax(220px,1.6fr) repeat(3,minmax(110px,1fr)); gap: 10px; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.065); background: transparent; }
#tags .tag-summary-card { min-width: 0; padding: 14px 15px; border: 1px solid rgba(255,255,255,.065); border-radius: 12px; background: rgba(255,255,255,.022); }
#tags .tag-summary-card span { display: block; color: #697485; font-size: 10px; font-weight: 600; }
#tags .tag-summary-card b { display: block; margin-top: 8px; overflow: hidden; color: #bbc4cf; font-size: 12px; font-weight: 560; line-height: 1.65; text-overflow: ellipsis; }
#tags .tag-candidate-head { display: flex; align-items: center; justify-content: space-between; padding: 21px 22px 12px; }
#tags .tag-candidate-head > div { display: grid; gap: 4px; }
#tags .tag-candidate-head b { color: #e5eaf0; font-size: 15px; }
#tags .tag-candidate-head span { color: #707c8d; font-size: 11px; }
#tags .tag-candidate-total { padding: 6px 9px; border-radius: 999px; background: rgba(36,140,255,.1); color: #6bb1ff !important; font-weight: 650; }
#tags .tag-candidate-list { display: grid; gap: 8px; padding: 0 18px 20px; }
#tags .tag-person-card { display: grid; grid-template-columns: 42px minmax(130px,.8fr) minmax(180px,1fr) auto auto; align-items: center; gap: 13px; min-height: 72px; padding: 10px 12px; border: 1px solid transparent; border-radius: 13px; background: rgba(255,255,255,.022); cursor: pointer; transition: border-color .16s,background .16s,transform .16s; }
#tags .tag-person-card:hover { border-color: rgba(36,140,255,.2); background: rgba(36,140,255,.05); transform: translateY(-1px); }
#tags .tag-person-card .person-avatar { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg,#21354f,#172332); color: #8fc5ff; font-size: 14px; }
#tags .tag-person-main,#tags .tag-person-company { display: grid; min-width: 0; gap: 4px; }
#tags .tag-person-main .person-name,#tags .tag-person-company b { overflow: hidden; color: #e3e9f0; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
#tags .tag-person-main .person-role,#tags .tag-person-company span { overflow: hidden; color: #737f8f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
#tags .tag-person-status { white-space: nowrap; }
#tags .tag-person-open { min-width: 54px; height: 34px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: rgba(255,255,255,.03); color: #aab4c1; font-size: 11px; cursor: pointer; }
#tags .tag-person-card:hover .tag-person-open { border-color: rgba(36,140,255,.28); color: #75b8ff; }
#tags .tag-empty-state { display: grid; place-items: center; min-height: 190px; padding: 30px; text-align: center; }
#tags .tag-empty-state b { color: #c8d0da; font-size: 15px; }
#tags .tag-empty-state span { max-width: 340px; margin-top: 8px; color: #697586; font-size: 12px; line-height: 1.65; }

html[data-theme="light"] #tags .tag-page-title h1 { color: #162033; }
html[data-theme="light"] #tags .tag-page-title p { color: #667386; }
html[data-theme="light"] #tags .tag-command-card { border-color: rgba(22,32,51,.08); background: linear-gradient(145deg,#fff,#f7f9fc); box-shadow: 0 16px 44px rgba(31,50,78,.07); }
html[data-theme="light"] #tags .tag-search input { border-color: rgba(22,32,51,.1); background: #fff; color: #1a2435; }
html[data-theme="light"] #tags .tag-governance-kpi:hover { color: #405068; background: rgba(23,41,70,.045); }
html[data-theme="light"] #tags .tag-governance-kpi.active { color: #1378dd; }
html[data-theme="light"] #tags .tag-governance-kpi b { background: rgba(20,40,70,.06); }
html[data-theme="light"] #tags .tag-audit-note { background: rgba(36,140,255,.06); color: #6b788b; }
html[data-theme="light"] #tags .tag-audit-note b { color: #344156; }
html[data-theme="light"] #tags .tag-tree,html[data-theme="light"] #tags .tag-detail { border-color: rgba(22,32,51,.08); background: #fff; box-shadow: 0 18px 52px rgba(31,50,78,.065); }
html[data-theme="light"] #tags .tag-section-head,html[data-theme="light"] #tags .tag-detail-hero,html[data-theme="light"] #tags .tag-detail-summary { border-color: rgba(22,32,51,.08); }
html[data-theme="light"] #tags .tag-section-head span,html[data-theme="light"] #tags #selectedTag { color: #1b2638; }
html[data-theme="light"] #tags #tagTree .group { background: #fafbfc; }
html[data-theme="light"] #tags #tagTree .group:has(.tree-tag.active) { border-color: rgba(36,140,255,.16); background: rgba(36,140,255,.025); }
html[data-theme="light"] #tags #tagTree .group-head:hover,html[data-theme="light"] #tags #tagTree .tree-tag:hover { background: rgba(24,43,73,.04); }
html[data-theme="light"] #tags #tagTree .group-copy b { color: #344156; }
html[data-theme="light"] #tags #tagTree .tree-tag { color: #5e6b7d; }
html[data-theme="light"] #tags #tagTree .tree-tag.active { color: #126fc6; }
html[data-theme="light"] #tags .tag-summary-card { border-color: rgba(22,32,51,.08); background: #fafbfc; }
html[data-theme="light"] #tags .tag-summary-card b,html[data-theme="light"] #tags .tag-candidate-head b,html[data-theme="light"] #tags .tag-person-main .person-name,html[data-theme="light"] #tags .tag-person-company b { color: #344156; }
html[data-theme="light"] #tags .tag-person-card { background: #fafbfc; }
html[data-theme="light"] #tags .tag-person-card:hover { background: rgba(36,140,255,.045); }

@media (max-width: 1080px) {
  #tags .tag-page-head { align-items: flex-start; flex-direction: column; }
  #tags .tag-detail-hero { grid-template-columns: minmax(0,1fr) auto; }
  #tags .tag-detail-actions { grid-column: 1/-1; }
  #tags .tag-detail-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  #tags .tag-layout { grid-template-columns: 1fr; }
  #tags .tag-tree { min-height: auto; }
  #tags #tagTree { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 680px) {
  #tags .tag-page-head { gap: 18px; }
  #tags .tag-page-title h1 { font-size: 30px; }
  #tags .tag-page-actions { width: 100%; overflow-x: auto; }
  #tags .tag-page-actions .btn { min-width: max-content; }
  #tags .tag-governance-toolbar { grid-template-columns: 1fr 1fr; }
  #tags .tag-search { grid-column: 1/-1; }
  #tags .tag-governance-kpis { overflow-x: auto; padding-bottom: 3px; }
  #tags .tag-governance-kpi { flex: 0 0 auto; }
  #tags .tag-audit-note { align-items: flex-start; flex-direction: column; gap: 3px; }
  #tags #tagTree { grid-template-columns: 1fr; }
  #tags .tag-detail-hero { grid-template-columns: 1fr; gap: 15px; }
  #tags .detail-kpi { overflow-x: auto; }
  #tags .tag-detail-summary { grid-template-columns: 1fr; }
  #tags .tag-person-card { grid-template-columns: 42px minmax(0,1fr) auto; }
  #tags .tag-person-company { grid-column: 2/4; }
  #tags .tag-person-status { grid-column: 2; }
  #tags .tag-person-open { grid-column: 3; }
}
