:root {
  --bg: #f6f7f9; --surface: #fff; --text: #16181d; --muted: #6b7280; --border: #e5e7eb;
  --accent: #fe2c55; --accent-2: #25c2c9; --ok: #15803d; --err: #b91c1c; --warn-bg: #fff7e6;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --surface: #181b21; --text: #e8eaed; --muted: #9aa0aa; --border: #2a2f37;
    --ok: #4ade80; --err: #f87171; --warn-bg: #2a2212;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
a:hover { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .6rem; }
input, select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .6rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: .4rem; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--accent); }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; padding: .35rem .7rem; border-radius: 8px; color: var(--muted); }
.topbar nav a.on { background: var(--bg); color: var(--text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.topbar-right form { margin: 0; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.25rem 16px 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.page-head h2 { margin: 0; }
.who { display: flex; gap: .8rem; align-items: center; }
.who img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: .5rem .9rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); color: #fff; }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--err); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg a { padding: .35rem .8rem; text-decoration: none; color: var(--muted); }
.seg a.on { background: var(--accent); color: #fff; }

.alert { background: var(--warn-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem 1rem; margin: 0 0 1rem; }
.alert.error { border-color: var(--err); color: var(--err); }
.alert.ok { border-color: var(--ok); color: var(--ok); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.kpi span { color: var(--muted); font-size: .8rem; }
.kpi b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kpi.hot b { color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.panel summary { cursor: pointer; font-weight: 600; }
.panel form { margin-top: .8rem; }
.row-form, .filters, .row, .bulk { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.bulk { margin: .5rem 0; align-items: center; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.grid3 small { font-weight: 400; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: .5rem .65rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
td.vid { display: flex; align-items: center; gap: .6rem; min-width: 260px; }
td.vid img { width: 36px; height: 48px; object-fit: cover; border-radius: 4px; flex: none; }
td.vid a { text-decoration: none; }
.r { text-align: right !important; }
.center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.up { color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.err { color: var(--err); }
.ok { color: var(--ok); }

.pill { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-weight: 600; cursor: default; }
button.pill { cursor: pointer; font-family: inherit; }
.pill.viral { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill.proj { background: var(--accent-2); color: #04292b; border-color: var(--accent-2); }
.pill.range { border-color: var(--accent-2); color: var(--accent-2); }
.pill.tag { font-weight: 500; }
.pill.live { color: var(--accent); border-color: var(--accent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.card { display: flex; gap: .7rem; padding: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; }
.card:hover { border-color: var(--accent); color: inherit; }
.card img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

.video-head { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; }
.video-head img { width: 150px; border-radius: var(--radius); }
.video-head .stack { flex: 1; min-width: 260px; }
.desc { font-size: 1.05rem; margin: 0; white-space: pre-wrap; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }

.login-card { max-width: 360px; margin: 12vh auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; }
.login-card h1 { color: var(--accent); }
.login-card .btn { width: 100%; padding: .65rem; }

/* Proyectos */
.mem { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; min-width: 140px; }
.mem .pill.proj { display: inline-flex; align-items: center; gap: .25rem; }
.mem .pill small { font-weight: 500; opacity: .8; }
.mem .x { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 .1rem; font-size: .9rem; line-height: 1; opacity: .7; }
.mem .x:hover { opacity: 1; }
.add-proj { font-size: .75rem; padding: .1rem .3rem; border-style: dashed; color: var(--muted); max-width: 130px; }
.pill.warn { border-color: var(--err); color: var(--err); }
.hot { color: var(--accent); font-weight: 600; }
.proj-card.on { border-color: var(--accent); }
.ghost-card { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); }
fieldset.accounts-pick { border: 1px solid var(--border); border-radius: 8px; display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: .5rem .8rem; margin: 0; }
fieldset.accounts-pick legend { font-weight: 500; padding: 0 .3rem; }
.panel ol { padding-left: 1.2rem; }

/* Cola de recolección */
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin: .5rem 0; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.topbar-right a.pill { text-decoration: none; }
.warn-text { color: var(--accent); font-weight: 600; font-size: .85rem; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: .35rem .8rem; font: inherit; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
label.inline { flex-direction: row; align-items: center; gap: .35rem; font-weight: 400; }
.danger-box { border: 1px solid var(--err); border-radius: var(--radius); padding: .8rem 1rem; }
.bulk-danger { margin-left: auto; display: inline-flex; gap: .5rem; align-items: center; }
