/* OFM — CRM para agencias de creadores. Diseño minimalista. Dos temas: oscuro (por defecto) y claro. Acento configurable. */
:root {
  --bg: #0b0c0f; --bg2: #0b0c0f;
  --panel: #121318; --panel2: #171920; --panel3: #1b1e27;
  --line: #23252e; --line2: #2c2f3a;
  --text: #eceef3; --muted: #9a9fac; --faint: #636875;
  --accent: #22d3ee; --accent2: #67e8f9; --accentdim: rgba(34, 211, 238, 0.15); --accfg: #06232b;
  --gold: #f59e0b; --green: #3ecf8e; --red: #ff5a6e; --yellow: #ffc34d; --purple: #8b5cf6;
  --glow: 0 0 0 1px rgba(34, 211, 238, 0.22);
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --nav-bg: #121318;
  --nav: #15161c;
  --th-bg: #15161c;
  --pop-bg: #15161c;
  --dialog-bg: #15161c;
  --authbox-bg: #121318;
  --active-bg: var(--accentdim);
  --kpi: #eceef3;
  --brandgrad: var(--text);
  --body-bg: radial-gradient(1100px 700px at 50% -12%, rgba(34, 211, 238, 0.05), transparent 60%), var(--bg);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fafafa; --bg2: #f6f6f7;
  --panel: #ffffff; --panel2: #f6f6f7; --panel3: #eef0f3;
  --line: #e8e8eb; --line2: #dcdce0;
  --text: #17181c; --muted: #6b6f78; --faint: #9aa0aa;
  --accent: #0891b2; --accent2: #0e7490; --accentdim: rgba(8, 145, 178, 0.12); --accfg: #ffffff;
  --gold: #d97706; --green: #16a34a; --red: #d2483e; --yellow: #b5820f; --purple: #7c3aed;
  --glow: 0 0 0 1px rgba(8, 145, 178, 0.18);
  --grad: linear-gradient(135deg, #22d3ee, #0891b2);
  --nav-bg: #ffffff;
  --nav: #ffffff;
  --th-bg: #ffffff;
  --pop-bg: #ffffff;
  --dialog-bg: #ffffff;
  --authbox-bg: #ffffff;
  --active-bg: var(--accentdim);
  --kpi: #17181c;
  --brandgrad: var(--text);
  --body-bg: radial-gradient(1100px 700px at 50% -12%, rgba(8, 145, 178, 0.04), transparent 60%), var(--bg);
  color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; }
html, body { height: 100vh; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif; color: var(--text); font-size: 13.5px; line-height: 1.5;
  background: var(--body-bg);
  background-attachment: fixed;
  overflow: hidden;
}
body::before { display: none; }
body.booting * { visibility: hidden; }
.drag { position: fixed; top: 0; left: 0; right: 0; height: 30px; -webkit-app-region: drag; z-index: 5; pointer-events: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); border-radius: 9px; padding: 7px 13px; background: var(--panel2); color: var(--text); transition: all .14s; backdrop-filter: blur(6px); }
button:hover { border-color: var(--line2); box-shadow: var(--glow); }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
button.primary { background: var(--accent); border-color: transparent; color: var(--accfg); font-weight: 700; box-shadow: none; }
button.primary:hover { filter: brightness(1.06); box-shadow: var(--glow); }
button.big { padding: 12px; width: 100%; margin-top: 16px; font-size: 14px; }
button.ghost { background: transparent; }
button.danger { background: rgba(255,90,110,.12); border-color: rgba(255,90,110,.4); color: #ff9aa8; }
button.success, button.on { background: rgba(39,226,164,.14); border-color: rgba(39,226,164,.4); color: #74f0cc; }
button.small { padding: 4px 9px; font-size: 12.5px; }
button.icon { padding: 5px 8px; position: relative; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; outline: none; width: 100%; transition: border .14s, box-shadow .14s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accentdim); }
textarea { resize: vertical; min-height: 70px; }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; } .right { text-align: right; } .num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); }
h1 { font-size: 21px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); opacity: .85; margin: 14px 0 8px; font-weight: 700; }
a { color: var(--accent2); }

#app { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: minmax(0, 1fr); height: 100vh; position: relative; z-index: 1; transition: grid-template-columns .22s ease; }
body.nav-collapsed #app { grid-template-columns: 66px 1fr; }
#nav { background: var(--nav-bg); border-right: 1px solid var(--line); padding: 38px 10px 0; overflow: hidden; display: flex; flex-direction: column; backdrop-filter: blur(10px); height: 100vh; min-height: 0; }
#nav .brand { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 14px; padding: 2px 8px 6px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; }
#nav .brand .lg { width: 28px; height: 28px; border-radius: 8px; flex: none; background: var(--accent); display: grid; place-items: center; color: var(--accfg); font-size: 14px; font-weight: 800; }
#nav .brand span { color: var(--text); font-weight: 800; }
@keyframes pulse { 50% { opacity: 1; } }
#nav .role { font-size: 9.5px; text-transform: uppercase; letter-spacing: .2em; color: var(--faint); padding: 0 10px 8px; opacity: .9; white-space: nowrap; overflow: hidden; }
.sec { font-size: 10px; text-transform: uppercase; color: var(--faint); letter-spacing: .14em; padding: 12px 10px 4px; font-weight: 700; white-space: nowrap; }
.navscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: block; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.navscroll::-webkit-scrollbar { width: 8px; }
.navscroll::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
.navscroll::-webkit-scrollbar-track { background: transparent; }
.navfoot { border-top: 1px solid var(--line2); padding: 6px 0 10px; margin-top: 4px; }
.navitem { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 9px; display: flex; gap: 11px; align-items: center; position: relative; cursor: pointer; white-space: nowrap; }
.navitem:hover { background: var(--panel2); }
.navitem.active { background: var(--active-bg); color: var(--text); font-weight: 600; }
.navitem.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.navitem .ic { width: 20px; height: 20px; flex: none; display: grid; place-items: center; opacity: .85; }
.navitem.active .ic { opacity: 1; color: var(--accent); }
.navitem .lbl { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.navitem .caret { color: var(--faint); transition: transform .18s; display: grid; }
.navitem.acc.open .caret { transform: rotate(90deg); }
.navitem .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; }
.navitem .pop { color: var(--faint); display: grid; }
/* Secciones plegables: cada categoría es una cabecera que esconde/muestra sus items. */
.navsec { display: flex; align-items: center; gap: 8px; padding: 11px 8px 4px; cursor: pointer; user-select: none; }
.navsec .snm { flex: 1; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .12em; font-weight: 700; white-space: nowrap; transition: color .14s, text-shadow .14s; }
.navsec:hover .snm { color: var(--accent); text-shadow: 0 0 10px var(--accent); }
.navsec:hover .scaret { color: var(--accent); }
.navsec .scaret { color: var(--faint); transition: transform .18s; display: grid; }
.navsec.closed .scaret { transform: rotate(-90deg); }
.secitems { overflow: hidden; max-height: 900px; transition: max-height .2s ease; display: flex; flex-direction: column; gap: 1px; }
.secitems.closed { max-height: 0; }
.ver { color: var(--faint); font-size: 11px; padding: 6px 12px 0; white-space: nowrap; overflow: hidden; }
.creatorsel { position: relative; margin: 2px 0 6px; }
.creatorsel .curr { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel2); cursor: pointer; }
.creatorsel .curr:hover { border-color: var(--line2); }
.cpic { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #06101c; font-weight: 700; font-size: 11px; }
.creatorsel .cmeta { min-width: 0; flex: 1; }
.creatorsel .cnm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creatorsel .csub { font-size: 11px; color: var(--faint); white-space: nowrap; }
.creatorsel .ccaret { color: var(--faint); display: grid; }
.creatordrop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--nav); border: 1px solid var(--line2); border-radius: 11px; box-shadow: 0 18px 44px rgba(0,0,0,.5); padding: 5px; z-index: 40; display: none; max-height: 330px; overflow: auto; }
.creatordrop.open { display: block; }
.copt { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.copt:hover { background: var(--panel2); }
.copt .cpic { width: 22px; height: 22px; font-size: 10px; }
.copt .cck { margin-left: auto; color: var(--gold); }
.copt.add { color: var(--gold); font-weight: 600; }
.plogo { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; overflow: hidden; color: #fff; }
.plogo.wht { background: #fff; }
.copt .pcount { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
/* Panel: chips de filtro de creador */
.dchips { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin: -4px 0 14px; }
.dchips .dchip-lab { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; margin-right: 2px; }
.dchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.dchip:hover { color: var(--text); }
.dchip.sel { background: var(--accent); border-color: var(--accent); color: var(--accfg); font-weight: 600; }
body.nav-collapsed #nav .brand span, body.nav-collapsed #nav .role, body.nav-collapsed .navsec,
body.nav-collapsed .navitem .lbl, body.nav-collapsed .navitem .badge, body.nav-collapsed .navitem .pop,
body.nav-collapsed .creatorsel .cmeta, body.nav-collapsed .creatorsel .ccaret, body.nav-collapsed .ver { display: none !important; }
body.nav-collapsed .secitems, body.nav-collapsed .secitems.closed { max-height: none !important; }
body.nav-collapsed .navitem { justify-content: center; padding: 10px 0; }
body.nav-collapsed .creatorsel .curr { justify-content: center; padding: 8px 0; }
body.nav-collapsed #nav .brand { justify-content: center; }
#navCollapse { display: grid; place-items: center; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px 10px; border-bottom: 1px solid var(--line); min-height: 54px; }
.crumb { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.me { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 8px; border-radius: 8px; }
.me:hover { background: var(--panel2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--accfg); flex: none; }
.dot { position: absolute; top: 2px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }
.sfw { font-size: 12.5px; }
#themeBtn { font-size: 15px; line-height: 1; padding: 5px 9px; }
/* Barra de estado del navegador integrado (OnlyFans/Fansly/MYM) en Messages Pro. */
.brbar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel2); margin-bottom: 8px; font-size: 12.5px; }
.brbar .live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); flex: none; }
.brbar .live.off { background: var(--muted); box-shadow: none; }
.brbar .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view { flex: 1; overflow: auto; padding: 20px; min-height: 0; position: relative; z-index: 1; }
#view.full { padding: 0; overflow: hidden; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; backdrop-filter: blur(10px); position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .5; }
.kpi .v { font-size: 25px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--kpi); letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.kpi .d { font-size: 12px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid2e { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1250px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 600; color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px; border-bottom: 1px solid var(--line2); position: sticky; top: 0; background: var(--th-bg); cursor: pointer; white-space: nowrap; backdrop-filter: blur(6px); }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: var(--panel2); }
table.t tr.click { cursor: pointer; }
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: auto; max-height: calc(100vh - 200px); backdrop-filter: blur(10px); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 11.5px; background: var(--panel3); border: 1px solid var(--line); white-space: nowrap; }
.pill.green { background: rgba(39,226,164,.14); color: #74f0cc; border-color: rgba(39,226,164,.3); }
.pill.red { background: rgba(255,90,110,.14); color: #ff9aa8; border-color: rgba(255,90,110,.3); }
.pill.yellow { background: rgba(255,195,77,.14); color: var(--yellow); border-color: rgba(255,195,77,.3); }
.pill.blue { background: var(--accentdim); color: var(--accent2); border-color: var(--line2); }
.pill.purple { background: rgba(185,139,255,.16); color: var(--purple); border-color: rgba(185,139,255,.3); }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 6px currentColor; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; border: 0; border-radius: 0; color: var(--muted); padding: 9px 13px; border-bottom: 2px solid transparent; }
.tabs button:hover { box-shadow: none; color: var(--text); }
.tabs button.sel { color: var(--accent); border-color: var(--accent); }

.modal { position: fixed; inset: 0; background: rgba(2,5,11,.72); display: grid; place-items: center; z-index: 50; padding: 24px; backdrop-filter: blur(4px); }
.dialog { background: var(--dialog-bg); border: 1px solid var(--line2); border-radius: 16px; width: min(640px, 100%); max-height: 100%; overflow: auto; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6), var(--glow); }
.dialog.wide { width: min(980px, 100%); }
/* Messages Pro en modo "ventana": pop-up grande con barra de título. */
.dialog.windowed { width: min(1120px, 100%); height: min(88vh, 920px); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.winbar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel2); flex: none; }
.winbar .wt { font-weight: 700; display: flex; gap: 8px; align-items: center; min-width: 0; }
.winbar .wt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winbody { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 0; }
.winbody .chat { min-width: 0; min-height: 0; }
.winbody .fanpanel { border-left: 1px solid var(--line); }
@media (max-width: 860px) { .dialog.windowed { height: 92vh; } .winbody { grid-template-columns: 1fr; } .winbody .fanpanel { display: none; } }
.dialog-head { display: flex; align-items: center; margin-bottom: 14px; gap: 10px; }
.dialog-head h2 { margin: 0; flex: 1; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form .full { grid-column: 1 / -1; }
.form label > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--pop-bg); border: 1px solid var(--line2); padding: 10px 14px; border-radius: 10px; max-width: 360px; box-shadow: 0 8px 30px rgba(0,0,0,.5), var(--glow); backdrop-filter: blur(8px); }
.toast.error { border-color: rgba(255,90,110,.6); } .toast.ok { border-color: rgba(39,226,164,.6); }
.idle { position: fixed; inset: 0; background: rgba(3,6,12,.94); z-index: 90; display: grid; place-items: center; text-align: center; backdrop-filter: blur(6px); }
body.sfw .media, body.sfw .avatar.media { filter: blur(14px); }

/* Acceso */
#auth { position: fixed; inset: 0; display: grid; place-items: center; z-index: 10;
  background: radial-gradient(900px 640px at 50% 38%, #0a141f 0%, #050c15 48%, #000 100%);
  /* El acceso es siempre oscuro (enlaza con la intro), independiente del tema de la app. */
  --panel2: #0f141b; --panel: #0f141b; --line: #20242e; --line2: #2c2f3a;
  --text: #eceef3; --muted: #9aa0ac; --faint: #636875;
  color: #eceef3; }
.authbox { width: min(400px, 92vw); background: transparent; border: 0; border-radius: 20px; padding: 10px 28px; box-shadow: none; text-align: center; position: relative; }
.authbox .lg { display: none; }
.authbox .brandline { font-weight: 800; letter-spacing: -.02em; font-size: 34px; color: var(--text); }
.authbox .rolepill { display: inline-block; margin: 7px auto 0; font-size: 9.5px; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); border: 1px solid var(--line2); border-radius: 20px; padding: 2px 12px; }
/* Intro: el vídeo del rayo se reproduce una vez y se difumina dando paso al acceso. */
#intro { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #000; }
#intro video { width: min(500px, 100vw); height: 100%; max-height: 100vh; object-fit: contain; background: #000; }
#intro.out { animation: introOut 1s ease forwards; }
@keyframes introOut { to { opacity: 0; visibility: hidden; filter: blur(12px); transform: scale(1.08); } }
.authbox h1 { font-size: 23px; margin: 16px 0 4px; }
.authbox .slogan { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.authbox label { display: block; margin-top: 10px; text-align: left; } .authbox label span { font-size: 12px; color: var(--muted); }
.authbox .err { color: #ff9aa8; font-size: 12.5px; margin-top: 10px; min-height: 16px; }

/* Bandeja (Messages Pro) */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr) 330px; height: 100%; }
.convlist { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.convlist .filters { padding: 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.groups { display: flex; gap: 3px; flex-wrap: wrap; }
.groups button { padding: 2px 8px; font-size: 12px; }
.groups button.sel { background: var(--accent); border-color: transparent; color: var(--accfg); }
.convs { overflow: auto; flex: 1; }
.conv { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.conv:hover { background: var(--panel2); } .conv.sel { background: var(--accentdim); }
.conv .nm { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.conv .last { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.conv .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: absolute; right: 10px; top: 14px; box-shadow: 0 0 8px var(--accent); }
.online { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 7px var(--green); }
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chattabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; min-height: 38px; }
.chattabs .ct { padding: 6px 10px; border-radius: 8px 8px 0 0; background: var(--panel); display: flex; gap: 6px; align-items: center; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.chattabs .ct.sel { background: var(--panel2); border-bottom: 2px solid var(--accent); }
.chattabs .ct b { color: var(--muted); font-weight: 400; }
.msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 70%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.in { background: var(--panel2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { background: var(--accent); color: var(--accfg); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg .meta { font-size: 11px; opacity: .7; margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.msg .ppv { margin-top: 6px; padding: 6px 8px; background: rgba(0,0,0,.2); border-radius: 8px; display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.msg.flag { outline: 2px solid var(--yellow); }
.composer { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { min-height: 64px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; }
.suggest button { background: rgba(185,139,255,.14); border-color: rgba(185,139,255,.3); color: #d6c9ff; font-size: 12.5px; text-align: left; max-width: 100%; }
.warn { color: var(--yellow); font-size: 12.5px; }
.fanpanel { border-left: 1px solid var(--line); overflow: auto; padding: 14px; }
.stat2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat2 div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.stat2 b { display: block; font-size: 16px; } .stat2 span { color: var(--muted); font-size: 11.5px; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

/* Bóveda */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.vitem { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; position: relative; }
.vitem.sel { outline: 2px solid var(--accent); box-shadow: var(--glow); }
.vitem .th { aspect-ratio: 1; background: var(--panel3) center/cover; display: grid; place-items: center; font-size: 34px; overflow: hidden; }
.vitem .th img, .vitem .th video { width: 100%; height: 100%; object-fit: cover; }
.vitem .info { padding: 8px; font-size: 12px; }
.vitem .sent { position: absolute; top: 6px; left: 6px; }

/* Turnos */
.week { display: grid; grid-template-columns: 60px repeat(7, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.week .hd { padding: 8px; text-align: center; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 12.5px; }
.week .hd.today { color: var(--accent); }
.week .col { position: relative; border-left: 1px solid var(--line); height: 576px; }
.week .hours { position: relative; height: 576px; }
.week .hours div { position: absolute; right: 6px; font-size: 10.5px; color: var(--muted); transform: translateY(-50%); }
.week .line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.shift { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; color: #02121a; overflow: hidden; cursor: pointer; font-weight: 500; }

/* Gráficos */
.chart { width: 100%; height: 220px; }
.bars .b { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12.5px; }
.bars .b .track { flex: 1; height: 8px; background: var(--panel3); border-radius: 4px; overflow: hidden; }
.bars .b .track i { display: block; height: 100%; border-radius: 4px; box-shadow: 0 0 10px currentColor; }
.rule { display: grid; grid-template-columns: 1.4fr .7fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.step { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.qr { background: #fff; padding: 10px; border-radius: 8px; display: inline-block; }
code.k { background: var(--panel3); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; font-size: 13px; letter-spacing: .08em; color: var(--accent2); }
.progress-line { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bar { height: 5px; background: var(--panel3); border-radius: 3px; overflow: hidden; }
.bar > i, .bar > span { display: block; height: 100%; background: var(--grad); width: 0; }

/* ===== Responsive / móvil ===== */
#navToggle { display: none; background: transparent; border: 1px solid var(--line); font-size: 17px; padding: 4px 11px; }
#navBackdrop { display: none; }
@media (max-width: 860px) {
  #app, body.nav-collapsed #app { grid-template-columns: 1fr; }
  #navCollapse { display: none; }
  body.nav-collapsed #nav .brand span, body.nav-collapsed #nav .role, body.nav-collapsed .navsec, body.nav-collapsed .navitem .lbl, body.nav-collapsed .navitem .pop, body.nav-collapsed .creatorsel .cmeta, body.nav-collapsed .creatorsel .ccaret, body.nav-collapsed .ver { display: revert !important; }
  body.nav-collapsed .navitem, body.nav-collapsed .creatorsel .curr, body.nav-collapsed #nav .brand { justify-content: flex-start; }
  #nav { position: fixed; left: 0; top: 0; bottom: 0; width: 256px; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 50px rgba(0,0,0,.65); padding-top: 16px; }
  body.nav-open #nav { transform: none; }
  #navBackdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
  body.nav-open #navBackdrop { display: block; }
  #navToggle { display: grid; place-items: center; }
  .topbar { padding: 12px 14px; min-height: 48px; gap: 8px; }
  label.sfw { display: none; }
  .me span { display: none; }
  #view { padding: 14px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid2, .grid3, .grid2e { grid-template-columns: 1fr; }
  .kpi .v { font-size: 22px; }
  .tablewrap { max-height: none; }
  /* Bandeja apilada: lista arriba, conversación abajo; ficha del fan oculta */
  .inbox { grid-template-columns: 1fr; grid-template-rows: 44vh 1fr; height: 100%; }
  .convlist { border-right: 0; border-bottom: 1px solid var(--line); }
  .fanpanel { display: none; }
  .conv .last { max-width: 55vw; }
  .dialog { padding: 16px; } .form { grid-template-columns: 1fr; }
  .week { font-size: 10px; }
  .authbox { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  h1 { font-size: 18px; } .crumb { font-size: 14px; }
}

/* Selector de color de acento (Ajustes → Apariencia) */
.accrow { display: flex; gap: 9px; margin-top: 7px; flex-wrap: wrap; }
.accsw { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; outline: 1px solid var(--line2); outline-offset: 2px; transition: transform .1s; }
.accsw:hover { transform: scale(1.08); }
.accsw.sel { border-color: var(--text); }

/* Switcher de creador en el Gestor de OF (embed) */
.ofswitch { display: inline-flex; align-items: center; gap: 7px; margin-left: 10px; }
.ofswitch select { width: auto; }
