:root {
  --blue-950: #061a38;
  --blue-900: #08275a;
  --blue-800: #003b7a;
  --blue-700: #0050a8;
  --blue-600: #0067b1;
  --red-700: #c8102e;
  --red-800: #a90d25;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --soft-2: #edf1f7;
  --text: #102443;
  --muted: #64748b;
  --line: #d7e0eb;
  --shadow: 0 14px 30px rgba(6, 26, 56, .10);
  --shadow-soft: 0 8px 18px rgba(6, 26, 56, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 6% 18%, rgba(0, 80, 168, .055), transparent 28%),
    radial-gradient(circle at 94% 20%, rgba(200, 16, 46, .045), transparent 25%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 63%, #eef3f8 100%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.header {
  height: 72px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand-link,
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-950);
}
.brand-link { min-width: 246px; }
.brand-mark {
  width: 64px;
  height: 44px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}
.brand-copy { line-height: .92; letter-spacing: -.35px; }
.brand-copy .iptv { display:block; color: var(--red-700); font-weight: 900; font-size: 15px; letter-spacing: .2px; }
.brand-copy .telecable { display:block; color: var(--blue-950); font-weight: 900; font-size: 25px; }
.brand-copy .dominicano { display:block; color: var(--blue-950); font-weight: 900; font-size: 18px; }
.logo-small { display:none; }

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-weight: 850;
  color: var(--blue-950);
  white-space: nowrap;
}
.nav a {
  padding: 8px 2px 10px;
  position: relative;
  opacity: .92;
  font-size: 15.5px;
}
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 10px;
  background: var(--red-700);
}
.nav a:hover { opacity: 1; color: var(--blue-700); }
.account-icon { font-size: 22px; vertical-align: -3px; margin-right: 7px; }

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 26px 0;
}
.hero {
  text-align: center;
  padding: 0 0 2px;
}
.logo-hero { display:none; }
.hero-brand {
  justify-content: center;
  margin: 0 auto 4px;
}
.hero-brand .brand-mark { width: 102px; height: 70px; }
.hero-brand .brand-copy .iptv { font-size: 24px; }
.hero-brand .brand-copy .telecable { font-size: 42px; }
.hero-brand .brand-copy .dominicano { font-size: 30px; }
h1 {
  color: var(--blue-950);
  font-size: clamp(34px, 3.2vw, 46px);
  line-height: 1.04;
  letter-spacing: -1.25px;
  margin: 6px 0 22px;
  font-weight: 900;
}
.lead {
  max-width: 760px;
  margin: -4px auto 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.52;
}

.primary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  max-width: 920px;
  margin: 0 auto 26px;
}
.primary-card {
  min-height: 134px;
  border-radius: var(--radius);
  color: #fff;
  padding: 22px;
  display: grid;
  grid-template-columns: 82px 1px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
}
.primary-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .11;
  background: radial-gradient(circle at 86% 52%, rgba(255,255,255,.62), transparent 32%);
  pointer-events: none;
}
.primary-card.tv { background: linear-gradient(135deg, #004c9f 0%, #062b62 100%); }
.primary-card.radio { background: linear-gradient(135deg, #d41430 0%, #98091f 100%); }
.card-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.card-icon svg { width: 64px; height: 64px; stroke: #fff; fill: none; stroke-width: 3.1; }
.flag-mini {
  width: 32px;
  height: 21px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,.20);
  display: grid;
  grid-template-columns: 1fr 7px 1fr;
  grid-template-rows: 1fr 6px 1fr;
  background: #fff;
}
.flag-mini span:nth-child(1){ background:#002d62; }
.flag-mini span:nth-child(2){ background:#fff; }
.flag-mini span:nth-child(3){ background:#ce1126; }
.flag-mini span:nth-child(4){ background:#fff; }
.flag-mini span:nth-child(5){ background:#fff; position:relative; }
.flag-mini span:nth-child(5)::after{ content:""; position:absolute; width:4px; height:4px; border-radius:50%; background:#1b7b3a; left:50%; top:50%; transform:translate(-50%,-50%); }
.flag-mini span:nth-child(6){ background:#fff; }
.flag-mini span:nth-child(7){ background:#ce1126; }
.flag-mini span:nth-child(8){ background:#fff; }
.flag-mini span:nth-child(9){ background:#002d62; }
.divider { width: 1px; height: 92px; background: rgba(255,255,255,.62); position: relative; }
.primary-title {
  position: relative;
  font-size: clamp(24px, 1.85vw, 30px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.65px;
  min-width: 0;
  text-align: left;
}
.primary-title small { display:block; font-size: clamp(18px, 1.25vw, 21px); font-weight: 750; margin-top: 7px; }
.arrow {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue-950);
  display: grid;
  place-items: center;
  font-size: 25px;
  line-height: 1;
  font-weight: 850;
  box-shadow: 0 8px 16px rgba(0,0,0,.13);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-bottom: 18px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.section-title {
  display:flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-950);
  font-size: 19px;
  font-weight: 900;
  margin: 0;
  line-height: 1.2;
}
.section-title::before { content:""; width:5px; height:27px; background:var(--red-700); border-radius:10px; }
.section-title svg { width: 24px; height: 24px; stroke: var(--blue-950); fill:none; stroke-width:2.4; flex: 0 0 auto; }
.section-link { font-weight: 850; color: var(--blue-700); white-space: nowrap; font-size: 14.5px; }
.cards-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.media-card {
  min-height: 148px;
  background: rgba(255,255,255,.99);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 34px 12px 13px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap: 8px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  overflow: hidden;
}
.media-card::after,
.list-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--blue-800);
  opacity: .9;
}
.media-card.radio::after,
.list-card.radio::after { background: var(--red-700); }
.media-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(6,26,56,.12); border-color: rgba(0,80,168,.28); }
.channel-number {
  position:absolute;
  top:10px;
  left:10px;
  color: var(--blue-950);
  background: #eef3f8;
  border: 1px solid #d9e3ef;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .45px;
  padding: 5px 8px;
  border-radius: 999px;
}
.badge-live {
  position:absolute;
  top:10px;
  right:10px;
  background: var(--red-700);
  color:#fff;
  font-size: 9.5px;
  font-weight: 900;
  padding: 5px 8px;
  border-radius: 999px;
  letter-spacing: .2px;
}
.logo-box {
  min-height: 72px;
  display:grid;
  place-items:center;
  color: var(--blue-800);
  text-align:center;
  padding: 5px 4px 0;
  line-height: .95;
}
.channel-logo-img {
  max-width: 112px;
  max-height: 68px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 7px 12px rgba(6,26,56,.10));
}
.fallback-logo {
  width: 70px;
  height: 58px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  gap:0;
  background: linear-gradient(180deg, #f9fbfd, #eef4fa);
  border:1px solid #dbe5f0;
  color: var(--blue-800);
}
.fallback-logo.radio { color: var(--red-700); }
.fallback-logo span {
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.8px;
}
.fallback-logo small {
  color: var(--blue-950);
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .6px;
}
.media-name {
  text-align:center;
  color: var(--blue-950);
  font-size: 13.3px;
  font-weight: 850;
  line-height: 1.16;
  min-height: 30px;
  display:grid;
  place-items:center;
}
.media-note { text-align:center; color:var(--muted); font-size:12px; margin-top:-3px; }

.benefits {
  margin: 18px 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(6,26,56,.075);
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  overflow:hidden;
}
.benefit {
  padding: 17px 18px;
  display:grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  align-items:center;
  border-right:1px solid var(--line);
}
.benefit:last-child{ border-right:0; }
.benefit-icon {
  width: 48px; height:48px; border-radius:50%; background:#eef3f8;
  display:grid; place-items:center; color:var(--blue-800);
}
.benefit-icon svg { width: 28px; height: 28px; stroke: currentColor; fill:none; stroke-width:2.25; }
.benefit h3 { margin:0 0 4px; font-size:16px; color:var(--blue-950); }
.benefit p { margin:0; color:#37506e; font-size:13px; line-height:1.35; }

.footer {
  margin-top: 16px;
  background: var(--blue-950);
  color: rgba(255,255,255,.92);
  padding: 14px 22px;
  text-align: center;
  font-size: 13.5px;
}
.footer .sep { opacity: .45; margin: 0 18px; }
.footer-flag {
  display: inline-block;
  width: 22px;
  height: 14px;
  margin-left: 7px;
  vertical-align: -2px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.45);
  background:
    linear-gradient(90deg, transparent 0 40%, #fff 40% 60%, transparent 60% 100%),
    linear-gradient(180deg, transparent 0 38%, #fff 38% 62%, transparent 62% 100%),
    linear-gradient(90deg, #002d62 0 50%, #ce1126 50% 100%);
}

.media-card.placeholder {
  background: #f9fbfd;
  border-style: dashed;
  box-shadow: none;
  opacity: .82;
  cursor: default;
  pointer-events: none;
}
.media-card.placeholder .badge-live {
  background: #e7edf5;
  color: #53657d;
}
.media-card.placeholder .logo-box { color: #8aa0ba; }
.media-card.placeholder .media-name { color: #53657d; }
.placeholder-mark {
  font-weight: 950;
  font-size: 21px;
  letter-spacing: -.3px;
}


.toolbar {
  display:flex; align-items:center; justify-content:space-between; gap:16px; margin: 10px 0 16px;
}
.search {
  width:min(420px,100%);
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  padding:13px 18px;
  outline:0;
  box-shadow:0 8px 18px rgba(6,26,56,.05);
}
.search:focus{ border-color:var(--blue-600); box-shadow:0 0 0 4px rgba(0,103,177,.12); }
.list-grid {
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.list-card {
  min-height: 214px;
  padding: 42px 20px 22px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:16px;
  box-shadow:var(--shadow-soft);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.list-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(6,26,56,.12);
  border-color: rgba(0,80,168,.28);
}
.list-card .logo-box { min-height:88px; padding-top:4px; }
.list-card .channel-logo-img { max-width: 150px; max-height: 92px; }
.list-card .fallback-logo { width: 92px; height: 76px; border-radius: 18px; }
.list-card .fallback-logo span { font-size: 30px; }
.list-card .fallback-logo small { font-size: 11px; }
.list-card .media-name {
  font-size: 16px;
  min-height: auto;
}
.list-card .btn { width: 100%; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  border:0; border-radius:999px; padding:12px 18px;
  background:var(--blue-800); color:#fff; font-weight:900; cursor:pointer;
  box-shadow:0 10px 18px rgba(0,59,122,.18);
}
.btn.red { background: var(--red-700); box-shadow:0 10px 18px rgba(200,16,46,.16); }
.btn.light { background:#eef3f8; color:var(--blue-950); box-shadow:none; }
.notice {
  background:#fff8e8;
  color:#735200;
  border:1px solid #f3d58c;
  border-radius:14px;
  padding:14px 16px;
  margin: 12px 0 20px;
  line-height:1.45;
}
.player-shell {
  display:grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items:start;
  margin: 12px 0 34px;
}
.player-card {
  background: #fff;
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.player-screen {
  background:#07142a;
  aspect-ratio: 16 / 9;
  display:grid;
  place-items:center;
}
video, audio { width:100%; }
video { height:100%; background:#07142a; }
audio { padding: 48px 34px; }
.player-meta { padding: 22px; }
.player-meta h2 { margin:0 0 6px; font-size: 28px; }
.sidebar { display:flex; flex-direction:column; gap:12px; }
.side-title { font-weight:900; color:var(--blue-950); margin:0 0 5px; }
.side-item { background:#fff; border:1px solid var(--line); border-radius:14px; padding:13px; display:flex; justify-content:space-between; gap:10px; align-items:center; box-shadow:0 8px 18px rgba(6,26,56,.05); }
.side-item strong { font-size:14px; }
.side-item small { color:var(--muted); }
.error-box { padding: 28px; text-align:center; color:#fff; }

.admin-layout {
  display:grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items:start;
  margin: 12px 0 34px;
}
.admin-panel,
.admin-list-panel {
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow-soft);
}
.admin-panel { padding: 22px; }
.admin-list-panel { padding: 18px; }
.admin-panel h2,
.admin-list-panel h2 {
  margin:0 0 14px;
  color:var(--blue-950);
  font-size:20px;
}
.admin-form {
  display:grid;
  gap:14px;
}
.form-row {
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
.field {
  display:grid;
  gap:7px;
}
.field label {
  color:var(--blue-950);
  font-size:13px;
  font-weight:900;
}
.field input,
.field select {
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:12px 13px;
  outline:0;
}
.field input:focus,
.field select:focus {
  border-color:var(--blue-600);
  box-shadow:0 0 0 4px rgba(0,103,177,.12);
}
.field small {
  color:var(--muted);
  line-height:1.35;
}
.admin-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:4px;
}
.admin-status {
  display:none;
  margin-top:12px;
  padding:11px 13px;
  border-radius:12px;
  background:#edf8f1;
  color:#1d6b37;
  font-weight:800;
  font-size:13px;
}
.admin-status.visible { display:block; }
.admin-list {
  display:grid;
  gap:10px;
}
.admin-item {
  display:grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  align-items:center;
  gap:12px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:#fbfdff;
}
.admin-item-logo {
  width:60px;
  height:48px;
  display:grid;
  place-items:center;
}
.admin-item-logo .channel-logo-img {
  max-width:58px;
  max-height:42px;
}
.admin-item-logo .fallback-logo {
  width:48px;
  height:40px;
  border-radius:12px;
}
.admin-item-logo .fallback-logo span { font-size:17px; }
.admin-item-logo .fallback-logo small { font-size:8px; }
.admin-item strong {
  display:block;
  color:var(--blue-950);
  font-size:14px;
  line-height:1.25;
}
.admin-item small {
  color:var(--muted);
  font-size:12px;
}
.admin-pill,
.admin-fixed {
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
  font-weight:950;
  background:#eef3f8;
  color:var(--blue-950);
}
.admin-pill.radio {
  background:#fff0f3;
  color:var(--red-700);
}
.admin-delete {
  border:0;
  border-radius:999px;
  padding:8px 11px;
  background:#fff0f3;
  color:var(--red-700);
  font-weight:900;
  cursor:pointer;
}
.import-label {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:12px 18px;
  background:#eef3f8;
  color:var(--blue-950);
  font-weight:900;
  cursor:pointer;
}
.import-label input { display:none; }

@media (max-width: 1050px) {
  .header-inner, .page { max-width: 1040px; }
  .primary-grid { max-width: 880px; }
  .primary-card { grid-template-columns: 76px 1px minmax(0, 1fr) 40px; gap:13px; padding:20px; }
  .card-icon svg { width:58px; height:58px; }
  .primary-title { font-size: 25px; }
  .primary-title small{ font-size: 18px; }
  .arrow { width: 40px; height: 40px; font-size: 23px; }
  .section-title { font-size:17px; }
}
@media (max-width: 960px) {
  .header { height:auto; }
  .header-inner { flex-direction:column; padding:12px 18px; }
  .brand-link { min-width:0; }
  .nav { gap:18px; flex-wrap:wrap; justify-content:center; }
  .primary-grid, .section-grid, .player-shell, .admin-layout { grid-template-columns:1fr; }
  .primary-grid { max-width: 620px; }
  .cards-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefits { grid-template-columns: repeat(2, 1fr); }
  .benefit:nth-child(2){ border-right:0; }
}
@media (max-width: 620px) {
  .page { padding:18px 16px 0; }
  h1 { font-size: 31px; }
  .hero-brand .brand-mark { width:80px; height:54px; }
  .hero-brand .brand-copy .iptv { font-size:18px; }
  .hero-brand .brand-copy .telecable { font-size:31px; }
  .hero-brand .brand-copy .dominicano { font-size:23px; }
  .primary-card { grid-template-columns: 68px 1px minmax(0,1fr) 38px; padding:17px; gap:11px; min-height:120px; }
  .card-icon svg { width:50px; height:50px; }
  .flag-mini{ width:28px; height:18px; }
  .divider{height:78px;}
  .primary-title { font-size:21px; }
  .primary-title small{font-size:16px;}
  .arrow{width:38px;height:38px;font-size:22px;}
  .cards-row, .list-grid, .benefits { grid-template-columns:1fr; }
  .benefit{border-right:0;border-bottom:1px solid var(--line);} .benefit:last-child{border-bottom:0;}
  .toolbar { flex-direction:column; align-items:stretch; }
  .form-row, .admin-item { grid-template-columns:1fr; }
  .admin-item-logo { width:100%; height:58px; }
}
