/* =========================================================
   AcadeRed — estilos compartidos (app + panel admin)
   Temas: data-theme="celeste|verde|azul|morado|rosado|rojo|amarillo|dorado|naranja"
   Modo:  data-mode="light|dark"
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --p: #06b6d4; --p2: #10b981; --p-ink: #ffffff;
  --bg: #f3f7f9; --bg2: #e9f1f4; --card: #ffffff; --card2: #f7fafb;
  --text: #0f1f2a; --muted: #5f7180; --line: #dde7ec;
  --danger: #e11d48; --ok: #059669; --warn: #d97706; --info: #0284c7;
  --shadow: 0 1px 2px rgba(15, 31, 42, .05), 0 8px 24px rgba(15, 31, 42, .06);
  --radius: 16px; --radius-sm: 10px;
  --sidebar: 252px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
[data-mode="dark"] {
  --bg: #0b1218; --bg2: #101a22; --card: #131f28; --card2: #182630;
  --text: #e6eef3; --muted: #8ea2b1; --line: #233541;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
  color-scheme: dark;
}
[data-theme="celeste"]  { --p: #06b6d4; --p2: #10b981; }
[data-theme="verde"]    { --p: #16a34a; --p2: #84cc16; }
[data-theme="azul"]     { --p: #2563eb; --p2: #06b6d4; }
[data-theme="morado"]   { --p: #7c3aed; --p2: #c026d3; }
[data-theme="rosado"]   { --p: #db2777; --p2: #fb7185; }
[data-theme="rojo"]     { --p: #dc2626; --p2: #f97316; }
[data-theme="amarillo"] { --p: #ca8a04; --p2: #f59e0b; --p-ink: #1c1400; }
[data-theme="dorado"]   { --p: #b8860b; --p2: #e0b84a; --p-ink: #1c1400; }
[data-theme="naranja"]  { --p: #ea580c; --p2: #f59e0b; }
:root { --p-soft: color-mix(in srgb, var(--p) 12%, transparent); --p-soft2: color-mix(in srgb, var(--p) 22%, transparent);
  --grad: linear-gradient(135deg, var(--p), var(--p2)); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--p); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .xs { font-size: .76rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; } .icon.lg { width: 26px; height: 26px; }

/* ---------- Botones e inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; cursor: pointer;
  padding: 10px 16px; border-radius: 12px; font: 600 .92rem var(--font); background: var(--card2); color: var(--text);
  border-color: var(--line); transition: transform .08s, filter .15s, background .15s; white-space: nowrap; text-decoration: none !important; }
.btn:hover { filter: brightness(.97); } .btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: var(--p-ink); border-color: transparent; box-shadow: 0 6px 18px var(--p-soft2); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--p-soft); }
.btn.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-color: transparent; }
.btn.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border-color: transparent; }
.btn.sm { padding: 6px 11px; font-size: .82rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 9px; border-radius: 11px; }
.btn:disabled { opacity: .55; pointer-events: none; }
label { font-weight: 600; font-size: .86rem; display: block; margin-bottom: 6px; }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search],
input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: 500 .95rem var(--font); outline: none; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--p); box-shadow: 0 0 0 4px var(--p-soft); }
.field { margin-bottom: 14px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; font-size: .92rem; margin: 0; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--p); } .switch input:checked::after { left: 21px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700;
  background: var(--p-soft); color: var(--p); white-space: nowrap; }
[data-theme="amarillo"] .badge, [data-theme="dorado"] .badge { color: color-mix(in srgb, var(--p) 75%, var(--text)); }
.badge.gray { background: var(--bg2); color: var(--muted); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.badge.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #3b2500; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--grad); color: var(--p-ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; text-transform: uppercase; overflow: hidden; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; } .avatar.lg { width: 92px; height: 92px; font-size: 2rem; }
.avatar-wrap { position: relative; display: inline-flex; }
.dot-online { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--card); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------- Layout de la app ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--card);
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none !important; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: var(--p-ink); font-size: 1.2rem; flex: none; overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--text); font-weight: 600; font-size: .92rem;
  text-decoration: none !important; position: relative; transition: background .12s; }
.nav-item:hover { background: var(--bg2); }
.nav-item.active { background: var(--p-soft); color: var(--p); }
[data-theme="amarillo"] .nav-item.active, [data-theme="dorado"] .nav-item.active { color: color-mix(in srgb, var(--p) 75%, var(--text)); }
.nav-item .emoji { width: 20px; text-align: center; font-size: 1.05rem; }
.nav-item .count { margin-left: auto; background: var(--danger); color: #fff; font-size: .7rem; border-radius: 99px; padding: 1px 7px; font-weight: 700; }
.nav-item .lock { margin-left: auto; font-size: .8rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 560px; position: relative; }
.search input { padding-left: 40px; border-radius: 99px; background: var(--card); }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text);
  background: transparent; border: 0; cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--bg2); }
.icon-btn .count { position: absolute; top: 4px; right: 3px; background: var(--danger); color: #fff; font-size: .62rem; border-radius: 99px;
  padding: 1px 5px; font-weight: 800; min-width: 16px; text-align: center; }
.content { padding: 22px 24px 90px; max-width: 1240px; width: 100%; margin: 0 auto; }
.announcement { background: var(--grad); color: var(--p-ink); padding: 9px 20px; text-align: center; font-weight: 600; font-size: .88rem; }
.bottom-nav { display: none; }
.mobile-only { display: none; }

/* ---------- Feed ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600;
  font-size: .86rem; white-space: nowrap; cursor: pointer; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { border-color: var(--p); }
.chip.active { background: var(--grad); color: var(--p-ink); border-color: transparent; }
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.feed-layout > *, .detail > *, .two > *, .three > * { min-width: 0; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; cursor: pointer; transition: transform .15s, box-shadow .15s; color: inherit; text-decoration: none !important; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15,31,42,.1); }
.post-cover { aspect-ratio: 16/10; background: var(--bg2); position: relative; overflow: hidden; display: grid; place-items: center; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover .kind-big { font-size: 3rem; }
.post-cover.locked { background: repeating-linear-gradient(135deg, var(--bg2), var(--bg2) 12px, var(--card2) 12px, var(--card2) 24px); }
.post-cover .lock-badge { position: absolute; inset: auto 10px 10px auto; }
.post-cover .sec-badge { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); }
.post-cover .pin-badge { position: absolute; right: 10px; top: 10px; }
.post-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-title { font-weight: 700; font-size: 1rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-desc { color: var(--muted); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.post-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin-top: auto; flex-wrap: wrap; }
.post-meta span { display: inline-flex; align-items: center; gap: 4px; }
.author-line { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.author-line b { font-weight: 700; }
.stars { display: inline-flex; gap: 1px; color: #f59e0b; letter-spacing: -1px; }
.stars .off { color: var(--line); }
.star-input { display: inline-flex; gap: 4px; }
.star-input button { background: none; border: 0; font-size: 2rem; cursor: pointer; color: var(--line); padding: 0 2px; line-height: 1; transition: transform .1s, color .1s; }
.star-input button.on { color: #f59e0b; }
.star-input button:hover { transform: scale(1.15); }
.side-col { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.mini-post { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; color: inherit; text-decoration: none !important; }
.mini-post:hover { background: var(--bg2); }
.mini-thumb { width: 46px; height: 46px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; flex: none; overflow: hidden; font-size: 1.3rem; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero { background: var(--grad); color: var(--p-ink); border-radius: 22px; padding: 26px; position: relative; overflow: hidden; margin-bottom: 20px; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { content: ''; position: absolute; right: 60px; bottom: -90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h1 { font-size: 1.7rem; position: relative; z-index: 1; } .hero p { opacity: .92; max-width: 560px; position: relative; z-index: 1; }
.hero .btn { position: relative; z-index: 1; background: rgba(255,255,255,.95); color: #0f1f2a; border: 0; }
.hero .btn.outline { background: rgba(255,255,255,.18); color: var(--p-ink); }
.load-more { display: flex; justify-content: center; margin: 22px 0; }

/* ---------- Detalle de publicación ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: zoom-in; background: var(--bg2); }
.gallery.single { grid-template-columns: 1fr; } .gallery.single img { aspect-ratio: auto; max-height: 560px; object-fit: contain; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--card2); }
.file-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 1.35rem; flex: none; background: var(--p-soft); }
.pdf-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.desc-text { white-space: pre-wrap; word-wrap: break-word; }
.tag { color: var(--p); font-weight: 600; font-size: .86rem; }
.rating-big { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.dist-bar { flex: 1; height: 7px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: #f59e0b; border-radius: 99px; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-body .text { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.locked-box { text-align: center; padding: 34px 20px; border-radius: var(--radius); background: var(--p-soft); border: 1px dashed var(--p); }
.locked-box .big { font-size: 2.8rem; }

/* ---------- Subida ---------- */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px 16px; text-align: center; cursor: pointer;
  transition: border .15s, background .15s; background: var(--card2); }
.dropzone.drag, .dropzone:hover { border-color: var(--p); background: var(--p-soft); }
.dropzone .big { font-size: 2.2rem; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.section-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.section-opt { border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; text-align: center; background: var(--card); transition: border .12s, background .12s; }
.section-opt:hover { border-color: var(--p-soft2); }
.section-opt.active { border-color: var(--p); background: var(--p-soft); }
.section-opt .emo { font-size: 1.6rem; } .section-opt .nm { font-weight: 700; font-size: .88rem; }
.section-opt.disabled { opacity: .5; }

/* ---------- Premium ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.plan { border: 2px solid var(--line); border-radius: 18px; padding: 18px; cursor: pointer; background: var(--card); transition: border .12s, transform .12s; position: relative; }
.plan:hover { transform: translateY(-2px); }
.plan.active { border-color: var(--p); box-shadow: 0 0 0 4px var(--p-soft); }
.plan .price { font-size: 1.9rem; font-weight: 800; }
.plan .price small { font-size: .85rem; font-weight: 600; color: var(--muted); display: block; margin-top: -2px; }
input[type=file] { font: 500 .88rem var(--font); color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: 600 .85rem var(--font); padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text); margin-right: 10px; cursor: pointer; }
.yape-box { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; background: linear-gradient(135deg, #6d28d9, #9333ea);
  color: #fff; border-radius: 18px; padding: 18px; }
.yape-box img { border-radius: 12px; background: #fff; padding: 6px; }
.yape-box .num { font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; }
.qr-placeholder { aspect-ratio: 1; border-radius: 12px; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 3rem; }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - 65px); }
.chat-side { border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.chat-side .scroll { overflow-y: auto; flex: 1; padding: 8px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer; color: inherit; text-decoration: none !important; }
.chat-item:hover { background: var(--bg2); }
.chat-item.active { background: var(--p-soft); }
.chat-item .ch-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--bg2); display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--card); display: flex; align-items: center; gap: 12px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.msg { display: flex; gap: 9px; max-width: 78%; align-items: flex-end; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--card); border: 1px solid var(--line); padding: 8px 12px; border-radius: 16px 16px 16px 4px; word-wrap: break-word; white-space: pre-wrap; min-width: 0; }
.msg.me .bubble { background: var(--grad); color: var(--p-ink); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.bubble .who { font-size: .76rem; font-weight: 700; color: var(--p); margin-bottom: 1px; }
.bubble .time { font-size: .68rem; opacity: .65; margin-top: 2px; text-align: right; }
.msg.cont .avatar { visibility: hidden; }
.msg.cont .who { display: none; }
.day-sep { align-self: center; font-size: .74rem; color: var(--muted); background: var(--bg2); padding: 3px 11px; border-radius: 99px; margin: 10px 0; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); }
.chat-form textarea { min-height: 44px; max-height: 140px; height: 44px; border-radius: 22px; padding: 11px 16px; resize: none; }
.chat-form .btn { border-radius: 50%; width: 46px; height: 46px; padding: 0; flex: none; }
.typing { font-size: .78rem; color: var(--muted); padding: 0 18px 6px; min-height: 20px; }

/* ---------- Perfil ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.3rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: var(--font); font-size: .9rem; }
.tab.active { color: var(--p); border-bottom-color: var(--p); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--grad); color: var(--p-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.1); }
.auth-art h1 { font-size: 2.5rem; max-width: 520px; position: relative; z-index: 1; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; position: relative; z-index: 1; }
.auth-feat { background: rgba(255,255,255,.14); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: .9rem; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .tabs { margin-bottom: 20px; }

/* ---------- Toast, modal, lightbox ---------- */
#toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0f1f2a; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: toastIn .25s ease; max-width: 92vw; pointer-events: auto; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal-bg { position: fixed; inset: 0; z-index: 900; background: rgba(5, 15, 22, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 20px; padding: 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lightbox { position: fixed; inset: 0; z-index: 950; background: rgba(0,0,0,.92); display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 92vh; object-fit: contain; }
.notif { display: flex; gap: 10px; padding: 12px; border-radius: 12px; color: inherit; text-decoration: none !important; align-items: flex-start; }
.notif:hover { background: var(--bg2); }
.notif.unread { background: var(--p-soft); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--p); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg2), var(--card2), var(--bg2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Tablas (admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--card2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--card2); }
.theme-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 13px; cursor: pointer; border: 3px solid transparent; position: relative; }
.swatch.active { border-color: var(--text); }
.swatch span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--muted); white-space: nowrap; }

/* ---------- Responsive (modo aplicación) ---------- */
@media (max-width: 1100px) {
  .feed-layout, .detail { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 200; width: 280px; transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .sidebar-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 150; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .topbar { padding: 10px 12px; gap: 8px; padding-top: max(10px, env(safe-area-inset-top)); }
  .content { padding: 16px 14px 100px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--muted);
    text-decoration: none !important; padding: 4px 10px; border-radius: 12px; position: relative; flex: 1; }
  .bottom-nav a.active { color: var(--p); }
  .bottom-nav a.fab { color: var(--p-ink); }
  .bottom-nav a.fab .icon { background: var(--grad); width: 44px; height: 44px; padding: 11px; border-radius: 15px; margin-top: -18px; box-shadow: 0 8px 20px var(--p-soft2); }
  .bottom-nav .count { position: absolute; top: 0; right: calc(50% - 22px); background: var(--danger); color: #fff; font-size: .6rem; border-radius: 99px; padding: 0 5px; }
  .posts-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .post-body { padding: 10px; } .post-title { font-size: .9rem; } .post-desc { display: none; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 61px - 64px); }
  .chat.in-conv .chat-side { display: none; }
  .chat:not(.in-conv) .chat-main { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; } .auth-art h1 { font-size: 1.6rem; } .auth-feats { display: none; }
  .yape-box { grid-template-columns: 1fr; text-align: center; } .yape-box img, .yape-box .qr-placeholder { max-width: 200px; margin: 0 auto; }
  .msg { max-width: 90%; }
  .hero { padding: 20px; } .hero h1 { font-size: 1.35rem; }
  h1 { font-size: 1.35rem; }
}
@media (max-width: 380px) { .posts-grid { grid-template-columns: 1fr; } }

/* =========================================================
   v2 — Texto, perfiles sociales, grupos, soporte, instalación
   ========================================================= */
.badge.staff { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.badge.admin { background: var(--grad); color: var(--p-ink); }
.text-cover { aspect-ratio: 16/10; padding: 18px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 700; font-size: 1.02rem; line-height: 1.35; overflow: hidden; background: var(--card2); color: var(--text); }
.text-cover p { margin: 0; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.text-cover.plain { justify-content: flex-start; text-align: left; align-items: flex-start; font-weight: 500; font-size: .95rem; padding-top: 44px; }
.tstyle-1 { background: linear-gradient(135deg, #06b6d4, #10b981) !important; color: #fff !important; }
.tstyle-2 { background: linear-gradient(135deg, #7c3aed, #db2777) !important; color: #fff !important; }
.tstyle-3 { background: linear-gradient(135deg, #f59e0b, #ef4444) !important; color: #fff !important; }
.tstyle-4 { background: linear-gradient(135deg, #2563eb, #7c3aed) !important; color: #fff !important; }
.tstyle-5 { background: linear-gradient(135deg, #0f172a, #334155) !important; color: #fff !important; }
.tstyle-6 { background: linear-gradient(135deg, #fde68a, #fca5a5) !important; color: #3b1d00 !important; }
.tstyle-7 { background: linear-gradient(135deg, #a7f3d0, #93c5fd) !important; color: #0b2a3a !important; }
.tstyle-8 { background: linear-gradient(135deg, #ec4899, #f97316) !important; color: #fff !important; }
.big-text { font-size: 1.55rem; font-weight: 800; line-height: 1.35; padding: 44px 26px; border-radius: 16px; text-align: center; white-space: pre-wrap; word-break: break-word; }
.composer { display: flex; gap: 12px; align-items: center; cursor: pointer; margin-bottom: 16px; }
.composer .fake-input { flex: 1; background: var(--bg2); border-radius: 99px; padding: 12px 18px; color: var(--muted); font-weight: 500; }
.composer .fake-input:hover { background: var(--line); }
.style-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.style-picker button { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; background: var(--card2); }
.style-picker button.active { border-color: var(--text); transform: scale(1.08); }
.composer-text { min-height: 140px; font-size: 1.05rem; transition: all .2s; }
.composer-text.styled { font-size: 1.4rem; font-weight: 800; text-align: center; padding: 30px 18px; border: 0; min-height: 200px; }
.composer-text.styled::placeholder { color: rgba(255,255,255,.75); }
.feed-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 5px; width: fit-content; max-width: 100%; overflow-x: auto; }
.feed-tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font: 700 .86rem var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.feed-tabs button.active { background: var(--p-soft); color: var(--p); }
.like-btn.liked { color: #e11d48; border-color: color-mix(in srgb, #e11d48 30%, transparent); background: color-mix(in srgb, #e11d48 8%, transparent); }
.like-btn.liked .icon { fill: #e11d48; stroke: #e11d48; }

/* Perfil estilo Instagram/TikTok */
.ig-head { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.ig-avatar { width: 128px; height: 128px; border-radius: 50%; padding: 4px; background: var(--grad); }
.ig-avatar .avatar { width: 100%; height: 100%; font-size: 2.8rem; border: 4px solid var(--card); }
.ig-stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 10px 0; }
.ig-stats button, .ig-stats div { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.ig-stats b { font-size: 1.15rem; display: block; line-height: 1.1; }
.ig-stats span { color: var(--muted); font-size: .82rem; }
.score-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--p-soft); margin-top: 12px; }
.score-card .lvl { font-size: 2rem; }
.score-bar { height: 8px; border-radius: 99px; background: var(--card); overflow: hidden; margin-top: 6px; }
.score-bar i { display: block; height: 100%; background: var(--grad); }
.social-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .82rem; text-decoration: none !important; }
.social-link.tt { background: #000; color: #fff; } .social-link.ig { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); color: #fff; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.member-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.career-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.career-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; color: inherit; text-decoration: none !important; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); transition: transform .15s; }
.career-card:hover { transform: translateY(-2px); }
.career-card.mine { border: 2px solid var(--p); }
.career-card .ci { font-size: 2rem; width: 56px; height: 56px; border-radius: 16px; background: var(--p-soft); display: grid; place-items: center; flex: none; }

/* Chat v2 */
.chat-sec { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px; }
.chat-sec .nav-label { padding: 0; }
.msg-file { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.06); text-decoration: none !important; color: inherit; margin-bottom: 4px; min-width: 200px; }
.msg.me .msg-file { background: rgba(255,255,255,.18); }
.msg-img { max-width: 260px; max-height: 260px; border-radius: 12px; cursor: zoom-in; margin-bottom: 4px; object-fit: cover; }
.poll { min-width: 240px; }
.poll-q { font-weight: 800; margin-bottom: 8px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(0,0,0,.12); margin-bottom: 6px; cursor: pointer; overflow: hidden; background: transparent; width: 100%; font: inherit; color: inherit; text-align: left; }
.msg.me .poll-opt { border-color: rgba(255,255,255,.4); }
.poll-opt i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--p) 22%, transparent); z-index: 0; transition: width .3s; }
.msg.me .poll-opt i { background: rgba(255,255,255,.28); }
.poll-opt span, .poll-opt b { position: relative; z-index: 1; }
.poll-opt .chk { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; flex: none; display: grid; place-items: center; font-size: .7rem; }
.poll-opt.voted .chk { background: currentColor; }
.poll-opt.voted .chk::after { content: '✓'; color: var(--card); font-weight: 900; }
.msg.me .poll-opt.voted .chk::after { color: var(--p); }
.sys-msg { align-self: center; font-size: .76rem; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 4px 12px; border-radius: 99px; margin: 6px 0; text-align: center; max-width: 90%; }
.chat-tools { display: flex; gap: 2px; }
.chat-tools .btn { width: 40px; height: 46px; padding: 0; border-radius: 12px; background: transparent; border: 0; font-size: 1.2rem; box-shadow: none; }
.chat-tools .btn:hover { background: var(--bg2); }
.pick-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--bg2); }
.pick-row input { width: 18px; height: 18px; accent-color: var(--p); }
.msg .del-msg { opacity: 0; background: none; border: 0; cursor: pointer; color: var(--muted); align-self: center; padding: 4px; }
.msg:hover .del-msg { opacity: 1; }

/* Soporte flotante */
body.in-chat #support-fab { display: none; }
#support-fab { position: fixed; right: 20px; bottom: 22px; z-index: 120; border-radius: 99px; padding: 12px 18px; box-shadow: 0 10px 30px var(--p-soft2); }
#support-panel { position: fixed; right: 20px; bottom: 84px; z-index: 130; width: 380px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 120px);
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; animation: toastIn .2s; }
.sp-head { background: var(--grad); color: var(--p-ink); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.sp-head .icon-btn { color: inherit; }
.sp-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.sp-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: .92rem; }
.sp-msg.bot { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.sp-msg.user { background: var(--grad); color: var(--p-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.sp-msg.staff { background: color-mix(in srgb, #6366f1 12%, var(--card)); border: 1px solid color-mix(in srgb, #6366f1 30%, transparent); align-self: flex-start; border-bottom-left-radius: 4px; }
.sp-msg .who { font-size: .72rem; font-weight: 800; opacity: .8; margin-bottom: 2px; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.sp-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 8px; background: var(--bg); }
.sp-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); }
.sp-form input { border-radius: 99px; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: blink 1s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s; } .typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* Instalar app */
.install-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.install-hero img { width: 120px; height: 120px; border-radius: 28px; box-shadow: 0 16px 40px var(--p-soft2); }
.os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.os-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.os-card.current { border: 2px solid var(--p); box-shadow: 0 0 0 4px var(--p-soft); }
.os-card ol { margin: 8px 0 0; padding-left: 20px; } .os-card li { margin-bottom: 6px; }
.kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); font-weight: 700; font-size: .85em; }
.install-banner { position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 140; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
  display: flex; gap: 12px; align-items: center; box-shadow: 0 14px 40px rgba(0,0,0,.2); max-width: 520px; margin: 0 auto; animation: toastIn .3s; }
.install-banner img { width: 44px; height: 44px; border-radius: 12px; }
.lock-box { text-align: center; padding: 30px; border-radius: 18px; background: var(--bg2); border: 2px dashed var(--line); }
.lock-box .big { font-size: 3rem; }
.checklist li { list-style: none; margin: 6px 0; } .checklist { padding: 0; }
.ticket-item { display: flex; gap: 10px; padding: 12px; border-radius: 12px; color: inherit; text-decoration: none !important; border-bottom: 1px solid var(--line); }
.ticket-item:hover, .ticket-item.active { background: var(--p-soft); }
@media (max-width: 860px) {
  #support-fab { bottom: 84px; right: 14px; padding: 12px; }
  #support-fab .lbl { display: none; }
  #support-panel { right: 12px; left: 12px; bottom: 76px; width: auto; height: calc(100vh - 150px); }
  .ig-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .ig-stats { justify-content: center; }
  .ig-avatar { width: 104px; height: 104px; }
  .install-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .big-text { font-size: 1.25rem; padding: 30px 18px; }
}
@media (display-mode: standalone) { .hide-installed { display: none !important; } }
.poll, .msg-file, .bubble .poll * { white-space: normal; }
@media (max-width: 860px) { .ig-head .row { justify-content: center; } .ig-head .muted { text-align: center; } }
