:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-alt: #1f2937;
  --card: #ffffff;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #34d399;
  --danger: #f87171;
  --shadow: rgba(15, 23, 42, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #020817 0%, #0f172a 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  font-size: 2rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar {
  padding: 1.5rem 1rem;
  background: rgba(17, 24, 39, 0.9);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sidebar a {
  display: block;
  padding: 0.8rem 1rem;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}

.content {
  padding: 2rem;
}

.hero,
.card {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  box-shadow: 0 15px 35px var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.hero h2 {
  margin: 0;
  font-size: 2rem;
}

.tag {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: var(--primary);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 1.5rem 1.75rem;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.card p,
.card li {
  color: var(--muted);
  line-height: 1.7;
}

.bullet-list,
.numbered-list {
  margin: 0;
  padding-left: 1.2rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.link-grid a {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 8, 23, 0.88);
  z-index: 50;
}

.auth-box {
  width: min(90vw, 420px);
  padding: 2rem;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(2, 6, 23, 0.6);
}

.auth-box h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.auth-box p {
  color: var(--muted);
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

#passwordInput {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 1rem;
}

button {
  cursor: pointer;
  font: inherit;
}

#authForm button,
.logout-btn {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #062b1e;
  border: none;
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  font-weight: 700;
}

.error-message {
  min-height: 1.2rem;
  color: var(--danger);
  margin-top: 0.8rem;
}

.hidden-app {
  opacity: 0;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ───────────────────────────────────────────────────────────────────────────
   Form controls — shared across auth, request-access, and admin
   These are at the TOP LEVEL, not inside a media query.
   ─────────────────────────────────────────────────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  display: block;
  padding: 0.7rem 0.9rem;
  background: rgba(11, 19, 36, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 9px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.55;
}

select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 11px;
  padding-right: 2.2rem;
  cursor: pointer;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  background: rgba(11, 19, 36, 0.95);
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
  opacity: 1;
}

input:disabled,
textarea:disabled,
select:disabled,
input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(11, 19, 36, 0.4);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #e2e8f0;
  -webkit-box-shadow: 0 0 0 1000px rgba(11, 19, 36, 0.95) inset;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: #e2e8f0;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 0;
  accent-color: #3b82f6;
  cursor: pointer;
  vertical-align: middle;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.auth-box input,
.auth-box select,
.auth-box textarea,
.auth-box label {
  margin-top: 0.5rem;
}

.auth-box input:first-of-type,
.auth-box label:first-of-type {
  margin-top: 0;
}

#reqForm input,
#reqForm select,
#reqForm textarea,
#reqForm label {
  margin-top: 0.6rem;
}
/* Bare <input> with no type attribute defaults to text — match it too */
input:not([type]),
input[type=""],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="color"],
select,
textarea {
  width: 100%;
  display: block;
  padding: 0.72rem 0.9rem;
  background: rgba(11, 19, 36, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* ───────────────────────────────────────────────────────────────────────────
   Media queries
   ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 1rem 1rem 1.2rem;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}