* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f766e 100%);
  min-height: 100vh;
  color: #0f172a;
}
.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}
.card-wide {
  max-width: 640px;
}
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.user-tag {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}
.logout-inline {
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
}
.main-nav {
  display: flex;
  gap: 0.25rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
}
.main-nav button {
  flex: 1;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
}
.main-nav button.active {
  background: white;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.user-form {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
.form-row input {
  margin-bottom: 0;
}
.users-list {
  margin-top: 0.5rem;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.users-table th,
.users-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.users-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.cell-actions {
  text-align: right;
  white-space: nowrap;
}
.btn-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
}
.muted {
  color: #94a3b8;
  font-weight: 400;
  font-size: 0.8rem;
}
h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}
.sub {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #334155;
}
input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  font-size: 1rem;
  margin-bottom: 1rem;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
}
.btn-primary {
  width: 100%;
  background: #059669;
  color: white;
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-secondary {
  background: white;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.tabs {
  display: flex;
  gap: 0.25rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}
.tabs button {
  flex: 1;
  background: transparent;
  color: #64748b;
}
.tabs button.active {
  background: white;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-ok {
  background: #d1fae5;
  color: #065f46;
}
.badge-warn {
  background: #fef3c7;
  color: #92400e;
}
.badge-off {
  background: #f1f5f9;
  color: #475569;
}
.err {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.qr {
  display: block;
  max-width: 100%;
  margin: 1rem auto;
  border-radius: 0.5rem;
}
.code {
  text-align: center;
  font-size: 1.75rem;
  letter-spacing: 0.2em;
  font-weight: 700;
  margin: 1rem 0;
  color: #0f766e;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.hidden {
  display: none !important;
}
.logout {
  margin-top: 1rem;
  width: 100%;
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
}
