/* Shared topnav styles — used by all admin pages */
:root {
  --bg: #fff8d7;
  --surface: #ffffff;
  --surface-warm: #ffef9f;
  --fg: #1d1836;
  --fg-2: #4c426c;
  --muted: #796f91;
  --border: #eadfba;
  --border-soft: #f5eccd;
  --accent: #ff6b00;
  --success: #2e9d57;
  --warn: #ffb020;
  --danger: #e5484d;
  --font-body: Inter, system-ui, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --focus-ring: 0 0 0 4px rgba(255, 107, 0, 0.26);
  --motion-fast: 150ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--fg); height: 60px;
  display: flex; align-items: center; padding: 0 24px;
  gap: 16px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark { width: 30px; height: 30px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 11px; color: white; }
.nav-brand { font-size: 14px; font-weight: 800; color: white; }
.nav-tabs { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; }
.nav-tab {
  display: inline-flex; align-items: center;
  padding: 7px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.5);
  background: none; border: none; cursor: pointer;
  transition: all var(--motion-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.nav-tab:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.07); }
.nav-tab.active { color: #ff8c3a; background: rgba(255,107,0,0.16); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.trainer-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 12px; background: rgba(255,255,255,0.08);
  border: none; border-radius: 9999px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85);
  cursor: pointer; font-family: inherit;
}
.trainer-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; color: white;
}
.chip-caret { width: 10px; height: 10px; color: rgba(255,255,255,0.5); margin-left: 2px; }
.chip-dropdown {
  position: absolute; top: 56px; right: 24px; z-index: 60;
  min-width: 260px; background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(29, 24, 54, 0.22);
  padding: 6px; font-size: 13px;
}
.chip-dropdown[hidden] { display: none; }
.dropdown-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-bottom: 1px solid var(--border-soft);
}
.dropdown-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; flex-shrink: 0;
}
.dropdown-name { font-weight: 800; color: var(--fg); font-size: 14px; }
.dropdown-email { color: var(--muted); font-size: 11px; margin-top: 1px; }
.dropdown-item {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: var(--fg); font-weight: 500;
  transition: background var(--motion-fast) var(--ease);
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item:last-child { color: var(--danger); }

/* Page layout */
.page { max-width: 1280px; margin: 0 auto; padding: 32px; }
.page-header { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 28px; font-weight: 900; letter-spacing: -0.025em; }
.page-subtitle { font-size: 14px; color: var(--muted); margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.card-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* Toolbar (search + filters + add button) */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 200px; max-width: 360px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

.filter-pill {
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease);
  font-family: inherit;
}
.filter-pill:hover { border-color: var(--fg-2); }
.filter-pill.active { background: var(--accent); color: white; border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease);
  font-family: inherit;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent), black 8%); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--surface); color: var(--fg-2); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--fg-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); background: color-mix(in oklab, var(--bg), transparent 40%); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: color-mix(in oklab, var(--bg), transparent 30%); }

.data-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  /* Phase 4.42 — Ali 13:18: on narrow screens the table
     scrolls horizontally inside the panel instead of
     overflowing the page. The radius+border stay; we
     use overflow-x: auto so a wide table gets a scrollbar
     inside the panel rather than clipping its rightmost
     columns. */
  overflow-x: auto;
  overflow-y: hidden;
}

.toast {
  position: fixed; top: 80px; right: 24px; z-index: 100;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,0.16);
  animation: slideIn 200ms cubic-bezier(0.2,0,0,1);
}
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 9999px;
  font-size: 11px; font-weight: 700;
}
.badge-active { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #fee2e2; color: #b91c1c; }
.badge-warn { background: color-mix(in oklab, var(--warn), transparent 80%); color: #b45309; }
.badge-info { background: color-mix(in oklab, var(--accent), transparent 90%); color: var(--accent); }
