/* ============================================================
   ClipForge Studio · tema oscuro profesional
   ============================================================ */
:root {
  --bg: #08090d;
  --bg-soft: #0d0f16;
  --panel: #11141d;
  --panel-2: #161a26;
  --line: #232838;
  --line-soft: #1b1f2c;
  --text: #e8ebf2;
  --muted: #8b94a7;
  --muted-2: #6b7488;
  --accent: #6d5efc;
  --accent-2: #9b8cff;
  --accent-soft: #6d5efc22;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #38bdf8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .45);
  --font: "Segoe UI", system-ui, -apple-system, Inter, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 75% -10%, #1a1640 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 34px; line-height: 1.15; }
h3 { font-size: 17px; }
p { margin: 0; color: var(--muted); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #252b3c; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 246px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 26px;
  padding: 24px 18px; background: #0a0c12cc; backdrop-filter: blur(18px);
  border-right: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #7c6cff, #4f3ff0);
  color: #fff; box-shadow: 0 8px 24px #6d5efc55;
}
.brand .logo svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand span { font-size: 11px; letter-spacing: .16em; color: var(--muted-2); text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 11px; font-size: 13.5px; text-align: left;
  transition: background .15s, color .15s;
}
.nav button:hover { background: #ffffff08; color: var(--text); }
.nav button.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav-count {
  margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted);
  background: #ffffff0a; border: 1px solid var(--line); padding: 1px 7px; border-radius: 20px;
}
.nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: #2b3240; }
.nav-dot.on { background: var(--red); box-shadow: 0 0 0 4px #ef444422; animation: pulse 1.6s infinite; }

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.health-card {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px;
}
.health-card strong { display: block; font-size: 12px; }
.health-card small { color: var(--muted-2); font-size: 11px; }
.health-card .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.health-card.ok .pulse { background: var(--green); box-shadow: 0 0 0 4px #22c55e22; }
.health-card.bad .pulse { background: var(--red); box-shadow: 0 0 0 4px #ef444422; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 34px 16px; position: sticky; top: 0; z-index: 20;
  background: linear-gradient(var(--bg) 70%, transparent);
}
#pageTitle { font-size: 24px; }
#pageSub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.jobs-pill {
  display: flex; align-items: center; gap: 9px; background: var(--panel);
  border: 1px solid var(--line); color: var(--muted); padding: 8px 13px;
  border-radius: 30px; font-size: 12px; white-space: nowrap;
}
.jobs-pill.busy { color: var(--text); border-color: #3a3566; background: #141228; }
.spinner {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #ffffff22;
  border-top-color: var(--accent-2); display: none;
}
.jobs-pill.busy .spinner { display: block; animation: spin 1s linear infinite; }

.scroll { padding: 4px 34px 60px; max-width: 1500px; width: 100%; }
.view { animation: fade .22s ease; }

/* ---------------- primitives ---------------- */
.card {
  background: linear-gradient(180deg, #12151f, #0f1219);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: 0 1px 0 #ffffff05 inset;
}
.muted { color: var(--muted); font-size: 13px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 30px 0 14px;
}
.eyebrow {
  display: inline-block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 700;
}
.eyebrow.live { color: #ff5c75; }

button.primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #7b6cff, #5b4cf0); color: #fff; border: 0;
  padding: 11px 18px; border-radius: 11px; font-weight: 600; font-size: 13.5px;
  box-shadow: 0 8px 22px #6d5efc33; transition: transform .12s, box-shadow .12s;
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px #6d5efc55; }
button.primary:disabled { opacity: .5; transform: none; cursor: not-allowed; }
button.primary.small, button.ghost.small { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
button.ghost {
  display: inline-flex; align-items: center; gap: 7px;
  background: #ffffff06; border: 1px solid var(--line); color: var(--text);
  padding: 10px 15px; border-radius: 10px; font-size: 13px;
}
button.ghost:hover { background: #ffffff0d; border-color: #303749; }
a.ghost {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  background: #ffffff06; border: 1px solid var(--line); color: var(--text);
  padding: 10px 15px; border-radius: 10px; font-size: 13px;
}
a.ghost:hover { background: #ffffff0d; border-color: #303749; }
button.danger { color: #ff8f8f; border-color: #55262c; background: #ef44440f; }
button.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--muted);
}
button.icon-btn:hover { color: var(--text); }

input, select, textarea {
  background: #0c0e15; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; outline: none; width: 100%;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: #4b44a8; box-shadow: 0 0 0 3px #6d5efc22; }
input::placeholder, textarea::placeholder { color: #5b6377; }
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b94a7' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline > span { white-space: nowrap; }
.field.inline select { width: auto; min-width: 92px; padding-block: 7px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }

/* ---------------- hero ---------------- */
.hero {
  position: relative; overflow: hidden; padding: 38px 38px 26px; margin-top: 4px;
  background:
    radial-gradient(700px 260px at 88% 0%, #3b2f8a55, transparent 65%),
    linear-gradient(180deg, #131624, #0d1017);
}
.hero-glow {
  position: absolute; inset: auto -80px -140px auto; width: 380px; height: 380px;
  background: radial-gradient(circle, #6d5efc33, transparent 65%); filter: blur(10px);
  pointer-events: none;
}
.hero-copy { max-width: 760px; position: relative; }
.hero h2 { margin: 12px 0 12px; font-size: 40px; }
.hero h2 span { background: linear-gradient(90deg, #a99bff, #6d5efc 55%, #4fd1ff);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 660px; font-size: 14px; }
.link-box { display: flex; gap: 10px; margin-top: 26px; position: relative; z-index: 1; }
.link-input { position: relative; flex: 1; }
.link-input svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.link-input input { padding: 15px 16px 15px 44px; font-size: 14px; border-radius: 13px; background: #0a0c12; }
.hero-options { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.platform-strip { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.platform-strip > span { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .12em; }
.platform-strip ul { display: flex; gap: 7px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.platform-strip li {
  font-size: 11.5px; color: var(--muted); background: #ffffff06;
  border: 1px solid var(--line-soft); padding: 3px 9px; border-radius: 20px;
}

/* ---------------- grids / cards ---------------- */
.grid { display: grid; gap: 16px; }
.grid.sources { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.grid.clips { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.accounts { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid.platforms { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.live-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

.search { display: flex; align-items: center; gap: 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; min-width: 220px; }
.search svg { color: var(--muted-2); width: 15px; }
.search input { border: 0; background: transparent; padding: 9px 0; box-shadow: none; }
.search input:focus { box-shadow: none; }

.source-card { position: relative; overflow: hidden; transition: border .15s, transform .15s; }
.source-card:hover { border-color: #323a52; transform: translateY(-2px); }
.source-thumb { position: relative; aspect-ratio: 16/9; background: #0a0c12; overflow: hidden; }
.source-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.source-thumb .badge { position: absolute; left: 10px; top: 10px; }
.source-thumb .dur { position: absolute; right: 10px; bottom: 10px; }
.source-body { padding: 13px 15px 15px; display: grid; gap: 8px; }
.source-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.source-meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted-2); }
.source-actions { display: flex; gap: 7px; margin-top: 2px; }
.source-actions button { flex: 1; justify-content: center; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 20px;
  background: #0b0d13cc; border: 1px solid #ffffff14; color: #cfd5e2; backdrop-filter: blur(6px);
}
.badge.youtube { color: #ff7a7a; border-color: #ff003355; }
.badge.twitch { color: #c4a7ff; border-color: #9147ff55; }
.badge.kick { color: #8dff9e; border-color: #53fc1855; }
.badge.tiktok { color: #7ef7f0; border-color: #00f2ea55; }
.badge.instagram { color: #ff9ec2; border-color: #e1306c55; }
.badge.x { color: #e7e9ea; }
.badge.local { color: #ffd28d; border-color: #f59e0b55; }
.badge.dur { background: #000000b8; color: #fff; border: 0; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.status.listo i, .status.publicada i, .status.completado i { background: var(--green); }
.status.renderizando i, .status.en_cola i, .status.publicando i, .status.ejecutando i { background: var(--amber); animation: pulse 1.4s infinite; }
.status.error i, .status.detenido i { background: var(--red); }
.status.descargando i, .status.analizando i { background: var(--blue); animation: pulse 1.4s infinite; }

.progress { height: 4px; border-radius: 4px; background: #ffffff0d; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #6d5efc, #4fd1ff); transition: width .4s ease; }

/* ---------------- clips ---------------- */
.clip-card { overflow: hidden; display: flex; flex-direction: column; transition: border .15s; }
.clip-card:hover { border-color: #323a52; }
.clip-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.clip-thumb { position: relative; aspect-ratio: 9/16; background: #07080c; overflow: hidden; }
.clip-thumb img, .clip-thumb video { width: 100%; height: 100%; object-fit: cover; }
.clip-thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center; border: 0;
  background: linear-gradient(180deg, transparent 40%, #000000b8); color: #fff;
}
.clip-thumb .play svg { width: 42px; height: 42px; padding: 12px; border-radius: 50%;
  background: #00000088; backdrop-filter: blur(4px); }
.clip-thumb .score { position: absolute; top: 8px; left: 8px; }
.clip-thumb .pick { position: absolute; top: 8px; right: 8px; z-index: 2; }
.clip-thumb .pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.clip-thumb .dur { position: absolute; right: 8px; bottom: 8px; }
.clip-body { padding: 11px 12px; display: grid; gap: 7px; }
.clip-title { font-size: 12.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 10px; color: var(--muted); background: #ffffff07; border-radius: 5px; padding: 1px 6px; }
.clip-actions { display: flex; gap: 6px; margin-top: 2px; }
.clip-actions button { flex: 1; justify-content: center; padding: 6px 8px; font-size: 11.5px; }

.bulkbar {
  position: sticky; top: 74px; z-index: 15; display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding: 10px 14px; background: #1a1830ee; backdrop-filter: blur(10px);
  border: 1px solid #3b3670; border-radius: 12px;
}
.bulkbar span { font-size: 12.5px; font-weight: 600; margin-right: auto; }

/* ---------------- tabs / table ---------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin: 6px 0 18px; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line-soft);
  padding: 4px; border-radius: 11px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 0; color: var(--muted); font-size: 12.5px;
  padding: 7px 13px; border-radius: 8px; }
.tabs button.active { background: #ffffff0c; color: var(--text); }
.tabs button:hover { color: var(--text); }

.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; color: var(--muted-2); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #ffffff03; }
.table .clip-mini { display: flex; align-items: center; gap: 10px; }
.table .clip-mini img { width: 34px; height: 52px; object-fit: cover; border-radius: 6px; background: #000; }
.table .clip-mini div { max-width: 280px; }
.table .clip-mini strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .clip-mini small { color: var(--muted-2); }

/* ---------------- live ---------------- */
.live-start { padding: 26px 28px; background:
  radial-gradient(600px 200px at 10% 0%, #ef44441c, transparent 60%),
  linear-gradient(180deg, #131624, #0d1017); }
.live-head h2 { font-size: 24px; margin: 8px 0 8px; }
.live-head p { max-width: 720px; }
.live-card { padding: 18px; display: grid; gap: 12px; }
.live-card .live-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.live-console {
  font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; line-height: 1.6;
  background: #06070a; border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 10px 12px; height: 170px; overflow: auto; color: #9fb0c6; white-space: pre-wrap;
}
.live-console .hot { color: #ff9d9d; }
.live-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.live-rec { display: inline-flex; align-items: center; gap: 6px; color: #ff7a8d; font-size: 11px;
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.live-rec i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d6a; animation: pulse 1.2s infinite; }

/* ---------------- accounts ---------------- */
.platform-card { padding: 16px; display: grid; gap: 12px; }
.platform-top { display: flex; align-items: center; gap: 10px; }
.platform-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #08090d; }
.platform-card h4 { font-size: 13.5px; }
.platform-card p { font-size: 11.5px; }
.cred-form { display: grid; gap: 8px; }
.cred-form input { padding: 8px 10px; font-size: 12px; }
.account-card { padding: 16px; display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #232838; display: grid;
  place-items: center; font-weight: 700; color: #cfd5e2; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-card .meta { flex: 1; min-width: 0; }
.account-card .meta strong { display: block; font-size: 13px; }
.account-card .meta small { color: var(--muted-2); font-size: 11.5px; }
.account-actions { display: flex; gap: 6px; }

/* ---------------- settings ---------------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.settings-card { padding: 20px 22px; display: grid; gap: 16px; align-content: start; }
.settings-card h3 { padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.health-detail { display: grid; gap: 9px; }
.health-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.health-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.health-row.ok i { background: var(--green); }
.health-row span { color: var(--muted); }
.health-row strong { margin-left: auto; font-weight: 600; font-size: 11.5px; color: var(--muted); }
.sticky-actions { position: sticky; bottom: 18px; z-index: 10; }

/* ---------------- empty / loading ---------------- */
.empty { grid-column: 1 / -1; display: grid; place-items: center; gap: 12px;
  padding: 54px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted-2); background: #ffffff02; }
.empty svg { width: 34px; height: 34px; opacity: .5; }
.empty strong { color: var(--text); font-size: 14px; }
.empty p { max-width: 420px; font-size: 12.5px; }
.skeleton { height: 120px; border-radius: var(--radius); background:
  linear-gradient(90deg, #11141d 25%, #171b27 37%, #11141d 63%);
  background-size: 400% 100%; animation: shimmer 1.3s infinite; }

/* ---------------- modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: #04050ac9; backdrop-filter: blur(7px);
  display: flex; justify-content: center; align-items: flex-start; padding: 4vh 20px;
  overflow: auto; animation: fade .16s ease;
}
.modal {
  width: min(980px, 100%); background: #0e1118; border: 1px solid #2a3042;
  border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; animation: rise .2s ease;
}
.modal.wide { width: min(1180px, 100%); }
.modal.narrow { width: min(520px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0;
  background: #0e1118f2; backdrop-filter: blur(8px); z-index: 2; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 22px; display: grid; gap: 20px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line-soft); display: flex;
  justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: #0e1118f2; }
.modal-close { background: #ffffff08; border: 1px solid var(--line); color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }

/* workbench */
.workbench { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr); gap: 22px; }
.wb-left, .wb-right { display: grid; gap: 16px; align-content: start; min-width: 0; }
.player { border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line-soft); }
.player video { width: 100%; max-height: 380px; display: block; background: #000; }
.timeline { position: relative; height: 52px; border-radius: 10px; overflow: hidden;
  background: #0a0c12; border: 1px solid var(--line-soft); cursor: crosshair; }
.timeline canvas { width: 100%; height: 100%; display: block; }
.timeline .marker { position: absolute; top: 0; bottom: 0; width: 2px; background: #ff5c75; }
.wb-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.wb-meta .badge { background: #ffffff07; }
.transcript { max-height: 220px; overflow: auto; display: grid; gap: 3px; padding-right: 6px; }
.transcript button { display: flex; gap: 10px; text-align: left; background: transparent; border: 0;
  padding: 5px 7px; border-radius: 7px; color: var(--muted); font-size: 12px; }
.transcript button:hover { background: #ffffff07; color: var(--text); }
.transcript time { color: var(--accent-2); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; }
.mode-tabs { display: flex; gap: 4px; background: #0a0c12; border: 1px solid var(--line-soft);
  padding: 4px; border-radius: 10px; }
.mode-tabs button { flex: 1; background: transparent; border: 0; color: var(--muted);
  font-size: 12px; padding: 7px; border-radius: 7px; }
.mode-tabs button.active { background: #ffffff0d; color: var(--text); }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

.publish-accounts { display: grid; gap: 8px; max-height: 230px; overflow: auto; }
.publish-account { display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer; }
.publish-account:hover { background: #ffffff04; }
.publish-account input { width: 16px; height: 16px; accent-color: var(--accent); }
.publish-account .avatar { width: 28px; height: 28px; font-size: 11px; }
.publish-account strong { font-size: 12.5px; }
.publish-account small { color: var(--muted-2); font-size: 11px; }

/* ---------------- toasts ---------------- */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 10px;
  width: min(380px, calc(100vw - 44px)); }
.toast { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-radius: 12px;
  background: #151926f2; border: 1px solid #2b3245; box-shadow: var(--shadow);
  animation: rise .18s ease; font-size: 12.5px; }
.toast i { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--blue); }
.toast.ok i { background: var(--green); }
.toast.err i { background: var(--red); }
.toast strong { display: block; font-size: 12.5px; margin-bottom: 1px; }
.toast span { color: var(--muted); }

/* ---------------- misc ---------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.link-btn { background: transparent; border: 0; color: var(--accent-2); padding: 0; font-size: 12px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: Consolas, monospace; font-size: 11.5px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (max-width: 1080px) {
  .sidebar { width: 78px; padding: 20px 12px; }
  .brand div:last-child, .nav button em, .sidebar-foot .ghost { display: none; }
  .nav button { justify-content: center; padding: 12px; }
  .nav button svg { width: 20px; height: 20px; }
  .health-card { justify-content: center; }
  .health-card div { display: none; }
  .workbench { grid-template-columns: 1fr; }
  .hero h2 { font-size: 30px; }
}
@media (max-width: 720px) {
  .scroll, .topbar { padding-left: 16px; padding-right: 16px; }
  .app { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center;
    gap: 10px; padding: 12px 14px; overflow-x: auto; }
  .nav { flex-direction: row; }
  .brand { display: none; }
  .sidebar-foot { display: none; }
  .hero { padding: 26px 20px; }
  .hero h2 { font-size: 26px; }
  .link-box { flex-direction: column; }
  .grid.clips { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .topbar { padding-top: 14px; }
}

/* ============================================================
   Autenticación, cuenta, exportación manual y administración
   ============================================================ */
.modal-overlay[hidden] { display: none; }

/* ---------------- tarjeta de usuario (barra lateral) ---------------- */
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px;
}
.user-card .avatar { width: 34px; height: 34px; font-size: 12px; }
.user-card > div { min-width: 0; }
.user-card strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card small { color: var(--muted-2); font-size: 10.5px; }

/* ---------------- acceso ---------------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 32px 20px; }
.auth-wrap { width: min(430px, 100%); display: grid; gap: 22px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 11px; }
.auth-brand .logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #7c6cff, #4f3ff0); color: #fff;
  box-shadow: 0 8px 24px #6d5efc55;
}
.auth-brand .logo svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.auth-brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.auth-brand span { font-size: 10px; letter-spacing: .16em; color: var(--muted-2); text-transform: uppercase; }
.auth-card { padding: 30px; display: grid; gap: 14px; }
.auth-card h1 { font-size: 26px; }
.auth-card > p { color: var(--muted); font-size: 13px; margin: 0; }
.auth-card form { display: grid; gap: 14px; margin-top: 4px; }
.auth-card form .primary { justify-content: center; margin-top: 4px; }
.auth-error {
  background: #ef44441a; border: 1px solid #ef444455; color: #ffb3b3;
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px;
}
.auth-foot { text-align: center; font-size: 12px; color: var(--muted-2); margin: 0; line-height: 1.6; }

/* ---------------- mi cuenta ---------------- */
.account-info { display: grid; }
.account-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.account-row:last-child { border-bottom: 0; padding-bottom: 0; }
.account-row span { color: var(--muted); }
.account-row strong { font-weight: 600; text-align: right; word-break: break-word; }

/* ---------------- exportación manual ---------------- */
.export-steps {
  display: grid; gap: 7px; background: #0a0c12; border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 13px 15px; font-size: 12.5px; color: var(--muted);
}
.export-steps strong { color: var(--accent-2); margin-right: 4px; }
.copy-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.export-list { display: grid; gap: 8px; max-height: 340px; overflow: auto; }
.export-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px;
}
.export-row strong { display: block; font-size: 12.5px; }
.export-row small { color: var(--muted-2); font-size: 11px; }

/* ---------------- administración ---------------- */
.admin-body { min-height: 100vh; }
.admin-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: #08090de6; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #7c6cff, #4f3ff0); color: #fff;
  box-shadow: 0 8px 24px #6d5efc55;
}
.admin-brand .logo svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.admin-brand strong { display: block; font-size: 14.5px; letter-spacing: -.02em; }
.admin-brand span { font-size: 10px; letter-spacing: .16em; color: var(--muted-2); text-transform: uppercase; }
.admin-top-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.admin-me {
  font-size: 12px; color: var(--muted); padding-right: 4px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.admin-main {
  max-width: 1500px; margin: 0 auto; padding: 30px 28px 70px;
  display: grid; gap: 22px;
}
.admin-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.admin-hero h1 { font-size: 32px; margin: 8px 0 10px; }
.admin-hero p { max-width: 720px; color: var(--muted); font-size: 13px; margin: 0; line-height: 1.6; }
.admin-hero-side {
  max-width: 300px; padding: 12px 14px; border: 1px dashed var(--line);
  border-radius: 12px; background: #ffffff03;
}

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric { padding: 15px 17px; display: grid; gap: 3px; min-height: 104px; align-content: center; }
.metric > span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.metric strong { font-size: 27px; line-height: 1.1; letter-spacing: -.03em; }
.metric strong.ok { color: #7ee2a8; }
.metric strong.warn { color: #ffce7a; }
.metric strong.bad { color: #ff9d9d; }
.metric small { font-size: 11px; color: var(--muted-2); }

.admin-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.admin-panel { overflow: hidden; }
.admin-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.admin-panel-head h2 { font-size: 15px; }
.admin-panel-head p { margin-top: 3px; }
.admin-search { width: min(280px, 100%); }

.admin-table th:first-child, .admin-table td:first-child { padding-left: 20px; }
.admin-table th:last-child, .admin-table td:last-child { padding-right: 20px; }
.admin-table th.right, .admin-table td.right { text-align: right; }

.admin-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.admin-user .avatar { width: 34px; height: 34px; font-size: 12px; }
.admin-user strong { display: block; font-size: 12.5px; font-weight: 600; }
.admin-user small { color: var(--muted-2); font-size: 11.5px; }
.you {
  font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-2); background: var(--accent-soft); padding: 1px 5px;
  border-radius: 5px; margin-left: 5px;
}
.tag.plan { background: var(--accent-soft); color: var(--accent-2); border: 1px solid #6d5efc44; padding: 2px 8px; font-size: 10.5px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 20px; font-size: 10.5px; font-weight: 600; border: 1px solid transparent;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #7ee2a8; background: #22c55e14; border-color: #22c55e33; }
.pill.warn { color: #ffce7a; background: #f59e0b14; border-color: #f59e0b33; }
.pill.bad { color: #ff9d9d; background: #ef444414; border-color: #ef444433; }

.expiry strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; }
.expiry strong.bad { color: #ff9d9d; }
.expiry strong.warn { color: #ffce7a; }
.expiry small { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.usage { display: grid; gap: 2px; font-size: 11px; color: var(--muted-2); white-space: nowrap; }

.admin-actions { display: flex; gap: 5px; justify-content: flex-end; }
.admin-actions .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.admin-actions .icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.admin-actions .icon-btn:hover { color: var(--text); border-color: #3a4258; background: #ffffff0c; }
.admin-actions .icon-btn.soft-warn:hover { color: #ffce7a; border-color: #f59e0b55; background: #f59e0b12; }
.admin-actions .icon-btn.danger:hover { color: #ff9d9d; border-color: #ef444455; background: #ef444412; }
.admin-actions .icon-btn:disabled { opacity: .32; cursor: not-allowed; }
.admin-table tr.is-me td { background: #6d5efc08; }

.admin-new { padding: 20px; display: grid; gap: 16px; align-content: start; position: sticky; top: 84px; }
.admin-new .admin-panel-head { padding: 0; border: 0; }
.admin-form { display: grid; gap: 13px; }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-form textarea { resize: vertical; min-height: 62px; }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: #ffffff06; border: 1px solid var(--line); color: var(--muted);
  border-radius: 20px; padding: 5px 11px; font-size: 11.5px;
}
.chip:hover { color: var(--text); border-color: #303749; }
.chip.on { background: var(--accent-soft); border-color: #6d5efc66; color: var(--accent-2); }

.admin-empty { display: grid; place-items: center; gap: 8px; padding: 36px 20px; text-align: center; }
.admin-empty strong { font-size: 14px; }
.admin-empty p { color: var(--muted-2); font-size: 12px; margin: 0; }
.admin-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--muted); font-size: 12.5px; }

.admin-modal .modal-body > p { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.65; }
.credential-box { background: #0a0c12; border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; }
.cred-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px;
}
.cred-row:last-child { border-bottom: 0; }
.cred-row span { color: var(--muted); }
.cred-row strong { font-weight: 600; text-align: right; word-break: break-all; }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12.5px; letter-spacing: .02em; }
.danger-btn { background: linear-gradient(180deg, #f06060, #d63c3c) !important; box-shadow: 0 8px 22px #ef444433 !important; }

@media (max-width: 1180px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-new { position: static; }
}
@media (max-width: 1080px) {
  .user-card > div { display: none; }
  .user-card { justify-content: center; padding: 8px; }
}
@media (max-width: 720px) {
  .admin-top { padding: 12px 16px; }
  .admin-me { display: none; }
  .admin-main { padding: 20px 16px 50px; }
  .admin-hero h1 { font-size: 24px; }
  .admin-hero-side { max-width: 100%; }
  .admin-form-row { grid-template-columns: 1fr; }
  .admin-table th:nth-child(5), .admin-table td:nth-child(5) { display: none; }
  .admin-search { width: 100%; }
  .admin-panel-head { flex-direction: column; align-items: stretch; }
}

/* ---------------- mis redes ---------------- */
.grid.networks { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.networks-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
  padding: 26px 28px;
  background: radial-gradient(700px 260px at 8% -20%, #6d5efc1f, transparent 70%), var(--panel);
}
.networks-hero-copy h2 { font-size: 25px; margin: 8px 0; letter-spacing: -.02em; }
.networks-hero-copy p { max-width: 690px; }
.networks-stats { display: flex; gap: 10px; flex: none; }
.networks-stats > div {
  min-width: 124px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: #0a0c12; text-align: center;
}
.networks-stats strong { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.networks-stats small { color: var(--muted-2); font-size: 10.5px; }

.network-card { padding: 16px; display: grid; gap: 12px; align-content: start; transition: border .15s; }
.network-card:hover { border-color: #323a52; }
.network-top { display: flex; align-items: center; gap: 11px; min-width: 0; }
.network-logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  letter-spacing: .04em; color: var(--net, var(--accent-2));
  background: #ffffff07; border: 1px solid var(--line);
}
.network-meta { min-width: 0; }
.network-meta strong {
  display: block; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.network-meta small {
  display: block; color: var(--muted-2); font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.network-links { display: flex; gap: 7px; flex-wrap: wrap; }
.network-links a { flex: 1; justify-content: center; }
.network-links a.net-upload { color: var(--accent-2); border-color: #6d5efc55; background: var(--accent-soft); }
.network-actions { display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.network-actions button { flex: 1; justify-content: center; }

.network-form-card { margin-top: 16px; padding: 20px 22px; display: grid; gap: 14px; }
.network-form-head h3 { font-size: 15px; }
.network-form-head .hint { margin-top: 4px; }
.network-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.export-networks { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.export-networks > span { font-size: 11.5px; color: var(--muted-2); }

@media (max-width: 720px) {
  .networks-hero { flex-direction: column; align-items: stretch; padding: 20px; }
  .networks-stats { width: 100%; }
  .networks-stats > div { flex: 1; min-width: 0; }
}

/* ---------------- solicitudes de compra ---------------- */
.admin-requests { margin-bottom: 18px; }
.admin-requests .admin-panel-head { align-items: center; }
.admin-requests .tag.plan { font-size: 10.5px; }
.request-contact {
  max-width: 240px; color: var(--muted); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-actions .primary.small, .admin-actions .ghost.small {
  padding: 5px 10px; font-size: 11.5px; border-radius: 8px;
}
.admin-requests .admin-actions { align-items: center; }
