/* ========================================================
   LATIN EATS ADMIN SUITE - DESIGN SYSTEM (INSPIRADO EN QUICKEN/SIMPLIFI)
   Ultra-limpio, tarjetas redondeadas (20-24px), barra de iconos lateral,
   paleta armónica con acentos Latin Eats (verde botánico y carmesí).
   ======================================================== */

:root {
  /* Paleta base de la interfaz (Quicken style) */
  --bg-app: #f2f4f8;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfe;
  --bg-subtle: #f6f8fb;
  --border-card: #e5e9f2;
  --border-subtle: #edf1f7;
  
  /* Textos y contrastes */
  --text-primary: #19202e;
  --text-secondary: #58657d;
  --text-muted: #8b98b0;
  
  /* Acentos de marca Latin Eats */
  --le-brand-green: #3d6e1b;
  --le-brand-green-light: #528c28;
  --le-brand-green-subtle: #ecf5e6;
  --le-brand-red: #d92d20;
  --le-brand-red-subtle: #fee4e2;
  --le-accent-blue: #3b82f6;
  --le-accent-blue-subtle: #eff6ff;
  --le-accent-purple: #7c3aed;
  --le-accent-purple-subtle: #f5f3ff;
  --le-accent-teal: #0d9488;
  --le-accent-teal-subtle: #f0fdfa;
  
  /* Sombras y bordes suaves */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-card: 22px;
  --radius-pill: 9999px;
  --shadow-card: 0 4px 16px rgba(24, 38, 64, 0.04), 0 1px 3px rgba(24, 38, 64, 0.02);
  --shadow-hover: 0 10px 24px rgba(24, 38, 64, 0.08), 0 2px 6px rgba(24, 38, 64, 0.03);
  --shadow-drawer: -12px 0 36px rgba(18, 28, 48, 0.16);

  --sidebar-width: 68px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-app: #0f141d;
    --bg-card: #171e2b;
    --bg-card-hover: #1c2535;
    --bg-subtle: #121822;
    --border-card: #222c3d;
    --border-subtle: #1c2534;
    --text-primary: #f0f4fc;
    --text-secondary: #97a6c0;
    --text-muted: #62728d;
    --le-brand-green-subtle: #192a11;
    --le-brand-red-subtle: #341414;
    --le-accent-blue-subtle: #12213a;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================
   ESTRUCTURA PRINCIPAL (SLIM RAIL SIDEBAR + MAIN STAGE)
   ======================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* 1. Slim Icon Rail (Izquierda) */
.rail-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  flex-shrink: 0;
}

.rail-top, .rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rail-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--le-brand-green), #24460f);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -1px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(61, 110, 27, 0.35);
  margin-bottom: 12px;
}

.rail-logo-badge span {
  color: #ff5252;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rail-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.rail-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.rail-btn:hover {
  background: var(--bg-subtle);
  color: var(--le-brand-green);
  transform: scale(1.05);
}

.rail-btn.active {
  background: var(--le-brand-green);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(61, 110, 27, 0.3);
}

.rail-btn.active::before {
  content: '';
  position: absolute;
  left: -12px;
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--le-brand-green);
}

/* Tooltips */
.rail-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s ease;
  z-index: 1000;
  box-shadow: var(--shadow-card);
}

.rail-btn:hover[data-tooltip]::after {
  opacity: 1;
  transform: translateX(0);
}

.rail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--le-brand-green-subtle);
  color: var(--le-brand-green);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-card);
  cursor: pointer;
}

/* 2. Main Stage (Área de Contenido y Dashboard) */
.stage-container {
  flex: 1;
  padding: 24px 32px 64px;
  max-width: 1540px;
  margin: 0 auto;
  width: calc(100vw - var(--sidebar-width));
}

/* Header superior del Stage */
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.stage-title-wrap h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0 0 4px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-title-wrap p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.stage-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.dot-indicator.offline {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* ========================================================
   TARJETAS ESTILO QUICKEN (20-24px BORDER-RADIUS)
   ======================================================== */
.q-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.q-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.q-card-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-card-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.q-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--le-brand-green);
  background: var(--le-brand-green-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.q-btn-add:hover {
  background: var(--le-brand-green);
  color: #ffffff;
}

/* ========================================================
   VISTA 1: DASHBOARD GENERAL (QUICKEN STYLE)
   ======================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

.left-summary-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metric-big-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.metric-big-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.metric-big-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.8px;
}

.category-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.category-group-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card);
  transform: translateX(3px);
}

.category-group-item.active {
  background: var(--le-brand-green-subtle);
  border-color: var(--le-brand-green);
}

.cat-label-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.cat-count-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.right-dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.plan-breakdown-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: center;
}

.donut-visual-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.donut-chart-svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.donut-chart-svg circle {
  fill: none;
  stroke-width: 16;
}

.progress-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.city-progress-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.city-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border-card);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--le-brand-green);
  transition: width 0.5s ease;
}

.progress-fill.blue { background: var(--le-accent-blue); }
.progress-fill.purple { background: var(--le-accent-purple); }
.progress-fill.teal { background: var(--le-accent-teal); }

.bottom-dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  transition: background 0.15s;
}

.activity-item:hover {
  background: var(--bg-card-hover);
}

.activity-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--le-brand-green-subtle);
  color: var(--le-brand-green);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.activity-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-item-right {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

.user-mini-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.user-mini-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--le-brand-green);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-mini-badge.suspended {
  background: var(--le-brand-red);
}

/* ========================================================
   VISTA 2: CATÁLOGO DE COMERCIOS & HERRAMIENTAS PRO
   ======================================================== */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: var(--shadow-card);
  transition: all 0.15s;
}

.search-input:focus {
  border-color: var(--le-brand-green);
  box-shadow: 0 0 0 3px rgba(61, 110, 27, 0.15);
}

.filter-selects-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--le-brand-green);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(61, 110, 27, 0.3);
  transition: all 0.15s;
}

.btn-primary-action:hover {
  background: #2b5012;
  transform: translateY(-1px);
}

/* Switcher de Vista: Cuadrícula vs Tabla */
.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  padding: 3px;
  box-shadow: var(--shadow-card);
}

.view-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.view-mode-btn.active {
  background: var(--le-brand-green);
  color: #ffffff;
}

/* Grid de Comercios */
.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.biz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.biz-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--le-brand-green-light);
}

.biz-thumb {
  height: 160px;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

.biz-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.biz-card:hover .biz-thumb img {
  transform: scale(1.04);
}

.biz-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, var(--bg-subtle), var(--le-brand-green-subtle));
}

.biz-card .biz-status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  z-index: 2;
}

.biz-status-pill.published {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.biz-status-pill.draft {
  background: rgba(245, 158, 11, 0.9);
  color: #fff;
}

.biz-status-pill.closed {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

/* Badges de estado en línea (Dashboard, Tablas, Headers, Usuarios) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.status-badge.published {
  background: var(--le-brand-green-subtle);
  color: var(--le-brand-green);
  border: 1px solid rgba(61, 110, 27, 0.25);
}

.status-badge.draft {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.closed {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.biz-content {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* ========================================================
   TARJETAS DE EVENTOS & ACTIVIDADES
   ======================================================== */
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(61, 110, 27, 0.3);
}

.event-hero {
  position: relative;
  width: 100%;
  height: 160px;
  background: #1e293b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.event-card:hover .event-hero img {
  transform: scale(1.03);
}

.event-date-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 2;
  min-width: 44px;
}

.event-date-month {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--le-brand-red);
  letter-spacing: 0.5px;
  line-height: 1;
}

.event-date-day {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
}

.event-price-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.biz-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.biz-location {
  font-size: 13px;
  color: var(--text-secondary);
}

.biz-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.biz-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--le-brand-green-subtle);
  color: var(--le-brand-green);
}

.biz-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-card-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-card-edit:hover {
  background: var(--le-brand-green);
  color: #ffffff;
  border-color: var(--le-brand-green);
}

/* Tabla Compacta Pro */
.compact-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.compact-table th {
  padding: 14px 18px;
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-card);
}

.compact-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.compact-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Quick Status Selector Dropdown */
.quick-status-select {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-card);
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.quick-status-select.published { background: #dcfce7; color: #15803d; border-color: rgba(34, 197, 94, 0.4); }
.quick-status-select.draft { background: #fef3c7; color: #b45309; border-color: rgba(245, 158, 11, 0.4); }
.quick-status-select.closed { background: #fee2e2; color: #b91c1c; border-color: rgba(239, 68, 68, 0.4); }
.quick-status-select.cancelled { background: #fee2e2; color: #b91c1c; border-color: rgba(239, 68, 68, 0.4); }
.quick-status-select.postponed { background: #ffedd5; color: #c2410c; border-color: rgba(249, 115, 22, 0.4); }

/* Quick Status Selector on Business Card Thumbnails */
.biz-card .biz-status-select {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
  backdrop-filter: blur(8px);
  z-index: 2;
  cursor: pointer;
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.biz-card .biz-status-select:hover {
  transform: scale(1.04);
}

.biz-card .biz-status-select.published { background: rgba(16, 185, 129, 0.95); color: #fff; }
.biz-card .biz-status-select.draft { background: rgba(245, 158, 11, 0.95); color: #fff; }
.biz-card .biz-status-select.closed { background: rgba(239, 68, 68, 0.95); color: #fff; }

/* Taxonomy Management Components */
.tax-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tax-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--le-accent-blue);
}

.tax-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* ========================================================
   SLIDE-OVER DRAWER (EDITOR DE COMERCIO)
   ======================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 29, 0.6);
  backdrop-filter: blur(6px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 890px;
  background: var(--bg-card);
  box-shadow: var(--shadow-drawer);
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer-panel.open {
  transform: translateX(0);
}

.drawer-panel.open ~ .drawer-backdrop,
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-card);
  background: var(--bg-card);
}

.drawer-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.drawer-body {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-card);
  background: var(--bg-card);
}

.editor-tabs-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-pill-btn {
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tab-pill-btn:hover {
  color: var(--text-primary);
}

.tab-pill-btn.active {
  color: var(--le-brand-green);
  border-bottom-color: var(--le-brand-green);
}

.tab-pane {
  display: none;
}

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

.field-row {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.field-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 220px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

.field-input, .field-select, .field-textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s;
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--le-brand-green);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(61, 110, 27, 0.15);
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.pill-option {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.pill-option:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.pill-option.selected {
  background: var(--le-brand-green-subtle);
  color: var(--le-brand-green);
  border-color: var(--le-brand-green);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(61, 110, 27, 0.12);
}

.pill-option.selected::before {
  content: "✓";
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

#drawer-toggle-preview.active {
  background: var(--le-brand-green-subtle);
  color: var(--le-brand-green);
  border-color: var(--le-brand-green);
  font-weight: 700;
}

/* Modales */
dialog.q-modal {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 32px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 90%;
}

dialog.q-modal::backdrop {
  background: rgba(15, 20, 29, 0.6);
  backdrop-filter: blur(6px);
}

@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .plan-breakdown-card { grid-template-columns: 1fr; }
  .bottom-dashboard-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .rail-sidebar {
    width: 100%; height: auto;
    flex-direction: row; position: relative;
    padding: 12px 18px;
  }
  .rail-top, .rail-bottom { flex-direction: row; }
  .rail-nav { flex-direction: row; }
  .stage-container { width: 100vw; padding: 16px; }
}

/* ========================================================
   SISTEMA DE NOTIFICACIONES TOAST (QUICKEN STYLE)
   ======================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 380px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-item.toast-success {
  background: rgba(18, 38, 20, 0.94);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #86efac;
}

.toast-item.toast-error {
  background: rgba(45, 18, 18, 0.94);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.toast-item.toast-info {
  background: rgba(18, 30, 48, 0.94);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

.toast-item.toast-warning {
  background: rgba(45, 35, 15, 0.94);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

/* ========================================================
   BARRA FLOTANTE DE ACCIONES MASIVAS (BULK BAR)
   ======================================================== */
.bulk-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 1500;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.bulk-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bulk-count-badge {
  background: var(--le-brand-green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.bulk-action-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.bulk-action-btn:hover {
  background: var(--border-subtle);
  border-color: var(--border-card);
}

.bulk-action-btn.danger:hover {
  background: rgba(225, 29, 72, 0.15);
  border-color: var(--le-brand-red);
  color: var(--le-brand-red);
}

/* Resaltado de filas seleccionadas */
tr.row-selected {
  background: rgba(61, 110, 27, 0.08) !important;
}

/* ========================================================
   LIVE IPHONE PREVIEW (SIMULADOR EN DRAWER)
   ======================================================== */
.drawer-panel.preview-mode {
  max-width: 1280px;
}

.drawer-split-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  height: 100%;
}

.drawer-panel.preview-mode .drawer-split-container {
  grid-template-columns: 1fr 380px;
}

.iphone-preview-wrap {
  display: none;
  position: sticky;
  top: 0;
  align-self: start;
}

.drawer-panel.preview-mode .iphone-preview-wrap {
  display: block;
}

.iphone-device {
  width: 360px;
  height: 720px;
  background: #000;
  border-radius: 46px;
  border: 10px solid #222;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 2px rgba(255, 255, 255, 0.4);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  color: #fff;
}

.iphone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: #000;
  border-radius: 20px;
  z-index: 10;
}

.iphone-status-bar {
  height: 44px;
  padding: 10px 24px 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  z-index: 5;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.iphone-screen-content {
  flex: 1;
  overflow-y: auto;
  background: #0d1117;
  color: #f0f6fc;
}

.iphone-screen-content::-webkit-scrollbar {
  display: none;
}

.iphone-hero {
  width: 100%;
  height: 200px;
  background: #1f2937;
  position: relative;
  overflow: hidden;
}

.iphone-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iphone-body-sheet {
  padding: 18px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.iphone-biz-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.iphone-tagline {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

.iphone-pills-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.iphone-mini-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.iphone-action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0;
}

.iphone-btn-icon {
  background: #1e293b;
  border: none;
  border-radius: 12px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
}

.iphone-desc-box {
  background: #161e2e;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
}

.iphone-lang-switcher {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.iphone-lang-btn {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  cursor: pointer;
}

.iphone-lang-btn.active {
  background: var(--le-brand-green);
  color: #fff;
  border-color: var(--le-brand-green);
}


/* Hasta iniciar sesión no se muestra nada del panel */
body.is-locked .app-layout { display: none !important; }
