:root {
  --bg: #0d0e12;
  --bg-2: #121419;
  --card: #181b22;
  --card-2: #1f232c;
  --line: #2a2f3a;
  --text: #eceef3;
  --muted: #8d93a3;
  --faint: #5d6372;
  --accent: #ff7a45;
  --accent-2: #ffb15c;
  --accent-ink: #1a0d06;
  --accent-soft: rgba(255, 122, 69, .14);
  --ok: #3ecf8e;
  --ok-soft: rgba(62, 207, 142, .14);
  --warn: #f5b942;
  --warn-soft: rgba(245, 185, 66, .14);
  --err: #ff5d6c;
  --err-soft: rgba(255, 93, 108, .14);
  --info: #6aa8ff;
  --info-soft: rgba(106, 168, 255, .14);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.25);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f3ef;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f4f1ec;
  --line: #e5e1d9;
  --text: #1b1c20;
  --muted: #6a6e79;
  --faint: #9a9da6;
  --accent: #e8612c;
  --accent-2: #f59b3d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(232, 97, 44, .1);
  --ok: #17a36a;
  --ok-soft: rgba(23, 163, 106, .1);
  --warn: #c98a0c;
  --warn-soft: rgba(201, 138, 12, .12);
  --err: #dc3446;
  --err-soft: rgba(220, 52, 70, .1);
  --info: #2f74e0;
  --info-soft: rgba(47, 116, 224, .1);
  --shadow: 0 1px 2px rgba(30, 25, 15, .05), 0 8px 24px rgba(30, 25, 15, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; text-decoration: none; }
.brand-name { font-weight: 750; font-size: 19px; letter-spacing: -.02em; }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: -2px; }
.logo { width: 38px; height: 38px; flex: none; }
.logo .spin { transform-origin: 20px 20px; }
.busy .logo .spin { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 550; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--card-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font-weight: 700;
}

.main { min-width: 0; padding: 28px 36px 60px; max-width: 1320px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.025em; font-weight: 750; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-body { padding: 16px 20px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.cols-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.cols-2e { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.kpi .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi.hero { background: linear-gradient(140deg, var(--accent) 0%, var(--accent-2) 100%); border-color: transparent; color: var(--accent-ink); }
.kpi.hero .label, .kpi.hero .sub { color: inherit; opacity: .8; }
.kpi.hero .ico { background: rgba(0,0,0,.12); color: inherit; }
.meter { height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.meter.ok > span { background: var(--ok); }
.meter.warn > span { background: var(--warn); }
.meter.err > span { background: var(--err); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s, opacity .15s;
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; height: 34px; }
.btn.block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- pills & badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--card-2); color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.live .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; background: var(--err); color: #fff; }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); background: var(--card-2); border-radius: 8px; padding: 3px 9px; }
.chip svg.i { width: 14px; height: 14px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label-sm { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
:root[data-theme="light"] .input, :root[data-theme="light"] .select, :root[data-theme="light"] .textarea { background: #fbfaf8; }
.textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid { border-color: var(--err); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-icon { position: relative; }
.input-icon svg.i { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.input-icon .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; margin: 8px 0 -4px; grid-column: 1 / -1; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch .txt b { display: block; font-weight: 600; }
.switch .txt span { font-size: 12.5px; color: var(--muted); }

.seg { display: inline-flex; background: var(--card-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* ---------- lists ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--card-2); flex: none; display: grid; place-items: center; color: var(--faint); }
.thumb.sm { width: 40px; height: 40px; border-radius: 8px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .big { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--accent-soft); color: var(--accent); }
.empty .big svg.i { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; }

/* ---------- fuentes ---------- */
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.source { display: flex; flex-direction: column; padding: 18px 20px; gap: 14px; position: relative; overflow: hidden; }
.source.paused { opacity: .62; }
.source .top { display: flex; align-items: flex-start; gap: 12px; }
.source h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.source .url { font-size: 12.5px; color: var(--faint); text-decoration: none; display: block; }
.source .url:hover { color: var(--accent); }
.source .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.source .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.source .num { background: var(--card-2); border-radius: 10px; padding: 8px 10px; }
.source .num b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.source .num span { font-size: 11.5px; color: var(--muted); }
.source .foot { display: flex; align-items: center; gap: 6px; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.source .err-line { font-size: 12.5px; color: var(--err); background: var(--err-soft); padding: 8px 10px; border-radius: 8px; word-break: break-word; }
.source .err-line.warn { color: var(--warn); background: var(--warn-soft); }
.live-box { background: var(--card-2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.live-box .t { font-weight: 600; font-size: 13px; }
.source::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.source.s-ok::before { background: var(--ok); }
.source.s-aviso::before { background: var(--warn); }
.source.s-error::before { background: var(--err); }
.source.s-running::before { background: var(--accent); }

/* ---------- jobs ---------- */
.job { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job .line1 { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.job .track-title { margin-top: 6px; font-size: 13px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq span { width: 3px; background: var(--accent); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: .2s; }
.eq span:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---------- recent grid ---------- */
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding: 16px 20px 20px; }
.tile { text-decoration: none; min-width: 0; }
.tile .art { aspect-ratio: 1; border-radius: 12px; background: var(--card-2) center/cover no-repeat; position: relative; overflow: hidden; display: grid; place-items: center; color: var(--faint); }
.tile .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,.45)); opacity: 0; transition: opacity .2s; }
.tile:hover .art::after { opacity: 1; }
.tile .t { font-weight: 600; font-size: 13px; margin-top: 8px; }
.tile .a { font-size: 12px; color: var(--muted); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--card-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.track-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; max-width: 520px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input-icon { flex: 1; min-width: 200px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- charts ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); transition: opacity .15s; }
.chart .bar:hover { opacity: .75; }
.chart .bar.zero { fill: var(--line); }
.chart .axis { fill: var(--faint); font-size: 11px; }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.hbar .lbl b { font-weight: 600; }
.hbar .bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.hbar .bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 90px; }
.hours div { background: var(--accent); border-radius: 3px 3px 0 0; min-height: 3px; opacity: .85; }
.hours-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* ---------- banners ---------- */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; margin-bottom: 16px; border: 1px solid; flex-wrap: wrap; }
.banner .grow { flex: 1; min-width: 200px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.banner b { display: block; }
.banner span { font-size: 13px; color: var(--muted); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.channel { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--card); }
.channel .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.channel .name { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.channel .logo-sq { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5, 6, 9, .6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s; }
.modal { width: min(680px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.45); animation: pop .18s ease-out; }
.modal.sm { width: min(440px, 100%); }
.modal.lg { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
details.adv summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; padding: 4px 0; }
details.adv[open] summary { margin-bottom: 12px; }
pre.log { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow: auto; margin: 8px 0 0; color: var(--muted); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: pop .2s ease-out; max-width: 420px; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--err); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 0% 0%, #2a1408 0%, #0d0e12 55%), #0d0e12; color: #f3eee9;
}
.login-art h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 16px; max-width: 14ch; }
.login-art h1 em { font-style: normal; background: linear-gradient(90deg, #ff7a45, #ffb15c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p { color: #a7a29c; max-width: 42ch; font-size: 15px; margin: 0; }
.vinyl { position: absolute; right: -180px; bottom: -180px; width: 560px; height: 560px; opacity: .55; animation: spin 18s linear infinite; z-index: 0; }
.login-art > :not(.vinyl) { position: relative; z-index: 1; }
.login-form-wrap { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: min(380px, 100%); }
.login-card h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.form-error { color: var(--err); background: var(--err-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* ---------- reproductor ---------- */
.player {
  position: fixed; left: 248px; right: 0; bottom: 0; z-index: 35; display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.player-meta { display: flex; flex-direction: column; min-width: 0; width: 220px; font-size: 13px; }
.player audio { flex: 1; min-width: 0; height: 38px; }
body.has-player .main { padding-bottom: 110px; }
body.has-player .toasts { bottom: 84px; }
.tile .play, .play-btn {
  position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.35); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; z-index: 1;
}
.tile:hover .play, .tile:focus-within .play { opacity: 1; transform: none; }
.tile .play svg.i { width: 16px; height: 16px; fill: currentColor; }
.qr { background: #fff; border-radius: 12px; padding: 8px; display: inline-block; line-height: 0; }
.qr svg { width: 200px; height: 200px; }

/* Usuario de solo lectura: se ocultan los controles que modifican datos */
.ro [data-admin], .ro [data-act], .ro [data-check], .ro [data-cancel], .ro #check-all, .ro #add,
.ro [data-new], .ro #oneoff-btn, .ro .tabs [data-tab]:not([data-tab="cuenta"]) { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2, .cols-2e { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 30; }
  .main { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 22px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; padding: 28px 20px; }
  .login-art h1 { font-size: 30px; }
  .vinyl { width: 300px; height: 300px; right: -110px; bottom: -130px; }
  .hide-sm { display: none; }
  .player { left: 0; padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .player-meta { width: auto; flex: 1; }
  .player audio { flex-basis: 100%; order: 3; }
  body.has-player .main { padding-bottom: 150px; }
  body.has-player .toasts { bottom: 130px; }
  .tile .play { opacity: 1; transform: none; }
}
@media (max-width: 520px) {
  .kpi .value { font-size: 24px; }
  .row { padding: 12px 14px; }
  .modal-body, .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
