@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@700;800&family=Gloria+Hallelujah&family=Poppins:wght@400;500;600;700&display=swap");
/* Marca API · Auto Post Igcia — paleta: turquesa #33d9c0, azul #00a6c0, lima #a6e65a, gris #3a4142 */
:root {
  --turq: #33d9c0; --blue: #00a6c0; --lime: #a6e65a; --gray: #3a4142;
  --bg: #f2f7f7; --panel: #ffffff; --ink: #1f2627; --muted: #5d6a6c; --line: #dde6e7; --soft: #e9f1f1;
  --accent: #33d9c0; --accent-ink: #0c1f1c; --accent-soft: #d9f7f2; --accent-text: #007f93;
  --ok: #3f8f2a; --warn: #d98200; --err: #e0384b; --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 45, .05), 0 4px 16px rgba(20, 40, 45, .06);
  --f-title: "Baloo 2", "Poppins", system-ui, sans-serif; --f-hand: "Gloria Hallelujah", "Poppins", cursive;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1d2223; --panel: #272d2e; --ink: #eef4f4; --muted: #a2aeb0; --line: #3a4142; --soft: #313839;
          --accent-soft: #1f4944; --accent-text: #33d9c0; --ok: #a6e65a; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent-text); text-decoration: none; }
h1 { font: 800 25px/1.2 var(--f-title); margin: 0; letter-spacing: .01em; }
.hand { font-family: var(--f-hand); }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh;
        display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 10px 16px; }
.wordmark { font: 800 30px/1 var(--f-title); letter-spacing: 1.5px; color: #0b1011; -webkit-text-stroke: 7px var(--turq); paint-order: stroke fill; padding: 4px 6px 0; }
.logo-sub { font: 400 12px/1.15 var(--f-hand); color: var(--muted); }
.nav-sec { font: 400 12.5px/1 var(--f-hand); color: var(--accent-text); padding: 14px 12px 5px; }
.nav a.cta { background: var(--accent); color: var(--accent-ink); font-weight: 600; margin-bottom: 4px; }
.nav a.cta:hover { background: var(--accent); filter: brightness(1.06); color: var(--accent-ink); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.badge { background: var(--warn); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; }
.nav .badge { margin-left: auto; background: var(--warn); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; }
.side .bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.user { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 700; color: var(--accent-text); }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.top .spacer { flex: 1; }
.content { padding: 24px 28px 60px; max-width: 1240px; }
.brand-switch select { font-weight: 600; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; left: -260px; width: 240px; transition: left .2s; box-shadow: var(--shadow); }
  .side.open { left: 0; }
  .menu-btn { display: inline-flex; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
}

/* ---------- componentes ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } .g5 { grid-template-columns: repeat(2, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }

.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover, button:hover { border-color: var(--muted); }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, button.primary:hover { filter: brightness(1.08); }
.btn.ghost, button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger, button.danger { color: var(--err); }
.btn.sm, button.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .6; cursor: wait; }

label.lbl { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; background: var(--accent-soft); color: var(--ink); }
.alert.err { background: color-mix(in srgb, var(--err) 14%, transparent); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.pill.published { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill.scheduled { background: var(--accent-soft); color: var(--accent-text); }
.pill.draft { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.failed { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }

.net { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; font-size: 14px; flex: none; }
.net.lg { width: 40px; height: 40px; border-radius: 12px; font-size: 21px; }
.net[title="Instagram"] { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%) !important; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* stats */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }

/* calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal .dow { padding: 8px 10px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; background: var(--soft); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; position: relative; }
.cal .day:nth-child(7n) { border-right: none; }
.cal .day.out { background: var(--soft); opacity: .6; }
.cal .num { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.cal .day.today .num b { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 7px; }
.cal .add { opacity: 0; font-size: 16px; line-height: 1; color: var(--muted); }
.cal .day:hover .add { opacity: 1; }
.chip { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 7px; margin-top: 4px; font-size: 12px; color: var(--ink);
        background: var(--soft); border-left: 3px solid var(--c); overflow: hidden; white-space: nowrap; }
.chip:hover { filter: brightness(.97); }
.chip .t { font-weight: 700; }
.chip.published { opacity: .75; }
.chip.failed { background: color-mix(in srgb, var(--err) 12%, transparent); }
.chip.draft { border-left-style: dashed; }
@media (max-width: 860px) { .cal .day { min-height: 74px; } .chip span.n { display: none; } }

/* composer */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; cursor: pointer; transition: .15s; background: var(--soft); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { font-size: 34px; }
.drop video, .drop img { max-width: 100%; max-height: 280px; border-radius: 10px; margin-top: 10px; }
.netpick { display: flex; flex-wrap: wrap; gap: 10px; }
.netpick label { display: flex; align-items: center; gap: 9px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; user-select: none; }
.netpick input { display: none; }
.netpick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.netpick label.off { opacity: .5; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* post */
.post-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .post-grid { grid-template-columns: 1fr; } }
.preview-media { width: 100%; border-radius: 12px; background: #000; max-height: 480px; object-fit: contain; display: block; }
.counter { font-size: 12px; color: var(--muted); text-align: right; }
.counter.over { color: var(--err); font-weight: 700; }
.net-card { border-top: 4px solid var(--c); }
.errbox { background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); border-radius: 10px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; margin-bottom: 10px; }

/* cuentas */
.acc { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.acc:last-child { border-bottom: none; }
.acc .info { flex: 1; min-width: 0; }
.acc .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent), var(--bg); }
.auth { width: 100%; max-width: 400px; }
.auth .card { padding: 30px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
pre.mono { display: block; padding: 12px; white-space: pre-wrap; }
details summary { cursor: pointer; font-weight: 600; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin-bottom: 10px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 12px; }

@media (max-width: 860px) {
  .top { gap: 8px; }
  .top h1 { font-size: 17px; }
  .brand-switch > .row, .legend { display: none !important; }
  .brand-switch select { max-width: 150px !important; padding: 8px 10px; }
  .cal .chip { padding: 2px 3px; font-size: 10.5px; }
  .cal .chip .t { font-weight: 600; }
}

/* biblioteca */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.lib-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.lib-thumb { aspect-ratio: 4 / 5; background: var(--soft); position: relative; display: grid; place-items: center; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib-kind { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.lib-used { position: absolute; right: 8px; top: 8px; background: var(--lime); color: #1c2a10; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.lib-body { padding: 10px 12px 12px; min-width: 0; }
.lib-body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
/* portadas */
.cover-box { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start; margin-top: 6px; padding: 12px; background: var(--soft); border-radius: 12px; }
.cover-box .cv { width: 110px; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--line); object-fit: cover; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.frame-pick video { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: #000; }
.frame-pick input[type=range] { width: 100%; }
@media (max-width: 600px) { .cover-box { grid-template-columns: 1fr; } }

/* ---------- TikTok (opciones de publicación) ---------- */
.tt-creator { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--soft); border-radius: 12px; }
.tt-creator img, .tt-creator .avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.check.off { opacity: .5; cursor: not-allowed; }
.tt-note { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-top: 8px; }
.tt-consent { margin: 14px 0 0; }
/* formato (Reel / Publicación / Historia) */
.seg label.off, .seg label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.fmt-row { margin-top: 14px; }
.fmt-row .lbl { display: flex; align-items: center; gap: 8px; }
.fmt-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.chip .fmt { font-size: 10px; font-weight: 700; color: var(--muted); flex: none; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 10px; max-height: 300px; overflow-y: auto; padding: 2px; }
.cover-opt { padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--soft); aspect-ratio: 9 / 16; overflow: hidden; cursor: pointer; }
.cover-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; width: 100%; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; color: var(--muted); cursor: pointer; line-height: 0; box-shadow: none; }
.pw-eye:hover { color: var(--ink); background: none; }
.pw-eye svg { width: 20px; height: 20px; }

/* ---------- vista previa de respuestas automáticas ---------- */
.pv-col { position: sticky; top: 84px; align-self: start; }
.pv-title { text-align: center; color: var(--accent-text); font: 400 15px/1.3 var(--f-hand); margin: 0 0 10px; }
.phone { width: 300px; max-width: 100%; margin: 0 auto; background: #0d1112; border: 9px solid #23292a; border-radius: 38px; padding: 0; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25); color: #eef4f4; font-size: 12.5px; }
.phone-top { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; border-bottom: 1px solid #23292a; }
.phone-top .pv-av { width: 28px; height: 28px; }
.phone-top b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-top .net { margin-left: auto; }
.phone-body { height: 470px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.pv-sec { align-self: center; font: 400 11.5px/1 var(--f-hand); color: var(--turq); margin: 6px 0 2px; }
.pv-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; background: #3a4142; color: #eef4f4; }
.pv-av.me { background: var(--turq); color: #0c1f1c; }
.pv-cm { display: flex; gap: 8px; align-items: flex-start; }
.pv-cm.reply { margin-left: 30px; }
.pv-cm b { font-size: 12px; } .pv-cm span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-msg { max-width: 82%; padding: 8px 11px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.pv-msg.them { align-self: flex-end; background: var(--turq); color: #0c1f1c; border-bottom-right-radius: 5px; }
.pv-msg.us { align-self: flex-start; background: #2a3031; border-bottom-left-radius: 5px; }
.pv-msg.empty { opacity: .5; font-style: italic; }
.pv-btn { display: block; margin-top: 8px; padding: 6px 10px; border-radius: 9px; background: #3a4142; text-align: center; font-weight: 600; }
.pv-note { align-self: center; text-align: center; font-size: 11px; color: #a2aeb0; max-width: 90%; }
@media (max-width: 860px) { .pv-col { position: static; } }
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-bottom: 8px; }
.car-item { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--soft); }
.car-item img, .car-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-n { position: absolute; left: 5px; top: 5px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; z-index: 1; }
.car-v { position: absolute; right: 6px; bottom: 5px; color: #fff; font-size: 13px; text-shadow: 0 1px 3px #000; }
