/* Theme 2: shared NSUEM identity of YearReport and Vestnik.
   All visual overrides are scoped; the original theme remains unchanged. */
@font-face {
  font-family: "NewROP Reports";
  src: url("/static/fonts/TTRuns-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "NewROP Reports";
  src: url("/static/fonts/TT-Runs-DemiBold.ttf") format("truetype");
  font-weight: 600 900;
  font-display: swap;
}
.theme-sr-only, .theme-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.theme-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid #cdd5e0;
  border-radius: 6px;
  background: #fff;
  color: #46516a;
  font: 12px/1.4 Verdana, Arial, sans-serif;
}
.theme-switch label { position: relative; display: flex; margin: 0; cursor: pointer; }
.theme-switch span {
  display: grid;
  place-items: center;
  min-width: 67px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}
.theme-switch input:checked + span { color: #fff; background: #173eac; border-color: #173eac; }
.theme-switch input:focus-visible + span { outline: 3px solid #c65b20; outline-offset: 2px; }
.theme-switch label:hover span { border-color: #a3afc5; }
.theme-standalone { display: flex; justify-content: flex-end; padding: 16px 24px; }
.login-page > .theme-standalone { position: absolute; z-index: 5; top: 0; right: 0; }
.public-header { gap: 16px; flex-wrap: wrap; }
.public-header > .theme-switch { margin-left: auto; }
.topbar { gap: 12px; height: auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.topbar-path { flex: 1 1 120px; }
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }

html[data-theme="nsuem"] {
  --blue-900: #173eac;
  --blue-800: #163896;
  --blue-700: #173eac;
  --blue-500: #f58345;
  --blue-100: #edf1fd;
  --blue-050: #f5f7fc;
  --surface: #fff;
  --canvas: #f5f6f9;
  --text: #233147;
  --text-strong: #171d2a;
  --muted: #5f6c80;
  --border: #dde2e9;
  --border-strong: #c4ccd9;
  --success: #237447;
  --success-soft: #eaf5ee;
  --danger: #b42332;
  --danger-soft: #fcecef;
  --warning: #a4511a;
  --warning-soft: #fff3e9;
  --shadow: 0 8px 26px #171d2a0d;
  --font: Verdana, Arial, sans-serif;
}
html[data-theme="nsuem"] :is(h1,h2,h3,h4,h5,.brand-copy,.kpi strong,.heading-count strong,.registry-total-strip strong) {
  font-family: "NewROP Reports", Verdana, Arial, sans-serif;
}
html[data-theme="nsuem"] :is(h1,h2,h3,h4,h5,p,small,label,button,input,select,textarea,th,.eyebrow,.kpi-label,.brand-mark,.nav-caption) { letter-spacing: 0; }
html[data-theme="nsuem"] :is(button,a,input,textarea,select,summary):focus-visible { outline: 3px solid #c65b20; outline-offset: 3px; }
html[data-theme="nsuem"] ::selection { color: #171d2a; background: #ffdbc6; }
html[data-theme="nsuem"] .sidebar { color: var(--text); background: #fff; border-right: 1px solid var(--border); box-shadow: none; }
html[data-theme="nsuem"] :is(.sidebar,.hero,.login-brand-panel,.kpi-primary)::before,
html[data-theme="nsuem"] :is(.sidebar,.hero,.login-brand-panel,.kpi-primary)::after { display: none; }
html[data-theme="nsuem"] .brand { border-bottom-color: var(--border); padding-bottom: 20px; }
html[data-theme="nsuem"] .brand-mark { background: #173eac; border-radius: 3px; border-bottom: 3px solid #f58345; box-shadow: none; }
html[data-theme="nsuem"] .brand-copy strong { color: #173eac; font-size: 13px; line-height: 1.5; font-weight: 600; }
html[data-theme="nsuem"] .nav-caption { color: #697489; font-size: 11px; text-transform: none; font-weight: 400; }
html[data-theme="nsuem"] .nav-item { position: relative; color: #4e5b70; border-radius: 4px; font-size: 12px; font-weight: 400; }
html[data-theme="nsuem"] .nav-item .nav-icon { color: #748199; }
html[data-theme="nsuem"] .nav-item:hover { color: #173eac; background: #f5f7fc; }
html[data-theme="nsuem"] .nav-item.active { color: #173eac; background: #edf1fd; font-weight: 700; box-shadow: none; }
html[data-theme="nsuem"] .nav-item.active::before { position: absolute; content: ""; left: -14px; top: 9px; bottom: 9px; width: 3px; background: #f58345; }
html[data-theme="nsuem"] .nav-item.active .nav-icon { color: #173eac; }
html[data-theme="nsuem"] .sidebar-foot { border: 0; border-top: 1px solid var(--border); border-radius: 0; background: #fff; }
html[data-theme="nsuem"] .avatar { color: #173eac; background: #edf1fd; }
html[data-theme="nsuem"] .user-meta small { color: var(--muted); }
html[data-theme="nsuem"] .logout-button { color: #173eac; border-color: var(--border); }
html[data-theme="nsuem"] .sidebar-close { color: #173eac; }
html[data-theme="nsuem"] .topbar { background: rgba(255,255,255,.94); box-shadow: none; }
html[data-theme="nsuem"] :is(.year-chip,.role-chip) { color: #52627c; background: #fff; border-color: var(--border); font-weight: 400; }
html[data-theme="nsuem"] .role-chip { color: #173eac; background: #edf1fd; }
html[data-theme="nsuem"] .page-heading { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
html[data-theme="nsuem"] .page-heading h1 { font-size: 28px; font-weight: 600; line-height: 1.3; }
html[data-theme="nsuem"] .page-heading p { font-size: 12px; line-height: 1.65; }
html[data-theme="nsuem"] .hero { min-height: 0; color: var(--text); background: #fff; border-radius: 0; border-top: 3px solid #173eac; border-bottom: 1px solid var(--border); box-shadow: none; padding: 26px; }
html[data-theme="nsuem"] .hero h1 { color: #173eac; font-size: 28px; line-height: 1.3; }
html[data-theme="nsuem"] :is(.hero p,.hero .eyebrow.light) { color: var(--muted); }
html[data-theme="nsuem"] .hero-meta span { background: #f5f7fc; border-color: var(--border); color: var(--text); }
html[data-theme="nsuem"] .hero-updated { color: var(--muted); }
html[data-theme="nsuem"] .hero-updated :is(strong,b) { color: var(--text); }
html[data-theme="nsuem"] :is(.hero-counter,.hero-counter strong,.dashboard-first-course strong) { color: #173eac; }
html[data-theme="nsuem"] .hero-risk-note { color: #854413; background: #fff3e9; border-color: #ebcfbb; }
html[data-theme="nsuem"] :is(.kpi,.kpi-card) { background: #fff; border-color: var(--border); border-radius: 6px; box-shadow: none; }
html[data-theme="nsuem"] .kpi-primary { border-top: 3px solid #173eac; }
html[data-theme="nsuem"] .kpi-primary :is(.kpi-label,small) { color: var(--muted); }
html[data-theme="nsuem"] .kpi-primary strong { color: #173eac; }
html[data-theme="nsuem"] .kpi strong { font-weight: 600; }
html[data-theme="nsuem"] :is(.kpi-label,.kpi-card>span) { text-transform: none; font-weight: 400; }
html[data-theme="nsuem"] a.kpi:hover { transform: none; border-color: #173eac; }
html[data-theme="nsuem"] :is(.panel,.filter-panel,.program-drawer,.formula-popover,.modal-card,.registry-view-dialog,.login-card,.public-card) { border-color: var(--border); border-radius: 6px; box-shadow: none; }
html[data-theme="nsuem"] .panel-header { min-height: 56px; background: #fff; border-color: var(--border); }
html[data-theme="nsuem"] .panel-header h2 { color: var(--text-strong); font-size: 17px; font-weight: 600; }
html[data-theme="nsuem"] .panel-index { background: #edf1fd; color: #173eac; border-radius: 3px; }
html[data-theme="nsuem"] .warning-index { color: #854413; background: #fff3e9; }
html[data-theme="nsuem"] :is(.button,.input,select,textarea,.search-field input) { border-radius: 4px; box-shadow: none; }
html[data-theme="nsuem"] .button-primary { background: #173eac; border: 1px solid #173eac; color: #fff; }
html[data-theme="nsuem"] .button-primary:hover { background: #102c7d; transform: none; box-shadow: none; }
html[data-theme="nsuem"] :is(.button-light,.button-secondary,.button-outline) { background: #fff; color: #173eac; border: 1px solid #cdd5e0; }
html[data-theme="nsuem"] :is(.button-light,.button-secondary,.button-outline):hover { background: #f5f7fc; border-color: #173eac; }
html[data-theme="nsuem"] :is(.filter-panel,.filter-bar) { background: #fff; border-color: var(--border); }
html[data-theme="nsuem"] .data-table { font-size: 12px; }
html[data-theme="nsuem"] .data-table th { background: #f4f6fa; color: #52627c; border-color: var(--border); font-size: 11px; text-transform: none; font-weight: 600; }
html[data-theme="nsuem"] .data-table td { border-color: #e8ebf0; }
html[data-theme="nsuem"] .data-table tbody tr:hover { background: #f5f7fc; }
html[data-theme="nsuem"] .data-table .cell-title { font-size: 12px; font-weight: 600; }
html[data-theme="nsuem"] .cross-year-table thead th { color: #34415a; background: #f0f3f8; font-size: 11px; text-transform: none; letter-spacing: 0; }
html[data-theme="nsuem"] .cross-year-table thead th small { color: #52627c; font-size: 10px; }
html[data-theme="nsuem"] .cross-year-table thead .year-current { color: #173eac; background: #edf1fd; box-shadow: inset 0 -3px #173eac; }
html[data-theme="nsuem"] .cross-year-table thead .year-future { color: #854413; background: #fff3e9; box-shadow: inset 0 -3px #f58345; }
html[data-theme="nsuem"] .cross-year-table thead :is(.matrix-total-head,.matrix-average-head) { color: #173eac; background: #e8edf9; }
html[data-theme="nsuem"] :is(.matrix-cohort-heading,.matrix-group-heading) b { font-family: "NewROP Reports", Verdana, sans-serif; font-size: 14px; }
html[data-theme="nsuem"] .period-future { color: #854413; background: #fff3e9; }
html[data-theme="nsuem"] .period-past { color: #445168; background: #e8ecf2; }
html[data-theme="nsuem"] .period-current { color: #173eac; background: #edf1fd; }
html[data-theme="nsuem"] :is(.source-badge,.year-chip,.role-chip,.tag) { border-radius: 4px; }
html[data-theme="nsuem"] :is(.analytics-tabs,.tabs) a { border-radius: 3px; box-shadow: none; }
html[data-theme="nsuem"] :is(.analytics-tabs,.tabs) a.active { color: #173eac; background: #edf1fd; border-color: #173eac; }
html[data-theme="nsuem"] :is(.analytics-version-strip,.metric-context-bar) { background: #fff; border: 1px solid var(--border); border-left: 3px solid #173eac; color: var(--text); border-radius: 0; }
html[data-theme="nsuem"] :is(.analytics-version-strip,.metric-context-bar) :is(span,small,strong,b) { color: inherit; }
html[data-theme="nsuem"] .metric-context-bar .field-label { color: #52627c; }
html[data-theme="nsuem"] .hero-risk { color: #854413; background: #fff3e9; border-color: #ebcfbb; }
html[data-theme="nsuem"] :is(.bar-track i,.status-chart-row em) { background: #173eac; }
html[data-theme="nsuem"] :is(.formula-info,.row-arrow) { color: #173eac; background: #edf1fd; border-color: #cdd5e0; }
html[data-theme="nsuem"] :is(.calculator-nav,.calculator-summary,.calculator-actions,.calculator-bottom-bar) { box-shadow: none; border-color: var(--border); }
html[data-theme="nsuem"] :is(.calculator-head,.unit-detail-head,.program-head) { color: var(--text); background: #fff; border: 1px solid var(--border); border-top: 3px solid #173eac; border-radius: 4px; box-shadow: none; }
html[data-theme="nsuem"] :is(.calculator-head,.unit-detail-head) :is(p,small) { color: var(--muted); }
html[data-theme="nsuem"] .calculator-head :is(.tag,.status) { color: #173eac; background: #edf1fd; border-color: #cdd5e0; }
html[data-theme="nsuem"] .completion-ring { color: #173eac; background: radial-gradient(circle at center, #fff 58%, transparent 60%), conic-gradient(#173eac calc(var(--progress) * 1%), #e2e7f0 0); }
html[data-theme="nsuem"] .completion-ring span { color: var(--muted); }
html[data-theme="nsuem"] .calculator-status-dock { border-color: var(--border); border-radius: 4px; box-shadow: 0 3px 8px #171d2a0a; }
html[data-theme="nsuem"] .constants-grid>div { background: #fff; border-color: var(--border); border-radius: 4px; }
html[data-theme="nsuem"] .calculator-nav a.active { color: #173eac; background: #edf1fd; border-left-color: #f58345; }
html[data-theme="nsuem"] :is(.program-drawer-head,.program-drawer-body,.modal-header) { background: #fff; border-color: var(--border); }
html[data-theme="nsuem"] :is(.instruction-hero-card,.instruction-section,.instruction-toc,.acceptance-card,.reference-health-card,.indicator-catalog-card,.cohort-summary-card,.scenario-list article) { border-radius: 6px; border-color: var(--border); box-shadow: none; }
html[data-theme="nsuem"] :is(.instruction-prerequisites,.user-edit-grid,.reference-item>form,.nature-composition,.decision-support,.cohort-summary-card dl div) { background: #f5f7fc; border-radius: 4px; }
html[data-theme="nsuem"] .login-page { background: #f5f6f9; }
html[data-theme="nsuem"] .login-brand-panel { color: var(--text); background: #fff; border-right: 1px solid var(--border); }
html[data-theme="nsuem"] .login-brand-top strong { color: #173eac; }
html[data-theme="nsuem"] .login-message { padding-top: 24px; border-top: 3px solid #f58345; }
html[data-theme="nsuem"] .login-message h1 { color: #173eac; font-size: 48px; line-height: 1.2; font-weight: 600; }
html[data-theme="nsuem"] :is(.login-message>p,.login-brand-panel>small) { color: var(--muted); }
html[data-theme="nsuem"] .login-message .eyebrow.light { color: var(--muted); }
html[data-theme="nsuem"] .login-points span { color: var(--text); background: #fff; border-color: var(--border); }
html[data-theme="nsuem"] .login-points b { color: #173eac; }
html[data-theme="nsuem"] .login-card { padding: 32px; border-top: 3px solid #173eac; }
html[data-theme="nsuem"] .login-card .field-label { margin-bottom: 8px; font-size: 12px; }
html[data-theme="nsuem"] .login-card .button { min-height: 40px; font-size: 13px; }
html[data-theme="nsuem"] .login-hint { font-size: 12px; }
html[data-theme="nsuem"] .public-page { background: var(--canvas); }
html[data-theme="nsuem"] .public-header { background: #fff; color: #173eac; border-bottom: 1px solid var(--border); }
html[data-theme="nsuem"] .public-brand small { color: var(--muted); }
html[data-theme="nsuem"] :is(.public-hero,.public-program-head) { color: var(--text); background: #fff; border-radius: 0; border-top: 3px solid #173eac; }
html[data-theme="nsuem"] :is(.public-hero,.public-program-head) :is(p,small) { color: var(--muted); }
html[data-theme="nsuem"] :is(.public-hero,.public-program-head) h1 { font-size: 30px; line-height: 1.3; }
@media (max-width: 1240px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions .year-chip:not(.notification-chip), .topbar-actions .role-chip { display: none; }
}
@media (max-width: 760px) {
  .topbar { min-height: 64px; gap: 8px; }
  .topbar-path { flex-basis: 80px; font-size: 12px; }
  .topbar-actions { flex: 0 0 auto; margin-left: auto; }
  .topbar-actions .notification-chip { display: none; }
  .theme-switch span { min-width: 60px; min-height: 32px; font-size: 11px; padding: 4px 6px; }
  .theme-standalone { padding: 14px; }
  .login-form-panel { padding-top: 78px; }
  .public-header > .theme-switch { order: 3; margin-left: 0; }
  html[data-theme="nsuem"] .page-heading h1 { font-size: 24px; }
  html[data-theme="nsuem"] .hero { padding: 22px 18px; }
  html[data-theme="nsuem"] .hero h1 { font-size: 24px; }
  html[data-theme="nsuem"] .login-card { padding: 26px 22px; }
}
@media print { .theme-switch, .theme-standalone { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  html[data-theme="nsuem"] *, html[data-theme="nsuem"] *::before, html[data-theme="nsuem"] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .theme-switch input:checked + span { background: Highlight; color: HighlightText; border-color: Highlight; }
}
