:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #657386;
  --line: #d8e0e8;
  --accent: #1264d8;
  --accent-soft: #e8f1ff;
  --ok: #16764a;
  --warn: #a85a00;
  --danger: #bd2b2b;
  --danger-soft: #fff0f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 45px rgba(20, 32, 46, 0.13);
  --shadow-soft: 0 10px 28px rgba(21, 32, 43, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, #f2f5f9 190px),
    var(--bg);
  color: var(--ink);
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

button:hover {
  border-color: var(--accent);
  box-shadow: 0 5px 14px rgba(18, 100, 216, 0.1);
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 26px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.header-title {
  flex: 1 1 auto;
  min-width: 0;
}

.header-title h1,
.header-title .header-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 32px);
}

.header-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

h2 {
  font-size: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-box {
  flex: 0 1 44%;
  min-width: 0;
  max-width: 44vw;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-box span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.auth-panel {
  max-width: 680px;
  margin: 80px auto;
  padding: 0 20px;
}

.dashboard {
  width: min(100%, 1800px);
  margin: 0 auto;
  padding: 20px;
}

.monitor-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.monitor-sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: min(744px, calc(100vh - 148px));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px;
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(21, 32, 43, 0.045);
}

.monitor-nav-toggle {
  display: none;
}

.monitor-sidebar-head {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  padding: 8px 10px 13px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.monitor-sidebar-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.monitor-sidebar-head strong {
  font-size: 17px;
}

.monitor-nav {
  display: grid;
  gap: 16px;
  min-height: 0;
  padding: 6px 2px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c7d1dc transparent;
}

.monitor-nav::-webkit-scrollbar {
  width: 5px;
}

.monitor-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c7d1dc;
}

.monitor-nav-group {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.monitor-nav-group-label {
  padding: 0 10px;
  color: #7a8797;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.monitor-nav-list {
  display: grid;
  gap: 3px;
}

.monitor-nav button {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border-color: transparent;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.monitor-nav button > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #7a8797;
}

.monitor-nav-icon svg,
.monitor-nav-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.monitor-nav button:hover {
  border-color: transparent;
  background: #f3f6fa;
  box-shadow: none;
}

.monitor-nav button:focus-visible,
.monitor-nav-toggle:focus-visible {
  outline: 2px solid rgba(18, 100, 216, 0.35);
  outline-offset: 1px;
}

.monitor-nav button.active {
  border-color: transparent;
  background: #eaf2ff;
  color: #0d58be;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.monitor-nav button.active .monitor-nav-icon {
  color: var(--accent);
}

.monitor-content {
  min-width: 0;
}

.monitor-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 72px;
  margin-bottom: 16px;
  padding: 3px 0 12px;
  border-bottom: 1px solid var(--line);
}

.monitor-page-head h2 {
  margin-top: 4px;
  font-size: 26px;
}

.monitor-page-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.notice {
  border: 1px solid #efb2b2;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.panel.empty {
  padding: 28px;
}

.panel.empty p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  width: 100%;
  min-height: 112px;
  box-shadow: var(--shadow-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.metric.danger strong {
  color: var(--danger);
}

.metric:hover,
.mini:hover,
.metric:focus-visible,
.mini:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(18, 100, 216, 0.09);
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.grid.three {
  grid-template-columns: 0.8fr 0.8fr 1.2fr;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
}

.notification-metrics {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-bottom: 14px;
}

.mini {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fafbfd;
  text-align: left;
  width: 100%;
  min-height: 74px;
}

.mini span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini strong {
  font-size: 24px;
}

.mini strong.danger {
  color: var(--danger);
}

.analytics-view {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
}

.monitor-module {
  min-height: 430px;
}

.analytics-hero {
  background:
    linear-gradient(135deg, rgba(18, 100, 216, 0.1), rgba(22, 118, 74, 0.08)),
    var(--surface);
}

.chart-panel {
  overflow: hidden;
}

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

.report-export-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.export-group {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fafbfd;
}

.export-group strong,
.export-group span {
  display: block;
}

.export-group span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.export-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.export-links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
}

.export-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.comparison-card,
.report-card,
.management-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
}

.comparison-card span,
.report-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.comparison-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.comparison-card p,
.report-card strong,
.management-card p,
.snapshot-note {
  color: var(--muted);
  font-size: 13px;
}

.comparison-card.up strong,
.comparison-card.new strong {
  color: var(--accent);
}

.comparison-card.down strong {
  color: var(--ok);
}

.chart-box {
  min-height: 260px;
}

.chart-svg-wrap {
  width: 100%;
  overflow: hidden;
}

.chart-svg-wrap svg {
  display: block;
  width: 100%;
  min-height: 230px;
}

.chart-svg-wrap .axis {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-svg-wrap text {
  fill: var(--muted);
  font-size: 11px;
}

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span,
.donut-list div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i,
.donut-list i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.donut-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 160px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut strong,
.donut span {
  position: relative;
  z-index: 1;
}

.donut strong {
  align-self: end;
  font-size: 28px;
}

.donut span {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}

.donut-list,
.bar-list,
.management-grid,
.delay-grid,
.insight-grid,
.health-grid,
.workbench-grid {
  display: grid;
  gap: 10px;
}

.donut-list div {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.donut-list strong {
  color: var(--ink);
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.bar-row strong {
  color: var(--ink);
  font-size: 14px;
}

.bar-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.bar-track span,
.bar-track em {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.bar-track span {
  background: var(--accent-soft);
}

.bar-track em {
  background: var(--danger);
  opacity: 0.8;
}

.delay-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.delay-card {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(18, 100, 216, 0.08), rgba(255, 255, 255, 0)),
    #fafbfd;
  padding: 16px;
  text-align: left;
}

.delay-card.danger {
  background:
    linear-gradient(135deg, rgba(189, 43, 43, 0.1), rgba(255, 255, 255, 0)),
    #fffafa;
}

.delay-card span,
.delay-card p,
.delay-card em {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.delay-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.05;
}

.delay-card.danger strong {
  color: var(--danger);
}

.delay-card p {
  margin-top: 10px;
}

.delay-card em {
  margin-top: 6px;
}

.delay-analysis {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 12px;
}

.delay-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
}

.delay-panel h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.delay-ranking .bar-row {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

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

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

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

.wide-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.insight-card,
.workbench-card,
.health-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfd;
  padding: 14px;
  min-height: 112px;
  text-align: left;
}

button.insight-card,
.workbench-card {
  width: 100%;
}

.insight-card span,
.workbench-card span,
.health-card span,
.health-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.insight-card strong,
.health-card strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.insight-card em,
.workbench-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 30px;
  font-style: normal;
  font-weight: 800;
}

.insight-card p,
.health-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.closure-card {
  display: grid;
  gap: 10px;
}

.compact-meta {
  gap: 8px;
  margin-top: 0;
}

.muted-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.closure-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.closure-actions button,
.section-actions button,
.reason-form button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.closure-actions button:first-child,
.section-actions button,
.reason-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.reason-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.reason-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.reason-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reason-form select,
.reason-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 10px;
  color: var(--ink);
  font: inherit;
}

.supervision-item {
  cursor: default;
}

.insight-card.critical {
  background: var(--danger-soft);
  border-color: #efb2b2;
}

.insight-card.critical span,
.insight-card.critical em {
  color: var(--danger);
}

.insight-card.warning {
  background: #fff8eb;
  border-color: #f0d39b;
}

.insight-card.warning span,
.insight-card.warning em {
  color: var(--warn);
}

.health-card.ok {
  background: #f1fbf6;
  border-color: #b7e2cc;
}

.health-card.ok span {
  color: var(--ok);
}

.health-card.warning,
.health-card.critical {
  background: #fff8eb;
  border-color: #f0d39b;
}

.health-card.critical span,
.health-card.warning span {
  color: var(--warn);
}

.management-card h3 {
  margin-bottom: 8px;
}

.management-card p {
  margin: 6px 0 0;
}

.snapshot-note {
  margin-top: 12px;
}

.list {
  display: grid;
  gap: 10px;
}

.permission-list {
  display: grid;
  gap: 12px;
}

.permission-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(360px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.permission-user {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.permission-user span,
.permission-user code {
  color: var(--muted);
  font-size: 12px;
}

.permission-user code {
  word-break: break-all;
}

.role-legend,
.role-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  gap: 8px;
}

.role-legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.role-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fafbfd;
  font-size: 12px;
}

.role-check input {
  margin: 0;
}

.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  box-shadow: 0 6px 18px rgba(21, 32, 43, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.item.clickable {
  cursor: pointer;
}

.item.clickable:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(18, 100, 216, 0.11);
  transform: translateY(-1px);
}

.department-group {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.department-group header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.department-group h3 {
  margin: 0;
}

.department-group p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.employee-list {
  display: grid;
  gap: 8px;
}

.employee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  text-align: left;
}

.employee-row span,
.employee-count {
  display: grid;
  gap: 2px;
}

.employee-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.employee-count {
  justify-items: end;
}

.employee-count strong {
  font-size: 22px;
}

.empty-hint {
  color: var(--muted);
  font-size: 12px;
}

.item-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.item-title strong {
  font-size: 15px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf1f5;
  color: #435166;
  font-size: 12px;
}

.tag.ok {
  background: #e9f7f0;
  color: var(--ok);
}

.tag.warn {
  background: #fff4df;
  color: var(--warn);
}

.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.attachment-panel {
  display: grid;
  gap: 12px;
}

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

.attachment-head span {
  color: var(--muted);
  font-size: 12px;
}

.attachment-list,
.attachment-log {
  display: grid;
  gap: 8px;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #fafbfd;
}

.attachment-item strong {
  display: block;
  color: var(--ink);
}

.attachment-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.button-link:hover {
  border-color: #9bbbe5;
  background: var(--accent-soft);
}

.attachment-actions button[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

.attachment-event {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-event strong {
  color: var(--ink);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 27, 0.35);
  backdrop-filter: blur(4px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 100%);
  height: 100%;
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.drawer-close {
  float: right;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  clear: both;
}

.field {
  color: var(--muted);
  font-size: 12px;
}

.field strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-top: 3px;
  word-break: break-word;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}

@media (max-width: 1100px) {
  .grid.two,
  .grid.three,
  .comparison-grid,
  .report-grid,
  .management-grid,
  .insight-grid,
  .health-grid,
  .workbench-grid,
  .permission-item,
  .role-legend,
  .role-grid,
  .delay-summary,
  .delay-analysis,
  .dashboard-overview-grid {
    grid-template-columns: 1fr;
  }

  .export-group {
    grid-template-columns: 1fr;
  }

  .export-links {
    justify-content: flex-start;
  }

  .donut-layout {
    grid-template-columns: 1fr;
  }

  .reason-form {
    grid-template-columns: 1fr 1fr;
  }

  .reason-form .wide-field,
  .reason-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .monitor-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .monitor-sidebar {
    position: static;
    display: block;
    max-height: none;
    padding: 0;
    overflow: visible;
    box-shadow: none;
  }

  .monitor-nav-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 7px;
    padding: 10px 13px;
    background: var(--surface);
    text-align: left;
    box-shadow: none;
  }

  .monitor-nav-toggle:hover {
    border-color: transparent;
    background: #f8fafc;
    box-shadow: none;
  }

  .monitor-nav-toggle-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .monitor-nav-toggle strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .monitor-nav-chevron {
    color: var(--muted);
    transition: transform 0.18s ease;
  }

  .monitor-sidebar.nav-open .monitor-nav-chevron {
    transform: rotate(180deg);
  }

  .monitor-sidebar.nav-switching .monitor-nav,
  .monitor-sidebar.nav-switching .monitor-nav-chevron {
    transition: none;
  }

  .monitor-sidebar-head {
    display: none;
  }

  .monitor-nav {
    display: grid;
    gap: 13px;
    max-height: 0;
    padding: 0 10px;
    border-top: 0 solid var(--line);
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    transition: max-height 0.22s ease, padding 0.22s ease, border-width 0.22s ease, opacity 0.16s ease;
  }

  .monitor-sidebar.nav-open .monitor-nav {
    max-height: min(64vh, 560px);
    padding: 11px 10px 12px;
    border-top-width: 1px;
    opacity: 1;
    overflow-y: auto;
    pointer-events: auto;
    visibility: visible;
  }

  .monitor-nav-group {
    gap: 5px;
  }

  .monitor-nav-group-label {
    padding: 0 4px;
  }

  .monitor-nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .monitor-nav button {
    min-height: 44px;
    padding: 8px 9px;
  }

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

@media (max-width: 760px) {
  .dashboard {
    padding: 14px;
  }

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

  .panel,
  .metric,
  .mini,
  .item,
  .department-group {
    border-radius: 8px;
  }

  .monitor-page-head {
    min-height: 64px;
    margin-bottom: 12px;
  }

  .monitor-page-head h2 {
    font-size: 22px;
  }

  .monitor-page-head p {
    font-size: 12px;
  }

  .monitor-module {
    min-height: 0;
  }

  .employee-row {
    grid-template-columns: 1fr;
  }

  .employee-count {
    justify-items: start;
  }

  .attachment-head,
  .attachment-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .attachment-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .inline-actions,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 42%);
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
  }

  .header-actions {
    min-width: 0;
    justify-content: flex-end;
  }

  #permissionsNav,
  #refreshBtn {
    display: none;
  }

  .user-box {
    max-width: 100%;
    text-align: right;
  }

  .dashboard {
    padding: 14px;
  }

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