/* ============================================================
   GymBuk — Design System CSS
   ============================================================ */

:root {
  --bg:          #f4f4f8;
  --bg-2:        #ffffff;
  --bg-3:        #ebebf2;
  --border:      rgba(0,0,0,0.09);
  --text:        #1a1a2e;
  --text-muted:  #5a5a7a;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --bottom-nav-h:64px;
  color-scheme:  light;

  --accent-blue:   #6366f1;
  --accent-green:  #10b981;
  --accent-orange: #f59e0b;
  --accent-red:    #ef4444;
  --accent-purple: #8b5cf6;
  --accent-teal:   #14b8a6;

  --radius:   12px;
  --radius-sm: 8px;
  --shadow:   0 4px 24px rgba(0,0,0,0.08);
  --shadow-sm:0 2px 8px  rgba(0,0,0,0.05);

  --danger:   #ef4444;
  --success:  #10b981;
  --warning:  #f59e0b;
  --info:     #6366f1;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent-blue); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 99px; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar-brand {
  display: flex; align-items: center; gap: .85rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff; flex-shrink: 0;
}
.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  display: block;
}
.brand-role {
  font-size: .7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
  display: block;
}

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: .75rem .75rem;
  scrollbar-width: thin;
}

.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .875rem; font-weight: 500;
  cursor: pointer; transition: all .2s;
  margin-bottom: 2px; position: relative;
}
.nav-item i:first-child { font-size: 1.1rem; flex-shrink: 0; }
.nav-item span { flex: 1; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(139,92,246,.15));
  color: var(--accent-blue);
  border-left: 3px solid var(--accent-blue);
}
.nav-badge {
  background: var(--accent-red); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 2px 6px; border-radius: 99px;
}
.nav-arrow { font-size: .75rem; margin-left: auto; color: var(--text-muted); }
.nav-children { padding-left: 1.5rem; }
.nav-child {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .85rem; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .82rem;
  transition: all .2s; margin-bottom: 1px;
}
.nav-child:hover { background: var(--bg-3); color: var(--text); }
.nav-child.active { color: var(--accent-blue); background: rgba(99,102,241,.1); }

.sidebar-footer {
  padding: 1rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem; flex-shrink: 0;
}
.user-card { flex: 1; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #fff;
}
.user-info { min-width: 0; }
.user-name { display: block; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { display: block; font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
  color: var(--text-muted); font-size: 1.15rem; padding: .35rem;
  border-radius: var(--radius-sm); transition: all .2s; flex-shrink: 0;
}
.logout-btn:hover { color: var(--accent-red); background: rgba(239,68,68,.1); }

/* ── SIDEBAR OVERLAY (mobile) ─────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── MAIN WRAPPER ─────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.hamburger {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.4rem; cursor: pointer; padding: .35rem; border-radius: var(--radius-sm);
  transition: background .2s;
}
.hamburger:hover { background: var(--bg-3); }
.page-title {
  font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700;
  flex: 1;
}
.topbar-actions { display: flex; gap: .5rem; }
.topbar-btn {
  position: relative; color: var(--text-muted); font-size: 1.1rem;
  padding: .4rem; border-radius: var(--radius-sm);
  transition: all .2s;
}
.topbar-btn:hover { background: var(--bg-3); color: var(--text); }
.badge-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-red); border: 2px solid var(--bg-2);
}

/* ── CONTENT ──────────────────────────────────────────────── */
.content {
  flex: 1; padding: 1.5rem;
  padding-bottom: calc(var(--bottom-nav-h) + 1.5rem);
}

/* ── FLASH ────────────────────────────────────────────────── */
.flash {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.25rem; margin: 0 1.5rem .5rem;
  border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
  position: relative;
}
.flash-success { background: rgba(16,185,129,.12); color: #047857; border: 1px solid rgba(16,185,129,.3); }
.flash-error   { background: rgba(239,68,68,.12);  color: #b91c1c; border: 1px solid rgba(239,68,68,.3); }
.flash-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: inherit; opacity: .6; font-size: 1rem; padding: 0;
}
.flash-close:hover { opacity: 1; }

/* ── BOTTOM NAV (mobile) ──────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  z-index: 150;
  padding: 0 .5rem;
  justify-content: space-around; align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-muted); font-size: .7rem; font-weight: 500;
  padding: .4rem .75rem; border-radius: var(--radius-sm);
  transition: all .2s; flex: 1; text-align: center;
}
.bottom-nav-item i { font-size: 1.25rem; }
.bottom-nav-item.active { color: var(--accent-blue); }
.bottom-nav-item:hover { color: var(--text); }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: 'Syne', sans-serif; font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; gap: .5rem;
  margin: 0;
}
.card-body { padding: 1.25rem; }
.card-body.p-0 { padding: 0; }

/* ── STAT CARDS ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; align-items: flex-start; gap: 1rem;
  position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  opacity: .07; border-radius: inherit;
}
.stat-blue::before   { background: var(--accent-blue); }
.stat-green::before  { background: var(--accent-green); }
.stat-orange::before { background: var(--accent-orange); }
.stat-red::before    { background: var(--accent-red); }
.stat-purple::before { background: var(--accent-purple); }
.stat-teal::before   { background: var(--accent-teal); }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-blue   .stat-icon { background: rgba(99,102,241,.2);  color: var(--accent-blue); }
.stat-green  .stat-icon { background: rgba(16,185,129,.2);  color: var(--accent-green); }
.stat-orange .stat-icon { background: rgba(245,158,11,.2);  color: var(--accent-orange); }
.stat-red    .stat-icon { background: rgba(239,68,68,.2);   color: var(--accent-red); }
.stat-purple .stat-icon { background: rgba(139,92,246,.2);  color: var(--accent-purple); }
.stat-teal   .stat-icon { background: rgba(20,184,166,.2);  color: var(--accent-teal); }

.stat-value {
  font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 700;
  line-height: 1.1;
}
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* ── DASHBOARD GRID ───────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ── QUICK ACTIONS ────────────────────────────────────────── */
.quick-actions {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.5rem;
}
.quick-action-btn {
  display: flex; align-items: center; gap: .6rem;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); padding: .75rem 1.25rem;
  border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600;
  transition: all .2s; cursor: pointer;
}
.quick-action-btn:hover {
  background: var(--accent-blue); border-color: var(--accent-blue);
  color: #fff; transform: translateY(-1px);
}
.quick-action-btn i { font-size: 1.1rem; }

/* ── TABLES ───────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  padding: .75rem 1rem; text-align: left;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--bg-3); }
.table-sm th, .table-sm td { padding: .55rem .85rem; }
.member-cell { display: flex; align-items: center; gap: .65rem; }
.table-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.table-avatar-placeholder {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: #fff;
}
.actions-cell { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .25em .65em; border-radius: 99px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.badge-success  { background: rgba(16,185,129,.12);  color: #059669; }
.badge-danger   { background: rgba(239,68,68,.12);   color: #dc2626; }
.badge-warning  { background: rgba(245,158,11,.15);  color: #b45309; }
.badge-info     { background: rgba(99,102,241,.12);  color: #4f46e5; }
.badge-primary  { background: rgba(99,102,241,.12);  color: #4f46e5; }
.badge-secondary{ background: rgba(0,0,0,.06);       color: var(--text-muted); }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all .2s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary  { background: var(--accent-blue);  color: #fff; border-color: var(--accent-blue); }
.btn-success  { background: var(--accent-green); color: #fff; border-color: var(--accent-green); }
.btn-danger   { background: var(--accent-red);   color: #fff; border-color: var(--accent-red); }
.btn-outline  { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-3); border-color: rgba(255,255,255,.15); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger:hover  { filter: brightness(1.1); }
.btn-sm  { padding: .35rem .75rem; font-size: .8rem; }
.btn-xs  { padding: .2rem .55rem;  font-size: .75rem; }
.btn-full{ width: 100%; justify-content: center; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-sections { display: flex; flex-direction: column; gap: 1.5rem; }
.form-section {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.form-section-title {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .9rem;
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .5rem; justify-content: space-between;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.col-span-2 { grid-column: span 2; }
.form-label {
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}
.form-label.required::after { content: ' *'; color: var(--accent-red); }
.form-input {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  padding: .6rem .85rem; font-size: .875rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-input:focus {
  outline: none; border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
.form-select {
  background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%235a5a7a' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right .75rem center / 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: .6rem 2rem .6rem .85rem;
  font-size: .875rem; font-family: inherit;
  appearance: none; -webkit-appearance: none; width: 100%;
  transition: border-color .2s;
}
.form-select:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.form-hint { font-size: .75rem; color: var(--text-muted); }
.form-actions {
  display: flex; justify-content: flex-end; gap: .75rem;
  padding-top: .5rem;
}
.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem; pointer-events: none;
}
.input-icon-wrap .form-input { padding-left: 2.25rem; }
.input-eye {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 0; font-size: .9rem;
}

/* ── TOGGLE ───────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--bg-3);
  border-radius: 99px; cursor: pointer; transition: .3s;
  border: 1px solid var(--border);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 2px; bottom: 2px;
  background: var(--text-muted); border-radius: 50%; transition: .3s;
}
.toggle input:checked + .toggle-slider { background: var(--accent-blue); border-color: var(--accent-blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ── CHECKBOXES ───────────────────────────────────────────── */
.checkbox-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.checkbox-label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; cursor: pointer; padding: .35rem .65rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all .2s;
}
.checkbox-label:hover { border-color: var(--accent-blue); }
.checkbox-label input[type="checkbox"] { accent-color: var(--accent-blue); }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: 1rem;
}
.alert-danger { background: rgba(239,68,68,.10); color: #b91c1c; border: 1px solid rgba(239,68,68,.25); }
.mt-3 { margin-top: .75rem; }

/* ── PAGE ACTIONS ─────────────────────────────────────────── */
.page-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem;
}
.search-form { display: flex; gap: .5rem; flex: 1; min-width: 0; max-width: 480px; }
.search-form .form-input { flex: 1; }

/* ── CARD GRID ────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.info-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.info-card-header {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.info-card-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; flex-shrink: 0;
}
.info-card-body { padding: 1rem 1.25rem; color: var(--text-muted); font-size: .875rem; line-height: 1.5; }
.info-card-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--border); }

/* ── MEMBER PROFILE ───────────────────────────────────────── */
.member-profile-header {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.member-photo-large {
  width: 120px; flex-shrink: 0;
}
.member-photo-large img {
  width: 120px; height: 120px; border-radius: 12px;
  object-fit: cover; border: 3px solid var(--border);
}
.photo-timestamp { display: block; font-size: .65rem; color: var(--text-muted); margin-top: .3rem; }
.member-header-info { flex: 1; min-width: 0; }
.member-header-info h2 { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 800; margin-bottom: .25rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.member-code-large { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.member-meta-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.member-meta-chips span {
  display: flex; align-items: center; gap: .35rem;
  font-size: .8rem; color: var(--text-muted);
  background: var(--bg-3); padding: .25rem .6rem; border-radius: 99px;
}
.header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.avatar-xl {
  width: 80px; height: 80px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; color: #fff;
}
.avatar-xxl {
  width: 120px; height: 120px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 3rem; font-weight: 800; color: #fff;
}

/* ── DETAIL GRID ──────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.detail-list { display: flex; flex-direction: column; gap: .6rem; }
.detail-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; font-size: .875rem; }
.detail-label { color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0; }

/* ── MEAL LIST ────────────────────────────────────────────── */
.meal-list { display: flex; flex-direction: column; }
.meal-item {
  display: flex; gap: 1rem; padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.meal-item:last-child { border-bottom: none; }
.meal-timing {
  min-width: 130px; font-weight: 700; font-size: .82rem;
  color: var(--accent-blue); flex-shrink: 0;
}
.meal-items { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }

/* ── MEAL TIMELINE (member view) ──────────────────────────── */
.meal-timeline { display: flex; flex-direction: column; gap: 1rem; }
.meal-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.meal-card-number {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; color: #fff;
}
.meal-card-title { font-weight: 700; font-size: .9rem; margin-bottom: .25rem; color: var(--accent-blue); }
.meal-card-items { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

/* ── PROGRESS NOTES ───────────────────────────────────────── */
.note-item {
  background: var(--bg-3); border-radius: var(--radius-sm);
  padding: .85rem 1rem; margin-bottom: .75rem;
  border-left: 3px solid var(--accent-purple);
}
.note-meta { font-size: .75rem; color: var(--text-muted); margin-bottom: .35rem; }
.note-item p { font-size: .875rem; line-height: 1.6; }

/* ── PHOTO CAPTURE ────────────────────────────────────────── */
.photo-capture-area { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.camera-preview {
  width: 240px; height: 200px; background: var(--bg-3);
  border: 2px dashed var(--border); border-radius: var(--radius);
  overflow: hidden; position: relative; flex-shrink: 0;
}
.camera-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: .5rem; color: var(--text-muted); font-size: .8rem;
}
.camera-placeholder i { font-size: 2.5rem; }
.camera-controls { display: flex; flex-direction: column; gap: .75rem; }

/* ── NOTIFICATIONS ────────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.notif-item:hover { background: var(--bg-3); }
.notif-item.unread { background: rgba(99,102,241,.05); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.notif-info .notif-icon  { background: rgba(99,102,241,.15);  color: var(--accent-blue); }
.notif-success .notif-icon { background: rgba(16,185,129,.15); color: var(--accent-green); }
.notif-warning .notif-icon { background: rgba(245,158,11,.15); color: var(--accent-orange); }
.notif-danger .notif-icon  { background: rgba(239,68,68,.15);  color: var(--accent-red); }
.notif-body strong { font-size: .9rem; display: block; margin-bottom: .2rem; }
.notif-body p { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

/* ── MEMBER HERO (member dashboard) ───────────────────────── */
.member-hero {
  display: flex; gap: 1.25rem; align-items: center;
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.1));
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.member-hero-photo img { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; }
.member-hero-info h2 { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; }
.member-code { font-size: .8rem; color: var(--text-muted); margin-bottom: .35rem; }

/* ── AUTH ─────────────────────────────────────────────────── */
.auth-body {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.auth-container { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
}
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-logo {
  width: 60px; height: 60px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: #fff; margin: 0 auto 1rem;
}
.auth-title {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.75rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-subtitle { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-hint { margin-top: 1rem; padding: .75rem; background: var(--bg-3); border-radius: var(--radius-sm); font-size: .78rem; color: var(--text-muted); text-align: center; }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1rem; gap: .75rem; text-align: center; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; opacity: .4; }
.empty-state h3 { font-family: 'Syne', sans-serif; font-size: 1.1rem; color: var(--text); }
.empty-state p { font-size: .875rem; max-width: 280px; }

/* ── MISC UTILS ───────────────────────────────────────────── */
.text-muted  { color: var(--text-muted) !important; }
.text-red    { color: var(--accent-red); }
.text-orange { color: var(--accent-orange); }
.d-flex      { display: flex; }
.justify-between { justify-content: space-between; }
code {
  background: var(--bg-3); border: 1px solid var(--border);
  padding: .15em .4em; border-radius: 4px;
  font-size: .8em; font-family: monospace;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .hamburger { display: flex; }
  .bottom-nav { display: flex; }
  .content { padding: 1rem; padding-bottom: calc(var(--bottom-nav-h) + 1rem); }
  .flash { margin: 0 1rem .5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .member-profile-header { flex-direction: column; }
  .member-photo-large { width: 100%; text-align: center; }
  .member-photo-large img { margin: 0 auto; }
  .avatar-xxl { margin: 0 auto; }
  .photo-capture-area { flex-direction: column; }
  .camera-preview { width: 100%; }
  .page-actions { flex-direction: column; align-items: stretch; }
  .search-form { max-width: 100%; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .quick-actions { gap: .5rem; }
  .quick-action-btn { flex: 1; min-width: calc(50% - .25rem); justify-content: center; }
  .meal-item { flex-direction: column; gap: .25rem; }
  .meal-timing { min-width: unset; }
  .member-hero { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.2rem; }
  .auth-card { padding: 1.5rem; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ── PWA INSTALL BANNER ───────────────────────────────────── */
#pwa-banner {
  display: none;
  position: fixed; bottom: calc(var(--bottom-nav-h) + .75rem); left: 1rem; right: 1rem;
  background: var(--bg-2); border: 1px solid rgba(99,102,241,.4);
  border-radius: var(--radius); padding: .85rem 1.25rem;
  z-index: 300; box-shadow: var(--shadow);
  align-items: center; gap: .75rem;
}
#pwa-banner.show { display: flex; }
#pwa-banner p { flex: 1; font-size: .82rem; }
#pwa-banner strong { color: var(--accent-blue); }
