:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  --bg: #0a0d12;
  --panel: #121720;
  --line: #2a3341;
  --muted: #94a0b2;
  --mint: #43e6a5;
  --danger: #ff7b86;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: #f7f9fc; }
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #080b10ed; border-bottom: 1px solid var(--line);
}
header strong { font-size: 22px; color: var(--mint); margin-right: 12px; }
header span { color: var(--muted); }
.header-actions, .form-actions, .bulk-bar, .filters, .pagination {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
main { max-width: 1600px; margin: 0 auto; padding: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: center; }
h1, h2, p { margin: 0; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
p { color: var(--muted); margin-top: 5px; }
button, .button, input, select {
  border: 1px solid #384457; background: #0c1119; color: white;
  border-radius: 7px; padding: 9px 11px; font: inherit;
}
button, .button { cursor: pointer; text-decoration: none; }
button:hover, .button:hover { border-color: var(--mint); }
.primary { background: var(--mint); color: #07110d; border-color: var(--mint); font-weight: 750; }
.provider-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 16px; }
label { color: var(--muted); font-size: 13px; }
label input { display: block; width: 100%; margin-top: 5px; }
.message { min-height: 20px; color: var(--mint); margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #0e131b; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }
.rules-card { display: grid; grid-template-columns: minmax(280px, 1fr) auto minmax(180px, 260px) auto auto; gap: 10px; align-items: center; }
.filters { margin-bottom: 14px; }
.search { min-width: 300px; flex: 1; }
.bulk-bar { border-block: 1px solid var(--line); padding: 12px 0; margin-bottom: 12px; }
.bulk-bar select { min-width: 160px; }
.table-wrap { overflow: auto; max-height: calc(100vh - 390px); min-height: 360px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { position: sticky; top: 0; z-index: 2; background: #19212d; }
th, td { padding: 8px; border-bottom: 1px solid #242d3a; text-align: left; vertical-align: middle; }
th { color: #b9c3d1; }
td input, td select { width: 100%; min-width: 90px; padding: 7px; }
.name-cell { min-width: 320px; }
.provider-cell { max-width: 250px; color: var(--muted); }
.status-approved { color: var(--mint); }
.status-hidden { color: var(--danger); }
.pagination { justify-content: center; margin-top: 14px; }
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 20;
  background: #1f2935; border: 1px solid var(--mint); padding: 13px 16px;
  border-radius: 8px; box-shadow: 0 8px 30px #000a;
}
.hidden { display: none !important; }
code { color: var(--mint); }
@media (max-width: 1000px) {
  .provider-form, .rules-card { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Responsive para catálogo TV y curaduría VOD. No cambia APIs ni datos. */
@media (max-width: 820px) {
  body { overflow-x: hidden; font-size: 15px; }
  header {
    position: sticky;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }
  header > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  header strong { font-size: 20px; margin-right: 4px; }
  header span { font-size: 13px; }
  .header-actions,
  .form-actions,
  .bulk-bar,
  .filters,
  .pagination {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 9px;
  }
  .header-actions label,
  .filters label {
    width: 100%;
  }
  button,
  .button,
  input,
  select {
    width: 100%;
    min-height: 43px;
    font-size: 16px;
  }
  main {
    width: 100%;
    max-width: none;
    padding: 12px;
  }
  .card {
    padding: 12px;
    border-radius: 14px;
  }
  .section-title {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .stat { padding: 13px; }
  .stat b { font-size: 22px; }
  .search {
    min-width: 0;
    width: 100%;
  }
  .bulk-bar {
    border-block: 1px solid var(--line);
    padding: 10px 0;
  }
  .bulk-bar select { min-width: 0; }
  .provider-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .rules-card {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .table-wrap {
    max-height: none;
    min-height: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  table {
    min-width: 980px;
    font-size: 12px;
  }
  th,
  td {
    padding: 7px;
  }
  td input,
  td select {
    min-width: 110px;
    min-height: 36px;
    font-size: 13px;
  }
  .name-cell { min-width: 250px; }
  .provider-cell { max-width: 190px; }
  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  header strong { font-size: 19px; }
  .pagination {
    grid-template-columns: 1fr;
  }
}
