:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #15202b;
  --muted: #728093;
  --border: #e6ebf1;
  --accent: #2f7de1;
  --accent-soft: #eaf3ff;
  --success: #1f9d68;
  --success-soft: #e8f7f0;
  --warning: #d99519;
  --warning-soft: #fff7e6;
  --danger: #d94a4a;
  --danger-soft: #fff0f0;
  --shadow: 0 12px 35px rgba(24, 39, 58, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

button,
input,
select {
  font: inherit;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  background: #101923;
  color: #fff;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3688ee, #1e68c4);
  box-shadow: 0 10px 24px rgba(47, 125, 225, 0.28);
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: #8fa2b7;
  font-size: 12px;
}

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

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  color: #aebdcb;
  border-radius: 10px;
  font-size: 14px;
  transition: .2s ease;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.nav-icon {
  width: 22px;
  text-align: center;
  opacity: .9;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px 4px;
  color: #72869a;
  font-size: 12px;
  line-height: 1.5;
}

.main {
  padding: 28px;
  min-width: 0;
}

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

.page-title h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.5px;
}

.page-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 10px 7px 8px;
  box-shadow: var(--shadow);
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

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

.user span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 19px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.7px;
}

.stat-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--success);
}

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

.dashboard-grid {
  grid-template-columns: 1.45fr .8fr;
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

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

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

.server-item {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) .8fr .8fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}

.server-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.server-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
  flex: 0 0 auto;
}

.server-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}

.server-name strong {
  display: block;
  font-size: 14px;
}

.server-name span,
.metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

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

.storage {
  display: grid;
  place-items: center;
  min-height: 210px;
}

.donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 68%, #e9eef5 68% 100%);
  position: relative;
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: var(--surface);
}

.donut-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-content strong {
  display: block;
  font-size: 28px;
}

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

.storage-caption {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.table-card {
  overflow: hidden;
}

.table-toolbar {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.table-toolbar h2 {
  margin: 0;
  font-size: 16px;
}

.search {
  width: 240px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text);
  outline: none;
}

.search:focus {
  border-color: #a9c9f0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

th,
td {
  padding: 15px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #fbfcfe;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .55px;
}

tbody tr:hover {
  background: #fbfdff;
}

.progress {
  width: 120px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eef5;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.logs {
  display: grid;
  gap: 12px;
}

.log-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.log-item:last-child {
  border-bottom: 0;
}

.log-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 800;
}

.log-icon.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

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

.log-item strong {
  display: block;
  font-size: 13px;
}

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

.log-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--accent-soft);
  color: #235f9f;
  border: 1px solid #d9eaff;
  border-radius: 12px;
  font-size: 13px;
}

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

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .brand {
    padding-bottom: 16px;
  }

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

  .nav a {
    justify-content: center;
  }

  .nav-icon {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .user {
    display: none;
  }

  .server-item {
    grid-template-columns: 1fr 1fr;
  }

  .server-item .badge {
    justify-self: start;
  }

  .table-card {
    overflow-x: auto;
  }

  table {
    min-width: 720px;
  }
}

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

  .nav a {
    font-size: 12px;
    padding: 10px 6px;
  }

  .server-item {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }
}