﻿:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: #dfe5ee;
  --line-soft: #edf1f6;
  --text: #172033;
  --muted: #64748b;
  --subtle: #94a3b8;
  --blue: #1677ff;
  --blue-soft: #e0f2fe;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --nav: #0f172a;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  display: flex;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button, select, input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  width: 284px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.brand {
  height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--nav);
  color: #fff;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  font-weight: 800;
  font-size: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.brand p {
  margin: 4px 0 0;
  color: #9ca3af;
  font-size: 11px;
}

.nav {
  flex: 1;
  padding: 18px 0;
  overflow-y: auto;
}

.nav-title {
  margin: 18px 24px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--subtle);
}

.nav-title:first-child { margin-top: 0; }

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #5b6472;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 14px;
  border-right: 4px solid transparent;
}

.nav-item:hover {
  background: #f8fafc;
}

.nav-item.active {
  color: #0284c7;
  background: var(--blue-soft);
  border-right-color: #0284c7;
  font-weight: 700;
}

.nav-ico {
  width: 22px;
  text-align: center;
  color: #8b95a4;
}

.sidebar-footer {
  padding: 18px;
  border-top: 1px solid var(--line-soft);
  background: #f8fafc;
}

.primary-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 14px;
}

.shell {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 86px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.filters {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

select, .search input {
  border: 1px solid #cfd8e3;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  outline: 0;
}

select {
  height: 34px;
  padding: 0 34px 0 12px;
  min-width: 178px;
  font-size: 13px;
}

select:focus, .search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  color: #475569;
  font-size: 13px;
  padding-top: 5px;
}

.divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  font-size: 12px;
  font-weight: 800;
}

.content {
  flex: 1;
  overflow: auto;
  padding: 26px;
  display: grid;
  gap: 22px;
}

.panel, .ai-insight, .metric-card, .chart-card, .table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.import-panel h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.import-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.file-drop {
  min-width: 220px;
  border: 1px dashed #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-drop small {
  color: #64748b;
  font-weight: 400;
  font-size: 11px;
}

.quality-notes {
  color: #475569;
  font-size: 12px;
  max-width: 430px;
  line-height: 1.6;
}

.note-source {
  color: #0f172a;
  font-weight: 700;
}

.note-sheet {
  color: #64748b;
}

.note-ok {
  color: #15803d;
}

.note-warn {
  color: #dc2626;
}

.ai-insight {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(90deg, #f0f9ff, #eff6ff 55%, #eef2ff);
  border-color: #bae6fd;
  box-shadow: 0 0 18px rgba(14, 165, 233, 0.16);
}

.spark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #0284c7;
  font-size: 22px;
}

.ai-insight h2 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #0f3b7a;
}

.ai-insight h2 span {
  margin-left: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(22, 119, 255, 0.08);
  color: #2563eb;
  font-size: 11px;
  font-weight: 500;
}

.ai-insight p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.8;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric-card {
  min-height: 138px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-content: space-between;
}

.metric-card span, .metric-card small {
  color: var(--subtle);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
  color: #0f172a;
}

.metric-card i {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #94a3b8;
  font-style: normal;
  font-weight: 800;
}

.metric-card .ok { color: var(--green); background: #dcfce7; }
.metric-card .warning { color: var(--orange); background: #fffbeb; }
.metric-card .danger { color: var(--red); background: #fee2e2; }

.bar-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: #475569;
  font-size: 12px;
}

.bar-row em {
  font-style: normal;
}

.bar {
  grid-column: 1 / -1;
  height: 5px;
  background: #edf1f6;
  border-radius: 999px;
  overflow: hidden;
}

.bar b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.bar b.warning { background: var(--orange); }
.bar b.danger { background: var(--red); }

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  gap: 22px;
}

.chart-card {
  padding: 18px;
  min-height: 360px;
}

.chart-card header, .table-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.chart-card h3, .table-card h3 {
  margin: 0;
  font-size: 14px;
}

.chart-card header span, .table-card p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 12px;
}

.danger-pill {
  color: #dc2626 !important;
  background: #fee2e2;
  border-radius: 999px;
  padding: 4px 8px;
}

.line-chart {
  height: 286px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(#edf2f7 1px, transparent 1px);
  background-size: 100% 52px;
  position: relative;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.trend-value-label {
  font-size: 10px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.trend-value-label.ok { fill: #15803d; }
.trend-value-label.warning { fill: #b45309; }
.trend-value-label.danger { fill: #dc2626; }

.legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
  color: #475569;
  font-size: 12px;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.green { background: var(--green); }
.orange { background: var(--orange); }
.red { background: var(--red); }

.rank-chart {
  display: grid;
  gap: 18px;
  padding-top: 14px;
}

.rank-row {
  display: grid;
  grid-template-columns: 92px 1fr 52px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.rank-row .name {
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-track {
  display: grid;
  gap: 6px;
}

.rank-bar {
  height: 24px;
  display: flex;
  background: #fee2e2;
  border-radius: 4px;
  overflow: hidden;
}

.rank-bar b {
  display: block;
  background: #fb923c;
}

.rank-bar i {
  display: block;
  background: #f43f5e;
}

.rank-breakdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.rank-breakdown b,
.rank-breakdown i {
  font-style: normal;
  font-weight: 700;
}

.rank-breakdown b { color: #c2410c; }
.rank-breakdown i { color: #e11d48; }

.rank-row strong {
  color: #dc2626;
  font-size: 12px;
}

.table-card {
  overflow: hidden;
}

.table-card header {
  padding: 18px 22px 0;
  margin-bottom: 14px;
}

.search {
  position: relative;
  width: 320px;
}

.search span {
  position: absolute;
  left: 11px;
  top: 7px;
  color: var(--subtle);
}

.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  text-align: left;
  padding: 13px 22px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: #334155;
  vertical-align: middle;
}

tbody tr:hover { background: #f8fafc; }
tbody tr.hot { background: rgba(254, 226, 226, 0.35); }

.mono { font-family: Consolas, "Courier New", monospace; }
.muted { color: var(--subtle); font-size: 11px; }
.strong { font-weight: 700; color: #1e293b; }

.tag, .status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag.blue { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.tag.purple { color: #7e22ce; background: #faf5ff; border-color: #e9d5ff; }
.tag.slate { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.status.ok { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.status.warning { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.status.danger { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.status.slate { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }

.trace-button {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.trace-button.danger { color: #dc2626; }

.table-card footer {
  min-height: 52px;
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  white-space: nowrap;
}

.page-size select {
  min-width: 68px;
  height: 28px;
  padding: 0 24px 0 8px;
  background: #fff;
  font-size: 12px;
}

.pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pages button {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #cfd8e3;
  border-radius: 5px;
  background: #fff;
  color: #64748b;
}

.pages button:disabled {
  cursor: not-allowed;
  color: #cbd5e1;
  background: #f1f5f9;
}

.pages .current {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.page-ellipsis {
  color: #94a3b8;
  padding: 0 2px;
}

.defect-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.closure-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.closure-badge.pending { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.closure-badge.working { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.closure-badge.improved { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.closure-badge.closed { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }

@media (max-width: 1100px) {
  body { overflow: auto; }
  .sidebar { width: 240px; }
  .topbar { height: auto; padding: 14px 18px; align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: 1fr; }
  .dimension-summary-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
}

@media (max-width: 560px) {
  body { display: block; }
  .sidebar { width: 100%; height: auto; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 8px; }
  .nav-title { grid-column: 1 / -1; }
  .shell { display: block; }
  .content { padding: 14px; }
  .import-panel, .chart-card header, .table-card header, .scoreboard-card header { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .focus-row, .score-row { grid-template-columns: 1fr; }
  .score-meta { justify-content: flex-start; }
  .filters select { width: 100%; }
  .summary-hero { padding: 18px 16px; }
  .summary-hero h2 { font-size: 18px; }
  .summary-hero p { font-size: 13px; line-height: 1.6; }
  .compact-grid { grid-template-columns: 1fr; gap: 12px; }
  .compact-card { min-height: auto; padding: 16px; gap: 8px; }
  .compact-card strong { font-size: 22px; }
  .summary-band { grid-template-columns: 1fr; gap: 14px; }
  .summary-note { padding: 16px; }
  .summary-note h3 { font-size: 15px; margin-bottom: 8px; }
  .summary-note p { font-size: 12px; line-height: 1.65; }
  .analysis-list { gap: 10px; }
  .analysis-row { grid-template-columns: 1fr; align-items: flex-start; min-height: auto; padding: 12px; }
  .analysis-main strong { white-space: normal; }
  .risk-score { text-align: left; }
  .risk-score strong { font-size: 18px; }
  .audit-log-head { flex-direction: column; align-items: flex-start; }
  .table-wrap { overflow-x: auto; }
}


.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.dimension-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  gap: 22px;
  align-items: start;
}

.dimension-main-column {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.dimension-detail-panel {
  position: sticky;
  top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 18px;
  min-height: 640px;
}

.analysis-card, .loss-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 18px;
}

.analysis-card header, .loss-panel header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.analysis-card h3, .loss-panel h3 {
  margin: 0;
  font-size: 14px;
}

.analysis-card p, .loss-panel p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 12px;
}

.dimension-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.dimension-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.dimension-summary,
.dimension-focus,
.scoreboard-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f8fbff;
  padding: 14px;
}

.dimension-focus,
.scoreboard-card {
  background: #ffffff;
}

.headline-card {
  display: grid;
  gap: 8px;
}

.headline-label {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.headline-card strong {
  font-size: 28px;
  line-height: 1;
  color: #0f172a;
}

.headline-card p {
  margin: 0;
  line-height: 1.7;
}

.headline-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.focus-row,
.score-row {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.focus-row + .focus-row,
.score-row + .score-row {
  margin-top: 10px;
}

.focus-row:hover,
.score-row:hover,
.analysis-row.clickable:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.focus-row.active,
.score-row.active,
.analysis-row.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12) inset;
}

.focus-rank {
  min-width: 52px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

.focus-main,
.score-main {
  display: grid;
  gap: 4px;
}

.focus-main strong,
.score-main strong {
  color: #0f172a;
}

.focus-main small,
.score-main small {
  color: #64748b;
  font-size: 11px;
}

.focus-tag,
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.focus-tag.danger,
.score-pill.risk {
  background: #fee2e2;
  color: #dc2626;
}

.scoreboard-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.scoreboard-card h4 {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
}

.scoreboard-card p {
  margin: 4px 0 0;
}

.scoreboard-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.category-board {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px;
  background: #f8fbff;
}

.category-board + .category-board {
  margin-top: 12px;
}

.category-board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.category-board-head strong {
  color: #0f172a;
}

.category-board-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}

.category-board-list .score-row {
  background: #fff;
}

.score-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: #475569;
  font-size: 11px;
}

.panel-badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 4px 8px;
  color: #92400e;
  background: #fffbeb;
  font-size: 11px;
  font-weight: 700;
}

.panel-badge.blue {
  color: #1d4ed8;
  background: #eff6ff;
}

.analysis-list {
  display: grid;
  gap: 12px;
}

.analysis-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) minmax(160px, 2fr) minmax(86px, auto);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.analysis-row:hover {
  background: #f8fafc;
}

.analysis-main {
  display: grid;
  gap: 6px;
}

.analysis-main strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-main span, .analysis-meta {
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.analysis-meta {
  margin-top: 6px;
}

.stack-bar {
  height: 8px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.stack-bar .ok-part { background: var(--green); }
.stack-bar .warn-part { background: var(--orange); }
.stack-bar .bad-part { background: var(--red); }

.risk-score {
  text-align: right;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.risk-score strong {
  display: block;
  color: #dc2626;
  font-size: 20px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.loss-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.loss-item {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.loss-item span {
  color: var(--subtle);
  font-size: 12px;
}

.loss-item strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 24px;
}

.loss-item p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .analysis-grid, .loss-grid { grid-template-columns: 1fr; }
}

.page-hidden {
  display: none !important;
}

.date-slicer {
  flex: 1 1 100%;
  min-width: 520px;
  max-width: none;
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d8e1ed;
  border-radius: 9px;
  background: #f8fafc;
}

.slicer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slicer-head span {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.slicer-head select {
  min-width: 76px;
  height: 28px;
  padding-left: 8px;
  font-size: 12px;
  background: #fff;
}

.slicer-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
  max-height: 86px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.slicer-chip {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slicer-chip:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.slicer-chip.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .date-slicer { width: 100%; max-width: none; }
}


.empty-chart {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-size: 13px;
}

@media (max-width: 760px) {
  .date-slicer { min-width: 0; }
  .slicer-options { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); max-height: 112px; }
}

.trend-header {
  align-items: flex-start !important;
}

.drill-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.drill-toolbar button {
  min-width: 34px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
}

.drill-toolbar button:hover:not(:disabled) {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.drill-toolbar button.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.drill-toolbar button:disabled {
  cursor: not-allowed;
  color: #cbd5e1;
  background: #f8fafc;
}

.drill-divider {
  width: 1px;
  height: 18px;
  background: #dbe3ee;
}

@media (max-width: 760px) {
  .drill-toolbar { justify-content: flex-start; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.trace-modal {
  width: min(980px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d8e1ed;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.trace-modal > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.trace-modal h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.trace-modal p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 20px;
  line-height: 1;
}

.trace-body {
  overflow-y: auto;
  padding: 20px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.trace-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.trace-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.trace-kpi {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.trace-kpi span {
  color: #94a3b8;
  font-size: 12px;
}

.trace-kpi strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 22px;
}

.trace-section {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.trace-section h3 {
  margin: 0;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line-soft);
  color: #334155;
  font-size: 13px;
}

.trace-section .section-body {
  padding: 12px 14px;
}

.trace-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line-soft);
}

.trace-section-head h3 {
  padding: 0;
  background: transparent;
  border: 0;
}

.trace-section-head p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 12px;
}

.trace-mini-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.closure-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.closure-control label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.closure-control select {
  min-width: 110px;
  height: 30px;
  background: #fff;
}

.trace-ledger-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.trace-ledger-section .section-body {
  border-top: 1px solid var(--line-soft);
}

.ledger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ledger-grid-wide {
  grid-template-columns: 1fr;
}

.ledger-field {
  display: grid;
  gap: 6px;
}

.ledger-field span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ledger-field input,
.ledger-field select,
.ledger-field textarea {
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 9px 11px;
  font-size: 13px;
  outline: 0;
}

.ledger-field input,
.ledger-field select {
  height: 38px;
}

.ledger-field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

.ledger-field input:focus,
.ledger-field select:focus,
.ledger-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.ledger-field-wide {
  min-width: 0;
}

.ledger-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #64748b;
}

.ledger-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.ledger-chip.overdue {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.ledger-updated {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
}

.trace-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.trace-tags span {
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 9px;
  font-size: 12px;
}

.trace-table-section {
  overflow: hidden;
}

.trace-table-shell {
  padding: 0 14px 14px;
}

.trace-table-wrap {
  max-height: 248px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.trace-table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

.trace-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.trace-table th,
.trace-table td {
  padding: 10px 12px;
  font-size: 12px;
}

.trace-table th:nth-child(1),
.trace-table td:nth-child(1) { width: 110px; }
.trace-table th:nth-child(2),
.trace-table td:nth-child(2) { width: 160px; }
.trace-table th:nth-child(3),
.trace-table td:nth-child(3) { width: 120px; }
.trace-table th:nth-child(4),
.trace-table td:nth-child(4) { width: 96px; }
.trace-table td:nth-child(5) {
  white-space: normal;
  word-break: break-word;
  line-height: 1.6;
}

.action-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.8;
  font-size: 13px;
}

.analysis-row.clickable {
  cursor: pointer;
}

.analysis-row.clickable:hover {
  border-color: #bfdbfe;
}

@media (max-width: 980px) {
  .trace-layout-grid { grid-template-columns: 1fr; }
  .trace-ledger-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .trace-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { padding: 12px; }
  .trace-body { padding: 14px; gap: 14px; }
  .trace-section-head { flex-direction: column; align-items: stretch; }
  .trace-table-shell { padding: 0 10px 10px; }
  .trace-table-wrap { max-height: 220px; }
  .ledger-grid { grid-template-columns: 1fr; }
  .ledger-summary-row { align-items: flex-start; }
  .ledger-updated { margin-left: 0; width: 100%; }
}


.export-stack {
  display: grid;
  gap: 10px;
}

.secondary-button,
.ghost-button {
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}

.secondary-button:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.ghost-button {
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #dbe3ee;
  background: #fff;
  color: #64748b;
}

.ghost-button:hover:not(:disabled) {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.ghost-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.slicer-head-main {
  display: grid;
  gap: 2px;
}

.slicer-head-main small {
  color: #64748b;
  font-size: 11px;
}

.slicer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trend-point-hit {
  cursor: pointer;
}

.rank-row.clickable {
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 -8px;
}

.rank-row.clickable:hover {
  background: #f8fafc;
}

.loss-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.loss-button:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.summary-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.summary-hero h2 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.summary-hero p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.hero-badge.danger {
  background: #fee2e2;
  color: #dc2626;
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-card {
  min-height: 112px;
  grid-template-columns: 1fr;
  gap: 10px;
}

.compact-card strong {
  font-size: 24px;
  color: #0f172a;
}

.compact-card small {
  line-height: 1.65;
  color: #64748b;
}

.page-band {
  align-items: start;
}

.summary-note {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.summary-note h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #0f172a;
}

.summary-note p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.8;
}

.summary-note p + p {
  margin-top: 10px;
}

.overdue-table-card tbody tr.hot td {
  background: #fff7f7;
}

@media (max-width: 1180px) {
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slicer-head {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .summary-hero {
    flex-direction: column;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }

  .slicer-head {
    flex-direction: column;
    align-items: stretch;
  }

  .slicer-tools {
    justify-content: space-between;
  }
}


.summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 18px;
}

.overdue-band {
  margin-top: 2px;
}

.agent-note,
.comparison-note,
.focus-note {
  min-height: 100%;
}

.summary-note-wide {
  grid-column: 1 / -1;
}

.note-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.focus-list,
.owner-focus-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #334155;
  font-size: 13px;
  line-height: 1.8;
}

.focus-list.compact {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.summary-footnote {
  margin-top: 10px !important;
  color: #64748b !important;
  font-size: 12px !important;
}

.audit-log-item {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.audit-log-item + .audit-log-item {
  margin-top: 10px;
}

.audit-log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.audit-log-head strong {
  color: #0f172a;
}

.audit-log-head span {
  color: #64748b;
  font-size: 12px;
}

.owner-focus-list {
  list-style: none;
  padding: 0;
}

.owner-focus-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #dbe3ee;
}

.owner-focus-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.owner-focus-list strong {
  color: #0f172a;
  font-size: 13px;
}

.owner-focus-list span {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.compare-item {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.compare-item span,
.compare-item small {
  display: block;
}

.compare-item span {
  color: #64748b;
  font-size: 12px;
}

.compare-item strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 24px;
}

.compare-item small {
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.compare-item.up {
  border-color: #fecaca;
  background: #fff7f7;
}

.compare-item.down {
  border-color: #bbf7d0;
  background: #f5fff7;
}

.compare-item.flat {
  background: #f8fafc;
}

@media (max-width: 1180px) {
  .summary-band,
  .compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .summary-band,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .owner-focus-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .owner-focus-list span {
    text-align: left;
  }
}


#ownerPanel .summary-band {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.reminder-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.reminder-chip.today {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.reminder-chip.tomorrow {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.reminder-chip.overdue {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.reminder-chip.scheduled {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0f766e;
}

.reminder-chip.slate {
  background: #f8fafc;
  border-color: #dbe3ee;
  color: #64748b;
}

.owner-table-card tbody tr.hot td {
  background: #fff7f7;
}

@media (max-width: 1180px) {
  #ownerPanel .summary-band {
    grid-template-columns: 1fr;
  }
}


.reminder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -6px;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented-control button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.owner-band {
  align-items: start;
}

.advice-item {
  padding: 14px 0;
  border-bottom: 1px dashed #dbe3ee;
}

.advice-item:first-child {
  padding-top: 0;
}

.advice-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.advice-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.advice-head span {
  color: #64748b;
  font-size: 12px;
}

.advice-head strong {
  color: #0f172a;
  font-size: 13px;
}

.advice-item p {
  margin: 10px 0 0 !important;
  color: #334155 !important;
  line-height: 1.7 !important;
}

@media (max-width: 760px) {
  .reminder-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1 1 calc(50% - 8px);
  }

  .advice-head {
    flex-direction: column;
    align-items: flex-start;
  }
}


.review-band {
  align-items: start;
}

.risk-score {
  line-height: 1.5;
}

.risk-score strong {
  display: block;
}


#personalPanel .summary-band {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.personal-band,
.personal-band-grid {
  align-items: start;
}

.personal-focus-card,
.personal-preview-card {
  min-height: 100%;
}

.personal-table-card tbody tr.hot td {
  background: #fff7f7;
}

@media (max-width: 1180px) {
  #personalPanel .summary-band {
    grid-template-columns: 1fr;
  }
}


.overview-extension {
  align-items: stretch;
}

.engineer-band {
  align-items: stretch;
}

.engineer-table-card .table-wrap {
  max-height: 520px;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.engineer-trend-cell {
  margin-bottom: 6px;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

#engineerProgress .compact-card,
#engineerMetrics .compact-card {
  min-height: 112px;
}

#engineerSupplierScores .analysis-row,
#engineerModelList .analysis-row,
#engineerSnapshot .analysis-row {
  min-height: 92px;
}

@media (max-width: 1100px) {
  .progress-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .progress-grid {
    grid-template-columns: 1fr;
  }
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #64748b;
  font-size: 12px;
}

.detail-breadcrumb button,
.detail-action-grid button {
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: 8px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.detail-breadcrumb button {
  padding: 4px 10px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f8fbff;
}

.detail-label {
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

.detail-hero h4,
.detail-section h4 {
  margin: 6px 0 0;
  font-size: 20px;
  color: #0f172a;
}

.detail-hero p {
  margin: 6px 0 0;
  color: #64748b;
  line-height: 1.6;
}

.detail-score-stack {
  min-width: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line-soft);
  padding: 10px 12px;
}

.detail-score-stack strong {
  color: #dc2626;
  font-size: 32px;
  line-height: 1;
}

.detail-score-stack span {
  color: #64748b;
  font-size: 11px;
}

.detail-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.detail-metric {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.detail-metric span {
  display: block;
  color: #64748b;
  font-size: 11px;
}

.detail-metric strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 18px;
}

.detail-section {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.detail-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #334155;
  font-size: 12px;
}

.detail-trend-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.detail-trend-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.detail-trend-row span,
.detail-trend-row small {
  color: #64748b;
  font-size: 11px;
}

.detail-trend-row b {
  color: #0f172a;
  font-size: 13px;
}

.detail-trend-row small {
  grid-column: 1 / -1;
}

.detail-action-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.detail-action-grid button {
  min-height: 36px;
  padding: 0 12px;
  text-align: left;
}

.category-board.active {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12) inset;
}

@media (max-width: 1120px) {
  .dimension-workspace {
    grid-template-columns: 1fr;
  }

  .dimension-detail-panel {
    position: static;
    min-height: auto;
  }
}

.embedded-trace-section .trace-section-head,
.embedded-trace-section h4 {
  margin: 0;
}

.compact-head {
  padding: 0 0 12px;
  background: transparent;
  border-bottom: 1px solid var(--line-soft);
}

.compact-head h3 {
  font-size: 14px;
}

.compact-ledger-grid {
  padding-top: 12px;
}

.compact-ledger-wide {
  padding-top: 0;
}

.detail-tags {
  margin-top: 10px;
}

.detail-trace-table {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.detail-trace-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.detail-trace-row strong {
  color: #0f172a;
  font-size: 12px;
}

.detail-trace-row span,
.detail-trace-row small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}

.compact-action-list {
  margin-top: 10px;
  font-size: 12px;
}

.top-meta-extended {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.demo-access-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-access-inline input {
  height: 34px;
  min-width: 180px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

.status-chip.online {
  background: #ecfdf5;
  color: #047857;
}

.status-chip.offline {
  background: #fff7ed;
  color: #c2410c;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.topbar-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.filters {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.date-slicer {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #d8e1ed;
  border-radius: 9px;
  background: #f8fafc;
}

.slicer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slicer-head-main {
  display: grid;
  gap: 2px;
}

.slicer-head-main small {
  color: #64748b;
  font-size: 11px;
}

.slicer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.slicer-head span {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.slicer-head select {
  min-width: 76px;
  height: 30px;
  padding-left: 8px;
  font-size: 12px;
  background: #fff;
}

.slicer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 76px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.slicer-chip {
  min-width: 72px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.slicer-chip:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.slicer-chip.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.current-user-meta {
  display: grid;
  gap: 2px;
}

.current-user-meta small {
  color: var(--subtle);
  font-size: 11px;
}

.role-landing {
  width: 100%;
  margin-bottom: 0;
}

.role-landing-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.role-landing-label {
  display: inline-block;
  margin-bottom: 4px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

.role-landing-card strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
}

.role-landing-card p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.role-landing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.export-collapsible {
  position: relative;
  display: grid;
  gap: 10px;
}

.export-toggle {
  width: 100%;
  justify-content: center;
}

.export-popover {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.export-popover[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .topbar {
    height: auto;
    padding: 14px 18px;
    grid-template-columns: 1fr;
  }

  .top-meta-extended {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .demo-access-inline {
    justify-content: flex-start;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .date-slicer {
    min-width: 0;
    padding: 10px 12px;
  }

  .slicer-options {
    max-height: 110px;
  }

  .slicer-head {
    grid-template-columns: 1fr;
  }

  .slicer-tools {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .role-landing-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .role-landing-meta {
    justify-content: flex-start;
  }
}

/* Top header stable layout */
#roleLanding {
  display: none !important;
}

.topbar {
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.topbar-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

#topFilters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

#topFilters > .date-slicer {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d8e1ed;
  border-radius: 10px;
  background: #f8fafc;
}

#topFilters > .date-slicer .slicer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

#topFilters > .date-slicer .slicer-head-main {
  display: grid;
  gap: 2px;
}

#topFilters > .date-slicer .slicer-head-main small {
  color: #64748b;
  font-size: 12px;
}

#topFilters > .date-slicer .slicer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#topFilters > .date-slicer .slicer-head span {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

#topFilters > .date-slicer .slicer-head select {
  min-width: 84px;
  height: 32px;
  padding-left: 10px;
  font-size: 12px;
  background: #fff;
}

#topFilters > .date-slicer .slicer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 72px;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: flex-start;
}

#topFilters > .date-slicer .slicer-chip {
  width: auto;
  min-width: 84px;
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  line-height: 28px;
  text-align: center;
  white-space: nowrap;
}

#topFilters > select {
  width: 100%;
  min-width: 0;
  height: 38px;
}

.current-user-meta {
  display: grid;
  gap: 2px;
}

.current-user-meta small {
  color: var(--subtle);
  font-size: 11px;
}

.export-collapsible {
  position: relative;
  display: grid;
  gap: 10px;
}

.export-toggle {
  width: 100%;
  justify-content: center;
}

.export-popover {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.export-popover[hidden] {
  display: none;
}

@media (max-width: 1280px) {
  #topFilters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  #topFilters {
    grid-template-columns: 1fr;
  }

  #topFilters > .date-slicer .slicer-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #topFilters > .date-slicer .slicer-tools {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  #topFilters > .date-slicer .slicer-options {
    max-height: 104px;
  }
}


/* Restore requested usable header layout */
#roleLanding {
  display: none !important;
}

.topbar {
  display: grid !important;
  grid-template-columns: 480px minmax(620px, 1fr) auto !important;
  align-items: start !important;
  gap: 16px !important;
  padding: 14px 24px !important;
}

.topbar-main {
  grid-column: 2 !important;
  min-width: 0 !important;
  display: grid !important;
  gap: 14px !important;
}

.top-meta-extended {
  grid-column: 3 !important;
  align-self: start !important;
}

#topFilters {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}

#topFilters > .date-slicer {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  width: 100% !important;
  display: grid !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border: 1px solid #d8e1ed !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
}

#topFilters > .date-slicer .slicer-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
}

#topFilters > .date-slicer .slicer-head-main {
  display: grid !important;
  gap: 2px !important;
}

#topFilters > .date-slicer .slicer-tools {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

#topFilters > .date-slicer .slicer-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  max-height: 88px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-content: flex-start !important;
}

#topFilters > .date-slicer .slicer-chip {
  width: auto !important;
  min-width: 84px !important;
  flex: 0 0 auto !important;
  height: 30px !important;
  padding: 0 12px !important;
  line-height: 28px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

#topFilters > select {
  width: 100% !important;
  min-width: 0 !important;
  height: 40px !important;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: 320px minmax(520px, 1fr) auto !important;
  }
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 1fr auto !important;
  }

  .topbar-main {
    grid-column: 1 !important;
  }

  .top-meta-extended {
    grid-column: 2 !important;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr !important;
  }

  .topbar-main,
  .top-meta-extended {
    grid-column: 1 !important;
  }

  #topFilters {
    grid-template-columns: 1fr !important;
  }

  #topFilters > .date-slicer .slicer-head {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  #topFilters > .date-slicer .slicer-tools {
    justify-content: space-between !important;
    flex-wrap: wrap !important;
  }
}

/* Stable header and filter layout */
#roleLanding {
  display: none !important;
}

.topbar-spacer {
  display: none !important;
}

.topbar {
  min-height: auto;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 14px 18px !important;
  padding: 12px 18px !important;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-main {
  min-width: 0 !important;
  display: grid !important;
  gap: 10px !important;
}

.top-meta-extended {
  min-width: 220px;
  display: grid !important;
  grid-template-columns: 1fr auto auto !important;
  gap: 8px 10px !important;
  align-items: center !important;
  justify-self: end !important;
  padding-top: 2px;
}

.top-meta-extended .demo-access-inline {
  grid-column: 1 / -1;
}

.top-meta-extended #updateText {
  grid-column: 1;
  min-width: 0;
}

.top-meta-extended .status-chip {
  justify-self: start;
}

.top-meta-extended .divider {
  display: none;
}

.current-user-meta {
  display: grid;
  gap: 2px;
}

.current-user-meta small {
  color: var(--subtle);
  font-size: 11px;
}

#topFilters {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  align-items: start !important;
}

#topFilters > .date-slicer {
  min-width: 0 !important;
  width: 100% !important;
  display: grid !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border: 1px solid #d8e1ed !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
}

#topFilters > .date-slicer .slicer-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
}

#topFilters > .date-slicer .slicer-head-main {
  display: grid !important;
  gap: 2px !important;
}

#topFilters > .date-slicer .slicer-head-main small {
  color: var(--subtle);
}

#topFilters > .date-slicer .slicer-tools {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

#topFilters > .date-slicer .slicer-tools select {
  min-width: 72px;
  width: 72px;
}

#topFilters > .date-slicer .slicer-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  max-height: 72px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-content: flex-start !important;
}

#topFilters > .date-slicer .slicer-chip {
  width: auto !important;
  min-width: 68px !important;
  flex: 0 0 auto !important;
  height: 28px !important;
  padding: 0 10px !important;
  line-height: 26px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.filter-grid > select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 38px !important;
}

.export-collapsible {
  position: relative;
  display: grid;
  gap: 10px;
}

.export-toggle {
  width: 100%;
  justify-content: center;
}

.export-popover {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.export-popover[hidden] {
  display: none;
}

@media (max-width: 1320px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .topbar {
    grid-template-columns: 1fr !important;
  }

  .top-meta-extended {
    justify-self: stretch !important;
    grid-template-columns: 1fr auto auto !important;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 10px 12px !important;
    gap: 10px !important;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .top-meta-extended {
    grid-template-columns: 1fr !important;
  }

  .top-meta-extended .demo-access-inline,
  .top-meta-extended #updateText,
  .top-meta-extended .status-chip,
  .top-meta-extended .avatar,
  .top-meta-extended .current-user-meta {
    grid-column: 1 !important;
    justify-self: start;
  }

  #topFilters > .date-slicer .slicer-head {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  #topFilters > .date-slicer .slicer-tools {
    justify-content: space-between !important;
    flex-wrap: wrap !important;
  }
}

.user-entry {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-entry.is-guest {
  border-style: dashed;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 156px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 6px;
  z-index: 20;
}

.user-menu[hidden] {
  display: none;
}

.user-menu button {
  border: 0;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.auth-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.auth-empty-card {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 32px 32px 28px;
  text-align: left;
}

.auth-empty-card h2 {
  margin: 14px 0 10px;
  font-size: 22px;
}

.auth-empty-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 20px;
  flex-wrap: wrap;
}

.login-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  margin: 0 auto;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  overflow: auto;
}

.login-modal > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.login-modal > header h2 {
  margin: 0 0 6px;
  font-size: 26px;
}

.login-modal > header p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.login-modal-body {
  display: grid;
  gap: 16px;
  padding: 22px 24px 24px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.login-field select,
.login-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0 12px;
  font-size: 14px;
  color: #0f172a;
}

.login-modal-body .primary-button {
  margin-top: 4px;
  height: 44px;
  border-radius: 10px;
}

.login-modal-body .summary-footnote {
  margin: -2px 0 0;
  color: #64748b;
}

.quick-user-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.quick-user-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  text-align: left;
}

.quick-user-chip span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.quick-user-chip strong,
.quick-user-chip small {
  grid-column: 2;
  min-width: 0;
}

.quick-user-chip strong {
  color: #0f172a;
  font-size: 14px;
}

.quick-user-chip small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.quick-user-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.quick-user-chip.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.compact-login-card .inline-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.compact-login-card .inline-actions .primary-button,
.compact-login-card .inline-actions .ghost-button {
  width: auto;
  min-width: 112px;
}

@media (max-width: 760px) {
  .auth-empty-card {
    padding: 24px 20px 20px;
  }

  .auth-empty-card h2 {
    font-size: 18px;
  }

  .auth-empty-actions {
    flex-direction: column;
  }

  .auth-empty-actions .primary-button,
  .auth-empty-actions .ghost-button {
    width: 100%;
  }

  .login-modal {
    width: min(100%, calc(100vw - 20px));
  }

  .login-modal > header,
  .login-modal-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .quick-user-list {
    grid-template-columns: 1fr;
  }
}

.password-form-grid,
.account-form-grid {
  margin-top: 16px;
}

.password-form-grid .primary-button,
.account-form-grid .primary-button {
  align-self: end;
}

.compact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.access-top-band {
  align-items: stretch;
}

.access-overview-band,
.access-lane-card {
  display: grid;
  gap: 18px;
}

.access-overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.access-overview-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 18px;
  background: #f8fafc;
}

.access-lane-body {
  display: grid;
  gap: 18px;
}

.access-account-lane {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  align-items: start;
}

.access-account-lane > .access-table-card {
  grid-column: auto;
}

.access-account-tools {
  display: grid;
  grid-template-columns: 84mm minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.access-account-tools > .access-self-card,
.access-account-tools > .access-admin-card {
  min-height: 0;
}

.access-low-frequency-card {
  margin-top: 4px;
}

.access-low-frequency-grid {
  display: grid;
  grid-template-columns: 84mm minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.access-role-lane-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 20px;
  background: #f8fafc;
}

.access-mapping-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.86fr);
  gap: 18px;
  align-items: start;
}

.access-mapping-summary-wrap,
.access-mapping-editor-wrap,
.access-mapping-list-wrap {
  display: grid;
  gap: 18px;
  align-content: start;
}

.access-mapping-summary-wrap {
  grid-column: 1;
}

.access-mapping-editor-wrap {
  grid-column: 2;
}

.access-mapping-list-wrap {
  grid-column: 1 / -1;
}

.access-account-card .analysis-list {
  display: grid;
  gap: 18px;
}

.access-stack {
  display: grid;
  gap: 18px;
  align-items: start;
}

.access-account-card .access-self-card,
.access-account-card .access-admin-card,
.access-account-card .access-table-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fafc;
}

.access-account-card .access-self-card,
.access-account-card .access-admin-card {
  grid-column: auto;
}

.access-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.access-section-head strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.25;
}

.access-section-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  max-width: 46ch;
}

.access-section-head > div:first-child {
  min-width: 0;
}

.access-section-head > .ledger-chip {
  align-self: start;
  justify-self: end;
  white-space: nowrap;
}

.access-self-card,
.access-admin-card,
.access-table-card,
.access-matrix-card {
  display: grid;
  gap: 2px;
}

.access-table-card .access-section-head,
.access-matrix-card .access-section-head {
  padding: 2px 0 10px;
  border-bottom: 1px solid #e8eef6;
}

.access-password-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.access-password-grid .login-field span {
  margin-bottom: 4px;
}

.access-password-grid .primary-button {
  margin-top: 2px;
}

.access-self-card .login-field input {
  height: 38px;
}

.access-self-card .summary-footnote {
  display: none;
}

.access-scope-card .focus-list.compact {
  gap: 8px;
}

.access-scope-card .focus-list.compact li {
  line-height: 1.55;
}

.role-matrix-shell {
  overflow-x: auto;
  padding-bottom: 4px;
}

.role-matrix-grid {
  display: grid;
  gap: 0;
  min-width: 920px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.role-matrix-corner,
.role-matrix-role-head,
.role-matrix-row-label,
.role-matrix-cell {
  padding: 10px 10px;
  border-right: 1px solid #e8eef6;
  border-bottom: 1px solid #e8eef6;
  min-width: 0;
}

.role-matrix-corner {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.role-matrix-role-head {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.role-matrix-role-head strong {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
}

.role-matrix-row-label {
  background: #fcfdff;
  display: grid;
  gap: 2px;
  align-content: center;
}

.role-matrix-row-label.section-start,
.role-matrix-cell.section-start {
  border-top: 2px solid #d7e3f4;
}

.role-matrix-section {
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
}

.role-matrix-row-label strong {
  color: #0f172a;
  font-size: 11px;
  line-height: 1.4;
}

.role-matrix-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #ffffff;
}

.role-matrix-home,
.role-matrix-text {
  color: #0f172a;
  font-size: 11px;
  line-height: 1.45;
}

.role-matrix-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.role-matrix-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  line-height: 1.25;
}

.role-matrix-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.role-matrix-flag.enabled {
  background: #ecfdf3;
  color: #15803d;
  border-color: #bbf7d0;
}

.role-matrix-flag.disabled {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.role-matrix-flag.neutral {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.access-note-row {
  margin-bottom: 12px;
}

.access-account-card .summary-note-wide + .summary-note-wide,
.access-account-card .summary-note-wide + .table-wrap,
.access-account-card .table-wrap + .summary-note-wide {
  margin-top: 0;
}

.access-account-card .table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 4px 0;
}

.access-mapping-side {
  min-width: 0;
}

.access-mapping-editor-card {
  position: sticky;
  top: 24px;
  align-self: start;
}

.access-summary-card,
.mapping-editor-card {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.owner-mapping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.owner-mapping-group {
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  padding: 18px 20px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  display: grid;
  gap: 16px;
}

.owner-mapping-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.owner-mapping-group-title {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.owner-mapping-person {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.owner-mapping-group-title strong {
  font-size: 24px;
  color: #0f172a;
  line-height: 1.1;
}

.owner-mapping-role {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.owner-mapping-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.owner-mapping-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.owner-mapping-group-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: center;
}

.owner-mapping-tag-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.owner-mapping-tag {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.owner-mapping-tag-main {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.owner-mapping-item-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.owner-mapping-tag-main strong {
  font-size: 16px;
  color: #0f172a;
}

.owner-mapping-item-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  font-size: 12px;
  color: #475569;
}

.owner-mapping-item-summary {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.owner-mapping-item-summary span,
.owner-mapping-tag-meta {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.owner-mapping-item-remove {
  flex: 0 0 auto;
}

.owner-mapping-item-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.owner-mapping-group-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px dashed #d9e2ec;
}

.owner-transfer-field {
  min-width: 220px;
  flex: 1 1 260px;
}

#ownerMappingEditor .mapping-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

#ownerMappingEditor .mapping-form-grid .inline-actions.compact-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  padding-top: 4px;
}

#ownerMappingEditor .mapping-form-grid .mapping-form-actions {
  gap: 10px;
}

#ownerMappingEditor .mapping-form-grid .login-field {
  min-width: 0;
}

.danger-outline {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fff5f5;
}

.danger-outline:hover {
  background: #fee2e2;
}

@media (max-width: 1280px) {
  .access-overview-grid,
  .access-account-lane,
  .access-mapping-lane,
  .access-account-tools,
  .access-low-frequency-grid {
    grid-template-columns: 1fr;
  }

  .owner-mapping-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-mapping-summary-wrap,
  .access-mapping-editor-wrap,
  .access-mapping-list-wrap {
    grid-column: auto;
  }

  .access-stack {
    grid-template-columns: 1fr;
  }

  .owner-mapping-group-head,
  .owner-mapping-group-actions,
  .owner-mapping-tag {
    flex-direction: column;
    align-items: stretch;
  }

  .owner-mapping-group-meta {
    justify-content: flex-start;
  }

  .access-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .role-matrix-grid {
    min-width: 900px;
  }

  .owner-mapping-item-remove {
    align-self: flex-start;
  }

  .owner-mapping-item-actions {
    width: 100%;
  }

  #ownerMappingEditor .mapping-form-grid {
    grid-template-columns: 1fr;
  }

  .access-mapping-editor-card {
    position: static;
  }
}

@media (max-width: 960px) {
  .owner-mapping-grid {
    grid-template-columns: 1fr;
  }
}

body.auth-mode {
  display: block;
  overflow: hidden;
}

body.auth-mode .sidebar,
body.auth-mode .topbar,
body.auth-mode .page-section {
  display: none !important;
}

body.auth-mode .shell {
  min-height: 100vh;
  display: block;
}

body.auth-mode .content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

body.auth-mode #authPanel {
  display: flex !important;
  width: 100%;
  max-width: 640px;
  min-height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-only-card {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  border-radius: 20px;
  padding: 38px 36px 28px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d8e1ed;
}

.login-title-block {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.login-only-card h2 {
  margin: 0;
  font-size: 24px;
  color: #0f172a;
}

.login-inline-form {
  display: grid;
  gap: 18px;
}

.login-inline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 14px;
}

.login-inline-form .login-field {
  display: grid;
  gap: 6px;
}

.login-inline-form .login-field span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.login-inline-form .login-field select,
.login-inline-form .login-field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0 14px;
  font-size: 14px;
  color: #0f172a;
}

.login-only-actions {
  margin-top: 2px;
}

.login-only-actions .primary-button {
  width: 100%;
  height: 46px;
  border-radius: 10px;
}

.login-inline-hint {
  font-size: 12px;
  color: #64748b;
  text-align: right;
}

@media (max-width: 760px) {
  body.auth-mode .content {
    padding: 20px 14px;
  }

  .login-only-card {
    padding: 28px 20px 22px;
    border-radius: 16px;
  }

  .login-only-card h2 {
    font-size: 20px;
  }

  .login-inline-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .login-inline-hint {
    text-align: left;
  }
}

/* Header and slicer hotfix merged from header-fix.css */
#roleLanding {
  display: none !important;
}

body.auth-mode .topbar,
body.auth-mode .top-meta-extended,
body.auth-mode .topbar-main,
body.auth-mode #topFilters,
body.auth-mode .topbar-spacer {
  display: none !important;
}

body.auth-mode .shell {
  min-height: 100vh !important;
}

body.auth-mode .content {
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.topbar-spacer {
  display: none !important;
}

.topbar {
  position: relative !important;
  min-height: 78px !important;
  display: block !important;
  padding: 12px 16px !important;
  background: var(--panel) !important;
  border-bottom: 1px solid var(--line) !important;
}

.topbar-main {
  display: grid !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.top-meta-extended {
  position: absolute !important;
  top: 10px !important;
  right: 16px !important;
  width: 154px !important;
  display: grid !important;
  grid-template-columns: auto auto 1fr !important;
  align-items: center !important;
  column-gap: 8px !important;
  row-gap: 4px !important;
  min-width: 0 !important;
  padding: 8px 10px !important;
  border: 1px solid #d8e1ed !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,0.94) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04) !important;
}

.top-meta-extended #updateText {
  grid-column: 1 / -1 !important;
  justify-self: start !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  color: #475569 !important;
}

.top-meta-extended #dataSourceBadge {
  grid-column: 1 !important;
  grid-row: 2 !important;
  justify-self: start !important;
}

.top-meta-extended #currentUserAvatar {
  grid-column: 2 !important;
  grid-row: 2 / span 2 !important;
  justify-self: start !important;
  align-self: center !important;
}

.top-meta-extended .current-user-meta {
  grid-column: 3 !important;
  grid-row: 2 / span 2 !important;
  justify-self: start !important;
  align-self: center !important;
  display: grid !important;
  gap: 0 !important;
}

.top-meta-extended .status-chip {
  min-height: 18px !important;
  padding: 0 7px !important;
  font-size: 9px !important;
  line-height: 18px !important;
}

.top-meta-extended .avatar {
  width: 28px !important;
  height: 28px !important;
  font-size: 13px !important;
}

.top-meta-extended .current-user-meta strong {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

.top-meta-extended .current-user-meta small {
  font-size: 9px !important;
  color: #64748b !important;
  line-height: 1.1 !important;
}

#topFilters {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  min-width: 0 !important;
}

#topFilters > .date-slicer {
  grid-column: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 10px 180px 10px 12px !important;
  border-radius: 12px !important;
}

#topFilters > .date-slicer .slicer-head-main span {
  font-size: 13px !important;
}

#topFilters > .date-slicer .slicer-head-main small {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

#topFilters > .date-slicer .slicer-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
}

#topFilters > .date-slicer .slicer-tools {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

#topFilters > .date-slicer .slicer-tools .ghost-button,
#topFilters > .date-slicer .slicer-tools select {
  height: 30px !important;
}

#topFilters > .date-slicer .slicer-tools select {
  min-width: 74px !important;
  padding: 0 26px 0 10px !important;
  font-size: 12px !important;
}

#topFilters > .date-slicer .slicer-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  max-height: 72px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-content: flex-start !important;
}

#topFilters > .date-slicer .slicer-chip {
  width: auto !important;
  flex: 0 0 auto !important;
  min-width: 96px !important;
  height: 28px !important;
  padding: 0 12px !important;
  white-space: nowrap !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 26px !important;
  border-radius: 8px !important;
}

#topFilters > .date-slicer .slicer-chip[data-action="all"] {
  min-width: 60px !important;
}

#dateSlicerOptions[data-date-mode="year"] .slicer-chip {
  min-width: 84px !important;
}

#dateSlicerOptions[data-date-mode="quarter"] .slicer-chip {
  min-width: 88px !important;
}

#dateSlicerOptions[data-date-mode="month"] .slicer-chip {
  min-width: 96px !important;
}

#dateSlicerOptions[data-date-mode="week"] .slicer-chip {
  min-width: 104px !important;
}

.filter-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.filter-grid > select,
#topFilters > select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 40px !important;
  font-size: 11px !important;
  padding: 0 24px 0 10px !important;
}

@media (max-width: 1180px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 960px) {
  .topbar {
    padding: 12px 14px !important;
  }

  .top-meta-extended {
    position: static !important;
    width: auto !important;
    margin-top: 4px !important;
    grid-template-columns: auto auto 1fr !important;
  }

  .top-meta-extended #updateText {
    grid-column: 1 / -1 !important;
  }

  #topFilters > .date-slicer {
    padding-right: 12px !important;
  }

  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #topFilters > .date-slicer .slicer-head {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  #topFilters > .date-slicer .slicer-tools {
    justify-content: space-between !important;
    flex-wrap: wrap !important;
  }

  .top-meta-extended {
    grid-template-columns: 1fr !important;
  }

  .top-meta-extended #updateText,
  .top-meta-extended #dataSourceBadge,
  .top-meta-extended #currentUserAvatar,
  .top-meta-extended .current-user-meta {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

/* Final header layout override */
.shell > .topbar {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 248px !important;
  align-items: start !important;
  gap: 16px !important;
  min-height: auto !important;
  height: auto !important;
  padding: 16px 18px !important;
}

.shell > .topbar > .topbar-spacer {
  display: none !important;
}

.shell > .topbar > .topbar-main {
  grid-column: 1 !important;
  min-width: 0 !important;
  width: 100% !important;
  display: grid !important;
  gap: 14px !important;
  align-content: start !important;
}

.shell > .topbar > .top-meta-extended {
  grid-column: 2 !important;
  position: static !important;
  width: 248px !important;
  min-width: 248px !important;
  max-width: 248px !important;
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 10px 8px !important;
  align-items: center !important;
  justify-self: end !important;
  padding: 10px 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
}

.shell > .topbar > .top-meta-extended #updateText {
  grid-column: 1 / -1 !important;
  display: block !important;
  min-width: 0 !important;
  white-space: normal !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
  color: #64748b !important;
}

.shell > .topbar > .top-meta-extended #dataSourceBadge {
  grid-column: 1 !important;
  justify-self: start !important;
}

.shell > .topbar > .top-meta-extended #currentUserButton {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
}

.shell > .topbar .user-entry {
  width: 100% !important;
  padding: 8px 10px !important;
  justify-content: flex-start !important;
}

.shell > .topbar .current-user-meta {
  min-width: 0 !important;
  text-align: left !important;
}

.shell > .topbar #roleLanding {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.shell > .topbar #topFilters {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

.shell > .topbar #topFilters > .date-slicer {
  width: 100% !important;
  min-width: 0 !important;
  padding: 12px 14px !important;
}

.shell > .topbar #topFilters > .date-slicer .slicer-options {
  max-height: 96px !important;
}

.shell > .topbar #topFilters > .filter-grid {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 10px 12px !important;
}

.shell > .topbar #topFilters > .filter-grid > select {
  width: 100% !important;
  min-width: 0 !important;
  display: block !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar .nav {
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar .sidebar-footer {
  margin-top: auto;
}

@media (max-width: 1280px) {
  .shell > .topbar {
    grid-template-columns: 1fr !important;
  }

  .shell > .topbar > .topbar-main,
  .shell > .topbar > .top-meta-extended {
    grid-column: 1 !important;
  }

  .shell > .topbar > .top-meta-extended {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-self: stretch !important;
  }
}

@media (max-width: 900px) {
  .shell > .topbar #topFilters > .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .shell > .topbar {
    padding: 12px !important;
  }

  .shell > .topbar #topFilters > .filter-grid {
    grid-template-columns: 1fr !important;
  }
}

