/* app.css — Ninger Fitness CRM styles. Reuses theme.css tokens. */

.app-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }

/* ── App Nav ──────────────────────────────────────────────────────────────── */
.app-nav {
  background: var(--accent);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  margin-right: 32px;
  white-space: nowrap;
}
.app-nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  flex: 1;
}
.app-nav-links a {
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.app-nav-links a:hover { color: #fff; }
.app-nav-links a.active {
  color: #fff;
  border-bottom-color: var(--accent-2);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app-main { flex: 1; padding: 40px 32px; max-width: 1200px; margin: 0 auto; width: 100%; }
.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.app-header h1 { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 500; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--fg); letter-spacing: 0.02em; }

/* ── Metric Cards ─────────────────────────────────────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.metric-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-muted); margin-bottom: 8px; }
.metric-value { font-family: 'Playfair Display', serif; font-size: 36px; font-weight: 500; color: var(--fg); line-height: 1; }
.metric-sub { font-size: 12px; color: var(--fg-muted); margin-top: 6px; }
.metric-card.alert .metric-value { color: #C0392B; }
.metric-card.success .metric-value { color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  text-decoration: none;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg-alt); color: var(--fg); border: 1px solid var(--border); }
.btn-danger { background: #C0392B; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table .actions { display: flex; gap: 6px; }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-active    { background: rgba(26,61,46,0.12); color: var(--accent); }
.status-paused    { background: rgba(232,168,56,0.15); color: #B07000; }
.status-churned   { background: rgba(90,90,88,0.12); color: var(--fg-muted); }
.status-scheduled { background: rgba(26,61,46,0.12); color: var(--accent); }
.status-completed { background: rgba(26,61,46,0.12); color: var(--accent); }
.status-no_show   { background: rgba(192,57,43,0.12); color: #C0392B; }
.status-cancelled { background: rgba(90,90,88,0.12); color: var(--fg-muted); }
.status-draft     { background: var(--bg-alt); color: var(--fg-muted); border: 1px solid var(--border); }
.status-sent      { background: rgba(232,168,56,0.15); color: #B07000; }
.status-paid      { background: rgba(26,61,46,0.12); color: var(--accent); }
.status-overdue   { background: rgba(192,57,43,0.12); color: #C0392B; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .form-row-2, .form-row-3 { grid-template-columns: 1fr; } }
label { display: block; font-size: 12px; font-weight: 500; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--fg);
  background: var(--surface);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--fg-muted); margin-top: 4px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal { background: var(--surface); border-radius: var(--radius); padding: 32px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 500; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--fg-muted); padding: 0; line-height: 1; }
.modal-close:hover { color: var(--fg); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Quick add buttons ─────────────────────────────────────────────────────── */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--fg-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.tab:hover { color: var(--fg); }

/* ── Section headers ─────────────────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--fg); }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--fg-muted); }
.empty-state p { font-size: 14px; margin-top: 8px; }
.empty-state strong { display: block; font-size: 16px; color: var(--fg); margin-bottom: 4px; }

/* ── Filters ─────────────────────────────────────────────────────────────── */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter-select { padding: 7px 12px; font-size: 13px; width: auto; }

/* ── Inline form ─────────────────────────────────────────────────────────── */
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form .form-group { flex: 1; min-width: 140px; }
.inline-form label { font-size: 11px; }

/* ── Session calendar ────────────────────────────────────────────────────── */
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px;
  transition: border-color 0.15s;
}
.session-item:hover { border-color: var(--accent); }
.session-datetime { min-width: 140px; }
.session-date { font-size: 12px; font-weight: 500; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.session-time { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 500; }
.session-info { flex: 1; }
.session-client { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.session-type { font-size: 12px; color: var(--fg-muted); }
.session-actions { display: flex; gap: 6px; }

/* ── Amount formatting ─────────────────────────────────────────────────────── */
.amount { font-family: 'JetBrains Mono', monospace; font-size: 14px; }
.amount-large { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 500; }
.amount-overdue { color: #C0392B; }

/* ── Client detail ─────────────────────────────────────────────────────────── */
.client-detail-header { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.client-info-block { flex: 1; min-width: 200px; }
.client-name { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 500; margin-bottom: 8px; }
.client-meta { font-size: 13px; color: var(--fg-muted); display: flex; flex-direction: column; gap: 4px; }

/* ── Stripe invoice ────────────────────────────────────────────────────────── */
.invoice-stripe { border-left: 3px solid var(--accent); padding-left: 16px; }

/* ── Utils ─────────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-gap { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--fg-muted); font-size: 13px; }
.text-sm { font-size: 12px; }
.hidden { display: none; }