:root {
  --md-sys-color-primary: #006874;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #97f0ff;
  --md-sys-color-on-primary-container: #001f24;
  --md-sys-color-secondary: #4a6267;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #cde7ec;
  --md-sys-color-on-secondary-container: #051f23;
  --md-sys-color-surface: #fafdfe;
  --md-sys-color-on-surface: #191c1d;
  --md-sys-color-surface-variant: #dbe4e6;
  --md-sys-color-on-surface-variant: #3f484a;
  --md-sys-color-outline: #6f797a;
  --md-sys-color-outline-variant: #bfc8ca;
  --md-sys-color-background: #f4f7f8;
  --md-sys-color-on-background: #191c1d;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f4f7f8;
  --md-sys-color-surface-container: #eef1f2;
  --md-sys-color-surface-container-high: #e8ebec;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-surface);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top Bar ── */
.top-bar {
  height: 64px;
  background: var(--md-sys-color-surface-container-high);
  display: flex; align-items: center;
  padding: 0 8px 0 16px; gap: 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.top-bar-title { font-size: 22px; font-weight: 400; flex: 1; }
.top-bar-title strong { color: var(--md-sys-color-primary); }
.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--md-sys-color-on-surface-variant);
  padding: 4px 12px; border-radius: 20px;
  background: var(--md-sys-color-surface-container);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4caf50; }
.status-dot.err { background: var(--md-sys-color-error); }

/* ── Layout ── */
.layout { flex: 1; display: flex; overflow: hidden; }

/* ── Nav Rail ── */
.nav-rail {
  width: 80px;
  background: var(--md-sys-color-surface-container-low);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 4px; flex-shrink: 0;
  border-right: 1px solid var(--md-sys-color-outline-variant);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 64px; padding: 10px 0; border-radius: 16px;
  cursor: pointer; border: none; background: transparent;
  color: var(--md-sys-color-on-surface-variant); transition: background .15s;
  font-family: inherit;
}
.nav-item:hover { background: var(--md-sys-color-surface-container); }
.nav-item.active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.nav-item .icon { font-size: 24px; }
.nav-item .label { font-size: 12px; font-weight: 500; }

/* ── Content ── */
.content-area { flex: 1; display: flex; overflow: hidden; }
.list-panel { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.section { display: none; flex-direction: column; gap: 20px; }
.section.active { display: flex; }

.section-header { display: flex; align-items: center; gap: 12px; }
.section-header .icon { font-size: 32px; color: var(--md-sys-color-primary); }
.section-header h1 { font-size: 28px; font-weight: 400; flex: 1; }

/* ── Stats ── */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 140px;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px; padding: 16px 20px;
}
.stat-number { font-size: 36px; font-weight: 300; color: var(--md-sys-color-primary); }
.stat-label { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

/* ── Cards ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card {
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px; padding: 16px 20px;
  cursor: pointer; transition: box-shadow .2s, border-color .2s, background .2s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: var(--md-sys-color-outline); }
.card.selected { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); }
.card.selected .card-sub { color: var(--md-sys-color-on-primary-container); opacity: .7; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 8px; }
.card-top > div:first-child { min-width: 0; flex: 1; }
.card-title { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.card-footer { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); font-family: monospace; margin-top: 10px; }
.card-footer .icon { font-size: 14px; }
.card-actions { display: flex; gap: 4px; margin-top: 12px; justify-content: flex-end; }
.card-excerpt { font-family: 'Roboto Mono', monospace; font-size: 11px; color: var(--md-sys-color-on-surface-variant); line-height: 1.5; margin-top: 8px; white-space: pre-wrap; overflow: hidden; max-height: 60px; }

/* ── Chips ── */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; border: 1px solid currentColor; white-space: nowrap; flex-shrink: 0; }
.chip-ACTIVO    { color: #1b5e20; background: #e8f5e9; border-color: #81c784; }
.chip-BORRADOR  { color: #e65100; background: #fff3e0; border-color: #ffb74d; }
.chip-INACTIVO  { color: #37474f; background: #eceff1; border-color: #90a4ae; }
.chip-SUSPENDIDO{ color: #b71c1c; background: #ffebee; border-color: #ef9a9a; }
.chip-MAESTRE   { color: #1a237e; background: #e8eaf6; border-color: #7986cb; }
.chip-Maestre   { color: #1a237e; background: #e8eaf6; border-color: #7986cb; }
.chip-COMENDADOR{ color: #4a148c; background: #f3e5f5; border-color: #ba68c8; }
.chip-Comendador{ color: #4a148c; background: #f3e5f5; border-color: #ba68c8; }
.chip-true    { color: #1b5e20; background: #e8f5e9; border-color: #81c784; }
.chip-false   { color: #37474f; background: #eceff1; border-color: #90a4ae; }
.chip-Activo  { color: #1b5e20; background: #e8f5e9; border-color: #81c784; }
.chip-Inactivo{ color: #37474f; background: #eceff1; border-color: #90a4ae; }
.chip-Expirado{ color: #b71c1c; background: #ffebee; border-color: #ef9a9a; }
.chip-Agotado { color: #e65100; background: #fff3e0; border-color: #ffb74d; }
.chip-tipo-Onboarding { color: #1a237e; background: #e8eaf6; border-color: #7986cb; }
.chip-tipo-Promo      { color: #4a148c; background: #f3e5f5; border-color: #ba68c8; }
.chip-tipo-Reward     { color: #1b5e20; background: #e8f5e9; border-color: #81c784; }
/* EstadoOrden */
.chip-Pendiente       { color: #e65100; background: #fff3e0; border-color: #ffb74d; }
.chip-Aprobada        { color: #1b5e20; background: #e8f5e9; border-color: #81c784; }
.chip-Rechazada       { color: #b71c1c; background: #ffebee; border-color: #ef9a9a; }
.chip-Expirada        { color: #b71c1c; background: #ffebee; border-color: #ef9a9a; }
.chip-En-conflicto    { color: #b71c1c; background: #ffebee; border-color: #ef9a9a; }
/* ProveedorPago */
.chip-MercadoPago     { color: #1565c0; background: #e3f2fd; border-color: #64b5f6; }
.chip-PayPal          { color: #1565c0; background: #e3f2fd; border-color: #64b5f6; }
.chip-Manual          { color: #37474f; background: #eceff1; border-color: #90a4ae; }
/* EstadoActivo */
.chip-Borrador             { color: #e65100; background: #fff3e0; border-color: #ffb74d; }
.chip-Archivada            { color: #37474f; background: #eceff1; border-color: #90a4ae; }
.chip-Operación-exitosa    { color: #1b5e20; background: #e8f5e9; border-color: #81c784; }
.chip-Operación-fallida    { color: #b71c1c; background: #ffebee; border-color: #ef9a9a; }
.chip-Suspendida-por-pago  { color: #7b1fa2; background: #f3e5f5; border-color: #ba68c8; }
/* OperacionActivo */
.chip-Alquiler        { color: #1565c0; background: #e3f2fd; border-color: #64b5f6; }
.chip-Compraventa     { color: #4a148c; background: #f3e5f5; border-color: #ba68c8; }

/* ── Context Bar ── */
.ctx-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px; min-height: 40px; flex-shrink: 0;
  background: var(--md-sys-color-secondary-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.ctx-bar--hidden { display: none; }
.ctx-bar-icon { font-size: 16px; color: var(--md-sys-color-on-secondary-container); opacity: .7; }
.ctx-bar-label { font-size: 12px; font-weight: 500; color: var(--md-sys-color-on-secondary-container); opacity: .7; flex-shrink: 0; }
.ctx-chips-wrap { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 20px; padding: 2px 6px 2px 8px;
  font-size: 12px; font-weight: 500;
}
.ctx-chip .material-symbols-outlined { font-size: 14px; color: var(--md-sys-color-primary); }
.ctx-chip-close {
  border: none; background: transparent; cursor: pointer;
  padding: 0 2px; font-size: 16px; line-height: 1;
  color: var(--md-sys-color-on-surface-variant); margin-left: 2px;
}
.ctx-chip-close:hover { color: var(--md-sys-color-error); }
.ctx-clear-btn {
  display: flex; align-items: center; gap: 4px;
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 12px; color: var(--md-sys-color-on-secondary-container); opacity: .7;
  padding: 4px 8px; border-radius: 8px;
}
.ctx-clear-btn:hover { background: rgba(0,0,0,.08); opacity: 1; }
.ctx-clear-btn .material-symbols-outlined { font-size: 14px; }

/* ── Pin Button ── */
.pin-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 2px; border-radius: 4px; display: flex; align-items: center;
  color: var(--md-sys-color-on-surface-variant); opacity: .4;
  transition: opacity .15s, color .15s;
}
.pin-btn:hover { opacity: .9; }
.pin-btn .material-symbols-outlined { font-size: 16px; }
.pin-btn--active { color: var(--md-sys-color-primary); opacity: 1; font-variation-settings: 'FILL' 1; }

/* ── Data Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 10px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.data-table td { padding: 10px 10px; border-bottom: 1px solid var(--md-sys-color-outline-variant); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── States ── */
.state-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 64px 32px; color: var(--md-sys-color-on-surface-variant); text-align: center; }
.state-box .icon { font-size: 48px; opacity: .4; }
.state-box p { font-size: 15px; }

/* ── Detail panel ── */
.detail-panel {
  width: 440px; min-width: 440px;
  background: var(--md-sys-color-surface-container-lowest);
  border-left: 1px solid var(--md-sys-color-outline-variant);
  display: flex; flex-direction: column; overflow: hidden;
  transition: min-width .25s, width .25s;
}
.detail-panel.closed { width: 0; min-width: 0; border-left: none; }

.detail-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-shrink: 0;
  background: var(--md-sys-color-surface-container);
}
.detail-title { font-size: 17px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; min-width: 440px; }

.d-section { display: flex; flex-direction: column; gap: 10px; }
.d-section-title {
  font-size: 11px; font-weight: 500; color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase; letter-spacing: .08em;
  padding-bottom: 6px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex; align-items: center; gap: 8px;
}
.d-section-title span { flex: 1; }
.d-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 14px; }
.d-label { color: var(--md-sys-color-on-surface-variant); flex-shrink: 0; }
.d-value { font-weight: 500; text-align: right; word-break: break-all; }
.d-value.mono { font-family: 'Roboto Mono', monospace; font-size: 12px; font-weight: 400; }

/* ── Saldo ── */
.saldo-box { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border-radius: 16px; padding: 24px; text-align: center; }
.saldo-number { font-size: 56px; font-weight: 300; line-height: 1; }
.saldo-unit { font-size: 14px; opacity: .75; margin-top: 4px; }
.bolsa-row { display: flex; justify-content: space-between; align-items: center; background: var(--md-sys-color-surface-container); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.bolsa-info { display: flex; flex-direction: column; gap: 2px; }
.bolsa-monto { font-weight: 500; }
.bolsa-fecha { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.bolsa-restante { font-size: 20px; font-weight: 500; color: var(--md-sys-color-primary); }
.inst-row { display: flex; flex-direction: column; gap: 4px; background: var(--md-sys-color-surface-container); border-radius: 8px; padding: 10px 14px; border-left: 3px solid var(--md-sys-color-primary); font-size: 13px; }
.inst-heraldo { font-weight: 500; }
.inst-uuid { font-family: 'Roboto Mono', monospace; font-size: 11px; color: var(--md-sys-color-on-surface-variant); word-break: break-all; }

/* ── Instruction editor ── */
.inst-editor {
  width: 100%;
  min-height: 280px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  color: var(--md-sys-color-on-surface);
  line-height: 1.6;
  transition: border-color .2s;
}
.inst-editor:focus { outline: none; border-color: var(--md-sys-color-primary); border-width: 2px; }

.field-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.field-label { font-size: 12px; color: var(--md-sys-color-on-surface-variant); font-weight: 500; }
.field-select {
  width: 100%;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
}
.field-select:focus { outline: 2px solid var(--md-sys-color-primary); }
.field-input {
  width: 100%;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'Roboto Mono', monospace;
  color: var(--md-sys-color-on-surface);
}
.field-input:focus { outline: 2px solid var(--md-sys-color-primary); }

/* ── Version history ── */
.version-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--md-sys-color-surface-container);
  cursor: pointer;
  transition: background .15s;
}
.version-row:hover { background: var(--md-sys-color-surface-container-high); }
.version-row.is-head { border-left: 3px solid var(--md-sys-color-primary); }

.version-badge {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.version-head-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.version-excerpt { font-size: 12px; color: var(--md-sys-color-on-surface-variant); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Version expanded content */
.version-preview {
  display: none;
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--md-sys-color-surface-container-low);
  border-radius: 6px;
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant);
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}
.version-container.expanded .version-preview { display: block; }
.version-container.expanded .version-row { background: var(--md-sys-color-surface-container-high); }

/* ── Token grid (proveedor card) ── */
.prov-token-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 4px;
}
.prov-token-cell {
  background: var(--md-sys-color-surface-container);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prov-token-label {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  gap: 3px;
}
.prov-token-val {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  font-family: 'Roboto Mono', monospace;
}

/* ── Card action buttons ── */
.btn-card {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--md-sys-color-outline);
  background: transparent; cursor: pointer;
  font-family: inherit; font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  transition: background .15s;
}
.btn-card:hover { background: var(--md-sys-color-surface-container); }
.btn-card .icon { font-size: 16px; line-height: 1; }
.btn-card.danger {
  border-color: var(--md-sys-color-error);
  color: var(--md-sys-color-error);
}
.btn-card.danger:hover { background: var(--md-sys-color-error-container); }

/* ── Dialog ── */
md-dialog {
  --md-dialog-container-min-inline-size: min(480px, 94vw);
  --md-dialog-container-max-inline-size: min(540px, 94vw);
  --md-dialog-container-max-block-size: 92dvh;
}
md-dialog form { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
md-outlined-text-field { width: 100%; }

.form-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
  margin: 4px 0 0;
}
.form-section-label .material-symbols-outlined { font-size: 15px; }

.form-section-divider {
  height: 1px;
  background: var(--md-sys-color-outline-variant);
  margin: 8px 0 4px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

.dialog-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  padding: 10px 16px;
  margin-top: 4px;
}
.dialog-switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
}
.dialog-switch-label .material-symbols-outlined {
  font-size: 18px;
  color: var(--md-sys-color-on-surface-variant);
}

/* ── Generic button ── */
.button {
  padding: 6px 15pt;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

/* ── Chat ── */
.detail-body.chat-mode {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-input-area {
  flex-shrink: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--md-sys-color-surface-container-low);
}
.chat-textarea {
  flex: 1;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
}
.chat-textarea:focus { outline: 2px solid var(--md-sys-color-primary); border-color: transparent; }
.chat-group { display: flex; flex-direction: column; }
.chat-group.dueno  { align-items: flex-end; }
.chat-group.sistema { align-items: flex-start; }
.chat-group.broadcast { align-items: center; }
.chat-bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-bubble.dueno {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-bottom-right-radius: 4px;
}
.chat-bubble.sistema {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-bottom-left-radius: 4px;
}
.chat-bubble.broadcast {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-size: 12px;
  border-radius: 8px;
}
.chat-meta {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
  padding: 0 4px;
}
.chat-meta.dueno { text-align: right; }
.chat-meta.sistema { text-align: left; }
.chat-meta.broadcast { text-align: center; }

/* ── Cupones ── */
.cupon-tabs {
  display: flex; gap: 4px;
  margin-bottom: 16px;
  background: var(--md-sys-color-surface-container);
  padding: 4px; border-radius: 12px; width: fit-content;
}
.cupon-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px;
  border: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--md-sys-color-on-surface-variant); background: transparent; transition: background .15s;
}
.cupon-tab .material-symbols-outlined { font-size: 18px; }
.cupon-tab.active { background: var(--md-sys-color-surface-container-lowest); color: var(--md-sys-color-on-surface); }
.cupon-tab:hover:not(.active) { background: var(--md-sys-color-surface-container-high); }

.cupon-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px;
}
.cupon-stat {
  background: var(--md-sys-color-surface-container);
  border-radius: 12px; padding: 12px 16px; text-align: center;
}
.cupon-stat-num   { font-size: 26px; font-weight: 700; color: var(--md-sys-color-primary); }
.cupon-stat-label { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

.codigo-row {
  background: var(--md-sys-color-surface-container);
  border-radius: 10px; padding: 12px; margin-bottom: 8px;
}
.codigo-row-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
}
.codigo-str { font-size: 14px; font-weight: 600; color: var(--md-sys-color-primary); }
.codigo-row-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 8px;
}
.codigo-progress-bar {
  height: 4px; background: var(--md-sys-color-outline-variant); border-radius: 4px; overflow: hidden;
}
.codigo-progress-fill {
  height: 100%; background: var(--md-sys-color-primary); border-radius: 4px; transition: width .3s;
}

/* ── Material Web buttons ── */
md-filled-button, md-text-button {
  --md-filled-button-leading-space: 20px;
  --md-filled-button-trailing-space: 20px;
  --md-text-button-leading-space: 20px;
  --md-text-button-trailing-space: 20px;
}
md-outlined-button {
  --md-outlined-button-leading-space: 20px;
  --md-outlined-button-trailing-space: 20px;
}
md-filled-button::part(button),
md-outlined-button::part(button) {
  padding-inline: 20px;
}
