:root {
  --bg: #f5f7f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --green: #14a44d;
  --green-dark: #0c7a38;
  --black: #0b0f14;
  --danger: #c62828;
  --warning: #b7791f;
  --blue: #1d4ed8;
  --shadow: 0 12px 30px rgba(15, 23, 42, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }

.topbar {
  height: 74px;
  background: var(--black);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left, .topbar-right, .hero-row, .panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar h1 { font-size: 18px; margin: 0; }
.topbar .eyebrow { color: #a7f3d0; }

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -2px;
  background: var(--green);
  color: white;
}

.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: 14px; }

.eyebrow {
  margin: 0 0 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--green-dark);
}

.muted { color: var(--muted); }
.page-shell { max-width: 1500px; margin: 0 auto; padding: 28px; }

.hero-row {
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
}
.hero-row h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 34px); }
.hero-row p { margin-top: 0; }

.refresh-box { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { background: var(--green); color: white; }
.btn.primary:hover { background: var(--green-dark); }
.btn.secondary { background: #e8f7ee; color: var(--green-dark); }
.btn.ghost { background: rgba(255,255,255,.09); color: white; }
.btn.small { padding: 8px 10px; font-size: 12px; }

.user-pill {
  color: #d1d5db;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.15);
  padding: 8px 10px;
  border-radius: 999px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.status-card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.status-card { padding: 18px; min-height: 124px; }
.status-card strong { display: block; font-size: 26px; margin: 10px 0 4px; }
.status-card small { color: var(--muted); }
.status-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.online { color: var(--green-dark); }
.offline { color: var(--danger); }

.event-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.event-chip {
  background: white;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.event-chip strong { margin-left: 6px; }

.panel { padding: 20px; margin-bottom: 14px; }
.panel-head { justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 19px; }

.filters { display: flex; gap: 8px; }
.filters input, .filters select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 190px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 13px 10px;
  border-bottom: 1px solid #f0f1f2;
  vertical-align: middle;
  font-size: 13px;
}
tr:last-child td { border-bottom: 0; }
.product-name { max-width: 360px; font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}
.badge.NUEVO { background: #dcfce7; color: #166534; }
.badge.REINGRESO { background: #dbeafe; color: #1e40af; }
.badge.AGOTADO { background: #fee2e2; color: #991b1b; }
.badge.PRECIO, .badge.PRECIO_Y_STOCK { background: #fef3c7; color: #92400e; }
.badge.STOCK { background: #ede9fe; color: #5b21b6; }

.seo-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.seo-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: #fbfdfb;
}
.seo-card h4 { margin: 7px 0 8px; font-size: 14px; }
.seo-card .meta { color: var(--muted); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.seo-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-list { display: grid; gap: 8px; }
.mini-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.mini-row .danger { color: var(--danger); }

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

footer {
  display: flex;
  gap: 22px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 4px 30px;
}

.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0b0f14, #12361f);
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-shell { width: 100%; max-width: 430px; }
.login-card {
  background: white;
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
}
.login-card h1 { margin: 14px 0 8px; }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.login-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.alert.error {
  margin-top: 16px;
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .status-grid { grid-template-columns: repeat(3, 1fr); }
  .seo-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .page-shell { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar .topbar-left h1 { font-size: 15px; }
  .user-pill { display: none; }
  .hero-row { align-items: flex-start; flex-direction: column; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .seo-list, .two-col { grid-template-columns: 1fr; }
  .stacked-mobile { align-items: stretch; flex-direction: column; }
  .filters { flex-direction: column; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  footer { flex-direction: column; gap: 6px; }
}
