/* Portal de clientes · Andrezia Digital
   Marca: fondo oscuro, cian #00F0FF y magenta #BC00FF del logo.
   Tipografías provisionales (no Orbitron ni Inter): se cambian en --f-display y --f-body. */
:root {
  --bg: #0c0c10;
  --surface: #16161c;
  --sunk: #101015;
  --raise: #1d1d25;
  --ink: #eef0f4;
  --muted: #9a9cab;
  --line: #2a2a35;
  --cyan: #00f0ff;
  --magenta: #bc00ff;
  --magenta-soft: #d46bff;
  --ok: #3ee08f;
  --warn: #ffb547;
  --danger: #ff5d7a;
  --grad: linear-gradient(90deg, var(--magenta), var(--cyan));
  --f-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-body: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); background-image: radial-gradient(1200px 500px at 85% -10%, rgba(188, 0, 255, .14), transparent 60%), radial-gradient(900px 400px at -10% 10%, rgba(0, 240, 255, .08), transparent 60%); background-attachment: fixed; color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
body > #viewApp, body > .auth { flex: 1 0 auto; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
a { color: var(--cyan); }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }
.ph { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); font-size: 14px; }

/* Cabecera */
.top { border-bottom: 1px solid var(--line); background: rgba(12, 12, 16, .82); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.top::after { content: ""; display: block; height: 2px; background: var(--grad); opacity: .85; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 10px; flex-wrap: wrap; }
.logo img { display: block; height: 46px; width: auto; max-width: 62vw; }
.who { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.who #whoName { color: var(--ink); font-weight: 500; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }

/* Entrar */
.auth { display: grid; place-items: center; padding-block: 8vh 48px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 0 0 1px rgba(0, 240, 255, .06), 0 20px 60px rgba(188, 0, 255, .12); }
.auth-card h1 { font-size: 28px; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.auth-card input { padding: 11px 12px; }
.auth-card .btn { padding: 11px 14px; }

/* Entrada */
.entry { padding-block: 22px 6px; }
.entry-card { padding: 22px; display: grid; gap: 18px; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--cyan); margin-bottom: 6px; }
.entry h2 { font-size: 26px; font-weight: 600; margin-bottom: 6px; }
.entry .muted { max-width: 68ch; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { border-top: 2px solid var(--line); padding-top: 10px; min-width: 0; position: relative; }
.steps li::before { content: ""; position: absolute; top: -2px; left: 0; width: 48px; height: 2px; background: var(--grad); }
.steps .n { font-family: var(--f-mono); font-size: 12px; color: var(--magenta-soft); }
.steps h3 { font-size: 19px; font-weight: 600; margin: 2px 0 4px; }
.steps p { font-size: 14px; color: var(--muted); }
.plan { font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; font-size: 13px; white-space: nowrap; }
.linkbtn:hover { color: var(--ink); }
#showEntry { margin-top: 14px; }

/* Pestañas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 18px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px 9px; font-family: var(--f-display); font-size: 17px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-image: var(--grad) 1; border-bottom-width: 2px; border-bottom-style: solid; }
.tab .count { font-family: var(--f-mono); font-size: 12px; margin-left: 6px; color: var(--cyan); }

/* Panel principal */
.main { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; padding-block: 18px 40px; align-items: start; }
.list { display: grid; gap: 14px; min-width: 0; }
.lote h3 { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.lote-items { display: grid; gap: 6px; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; }
.item:hover { border-color: #3a3a48; }
.item[aria-current="true"] { border-color: rgba(0, 240, 255, .55); box-shadow: inset 3px 0 0 var(--cyan), 0 0 18px rgba(0, 240, 255, .08); }
.item .code { font-family: var(--f-mono); font-size: 12px; color: var(--muted); grid-row: 1; }
.item .t { grid-column: 1 / -1; font-weight: 500; overflow-wrap: anywhere; }
.item .pill { justify-self: end; }
.empty-list { color: var(--muted); font-size: 14px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 14px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 1px 9px; border: 1px solid currentColor; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-pendiente_guion { color: var(--muted); }
.s-guion_en_revision, .s-video_en_revision { color: var(--warn); }
.s-guion_aprobado, .s-en_produccion { color: var(--cyan); }
.s-video_aprobado, .s-entregado { color: var(--ok); }

.detail { padding: 22px; display: grid; gap: 22px; min-width: 0; }
.d-head { display: grid; gap: 6px; }
.d-head .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.d-head .code { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.d-head h2 { font-size: 28px; font-weight: 600; line-height: 1.15; }
.title-input { font-family: var(--f-display); font-size: 24px; font-weight: 600; width: 100%; }
.sec { display: grid; gap: 10px; }
.sec > h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: var(--f-mono); }
textarea { width: 100%; min-height: 240px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--sunk); line-height: 1.55; }
textarea.short { min-height: 88px; }
.readtext { white-space: pre-wrap; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; overflow-wrap: anywhere; margin: 0; font-family: var(--f-body); }
input[type="text"], input[type="url"], input[type="password"], input[type="number"], select, .title-input { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; background: var(--sunk); min-width: 0; }
input:focus, textarea:focus, select:focus { border-color: rgba(0, 240, 255, .6); outline: none; box-shadow: 0 0 0 3px rgba(0, 240, 255, .12); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid #3a3a48; background: var(--raise); color: var(--ink); border-radius: var(--r); padding: 8px 14px; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--cyan); }
.btn.primary { background: var(--grad); border: 0; color: #0a0a0e; font-weight: 600; padding: 9px 15px; }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 0 20px rgba(0, 240, 255, .25); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #04130b; font-weight: 600; }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: none; }
.files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.files li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; min-width: 0; background: var(--sunk); }
.files li > span { min-width: 0; overflow-wrap: anywhere; }
.files .meta { font-size: 12px; color: var(--muted); font-family: var(--f-mono); white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline > input { flex: 1 1 180px; }
.media { display: grid; gap: 8px; }
.media video, .media img { width: 100%; max-height: 70vh; background: #000; border-radius: var(--r); object-fit: contain; }
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.thread { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.thread li { border-left: 2px solid var(--line); padding: 2px 0 2px 12px; }
.thread li.a { border-left-color: var(--magenta); }
.thread .by { font-size: 12px; color: var(--muted); }
.thread .by b { color: var(--ink); font-weight: 600; }
.thread .at { font-family: var(--f-mono); color: var(--cyan); margin-right: 6px; }
.thread p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.owner { border: 1px dashed rgba(188, 0, 255, .55); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; background: rgba(188, 0, 255, .04); }
.owner > h3 { color: var(--magenta-soft); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-family: var(--f-mono); }
.owner .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.owner label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.versions { display: flex; gap: 6px; flex-wrap: wrap; }
.versions button { font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--line); background: var(--sunk); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.versions button[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); }
.deliver { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 240px); gap: 16px; }
.newpiece { display: grid; gap: 8px; padding: 12px; }
.newpiece .inline > input { flex: 1 1 90px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--raise); border: 1px solid rgba(0, 240, 255, .4); color: var(--ink); padding: 9px 15px; border-radius: var(--r); font-size: 14px; z-index: 20; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r); padding: 14px 16px; color: var(--muted); }
.foot { padding-block: 18px 28px; font-size: 12px; color: var(--muted); font-family: var(--f-mono); letter-spacing: .04em; }

@media (max-width: 760px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .owner .grid2, .deliver { grid-template-columns: minmax(0, 1fr); }
  .logo img { height: 32px; }
  .entry h2 { font-size: 22px; }
  .detail { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.momento { max-width: 170px; }

/* Ideas y temas */
.ideas { padding-block: 18px 40px; }
.ideas-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ideas-side { display: grid; gap: 14px; min-width: 0; }
.box { padding: 16px; display: grid; gap: 10px; }
.box > h3 { font-size: 17px; font-weight: 600; }
.box.owner > h3 { font-size: 13px; }
.box textarea { min-height: 150px; }
.box textarea.short { min-height: 80px; }
.ideas-bank { display: grid; gap: 20px; min-width: 0; }
.idea-list { display: grid; gap: 10px; }
.idea { padding: 14px 16px; display: grid; gap: 6px; }
.idea.ia { border-color: rgba(188, 0, 255, .35); }
.idea .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.idea h4 { margin: 0; font-family: var(--f-display); font-size: 18px; font-weight: 600; line-height: 1.25; }
.idea .gancho { color: var(--ink); font-style: italic; }
.tag { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--cyan); }
.idea.ia .tag { color: var(--magenta-soft); }
details > summary { cursor: pointer; }
@media (max-width: 760px) { .ideas-grid { grid-template-columns: minmax(0, 1fr); } }
