/*
 * TobyCon — Admin Page (admin.php)
 * Login, registrations table, stats strip.
 * ─────────────────────────────────────────
 */

/* ── Nav: right-side links and logout button ── */

.nav-right {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-right a,
.nav-right button {
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sand-dark);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-right a:hover,
.nav-right button:hover { color: var(--white); }

/* ── Login screen ── */

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem;
}

.login-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 4px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(30, 34, 24, 0.1);
}

.login-card .eyebrow { color: var(--sage); }

.login-card h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.75rem;
}

.login-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.login-card input[type="password"] {
  width: 100%;
  background: var(--sand-light);
  border: 1.5px solid var(--sand-dark);
  border-radius: 3px;
  padding: 0.7rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.login-card input:focus { border-color: var(--sage); background: var(--white); }

.login-error {
  background: #fdf0ef;
  border: 1.5px solid #e8b4b0;
  border-radius: 3px;
  padding: 0.6rem 0.8rem;
  font-size: 0.84rem;
  color: var(--red);
  margin-bottom: 1rem;
}

.btn-login {
  width: 100%;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--sage-dark);
  color: var(--white);
  border: none;
  padding: 0.85rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-login:hover { background: var(--sage); }

/* ── Dashboard layout ── */

.admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-header-left .eyebrow { color: var(--sage); margin-bottom: 0.3rem; }

.admin-header-left h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}

.admin-header-left .meta {
  font-size: 0.83rem;
  color: var(--earth);
  margin-top: 0.35rem;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--sage-dark);
  color: var(--white);
  padding: 0.6rem 1.2rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-download:hover { background: var(--sage); }

/* ── Stats strip ── */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--sand-dark);
  border: 1px solid var(--sand-dark);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  padding: 1.25rem 1.5rem;
}

.stat-card .stat-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--sage-dark);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--earth);
  margin-top: 0.2rem;
}

/* ── Empty state ── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: 4px;
}

.empty-state p { font-size: 0.95rem; color: var(--earth); margin-top: 0.5rem; }

.empty-state h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── Registrations table ── */

.table-wrap {
  background: var(--white);
  border-radius: 4px;
  overflow: auto;
  box-shadow: 0 2px 8px rgba(30, 34, 24, 0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 800px;
}

thead { background: var(--ink); }

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--sand); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--sand-light); }

tbody td {
  padding: 0.7rem 1rem;
  vertical-align: top;
  color: var(--ink-light);
  max-width: 200px;
}

tbody td.td-name { font-weight: 600; color: var(--ink); }

/* ── Sticky first two columns (#  and name) ── */

thead th:nth-child(1),
tbody td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 48px;
  min-width: 48px;
}

thead th:nth-child(2),
tbody td:nth-child(2) {
  position: sticky;
  left: 48px;
  z-index: 2;
  box-shadow: 2px 0 6px -2px rgba(30, 34, 24, 0.15);
}

thead th:nth-child(1),
thead th:nth-child(2) { background: var(--ink); }

tbody td:nth-child(1),
tbody td:nth-child(2) { background: var(--white); }

tbody tr:hover td:nth-child(1),
tbody tr:hover td:nth-child(2) { background: var(--sand-light); }

/* ── Status badges ── */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  white-space: nowrap;
}

.badge-yes     { background: #e8f5e9; color: #2e7d32; }
.badge-no      { background: #fbe9e7; color: #bf360c; }
.badge-maybe   { background: #fff8e1; color: #f57f17; }
.badge-neutral { background: var(--sand); color: var(--earth); }

/* ── Status select dropdown ── */

.status-select {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  border: 1.5px solid transparent;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23666' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  padding-right: 1.4rem;
  transition: all 0.15s;
  width: 110px;
}

.status-select:focus { box-shadow: 0 0 0 2px rgba(74, 100, 72, 0.25); }

/* Color states */
.status-submitted  { background-color: var(--sand);   color: var(--earth);   border-color: var(--sand-dark); }
.status-in-review  { background-color: #fff8e1;        color: #a16207;        border-color: #fbbf24; }
.status-approved   { background-color: #e8f5e9;        color: #2e7d32;        border-color: #a5d6a7; }
.status-paid       { background-color: #1b5e20;        color: #ffffff;        border-color: #1b5e20; }
.status-denied     { background-color: #fbe9e7;        color: #bf360c;        border-color: #ef9a9a; }

/* ── Save toast notification ── */

.status-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 200;
}

.status-toast.visible { opacity: 1; transform: translateY(0); }
.toast-ok  { background: #1b5e20; color: #fff; }
.toast-err { background: #bf360c; color: #fff; }
