/* Project-owned Dcatplus visual layer. No third-party styles are modified. */
body.hm-admin {
    --hm-primary: #2563eb;
    --hm-primary-dark: #1d4ed8;
    --hm-text: #1e293b;
    --hm-muted: #475569;
    --hm-surface: #fff;
    --hm-bg: #f5f7fb;
    --hm-border: #e2e8f0;
    --hm-soft: #eff6ff;
    --hm-green: #047857;
    --hm-amber: #92400e;
    --hm-radius: 12px;
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    color: var(--hm-text);
    font-size: 14px;
    line-height: 1.6;
}
.hm-admin .content-wrapper { background: var(--hm-bg); }
.hm-admin .content-header { padding-bottom: 20px; }
.hm-admin .content-header h1 { font-size: 22px; font-weight: 650; color: var(--hm-text); }
.hm-admin .content-header h1 small { color: var(--hm-muted); font-size: 13px; margin-left: 8px; }
.hm-admin .main-header { box-shadow: 0 1px 0 var(--hm-border) !important; }
.hm-admin .main-sidebar { box-shadow: 1px 0 0 var(--hm-border) !important; }
.hm-admin .main-sidebar.sidebar-light-primary { background: var(--hm-surface); }
.hm-admin .main-sidebar .brand-link { border-bottom: 1px solid var(--hm-border); }
.hm-admin .main-sidebar .nav-sidebar > .nav-item { margin: 4px 8px; }
.hm-admin .main-sidebar .nav-sidebar > .nav-item > .nav-link { border-radius: 8px; padding-top: 12px; padding-bottom: 12px; }
.hm-admin .sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active { background: var(--hm-soft) !important; color: var(--hm-primary-dark) !important; box-shadow: none !important; font-weight: 600; }
.hm-admin .card { border: 1px solid var(--hm-border); border-radius: var(--hm-radius); box-shadow: 0 2px 8px #0f172a03; }
.hm-admin .card-header { border-bottom-color: var(--hm-border); }
.hm-admin .table thead th { background: var(--hm-bg); color: var(--hm-muted); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--hm-border); }
.hm-admin .table td { vertical-align: middle; border-top-color: var(--hm-border); padding-top: 14px; padding-bottom: 14px; }
.hm-admin .table-hover tbody tr:hover { background-color: #f8fafc; }
.hm-admin .btn { border-radius: 7px; font-weight: 500; transition: background-color 150ms ease, box-shadow 150ms ease; }
.hm-admin .btn.btn-primary { background: var(--hm-primary) !important; border-color: var(--hm-primary) !important; color: #fff !important; box-shadow: none !important; }
.hm-admin .btn.btn-primary:hover { background: #1d4ed8 !important; border-color: #1d4ed8 !important; }
.hm-admin .btn-outline-primary { border-color: #93b4ee; color: var(--hm-primary-dark); }
.hm-admin .btn-outline-primary:hover { background: var(--hm-soft); border-color: var(--hm-primary); color: var(--hm-primary-dark); }
.hm-admin .form-control { border-color: #cbd5e1; border-radius: 7px; color: var(--hm-text); }
.hm-admin .form-control:focus { border-color: var(--hm-primary); box-shadow: 0 0 0 3px #2563eb18; }
.hm-admin .form-group label { color: var(--hm-text); }
.hm-admin .help-block { color: var(--hm-muted); }
.hm-admin a:focus-visible, .hm-admin button:focus-visible, .hm-admin select:focus-visible, .hm-admin input:focus-visible { outline: 3px solid var(--hm-primary); outline-offset: 3px; }
.hm-dashboard { max-width: 1680px; margin: 0 auto; }
.hm-dashboard h2, .hm-dashboard h3, .hm-dashboard h4 { color: var(--hm-text); margin: 0; }
.hm-dashboard p { margin: 0; }
.hm-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 0 28px; }
.hm-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--hm-primary-dark); margin-bottom: 12px; }
.hm-eyebrow span { padding: 0 10px; color: var(--hm-muted); }
.hm-welcome h2 { font-size: clamp(24px, 2vw, 32px); font-weight: 650; letter-spacing: -.025em; line-height: 1.4; }
.hm-welcome p { color: var(--hm-muted); margin-top: 8px; }
.hm-welcome-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 14px; flex-shrink: 0; }
.hm-today { color: var(--hm-muted); font-size: 12px; }
.hm-welcome-actions .btn { padding: 10px 20px; }
.hm-welcome-actions .btn i { margin-left: 16px; }
.hm-section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.hm-section-toolbar > div { display: flex; align-items: baseline; gap: 12px; }
.hm-section-toolbar h2 { font-size: 18px; font-weight: 600; }
.hm-section-toolbar span { font-size: 12px; color: var(--hm-muted); }
.hm-year-form { display: flex; align-items: center; gap: 8px; }
.hm-year-form label { margin: 0; font-size: 12px; color: var(--hm-muted); white-space: nowrap; }
.hm-year-form .form-control { width: 112px; height: 38px; padding: 4px 10px; font-size: 13px; background: var(--hm-surface); }
.hm-year-form .btn { height: 38px; padding: 4px 14px; white-space: nowrap; }
.hm-panel { background: var(--hm-surface); border: 1px solid var(--hm-border); border-radius: var(--hm-radius); padding: 24px; box-shadow: 0 2px 8px #0f172a03; min-width: 0; }
.hm-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.hm-metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--hm-muted); font-weight: 500; }
.hm-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; font-size: 18px; }
.hm-tone-blue { color: var(--hm-primary-dark); background: var(--hm-soft); }
.hm-tone-green { color: var(--hm-green); background: #ecfdf5; }
.hm-tone-amber { color: var(--hm-amber); background: #fffbeb; }
.hm-tone-neutral { color: var(--hm-muted); background: #f1f5f9; }
.hm-metric-value { font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 38px; font-weight: 650; line-height: 1.3; margin: 12px 0 8px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.hm-metric-value span { font-size: 13px; color: var(--hm-muted); font-weight: 400; margin-left: 8px; letter-spacing: 0; }
.hm-metric p { font-size: 12px; color: var(--hm-muted); }
.hm-primary-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(280px, 1fr); gap: 24px; margin-bottom: 24px; }
.hm-panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.hm-panel-heading h3 { font-size: 16px; font-weight: 600; line-height: 1.5; }
.hm-panel-heading p { font-size: 12px; color: var(--hm-muted); margin-top: 4px; }
.hm-heading-icon { color: var(--hm-muted); font-size: 18px; padding-top: 3px; }
.hm-tag { border: 1px solid var(--hm-border); border-radius: 6px; color: var(--hm-muted); padding: 2px 10px; font-size: 12px; }
.hm-month-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(4px, 1.5vw, 20px); height: 226px; padding: 28px 0 0; }
.hm-month-column { min-width: 0; display: flex; flex-direction: column; text-align: center; }
.hm-month-track { height: 166px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--hm-border); background: repeating-linear-gradient(to top, transparent 0, transparent 40px, #f1f5f9 40px, #f1f5f9 41px); }
.hm-month-bar { position: relative; width: min(100%, 34px); height: var(--bar-height); background: #3b82f6; border-radius: 5px 5px 0 0; }
.hm-month-peak { background: var(--hm-primary-dark); }
.hm-month-bar > span { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); color: var(--hm-text); font-size: 12px; font-weight: 600; }
.hm-month-label { margin-top: 12px; color: var(--hm-muted); font-size: 12px; white-space: nowrap; }
.hm-chart-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--hm-muted); padding-top: 16px; border-top: 1px solid var(--hm-border); margin-top: 12px; }
.hm-chart-footer i { color: var(--hm-primary); margin-right: 6px; }
.hm-publication-ring { width: 144px; height: 144px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--hm-primary) var(--published), var(--hm-border) 0); }
.hm-publication-ring > div { width: 120px; height: 120px; background: var(--hm-surface); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hm-publication-ring strong { font-size: 32px; font-family: "Avenir Next", "Segoe UI", sans-serif; line-height: 1.3; }
.hm-publication-ring small { font-size: 16px; }
.hm-publication-ring span { color: var(--hm-muted); font-size: 12px; }
.hm-publication-counts { display: flex; justify-content: space-around; gap: 12px; }
.hm-publication-counts > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--hm-muted); }
.hm-publication-counts strong { font-size: 20px; color: var(--hm-text); font-variant-numeric: tabular-nums; }
.hm-dot { display: inline-block; height: 7px; width: 7px; border-radius: 50%; margin-right: 6px; background: #64748b; }
.hm-dot-published { background: var(--hm-primary); }
.hm-dot-draft { background: #b45309; }
.hm-publication-note { color: var(--hm-muted); font-size: 12px; border-top: 1px solid var(--hm-border); margin-top: 16px !important; padding-top: 12px; }
.hm-secondary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(250px, .9fr); gap: 24px; margin-bottom: 24px; align-items: stretch; }
.hm-secondary-grid.hm-company-view { grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr); }
.hm-ranking { display: grid; gap: 12px; }
.hm-rank-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 5px; font-size: 13px; }
.hm-rank-row > div:first-child > span { overflow-wrap: anywhere; min-width: 0; }
.hm-rank-row strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-rank-row small { font-size: 12px; color: var(--hm-muted); font-weight: 400; }
.hm-rank-track { height: 5px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.hm-rank-track span { display: block; height: 100%; border-radius: inherit; background: #3b82f6; }
.hm-company-ranking .hm-rank-track span { background: #64748b; }
.hm-rank-number { display: inline-flex; justify-content: center; min-width: 20px; margin-right: 8px; color: var(--hm-muted); font-size: 12px; font-weight: 500; }
.hm-text-link { font-size: 12px; color: var(--hm-primary-dark); white-space: nowrap; padding: 4px 0; }
.hm-quick-link { display: flex; align-items: center; gap: 12px; color: var(--hm-text); padding: 16px 0; border-top: 1px solid var(--hm-border); }
.hm-quick-link > span:nth-child(2) { flex: 1; min-width: 0; }
.hm-quick-link strong, .hm-quick-link small { display: block; }
.hm-quick-link strong { font-size: 14px; font-weight: 600; }
.hm-quick-link small { color: var(--hm-muted); font-size: 12px; margin-top: 2px; }
.hm-quick-link > i { color: var(--hm-muted); }
.hm-quick-link:hover { color: var(--hm-primary-dark); background: #f8fafc; }
.hm-event { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--hm-border); }
.hm-event-date { width: 52px; flex-shrink: 0; border-radius: 8px; background: var(--hm-bg); text-align: center; padding: 5px 0; }
.hm-event-date span { color: var(--hm-muted); font-size: 12px; display: block; }
.hm-event-date strong { font-size: 22px; font-weight: 600; display: block; line-height: 1.3; }
.hm-event-info { flex: 1; min-width: 0; }
.hm-event-info a { color: var(--hm-text); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.hm-event-info a:hover { color: var(--hm-primary-dark); text-decoration: underline; }
.hm-event-info p { color: var(--hm-muted); font-size: 12px; margin-top: 5px; overflow-wrap: anywhere; }
.hm-event-info p span { margin: 0 6px; }
.hm-status { display: inline-block; font-size: 12px; padding: 4px 10px; border-radius: 5px; white-space: nowrap; }
.hm-empty { text-align: center; padding: 32px 16px; color: var(--hm-muted); font-size: 13px; }
.hm-empty > i { font-size: 28px; margin-bottom: 12px; color: var(--hm-primary); }
.hm-empty h4 { font-size: 15px; margin-bottom: 8px; }
.hm-inline-empty { font-size: 12px; color: var(--hm-muted); }
.hm-postponed { display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--hm-border); padding-top: 16px; font-size: 12px; color: var(--hm-muted); }
.hm-postponed strong { color: var(--hm-amber); }
.hm-postponed a { color: var(--hm-primary-dark); }
.hm-dashboard-footnote { color: var(--hm-muted); font-size: 12px; padding: 16px 0 8px; }
/* Preserve Dcat's native dark-mode preference when it is enabled. */
body.hm-admin.dark-mode {
    --hm-primary-dark: #93c5fd;
    --hm-text: #e2e8f0;
    --hm-muted: #cbd5e1;
    --hm-surface: #1e293b;
    --hm-bg: #0f172a;
    --hm-border: #475569;
    --hm-soft: #172f50;
    --hm-green: #6ee7b7;
    --hm-amber: #fcd34d;
}
.hm-admin.dark-mode .hm-tone-green { background: #123c32; }
.hm-admin.dark-mode .hm-tone-amber { background: #422f17; }
.hm-admin.dark-mode .hm-tone-neutral { background: #334155; }
.hm-admin.dark-mode .hm-rank-track { background: #334155; }
.hm-admin.dark-mode .hm-month-track { background: none; }
.hm-admin.dark-mode .hm-quick-link:hover, .hm-admin.dark-mode .table-hover tbody tr:hover { background: #26364d; }
.hm-admin.dark-mode .form-control { background: var(--hm-surface); }
@media (max-width: 1199px) {
    .hm-secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-secondary-grid .hm-quick-panel { grid-column: 1 / -1; }
    .hm-quick-panel .hm-quick-link { padding: 12px 0; }
    .hm-panel { padding: 20px; }
}
@media (max-width: 767px) {
    .hm-welcome { align-items: flex-start; flex-direction: column; gap: 16px; padding-top: 0; }
    .hm-welcome-actions { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
    .hm-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .hm-metric-value { font-size: 32px; }
    .hm-primary-grid, .hm-secondary-grid, .hm-secondary-grid.hm-company-view { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
    .hm-section-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
    .hm-section-toolbar > div { flex-wrap: wrap; }
    .hm-panel { padding: 16px; }
    .hm-month-chart { gap: 7px; }
    .hm-month-label > span { display: none; }
    .hm-event { flex-wrap: wrap; gap: 12px; }
    .hm-event-info { flex-basis: calc(100% - 76px); }
    .hm-event .hm-status { margin-left: 64px; margin-top: -4px; }
    .hm-dashboard .btn, .hm-dashboard select { min-height: 44px; }
    .hm-text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
    .hm-admin .content-header h1 small { display: block; margin: 8px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hm-admin .btn { transition: none; }
}
