/* ─── RECAUDA — Sistema de diseño v2 ──────────────────────────────────
   Requiere en el <head>:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
   <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/tabler-icons.min.css">
   <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
   <link rel="stylesheet" href="../compartido/styles.css">
──────────────────────────────────────────────────────────────────────── */

/* ─── Variables ──────────────────────────────────────────────────────── */
:root {
  --blue:          #005BC9;
  --blue-dark:     #004A9E;
  --blue-light:    #337CD4;
  --blue-bg:       #E6EFFA;

  --sidebar-width: 252px;
  --page-bg:       #F6F7F9;
  --card-bg:       #ffffff;
  --card-border:   #E5E7EB;

  --text-primary:  #111827;
  --text-secondary:#4B5563;
  --text-muted:    #6B7280;
  --text-hint:     #9CA3AF;

  --success-bg:    #dcfce7;
  --success-text:  #15803d;
  --success-dot:   #16a34a;
  --warning-bg:    #fef3c7;
  --warning-text:  #92400e;
  --warning-dot:   #d97706;
  --danger-bg:     #fee2e2;
  --danger-text:   #991b1b;
  --danger-dot:    #dc2626;
  --info-bg:       #dbeafe;
  --info-text:     #1e40af;
  --info-dot:      #2563eb;
  --purple-bg:     #ede9fe;
  --purple-text:   #5b21b6;
  --purple-dot:    #7c3aed;
  --neutral-bg:    #f3f4f6;
  --neutral-text:  #374151;
  --neutral-dot:   #6b7280;

  --radius-sm:     6px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --radius-xl:     16px;
  --radius-pill:   99px;

  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 6px 16px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 16px 40px rgba(17, 24, 39, 0.14);
}

/* ─── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

::selection { background: var(--blue-bg); color: var(--blue-dark); }

/* ─── Layout principal ───────────────────────────────────────────────── */
.r-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.r-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--card-bg);
  border-right: 1px solid var(--card-border);
  position: fixed;
  top: 0;
  left: 0;
  padding: 1.375rem 1rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.r-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  background: var(--page-bg);
  min-height: 100vh;
}

.r-content {
  padding: 2.25rem 2.75rem;
  max-width: 1180px;
}

/* ─── Logo ───────────────────────────────────────────────────────────── */
.r-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0.25rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.r-logo-img {
  height: 26px;
  width: auto;
  display: block;
}

/* ─── User card en sidebar ───────────────────────────────────────────── */
.r-sidebar-user {
  background: var(--page-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 1.5rem;
}

.r-sidebar-user-email {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.r-sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

/* ─── Navegación sidebar ─────────────────────────────────────────────── */
.r-nav-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-hint);
  padding: 0.9rem 0.6rem 0.35rem;
  display: block;
}

/* Usamos la clase sobre <a> y <button> con selectores específicos
   para ganar especificidad sobre Bootstrap sin usar !important */
a.r-nav-link,
button.r-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  text-decoration: none;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: left;
}

a.r-nav-link i,
button.r-nav-link i {
  font-size: 17px;
  color: var(--text-hint);
  flex-shrink: 0;
  transition: color 0.12s;
}

a.r-nav-link:hover,
button.r-nav-link:hover {
  background: var(--page-bg);
  color: var(--text-primary);
  text-decoration: none;
}

a.r-nav-link:hover i,
button.r-nav-link:hover i {
  color: var(--text-secondary);
}

a.r-nav-link.active,
button.r-nav-link.active {
  background: var(--blue-bg);
  color: var(--blue-dark);
  font-weight: 600;
}

a.r-nav-link.active::before,
button.r-nav-link.active::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--blue);
}

a.r-nav-link.active i,
button.r-nav-link.active i {
  color: var(--blue);
}

/* ─── Botón Salir ─────────────────────────────────────────────────────── */
.r-sidebar button.r-nav-logout,
button.r-nav-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--danger-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.r-sidebar button.r-nav-logout i,
button.r-nav-logout i {
  font-size: 17px;
  color: var(--danger-dot);
  flex-shrink: 0;
}

.r-sidebar button.r-nav-logout:hover,
button.r-nav-logout:hover {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.r-sidebar-bottom,
.r-sidebar-footer {
  margin-top: auto;
  padding-top: 0.875rem;
  border-top: 1px solid var(--card-border);
}

.r-sidebar-footer-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0.35rem 0.5rem 0.75rem;
}

.r-sidebar-footer-email {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.r-sidebar-footer-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  display: block;
}

/* ─── ONG name en sidebar (panel org) ───────────────────────────────── */
.r-sidebar-org {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 0.75rem;
  margin-bottom: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* ─── Avatar (iniciales) ─────────────────────────────────────────────── */
.r-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-dark);
  background: var(--blue-bg);
  flex-shrink: 0;
  letter-spacing: 0;
}

.r-avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }

.r-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Page header ────────────────────────────────────────────────────── */
.r-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.r-page-header h2 {
  font-size: 23px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.r-page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.r-page-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Header de evento (hub "Mi evento") ─────────────────────────────── */
.r-event-header {
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.r-event-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.r-event-header-title {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.r-event-header-title h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin: 0;
}

.r-event-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.r-event-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 12px;
}

.r-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.r-meta-item i { font-size: 15px; color: var(--text-hint); }

.r-meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--card-border);
  flex-shrink: 0;
}

.r-subheading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

/* ─── Cards ──────────────────────────────────────────────────────────── */
.r-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-xs);
}

.r-card-flush { padding: 0; overflow: hidden; }

.r-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.r-card-clickable:hover {
  box-shadow: var(--shadow-sm);
  border-color: #d1d5db;
}

.r-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.r-card-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.r-card-header-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─── Stat / metric cards ────────────────────────────────────────────── */
.r-stat-grid,
.r-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 1.75rem;
}

.r-stat-card,
.r-metric {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s ease;
}

.r-stat-card:hover { box-shadow: var(--shadow-sm); }

.r-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.r-stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.r-stat-value.success { color: var(--success-text); }
.r-stat-value.warning { color: var(--warning-text); }
.r-stat-value.info    { color: var(--info-text); }

.r-metric-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.r-metric-label i {
  font-size: 13px;
  color: var(--blue);
}

.r-metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

/* ─── Banner de cierre — feedback principal tras finalizar un evento ────
   Mayor jerarquía que el resto de las cards a propósito: es lo primero
   que el organizador necesita leer al volver a un evento cerrado (¿ya
   está todo rendido o falta cobrarle a alguien?). Ícono en badge circular
   + cifras grandes tipo stat + barra de progreso, en vez del aviso chico
   de una línea que tenía antes. */
.r-banner {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.r-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
}
.r-banner.success::before { background: var(--success-dot); }
.r-banner.warning::before  { background: var(--warning-dot); }
.r-banner.danger::before   { background: var(--danger-dot); }

.r-banner-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.r-banner.success .r-banner-icon { background: var(--success-bg); color: var(--success-dot); }
.r-banner.warning  .r-banner-icon { background: var(--warning-bg); color: var(--warning-dot); }
.r-banner.danger   .r-banner-icon { background: var(--danger-bg); color: var(--danger-dot); }

.r-banner-body { flex: 1; min-width: 0; }

.r-banner-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.r-banner-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.r-banner-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--page-bg);
}

.r-banner-stat-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.r-banner-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}
.r-banner-stat-value.success { color: var(--success-text); }
.r-banner-stat-value.warning { color: var(--warning-text); }

.r-banner-progress {
  margin-top: 14px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  overflow: hidden;
}
.r-banner-progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.2s;
}
.r-banner-progress-bar.success { background: var(--success-dot); }
.r-banner-progress-bar.warning  { background: var(--warning-dot); }

.r-banner-note {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.r-banner-chip {
  display: inline-flex;
  align-items: center;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-weight: 600;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* Ítems clave/valor genéricos — detalle de compra (Compradores, PDF) */
.r-kv-row {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.r-kv-label { color: var(--text-muted); }
.r-kv-value { font-weight: 700; margin-left: 4px; }

/* ─── Tablas ──────────────────────────────────────────────────────────── */
.r-table-wrap,
.r-table-bare {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  width: 100%;
  border-collapse: collapse;
}

.r-table,
.r-table-bare table { width: 100%; border-collapse: collapse; }

.r-table thead th,
.r-table-bare thead th {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 12px 20px;
  text-align: left;
  background: #FAFAFB;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

/* Redondeo manual de esquinas (en vez de overflow:hidden en la tabla) para
   que los menús contextuales (dropdown de Acciones) no queden recortados. */
.r-table thead tr:first-child th:first-child,
.r-table-bare thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.r-table thead tr:first-child th:last-child,
.r-table-bare thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }
.r-table tbody tr:last-child td:first-child,
.r-table-bare tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-lg); }
.r-table tbody tr:last-child td:last-child,
.r-table-bare tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-lg); }

.r-table tbody td,
.r-table-bare tbody td {
  padding: 13px 20px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--page-bg);
  vertical-align: middle;
  text-align: left;
}

.r-table tbody tr:last-child td,
.r-table-bare tbody tr:last-child td {
  border-bottom: none;
}

.r-table tbody tr:hover td,
.r-table-bare tbody tr:hover td {
  background: #FAFAFB;
}

.r-table tbody tr.r-row-clickable,
.r-table-bare tbody tr.r-row-clickable {
  cursor: pointer;
}

.r-table-name {
  font-weight: 600;
  color: var(--text-primary);
}

.r-table-sub {
  font-size: 11.5px;
  color: var(--text-hint);
  margin-top: 1px;
}

/* ─── Badges ─────────────────────────────────────────────────────────── */
.r-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.r-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.r-badge-success  { background: var(--success-bg);  color: var(--success-text); }
.r-badge-success .r-badge-dot  { background: var(--success-dot); }
.r-badge-warning  { background: var(--warning-bg);  color: var(--warning-text); }
.r-badge-warning .r-badge-dot  { background: var(--warning-dot); }
.r-badge-danger   { background: var(--danger-bg);   color: var(--danger-text); }
.r-badge-danger .r-badge-dot   { background: var(--danger-dot); }
.r-badge-info     { background: var(--info-bg);     color: var(--info-text); }
.r-badge-info .r-badge-dot     { background: var(--info-dot); }
.r-badge-purple   { background: var(--purple-bg);   color: var(--purple-text); }
.r-badge-purple .r-badge-dot   { background: var(--purple-dot); }
.r-badge-neutral  { background: var(--neutral-bg);  color: var(--neutral-text); }
.r-badge-neutral .r-badge-dot  { background: var(--neutral-dot); }

/* Variante para tablas — sin pill, solo el dot de color + texto en negro,
   para bajar la carga visual de columnas de estado dentro de .r-table*. */
.r-badge-plain {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  color: var(--text-primary);
}
.r-badge-plain .r-badge-dot { width: 6px; height: 6px; }

/* ─── Botones ────────────────────────────────────────────────────────── */
.r-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  text-align: center;
}

.r-btn i { font-size: 16px; }

.r-btn-sm { padding: 6px 14px; font-size: 12px; font-weight: 500; }
.r-btn-sm i { font-size: 14px; }

.r-btn-icon { padding: 8px; width: 33px; height: 33px; justify-content: center; }

.r-btn-primary {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 1px 2px rgba(0, 91, 201, 0.25);
}
.r-btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #ffffff;
  text-decoration: none;
}

.r-btn-secondary {
  background: var(--card-bg);
  color: var(--text-secondary);
  border-color: var(--card-border);
}
.r-btn-secondary:hover {
  background: var(--page-bg);
  color: var(--text-primary);
}

.r-btn-danger {
  background: var(--card-bg);
  color: var(--danger-text);
  border-color: #fecaca;
}
.r-btn-danger:hover { background: var(--danger-bg); }

.r-btn-warning {
  background: var(--card-bg);
  color: var(--warning-text);
  border-color: #fde68a;
}
.r-btn-warning:hover { background: var(--warning-bg); }

.r-btn-success {
  background: var(--card-bg);
  color: var(--success-text);
  border-color: #bbf7d0;
}
.r-btn-success:hover { background: var(--success-bg); }

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

/* ─── Formularios ────────────────────────────────────────────────────── */
.r-form-group { margin-bottom: 1rem; }

.r-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.r-form-control,
.form-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
}

.r-form-control:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-bg);
}

.r-form-control::placeholder { color: var(--text-hint); }

.r-form-hint {
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 4px;
}

/* ─── Alertas ────────────────────────────────────────────────────────── */
.r-alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.r-alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.r-alert span { flex: 1; }

.r-alert-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.r-alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.r-alert-success { background: var(--success-bg); color: var(--success-text); }
.r-alert-info    { background: var(--info-bg);    color: var(--info-text); }

/* ─── Login ──────────────────────────────────────────────────────────── */
.r-login-wrap {
  min-height: 100vh;
  background:
    radial-gradient(720px circle at 12% 8%, rgba(0, 91, 201, 0.10), transparent 55%),
    radial-gradient(640px circle at 88% 92%, rgba(51, 124, 212, 0.10), transparent 55%),
    var(--page-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.r-login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.r-login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 0.4rem;
}

.r-login-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.r-login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2rem;
  display: block;
}

.r-btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.r-btn-google:hover {
  background: var(--page-bg);
  border-color: #d1d5db;
  box-shadow: var(--shadow-xs);
}

/* ─── Menú contextual (dropdown de acciones por fila) ─────────────────── */
.dropdown-menu {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  min-width: 200px;
}

.dropdown-item {
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item i { font-size: 15px; width: 16px; text-align: center; }

.dropdown-item:hover,
.dropdown-item:focus { background: var(--page-bg); color: var(--text-primary); }

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus { background: var(--danger-bg); color: var(--danger-text) !important; }

.dropdown-divider { margin: 6px 2px; border-color: var(--card-border); }

/* ─── Modales Bootstrap — override con Inter y diseño RECAUDA ────────── */
.modal-content {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  font-family: 'Inter', sans-serif;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

.modal-body { padding: 1.25rem 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--card-border);
  gap: 8px;
}

/* ─── Offcanvas Bootstrap — override con Inter y diseño RECAUDA ───────── */
.offcanvas {
  font-family: 'Inter', sans-serif;
  border-left: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
}

.offcanvas-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.offcanvas-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.offcanvas-body { padding: 1.25rem 1.5rem; }

.offcanvas-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--card-border);
}

/* ─── Bottom sheet (Panel Vendedor) ───────────────────────────────────────
   Variante inferior del offcanvas. La usan los dos sheets del panel: el
   detalle de una venta ya registrada y el flujo completo de nueva venta.
   Altura al contenido (no el 30vh fijo de Bootstrap), esquinas superiores
   redondeadas y barrita de arrastre — patrón de hoja modal nativa.
   ⚠️ No tocar `transform` acá: Bootstrap lo usa para animar el show/hide
   del offcanvas. Para centrarlo en desktop se usa `left` + `width`. */
.offcanvas.offcanvas-bottom {
  height: auto;
  max-height: 85vh;
  border-left: none;
  border-top: 1px solid var(--card-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.r-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--card-border);
  border-radius: var(--radius-pill);
  margin: 10px auto 0;
  flex-shrink: 0;
}

/* En desktop el shell del vendedor se muestra como un frame de teléfono
   centrado; la hoja acompaña ese ancho en vez de cruzar toda la ventana. */
@media (min-width: 640px) {
  .offcanvas.offcanvas-bottom {
    width: 420px;
    left: calc(50% - 210px);
    right: auto;
  }
}

/* ─── Detalle de compra (panel lateral, formato vertical) ──────────────── */
.r-detalle-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
}
.r-detalle-item:last-child { border-bottom: none; }

.r-detalle-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

/* Sin `border-top`: el ítem inmediatamente anterior ya aporta su
   `border-bottom`, así que agregarlo acá dibujaba dos líneas pegadas. */
.r-detalle-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── Placeholders ───────────────────────────────────────────────────── */
.r-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  border: 1.5px dashed var(--card-border);
  border-radius: var(--radius-lg);
  margin-top: 1rem;
  background: var(--card-bg);
}

.r-placeholder-icon {
  width: 50px;
  height: 50px;
  background: var(--blue-bg);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.r-placeholder-icon i { font-size: 24px; color: var(--blue); }
.r-placeholder h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.r-placeholder p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ─── Progress ───────────────────────────────────────────────────────── */
.r-progress {
  height: 6px;
  background: var(--page-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.r-progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.r-progress-bar.success { background: var(--success-dot); }
.r-progress-bar.warning { background: var(--warning-dot); }

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.r-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 1.25rem;
  gap: 4px;
}

.r-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}

.r-tab:hover { color: var(--text-primary); }
.r-tab.active { color: var(--blue); font-weight: 700; border-bottom-color: var(--blue); }

/* ─── Segmented control (filtros dentro de una pestaña) ──────────────── */
.r-seg {
  display: inline-flex;
  background: var(--neutral-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.r-seg-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.r-seg-btn:hover { color: var(--text-primary); }

.r-seg-btn.active {
  background: var(--card-bg);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ─── Empty state ────────────────────────────────────────────────────── */
.r-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── Divider ────────────────────────────────────────────────────────── */
.r-divider {
  height: 1px;
  background: var(--card-border);
  margin: 1.25rem 0;
}

/* ─── Panel Vendedor — app-shell responsive (mobile-first + desktop) ──────
   Patrón de app nativa, no de dashboard: header fijo arriba, contenido con
   scroll propio en el medio, y una barra de acción fija abajo (thumb zone)
   para la CTA primaria de cada pantalla (Nueva Venta, Siguiente, Confirmar
   Venta...) — así el botón principal siempre está a un pulgar de distancia,
   sin depender de hacer scroll hasta el final.
   Mobile (< 640px): el frame ocupa todo el viewport (100dvh).
   Desktop/tablet (>= 640px): el mismo shell se centra dentro de un "frame"
   tipo teléfono (ancho fijo, bordes redondeados, sombra) en vez de
   estirarse a lo ancho de la pantalla. ──────────────────────────────────── */
.r-vendor-shell {
  min-height: 100vh;
  background: var(--page-bg);
}

.r-vendor-frame {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  overflow: hidden;
  /* Ancla del overlay full-screen de éxito (`.r-pantalla-exito`) */
  position: relative;
}

/* Barra de marca tipo app: logo a la izquierda, identidad y salida a la
   derecha. Sin menú desplegable — el panel es una sola pantalla, así que
   todo lo del header queda a un toque. */
.r-vendor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.r-vendor-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.r-vendor-brand-img {
  height: 22px;
  width: auto;
  display: block;
}

.r-vendor-header-acciones {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.r-vendor-header-salir {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--danger-dot);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}

.r-vendor-header-salir i { font-size: 19px; }
.r-vendor-header-salir:hover,
.r-vendor-header-salir:active { background: var(--danger-bg); }

/* Única zona que scrollea — header y bottombar quedan fijos por fuera */
.r-vendor-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Barra de acción inferior — CTA primaria de cada pantalla, siempre visible
   sin depender de scroll. Poblada vía setBottombar()/ocultarBottombar()
   (compartido/utils.js) desde main.js/venta.js. */
.r-vendor-bottombar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  box-shadow: 0 -4px 14px rgba(17, 24, 39, 0.05);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Hero de progreso (pantalla principal del vendedor) ──────────────────
   Reemplaza a la card que envolvía nombre/fecha/lugar + barra de progreso.
   Va sin card, apoyado directo sobre el fondo del frame: el contexto del
   evento se comprime a una línea muted (el vendedor ya sabe dónde está, sólo
   necesita confirmarlo de reojo) y el peso visual queda en las cifras que
   le cambian la conducta — cuántas vendió y cuántas le quedan. */
.r-vendor-hero {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--card-border);
}

.r-vendor-hero-context {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r-vendor-hero-bar {
  height: 6px;
  background: var(--card-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 14px;
}

.r-vendor-hero-bar-fill {
  height: 100%;
  background: var(--success-dot);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.r-vendor-hero-stats {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.r-vendor-hero-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.r-vendor-hero-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Pantalla de éxito de venta (full screen) ────────────────────────────
   No es un paso del wizard sino el cierre celebratorio del flujo, y ocupa
   todo el frame del panel. Va posicionada dentro de `.r-vendor-frame` (no
   `fixed` al viewport) para que en desktop siga respetando la maqueta de
   teléfono en vez de cubrir la ventana entera. La muestra venta.js recién
   cuando el sheet de nueva venta terminó de cerrarse, así el offcanvas y su
   backdrop (que van por encima) ya no tapan nada. */
.r-pantalla-exito {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  animation: r-exito-fondo 0.28s ease-out;
}

.r-exito-centro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.r-exito-icono {
  width: 104px;
  height: 104px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: r-exito-pop 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.25) both;
}

.r-exito-icono svg { width: 52px; height: 52px; }

.r-exito-tilde {
  fill: none;
  stroke: var(--success-dot);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: r-exito-trazo 0.36s 0.22s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}

.r-exito-titulo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin: 0 0 4px;
  animation: r-exito-entrar 0.35s 0.16s ease-out both;
}

.r-exito-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 28px;
  animation: r-exito-entrar 0.35s 0.22s ease-out both;
}

.r-exito-monto {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--success-text);
  letter-spacing: -1px;
  line-height: 1.05;
  animation: r-exito-entrar 0.35s 0.28s ease-out both;
}

.r-exito-comprador {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  animation: r-exito-entrar 0.35s 0.32s ease-out both;
}

.r-exito-acciones {
  display: flex;
  gap: 8px;
  margin-top: 34px;
  width: 100%;
  max-width: 340px;
  animation: r-exito-entrar 0.35s 0.38s ease-out both;
}

.r-exito-acciones .r-btn { flex: 1; padding: 12px; }

.r-exito-pie {
  flex-shrink: 0;
  animation: r-exito-entrar 0.35s 0.44s ease-out both;
}

@keyframes r-exito-fondo {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes r-exito-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes r-exito-trazo {
  to { stroke-dashoffset: 0; }
}

@keyframes r-exito-entrar {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* Accesibilidad: si el sistema pide menos movimiento, se muestra el estado
   final sin animar (el tilde igual queda dibujado). */
@media (prefers-reduced-motion: reduce) {
  .r-pantalla-exito,
  .r-exito-icono,
  .r-exito-titulo,
  .r-exito-sub,
  .r-exito-monto,
  .r-exito-comprador,
  .r-exito-acciones,
  .r-exito-pie { animation: none; }
  .r-exito-tilde { stroke-dashoffset: 0; animation: none; }
}

/* Cupo restante en el paso 2 de la venta — va debajo de la lista de platos,
   alineado a la derecha para quedar bajo los selectores de cantidad (mismo
   padding horizontal que las filas de `.r-vendor-list`). Se actualiza en
   vivo con cada +/− desde actualizarDisplayPaso2(). */
.r-vendor-disponibles {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 16px 0;
}

/* Fila "volver + título" repetida en venta.js / historial.js */
.r-vendor-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.r-vendor-topbar h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Label "PASO 1 DE 2" / secciones dentro de una card */
.r-vendor-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}

/* ─── Lista plana — patrón de navegación/colección nativo de mobile,
   reemplaza stacks de cards individuales con sombra propia (selección de
   evento, navegación secundaria, historial de ventas) por un único
   contenedor con filas divididas — mismo lenguaje que una lista de ajustes
   o de transacciones en una app nativa. ──────────────────────────────── */
.r-vendor-list {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.r-vendor-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid var(--page-bg);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  font-family: 'Inter', sans-serif;
  text-align: left;
  color: inherit;
  text-decoration: none;
}
.r-vendor-list-item:last-child { border-bottom: none; }

button.r-vendor-list-item {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}
button.r-vendor-list-item:active { background: var(--page-bg); }

.r-vendor-list-item-body { flex: 1; min-width: 0; }

.r-vendor-list-item-chevron {
  font-size: 18px;
  color: var(--text-hint);
  flex-shrink: 0;
}

/* ─── Fila de venta (lista de compradores del vendedor) ───────────────────
   Patrón de fila de transacción: avatar del comprador a la izquierda,
   dos líneas de texto en el medio (nombre / comprobante · hora) y el monto
   como ancla a la derecha. Reemplaza el bloque apilado de 5 líneas que
   tenía cada venta antes — ver CLAUDE.md, "Lista de ventas del vendedor". */
.r-vendor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--page-bg);
  border-radius: 0;
  font-family: 'Inter', sans-serif;
  text-align: left;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}

.r-vendor-row:last-child { border-bottom: none; }
.r-vendor-row:active { background: var(--page-bg); }

.r-vendor-row-body { flex: 1; min-width: 0; }

.r-vendor-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r-vendor-row-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Columna derecha: monto arriba y, si corresponde, "Anulada" debajo — así
   ambos lados de la fila tienen dos líneas y quedan equilibrados. */
.r-vendor-row-right {
  flex-shrink: 0;
  text-align: right;
}

.r-vendor-row-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.r-vendor-row-anulada-tag {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger-text);
  margin-top: 1px;
}

/* Anulada: no lleva badge propio — se distingue por atenuación general y
   el monto tachado, para no meter un pill de color en cada fila. */
.r-vendor-row.anulada .r-vendor-row-title { color: var(--text-hint); }
.r-vendor-row.anulada .r-vendor-row-amount {
  color: var(--text-hint);
  text-decoration: line-through;
}
.r-vendor-row.anulada .r-avatar {
  background: var(--neutral-bg);
  color: var(--text-hint);
}

@media (min-width: 640px) {
  .r-vendor-shell {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
  }

  .r-vendor-frame {
    width: 100%;
    max-width: 420px;
    height: min(800px, calc(100vh - 80px));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
  }

  .r-vendor-header { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .r-vendor-bottombar { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
}

/* ─── Spinner animation ──────────────────────────────────────────────── */
@keyframes r-spin {
  to { transform: rotate(360deg); }
}
.r-spin { animation: r-spin 1s linear infinite; }
