/* ═══════════════════════════════════════════════════════════
   ARENA CROSS — GLOBAL STYLES
   Theme: Ravvo — Black Industrial Black & Orange Purple — with logo branding
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1C1C1C;
  --bg-input: #1A1A1A;
  --bg-modal: #131313;
  --accent: #8B3FE8;
  --accent-hover: #A66BF0;
  --accent-dim: rgba(139, 63, 232, 0.15);
  --accent-glow: rgba(139, 63, 232, 0.3);
  --success: #22C55E;
  --success-dim: rgba(34, 197, 94, 0.15);
  --danger: #EF4444;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --warning: #F59E0B;
  --warning-dim: rgba(245, 158, 11, 0.15);
  --info: #3B82F6;
  --info-dim: rgba(59, 130, 246, 0.15);
  --text-primary: #F5F5F5;
  --text-secondary: #999999;
  --text-muted: #666666;
  --text-on-accent: #FFFFFF;
  --border: #222222;
  --border-hover: #333333;
  --border-accent: rgba(139, 63, 232, 0.4);
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-modal: 0 8px 40px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 20px rgba(139, 63, 232, 0.2);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: 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='%23ffffff' fill-opacity='0.02'%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");
  pointer-events: none; z-index: 0;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── LOGO IMAGE ── */
.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}
.logo-img-lg {
  height: 120px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(139, 63, 232,0.3));
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  cursor: pointer; transition: all 0.2s;
  position: relative; overflow: hidden;
}
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border-hover); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ── INPUTS ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-family: var(--font-display); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font-body); font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-input::placeholder { color: var(--text-muted); }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ── CARDS ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; transition: all 0.25s; }
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-card); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }
.badge-active { background: var(--success-dim); color: var(--success); }
.badge-inactive { background: var(--danger-dim); color: var(--danger); }
.badge-pending { background: var(--warning-dim); color: var(--warning); }
.badge-crossfit { background: var(--accent-dim); color: var(--accent); }
.badge-musculacao { background: var(--info-dim); color: var(--info); }
.badge-funcional { background: rgba(168,85,247,0.15); color: #A855F7; }
.badge-pilates { background: rgba(236,72,153,0.15); color: #EC4899; }
.badge-yoga { background: rgba(20,184,166,0.15); color: #14B8A6; }

/* ── TABLES ── */
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); text-align: left; border-bottom: 1px solid var(--border); }
.data-table td { padding: 14px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn 0.2s; }
.modal { background: var(--bg-modal); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; width: 90%; max-width: 560px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-modal); animation: slideUp 0.3s; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.3rem; color: var(--accent); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 4px 8px; transition: color 0.2s; }
.modal-close:hover { color: var(--text-primary); }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── STAT CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent); opacity: 0; transition: opacity 0.2s; }
.stat-card:hover::after { opacity: 1; }
.stat-label { font-family: var(--font-display); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }
.stat-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }

/* ── SEARCH / TOOLBAR ── */
.search-bar { position: relative; }
.search-bar input { width: 100%; padding: 10px 14px 10px 40px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem; }
.search-bar input:focus { outline: none; border-color: var(--accent); }
.search-bar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.toolbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px; font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-secondary); background: transparent; cursor: pointer; transition: all 0.2s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

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

/* ── TOAST ── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 14px 20px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow-card); animation: slideIn 0.3s, fadeOut 0.3s 2.7s; display: flex; align-items: center; gap: 10px; }
.toast-success { background: #166534; color: #bbf7d0; }
.toast-error { background: #991b1b; color: #fecaca; }
.toast-info { background: #1e3a5f; color: #bfdbfe; }

/* ── PWA INSTALL BANNER ── */
.pwa-install-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, #1a1000 0%, var(--bg-secondary) 100%);
  border-top: 2px solid var(--accent);
  padding: 20px;
  z-index: 1500;
  animation: slideUpBanner 0.4s;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.6);
}

.pwa-install-inner {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.pwa-install-logo {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 12px;
}

.pwa-install-logo img {
  height: 44px; width: 44px; border-radius: 10px;
  box-shadow: 0 0 15px rgba(139, 63, 232,0.3);
}

.pwa-install-logo span {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
}

.pwa-install-msg {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.pwa-install-msg strong {
  color: var(--accent);
}

.pwa-install-steps {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.pwa-install-actions {
  display: flex; gap: 10px; justify-content: center;
}

.pwa-dismiss {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  font-size: 0.82rem; padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.2s;
}
.pwa-dismiss:hover { border-color: var(--text-muted); color: var(--text-primary); }

@keyframes slideUpBanner { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (max-width: 768px) {
  .pwa-install-banner { padding: 16px 14px; }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── UTILITY ── */
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .modal { width: 95%; padding: 20px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  html { font-size: 14px; }
}
