:root {
  --bg: #f5f5f5;
  --bg-accent: #eaeaea;
  --panel: rgba(255, 255, 255, 0.98);
  --text: #414140;
  --text-secondary: #585c5c;
  --muted: #a9a9a9;
  --line: rgba(65, 64, 64, 0.12);
  --line-strong: rgba(65, 64, 64, 0.25);
  --primary: #585c5c;
  --primary-light: #7a7e7e;
  --primary-dark: #414140;
  --primary-gradient: linear-gradient(135deg, #585c5c 0%, #7a7e7e 50%, #414140 100%);
  --secondary: #eaeaea;
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #585c5c;
  --info-light: #eaeaea;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(88, 92, 92, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(88, 92, 92, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(88, 92, 92, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ==================== LAYOUT ==================== */

.app-shell {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.app-shell--narrow {
  width: min(1080px, calc(100% - 48px));
}

/* ==================== TOPBAR ==================== */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  margin: 0 -32px 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(65, 64, 64, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

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

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(65, 64, 64, 0.15);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  transition: all var(--transition-fast);
}

.user-pill:hover {
  border-color: rgba(65, 64, 64, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* ==================== LOGIN ==================== */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.login-shell {
  width: min(1200px, calc(100% - 48px));
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}

.login-panel {
  padding: 40px;
}

.login-panel__logo {
  height: 56px;
  margin-bottom: 20px;
}

/* ==================== CARDS ==================== */

.hero-card,
.panel-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  animation: slideUpFade 0.5s ease-out;
}

.hero-card:hover,
.panel-card:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12), 0 0 60px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  border-color: rgba(65, 64, 64, 0.25);
}

.hero-card::before,
.panel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(65, 64, 64, 0.03) 0%, transparent 50%, rgba(88, 92, 92, 0.02) 100%);
  pointer-events: none;
}

.hero-card::after,
.panel-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #414140 0%, #585c5c 50%, #414140 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ==================== TYPOGRAPHY ==================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #585c5c;
  margin-bottom: 8px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #414140;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(65, 64, 64, 0.4);
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

h2 { font-size: 1.5rem; margin-bottom: 8px; }
h3 { font-size: 1.125rem; margin-bottom: 6px; }

p { color: var(--text-secondary); line-height: 1.7; }

/* ==================== COMMAND CENTER ==================== */

.command-center {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}

.command-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 40px;
  background: linear-gradient(135deg, #414140 0%, #585c5c 50%, #2d2f2f 100%);
  color: white;
  box-shadow: var(--shadow-xl), 0 0 60px rgba(88, 92, 92, 0.25);
  border-left: 4px solid var(--warning);
}

.command-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.command-hero::after { display: none; }
.command-hero .eyebrow { color: rgba(255, 255, 255, 0.9); }
.command-hero .eyebrow::before { background: white; box-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }
.command-hero h2 { font-size: clamp(2rem, 4vw, 3rem); color: white; margin: 12px 0 16px; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.command-hero p { color: rgba(255, 255, 255, 0.95); font-size: 1.1rem; max-width: 700px; margin: 0; }

.hero-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

.ghost-btn--light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.ghost-btn--light:hover { background: rgba(255, 255, 255, 0.18); }

/* ==================== METRICS ==================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  animation: slideUpFade 0.5s ease-out;
}

.metric-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 0 30px rgba(0, 0, 0, 0.04);
  border-color: rgba(65, 64, 64, 0.2);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #414140 0%, #585c5c 50%, #414140 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.metric-card .metric-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.metric-card .metric-value {
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

/* ==================== CARTELERA ==================== */

.cartelera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.evento-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  animation: slideUpFade 0.5s ease-out;
  position: relative;
}

.evento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 2.5px solid #e07b39;
  box-shadow: 0 0 0 1px rgba(224, 123, 57, 0.2), 0 0 10px rgba(224, 123, 57, 0.55);
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
  transition: opacity 0.3s, box-shadow 0.3s;
}

.evento-card:hover::before {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(224, 123, 57, 0.3), 0 0 16px rgba(224, 123, 57, 0.75);
  border-color: #ff8c42;
}

.evento-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(224, 123, 57, 0.2);
  border-color: rgba(224, 123, 57, 0.4);
}

.evento-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--bg-accent);
  display: block;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.evento-poster--placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.evento-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.evento-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}

.evento-card__meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.evento-card__actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== DETALLE EVENTO ==================== */

.evento-hero {
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: 32px;
  align-items: start;
}

.evento-hero__poster {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-accent);
}

.evento-hero__poster img {
  width: 100%;
  display: block;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.evento-hero__info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== CARRO ==================== */

.carrito-list {
  display: grid;
  gap: 16px;
}

.carrito-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.carrito-item__poster {
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-accent);
}

/* ==================== TABLES ==================== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.dashboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.dashboard-table thead {
  background: var(--bg-accent);
}

.dashboard-table th {
  padding: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.dashboard-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.dashboard-table tbody tr {
  transition: background var(--transition-fast);
}

.dashboard-table tbody tr:hover {
  background: rgba(65, 64, 64, 0.04);
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==================== BADGES ==================== */

.traffic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.traffic-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.traffic-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.traffic-badge--green {
  background: var(--success-light);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.3);
}
.traffic-badge--green::before { background: var(--success); box-shadow: 0 0 8px var(--success); }

.traffic-badge--yellow {
  background: var(--warning-light);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
}
.traffic-badge--yellow::before { background: var(--warning); box-shadow: 0 0 8px var(--warning); }

.traffic-badge--red {
  background: var(--danger-light);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.3);
}
.traffic-badge--red::before { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--secondary);
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.2;
  position: relative;
  overflow: hidden;
}

.stage-badge--glow {
  background: linear-gradient(135deg, #e07b39 0%, #c9784a 100%);
  color: white;
  box-shadow: 0 0 12px rgba(224, 123, 57, 0.35), 0 0 4px rgba(224, 123, 57, 0.2);
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.stage-badge--glow::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  animation: badgeShine 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes badgeShine {
  0%, 100% { transform: translate(-30%, -30%) scale(0.8); opacity: 0; }
  50% { transform: translate(0%, 0%) scale(1); opacity: 1; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-accent);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==================== BUTTONS ==================== */

button {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover { transform: translateY(-2px); }
button:active { transform: translateY(0); }

.primary-btn, .ghost-btn, .danger-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(120deg, #585c5c 0%, #7a7e7e 25%, #969a9a 45%, #7a7e7e 55%, #585c5c 75%, #414140 100%);
  background-size: 200% auto;
  color: white;
  box-shadow: 0 4px 14px rgba(227, 82, 5, 0.4);
  position: relative;
  overflow: hidden;
}

.primary-btn:hover {
  box-shadow: 0 8px 25px rgba(227, 82, 5, 0.6), 0 0 30px rgba(227, 82, 5, 0.15);
  transform: translateY(-2px);
}

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

.ghost-btn:hover {
  background: var(--line);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.danger-btn {
  background: var(--danger);
  color: white;
}

.danger-btn:hover { background: #dc2626; }

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ==================== FORMS ==================== */

.stack-form, .inline-form {
  display: grid;
  gap: 16px;
}

.inline-form {
  grid-template-columns: 1fr auto;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.95rem;
  color: var(--text);
  transition: all var(--transition-fast);
}

input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #585c5c;
  box-shadow: 0 0 0 3px rgba(88, 92, 92, 0.15), 0 0 20px rgba(88, 92, 92, 0.08);
  transform: translateY(-1px);
}

textarea { resize: vertical; min-height: 100px; }

/* ==================== FLASH MESSAGES ==================== */

.flash {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-ok {
  background: var(--success-light);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.flash-error {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==================== TABS ==================== */

.tabs-bar {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  width: fit-content;
  box-shadow: var(--shadow-inner);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}

.tab-btn.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: #414140;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(65, 64, 64, 0.1) inset;
  transform: translateY(-1px);
}

.tab-btn.is-active::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: linear-gradient(90deg, #414140 0%, #585c5c 50%, #414140 100%);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 8px rgba(65, 64, 64, 0.3);
}

/* ==================== PANELS & LAYOUTS ==================== */

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 { margin: 0; font-size: 1.25rem; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ==================== CHAT ==================== */

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-accent);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  max-width: 80%;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}

.chat-bubble--own {
  align-self: flex-end;
  background: var(--primary-gradient);
  color: white;
  border: none;
}

.chat-bubble__meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.chat-bubble--own .chat-bubble__meta {
  color: rgba(255, 255, 255, 0.8);
}

.chat-bubble__text {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state h3 { margin: 0 0 8px 0; color: var(--text); }

/* ==================== RESPONSIVE ==================== */

@media (min-width: 1440px) {
  .app-shell { width: min(1800px, calc(100% - 64px)); }
  .cartelera-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

@media (max-width: 1200px) {
  .two-col, .three-col, .evento-hero { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 16px; }
  .tabs-bar { width: 100%; flex-wrap: wrap; }
  .tab-btn { flex: 1; min-width: 120px; justify-content: center; }
}

@media (max-width: 640px) {
  .app-shell { width: calc(100% - 24px); padding: 16px 0 32px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .cartelera-grid { grid-template-columns: repeat(2, 1fr); }
  .carrito-item { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .cartelera-grid { grid-template-columns: 1fr; }
}

/* ==================== ANIMATIONS ==================== */

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== CARTELERA BANNER ==================== */

.cartelera-banner {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 32px;
  padding: 48px 40px;
  background: linear-gradient(135deg, #414140 0%, #585c5c 50%, #2d2f2f 100%);
  color: white;
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--warning);
}

.cartelera-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.12) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.cartelera-banner__content {
  position: relative;
  max-width: 700px;
}

.cartelera-banner__content h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: white;
  margin: 12px 0 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cartelera-banner__content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0;
}

/* ==================== FOOTER ==================== */

.app-footer {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
}

.app-footer__content {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.app-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.app-footer__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.app-footer__links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.app-footer__links a:hover {
  color: var(--primary-dark);
}

/* ==================== CHAT WIDGET ==================== */

.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  max-height: 500px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpFade 0.4s ease-out;
}

.chat-widget__header {
  padding: 14px 18px;
  background: var(--primary-gradient);
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  user-select: none;
  flex-shrink: 0;
}

.chat-widget__header:hover {
  opacity: 0.95;
}

.chat-widget__body {
  display: flex;
  flex-direction: column;
  height: 380px;
}

.chat-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-accent);
}

.chat-widget__msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  max-width: 85%;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  line-height: 1.4;
  animation: slideIn 0.3s ease-out;
}

.chat-widget__msg--own {
  align-self: flex-end;
  background: var(--primary-gradient);
  color: white;
  border: none;
}

.chat-widget__msg-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-widget__msg--own .chat-widget__msg-meta {
  color: rgba(255, 255, 255, 0.75);
}

.chat-widget__form {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}

.chat-widget__form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.9rem;
  color: var(--text);
}

.chat-widget__form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 92, 92, 0.12);
}

.chat-widget__form button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: white;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-widget__form button:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ==================== DRAG & DROP ==================== */

.evento-card[draggable="true"] {
  cursor: grab;
}

.evento-card[draggable="true"]:active {
  cursor: grabbing;
}

.evento-card[draggable="true"]:hover::after {
  content: "↔";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-accent); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #585c5c; }

/* ==================== CHAT WIDGET PROFESSIONAL ==================== */

.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  max-height: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  animation: slideUpFade 0.4s ease-out;
}

.chat-widget--collapsed {
  width: auto;
  max-height: 56px;
  flex-direction: column;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.chat-widget--collapsed .chat-widget__sidebar,
.chat-widget--collapsed .chat-widget__body {
  display: none !important;
}

.chat-widget__sidebar {
  width: 160px;
  background: var(--bg-accent);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-widget__sidebar-header {
  padding: 14px 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--primary-gradient);
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-widget__sidebar-search {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-widget__sidebar-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  background: var(--panel);
}

.chat-widget__sidebar-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
}

.chat-widget__contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.chat-widget__contact:hover {
  background: rgba(255,255,255,0.6);
}

.chat-widget__contact--active {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chat-widget__contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-widget__contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-widget__contact-info strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-widget__contact-info span {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-widget__contact-badge {
  position: absolute;
  top: 8px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.chat-widget__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-widget__header {
  padding: 14px 16px;
  background: var(--primary-gradient);
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  user-select: none;
  flex-shrink: 0;
}

.chat-widget__header:hover {
  opacity: 0.95;
}

.chat-widget__body {
  display: flex;
  flex-direction: column;
  height: 400px;
}

.chat-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-accent);
}

.chat-widget__msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  max-width: 85%;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  line-height: 1.4;
  animation: slideIn 0.3s ease-out;
}

.chat-widget__msg--own {
  align-self: flex-end;
  background: var(--primary-gradient);
  color: white;
  border: none;
}

.chat-widget__msg-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-widget__msg--own .chat-widget__msg-meta {
  color: rgba(255, 255, 255, 0.75);
}

.chat-widget__msg-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-widget__form {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}

.chat-widget__form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.9rem;
  color: var(--text);
}

.chat-widget__form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 92, 92, 0.12);
}

.chat-widget__form button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: white;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-widget__form button:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ==================== CHARTS ==================== */

.chart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  animation: slideUpFade 0.5s ease-out;
}

.chart-panel h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 700;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-bar {
  transition: opacity var(--transition-fast);
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.85;
}

.chart-label {
  font-size: 0.75rem;
  fill: var(--muted);
  font-weight: 600;
}

.chart-value {
  font-size: 0.75rem;
  fill: var(--text);
  font-weight: 700;
}

.chart-tick {
  font-size: 0.7rem;
  fill: var(--muted);
}

/* ==================== TOOLBAR / SEARCH ==================== */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.toolbar input[type="text"],
.toolbar input[type="search"],
.toolbar select {
  width: auto;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.9rem;
}

.toolbar form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ==================== MASS ACTIONS ==================== */

.mass-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-accent);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ==================== CONFIG PANEL ==================== */

.config-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  animation: slideUpFade 0.5s ease-out;
}

.config-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.config-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-accent);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.config-item strong {
  font-size: 0.9rem;
  color: var(--text);
}

.config-item span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==================== RESPONSIVE CHAT ==================== */

@media (max-width: 640px) {
  .chat-widget {
    width: calc(100% - 24px);
    right: 12px;
    bottom: 12px;
    max-height: 70vh;
  }
  .chat-widget__sidebar {
    width: 130px;
  }
  .chat-widget__body {
    height: 320px;
  }
}

@media (max-width: 480px) {
  .chat-widget {
    flex-direction: column;
    width: calc(100% - 24px);
  }
  .chat-widget__sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 140px;
  }
  .chat-widget__body {
    height: 280px;
  }
}
