:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e5edf6;
  --line-strong: #d7e2ee;
  --text: #0f172a;
  --muted: #64748b;
  --muted-strong: #475569;
  --brand: #1f73ff;
  --brand-dark: #155bd6;
  --green: #19b36b;
  --amber: #f59e0b;
  --red: #ef4444;
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --sidebar: #071527;
  --sidebar-2: #0c2038;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  --sidebar-width: 232px;
  --sidebar-collapsed: 72px;
  font-family:
    Inter,
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(440px, 1.1fr);
  background:
    linear-gradient(120deg, rgba(7, 21, 39, 0.96), rgba(16, 42, 72, 0.94)),
    radial-gradient(circle at 30% 20%, rgba(31, 115, 255, 0.35), transparent 32%);
}

.login-visual {
  position: relative;
  padding: 52px;
  color: #fff;
  overflow: hidden;
}

.brand-mark,
.brand-mark-small {
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1f73ff, #20c997);
  color: #fff;
  box-shadow: 0 14px 32px rgba(31, 115, 255, 0.28);
}

.brand-mark {
  width: 52px;
  height: 52px;
}

.brand-mark-small {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.login-visual h1 {
  margin: 34px 0 14px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
}

.login-visual p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.75;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 640px;
  margin-top: 48px;
}

.login-metric {
  min-height: 110px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.login-metric strong {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}

.login-metric span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(245, 248, 252, 0.94)),
    var(--bg);
}

.login-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-title h2 {
  margin: 0;
  font-size: 22px;
}

.login-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

.field label {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.field.is-wide {
  grid-column: 1 / -1;
}

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

.check-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff;
}

.check-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.check-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.check-row strong,
.check-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-row strong {
  font-size: 13px;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(31, 115, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 115, 255, 0.1);
}

.form-error {
  display: none;
  min-height: 38px;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: #fff1f2;
  color: #be123c;
  font-size: 13px;
}

.form-error.is-visible {
  display: flex;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.soft-btn,
.danger-btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  white-space: nowrap;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.primary-btn {
  width: 100%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(31, 115, 255, 0.24);
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.ghost-btn {
  background: #fff;
  color: var(--muted-strong);
  border-color: var(--line);
}

.ghost-btn:hover,
.soft-btn:hover,
.icon-btn:hover {
  border-color: rgba(31, 115, 255, 0.35);
  color: var(--brand);
}

.soft-btn {
  background: #eef5ff;
  color: var(--brand);
  border-color: #dbeafe;
  font-weight: 700;
}

.danger-btn {
  background: #fff1f2;
  color: #e11d48;
  border-color: #ffe4e6;
}

.icon-btn {
  width: 36px;
  padding: 0;
  background: #fff;
  color: var(--muted-strong);
  border-color: var(--line);
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(8, 27, 49, 0.98), rgba(3, 12, 23, 1)),
    var(--sidebar);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 4px 0 22px rgba(15, 23, 42, 0.12);
}

.sidebar-head {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand-copy span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.nav {
  padding: 14px 10px 92px;
}

.nav-group {
  margin-bottom: 12px;
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 800;
}

.nav-link {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  margin: 3px 0;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 700;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 24px rgba(31, 115, 255, 0.26);
}

.nav-link i,
.nav-group-title i,
.brand-mark-small i,
.brand-mark i,
.icon-btn i,
.ghost-btn i,
.soft-btn i,
.danger-btn i {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.sidebar-foot {
  position: fixed;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  padding: 12px;
  background: rgba(3, 12, 23, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.avatar,
.avatar-sm {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #a7f3d0);
  color: #0f766e;
  font-weight: 900;
  overflow: hidden;
}

.avatar {
  width: 40px;
  height: 40px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.profile-mini div {
  min-width: 0;
}

.profile-mini strong,
.profile-mini span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-mini strong {
  font-size: 13px;
}

.profile-mini span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.breadcrumb strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-badge,
.status-pill,
.tag,
.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.api-badge {
  color: var(--muted-strong);
  background: #f1f5f9;
}

.status-pill {
  color: #047857;
  background: #dcfce7;
}

.status-pill.is-warn {
  color: #b45309;
  background: #fef3c7;
}

.status-pill.is-off {
  color: #be123c;
  background: #ffe4e6;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.top-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-user div {
  min-width: 0;
}

.top-user strong,
.top-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-user strong {
  font-size: 13px;
}

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

.content {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 20px 26px 26px;
}

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

.page-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.panel,
.table-panel,
.stat-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 22px;
}

.metric-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}

.metric-icon i {
  width: 24px;
  height: 24px;
}

.metric-card h3 {
  margin: 0 0 7px;
  color: var(--muted-strong);
  font-size: 13px;
}

.metric-value {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 900;
}

.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.metric-delta.is-muted {
  color: var(--muted);
}

.panel {
  min-width: 0;
  padding: 18px;
}

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

.panel-head h2,
.table-head h2 {
  margin: 0;
  font-size: 17px;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(320px, 1.15fr) minmax(250px, 0.78fr);
  gap: 16px;
}

.bottom-row {
  display: grid;
  grid-template-columns: minmax(420px, 1.18fr) minmax(320px, 0.82fr) minmax(250px, 0.72fr);
  gap: 16px;
}

.wide-row {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 16px;
}

.chart {
  width: 100%;
  min-height: 284px;
}

.chart-sm {
  width: 100%;
  min-height: 210px;
}

.empty-chart {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.service-list,
.announce-list,
.resource-list {
  display: grid;
  gap: 14px;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  color: var(--muted-strong);
  font-weight: 800;
}

.service-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.service-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.8;
}

.announce-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  color: var(--muted-strong);
  font-size: 13px;
}

.announce-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.announce-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-item {
  display: grid;
  gap: 7px;
}

.resource-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.table-panel {
  min-width: 0;
  padding: 18px;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.table-tools-left,
.table-tools-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-box {
  position: relative;
  min-width: min(320px, 100%);
}

.search-box i {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 12px 0 36px;
  outline: none;
}

.filter-select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted-strong);
  padding: 0 10px;
  outline: none;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--muted-strong);
  background: #f8fafc;
  font-weight: 900;
}

td {
  color: #172033;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.cell-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.cell-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

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

.action-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-strong);
}

.action-btn i {
  width: 16px;
  height: 16px;
}

.action-btn:hover {
  background: #eef5ff;
  color: var(--brand);
}

.action-btn.is-danger:hover {
  background: #fff1f2;
  color: var(--red);
}

.tag {
  background: #edf2f7;
  color: var(--muted-strong);
}

.tag.is-green {
  background: #dcfce7;
  color: #059669;
}

.tag.is-red {
  background: #ffe4e6;
  color: #e11d48;
}

.tag.is-amber {
  background: #fef3c7;
  color: #b45309;
}

.tag.is-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.tag.is-violet {
  background: #ede9fe;
  color: #7c3aed;
}

.pagination {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.pager-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pager-buttons button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted-strong);
}

.pager-buttons button.is-current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

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

.stat-tile {
  padding: 16px;
}

.stat-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

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

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

.form-card h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.switch-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.switch-row:last-child {
  border-bottom: 0;
}

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

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  padding: 0;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.toggle.is-on {
  background: var(--brand);
}

.toggle.is-on::after {
  transform: translateX(18px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.modal {
  width: min(680px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.detail-grid {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 11px 14px;
  font-size: 13px;
}

.detail-grid dt {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.detail-grid dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

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

.message-bubble {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  line-height: 1.65;
  font-size: 13px;
}

.message-bubble strong {
  display: block;
  margin-bottom: 4px;
}

#toast-root {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: min(360px, calc(100vw - 40px));
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
}

.toast i {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.layout.is-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.layout.is-collapsed .sidebar-foot {
  width: var(--sidebar-collapsed);
}

.layout.is-collapsed .brand-copy,
.layout.is-collapsed .nav-group-title span,
.layout.is-collapsed .nav-link span,
.layout.is-collapsed .profile-mini div {
  display: none;
}

.layout.is-collapsed .sidebar-head,
.layout.is-collapsed .nav-group-title,
.layout.is-collapsed .nav-link,
.layout.is-collapsed .profile-mini {
  justify-content: center;
}

.layout.is-collapsed .nav-link {
  padding: 0;
}

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

  .chart-row,
  .bottom-row,
  .wide-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  .login-visual {
    min-height: 330px;
    padding: 34px;
  }

  .login-metrics {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .layout,
  .layout.is-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .layout.is-mobile-open .sidebar {
    transform: translateX(0);
  }

  .layout.is-collapsed .sidebar {
    width: var(--sidebar-width);
  }

  .layout.is-collapsed .brand-copy,
  .layout.is-collapsed .nav-group-title span,
  .layout.is-collapsed .nav-link span,
  .layout.is-collapsed .profile-mini div {
    display: block;
  }

  .layout.is-collapsed .sidebar-head,
  .layout.is-collapsed .nav-group-title,
  .layout.is-collapsed .nav-link,
  .layout.is-collapsed .profile-mini {
    justify-content: flex-start;
  }

  .layout.is-collapsed .nav-link {
    padding: 0 12px;
  }

  .sidebar-foot,
  .layout.is-collapsed .sidebar-foot {
    width: var(--sidebar-width);
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .metric-grid,
  .stats-grid,
  .settings-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .table-tools,
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .table-tools-left,
  .table-tools-right {
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
  }

  .api-badge {
    display: none;
  }
}

@media (max-width: 640px) {
  .login-panel-wrap {
    padding: 18px;
  }

  .login-panel {
    padding: 22px;
  }

  .topbar-right .top-user div,
  .topbar-right .status-pill {
    display: none;
  }

  .metric-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 16px;
  }

  .metric-icon {
    width: 46px;
    height: 46px;
  }

  .metric-value {
    font-size: 22px;
  }

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