/* ========================================
   ELEVRA CLIENT FIT — Design System
   Crno/zlatni premium fitness stil
======================================== */

:root {
  --gold: #d4af37;
  --gold-light: #f0d878;
  --gold-dark: #a8842a;
  --black: #0a0a0a;
  --black-soft: #131313;
  --charcoal: #1c1c1c;
  --charcoal-light: #262626;
  --border: #2e2e2e;
  --text: #f0f0f0;
  --text-dim: #a3a3a3;
  --text-faint: #6b6b6b;
  --success: #4caf6d;
  --danger: #e05353;
  --warn: #e0a953;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-gold: 0 0 0 1px rgba(212,175,55,0.15), 0 8px 24px rgba(0,0,0,0.5);
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--black);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 20% 0%, rgba(212,175,55,0.06), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(212,175,55,0.04), transparent 40%);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Layout helpers ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.logo-text {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.gold-text {
  background: linear-gradient(120deg, var(--gold-light), var(--gold) 60%, var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  color: #1a1400;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger {
  background: rgba(224,83,83,0.12);
  color: var(--danger);
  border-color: rgba(224,83,83,0.3);
}
.btn-danger:hover { background: rgba(224,83,83,0.2); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-hover { transition: var(--transition); }
.card-hover:hover { border-color: rgba(212,175,55,0.4); box-shadow: var(--shadow-gold); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.badge-gold { background: rgba(212,175,55,0.15); color: var(--gold); }
.badge-success { background: rgba(76,175,109,0.15); color: var(--success); }
.badge-danger { background: rgba(224,83,83,0.15); color: var(--danger); }
.badge-warn { background: rgba(224,169,83,0.15); color: var(--warn); }
.badge-neutral { background: var(--charcoal-light); color: var(--text-dim); }

/* ---------- Nav (dashboard) ---------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--black-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
}
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav a,
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-nav a:hover,
.sidebar-nav .nav-item:hover { background: var(--charcoal); color: var(--text); }
.sidebar-nav a.active,
.sidebar-nav .nav-item.active {
  background: rgba(212,175,55,0.12);
  color: var(--gold);
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-faint);
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Mobile nav toggle */
.mobile-topbar { display: none; }
.mobile-nav-toggle {
  background: var(--charcoal);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 18px;
}

/* ---------- Stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card { text-align: left; }
.stat-value { font-size: 28px; font-weight: 800; margin: 6px 0 2px; }
.stat-label { font-size: 13px; color: var(--text-dim); }

/* ---------- Tables / lists ---------- */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--black-soft);
  margin-bottom: 10px;
  transition: var(--transition);
}
.list-row:hover { border-color: rgba(212,175,55,0.35); }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: #1a1400;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-gold);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 20px; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--gold); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
  background: none; border: none; color: var(--text-dim);
  padding: 10px 16px; font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- Progress bar ---------- */
.progress-track {
  width: 100%; height: 8px; border-radius: 100px;
  background: var(--black-soft); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 36px; margin-bottom: 12px; opacity: 0.6; }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.section-title { font-size: 20px; margin-bottom: 4px; }
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--charcoal); border: 1px solid var(--gold);
  color: var(--text); padding: 12px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-gold); font-size: 14px;
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: flex;
    position: fixed;
    z-index: 999;
    width: 78%;
    max-width: 300px;
    box-shadow: 20px 0 40px rgba(0,0,0,0.6);
  }
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--black-soft);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 500;
  }
  .main-content { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .modal { padding: 20px; }
}

.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}
.nav-overlay.open { display: block; }
