/* ── Reset & base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0d0d;
  --surface:   #1a1a1a;
  --surface2:  #222222;
  --border:    #2a2a2a;
  --border2:   #333333;
  --amber:     #f59e0b;
  --amber-dim: #b45309;
  --green:     #10b981;
  --blue:      #3b82f6;
  --purple:    #8b5cf6;
  --red:       #ef4444;
  --text:      #f5f5f5;
  --text2:     #9ca3af;
  --text3:     #8b93a1;   /* ≈5.5:1 on --bg; the old #6b7280 was ~4:1, under AA for small text */
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.5);
}

html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ──────────────────────────────────────────── */
.page { max-width: 900px; margin: 0 auto; padding: 0 16px 48px; }
.page-narrow { max-width: 520px; margin: 0 auto; padding: 0 16px 48px; }

/* ── Nav ─────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; position: sticky; top: 0; z-index: 100;
}
.nav-logo { font-weight: 700; font-size: 1rem; color: var(--amber); letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: var(--text2); font-size: .9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card + .card { margin-top: 16px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 9px; font-size: .95rem;
  font-weight: 600; cursor: pointer; border: none; transition: opacity .15s, transform .1s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary  { background: var(--amber); color: #000; }
.btn-ghost    { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { color: var(--text); border-color: var(--text3); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-success  { background: var(--green); color: #fff; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-full     { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 7px; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: .85rem; color: var(--text2); font-weight: 500; }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 8px;
  /* 16px keeps iOS Safari from auto-zooming the page on focus */
  font-size: 16px;
  font-family: inherit;
  transition: border-color .15s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--amber);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 600; letter-spacing: .3px;
}
.badge-upcoming  { background: rgba(59,130,246,.15); color: var(--blue); }
.badge-completed { background: rgba(16,185,129,.15); color: var(--green); }
.badge-cancelled { background: rgba(107,114,128,.15); color: var(--text3); }

/* ── Skill level chip ─────────────────────────────────── */
.skill-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 700;
  border: 1px solid currentColor;
}

/* ── Stats grid ──────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: var(--text2); }

/* ── Table ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: var(--surface2); }
th { padding: 12px 16px; text-align: left; font-size: .78rem; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
td { padding: 12px 16px; border-top: 1px solid var(--border); }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Progress bar ─────────────────────────────────────── */
.progress-bar { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--amber); transition: width .4s; }

/* ── Alert/toast ─────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 9px; font-size: .9rem; margin: 12px 0;
}
.alert-info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-size: .9rem; z-index: 2000;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: calc(100vw - 32px);
  opacity: 1; transition: opacity .3s;
}
.toast-error { border-color: rgba(239,68,68,.5); color: #fca5a5; }
.toast-hide  { opacity: 0; pointer-events: none; }

/* Filter chips (admin drives list) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  padding: 5px 12px; border-radius: 99px; font-size: .8rem; cursor: pointer;
}
.chip.active { background: var(--surface2); color: var(--text); border-color: var(--text3); }
.chip .n { color: var(--text3); margin-left: 4px; }

/* ── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 8px; margin: -8px -8px -8px 0; }
.modal-close:hover { color: var(--text); }

/* ── Misc helpers ─────────────────────────────────────── */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.text-sm   { font-size: .85rem; }
.text-xs   { font-size: .75rem; }
.text-muted { color: var(--text2); }
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.font-bold  { font-weight: 700; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.w-full { width: 100%; }
