@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --brand: #B3126A;
  --brand-dark: #3B0A2A;
  --heading: #3B0A2A;
  --section: #5C1540;
  --brand-lilac: #C77DB5;
  --brand-coral: #E25B6A;
  --brand-soft: #FCE9F2;
  --ink: #2B2B2B;
  --text: #2B2B2B;
  --muted: #6B5A62;
  --line: #F3D5E4;
  --canvas: #FFF7FA;
  --surface: #FFFFFF;
  --green: #2F7D4A;
  --red: #E25B6A;
  --mint: #2F7D4A;
  --teal: #C2186B;
  --shadow: 0 10px 30px rgba(142, 16, 80, 0.07);
  --font: "Inter", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
h1, .page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 32px);
  color: var(--heading);
  line-height: 1.2;
  margin: 0;
}
h2, .card h2 {
  font-size: 18px;
  color: var(--section);
  margin: 0 0 12px;
}
a { color: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--brand-dark);
  color: #fff;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  padding: 4px 8px 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), var(--brand-coral));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand strong,
.brand small { display: block; }
.brand strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand small {
  font-size: 11px;
  color: var(--brand-lilac);
  margin-top: 4px;
  font-weight: 500;
}

.nav { margin-top: 18px; }
.nav p {
  margin: 18px 10px 7px;
  color: var(--brand-lilac);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav a,
.nav-disabled {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin: 2px 0;
}
.nav a { color: rgba(255, 255, 255, 0.88); }
.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nav a.active {
  box-shadow: inset 3px 0 0 var(--brand-coral);
}
.nav-disabled { color: rgba(255, 255, 255, 0.38); }

.sidebar-user {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px 6px 4px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 9px;
  align-items: center;
}
.sidebar-user strong,
.sidebar-user small { display: block; font-size: 12px; }
.sidebar-user small { color: var(--brand-lilac); }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}
.sidebar .avatar {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.link-button,
button.link-button {
  border: 0;
  background: none;
  color: var(--brand-lilac);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  box-shadow: none;
}
.sidebar .link-button:hover { color: #fff; }
.nav-backdrop { display: none; }

.workspace {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 68px;
  padding: 12px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-open-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  place-content: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-open-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--brand-dark);
  border-radius: 2px;
}
.topbar-search {
  flex: 1;
  min-width: 0;
}
.topbar-search input {
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--line);
  background: var(--canvas);
  border-radius: 999px;
  padding: 11px 16px 11px 18px;
  font: inherit;
  color: var(--ink);
}
.topbar-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 30%, white);
  border-color: var(--brand);
  background: #fff;
}
.topbar-context {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.topbar-alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-dark);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.topbar-alert svg { width: 18px; height: 18px; color: var(--brand); }
.topbar-alert:hover {
  border-color: var(--brand-lilac);
  background: var(--brand-soft);
}
.alert-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-coral);
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.topbar-sucursal {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-caja { flex-shrink: 0; }
.scan-form { display: grid; gap: 12px; margin-top: 12px; }
.scan-camera { margin-top: 18px; }
.scan-camera video {
  display: none;
  width: 100%;
  max-height: 240px;
  background: #1a0b12;
  border-radius: 12px;
}
.scan-camera video.is-on { display: block; }
.qr-box-lg img { width: 180px; height: 180px; }
.qr-box-lg small { display: block; margin-top: 6px; word-break: break-all; font-size: 11px; }
.consulta-card .stats { grid-template-columns: 1fr 1fr; margin-top: 16px; }

.main { min-width: 0; flex: 1; }
.page { padding: 28px 32px 40px; max-width: 1500px; margin: auto; }

.page-header,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 7px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 11px;
  font-weight: 800;
  color: var(--brand);
}
h1, h2 {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: clamp(28px, 3vw, 32px); color: var(--heading); }
h2 { font-size: 18px; color: var(--section); }
.muted { color: var(--muted); font-size: 14px; }

.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat,
.card {
  background: #FFFFFF;
  border: 1px solid #F3D5E4;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.stat {
  position: relative;
  overflow: hidden;
  padding-left: 22px;
}
.stat:before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
}
.stat:nth-child(2):before { background: var(--brand-lilac); }
.stat:nth-child(3):before { background: var(--brand-coral); }
.stat:nth-child(4):before { background: var(--brand-dark); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-lilac);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.alert-banner strong,
.alert-banner small { display: block; }
.alert-banner small { color: var(--muted); margin-top: 4px; }
.alert-banner.warning { border-left-color: var(--brand); }
.alert-banner.critical { border-left-color: var(--brand-coral); background: #FFF5F6; }
.alert-banner.quiet { border-left-color: var(--brand-lilac); box-shadow: none; }

.two-columns,
.split { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr); }
.section-gap { margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}
.btn.primary,
button[type=submit] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn.primary:hover,
button[type=submit]:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ver {
  background: #fff;
  border: 1px solid #3B0A2A;
  color: #3B0A2A;
}
.btn-editar, .btn.btn-editar {
  background: #B3126A;
  color: #fff;
  border-color: #B3126A;
}
.btn-editar:disabled, .btn-editar[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.danger {
  background: #C62828;
  color: #fff;
  border-color: #C62828;
}
.ver-editar { display: flex; gap: 8px; flex-wrap: wrap; }
.ficha-lectura { font-size: 16px; line-height: 1.7; }
.ficha-lectura h2 { margin-top: 20px; }
.full { width: 100%; }

.action-list a,
.actions a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 9px;
  background: var(--canvas);
}
.action-list a:hover,
.actions a:hover { border-color: var(--brand-lilac); background: var(--brand-soft); }
.action-list small,
.actions small { display: block; color: var(--muted); margin-top: 3px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
th {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.positive, .pos { color: var(--green); font-weight: 700; }
.negative, .neg { color: var(--red); font-weight: 700; }
.empty { text-align: center; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); }

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, #F7D7EA, transparent 42%),
    radial-gradient(circle at bottom left, #FAD4D8, transparent 36%),
    var(--canvas);
}
.login-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(142, 16, 80, 0.12);
}
.login-brand { padding: 0; margin-bottom: 32px; }
.login-page .brand { color: var(--ink); }
.login-page .brand small { color: var(--muted); }
.form-stack { display: grid; gap: 16px; margin-top: 24px; }
.form-stack label { font-size: 13px; font-weight: 700; }
.form-stack input {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}
.alert {
  background: #FFF1F3;
  color: var(--red);
  padding: 11px;
  border-radius: 9px;
}
.technical-link {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .app-shell:has(.nav-open:checked) .sidebar { transform: none; }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(59, 36, 48, 0.38);
  }
  .app-shell:has(.nav-open:checked) .nav-backdrop { display: block; }
  .nav-open-btn { display: grid; }
  .nav { display: block; }
  .nav p, .nav-disabled { display: block; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-columns, .split { grid-template-columns: 1fr; }
  .topbar-alert-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body, .btn, input, select, textarea, th, td, .muted { font-size: 16px !important; }
}

@media (max-width: 600px) {
  .page { padding: 20px 14px; }
  .app-topbar { padding: 10px 14px; }
  .page-header, .topbar { display: block; }
  .page-header .btn, .topbar .btn { margin-top: 15px; }
  .stats { grid-template-columns: 1fr; }
  .alert-banner { flex-direction: column; align-items: flex-start; }
}

.button-row { display: flex; gap: 9px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.toolbar input {
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
}
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.row-actions a,
.card-title a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
}
.badge.success { background: #eaf8f1; color: var(--green); }
.badge.warning { background: #F8E7F3; color: var(--brand-dark); }
.muted-badge { color: var(--muted); background: #F6EEF2; }
td small,
.record small { display: block; color: var(--muted); margin-top: 3px; }
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.record {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.record:last-child { border: 0; }
.notice {
  background: #eaf8f1;
  color: #126341;
  border: 1px solid #c7ead9;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.notice.error {
  background: #FFF7F8;
  color: #9B1C2A;
  border-color: #F7C7CD;
}
.notice.info, .notice.warning {
  background: #FFF8EE;
  color: #8E1050;
  border-color: #F1D4E2;
}
.caja-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}
.caja-meta code { font-size: 12px; }
.caja-matches { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.caja-matches a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
}
.caja-matches a span { color: var(--muted); font-size: 12px; }
.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #F7C7CD;
  background: #FFF7F8;
  border-radius: 14px;
}
.btn.danger { color: var(--red); border-color: #F3AAA3; }
.form-card { max-width: 820px; }
.data-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: #fff;
}
.field textarea,
.field:has(textarea),
.field:has(input[type=file]) { grid-column: 1 / -1; }
.field-check { flex-direction: row; align-items: center; }
.field-check input { width: auto; }
.field small { color: var(--muted); font-weight: 400; }
.field-error { color: var(--red) !important; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.money-row,
.money-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.money-row.deduction { color: var(--red); }
.money-total { font-size: 19px; border-bottom: 0; margin-top: 5px; }
.summary {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  margin: 18px 0;
}
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; }
.confirm-box { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; }

@media (max-width: 760px) {
  .detail-grid, .data-form { grid-template-columns: 1fr; }
  .toolbar { display: grid; }
  .toolbar input { min-width: 0; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
}

.ai-disclosure {
  padding: 17px 19px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
}
.ai-disclosure p { margin: 5px 0 0; color: #FAD9EC; }
.ai-layout { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr); }
.capability-grid { display: grid; gap: 8px; margin-top: 17px; }
.capability {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.capability-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
}
.capability small { display: block; color: var(--muted); margin-top: 3px; }
.badge.critical { background: #FFF0F2; color: var(--brand-coral); }
.empty-state { text-align: center; padding: 35px; color: var(--muted); }
.empty-state strong { color: var(--ink); }

@media (max-width: 900px) {
  .ai-layout { grid-template-columns: 1fr; }
}

.loyalty-levels { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.level-stat {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 17px;
  box-shadow: var(--shadow);
}
.level-stat:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--level-color);
}
.level-stat span,
.level-stat small { display: block; color: var(--muted); }
.level-stat strong { display: block; font-size: 25px; margin: 5px 0; }
.level-badge {
  color: var(--level-color);
  background: color-mix(in srgb, var(--level-color) 12%, white);
  border: 1px solid color-mix(in srgb, var(--level-color) 24%, white);
}
.customer-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: #fff;
  border-radius: 20px;
  padding: 26px;
  background: linear-gradient(125deg, var(--level-color), var(--brand-dark));
  box-shadow: 0 16px 35px color-mix(in srgb, var(--level-color) 24%, transparent);
}
.customer-hero p,
.customer-hero h2 { margin: 0 0 5px; }
.customer-hero .points { text-align: right; }
.customer-hero .points strong,
.customer-hero .points span { display: block; }
.customer-hero .points strong { font-size: 38px; }
.progress-heading { display: flex; justify-content: space-between; margin-bottom: 10px; }
.progress-track {
  height: 10px;
  overflow: hidden;
  background: #F6EEF2;
  border-radius: 999px;
}
.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-coral));
  border-radius: 999px;
}
.loyalty-card {
  width: min(640px, 100%);
  margin: 10px auto;
  padding: 28px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.25), transparent 25%),
    linear-gradient(135deg, var(--level-color), var(--brand-dark) 78%);
  box-shadow: 0 25px 60px color-mix(in srgb, var(--level-color) 30%, transparent);
}
.loyalty-brand { display: flex; align-items: center; gap: 10px; }
.loyalty-brand strong,
.loyalty-brand small { display: block; }
.loyalty-brand strong { font-family: var(--font-display); }
.loyalty-person { margin: 42px 0 28px; }
.loyalty-person p { font-size: 10px; letter-spacing: 0.15em; }
.loyalty-person h2 { font-size: 31px; color: #fff; }
.loyalty-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.loyalty-bottom > div > strong,
.loyalty-bottom > div > span { display: block; }
.loyalty-bottom > div > strong { font-size: 34px; }
.qr-box {
  background: #fff;
  padding: 8px;
  border-radius: 13px;
  color: #333;
  text-align: center;
}
.qr-box img { display: block; width: 115px; height: 115px; }
.qr-box small { font-size: 9px; }
.loyalty-progress-card { width: min(640px, 100%); margin: 18px auto; }
.level-rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rule-card { border-top: 5px solid var(--level-color); }

@media (max-width: 1000px) {
  .loyalty-levels { grid-template-columns: repeat(3, 1fr); }
  .level-rules { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .loyalty-levels, .level-rules { grid-template-columns: 1fr; }
  .customer-hero { align-items: flex-start; flex-direction: column; }
  .customer-hero .points { text-align: left; }
  .loyalty-card { padding: 20px; }
  .loyalty-person { margin: 30px 0; }
  .qr-box img { width: 90px; height: 90px; }
}

.stat small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; font-weight: 600; }
.ops-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.ops-filters label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.ops-filters input,
.ops-filters select {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.ops-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ops-mini { text-decoration: none; }
.ops-mini strong { display: block; font-size: 28px; margin: 8px 0 4px; letter-spacing: -0.03em; }
.ops-mini small { color: var(--muted); }
.ops-chart { position: relative; height: 240px; }
.ops-tablist { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.ops-tablist button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.ops-tablist button.is-on {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}
.ops-gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
.ops-gauge { display: flex; gap: 14px; align-items: center; }
.ops-gauge p { margin: 0; font-weight: 700; }
.ops-gauge small { color: var(--muted); font-weight: 600; }
.ring {
  --pct: 0;
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), #F1D4E2 0);
  display: grid;
  place-items: center;
}
.ring:after {
  content: "";
  position: absolute;
  inset: 12px;
  background: #fff;
  border-radius: 50%;
}
.ring strong { position: relative; z-index: 1; font-size: 16px; }
.ops-mix {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.ops-mix small { display: block; color: var(--muted); }
.ops-mix-bar {
  height: 10px;
  background: #F6EEF2;
  border-radius: 999px;
  overflow: hidden;
}
.ops-mix-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-lilac));
  border-radius: 999px;
}
@media (max-width: 1000px) {
  .ops-cards, .ops-gauges { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .ops-cards, .ops-gauges, .stats { grid-template-columns: 1fr; }
  .ops-mix { grid-template-columns: 1fr; }
}

.prod-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.prod-toolbar input,
.prod-toolbar select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  min-width: 160px;
}
.prod-toolbar input { flex: 1; min-width: 220px; }
.prod-table th a { color: var(--brand-dark); text-decoration: none; }
.prod-table th:last-child,
.prod-table td.prod-actions { text-align: right; }
.prod-row { cursor: pointer; }
.prod-row:hover { background: var(--brand-soft); }
.prod-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
}
.prod-hero {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  display: grid;
  place-items: center;
  min-height: 180px;
  font-size: 42px;
  font-weight: 800;
  color: var(--brand);
  background: var(--brand-soft);
}
.prod-actions { white-space: nowrap; }
.icon-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: #3B2430;
  text-decoration: none;
  box-sizing: border-box;
}
.icon-btn svg { width: 15px; height: 15px; display: block; }
.icon-btn:hover {
  color: #C2186B;
  border-color: #C2186B;
}
.icon-btn-danger:hover {
  color: #E25B6A;
  border-color: #E25B6A;
}
.prod-pager {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.prod-dl { display: grid; gap: 10px; margin: 0; }
.prod-dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.prod-dl dt { color: var(--muted); font-weight: 700; }
.prod-dl dd { margin: 0; font-weight: 700; }

.rich-source { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rich-wrap {
  grid-column: 1 / -1;
  border: 1px solid #F3D5E4;
  border-radius: 10px;
  background: #fff;
  overflow: visible;
}
.rich-wrap .ql-toolbar.ql-snow {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #F3D5E4;
  flex-wrap: wrap;
  padding: 8px 10px;
}
.rich-wrap .ql-container.ql-snow { border: 0; font-family: "Open Sans", sans-serif; font-size: 16px; min-height: 180px; }
.rich-wrap .ql-editor { min-height: 160px; font-family: "Open Sans", sans-serif; font-size: 16px; line-height: 1.6; }
.ql-font-open-sans { font-family: "Open Sans", sans-serif; }
.ql-font-inter { font-family: Inter, sans-serif; }
.ql-font-fraunces { font-family: Fraunces, Georgia, serif; }
.ql-font-georgia { font-family: Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="open-sans"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="open-sans"]::before { content: "Open Sans"; font-family: "Open Sans", sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="inter"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="inter"]::before { content: "Inter"; font-family: Inter, sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="fraunces"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="fraunces"]::before { content: "Fraunces"; font-family: Fraunces, Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="georgia"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="georgia"]::before { content: "Georgia"; font-family: Georgia, serif; }
.ql-snow .ql-picker.ql-header .ql-picker-label::before { content: "Párrafo"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before { content: "H1"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before { content: "H2"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before { content: "H3"; }
.ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Párrafo"; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { content: "H1"; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "H2"; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "H3"; }
.rich-view {
  font-family: "Open Sans", Inter, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: #2B2B2B;
}
.rich-view h1 { font-size: 32px; color: #3B0A2A; margin: 0 0 12px; }
.rich-view h2 { font-size: 24px; color: #5C1540; margin: 16px 0 10px; }
.rich-view h3 { font-size: 20px; color: #5C1540; margin: 14px 0 8px; }
.rich-view p { margin: 0 0 10px; }
.rich-view ul, .rich-view ol { margin: 0 0 12px 1.2em; }
@media (max-width: 720px) {
  .rich-wrap .ql-toolbar.ql-snow { position: sticky; top: 0; }
  .rich-wrap .ql-toolbar .ql-formats { margin-right: 8px; }
  .rich-wrap .ql-editor { font-size: 16px; }
}
