/* Panel de administración — Material 3, mismos componentes que veemedia. Se suma a portal.css. */
.who { display: flex; align-items: center; gap: 10px; }
.who-name { display: flex; flex-direction: column; line-height: 16px; font-weight: 500; }
.who-name small { font-weight: 400; color: var(--on-surface-v); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 500; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--on-surface-v); }
.icon-btn:hover { background: rgba(0,0,0,.07); }
@media (max-width: 1240px) { .nav a:not(.on) .t { display: none; } .nav a { padding: 0 12px; } }
.who { flex: none; }
.who-name { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name small { display: block; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .who-name { display: none; } }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .grow { flex: 1; min-width: 200px; }
.kpis.admin { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 20px; }
.kpis.admin .card { display: flex; align-items: center; gap: 14px; }
.kpis.admin .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-c); color: var(--on-primary-c); flex: none; }
.kpis.admin .ico.live { background: var(--error-c); color: var(--error); }
.kpis.admin .ico.ok { background: var(--ok-c); color: var(--ok); }
.kpis.admin .ico.warn { background: var(--warn-c); color: #5F4A00; }
.kpis.admin .v { font-size: 26px; line-height: 30px; }
.kpis.admin .l { font-size: 12px; color: var(--on-surface-v); }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .field { margin: 0; flex: 1; min-width: 220px; max-width: 360px; }
.toolbar .field input { height: 40px; border-radius: 20px; padding: 0 18px; }
.filters .chip .n { opacity: .65; margin-left: 2px; }

.tbl-wrap { overflow-x: auto; padding: 0; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 880px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--on-surface-v); padding: 12px 14px; border-bottom: 1px solid var(--outline-v); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--outline-v); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .15s; }
.tbl tbody tr:hover { background: rgba(63,81,181,.05); }
.rname { display: flex; align-items: center; gap: 12px; }
.rname .lg { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.rname small { display: block; color: var(--on-surface-v); }
.mini { min-width: 140px; } .mini .progress { height: 8px; margin: 4px 0 2px; }
.chip.err { background: var(--error-c); color: var(--error); }
.chip.off { background: var(--sec-c); color: var(--on-surface-v); }
.chip.gray { background: var(--sec-c); }

/* Diálogo */
.dlg-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: grid; place-items: center; padding: 16px; }
.dlg { background: #fff; border-radius: 28px; width: min(760px, 100%); max-height: 92vh; overflow: auto; padding: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.dlg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.dlg-head .grow { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--outline-v); margin: 12px 0 16px; overflow-x: auto; }
.tabs button { height: 44px; padding: 0 16px; border: 0; background: none; font-weight: 500; color: var(--on-surface-v); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-color: var(--primary); }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 8px 0; border-bottom: 1px solid var(--outline-v); }
.kv td:first-child { color: var(--on-surface-v); width: 42%; }
.kv tr:last-child td { border: 0; }
.cred { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--primary-c); color: var(--on-primary-c); margin-bottom: 12px; }
.cred .grow { flex: 1; min-width: 0; } .cred .secret { font-family: ui-monospace, Consolas, monospace; font-size: 15px; word-break: break-all; }
.copy { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--outline-v); }
.copy .lbl { width: 130px; color: var(--on-surface-v); } .copy .val { flex: 1; font-family: ui-monospace, Consolas, monospace; }

/* Kanban de cumplimiento */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--surface-2); border-radius: 20px; padding: 12px; }
.col h3 { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; }
.col .item { background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--shadow-1); margin-bottom: 10px; }
.col .item .acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.col .item .btn { height: 32px; padding: 0 14px; font-size: 13px; }
.flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.flow .chip .ms { font-size: 16px; } .flow > .ms { color: var(--outline); }

/* Editor con pestañas verticales */
.editor { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.vtabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; }
.vtabs button { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border: 0; border-radius: 24px; background: transparent; font-weight: 500; color: var(--on-surface-v); text-align: left; }
.vtabs button:hover { background: rgba(0,0,0,.05); } .vtabs button.on { background: var(--sec-c); color: var(--on-surface); }
@media (max-width: 800px) { .editor { grid-template-columns: 1fr; } .vtabs { flex-direction: row; overflow-x: auto; position: static; } .vtabs button { flex: none; } .vtabs .t { display: none; } }
.save-bar { position: sticky; top: 64px; z-index: 20; display: flex; justify-content: flex-end; padding: 8px 0; }

.ledger td.amt { text-align: right; font-weight: 500; white-space: nowrap; }
.bar-h { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.bar-h .lbl { width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-h .progress { flex: 1; margin: 0; } .bar-h .val { width: 70px; text-align: right; color: var(--on-surface-v); }
.log-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--outline-v); }
.log-row:last-child { border: 0; } .log-row .t { width: 110px; color: var(--on-surface-v); flex: none; font-size: 12px; padding-top: 3px; }
.log-row .ms { flex: none; }
.snack { background: #303036; }
.empty-s { text-align: center; padding: 32px 16px; color: var(--on-surface-v); }
.empty-s .ms { font-size: 56px; color: var(--outline); display: block; margin: 0 auto 8px; }

/* Soporte y ayuda */
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--error); color: #fff; font-size: 12px; font-weight: 500; display: inline-grid; place-items: center; }
.dotnew { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 8px; }
.msg { border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; max-width: 92%; }
.msg.rad { background: var(--surface-2); } .msg.adm { background: var(--primary-c); color: var(--on-primary-c); margin-left: auto; }
.msg-h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; } .msg-b { line-height: 1.5; word-break: break-word; }
.mono { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.card.flat { box-shadow: none; border: 1px solid var(--outline-v); margin: 12px 0; padding: 8px 16px; }
details.help { background: #fff; border-radius: 16px; box-shadow: var(--shadow-1); margin-bottom: 12px; overflow: hidden; }
details.help summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; font-weight: 500; font-size: 16px; list-style: none; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary .ms:first-child { color: var(--primary); }
details.help summary .chev { margin-left: auto; transition: transform .2s; } details.help[open] summary .chev { transform: rotate(180deg); }
details.help[open] summary { border-bottom: 1px solid var(--outline-v); }
.help-b { padding: 16px 20px 20px; line-height: 1.55; } .help-b ol, .help-b ul { padding-left: 22px; } .help-b li { margin-bottom: 8px; }
.faq dt { font-weight: 500; margin-top: 14px; } .faq dd { margin: 4px 0 0; color: var(--on-surface-v); }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--outline-v); color: var(--on-surface); }
.check:last-child { border: 0; } .check .ms:first-child { color: var(--outline); } .check.done .ms:first-child { color: var(--ok); } .check.done span:nth-child(2) { color: var(--on-surface-v); text-decoration: line-through; }
.check .go { margin-left: auto; color: var(--outline); }
.probe { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.probe .grow { flex: 1; } .probe.ok { background: var(--ok-c); color: var(--ok); } .probe.bad { background: var(--error-c); color: var(--error); }
.probe .ms:first-child { font-size: 32px; }

/* Editor de programación */
.prow { border: 1px solid var(--outline-v); border-radius: 16px; padding: 14px 16px 4px; margin-bottom: 12px; background: var(--surface-2); }
.prow-top, .prow-time { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.prow .grow { flex: 1; min-width: 180px; }
.prow-top .icon-btn { margin-top: 18px; }
.prow-time .field:not(.grow) { width: 120px; }
.prow .field { margin-bottom: 12px; }
.prow input[type=time] { width: 100%; }
.daychips { display: flex; gap: 6px; flex-wrap: wrap; }
.daychips label { position: relative; cursor: pointer; }
.daychips input { position: absolute; opacity: 0; inset: 0; }
.daychips span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--outline); font-weight: 500; transition: .15s; }
.daychips input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.daychips input:focus-visible + span { outline: 3px solid #B388FF; outline-offset: 2px; }
.atajos { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 4px; }
.atajos .btn { height: 30px; font-size: 12px; }

/* AutoDJ */
.dropzone { border: 2px dashed var(--outline); border-radius: 16px; padding: 28px 16px; text-align: center; cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-visible { border-color: var(--primary); background: var(--primary-c); outline: none; }
.dropzone .ms { color: var(--primary); }
#adj-subidas { margin-top: 12px; } .up { display: grid; grid-template-columns: 1fr 140px 120px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--outline-v); } .up .progress { margin: 0; }
@media (max-width: 600px) { .up { grid-template-columns: 1fr; } }

/* Tarjetas apiladas (Respaldo, etc.) y campo de archivo */
.wrap > .card + .card { margin-top: 16px; }
.field input[type=file] { height: auto; padding: 10px 12px; cursor: pointer; }
.field input[type=file]::file-selector-button { margin-right: 12px; padding: 8px 18px; border: 0; border-radius: 20px; background: var(--primary-c); color: var(--on-primary-c); font: inherit; font-weight: 500; cursor: pointer; }

/* Menú lateral del panel (en celular pasa a una franja con íconos, debajo de la barra superior) */
.side { position: fixed; top: 64px; left: 0; bottom: 0; width: 240px; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; z-index: 40; }
.side a { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 16px; border-radius: 24px; color: var(--on-surface-v); font-weight: 500; flex: none; }
.side a:hover { background: rgba(0,0,0,.05); }
.side a.on { background: var(--sec-c); color: var(--on-surface); }
.side .badge { margin-left: auto; }
.dark .side a:hover { background: rgba(255,255,255,.08); }
body.has-side { padding-left: 240px; }
body.has-side > .bar { margin-left: -240px; }   /* la barra superior ocupa todo el ancho; el menú queda debajo */
body.has-side .flash { left: calc(50% + 120px); }
@media (max-width: 900px) {
  .side { position: sticky; top: 64px; width: auto; flex-direction: row; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; background: var(--surface-2); }
  .side a { padding: 0 14px; } .side a .t { display: none; } .side a.on .t { display: inline; }
  body.has-side { padding-left: 0; }
  body.has-side > .bar { margin-left: 0; }
  .save-bar { top: 124px; }
  body.has-side .flash { left: 50%; }
}

/* Logo: vista previa */
.logo-up { display: flex; align-items: center; gap: 14px; }
.logo-up input[type=file] { flex: 1; min-width: 0; }
.logo-prev { width: 72px; height: 72px; flex: none; border-radius: 16px; background: var(--primary-c); color: var(--on-primary-c); display: grid; place-items: center; font-size: 26px; font-weight: 700; overflow: hidden; border: 1px solid var(--outline-v); }
.logo-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* AutoDJ simple: qué incluye y qué no */
.adj-alcance { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; text-align: left; margin: 16px auto 20px; max-width: 640px; }
.adj-alcance > div { background: var(--surface-2); border-radius: 16px; padding: 14px 18px; }
.adj-alcance ul { margin: 8px 0 0; padding-left: 20px; }
.adj-alcance li { margin: 6px 0; line-height: 1.45; }

/* Fila de compra (Pagos): selector de meses y botones de pago bien alineados, y ordenados en el celular */
.kv td { vertical-align: middle; }
.buyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.buyrow label { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.buyrow select.months { height: 40px; padding: 0 12px; border: 1px solid var(--outline); border-radius: 20px; background: var(--card); color: var(--on-surface); font: inherit; }
.buyrow .paybtn { margin: 0; white-space: nowrap; }
.buyrow .paybtn[disabled] { opacity: .55; cursor: not-allowed; }
@media (max-width: 700px) { .kv tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--outline-v); } .kv td { display: block; width: auto !important; border: 0; padding: 4px 0; } }

/* Avisos del administrador en el panel de las radios */
.notice-wrap { max-width: 1120px; margin: 16px auto 0; padding: 0 16px; }
.notice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--primary-c); color: var(--on-primary-c); box-shadow: var(--shadow-1); }
.notice.promo { background: linear-gradient(100deg, #7C4DFF, #3F51B5); color: #fff; }
.notice.importante { background: #FFDAD6; color: #410002; border: 1px solid #BA1A1A; }
.dark .notice.importante { background: rgba(255,90,90,.18); color: #FFDAD6; border-color: rgba(255,120,120,.6); }
.notice-ico { font-size: 30px; flex: none; }
.notice-body { flex: 1; min-width: 0; line-height: 1.45; }
.notice-body b { display: block; font-size: 17px; margin-bottom: 2px; }
.notice-act { flex: none; }
.notice-act .btn { white-space: nowrap; }
.notice.promo .btn.filled { background: #fff; color: #3F51B5; }
.notice .notice-x { margin: 0; flex: none; }
.notice .icon-btn { color: inherit; }
@media (max-width: 700px) { .notice { flex-wrap: wrap; } .notice-act { order: 3; width: 100%; } .notice-act .btn { width: 100%; } }
.nmodal-back { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.nmodal-back[hidden] { display: none; }
.nmodal { background: var(--card); color: var(--on-surface); border-radius: 28px; padding: 28px; max-width: 460px; width: 100%; box-shadow: var(--shadow-2); text-align: center; }
.nmodal .notice-ico { color: #BA1A1A; font-size: 44px; }
.nmodal h2 { margin: 8px 0; }
.nmodal-txt { color: var(--on-surface-v); line-height: 1.5; margin-bottom: 18px; text-align: left; }
.nmodal-act { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.nmodal-act form { margin: 0; }
.aviso-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px 16px; border-bottom: 1px solid var(--outline-v); }
.aviso-row .notice-wrap { padding: 0; margin: 0; }
.aviso-row .grow { flex: 1; min-width: 0; }
.aviso-acc { display: flex; flex-direction: column; gap: 2px; margin: 0; }
@media (max-width: 700px) { .aviso-row { flex-direction: column; } .aviso-acc { flex-direction: row; } }

/* La franja de avisos, ya dentro de la columna de la pantalla, toma su ancho */
.wrap > .notice-wrap { max-width: none; margin: 0 0 18px; padding: 0; }

/* Con el menú a la izquierda el contenido va pegado al menú (centrado dejaba un hueco grande en las pantallas angostas) */
body.has-side main.wrap { max-width: 1120px !important; margin-left: 8px; margin-right: auto; }   /* todas las pantallas con el mismo ancho que el Resumen */
@media (max-width: 900px) { body.has-side main.wrap { margin-left: auto; } }

/* Soporte por WhatsApp */
.wa-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; border-left: 5px solid #25D366; }
.wa-card.off { border-left-color: var(--outline-v); }
.wa-card .wa-ico { font-size: 34px; color: #1FA855; flex: none; }
.wa-card.off .wa-ico { color: var(--on-surface-v); }
.wa-card .grow { flex: 1; min-width: 200px; }
.wa-card .btn.filled { background: #25D366; color: #06371A; }

/* Tabla de precios (Configuración → Pagos): dólares a la izquierda, pesos a la derecha */
.price-table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; }
.price-table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--on-surface-v); padding: 8px 10px; border-bottom: 1px solid var(--outline-v); }
.price-table td { padding: 10px; border-bottom: 1px solid var(--outline-v); vertical-align: middle; }
.price-table td:first-child { width: 46%; }
.price-table .help { display: block; font-size: 12px; margin-top: 2px; }
.pt-in { display: flex; align-items: center; border: 1px solid var(--outline); border-radius: 24px; height: 48px; background: #fff; overflow: hidden; max-width: 180px; }
.dark .pt-in { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
.dark .pt-in input { color: #fff; }
.pt-in span { padding-left: 16px !important; }
.pt-in:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pt-in span { padding: 0 10px; color: var(--on-surface-v); font-size: 14px; }
.pt-in input { border: 0; outline: 0; background: transparent; height: 100%; width: 100%; min-width: 0; padding: 0 10px 0 0; font: inherit; }
@media (max-width: 640px) { .price-table th:nth-child(n+2) { font-size: 12px; } .price-table td { padding: 8px 4px; } .price-table td:first-child { width: auto; } }
