/* ═══════════════════════════════════════════════════════════════════
   GYMPRO — Premium Gym Management UI
   Design: Dark athletic theme with orange/red energy accents
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Barlow+Condensed:wght@600;700;800&display=swap');

:root {
  /* Core palette */
  --bg:          #0a0a0f;
  --bg-2:        #111118;
  --bg-3:        #18181f;
  --bg-4:        #1e1e28;
  --surface:     #242430;
  --surface-2:   #2c2c3a;

  /* Brand */
  --fire:        #ff4d00;
  --fire-2:      #ff6a2a;
  --fire-glow:   rgba(255,77,0,0.18);
  --fire-border: rgba(255,77,0,0.35);

  /* Semantic */
  --green:  #00e5a0;
  --blue:   #4d9fff;
  --yellow: #ffb800;
  --red:    #ff3d5a;
  --purple: #9b6dff;

  /* Text */
  --t1: #f0f0f5;
  --t2: #9898aa;
  --t3: #5a5a6e;

  /* Borders */
  --b1: #2a2a38;
  --b2: #1e1e2a;

  /* Sizing */
  --sidebar: 260px;
  --header:  64px;
  --r:       10px;
  --r-lg:    16px;
  --r-xl:    20px;

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --glow:      0 0 30px rgba(255,77,0,0.15);
  --ease:      cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; scroll-behavior:smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width:4px; height:4px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius:2px; }
::-webkit-scrollbar-thumb:hover { background: var(--fire); }

/* ── Auth ──────────────────────────────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,77,0,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-container::after {
  content: '';
  position: absolute;
  bottom: -200px; left: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(77,159,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-left {
  display: none;
  flex: 1;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a0a00 100%);
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ff4d00' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-left-content { position: relative; z-index: 1; text-align: center; }
.auth-left-content h1 { font-family: 'Barlow Condensed', sans-serif; font-size: 4rem; font-weight: 800; color: var(--fire); letter-spacing: 2px; text-transform: uppercase; line-height: 1; }
.auth-left-content p { color: var(--t2); font-size: 1rem; margin-top: 12px; }

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-3);
  border: 1px solid var(--b1);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  background: var(--fire-glow);
  border: 1px solid var(--fire-border);
  border-radius: 14px;
  margin-bottom: 14px;
}
.auth-logo h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem; font-weight: 800;
  color: var(--t1); letter-spacing: 1px; text-transform: uppercase;
}
.auth-logo h1 span { color: var(--fire); }
.auth-logo p { color: var(--t3); font-size: 0.85rem; margin-top: 4px; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--t3); font-size: 0.78rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--b1);
}

/* ── App Layout ────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  background: var(--bg-2);
  border-right: 1px solid var(--b1);
  display: flex; flex-direction: column;
  position: fixed; top:0; left:0; height:100vh;
  z-index: 300;
  transition: transform 0.3s var(--ease);
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--fire-glow);
  border: 1px solid var(--fire-border);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem; font-weight: 800;
  color: var(--t1); letter-spacing: 1px; text-transform: uppercase;
  line-height: 1;
}
.sidebar-logo-text h2 span { color: var(--fire); }
.sidebar-logo-text p { font-size: 0.65rem; color: var(--t3); margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section-title {
  padding: 12px 20px 4px;
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--t3);
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px;
  color: var(--t2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border-left: 2px solid transparent;
  font-size: 0.875rem; font-weight: 500;
  user-select: none; position: relative;
  margin: 1px 0;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--t1);
  border-left-color: rgba(255,77,0,0.4);
}

.nav-item.active {
  background: var(--fire-glow);
  color: var(--fire);
  border-left-color: var(--fire);
  font-weight: 600;
}

.nav-item.active .nav-icon svg { stroke: var(--fire); }

.nav-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg { width: 17px; height: 17px; stroke: currentColor; transition: stroke 0.2s; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--b1);
  flex-shrink: 0;
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  margin-bottom: 10px;
}

.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--fire), var(--fire-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: white; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255,77,0,0.3);
}

.user-details .name { font-size: 0.82rem; font-weight: 600; color: var(--t1); }
.user-details .role { font-size: 0.65rem; color: var(--t3); text-transform: capitalize; margin-top: 1px; }

/* Sidebar overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 299;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.show { display: block; }

/* ── Main Content ──────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh; min-width: 0;
  background: var(--bg);
}

/* ── Header ────────────────────────────────────────────────────────── */
.header {
  height: var(--header);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  gap: 12px;
}

.header-title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--t1); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.notification-btn {
  position: relative; background: var(--bg-3);
  border: 1px solid var(--b1); color: var(--t2);
  cursor: pointer; padding: 8px; border-radius: 9px;
  transition: all 0.2s; display: flex; align-items: center;
}
.notification-btn:hover { border-color: var(--fire-border); color: var(--fire); background: var(--fire-glow); }
.notification-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--fire); color: white;
  font-size: 0.55rem; width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; border: 2px solid var(--bg);
}

/* ── Page Content ──────────────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}

.page-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem; font-weight: 700;
  color: var(--t1); text-transform: uppercase; letter-spacing: 0.5px;
  line-height: 1;
}
.page-header p { color: var(--t3); font-size: 0.82rem; margin-top: 4px; }

/* ── Stats Grid ────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-3);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.2s var(--ease);
  position: relative; overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-color, var(--fire)), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover { border-color: var(--b2); transform: translateY(-1px); box-shadow: var(--shadow); }

.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }

.stat-icon.red    { background: rgba(255,77,0,0.12);   } .stat-icon.red    svg { stroke: var(--fire); }
.stat-icon.green  { background: rgba(0,229,160,0.12);  } .stat-icon.green  svg { stroke: var(--green); }
.stat-icon.blue   { background: rgba(77,159,255,0.12); } .stat-icon.blue   svg { stroke: var(--blue); }
.stat-icon.orange { background: rgba(255,184,0,0.12);  } .stat-icon.orange svg { stroke: var(--yellow); }
.stat-icon.purple { background: rgba(155,109,255,0.12);} .stat-icon.purple svg { stroke: var(--purple); }

.stat-info .value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--t1); }
.stat-info .label { color: var(--t3); font-size: 0.75rem; margin-top: 3px; font-weight: 500; }
.stat-info .change { font-size: 0.7rem; margin-top: 4px; font-weight: 600; }
.stat-info .change.up   { color: var(--green); }
.stat-info .change.down { color: var(--red); }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-3);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  background: rgba(255,255,255,0.01);
}

.card-header h3 {
  font-size: 0.9rem; font-weight: 700;
  color: var(--t1); text-transform: uppercase; letter-spacing: 0.5px;
}

.card-body { padding: 20px; }

/* ── Grids ─────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* ── Table ─────────────────────────────────────────────────────────── */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 480px; }

thead th {
  padding: 10px 14px; text-align: left;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--t3); border-bottom: 1px solid var(--b1);
  background: rgba(255,255,255,0.015); white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--t2); vertical-align: middle;
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 0.68rem; font-weight: 700;
  text-transform: capitalize; white-space: nowrap; letter-spacing: 0.3px;
}
.badge-success   { background: rgba(0,229,160,0.12);   color: var(--green);  border: 1px solid rgba(0,229,160,0.2); }
.badge-danger    { background: rgba(255,61,90,0.12);   color: var(--red);    border: 1px solid rgba(255,61,90,0.2); }
.badge-warning   { background: rgba(255,184,0,0.12);   color: var(--yellow); border: 1px solid rgba(255,184,0,0.2); }
.badge-info      { background: rgba(77,159,255,0.12);  color: var(--blue);   border: 1px solid rgba(77,159,255,0.2); }
.badge-secondary { background: rgba(152,152,170,0.1);  color: var(--t2);     border: 1px solid rgba(152,152,170,0.15); }
.badge-accent    { background: rgba(255,77,0,0.12);    color: var(--fire);   border: 1px solid rgba(255,77,0,0.2); }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--t2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}

.form-control {
  width: 100%; padding: 10px 13px;
  background: var(--bg-4); border: 1px solid var(--b1);
  border-radius: 8px; color: var(--t1);
  font-size: 0.875rem; transition: all 0.2s; outline: none;
  -webkit-appearance: none; appearance: none; font-family: inherit;
}
.form-control:focus { border-color: var(--fire); box-shadow: 0 0 0 3px rgba(255,77,0,0.1); background: var(--bg-3); }
.form-control::placeholder { color: var(--t3); }
.form-control:hover:not(:focus) { border-color: var(--surface-2); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5a6e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
select.form-control option { background: var(--bg-3); }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }
input[type="range"].form-control { padding: 4px 0; background: none; border: none; cursor: pointer; }
input[type="range"].form-control:focus { box-shadow: none; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 9px;
  font-size: 0.85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: all 0.2s var(--ease);
  text-decoration: none; white-space: nowrap; letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  position: relative; overflow: hidden;
}

.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background 0.15s;
}
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--fire), var(--fire-2));
  color: white;
  box-shadow: 0 4px 14px rgba(255,77,0,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(255,77,0,0.4); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-4); color: var(--t1);
  border: 1px solid var(--b1);
}
.btn-secondary:hover { border-color: var(--fire-border); color: var(--fire); }

.btn-success  { background: var(--green);  color: #0a0a0f; font-weight: 700; }
.btn-danger   { background: var(--red);    color: white; }
.btn-sm       { padding: 6px 12px; font-size: 0.78rem; border-radius: 7px; }
.btn-icon     { padding: 8px; border-radius: 8px; background: var(--bg-4); border: 1px solid var(--b1); color: var(--t2); }
.btn-icon:hover { border-color: var(--fire-border); color: var(--fire); }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000; padding: 0;
  backdrop-filter: blur(6px);
}

.modal {
  background: var(--bg-3); border: 1px solid var(--b1);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%; max-width: 100%; max-height: 94vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: sheetUp 0.28s var(--ease);
}

@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-header {
  padding: 18px 20px; border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-3); z-index: 1;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--t1); }

.modal-body { padding: 20px; }

.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--b1);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  position: sticky; bottom: 0; background: var(--bg-3);
}
.modal-footer .btn { flex: 1; min-width: 100px; }

.close-btn {
  background: var(--bg-4); border: 1px solid var(--b1);
  color: var(--t3); font-size: 1rem; cursor: pointer;
  padding: 6px 10px; border-radius: 7px; transition: all 0.2s;
  line-height: 1; display: flex; align-items: center;
}
.close-btn:hover { color: var(--t1); border-color: var(--b2); }

/* ── Alerts ────────────────────────────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: 9px;
  font-size: 0.84rem; margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 9px; line-height: 1.45;
}
.alert-error   { background: rgba(255,61,90,0.08);  border: 1px solid rgba(255,61,90,0.25);  color: var(--red); }
.alert-success { background: rgba(0,229,160,0.08);  border: 1px solid rgba(0,229,160,0.25);  color: var(--green); }
.alert-warning { background: rgba(255,184,0,0.08);  border: 1px solid rgba(255,184,0,0.25);  color: var(--yellow); }
.alert-info    { background: rgba(77,159,255,0.08); border: 1px solid rgba(77,159,255,0.25); color: var(--blue); }

/* ── Loading ───────────────────────────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--t3); gap: 12px; }
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--b1); border-top-color: var(--fire);
  border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ───────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--t3); }
.empty-state h3 { font-size: 1rem; color: var(--t2); margin-bottom: 6px; font-weight: 600; }
.empty-state p { font-size: 0.84rem; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 32px); max-width: 380px;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--b1);
  border-radius: 11px; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg); animation: sheetUp 0.25s var(--ease);
  font-size: 0.875rem; color: var(--t1);
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

/* ── Notification Panel ────────────────────────────────────────────── */
.notification-panel {
  position: fixed; top: var(--header); right: 0;
  width: 100%; max-width: 340px;
  background: var(--bg-3); border: 1px solid var(--b1);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: var(--shadow-lg); z-index: 200;
  max-height: 70vh; overflow-y: auto;
}
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--b1); cursor: pointer; transition: background 0.15s; }
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { border-left: 2px solid var(--fire); }
.notif-item .title { font-size: 0.84rem; font-weight: 600; color: var(--t1); }
.notif-item .message { font-size: 0.76rem; color: var(--t3); margin-top: 3px; line-height: 1.4; }
.notif-item .time { font-size: 0.68rem; color: var(--t3); margin-top: 4px; }

/* ── Search Bar ────────────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-4); border: 1px solid var(--b1);
  border-radius: 9px; padding: 8px 12px; transition: all 0.2s;
}
.search-bar:focus-within { border-color: var(--fire); box-shadow: 0 0 0 3px rgba(255,77,0,0.08); }
.search-bar svg { flex-shrink: 0; color: var(--t3); }
.search-bar input { background: none; border: none; outline: none; color: var(--t1); font-size: 0.875rem; flex: 1; min-width: 0; font-family: inherit; }
.search-bar input::placeholder { color: var(--t3); }

/* ── Progress Bar ──────────────────────────────────────────────────── */
.progress-bar { height: 5px; background: var(--b1); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--fire), var(--fire-2)); border-radius: 3px; transition: width 0.5s var(--ease); }

/* ── Chart Bars ────────────────────────────────────────────────────── */
.chart-container { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 5px; padding: 0 4px; }
.chart-bar { flex: 1; background: linear-gradient(to top, var(--fire), rgba(255,77,0,0.2)); border-radius: 3px 3px 0 0; transition: opacity 0.2s; position: relative; min-height: 4px; }
.chart-bar:hover { opacity: 0.75; }
.chart-bar .tooltip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--bg-4); border: 1px solid var(--b1); padding: 3px 8px; border-radius: 5px; font-size: 0.68rem; white-space: nowrap; display: none; z-index: 10; color: var(--t1); }
.chart-bar:hover .tooltip { display: block; }
.chart-labels { display: flex; gap: 5px; padding: 6px 4px 0; }
.chart-labels span { flex: 1; text-align: center; font-size: 0.62rem; color: var(--t3); }

/* ── Misc ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.tabs { display: flex; gap: 3px; background: var(--bg-4); padding: 3px; border-radius: 10px; margin-bottom: 20px; overflow-x: auto; border: 1px solid var(--b1); }
.tab-btn { flex: 1; padding: 8px 12px; border: none; background: none; color: var(--t3); font-size: 0.8rem; font-weight: 600; cursor: pointer; border-radius: 8px; transition: all 0.2s; white-space: nowrap; font-family: inherit; }
.tab-btn.active { background: var(--fire); color: white; box-shadow: 0 2px 8px rgba(255,77,0,0.3); }

/* ── Camera ────────────────────────────────────────────────────────── */
.camera-container { position: relative; background: #000; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4/3; max-width: 100%; margin: 0 auto; border: 1px solid var(--b1); }
#webcam { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes pulse { 0%,100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }

/* ── Workout Cards ─────────────────────────────────────────────────── */
.workout-day-card { background: var(--bg-4); border: 1px solid var(--b1); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.workout-day-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.day-badge { background: var(--fire-glow); color: var(--fire); border: 1px solid var(--fire-border); padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: capitalize; letter-spacing: 0.5px; }
.exercise-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.exercise-item:last-child { border-bottom: none; }
.exercise-icon { width: 32px; height: 32px; background: var(--fire-glow); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.exercise-info .name { font-size: 0.84rem; font-weight: 600; color: var(--t1); }
.exercise-info .details { font-size: 0.72rem; color: var(--t3); margin-top: 2px; }

/* ── Plan Cards ────────────────────────────────────────────────────── */
.plan-card { background: var(--bg-4); border: 1px solid var(--b1); border-radius: var(--r-lg); padding: 20px; text-align: center; transition: all 0.2s var(--ease); cursor: pointer; position: relative; }
.plan-card:hover, .plan-card.selected { border-color: var(--fire); box-shadow: 0 0 0 1px var(--fire), var(--glow); }
.plan-price { font-size: 2rem; font-weight: 800; color: var(--fire); font-family: 'Barlow Condensed', sans-serif; }
.plan-features { list-style: none; text-align: left; }
.plan-features li { padding: 4px 0; font-size: 0.82rem; color: var(--t2); display: flex; align-items: center; gap: 7px; }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; }

/* ── Progress / Calendar ───────────────────────────────────────────── */
#attendance-calendar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#attendance-calendar svg { display: block; }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════════════════ */

/* ── < 400px ─────────────────────────────────────────────────────── */
@media (max-width: 399px) {
  .page-content { padding: 12px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 12px; }
  .stat-info .value { font-size: 1.4rem; }
  .auth-card { padding: 22px 16px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
  table { font-size: 0.74rem; }
  thead th, tbody td { padding: 8px 8px; }
  .page-header h2 { font-size: 1.4rem; }
}

/* ── 400–767px ───────────────────────────────────────────────────── */
@media (min-width: 400px) and (max-width: 767px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 14px; }
}

/* ── All mobile < 768px ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); width: min(var(--sidebar), 85vw); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  #sidebar-toggle { display: flex !important; }
  .header { padding: 0 14px; }
  .header-title { font-size: 0.95rem; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > div:last-child { display: flex; flex-direction: column; gap: 8px; }
  .page-header > div:last-child .btn { width: 100%; justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--r-xl) var(--r-xl) 0 0; max-width: 100%; max-height: 95vh; }
  .notification-panel { width: 100%; max-width: 100%; right: 0; left: 0; border-radius: 0; }
  .toast-container { bottom: 12px; }
  .table-container { margin: 0 -14px; padding: 0 14px; }
  .chart-container { height: 150px; }
  .stat-icon { width: 40px; height: 40px; border-radius: 10px; }
  .stat-icon svg { width: 19px; height: 19px; }
  .auth-left { display: none; }
  .auth-right { padding: 20px 16px; }
}

/* ── Tablets 768–1023px ──────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  :root { --sidebar: 220px; }
  .page-content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .modal { max-width: 560px; border-radius: var(--r-xl); }
  .modal-overlay { align-items: center; padding: 20px; }
  @keyframes sheetUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .notification-panel { width: 320px; right: 14px; left: auto; border-radius: var(--r-lg); }
  .toast-container { left: auto; right: 14px; transform: none; width: auto; max-width: 360px; }
  .auth-left { display: flex; }
}

/* ── Desktop >= 1024px ───────────────────────────────────────────── */
@media (min-width: 1024px) {
  .page-content { padding: 28px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .form-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .stat-card { padding: 20px; }
  .stat-icon { width: 48px; height: 48px; }
  .stat-info .value { font-size: 1.8rem; }
  .modal { max-width: 560px; border-radius: var(--r-xl); }
  .modal-overlay { align-items: center; padding: 20px; }
  @keyframes sheetUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .notification-panel { width: 340px; right: 20px; left: auto; border-radius: var(--r-lg); }
  .toast-container { left: auto; right: 24px; transform: none; width: auto; max-width: 380px; bottom: 24px; }
  .card-header { padding: 18px 22px; }
  .card-body { padding: 22px; }
  .stat-card:hover { transform: translateY(-2px); }
  #sidebar-toggle { display: none !important; }
  .auth-left { display: flex; }
}

/* ── Large >= 1440px ─────────────────────────────────────────────── */
@media (min-width: 1440px) {
  :root { --sidebar: 280px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .page-content { padding: 32px; }
}

/* ── Touch devices ───────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .nav-item { min-height: 46px; }
  .form-control { min-height: 44px; font-size: 16px; }
  .close-btn { min-width: 36px; min-height: 36px; }
  .stat-card:hover { transform: none; }
  .btn-primary:hover { box-shadow: 0 4px 14px rgba(255,77,0,0.3); transform: none; }
}

/* ── Landscape phone ─────────────────────────────────────────────── */
@media (max-width: 767px) and (orientation: landscape) {
  .modal { max-height: 88vh; }
  .camera-container { max-height: 48vh; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .auth-container { align-items: flex-start; padding-top: 20px; }
}

/* ── Announcement banner animation ─────────────────────────────────── */
@keyframes slideDown {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
