:root {
  --bg: #f5f7fa;
  --panel: #fff;
  --text: #172033;
  --muted: #64748b;
  --line: #d7dee9;
  --brand: #0f766e;
  --blue: #2563eb;
  --warn: #a16207;
  --danger: #b42318;
  --good: #047857;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.shell {
  width: min(1440px, 96%);
  margin: 16px auto 28px;
}

.login-wrap {
  min-height: calc(100vh - 44px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(430px, 96vw);
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.login-card p {
  color: var(--muted);
}

.login-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-weight: 900;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #fff;
  background: linear-gradient(135deg, #0b3b3b, #111827);
  border-radius: 8px;
  padding: 16px;
}

h1,
h2,
p {
  margin: 0;
}

.topbar h1 {
  font-size: 24px;
}

.topbar p {
  color: #cbd5e1;
  margin-top: 5px;
  font-size: 13px;
}

.filters,
.metrics,
.grid,
.panel {
  margin-top: 14px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
  background: #fff;
  color: var(--text);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.line {
  background: #fff;
}

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

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.metrics article {
  padding: 12px;
}

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

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.panel {
  padding: 14px;
}

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

.panel h2 {
  font-size: 18px;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  white-space: nowrap;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

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

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: #dcfce7;
  color: var(--good);
}

.badge.low {
  background: #fef3c7;
  color: var(--warn);
}

.badge.out {
  background: #fee2e2;
  color: var(--danger);
}

.message {
  margin-top: 14px;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.message.error {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .filters,
  .metrics,
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }
}
