:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8edf6;
  background: #111827;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(79, 140, 255, 0.25), transparent 35%),
    linear-gradient(135deg, #0b1020, #111827 45%, #0f172a);
}

main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px;
}

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

h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

header p {
  margin: 0;
  color: #9aa7bd;
}

.status-pill {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
}

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

.logout-btn {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: #e8edf6;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: 4px solid var(--accent);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.26);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card h2 { margin: 0; font-size: 1.45rem; }

.iface {
  margin: 4px 0 0;
  color: #9aa7bd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.badge {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #c9d3e6;
  white-space: nowrap;
}

.badge.good { background: rgba(37, 180, 107, 0.18); color: #68e0a2; }
.badge.bad { background: rgba(255, 92, 92, 0.18); color: #ff9d9d; }

.gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.gauge { width: 100%; max-width: 130px; margin: 0 auto; }

.gauge-bg { fill: none; stroke: rgba(255,255,255,0.10); stroke-width: 12; }
.gauge-fg { fill: none; stroke-width: 12; stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 0.35s ease; }
.gauge-value { fill: #ffffff; font-size: 22px; font-weight: 750; }
.gauge-label { fill: #9aa7bd; font-size: 10px; text-transform: uppercase; }

dl { margin: 0 0 16px; display: grid; gap: 8px; }
dl div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
dt { color: #9aa7bd; }
dd { margin: 0; text-align: right; }

.test-btn, .secondary-btn, .log-header button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  color: #07111f;
  background: var(--accent, #4f8cff);
  cursor: pointer;
}

.test-btn:disabled, .secondary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.secondary-btn {
  margin-top: 10px;
  background: rgba(255,255,255,0.12);
  color: #e8edf6;
}

.log-panel {
  margin-top: 22px;
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px;
}

.log-header { display: flex; align-items: center; justify-content: space-between; }
.log-header h2 { margin: 0 0 12px; }
.log-header button { width: auto; background: rgba(255,255,255,0.12); color: #e8edf6; }

pre {
  margin: 0;
  min-height: 180px;
  max-height: 340px;
  overflow: auto;
  padding: 14px;
  background: rgba(0,0,0,0.32);
  border-radius: 12px;
  color: #d7e0ef;
  font-size: 0.92rem;
}

.login-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  max-width: 100%;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 22px 55px rgba(0,0,0,0.36);
}

.login-subtitle {
  color: #9aa7bd;
  margin-top: 0;
  margin-bottom: 22px;
}

.login-card form {
  display: grid;
  gap: 15px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #cbd5e1;
  font-weight: 700;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.26);
  color: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 1rem;
}

.remember-row {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px !important;
  font-weight: 600 !important;
  color: #d8e0ee !important;
}

.remember-row input { width: 18px; height: 18px; }

.login-message { color: #ff9d9d; min-height: 22px; margin: 14px 0 0; }

.login-help {
  margin-top: 18px;
  color: #9aa7bd;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.92rem;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .cards { grid-template-columns: 1fr; }
  header { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; justify-content: space-between; }
}


.card-running {
  box-shadow: 0 0 0 1px var(--accent), 0 18px 55px rgba(0,0,0,0.36);
}

.gauge-active .gauge-fg {
  filter: drop-shadow(0 0 8px var(--accent));
}

.gauge-active {
  animation: gaugePulse 1.1s ease-in-out infinite alternate;
}

@keyframes gaugePulse {
  from { transform: scale(0.985); opacity: 0.82; }
  to { transform: scale(1.025); opacity: 1; }
}

.run-progress {
  margin: 0 0 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 10px;
}

.run-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d8e0ee;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.run-progress-track {
  height: 9px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
}

.run-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
  position: relative;
}

.run-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}


.primary-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(104, 224, 162, 0.18);
  color: #68e0a2;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  font-weight: 900;
}

.primary-btn {
  width: 100%;
  border: 1px solid rgba(104, 224, 162, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  background: rgba(104, 224, 162, 0.12);
  color: #68e0a2;
  margin-top: 10px;
  cursor: default;
}


/* v12 dashboard additions */
.alerts-panel {
  margin-bottom: 18px;
  display: grid;
  gap: 10px;
}

.alert-ok, .alert-bad {
  border-radius: 14px;
  padding: 13px 15px;
  font-weight: 800;
}

.alert-ok {
  color: #68e0a2;
  background: rgba(104, 224, 162, 0.12);
  border: 1px solid rgba(104, 224, 162, 0.24);
}

.alert-bad {
  color: #ffb3b3;
  background: rgba(255, 92, 92, 0.14);
  border: 1px solid rgba(255, 92, 92, 0.28);
}

.ops-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.ops-card, .history-panel {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.22);
}

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

.section-header h2 {
  margin: 0;
}

.section-header button, .ops-buttons button, .download-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.12);
  color: #e8edf6;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.ops-buttons {
  display: grid;
  gap: 10px;
}

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

.status-tile {
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
}

.bad-tile {
  background: rgba(255, 92, 92, 0.10);
  border-color: rgba(255, 92, 92, 0.22);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 7px;
}

.dot.ok { background: #68e0a2; box-shadow: 0 0 10px rgba(104,224,162,0.6); }
.dot.bad { background: #ff7878; box-shadow: 0 0 10px rgba(255,120,120,0.6); }

.status-value {
  margin-top: 8px;
  font-weight: 900;
  color: #fff;
}

.status-sub {
  margin-top: 4px;
  color: #9aa7bd;
  font-size: 0.9rem;
}

.history-panel {
  margin-top: 22px;
}

.history-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: #d7e0ef;
  font-size: 0.92rem;
}

th, td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

th {
  color: #9aa7bd;
  font-weight: 800;
}

.primary-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(104, 224, 162, 0.18);
  color: #68e0a2;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  font-weight: 900;
}

.primary-btn {
  width: 100%;
  border: 1px solid rgba(104, 224, 162, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  background: rgba(104, 224, 162, 0.12);
  color: #68e0a2;
  margin-top: 10px;
  cursor: default;
}

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