:root {
  --bg: #f7f9fc;
  --bg-soft: #eef3fb;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --surface-tint: #f8fbff;
  --line: #e6edf7;
  --line-strong: #ced9e8;
  --text: #111c2f;
  --muted: #64748b;
  --faint: #94a3b8;
  --blue: #256df4;
  --blue-strong: #155bd5;
  --blue-soft: #eaf3ff;
  --cyan: #0ea5e9;
  --green: #10a66b;
  --green-soft: #e8f7f0;
  --orange: #c77700;
  --orange-soft: #fff5df;
  --red: #d92d20;
  --red-soft: #fff1ef;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--line);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.025);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 2px 10px;
  border-bottom: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at center, #ffffff 0 28%, #256df4 30% 43%, #d9e7ff 45% 58%, #256df4 60% 74%, #ffffff 76%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0;
  box-shadow: 0 10px 22px rgba(37, 109, 244, 0.16);
}

.brand-title {
  font-size: 18px;
  font-weight: 780;
  color: var(--text);
}

.brand-subtitle,
.tiny {
  color: var(--faint);
  font-size: 12px;
}

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

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #344258;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-radius: var(--radius);
  padding: 0 14px;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--line);
}

.nav-item.active {
  color: var(--blue);
  background: #edf5ff;
  border-color: #e1edff;
  box-shadow: none;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-status,
.sidebar-user {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--surface-tint));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.sidebar-status {
  min-height: 72px;
  padding: 12px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-status strong {
  display: block;
  color: var(--green);
  font-size: 13px;
  margin-bottom: 5px;
}

.sidebar-status span:not(.status-dot) {
  display: block;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.sidebar-user {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-size: 14px;
  font-weight: 780;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-user-main strong,
.sidebar-user-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-main strong {
  color: var(--text);
  font-size: 14px;
}

.sidebar-user-main span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-chevron {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.sync-pill,
.badge {
  width: fit-content;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #bfe8d3;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 680;
}

.badge.neutral {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
}

.main {
  min-width: 0;
  padding: 22px 32px 22px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

p {
  color: var(--muted);
}

.topbar-actions,
.inline-form,
.empty-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button.primary {
  background: linear-gradient(180deg, #2f7df5, var(--blue-strong));
  color: #fff;
  box-shadow: 0 10px 20px rgba(29, 111, 242, 0.22);
}

.button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.button.danger {
  color: var(--red);
  background: #fff;
  border-color: #f1c4bf;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.button:focus-visible,
.icon-button:focus-visible,
.nav-item:focus-visible,
.input:focus-visible,
.select:focus-visible,
.segmented button:focus-visible {
  outline: 2px solid rgba(29, 111, 242, 0.38);
  outline-offset: 2px;
}

.icon-button {
  width: 34px;
  padding: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 20px;
}

.input,
.select {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  min-width: 170px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

#package-select {
  min-width: 330px;
}

.input.compact,
.select.compact {
  min-width: 128px;
  height: 32px;
  font-size: 13px;
}

.input:focus,
.select:focus {
  border-color: #9fc3ff;
}

.select {
  cursor: pointer;
}

.auth-panel,
.empty-state,
.status-bar,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-panel,
.empty-state {
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-soft);
}

.auth-panel {
  border-color: #cfe2ff;
  background: linear-gradient(90deg, #f7fbff, #fff);
}

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

.user-chip {
  min-height: 36px;
  max-width: 180px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-bar {
  min-height: 46px;
  color: #263650;
  padding: 12px 16px 12px 46px;
  margin-bottom: 18px;
  background: #f7fbff;
  border-color: #8bb7ff;
  position: relative;
}

.status-bar::before {
  content: "i";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#overview-view.view.active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.kpi-grid:empty,
.package-snapshot:empty {
  display: none;
}

.kpi {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.kpi::before {
  display: none;
}

.kpi-top {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.kpi-label {
  color: #334155;
  font-size: 14px;
  font-weight: 680;
}

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.kpi-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  margin-left: 68px;
}

.kpi-trend {
  color: var(--green);
  font-size: 12px;
  margin-left: 68px;
}

.package-snapshot {
  display: none;
}

.snapshot-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.snapshot-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  margin-bottom: 5px;
}

.snapshot-value {
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr) minmax(0, 1.18fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.dashboard-bottom-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 1.35fr);
  align-items: stretch;
  margin-bottom: 14px;
}

.panel {
  min-width: 0;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

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

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

.radar-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.timeline-panel {
  margin-bottom: 0;
}

.dashboard-bottom-grid .timeline-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timeline-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.timeline-date,
.timeline-value {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.timeline-value {
  text-align: right;
}

.timeline-track {
  height: 7px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.timeline-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.radar-wrap {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  align-items: center;
  gap: 8px;
}

#radar-canvas {
  width: 100%;
  max-width: 360px;
  height: 300px;
}

.radar-legend {
  display: grid;
  gap: 8px;
}

.legend-row,
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.legend-key {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--blue);
}

.legend-label {
  color: var(--muted);
}

.legend-value {
  font-weight: 740;
  font-variant-numeric: tabular-nums;
}

.resource-tree {
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 0;
}

.resource-header,
.tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 74px;
  align-items: center;
  gap: 10px;
}

.resource-header {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  border-bottom: 1px solid var(--line);
  background: var(--surface-tint);
  padding: 0 10px;
}

.resource-header span:nth-child(2),
.resource-header span:nth-child(3) {
  text-align: right;
}

.tree-row {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
}

.tree-row:hover {
  background: var(--surface-tint);
}

.tree-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-kind {
  width: 15px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid #94bfff;
  background: #eef6ff;
  flex: 0 0 auto;
}

.resource-kind.file {
  width: 13px;
  height: 15px;
  border-color: #c7d2e1;
  background: #f8fafc;
}

.metric-num {
  color: #1f2d43;
  text-align: right;
  font-variant-numeric: tabular-nums;
  justify-self: stretch;
}

.type-tag {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #d7e7ff;
  font-size: 12px;
  font-weight: 680;
}

.heat-bar,
.metric-track {
  height: 7px;
  background: var(--surface-soft);
  border-radius: 99px;
  overflow: hidden;
}

.heat-bar span,
.metric-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.table-wrap {
  overflow: auto;
}

.heat-panel .table-wrap {
  overflow: hidden;
}

.heat-panel table {
  table-layout: fixed;
}

.heat-panel th:nth-child(1),
.heat-panel td:nth-child(1) {
  width: 48px;
}

.heat-panel th:nth-child(3),
.heat-panel td:nth-child(3),
.heat-panel th:nth-child(4),
.heat-panel td:nth-child(4) {
  width: 62px;
  text-align: right;
}

.table-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 680;
  font-size: 12px;
  background: var(--surface-tint);
}

td {
  color: var(--text);
}

tbody tr:hover {
  background: #fbfdff;
}

.muted {
  color: var(--muted);
}

.linkish {
  color: var(--blue);
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 680;
}

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

.channel-summary {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 210px;
}

.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.donut-chart > div {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  align-content: center;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

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

.donut-chart strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.channel-legend {
  display: grid;
  gap: 12px;
}

.channel-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  color: #334155;
}

.channel-item em {
  color: var(--muted);
  font-style: normal;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.mini-table {
  display: grid;
  align-content: start;
  gap: 0;
  overflow: auto;
}

.mini-head,
.mini-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
}

.mini-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  background: var(--surface-tint);
  padding: 0 10px;
}

.mini-row {
  padding: 0 10px;
}

.mini-foot {
  min-height: 34px;
  padding: 9px 10px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.event-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-pager div {
  display: flex;
  gap: 8px;
}

.mini-page-button {
  min-width: 58px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.mini-page-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.mini-row strong {
  color: var(--text);
  font-weight: 700;
}

.sharer-row {
  grid-template-columns: 44px minmax(0, 1fr) 82px 82px;
}

.event-table-row {
  grid-template-columns: 78px 96px 104px minmax(0, 1fr) 120px 82px;
}

.recent-panel .event-table-row {
  grid-template-columns:
    minmax(88px, 0.5fr)
    minmax(116px, 0.7fr)
    minmax(120px, 0.75fr)
    minmax(240px, 1.7fr)
    minmax(160px, 1fr)
    minmax(108px, 0.75fr);
}

.event-table-row span,
.event-table-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-tint);
}

.metric-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.event-list {
  display: grid;
  gap: 0;
  max-height: 310px;
  overflow: auto;
}

#overview-view > .recent-panel {
  flex: 1;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

#overview-view > .recent-panel .event-list {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.event-main {
  min-width: 0;
}

.event-meta {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 12px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

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

.qr-card img {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: #fff;
}

.copy-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-line code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.settings-list {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px 14px;
}

.settings-list dt {
  color: var(--muted);
}

.settings-list dd {
  margin: 0;
  word-break: break-all;
}

.check-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  display: grid;
  gap: 10px;
}

.dialog {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  width: min(560px, calc(100vw - 36px));
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(3px);
}

.dialog-body {
  padding: 18px;
  display: grid;
  gap: 14px;
  background: #fff;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 680;
}

.dialog label .input,
.dialog label .select {
  width: 100%;
}

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

.dialog-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  background: #172033;
  color: #fff;
  border-radius: var(--radius);
  padding: 11px 14px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .package-snapshot,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

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

  .topbar,
  .auth-panel,
  .empty-state {
    display: grid;
  }

  .topbar-actions,
  .inline-form,
  .empty-actions,
  .auth-actions {
    align-items: stretch;
  }

  .topbar-actions > *,
  .inline-form > *,
  .empty-actions > *,
  .auth-actions > * {
    width: 100%;
  }

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

  .package-snapshot,
  .timeline-list {
    grid-template-columns: 1fr;
  }

  .radar-wrap {
    grid-template-columns: 1fr;
  }

  .analysis-grid,
  .dashboard-bottom-grid {
    gap: 8px;
  }

  .panel {
    padding: 12px;
  }

  .panel-head {
    gap: 8px;
  }

  .heat-panel .panel-head {
    display: grid;
  }

  .heat-panel .panel-tools {
    justify-content: stretch;
  }

  .heat-panel .select.compact {
    min-width: 0;
    width: 100%;
  }

  .heat-panel th,
  .heat-panel td {
    padding: 7px 4px;
  }

  .heat-panel th:nth-child(1),
  .heat-panel td:nth-child(1) {
    width: 34px;
  }

  .heat-panel th:nth-child(3),
  .heat-panel td:nth-child(3),
  .heat-panel th:nth-child(4),
  .heat-panel td:nth-child(4) {
    width: 42px;
  }

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

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

@media (max-width: 420px) {
  .analysis-grid,
  .lower-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
}
