:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --panel-alt: #f8fbff;
  --text: #172033;
  --muted: #64748b;
  --line: #dbe4ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #f59e0b;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #eef4fb 0%, var(--bg) 100%);
  color: var(--text);
}

.site-shell { min-height: 100vh; }
.container {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
}
.page-content {
  padding-bottom: 40px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
  background: rgba(243,247,251,0.9);
  border-bottom: 1px solid rgba(219,228,239,0.9);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 20px 0 14px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.site-header h1 {
  margin: 0;
  font-size: 30px;
}
.subtext {
  margin: 8px 0 0;
  color: var(--muted);
}
.header-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-chip {
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}
.nav-bar {
  display: flex;
  gap: 10px;
  padding-bottom: 16px;
}
.nav-bar a {
  text-decoration: none;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: bold;
}
.nav-bar a.active,
.nav-bar a:hover {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 20px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}
.panel-head p {
  margin: 0;
  color: var(--muted);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: bold;
}
.field input,
.field select,
.btn {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  font-size: 15px;
}
.field.actions {
  display: flex;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-weight: bold;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary {
  background: #fff;
  color: var(--text);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.stat-card {
  background: linear-gradient(180deg, #fff 0%, var(--panel-alt) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.stat-card strong {
  font-size: 22px;
  line-height: 1.35;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.chart-wrap {
  height: 360px;
}
.summary-list {
  margin: 0;
  display: grid;
  gap: 12px;
}
.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.summary-list dt {
  color: var(--muted);
  font-weight: bold;
}
.summary-list dd {
  margin: 0;
  text-align: right;
}
.table-head { margin-bottom: 14px; }
.table-count {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary-dark);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: bold;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.list-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}
.list-table th,
.list-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
  font-size: 14px;
}
.list-table thead th {
  position: sticky;
  top: 0;
  background: #eff6ff;
  color: #1e3a8a;
  z-index: 1;
}
.list-table tbody tr:nth-child(even) { background: #fbfdff; }
.list-table tbody tr:hover { background: #f0f7ff; }
.device-badge {
  display: inline-block;
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 999px;
  font-weight: bold;
}
.empty-cell {
  padding: 40px 16px !important;
  color: var(--muted);
}
.modify-controls input[type="submit"] {
  width: 100px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
.pagination {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination a,
.pagination strong {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: #fff;
}
.pagination strong {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

@media (max-width: 720px) {
  .container { width: min(100%, calc(100% - 20px)); }
  .header-inner,
  .panel-head { flex-direction: column; align-items: flex-start; }
  .nav-bar { overflow-x: auto; padding-bottom: 12px; }
  .filter-grid,
  .stats-grid { grid-template-columns: 1fr; }
  .field.actions { flex-direction: column; }
  .site-header h1 { font-size: 24px; }
  .chart-wrap { height: 300px; }
}
