:root {
  --bg: #f6f6f9;
  --surface: #ffffff;
  --surface-2: #f3f3f7;
  --surface-3: #e9e9f0;
  --border: #e6e6ee;
  --border-strong: #d4d4df;
  --text: #15151e;
  --text-2: #464658;
  --muted: #707086;
  --brand: #5b3df5;
  --brand-ink: #4a2ee0;
  --brand-2: #ff4d8d;
  --brand-soft: #efebff;
  --ok: #12a150;
  --ok-soft: #e3f6ea;
  --warn: #b45309;
  --warn-soft: #fdf1dc;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --chart: #5b3df5;
  --grid: #ececf2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, .05);
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 6px 20px rgba(20, 20, 40, .06);
  --shadow-lg: 0 24px 80px rgba(10, 10, 30, .28);
  --side-w: 244px;
  color-scheme: light;
}


* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 18px; letter-spacing: -.01em; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--brand-ink); }
code, pre { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

/* ---------- botones e inputs */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s, border-color .15s, filter .15s, transform .05s;
  white-space: nowrap; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; pointer-events: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--surface); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.subtle { background: var(--surface-2); border-color: transparent; }
.btn.subtle:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.btn.small .ico { width: 15px; height: 15px; }
.btn.block { width: 100%; }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; width: 100%;
}
select { padding-right: 30px; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 22%, transparent); outline-offset: 0; border-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
input[type="range"] { padding: 0; border: 0; accent-color: var(--brand); background: transparent; }
input[type="number"] { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.field { display: grid; gap: 6px; }
.field > .label, .field > span:first-child { font-weight: 600; font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; color: var(--text); }
.hint { color: var(--muted); font-size: 12.5px; }
.form-error { color: var(--danger); font-weight: 600; font-size: 14px; margin: 0; min-height: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.check, .radio { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.input-suffix { position: relative; display: block; }
.input-suffix em { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; font-size: 13px; pointer-events: none; }
.input-suffix input { padding-right: 46px; }
.search { position: relative; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }

.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 3px; }
.segmented button, .segmented label > span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.segmented label { position: relative; display: block; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented button.active, .segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); }
.segmented.block { display: grid; width: 100%; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .2s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.chip.accent { background: var(--brand-soft); color: var(--brand-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip .ico { width: 13px; height: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); }
.tag-new { font-size: 11px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; }

/* ---------- acceso (entrar, registro, reclamar, invitación) */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-side {
  display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 48px clamp(28px, 6vw, 80px); color: #fff;
  background: radial-gradient(circle at 15% 15%, rgba(255, 77, 141, .45), transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(124, 99, 255, .55), transparent 50%), #17123a;
}
.auth-side .brand { color: #fff; }
.auth-side h2 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.25; letter-spacing: -.02em; max-width: 520px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 480px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .85); font-size: 15px; }
.auth-points .ico { color: #ffb3cf; margin-top: 2px; }
.auth-tv { max-width: 460px; }
.auth-tv .tv { box-shadow: 0 0 0 7px #0b0918, 0 24px 50px rgba(0, 0, 0, .45); }
.auth-banner { color: #fff; font-weight: 700; font-size: clamp(10px, 3.2cqw, 16px); background: linear-gradient(90deg, #5b3df5, #ff4d8d) !important; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 14px; }
.auth-card h1 { font-size: 26px; }
.auth-card .auth-brand { display: none; }
.auth-form { display: grid; gap: 14px; margin-top: 6px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; }
.auth-help { font-size: 13.5px; color: var(--muted); }
.auth-help summary { cursor: pointer; }
.auth-help p { margin-top: 6px; }
.auth-claim { text-decoration: none; }

/* ---------- usuario en el menú, barra del plan y solo lectura */

.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.side-user:hover { background: var(--surface-2); }
.side-user .who { display: grid; min-width: 0; line-height: 1.25; }
.side-user .who b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.shell.collapsed .side-user .who { display: none; }
.shell.collapsed .side-user { justify-content: center; }
.plan-bar { display: flex; align-items: center; gap: 12px; padding: 10px 36px; background: var(--brand-soft); color: var(--brand-ink); font-size: 14px; border-bottom: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.plan-bar > span { flex: 1; }
.plan-bar .icon-btn { color: var(--brand-ink); width: 30px; height: 30px; }
.viewer-note { margin: 16px 36px 0; }
.role-viewer .head-actions .btn.primary, .role-viewer .item-card .actions .btn.subtle,
.role-viewer .editor-bar .btn.primary, .role-viewer .empty .btn.primary { display: none; }

/* ---------- configuración */

.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabbar a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabbar a:hover { color: var(--text); }
.tabbar a.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.settings-card { margin-bottom: 18px; max-width: 920px; }
.settings-card > h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.settings-form { display: grid; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.form-actions .form-error { flex: 1; }
.soon-card { background: var(--surface-2); box-shadow: none; }
.brand-kit { display: grid; grid-template-columns: 240px 1fr; gap: 28px; margin-top: 16px; align-items: start; }
.logo-box { height: 132px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); display: grid; place-items: center; gap: 6px; color: var(--muted); font-size: 13px;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px; }
.logo-box img { max-width: 86%; max-height: 108px; object-fit: contain; }
.brand-actions { display: flex; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.brand-colors { display: grid; gap: 10px; align-content: start; }
.brand-colors .label { font-weight: 600; font-size: 14px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] { width: 44px; height: 38px; padding: 3px; border-radius: 10px; cursor: pointer; }
.color-field input[type="text"] { width: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
@media (max-width: 700px) { .brand-kit { grid-template-columns: 1fr; } }
.ai-modal { width: min(640px, calc(100vw - 32px)); }
.ai-options { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-top: 4px; }
.ai-options .field { flex: 1; min-width: 220px; }
.ai-options .check { padding-bottom: 10px; }
.ai-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; background: var(--surface-2); }
.ai-result { margin-top: 16px; }
.ai-result img { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.ai-result p { margin-top: 10px; font-size: 14px; }
.ai-result p .ico { vertical-align: -2px; color: var(--ok); }
.ai-wait { display: flex; align-items: center; gap: 12px; padding: 36px 16px; justify-content: center; background: var(--surface-2); border-radius: var(--radius-sm); color: var(--text-2); }
.ai-spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.plan-now { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 22px; }
.plan-now h2 { font-size: 24px; margin: 2px 0 6px; }
.plan-now-meters { display: grid; gap: 14px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.meter-top span { color: var(--muted); }
.meter-bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.meter-bar span { display: block; height: 100%; border-radius: 8px; background: var(--brand); }
.meter-bar span.full { background: var(--warn); }
.pricing-controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 16px; }
.pricing-controls .save { font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 1px 6px; border-radius: 6px; }
.pricing { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.price-card { position: relative; padding: 20px 18px; display: flex; flex-direction: column; gap: 8px; }
.price-card h3 { font-size: 18px; }
.price-card.best { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent), var(--shadow); }
.price-card.current { background: var(--surface-2); }
.best-tag { position: absolute; top: -11px; left: 18px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--brand); padding: 2px 9px; border-radius: 999px; }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.price b { font-size: 30px; letter-spacing: -.02em; }
.price span { font-size: 13px; color: var(--muted); }
.price-note { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.features { list-style: none; margin: 8px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.features li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; font-size: 13.5px; align-items: start; }
.features .ico { color: var(--ok); margin-top: 2px; }
.soon { font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-3); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }
.pricing-foot { margin-top: 14px; }
.team-card .card-head { align-items: flex-start; }
.team-table { width: 100%; border-collapse: collapse; }
.team-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 8px 8px; }
.team-table td { padding: 10px 8px; border-top: 1px solid var(--border); vertical-align: middle; }
.team-table select { width: auto; min-width: 150px; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person b { display: block; font-size: 14px; }
.person small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.actions-cell { text-align: right; white-space: nowrap; }
.invites { display: grid; gap: 8px; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.invite-row .grow { flex: 1; }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.roles div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.roles dt { font-weight: 700; font-size: 14px; }
.roles dd { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.role-pick { display: grid; gap: 8px; }
.role-pick label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.role-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.role-pick input { margin-top: 3px; }
.role-pick b { display: block; font-size: 14px; }
.role-pick small { display: block; color: var(--muted); font-size: 12.5px; }
.btn.whatsapp { background: #25d366; border-color: #25d366; color: #fff; justify-self: start; }
.btn.whatsapp:hover { filter: brightness(1.05); }

/* ---------- marca */

.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand img { width: 30px; height: 30px; flex: none; }
.brand b {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-lg { font-size: 28px; }
.brand-lg img { width: 44px; height: 44px; }

/* ---------- estructura: barra lateral + contenido */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.main-col { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px 12px; z-index: 20;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 18px; }
.side-nav { display: grid; gap: 2px; overflow-y: auto; align-content: start; flex: 1; }
.side-nav a, .side-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14.5px;
  border: 0; background: transparent; font-family: inherit; cursor: pointer; width: 100%; text-align: left;
}
.side-nav a .ico, .side-link .ico { color: var(--muted); }
.side-nav a:hover, .side-link:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active, .side-link.active { background: var(--brand-soft); color: var(--brand-ink); }
.side-nav a.active .ico, .side-link.active .ico { color: var(--brand-ink); }
.nav-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 16px 11px 6px; }
.nav-badge { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }
.nav-badge.ok { color: var(--ok); background: var(--ok-soft); }
.side-foot { border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 2px; }
.sync { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); padding: 6px 11px; }
.sync.off { color: var(--danger); }
.sync.off .dot { background: var(--danger); box-shadow: none; }

.shell.collapsed { --side-w: 72px; }
.shell.collapsed .brand span, .shell.collapsed .side-nav a span, .shell.collapsed .nav-label,
.shell.collapsed .side-link span, .shell.collapsed .sync span, .shell.collapsed .nav-badge { display: none; }
.shell.collapsed .side-head { flex-direction: column; gap: 10px; padding-bottom: 12px; }
.shell.collapsed .side-nav a, .shell.collapsed .side-link, .shell.collapsed .sync { justify-content: center; }
.shell.collapsed #collapseBtn { transform: rotate(180deg); }

.mobile-bar { display: none; }
.scrim { display: none; }

.view { min-width: 0; padding: 28px 36px 72px; max-width: 1320px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { margin-top: 5px; color: var(--muted); }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { width: min(320px, 100%); }
.toolbar .spacer { flex: 1; }
.group-bar { justify-content: space-between; }
.group-chip { font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.group-chip small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.group-chip:hover { border-color: var(--border-strong); }
.group-chip.active { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.group-chip.active small { color: var(--brand-ink); }
.group-tools { display: flex; align-items: center; gap: 6px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.inline-field select { min-width: 190px; }
.group-upsell { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.count { font-size: 13px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h2 { font-size: 16px; }
.plays-head { flex-wrap: wrap; }
.plays-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plays-tools .segmented button { display: inline-flex; align-items: center; gap: 4px; }
.card-body { padding: 16px 20px 20px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

.empty {
  grid-column: 1 / -1; text-align: center; padding: 56px 20px;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty .art { width: 200px; max-width: 100%; margin: 0 auto 18px; }
.empty h3 { margin-bottom: 6px; font-size: 18px; }
.empty p { margin: 0 auto 18px; color: var(--muted); max-width: 460px; }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0; font-size: 13.5px; padding: 11px 13px; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn);
}
.note.info { background: var(--brand-soft); color: var(--brand-ink); }
.note a { color: inherit; font-weight: 700; }
.note .ico { margin-top: 1px; }

/* ---------- vista previa de TV (compartida) */

.tv {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px;
  background: #0b0b12; isolation: isolate; container-type: inline-size;
}
.tv.framed { box-shadow: 0 0 0 6px #1c1c26, 0 12px 30px rgba(0, 0, 0, .25); margin: 6px; }
.tv-scene {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 190, 110, .55), transparent 42%),
    radial-gradient(circle at 75% 65%, rgba(90, 120, 255, .55), transparent 45%),
    linear-gradient(160deg, #23234a, #3b2150 55%, #12122a);
}
.tv-scene-title {
  position: absolute; left: 6%; top: 40%; color: rgba(255, 255, 255, .75);
  font-weight: 700; font-size: clamp(8px, 3.4cqw, 18px); letter-spacing: .02em;
}
.tv-scene-bar {
  position: absolute; left: 6%; right: 6%; top: 52%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .8) 35%, rgba(255, 255, 255, .25) 35%);
}
.pv { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pv img, .pv video { width: 100%; height: 100%; object-fit: contain; display: block; }
.pv-full { inset: 0; background: #000; z-index: 2; }
.pv-banner { background: rgba(0, 0, 0, .6); z-index: 1; }
.pv-banner.pos-top { top: 0; left: 0; right: 0; }
.pv-banner.pos-bottom { bottom: 0; left: 0; right: 0; }
.pv-banner.pos-left { top: 0; bottom: 0; left: 0; }
.pv-banner.pos-right { top: 0; bottom: 0; right: 0; }
.pv-banner[class*="pos-top_"], .pv-banner[class*="pos-bottom_"] {
  background: transparent; border-radius: 5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); min-height: 8%;
}
.pv-banner[class*="pos-top_"] img, .pv-banner[class*="pos-top_"] video,
.pv-banner[class*="pos-bottom_"] img, .pv-banner[class*="pos-bottom_"] video { height: auto; }
/* margen = 3% del alto en ambos ejes (igual que la app de TV): 3% * 9/16 del ancho */
.pv-banner.pos-top_left { top: 3%; left: 1.6875%; }
.pv-banner.pos-top_right { top: 3%; right: 1.6875%; }
.pv-banner.pos-bottom_left { bottom: 3%; left: 1.6875%; }
.pv-banner.pos-bottom_right { bottom: 3%; right: 1.6875%; }
.pv.empty-zone {
  background: repeating-linear-gradient(45deg, rgba(124, 99, 255, .45), rgba(124, 99, 255, .45) 7px, rgba(255, 77, 141, .4) 7px, rgba(255, 77, 141, .4) 14px);
  color: #fff; font-size: clamp(8px, 2.4cqw, 13px); font-weight: 700; text-align: center; padding: 4px;
}
.pv.empty-zone[class*="pos-top_"], .pv.empty-zone[class*="pos-bottom_"] { aspect-ratio: 16 / 9; }
.pv.sel { outline: 3px solid #fff; outline-offset: -3px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); z-index: 3; }
.pv.clickable { cursor: pointer; }
.tv-pill {
  position: absolute; z-index: 4; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: #fff; background: rgba(16, 16, 26, .78); padding: 3px 8px; border-radius: 999px;
}
.tv-pill.live { background: rgba(18, 161, 80, .92); }
.tv-pill.clickable { cursor: pointer; }
.pv.empty-zone { overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
@container (max-width: 260px) {
  .tv-pill { font-size: 9.5px; padding: 2px 6px; left: 5px; top: 5px; }
  .tv-pill .pill-long { display: none; }
  .tv-pill .ico { width: 11px; height: 11px; }
  .pv.empty-zone { font-size: 0; padding: 0; }
  .tv-scene-title { font-size: 0; }
}
.tv-pill.right { left: auto; right: 8px; }
.tv-pill .pill-long { margin-right: -1px; }
.tv-empty { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .55); font-size: 13px; font-weight: 600; z-index: 1; }

.thumb { position: relative; aspect-ratio: 16 / 9; background: #0b0b12; border-radius: 9px; overflow: hidden; display: block; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .badge-dur {
  position: absolute; right: 6px; bottom: 6px; font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, .72); padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums;
}
.thumb .badge-kind { position: absolute; left: 6px; top: 6px; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: 3px; display: grid; }
.thumb .badge-kind .ico { width: 13px; height: 13px; }
.thumb-placeholder { display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }

/* ---------- inicio */

.hello { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.hello h1 { font-size: 28px; }
.setup { padding: 20px 22px; margin-bottom: 20px; }
.setup-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-line { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; width: 160px; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 6px; }
.steps4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.step4 {
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; align-items: start; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface);
  font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, background .15s;
}
.step4:hover { border-color: var(--brand); }
.step4 .num {
  grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: var(--brand-ink); background: var(--brand-soft);
}
.step4.done .num { background: var(--ok); color: #fff; }
.step4 b { font-size: 14.5px; }
.step4 small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.step4.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hero-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; min-height: 360px; }
.hero-card h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-card > p { color: var(--muted); }
.hero-tv { flex: 1; display: grid; place-items: center; padding: 18px 0 4px; }
.tv-art { position: relative; width: min(340px, 90%); aspect-ratio: 16 / 10; border: 7px solid #23232e; border-radius: 12px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); display: grid; place-items: center; box-shadow: 0 18px 30px -18px rgba(0,0,0,.4); }
.tv-art::after { content: ""; position: absolute; bottom: -16px; left: 50%; width: 70px; height: 8px; transform: translateX(-50%); background: #23232e; border-radius: 0 0 6px 6px; }
.plus-big {
  width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 10px 24px -8px var(--brand);
  transition: transform .15s;
}
.plus-big:hover { transform: scale(1.06); }
.plus-big .ico { width: 34px; height: 34px; }
.tpl-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.tpl {
  display: grid; gap: 8px; text-align: left; border: 1px solid var(--border); border-radius: 12px; padding: 10px;
  background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, transform .15s;
}
.tpl:hover { border-color: var(--brand); transform: translateY(-1px); }
.tpl b { font-size: 13.5px; }
.tpl small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.mini-screens { display: grid; gap: 8px; margin-top: 12px; }
.hero-preview { margin-top: 14px; display: grid; gap: 8px; }
.hero-preview .tv { box-shadow: 0 0 0 5px #1c1c26; margin: 5px; }
.mini-screen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.mini-screen b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.install-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-top: 20px; flex-wrap: wrap; }
.install-banner .grow { flex: 1; min-width: 220px; }

/* ---------- panel (dashboard) */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; display: grid; gap: 4px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .value small { font-size: 16px; color: var(--muted); font-weight: 600; }
.kpi .foot { font-size: 12.5px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.dash-grid .card { min-width: 0; }
.status-list { display: grid; }
.status-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.status-row:first-child { border-top: 0; }
.status-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-row .meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-row .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .bar { fill: var(--chart); transition: opacity .15s; }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart .bar-hit:focus + .bar { opacity: .75; }
.chart .cap { font-size: 11.5px; font-weight: 700; fill: var(--text); font-variant-numeric: tabular-nums; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--text); color: var(--surface);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -100%);
  box-shadow: var(--shadow);
}
.tip b { font-size: 14px; display: block; }
.top-list { display: grid; gap: 12px; }
.top-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; }
.top-row .thumb { border-radius: 7px; }
.top-row .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hbar span { height: 8px; border-radius: 0 4px 4px 0; background: var(--chart); min-width: 3px; }
.hbar em { font-style: normal; font-size: 12.5px; color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.activity { display: grid; gap: 0; }
.activity li { list-style: none; display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.activity li:first-child { border-top: 0; }
.activity li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transform: translateY(-1px); }
.activity time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.activity ul { margin: 0; padding: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 7px 8px; border-top: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 600; font-size: 12.5px; border-top: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
details.table-view { margin-top: 10px; }
details.table-view summary { font-size: 12.5px; color: var(--muted); cursor: pointer; }

/* ---------- biblioteca */

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.media-card { padding: 8px; display: grid; gap: 8px; cursor: pointer; transition: border-color .15s, box-shadow .15s; position: relative; }
.media-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.media-card .info { padding: 0 4px 4px; display: grid; gap: 2px; min-width: 0; }
.media-card .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.media-card .used { position: absolute; top: 14px; right: 14px; }
.media-list { padding: 0; overflow: hidden; }
.media-list table { width: 100%; border-collapse: collapse; }
.media-list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; background: var(--surface-2); }
.media-list td { padding: 9px 14px; border-top: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.media-list tr { cursor: pointer; }
.media-list tbody tr:hover td { background: var(--surface-2); }
.media-list .thumb { width: 74px; border-radius: 6px; }
.media-list .cell-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.dropzone {
  display: grid; place-items: center; text-align: center; gap: 8px; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: 14px; padding: 28px 18px;
  background: var(--surface); transition: border-color .15s, background .15s; color: var(--muted);
}
.dropzone b { color: var(--text); font-size: 15px; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--brand) 16%, transparent); backdrop-filter: blur(2px);
}
.drop-overlay div { background: var(--surface); border: 2px dashed var(--brand); border-radius: 18px; padding: 30px 40px; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 12px; color: var(--brand-ink); }

/* panel lateral de detalle */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 40; background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .22s ease;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 20px; overflow-y: auto; display: grid; gap: 18px; align-content: start; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(10, 10, 20, .3); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.facts div { background: var(--surface-2); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.uses { display: grid; gap: 6px; }
.uses a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.uses a:hover { background: var(--surface-3); }
.uses a .ico { color: var(--muted); }

/* bandeja de subidas */
.uploads {
  position: fixed; right: 20px; bottom: 20px; z-index: 55; width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.uploads-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); }
.uploads-list { max-height: 260px; overflow-y: auto; }
.upload-row { padding: 10px 16px; display: grid; gap: 6px; border-top: 1px solid var(--border); font-size: 13px; }
.upload-row:first-child { border-top: 0; }
.upload-row .top { display: flex; justify-content: space-between; gap: 10px; }
.upload-row .top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.upload-row.error { color: var(--danger); }
.progress { width: 100%; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .15s; }

/* ---------- tarjetas de listas (playlists, layouts, programación) */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.item-card { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.item-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.item-card .cover { display: block; padding: 10px 10px 0; text-decoration: none; }
.item-card .body { padding: 12px 16px 6px; display: grid; gap: 6px; }
.item-card .title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-card .title h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .meta { font-size: 13px; color: var(--muted); }
.item-card .actions { display: flex; align-items: center; gap: 4px; padding: 8px 10px 10px; margin-top: auto; }
.item-card .actions .grow { flex: 1; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; border-radius: 10px; overflow: hidden; }
.strip .thumb { border-radius: 0; }
.strip .more { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13px; aspect-ratio: 16 / 9; }
.week-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px; background: var(--surface-2); border-radius: 10px; }
.week-mini .col { position: relative; height: 92px; background: var(--surface); border-radius: 5px; overflow: hidden; }
.week-mini .col span { position: absolute; left: 2px; right: 2px; border-radius: 3px; }
.week-mini .lbl { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--muted); margin-top: 3px; }

.menu-pop {
  position: fixed; z-index: 60; min-width: 190px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg);
}
.menu-pop button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 500; color: var(--text); padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: left; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop button.danger { color: var(--danger); }
.menu-pop button .ico { color: var(--muted); }
.menu-pop button.danger .ico { color: var(--danger); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }

/* ---------- editores (página completa) */

.editor-bar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: -28px -36px 22px; padding: 14px 36px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.editor-bar .head-actions { flex-wrap: nowrap; }
.editor-bar .back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.editor-bar .back:hover { color: var(--text); }
.title-input {
  flex: 1; min-width: 200px; font-size: 21px; font-weight: 700; letter-spacing: -.01em;
  border: 1px solid transparent; background: transparent; padding: 5px 9px; border-radius: 9px;
}
.title-input:hover { border-color: var(--border); background: var(--surface); }
.title-input:focus { background: var(--surface); }
.editor-bar .form-error { flex-basis: 100%; order: 9; }

/* playlist */
.film-card { padding: 16px 18px 18px; margin-bottom: 20px; }
.film-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.film-head .total { font-size: 14px; color: var(--muted); }
.film-head .total b { color: var(--text); font-variant-numeric: tabular-nums; }
.film { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; min-height: 196px; }
.film-item {
  position: relative; flex: none; width: 172px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 6px; display: grid; gap: 7px; scroll-snap-align: start; cursor: grab; transition: box-shadow .15s, opacity .15s;
}
.film-item:hover { box-shadow: var(--shadow); }
.film-item.dragging { opacity: .4; }
.film-item .idx { position: absolute; z-index: 2; top: 11px; left: 11px; width: 21px; height: 21px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.film-item .rm { position: absolute; z-index: 2; top: 9px; right: 9px; width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.film-item:hover .rm, .film-item:focus-within .rm { opacity: 1; }
.film-item .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.dur { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dur button { border: 0; background: var(--surface-2); height: 28px; cursor: pointer; color: var(--text-2); font-size: 16px; line-height: 1; }
.dur button:hover { background: var(--surface-3); }
.dur input { border: 0; border-radius: 0; text-align: center; padding: 4px 2px; font-size: 13px; font-weight: 600; height: 28px; }
.dur input:focus { outline: none; }
.film-item [data-full] { font-size: 11.5px; white-space: normal; line-height: 1.2; }
.dur .full { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); }
.film-slot {
  flex: none; width: 172px; border: 2px dashed var(--border); border-radius: 12px; display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 10px; min-height: 172px; background: var(--surface-2);
}
.film-slot.first { border-color: var(--border-strong); color: var(--text-2); cursor: pointer; }
.film-drop { flex: none; width: 4px; margin: 0 -7px; border-radius: 4px; background: var(--brand); }
.lib-card { padding: 16px 18px 18px; }
.lib-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-head h2 { margin-right: 8px; }
.lib-head .search { margin-left: auto; width: min(260px, 100%); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lib-item { position: relative; border: 1px solid var(--border); border-radius: 11px; padding: 5px; background: var(--surface); cursor: grab; display: grid; gap: 6px; transition: border-color .15s; }
.lib-item:hover { border-color: var(--brand); }
.lib-item .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px 2px; }
.lib-item .add { position: absolute; z-index: 2; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.lib-item .add .ico { width: 16px; height: 16px; }
.lib-item .count { position: absolute; z-index: 2; top: 10px; left: 10px; font-size: 11px; font-weight: 700; color: #fff; background: var(--ok); padding: 1px 7px; border-radius: 999px; }

/* layout */
.layout-editor { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
.layout-stage { position: sticky; top: 92px; display: grid; gap: 12px; }
.layout-stage .tv { box-shadow: 0 0 0 7px #1c1c26, 0 16px 40px rgba(0, 0, 0, .25); margin: 7px; }
.stage-caption { font-size: 13px; color: var(--muted); text-align: center; }
.zones { display: grid; gap: 10px; }
.zone-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.zone-card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.zone-top { display: flex; align-items: center; gap: 11px; padding: 11px 12px; cursor: pointer; }
.zone-top .zicon { width: 42px; flex: none; }
.zone-top .txt { flex: 1; min-width: 0; }
.zone-top .txt b { display: block; font-size: 14px; }
.zone-top .txt small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-body { padding: 4px 14px 16px; display: grid; gap: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.zone-mini { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.zone-mini i { position: absolute; background: var(--brand); border-radius: 2px; }
.pos-picker {
  display: grid; grid-template-columns: 22% 1fr 22%; grid-template-rows: 26% 1fr 26%; gap: 4px;
  width: 210px; aspect-ratio: 16 / 9; padding: 5px; border-radius: 10px; background: #1c1c26;
}
.pos-picker button { border: 0; border-radius: 5px; background: rgba(255, 255, 255, .14); cursor: pointer; transition: background .15s; color: rgba(255,255,255,.75); font-size: 10.5px; font-weight: 700; padding: 0; }
.pos-picker button:hover:not(:disabled) { background: rgba(255, 255, 255, .3); }
.pos-picker button.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.pos-picker button:disabled { opacity: .3; cursor: not-allowed; }
.content-pick { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
.content-pick .thumb { border-radius: 6px; }
.rhythm { display: grid; gap: 8px; }
.rhythm .every { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rhythm .every input { width: 76px; padding: 6px 9px; }

/* programación */
.sched-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.cal-card { overflow: hidden; }
.cal-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-toolbar .range { font-weight: 700; font-size: 15px; margin: 0 6px; }
.cal-toolbar .spacer { flex: 1; }
.cal-scroll { overflow: auto; max-height: calc(100vh - 230px); min-height: 420px; }
.cal { display: grid; grid-template-columns: 48px repeat(7, minmax(68px, 1fr)); position: relative; min-width: 540px; }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.cal-head.today { color: var(--brand-ink); }
.cal-head small { display: block; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.cal-head.today small { color: var(--brand-ink); }
.cal-hours { position: relative; }
.cal-hours div { height: 44px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-day { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 44px; cursor: cell; }
.cal-day.today { background-color: color-mix(in srgb, var(--brand) 4%, transparent); }
.cal-event {
  position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 4px 7px; font-size: 12px; line-height: 1.25; overflow: hidden;
  color: #fff; cursor: pointer; border: 2px solid var(--surface); box-shadow: var(--shadow-sm); text-align: left; font-family: inherit;
}
.cal-event b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event span { opacity: .92; font-variant-numeric: tabular-nums; }
.cal-event:hover { filter: brightness(1.06); z-index: 2; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.side-panel { display: grid; gap: 16px; position: sticky; top: 92px; }
.ev-list { display: grid; gap: 6px; }
.ev-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px 8px 0; border-radius: 9px; cursor: pointer; }
.ev-row:hover { background: var(--surface-2); }
.ev-row .sw { width: 4px; align-self: stretch; border-radius: 4px; }
.ev-row b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-row small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-row .ord { display: flex; flex-direction: column; }
.ev-row .ord button { width: 24px; height: 18px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; display: grid; place-items: center; border-radius: 4px; }
.ev-row .ord button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.ev-row .ord button:disabled { opacity: .3; cursor: default; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; }
.days span {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-weight: 700; font-size: 13px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted);
}
.days input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.days input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.quick-days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* ---------- pantallas */

.screens-table { padding: 0; overflow: hidden; }
.screens-table table { width: 100%; border-collapse: collapse; }
.screens-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; background: var(--surface-2); white-space: nowrap; }
.screens-table td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.screens-table .sname { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.screens-table .sname b { display: block; cursor: pointer; }
.screens-table .sname b:hover { color: var(--brand-ink); }
.screens-table .sname small { display: block; color: var(--muted); font-size: 12.5px; }
.screens-table select { min-width: 190px; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.state small { color: var(--muted); font-weight: 500; }
.showing { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.showing .thumb { width: 52px; border-radius: 5px; flex: none; }
.showing span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-pill { font: 700 13px ui-monospace, Menlo, monospace; letter-spacing: .1em; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }

/* asistente para conectar una pantalla */
.wizard { display: grid; gap: 18px; }
.wiz-steps { display: flex; gap: 6px; }
.wiz-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); }
.wiz-steps span.on { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.device {
  position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 22px 12px 16px;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s, background .15s;
}
.device:hover { border-color: var(--border-strong); }
.device.sel { border-color: var(--brand); background: var(--brand-soft); }
.device .ico { width: 34px; height: 34px; color: var(--text-2); }
.device b { font-size: 15px; }
.device small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.device .flag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--surface); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.wiz-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 22px; align-items: center; }
.howto { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: how; }
.howto > li { counter-increment: how; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 14.5px; }
.howto > li::before { content: counter(how); width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.howto ol { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; }
.code-tv { position: relative; aspect-ratio: 16 / 10; border: 7px solid #23232e; border-radius: 12px; display: grid; place-items: center; text-align: center; color: #fff;
  background: radial-gradient(circle at 20% 20%, #2a1f6b 0, transparent 50%), radial-gradient(circle at 80% 85%, #5a1a45 0, transparent 50%), #0a0a12; }
.code-tv .big { font: 800 clamp(20px, 5vw, 34px) ui-monospace, Menlo, monospace; letter-spacing: .14em; }
.code-tv small { opacity: .7; font-size: 12px; }
.code-tv .line { font-size: 12px; opacity: .75; margin-bottom: 6px; }
.code-input {
  font: 800 30px ui-monospace, Menlo, monospace; letter-spacing: .32em; text-align: center; text-transform: uppercase;
  padding: 14px 10px 14px calc(10px + .32em); border-radius: 14px; background: var(--surface-2);
}
.success { text-align: center; display: grid; gap: 8px; justify-items: center; padding-top: 6px; }
.success .ok-badge { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.success .ok-badge .ico { width: 28px; height: 28px; }
.copy {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2); border-radius: 10px; padding: 7px 7px 7px 13px; margin: 6px 0;
}
.copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.copy.big code { font-size: 19px; font-weight: 700; color: var(--brand-ink); }

/* instalación */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
.steps > li {
  counter-increment: step; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px 20px 18px 66px;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 18px; top: 17px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.steps h3 { margin-bottom: 6px; font-size: 16px; }
.steps p { margin: 6px 0; }
.steps ol { margin: 8px 0; padding-left: 20px; }
.steps li li { margin: 4px 0; }
.pill-ok, .pill-warn { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- ventanas (modal) */

.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
  padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal.wide { width: min(860px, calc(100vw - 24px)); }
.modal.xwide { width: min(1000px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(10, 10, 20, .5); backdrop-filter: blur(2px); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 26px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px 22px; }
.modal-head h2 { display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 4px 22px 18px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .form-error { flex: 1; }
.modal-foot .left { margin-right: auto; }
.screen-pick { display: grid; gap: 6px; }
.screen-pick label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 14px; }
.screen-pick label small { margin-left: auto; color: var(--muted); font-weight: 500; }
.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* ---------- toast */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #16161f; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: opacity .2s, transform .2s; z-index: 70;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ---------- responsive */

@media (max-width: 1180px) {
  .pricing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card .auth-brand { display: flex; }
  .plan-now { grid-template-columns: 1fr; }
  .welcome-grid, .dash-grid, .layout-editor, .sched-editor { grid-template-columns: 1fr; }
  .layout-stage, .side-panel { position: static; }
}

@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; --side-w: 264px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(10, 10, 20, .35); }
  #collapseBtn { display: none; }
  .shell.collapsed .brand span, .shell.collapsed .side-nav a span, .shell.collapsed .nav-label,
  .shell.collapsed .side-link span, .shell.collapsed .sync span, .shell.collapsed .nav-badge { display: revert; }
  .mobile-bar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 16;
    padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .view { padding: 20px 16px 64px; }
  .plan-bar { padding: 10px 16px; flex-wrap: wrap; }
  .viewer-note { margin: 12px 16px 0; }
  .row3, .roles { grid-template-columns: 1fr; }
  .team-table .hide-sm { display: none; }
  .editor-bar { margin: -20px -16px 18px; padding: 12px 16px; top: 57px; }
  .title-input { font-size: 18px; order: 3; flex-basis: 100%; }
  .editor-bar .head-actions { order: 4; flex-basis: 100%; justify-content: flex-end; flex-wrap: nowrap; }
  .editor-bar .head-actions .btn { padding: 7px 11px; font-size: 13.5px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .device-grid, .wiz-cols, .tpl-row { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2 { grid-template-columns: 1fr; }
  .screens-table thead { display: none; }
  .screens-table tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px; border-top: 1px solid var(--border); }
  .screens-table td { padding: 0; border: 0; }
  .screens-table td.c-content, .screens-table td.c-showing { grid-column: 1 / -1; }
  .screens-table .sname { min-width: 0; }
  .screens-table select { width: 100%; }
  .media-list .hide-sm { display: none; }
  .steps > li { padding-left: 56px; }
  .steps > li::before { left: 14px; }
}

@media (max-width: 520px) {
  .pricing { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .value { font-size: 24px; }
  .steps4 { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cards { grid-template-columns: 1fr; }
}

/* admin.kantu.app */
.sa-auth { grid-template-columns: 1fr; }
.sa-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.sa-top .brand .chip { margin-left: 4px; }
.sa-me { display: flex; align-items: center; gap: 10px; }
.sa-view { padding: 28px 24px 72px; max-width: 1320px; margin: 0 auto; }
.sa-signups { margin-bottom: 20px; }
.sa-view .toolbar select { width: auto; min-width: 190px; }
.sa-signups h2 { font-size: 15px; margin-bottom: 14px; }
.sa-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.sa-bars i { flex: 1; background: var(--brand); border-radius: 4px 4px 1px 1px; min-width: 3px; }
.sa-bars i.zero { background: var(--surface-3); }
.sa-bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.sa-table td small.muted { font-size: 12px; }
.sa-h3 { font-size: 14px; margin: 20px 0 8px; }
.sa-pass { font-size: 22px; text-align: center; padding: 12px; user-select: all; }
@media (max-width: 900px) { .sa-kpis { grid-template-columns: 1fr 1fr; } .sa-table { overflow-x: auto; } }

/* instalar: ayuda plegable */
.more-help { margin-top: 10px; }
.more-help summary { cursor: pointer; font-weight: 600; color: var(--brand-ink); }
.more-help[open] summary { margin-bottom: 8px; }
