/* HSRD interface system. Presentation only; data and permission contracts stay unchanged. */
body.ui-v2 {
  --ui-bg: #f5f7fb;
  --ui-surface: #fff;
  --ui-subtle: #f8fafc;
  --ui-text: #192334;
  --ui-muted: #68778c;
  --ui-line: #e2e7ef;
  --ui-accent: #345de3;
  --ui-accent-soft: #eef2ff;
  --ui-positive: #137e69;
  --ui-danger: #c54747;
  --ui-warning: #a76a12;
  --ui-radius: 10px;
  --ui-nav-width: 204px;
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.ui-v2 :is(button, input, select, textarea) { font: inherit; }
.ui-v2 :is(button, a, input, select, summary):focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 3px;
}
.ui-v2 :is(button, a) { transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease; }
.ui-v2 :is(button, input, select):disabled { cursor: not-allowed; opacity: .5; }
.ui-v2 :is(strong, b) { font-weight: 650; }
.ui-v2 :is(input, select, textarea) { accent-color: var(--ui-accent); }
.ui-v2 :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  color: var(--ui-text);
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  box-shadow: none;
}
.ui-v2 :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select) {
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 0 11px;
}
.ui-v2 :is(input, select, textarea):focus { border-color: var(--ui-accent); }
.ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .risk-dashboard-page, .mcn-dashboard-page, .ecommerce-dashboard, .overseas-dashboard-page) {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 28px 32px 40px;
  min-width: 0;
  background: transparent;
}
.ui-v2:has(.dashboard-nav) > main {
  width: calc(100% - var(--ui-nav-width));
  margin-left: var(--ui-nav-width);
  margin-right: 0;
}
.ui-v2 :is(.topbar, .domain-dashboard-header, .ecommerce-topbar) {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  margin: 0 0 22px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--ui-line);
}
.ui-v2 .brand-lockup { gap: 12px; }
.ui-v2 .topbar .brand-mark { display: none; }
.ui-v2 :is(.brand-lockup h1, .admin-header h1, .domain-dashboard-header h1, .ecommerce-topbar h1) {
  margin: 3px 0 0;
  color: var(--ui-text);
  font-size: 25px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.04em;
}
.ui-v2 :is(.brand-lockup small, .admin-header small, .ecommerce-topbar small) {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
}
.ui-v2 :is(.domain-dashboard-header, .ecommerce-topbar) p {
  margin-top: 8px;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.65;
}
.ui-v2 .account-actions { width: auto; align-items: center; gap: 15px; padding-top: 8px; }
.ui-v2 .account-actions > div { gap: 2px; }
.ui-v2 .account-actions > div strong { font-size: 13px; }
.ui-v2 .account-actions > div small { color: var(--ui-muted); font-size: 12px; }
.ui-v2 .secure-chip { padding: 4px 9px; border: 1px solid var(--ui-line); background: transparent; color: var(--ui-muted); font-size: 12px; font-weight: 450; }

/* A single navigation tree: desktop rail, horizontally scrollable mobile navigation. */
.ui-v2 .dashboard-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: var(--ui-nav-width);
  height: 100dvh;
  gap: 8px;
  padding: 26px 14px 18px;
  overflow-y: auto;
  border: 0;
  background: #111b2e;
  color: #bbc6d8;
  scrollbar-width: thin;
}
.ui-v2 .nav-brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 27px; }
.ui-v2 .nav-brand > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #6f8eff;
  border-radius: 7px;
  background: var(--ui-accent);
  color: #fff;
  font-size: 21px;
  font-weight: 750;
  line-height: 1;
}
.ui-v2 .nav-brand > div { display: grid; gap: 0; }
.ui-v2 .nav-brand strong { color: #fff; font-size: 17px; letter-spacing: .12em; line-height: 1.25; }
.ui-v2 .nav-brand small { color: #a2b2cb; font-size: 11px; letter-spacing: .13em; }
.ui-v2 .dashboard-nav-group { width: 100%; margin: 10px 0 0; padding: 0; }
.ui-v2 .dashboard-nav-group > h2 { margin: 0 11px 7px; color: #8495af; font-size: 11px; font-weight: 500; letter-spacing: .13em; }
.ui-v2 .dashboard-nav-menu {
  position: static;
  display: grid;
  width: 100%;
  padding: 0;
  gap: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.ui-v2 .dashboard-nav a:not(.nav-brand), .ui-v2 .dashboard-nav-logout .link-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 39px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #bdc8da;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.ui-v2 .dashboard-nav a::before { content: ""; flex: 0 0 6px; height: 6px; border: 1px solid #667b9b; border-radius: 2px; }
.ui-v2 .dashboard-nav-menu small { display: none; }
.ui-v2 .dashboard-nav a:hover, .ui-v2 .dashboard-nav-logout .link-button:hover { background: #1b2940; color: #fff; }
.ui-v2 .dashboard-nav a[aria-current=page] { background: #263b69; color: #fff; border-color: #314977; }
.ui-v2 .dashboard-nav a[aria-current=page]::before { background: #8aa7ff; border-color: #8aa7ff; }
.ui-v2 .dashboard-nav-logout { margin-top: auto; padding-top: 18px; }
.ui-v2 .dashboard-nav-logout .link-button { border-top-color: #29364d; border-radius: 0; color: #98aac4; }

/* Query controls keep their original IDs and submission semantics. */
.ui-v2 .view-tabs { width: auto; margin: 0 0 18px; padding: 0; gap: 24px; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; background: transparent; }
.ui-v2 .view-tabs button { padding: 10px 0 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--ui-muted); font-weight: 500; box-shadow: none; }
.ui-v2 .view-tabs button.active { color: var(--ui-accent); border-bottom-color: var(--ui-accent); background: transparent; box-shadow: none; font-weight: 650; }
.ui-v2 :is(.filters, .finance-query-bar, .hr-query-bar, .mcn-query, .risk-query, .overseas-query, .ecommerce-query) {
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 12px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: #fff;
  box-shadow: none;
}
.ui-v2 .filters { flex-wrap: wrap; }
.ui-v2 :is(.segments, .progress-switch) { padding: 3px; background: #f1f4f9; border: 1px solid #edf0f5; border-radius: 6px; }
.ui-v2 :is(.segments, .progress-switch) button { border-radius: 4px; color: var(--ui-muted); font-size: 13px; font-weight: 550; padding: 6px 13px; min-height: 30px; }
.ui-v2 :is(.segments, .progress-switch) button.active { background: #fff; color: var(--ui-text); box-shadow: 0 1px 3px #19233414; }
.ui-v2 .date-filter { flex-wrap: wrap; gap: 8px; }
.ui-v2 :is(.date-filter label, .mcn-query label, .hr-query-bar label, .risk-query label, .finance-query-bar label, .overseas-query label) { color: var(--ui-muted); font-weight: 500; font-size: 13px; }
.ui-v2 :is(.date-filter button, .detail-filters > button, .mcn-query > button, .risk-query > button, .finance-query-bar > button, .overseas-query > button, .hr-query-actions button, .ecommerce-query button, .auth-form button, .admin-form > button, .permission-save-row button, .mcn-primary-button, .drilldown-close-button) {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--ui-accent);
  color: #fff;
  font-weight: 550;
  box-shadow: none;
}
.ui-v2 :is(.date-filter button, .detail-filters > button, .auth-form button):hover { background: #254ac9; }
.ui-v2 .query-scope-bar { margin: 0 0 20px; gap: 10px; color: var(--ui-muted); font-size: 12px; }
.ui-v2 .period-shortcuts { gap: 5px; }
.ui-v2 .period-shortcuts button { padding: 5px 9px; border-color: var(--ui-line); border-radius: 5px; color: #55647b; font-size: 12px; }
.ui-v2 .period-shortcuts button:hover { border-color: #b9c8f5; background: var(--ui-accent-soft); color: var(--ui-accent); }
.ui-v2 .scope-caption { color: var(--ui-muted); font-size: 12px; }

/* Shared information hierarchy across all business domains. */
.ui-v2 :is(.kpi, .panel, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article, .ecommerce-card) {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: #fff;
  color: var(--ui-text);
  box-shadow: 0 1px 2px #19233403;
}
.ui-v2 :is(.panel, .ecommerce-card) { padding: 22px; }
.ui-v2 :is(.executive-kpis, .kpis, .domain-kpis, .hr-kpis, .mcn-kpis, .finance-kpis, .risk-kpis, .ecommerce-kpis, .overseas-kpis) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ui-v2 :is(.kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) { min-height: 124px; padding: 18px 20px; align-content: start; gap: 9px; }
.ui-v2 :is(.kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) > span { color: var(--ui-muted); font-size: 13px; font-weight: 500; }
.ui-v2 :is(.kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) > strong {
  color: var(--ui-text);
  font-size: clamp(23px, 2.05vw, 34px);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -.045em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}
.ui-v2 :is(.kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) > small { color: var(--ui-muted); font-size: 12px; line-height: 1.6; }
.ui-v2 .kpi.primary { background: #192a48; border-color: #192a48; color: #fff; }
.ui-v2 .kpi.primary > strong { color: #fff; }
.ui-v2 .kpi.primary > span { color: #c7d3e8; }
.ui-v2 .kpi.primary > small { color: #a3b7d6; }
.ui-v2 .kpi.target { background: #fff; }
.ui-v2 .result-strip { border-color: var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-line); }
.ui-v2 .result-strip > div { padding: 16px 20px; }
.ui-v2 .result-strip :is(span, small) { color: var(--ui-muted); font-weight: 450; }
.ui-v2 .result-strip strong { color: var(--ui-text); font-size: 21px; font-weight: 550; font-variant-numeric: tabular-nums; }
.ui-v2 .panel-title { gap: 20px; align-items: flex-start; }
.ui-v2 .panel-title small { color: #8a96a7; font-size: 11px; font-weight: 500; letter-spacing: .08em; }
.ui-v2 .panel-title h2 { margin-top: 3px; color: var(--ui-text); font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.ui-v2 .panel-title > span { color: var(--ui-muted); font-size: 12px; max-width: 48%; line-height: 1.6; }
.ui-v2 :is(.management-grid, .strategy-grid, .profit-grid, .domain-dashboard-grid, .mcn-main-grid) { gap: 16px; }
.ui-v2 .management-grid { grid-template-columns: minmax(0, 1.8fr) minmax(290px, .9fr); }
.ui-v2 .strategy-grid { grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); }
.ui-v2 :is(.comparison-cards > div, .structure-kpi, .profit-components > div, .asset-facts > div, .axis-guide-grid > div) { border: 1px solid #edf0f5; border-radius: 7px; background: var(--ui-subtle); }
.ui-v2 :is(.structure-kpis strong, .comparison-cards strong, .asset-facts strong, .profit-components strong) { color: var(--ui-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-v2 .structure-kpi:hover { border-color: #bccaf4; background: #f4f6ff; }
.ui-v2 .structure-kpi em { color: var(--ui-accent); font-size: 12px; font-weight: 500; }
.ui-v2 .mix-list i, .ui-v2 .overseas-coverage { background: #eef1f7; }
.ui-v2 .mix-list b, .ui-v2 .overseas-coverage i { background: #738fd4; }
.ui-v2 .mix-list :is(span, strong) { color: #627189; }
.ui-v2 :is(.source-grid article, .quality-grid article, .empty-state) { background: var(--ui-subtle); border-color: var(--ui-line); border-radius: 7px; color: var(--ui-muted); }
.ui-v2 .empty-state { padding: 24px; line-height: 1.7; }
.ui-v2 :is(.insight, .trend-detail, .risk-footnote) { color: #53647c; background: #f4f6fb; border: 1px solid #e9edf5; border-radius: 6px; font-size: 12px; }
.ui-v2 :is(.rule-note, .scope-caption, .mover-list span, .maturity-list span) { color: var(--ui-muted); }
.ui-v2 .maturity-list strong { color: #40526d; font-weight: 550; }

/* Chart axis and scrolling containers are deliberately left separate. */
.ui-v2 .trend-svg .trend-bar { fill: #9aaedb; }
.ui-v2 .trend-svg .trend-bar.selected { fill: #d69a24; }
.ui-v2 .trend-svg .trend-average { stroke: #62769e; }
.ui-v2 .trend-svg .trend-grid, .ui-v2 .trend-axis-line { stroke: #e5eaf2; }
.ui-v2 .trend-svg text, .ui-v2 .trend-axis text { fill: #71819a; }
.ui-v2 .trend-svg .trend-amount { fill: #34496c; font-weight: 550; }
.ui-v2 .trend-svg .trend-rise { fill: var(--ui-positive); }
.ui-v2 .trend-svg .trend-fall { fill: var(--ui-danger); }
.ui-v2 .trend-plot:focus-visible { outline-color: var(--ui-accent); }
.ui-v2 .radar-value { fill: #345de31f; stroke: var(--ui-accent); }
.ui-v2 .radar-dot { stroke: var(--ui-accent); }
.ui-v2 .radar-score { fill: var(--ui-accent); }
.ui-v2 .radar-label { fill: #52637c; }
.ui-v2 .mcn-trend-row i { background: #7a96d8; }

/* Tables remain horizontally scrollable; no global fixed column widths. */
.ui-v2 :is(.table-wrap, .domain-trend-table-wrap, .hr-team-table-wrap, .mcn-table-wrap, .ecommerce-table-wrap, .overseas-table-wrap) {
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  scrollbar-color: #bcc6d8 #f0f3f8;
  scrollbar-width: thin;
}
.ui-v2 :is(.table-wrap, .domain-trend-table-wrap, .hr-team-table-wrap, .mcn-table-wrap, .ecommerce-table-wrap, .overseas-table-wrap) table { margin-top: 0; }
.ui-v2 table { color: var(--ui-text); font-variant-numeric: tabular-nums; }
.ui-v2 table :is(th, td) { padding: 12px 14px; border-bottom-color: #edf0f5; font-size: 13px; }
.ui-v2 table th { background: #f7f9fc; color: #6e7c90; font-weight: 500; }
.ui-v2 table tbody tr:hover > td { background-color: #f2f5fc; }
.ui-v2 table tr.incomplete { background: #fffcf5; }
.ui-v2 table td:first-child { color: var(--ui-text); }
.ui-v2 table .team-subtotal td { background: #edf2fb; border-top: 1px solid #dae3f2; color: #3e5579; font-weight: 650; }
.ui-v2 :is(.detail-drill, .customer-breakdown summary, .detail-breadcrumb button, .metric-ratio, .asset-facts small, .text-link) { color: var(--ui-accent); font-weight: 550; text-decoration-color: #c7d3f6; }
.ui-v2 .detail-filters { gap: 8px; }
.ui-v2 .detail-filters > span { white-space: normal; overflow-wrap: anywhere; }
.ui-v2 .advanced-query > summary { height: 38px; border-color: var(--ui-line); border-radius: 6px; color: var(--ui-muted); font-weight: 500; }
.ui-v2 .advanced-query > div { border-color: var(--ui-line); box-shadow: 0 12px 28px #1923341a; }
.ui-v2 .export-controls { padding: 16px; border-color: #dce4f5; border-radius: 8px; background: #f5f7ff; }
.ui-v2 .export-controls :is(strong, label) { color: #3e547b; font-weight: 550; }
.ui-v2 .export-controls p, .ui-v2 .export-preview > small { color: var(--ui-muted); font-size: 12px; }
.ui-v2 .export-controls #customer-export { border: 1px solid #c5d1f4; border-radius: 6px; background: #fff; color: var(--ui-accent); font-weight: 600; }
.ui-v2 .export-controls #customer-export:hover:not(:disabled) { background: var(--ui-accent-soft); }

/* Contextual drilldown: preserve the flex/no-shrink fix for long client lists. */
.ui-v2 .action-list { gap: 0; max-height: 350px; }
.ui-v2 .action-item { border-radius: 0; background: #fff; padding: 13px 0; }
.ui-v2 .action-item + .action-item { border-top: 1px solid #edf0f5; }
.ui-v2 .action-item strong { font-size: 14px; font-weight: 550; }
.ui-v2 .action-item small { color: var(--ui-muted); font-size: 12px; }
.ui-v2 .action-item.clickable em { font-weight: 500; color: var(--ui-accent); }
.ui-v2 .action-item.clickable:hover { background: #f6f8ff; }
.ui-v2 .drilldown-overlay { background: #111b2e66; backdrop-filter: blur(3px); }
.ui-v2 .drilldown-drawer { width: min(780px, 96vw); background: var(--ui-bg); box-shadow: -12px 0 60px #101b2e26; }
.ui-v2 .drilldown-drawer > header { border-bottom-color: var(--ui-line); padding: 24px; }
.ui-v2 .drilldown-drawer > header h2 { color: var(--ui-text); font-size: 25px; font-weight: 600; }
.ui-v2 .drilldown-drawer > header :is(p, small) { color: var(--ui-muted); }
.ui-v2 .drilldown-result-meta { background: #eef2fb; color: #425a80; border-color: #dfe6f4; padding: 14px 24px; }
.ui-v2 .drilldown-list { padding: 18px; gap: 12px; display: flex; flex-direction: column; }
.ui-v2 .drilldown-customer-card { flex: 0 0 auto; min-height: max-content; height: auto; border-color: var(--ui-line); border-radius: 8px; box-shadow: none; }
.ui-v2 .drilldown-customer-card :is(h3, strong) { color: var(--ui-text); }
.ui-v2 .drilldown-customer-card summary { color: var(--ui-accent); background: #f8faff; border-color: var(--ui-line); font-weight: 550; }
.ui-v2 .drilldown-drawer > footer { border-color: var(--ui-line); }
.ui-v2 .drilldown-drawer > footer button { border-radius: 6px; background: var(--ui-accent); }
.ui-v2 .drilldown-drawer > footer span { color: var(--ui-muted); }
.ui-v2 .drilldown-drawer > header > button { color: #516786; background: #f3f6fc; border-color: var(--ui-line); border-radius: 7px; }
.ui-v2 .drilldown-result-meta strong { color: #425a80; }
.ui-v2 .drawer-evidence { background: #f8faff; }
.ui-v2 .drawer-evidence-grid b { color: #40526d; }
.ui-v2 .dashboard-loading-card { border-radius: 10px; border-color: var(--ui-line); box-shadow: 0 20px 70px #19233414; }
.ui-v2 .dashboard-loading-card strong { color: var(--ui-text); }
.ui-v2 .dashboard-loading-spinner { border-color: #e2e8fa; border-top-color: var(--ui-accent); }

/* Semantic status colors: distinguish warnings from the navigation accent. */
.ui-v2 :is(.positive, .positive-text, .status-pill.gain, .completeness-badge.complete) { color: var(--ui-positive) !important; }
.ui-v2 :is(.negative, .negative-text, .status-pill.loss, .risk-red-text, .difference-text, .completeness-badge.blocked) { color: var(--ui-danger) !important; }
.ui-v2 :is(.warning, .risk-yellow-text, .maturity-list .warning, .completeness-badge.partial) { color: var(--ui-warning); }
.ui-v2 :is(.domain-kpi.negative, .risk-kpis .red) > strong { color: var(--ui-danger); }
.ui-v2 :is(.risk-kpis .yellow, .mcn-kpi-risk, .overseas-kpis .overseas-estimate) { background: #fffcf5; border-color: #ede2cc; }
.ui-v2 :is(.domain-status-banner, .finance-quality-strip, .ecommerce-source-note) { border-radius: 7px; padding: 12px 16px; font-size: 12px; line-height: 1.65; }
.ui-v2 :is(.domain-status-banner.published, .finance-quality-strip) { border: 1px solid #dce5ef; background: #eef3f9; color: #465e7b; }
.ui-v2 :is(.domain-status-banner, .ecommerce-source-note) p { color: #6e7f93; }
.ui-v2 :is(.profit-caveat, .freshness-banner, .completeness-reasons, .asset-missing) { border: 1px solid #eedfbe; border-radius: 7px; background: #fffbf2; color: #87632a; }
.ui-v2 :is(.mcn-reconciliation-flow article, .mcn-finance-categories span, .permission-matrix fieldset, .permission-user-card) { border-color: var(--ui-line); border-radius: 8px; box-shadow: none; }
.ui-v2 .mcn-reconciliation-flow .highlight { background: #eef2ff; border-color: #d5dff9; }
.ui-v2 .mcn-reconciliation-flow article strong { color: var(--ui-text); }
.ui-v2 :is(.dashboard footer, .domain-dashboard-footer, .ecommerce-dashboard footer) { color: #8894a7; font-size: 12px; }

/* Sign-in and account management inherit the same visual language. */
.ui-v2 .auth-page { background: #f5f7fb; }
.ui-v2 .auth-card { border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; box-shadow: 0 18px 60px #1923340a; }
.ui-v2 .brand-mark { border-radius: 8px; background: #192a48; box-shadow: none; }
.ui-v2 .auth-copy h2 { font-size: 25px; color: var(--ui-text); font-weight: 600; }
.ui-v2 .auth-form input:not([type=checkbox]):not([type=hidden]) { height: 44px; }
.ui-v2 .auth-form button { height: 44px; }
.ui-v2 .security-note { border-color: var(--ui-line); font-size: 12px; }
.ui-v2 .security-note span { color: var(--ui-accent); }
.ui-v2 .permission-user-card .user-avatar { color: var(--ui-accent); background: var(--ui-accent-soft); }
.ui-v2 .admin-header > div { min-width: 0; }
.ui-v2 .admin-header > a, .ui-v2 .admin-header > nav:not(.dashboard-nav) { flex-shrink: 0; white-space: nowrap; }
.ui-v2 .admin-header > a { color: var(--ui-accent); }
.ui-v2 .integration-card button { border-radius: 6px; background: var(--ui-accent); font-weight: 550; }
.ui-v2 .integration-card dl > div { min-width: 0; }
.ui-v2 .integration-card dd { overflow-wrap: anywhere; }

@media (min-width: 1760px) {
  .ui-v2 :is(.executive-kpis, .mcn-kpis, .finance-kpis, .overseas-kpis) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ui-v2 :is(.executive-kpis .kpi, .mcn-kpis article, .finance-kpis article, .overseas-kpis article) > strong { font-size: 27px; }
}
@media (max-width: 1279px) {
  .ui-v2 { --ui-nav-width: 180px; }
  .ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .ecommerce-dashboard) { padding: 24px; }
  .ui-v2 .management-grid { grid-template-columns: minmax(0, 1fr); }
  .ui-v2 .action-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; max-height: none; }
  .ui-v2 :is(.strategy-grid, .profit-grid, .asset-grid) { grid-template-columns: minmax(0, 1fr); }
  .ui-v2 .secure-chip { display: none; }
}
@media (max-width: 900px) {
  .ui-v2:has(.dashboard-nav) > main { width: 100%; margin: 0; }
  .ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .ecommerce-dashboard) { padding: 20px; }
  .ui-v2 :is(.topbar, .domain-dashboard-header, .ecommerce-topbar) { display: flex; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 0; gap: 12px; }
  .ui-v2 .account-actions { display: contents; }
  .ui-v2 .account-actions > div { margin-left: auto; }
  .ui-v2 .dashboard-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    height: auto;
    gap: 4px;
    padding: 8px 0;
    overflow-x: auto;
    overflow-y: hidden;
    background: transparent;
    border-top: 1px solid var(--ui-line);
    scrollbar-width: thin;
    scroll-padding-inline: 12px;
  }
  .ui-v2 .nav-brand, .ui-v2 .dashboard-nav-group > h2 { display: none; }
  .ui-v2 .dashboard-nav-group, .ui-v2 .dashboard-nav-menu { display: contents; }
  .ui-v2 .dashboard-nav a:not(.nav-brand), .ui-v2 .dashboard-nav-logout .link-button {
    width: auto;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 11px;
    border: 0;
    border-radius: 5px;
    color: var(--ui-muted);
    background: transparent;
    font-size: 13px;
  }
  .ui-v2 .dashboard-nav a::before { display: none; }
  .ui-v2 .dashboard-nav a[aria-current=page] { color: var(--ui-accent); background: #e9eefc; }
  .ui-v2 .dashboard-nav a:hover { color: var(--ui-accent); background: #edf2fc; }
  .ui-v2 .dashboard-nav-logout { margin: 0; padding: 0; }
  .ui-v2 :is(.domain-dashboard-grid, .mcn-main-grid, .mcn-breakdown-grid, .overseas-main-grid) { grid-template-columns: minmax(0, 1fr); }
  .ui-v2 .detail-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-v2 :is(.hr-query-bar, .mcn-query, .risk-query, .overseas-query) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-v2 .date-filter { width: 100%; }
  .ui-v2 .permissions-layout, .ui-v2 .integration-grid { grid-template-columns: minmax(0, 1fr); }
  .ui-v2 .panel-title { flex-wrap: wrap; gap: 8px; }
  .ui-v2 .panel-title > span { max-width: 100%; }
}
@media (max-width: 600px) {
  .ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .ecommerce-dashboard) { padding: 16px 12px 32px; }
  .ui-v2 :is(.kpis, .executive-kpis, .domain-kpis, .hr-kpis, .mcn-kpis, .finance-kpis, .risk-kpis, .ecommerce-kpis, .overseas-kpis) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ui-v2 :is(.kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) { padding: 14px; }
  .ui-v2 :is(.kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) > strong { font-size: 23px; }
  .ui-v2 :is(.panel, .ecommerce-card) { padding: 16px; }
  .ui-v2 .panel-title h2 { font-size: 17px; }
  .ui-v2 .date-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .ui-v2 .date-filter label { grid-column: 1 / -1; }
  .ui-v2 .date-filter button { grid-column: 1 / -1; }
  .ui-v2 .date-filter input { width: 100%; padding: 0 6px; font-size: 12px; }
  .ui-v2 .result-strip { grid-template-columns: 1fr; }
  .ui-v2 .result-strip > div { padding: 12px 16px; }
  .ui-v2 .action-list { display: flex; flex-direction: column; }
  .ui-v2 .structure-kpis { grid-template-columns: 1fr; }
  .ui-v2 .structure-kpi { grid-template-columns: 1fr auto; align-items: center; }
  .ui-v2 .structure-kpi small { grid-column: 1; }
  .ui-v2 .structure-kpi em { grid-column: 2; }
  .ui-v2 .profit-components { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-v2 .profit-components > i { grid-column: 1 / -1; }
  .ui-v2 .source-grid, .ui-v2 .quality-grid { grid-template-columns: 1fr; }
  .ui-v2 .drilldown-drawer { width: 100%; }
  .ui-v2 .drilldown-drawer > header { padding: 18px; }
  .ui-v2 .drilldown-drawer > header h2 { font-size: 22px; }
  .ui-v2 .drilldown-list { padding: 12px; }
  .ui-v2 .export-controls { gap: 10px; }
  .ui-v2 .account-fields, .ui-v2 .permission-matrix { grid-template-columns: minmax(0, 1fr); }
  .ui-v2 .permission-user-card > header { flex-wrap: wrap; gap: 8px; }
  .ui-v2 .permission-user-card .user-identity { min-width: 0; overflow-wrap: anywhere; }
  .ui-v2 .permission-save-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ui-v2 *, .ui-v2 *::before, .ui-v2 *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .ui-v2 { background: #fff; }
  .ui-v2 .dashboard-nav { display: none; }
  .ui-v2:has(.dashboard-nav) > main { width: 100%; margin: 0; padding: 0; }
  .ui-v2 .kpi.primary { background: #fff; color: #192334; }
  .ui-v2 .kpi.primary > :is(span, strong, small) { color: #192334; }
}
