:root {
  --bg: #c7cfd8;
  --text: #0b2a5c;
  --primary: #1a2438;
  --primary-strong: #0f1728;
  --success: #0fa958;
  --warning: #f59e0b;
  --danger: #e11d48;
  --info: #06b6d4;
  --card: #f6f8fc;
  --border: #c2d0e6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #d0d6de 0%, #bec9d4 100%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 2px solid #2d4669;
  background: linear-gradient(90deg, #18253b, #2f5d8a);
  color: #fff;
}

.actions { display: flex; gap: 10px; }
.container { max-width: 920px; margin: 20px auto; padding: 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

form { display: grid; gap: 12px; }
label span { display: block; font-weight: 700; margin-bottom: 6px; }

input, select {
  width: 100%;
  border: 1px solid #a9c2f5;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
}
fieldset {
  border: 1px solid #b7cae8;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: #fafdff;
}
legend {
  font-weight: 700;
  color: #2b4c78;
  padding: 0 4px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-strong); }
.btn.secondary { background: #dbe9ff; color: var(--text); }
.pulse {
  animation: pulse 1.25s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 36, 56, 0.55); transform: scale(1); }
  70% { box-shadow: 0 0 0 14px rgba(26, 36, 56, 0); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(26, 36, 56, 0); transform: scale(1); }
}

.status { min-height: 22px; font-weight: 700; }
.status.ok { color: var(--success); }
.status.warn { color: var(--warning); }
.status.err { color: var(--danger); }

.hidden { display: none; }

.login-shell { margin-bottom: 20px; }
.brand-badge {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #eedc9a, #9a7b2f);
  color: #1f2f4e;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #cab06c;
}

.login-card { max-width: 460px; margin: 0 auto; }
.hint { font-size: 0.9rem; color: #415a83; margin-top: 10px; }
.install-cta { margin-bottom: 10px; }
.qr-box {
  margin-top: 10px;
  border: 1px dashed #c1d2eb;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}
.qr-box h3 { margin: 0 0 6px 0; font-size: 1rem; }
.qr-box p { margin: 0 0 8px 0; color: #3a5682; }
.qr-box img {
  width: 170px;
  height: 170px;
  border: 1px solid #d5e2f4;
  border-radius: 8px;
  background: #fff;
}
details {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #c9d7ec;
}
summary {
  cursor: pointer;
  font-weight: 700;
  color: #274672;
  margin-bottom: 8px;
}

.list {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.list-item { padding: 6px 0; border-bottom: 1px dashed #d8e2f2; }
.list-item:last-child { border-bottom: 0; }
.item-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
}
.action-btn {
  border: 1px solid #c6d6ef;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
}
.action-btn:hover {
  background: #edf4ff;
}
.perm-on { color: #0c8a4a; font-weight: 700; }
.perm-off { color: #b42318; font-weight: 700; }
.overdue-critical {
  border-left: 5px solid #b42318;
  background: #fff1f1;
}
.overdue-warning {
  border-left: 5px solid #d97706;
  background: #fff8eb;
}
.overdue-ok {
  border-left: 5px solid #15803d;
  background: #eefcf2;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
}
.kpi strong { font-size: 1.4rem; color: #1f365f; }
.kpi span { color: #35517f; font-size: 0.92rem; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 20, 38, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  width: min(640px, 100%);
  background: #f9fbff;
  border-radius: 12px;
  border: 1px solid #cfdbee;
  padding: 16px;
}

.footer-dev {
  text-align: center;
  padding: 14px 8px 22px 8px;
  color: #1b2f52;
  font-weight: 700;
  letter-spacing: 0.2px;
}

@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .container { margin-top: 12px; }
}
