/* Shared styles for the portal's sign-in, admin and user bar. Matches index.html. */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fa;
  color: #1e293b;
  line-height: 1.6;
}

a { color: #2563eb; }

/* ---- User bar ----------------------------------------------------------- */
.userbar {
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.9rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 24px;
}
.userbar .who { color: white; font-weight: bold; margin-right: auto; }
.userbar a, .userbar button {
  color: #cbd5e1;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.userbar a:hover, .userbar button:hover { color: white; }

/* ---- Forms -------------------------------------------------------------- */
label { display: block; font-weight: bold; font-size: 0.9rem; margin-bottom: 6px; color: #0f172a; }

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  background: white;
  color: #1e293b;
}
input:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb; }

.field { margin-bottom: 18px; }
.hint { font-size: 0.8rem; color: #64748b; margin-top: 4px; }

.btn {
  display: inline-block;
  background: #2563eb;
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn:hover { background: #1d4ed8; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.secondary { background: #e2e8f0; color: #0f172a; }
.btn.secondary:hover { background: #cbd5e1; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.info { background: #dbeafe; color: #1e3a8a; }
.alert.success { background: #dcfce7; color: #166534; }
[hidden] { display: none !important; }

/* ---- Auth card (login) -------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
.auth-card {
  background: white;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border-top: 5px solid #2563eb;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  padding: 36px 32px;
}
.auth-card h1 { font-size: 1.5rem; color: #0f172a; margin-bottom: 4px; }
.auth-card .sub { color: #475569; margin-bottom: 24px; }
.auth-card .btn { width: 100%; }
.auth-card .foot { margin-top: 22px; font-size: 0.85rem; color: #64748b; text-align: center; }

/* ---- Modal -------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal {
  background: white;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.3);
}
.modal h2 { color: #0f172a; margin-bottom: 18px; font-size: 1.3rem; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---- Admin -------------------------------------------------------------- */
.admin-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 36px 16px 60px; }
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.admin-head h1 {
  font-size: 1.8rem;
  color: #0f172a;
  border-left: 6px solid #2563eb;
  padding-left: 14px;
}
.panel {
  background: white;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
th { background: #f8fafc; color: #475569; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
td .email { font-weight: bold; color: #0f172a; word-break: break-all; }
td .name { color: #64748b; font-size: 0.85rem; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 4px; }

.pill {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
  margin: 2px 4px 2px 0;
}
.pill.admin { background: #0f172a; color: white; }
.pill.off { background: #fee2e2; color: #991b1b; }
.pill.warn { background: #fef3c7; color: #92400e; }
.muted { color: #94a3b8; }

.checks { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: normal; margin: 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #2563eb; }

/* Card access state on the portal home page */
.card.locked { opacity: 0.55; border-top-color: #94a3b8; }
.card.locked:hover { transform: none; }
.card .locked-note { display: inline-block; color: #64748b; font-weight: bold; padding: 12px 0; }

@media (max-width: 640px) {
  .auth-card { padding: 28px 20px; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
