/* ─── LuxRunner Portal — CSS ─── */

:root {
  --bg: #0f1219;
  --bg-card: #1a1e2b;
  --bg-sidebar: #141824;
  --bg-hover: #222738;
  --border: #2a2f3f;
  --text: #e4e7ed;
  --text-muted: #8b90a0;
  --primary: #6c5ce7;
  --primary-hover: #7c6fee;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --info: #74b9ff;
  --secondary: #636e72;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

/* ─── Sidebar ─── */
#sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-header {
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h1 { font-size: 1.25rem; margin: 0; }
.sidebar-header .version { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

#sidebar nav { flex: 1; padding: 0.75rem 0; overflow-y: auto; }
#sidebar nav a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
#sidebar nav a:hover { color: var(--text); background: var(--bg-hover); }
#sidebar nav a.active {
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Main ─── */
#main {
  flex: 1;
  margin-left: 240px;
  padding: 1.5rem 2rem;
  max-width: 1200px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.main-header h2 { font-size: 1.5rem; font-weight: 600; }

.header-actions { display: flex; gap: 0.5rem; }

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  display: block;
}
.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.25rem;
}
.stat-card small { font-size: 0.75rem; opacity: 0.7; display: block; margin-top: 0.1rem; }
.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.info { border-left: 4px solid var(--info); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger { border-left: 4px solid var(--danger); }
.stat-card.secondary { border-left: 4px solid var(--secondary); }

/* ─── Cards ─── */
.card, .info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.info-card h3 { margin-bottom: 0.5rem; }
.info-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ─── Memberships ─── */
.membresias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.membresia-card {
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.membresia-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.membresia-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.membresia-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.membresia-price small { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.membresia-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ─── Table ─── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table th, .table td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.875rem;
}
.table th {
  background: rgba(108, 92, 231, 0.1);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.table td { border-top: 1px solid var(--border); }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.table code {
  background: rgba(0,0,0,0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'SFMono-Regular', Consolas, monospace;
}

/* ─── Badges ─── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-success { background: rgba(0, 184, 148, 0.2); color: #00b894; }
.badge-warning { background: rgba(253, 203, 110, 0.2); color: #fdcb6e; }
.badge-danger { background: rgba(225, 112, 85, 0.2); color: #e17055; }
.badge-info { background: rgba(116, 185, 255, 0.2); color: #74b9ff; }
.badge-secondary { background: rgba(99, 110, 114, 0.2); color: #8b90a0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #00d2a0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e8856e; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #747c81; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

/* ─── Forms ─── */
.form-input, .form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); }
.form-select { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 50px; font-family: inherit; }
label { display: block; margin-bottom: 0.75rem; font-size: 0.85rem; color: var(--text-muted); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.btn-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  #sidebar { width: 60px; }
  .sidebar-header h1 { font-size: 0; }
  .sidebar-header h1::before { content: '🏛️'; font-size: 1.5rem; }
  #sidebar nav a { padding: 0.6rem 1rem; font-size: 0; }
  #sidebar nav a::before { font-size: 1.2rem; }
  #main { margin-left: 60px; padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Utilities ─── */
.section-actions { margin-bottom: 1rem; }
.loading { padding: 2rem; text-align: center; color: var(--text-muted); }
.error { color: var(--danger); padding: 1rem; }
.muted { color: var(--text-muted); padding: 1rem; font-style: italic; }
.alert {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.alert-success { background: rgba(0, 184, 148, 0.15); color: #00b894; border: 1px solid rgba(0, 184, 148, 0.3); }
