/* ── TK PYRO Admin Panel ── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Poppins:wght@400;500;600&display=swap');

:root {
  --pyro-orange:   #FF6B35;
  --flame-gold:    #FFB703;
  --midnight-navy: #0F172A;
  --navy-900:      #080E1A;
  --navy-800:      #1E293B;
  --navy-700:      #334155;
  --navy-600:      #475569;
  --navy-400:      #94A3B8;
  --soft-cream:    #FFF8EE;
  --electric-coral:#FF4D6D;
  --success:       #34D399;
  --warning:       #FBBF24;
  --danger:        #F87171;

  --sidebar-w: 240px;
  --topbar-h:  56px;
  --radius-sm: 8px;
  --radius-md: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--midnight-navy);
  color: var(--soft-cream);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

/* ── Layout ── */
.admin-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--navy-900);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transform: translateX(-100%); transition: transform .25s ease;
}
.sidebar.open { transform: translateX(0); }

.sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: .7rem;
}
.sidebar-brand img { height: 32px; }
.sidebar-brand-text {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: .95rem; letter-spacing: .06em;
  background: linear-gradient(to right, #FF5E2C, #FFD166);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-brand-sub { font-size: .65rem; color: var(--navy-400); letter-spacing: .08em; }

.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.nav-section-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .12em;
  color: var(--navy-600); text-transform: uppercase;
  padding: .75rem 1rem .25rem;
}
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem 1rem; margin: .1rem .5rem;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  color: var(--navy-400); cursor: pointer;
  transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--soft-cream); }
.nav-item.active {
  background: rgba(255,107,53,.15);
  color: var(--pyro-orange); font-weight: 600;
}
.nav-item .icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: .8rem; color: var(--navy-400);
}
.sidebar-footer strong { color: var(--soft-cream); display: block; font-size: .85rem; margin-bottom: .15rem; }
.sidebar-footer .logout-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--electric-coral); font-size: .78rem; cursor: pointer;
  margin-top: .35rem; background: none; border: none; padding: 0;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: .75rem; }
.hamburger {
  background: none; border: none; cursor: pointer;
  color: var(--soft-cream); font-size: 1.25rem; padding: .25rem;
}
.topbar-title { font-weight: 700; font-size: 1rem; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }

/* ── Main content ── */
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-content { padding: 1.25rem 1rem; flex: 1; }

/* ── Cards / Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--navy-800);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.stat-label { font-size: .72rem; color: var(--navy-400); font-weight: 600; letter-spacing: .04em; margin-bottom: .35rem; }
.stat-value {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.75rem; line-height: 1;
}
.stat-sub { font-size: .72rem; color: var(--navy-400); margin-top: .25rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,.07); }
table {
  width: 100%; border-collapse: collapse;
  font-size: .82rem;
}
thead { background: rgba(255,255,255,.04); }
th {
  padding: .7rem .9rem; text-align: left;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--navy-400);
  white-space: nowrap;
}
td {
  padding: .7rem .9rem; border-top: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
}
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Page header ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem;
}
.page-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.2rem;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1rem;
}
.filter-bar select, .filter-bar input {
  padding: .45rem .75rem;
  background: var(--navy-800); border: 1px solid rgba(255,255,255,.1);
  color: var(--soft-cream); border-radius: var(--radius-sm); font-size: .82rem;
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--pyro-orange); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: .18rem .6rem; border-radius: 99px;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.badge-pending  { background: rgba(251,191,36,.12); color: #FBBF24; }
.badge-approved { background: rgba(52,211,153,.12); color: #34D399; }
.badge-rejected { background: rgba(248,113,113,.12); color: var(--danger); }
.badge-thai          { background: rgba(255,183,3,.12);  color: var(--flame-gold); }
.badge-international { background: rgba(255,107,53,.12); color: var(--pyro-orange); }
.badge-athletics     { background: rgba(255,77,109,.1);  color: var(--electric-coral); }
.badge-activity      { background: rgba(148,163,184,.12);color: var(--navy-400); }
.badge-on  { background: rgba(52,211,153,.12); color: #34D399; }
.badge-off { background: rgba(148,163,184,.1);  color: var(--navy-600); }

/* ── Toggle switch ── */
.toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 99px;
  background: var(--navy-700); cursor: pointer; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--soft-cream); top: 3px; left: 3px;
  transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--pyro-orange); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s;
}
.btn-primary  { background: var(--pyro-orange); color: var(--midnight-navy); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger   { background: rgba(248,113,113,.15); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.25); }
.btn-success  { background: rgba(52,211,153,.15); color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.btn-outline  { background: transparent; border: 1px solid rgba(255,255,255,.15); color: var(--soft-cream); }
.btn-outline:hover { background: rgba(255,255,255,.05); }
.btn-sm { padding: .3rem .7rem; font-size: .75rem; }
.btn-icon { padding: .35rem .5rem; }

/* ── Form ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .3rem; color: var(--navy-400); }
.form-control {
  width: 100%; padding: .6rem .85rem;
  background: var(--midnight-navy); border: 1.5px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm); color: var(--soft-cream); font-size: .875rem;
}
.form-control:focus { outline: none; border-color: var(--pyro-orange); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-text { font-size: .75rem; color: var(--navy-400); margin-top: .25rem; }
.form-check { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .875rem; }
.form-check input { accent-color: var(--pyro-orange); width: 15px; height: 15px; }

/* ── Modal ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(8,14,26,.85); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--navy-800);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; padding: 1.5rem;
  animation: fadeScale .2s ease;
}
@keyframes fadeScale { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--navy-400); cursor: pointer; font-size: 1.25rem; line-height: 1; }

/* ── Alert ── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .82rem; margin-bottom: 1rem; }
.alert-success { background: rgba(52,211,153,.1);  border: 1px solid rgba(52,211,153,.25); color: var(--success); }
.alert-error   { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25); color: var(--danger); }
.alert-info    { background: rgba(255,183,3,.08);  border: 1px solid rgba(255,183,3,.2);   color: var(--flame-gold); }

/* ── Pagination ── */
.pagination { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: 1rem; }
.page-btn {
  padding: .35rem .65rem; border-radius: var(--radius-sm);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  background: var(--navy-800); border: 1px solid rgba(255,255,255,.08);
  color: var(--navy-400);
}
.page-btn.active { background: var(--pyro-orange); border-color: var(--pyro-orange); color: var(--midnight-navy); }
.page-btn:hover:not(.active) { background: rgba(255,255,255,.05); color: var(--soft-cream); }

/* ── Login page ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(255,94,44,.2) 0%, transparent 60%),
              var(--midnight-navy);
  padding: 1rem;
}
.login-card {
  background: var(--navy-800);
  border: 1px solid rgba(255,107,53,.2);
  border-radius: 20px; padding: 2rem 1.5rem;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.login-logo { height: 48px; margin: 0 auto 1rem; }
.login-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.2rem; text-align: center; margin-bottom: .25rem; }
.login-sub { text-align: center; color: var(--navy-400); font-size: .82rem; margin-bottom: 1.75rem; }

/* ── Tablet/Desktop ── */
@media (min-width: 768px) {
  .sidebar { transform: translateX(0); position: sticky; top: 0; height: 100vh; }
  .hamburger { display: none; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .admin-content { padding: 1.5rem 2rem; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 45;
  background: rgba(0,0,0,.5);
}
.sidebar-overlay.open { display: block; }
@media (min-width: 768px) { .sidebar-overlay { display: none !important; } }
