/* ============================================================
   Dashboard Theme — organizer dashboard design system
   Tokens + component classes used by dashboard.ejs and
   event-dashboard.ejs. Not loaded on public marketing pages.
   ============================================================ */

/* Aqui habia un @import de Inter. No se pintaba NUNCA: head.ejs carga esta
   hoja y luego brand.css, que redefine --font en el mismo :root y gana por
   orden de cascada. Era una familia entera bajada de Google para nada. */

:root {
  /* Fondos */
  --bg: #0A0E17;
  --surface: #121826;
  --surface-2: #1A2130;
  --border: #232B3A;

  /* Texto */
  --text: #F1F5F9;
  --text-muted: #8B97A8;
  --text-dim: #5A6577;

  /* Acento */
  --accent: #0EA5E9;
  --accent-hover: #0284C7;
  --accent-soft: rgba(14, 165, 233, 0.1);

  /* Estados */
  --success: #10B981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.12);

  /* Sistema */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
  --space-unit: 8px;

  /* Tipografía */
  --font: 'Poppins', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.dash-page {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.dash-page a {
  font-family: var(--font);
}

/* ---------- Layout helpers ---------- */
.dash-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.dash-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  margin-bottom: 24px;
}

.dash-back:hover {
  color: var(--accent);
}

.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.dash-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 6px 0;
}

.dash-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- 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: 24px;
  transition: border-color 0.15s;
}

.metric-card:hover {
  border-color: var(--accent);
}

.metric-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 10px;
}

.metric-delta {
  font-size: 12px;
  color: var(--success);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: -12px 0 20px 0;
}

.panel-grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.panel-row:last-child {
  border-bottom: none;
}

.panel-row .label {
  color: var(--text-muted);
}

.panel-row .value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Status badge ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge.live {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: dash-pulse 2s infinite;
}

.status-badge.future {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-badge.past {
  background: rgba(139, 151, 168, 0.12);
  color: var(--text-muted);
}

@keyframes dash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- Join feed ---------- */
.join-list {
  display: flex;
  flex-direction: column;
}

.join-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.join-item:last-child {
  border-bottom: none;
}

.join-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.join-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.join-time {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.join-empty {
  font-size: 13px;
  color: var(--text-dim);
  padding: 12px 0;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.copied {
  background: var(--success);
  color: #fff;
  /* El botón de copiar es .btn-secondary y lleva borde propio: lo igualamos
     al fondo para que el estado "Copiado" quede sólido. */
  border-color: var(--success);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 24px;
}

.tab-button {
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tab-button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-button:hover:not(.active) {
  color: var(--text);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ---------- Form fields ---------- */
.field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.field-input::placeholder {
  color: var(--text-dim);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.field-input {
  resize: vertical;
  font-family: var(--font);
}

/* ---------- Misc ---------- */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.live-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: dash-pulse 2s infinite;
}

.stat-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.stat-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-mini-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-mini-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.code-pill {
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  word-break: break-all;
}

.legend-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dash-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  text-align: center;
  font-size: 13px;
  padding: 24px;
}

@media (max-width: 860px) {
  .panel-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dash-shell {
    padding: 24px 16px 48px;
  }
  .dash-title {
    font-size: 22px;
  }
  .metric-value {
    font-size: 30px;
  }
}
