:root {
  color: #111;
  background: #f4f4f1;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }

.auth-shell, .loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 0%, #eee9ff 0, transparent 38%),
    #f4f4f1;
}

.auth-card {
  width: min(100%, 480px);
  padding: 40px;
  border: 1px solid #ddd;
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 30px 80px rgba(0,0,0,.08);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: white;
  background: #111;
  font-weight: 800;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0;
  color: #777;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 { margin: 8px 0; font-size: clamp(34px, 5vw, 54px); letter-spacing: -.05em; }
h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.03em; }
.auth-copy, .subtitle { color: #666; line-height: 1.55; }
.notice { padding: 12px 14px; border-radius: 12px; background: #ecfdf3; color: #166534; }
form { display: grid; gap: 10px; margin-top: 26px; }
label { color: #555; font-size: 13px; font-weight: 700; }
input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  color: #333;
  background: #f8f8f7;
}
button {
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  color: white;
  background: #111;
  font-weight: 750;
}
button:disabled { cursor: wait; opacity: .55; }
.security-note { margin: 18px 0 0; color: #999; font-size: 12px; }

.dashboard { width: min(1480px, 100%); margin: auto; padding: 34px 30px 56px; }
.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.topbar h1 { margin-bottom: 0; }
.subtitle { margin: 8px 0 0; }
.top-actions { display: flex; gap: 10px; }
.secondary { color: #222; background: white; border: 1px solid #ddd; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.metric-card, .panel {
  min-width: 0;
  border: 1px solid #dfdfdc;
  border-radius: 20px;
  background: white;
  box-shadow: 0 8px 24px rgba(0,0,0,.025);
}
.metric-card { padding: 20px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-top p { margin: 0; color: #777; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.metric-dot { width: 10px; height: 10px; border-radius: 50%; background: #111; }
.metric-dot.green { background: #10b981; }
.metric-dot.purple { background: #7c3aed; }
.metric-dot.blue { background: #2563eb; }
.metric-dot.amber { background: #f59e0b; }
.metric-card strong { display: block; margin-top: 18px; font-size: clamp(27px, 3vw, 42px); letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card small { display: block; margin-top: 5px; color: #888; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 14px;
}
.panel { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.panel-heading > p { margin: 0; color: #999; font-size: 12px; }
.bars { height: 285px; display: grid; grid-template-columns: repeat(7, minmax(48px, 1fr)); align-items: end; gap: 12px; margin-top: 28px; overflow-x: auto; }
.bar-cell { min-width: 48px; display: grid; grid-template-rows: 20px 200px auto auto; gap: 5px; text-align: center; }
.bar-cell span, .bar-cell small { color: #888; font-size: 11px; }
.bar-track { height: 200px; display: flex; align-items: end; border-bottom: 1px solid #ddd; }
.bar { width: 100%; border-radius: 8px 8px 2px 2px; background: linear-gradient(#8b5cf6, #6d28d9); }
.bar-cell strong { font-size: 13px; }
.stat-list, .inventory { margin: 24px 0 0; }
.stat-list div, .inventory div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid #eee; }
dt { color: #777; }
dd { margin: 0; font-weight: 800; }
.worker-list { margin-top: 18px; }
.worker { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #eee; }
.status { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; }
.status.healthy { background: #10b981; }
.worker strong, .worker small { display: block; }
.worker small { margin-top: 3px; color: #888; }
.worker b { color: #777; font-size: 11px; text-transform: uppercase; }
.quality { margin: 18px 0 0; color: #777; font-size: 12px; }
.loading { align-content: center; color: #777; }
.spinner { width: 34px; height: 34px; border: 3px solid #ddd; border-top-color: #111; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

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

@media (max-width: 560px) {
  .dashboard { padding: 24px 14px 40px; }
  .topbar { align-items: start; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions button { flex: 1; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 15px; }
  .metric-card strong { font-size: 25px; }
  .metric-card small { font-size: 10px; }
  .panel { padding: 17px; }
  .auth-card { padding: 28px 22px; }
}
