/* zero2hero admin — Descuentos (page-scoped) */

/* Drawer for create/edit form */
.disc-scrim {
  position: fixed;
  inset: 0;
  z-index: 1070;
  background: rgba(15, 11, 31, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.disc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1075;
  width: min(520px, 100vw);
  background: var(--adm-surface);
  border-left: 1px solid var(--adm-border);
  box-shadow: -20px 0 60px rgba(15, 11, 31, 0.25);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 0.26s ease, visibility 0s linear 0.26s;
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
}
.disc-drawer.is-open { transform: none; visibility: visible; transition: transform 0.26s ease, visibility 0s; }
.disc-scrim.is-open { opacity: 1; pointer-events: auto; }
.disc-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--adm-border);
  background: var(--adm-surface-2);
}
.disc-drawer__head h2 {
  font-family: var(--adm-font-head);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}
.disc-drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 1.1rem 1.15rem; }
.disc-drawer__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--adm-border);
  background: var(--adm-surface-2);
}
.disc-drawer__foot .disc-drawer__btns { display: flex; gap: 0.5rem; margin-left: auto; }
body.disc-drawer-open { overflow: hidden; }

/* Code cell */
.disc-code {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--adm-font-mono);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--adm-text);
}
.disc-code .adm-act { min-height: 28px; padding: 0.1rem 0.45rem; font-size: 0.72rem; }
.disc-note {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--adm-muted);
  font-size: 0.76rem;
}
.disc-sub { color: var(--adm-muted); font-size: 0.76rem; }

/* Selected row (audit) */
body.adm-body .adm-content #discounts-tbody tr.is-selected > * { background: var(--adm-violet-soft); }
body.adm-body .adm-content #discounts-tbody tr.is-selected > *:first-child { box-shadow: inset 3px 0 0 var(--adm-violet); }
body.adm-body .adm-content #discounts-tbody tr.is-busy { opacity: 0.55; pointer-events: none; }
body.adm-body .adm-content #discounts-tbody .adm-cell-actions { white-space: normal; }
.disc-actions { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }

/* Audit header select */
.disc-audit-pick { min-width: 220px; }
body.adm-body .adm-content fieldset:disabled .form-control,
body.adm-body .adm-content fieldset:disabled .form-select { background: var(--adm-surface-2); }

@media (max-width: 767.98px) {
  .disc-drawer { width: 100vw; }
  .disc-note { max-width: 180px; }
  .disc-audit-pick { min-width: 0; width: 100%; }
}

.disc-drawer__form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

body.adm-body .adm-content #admin-discounts .adm-toolbar__search .form-control { padding-left: 2.3rem; }
body.adm-body .adm-content #admin-discounts #audit-card .card-header > div:last-child { flex: 0 1 auto; }
body.adm-body .adm-content #admin-discounts .disc-audit-pick { width: auto; max-width: 320px; }

/* Empty/loading states: collapse the wide table so the message fits the viewport */
body.adm-body .adm-content #admin-discounts .table-responsive.is-empty thead { display: none; }
body.adm-body .adm-content #admin-discounts .table-responsive.is-empty table { width: 100%; min-width: 0; table-layout: fixed; }
