/* Paleta, glow y disposición inspirados en AutoExpert recibido en comparador.zip. */
:root {
  color-scheme: dark;
  --bg: #09090f;
  --surface: #111118;
  --surface2: #1a1a25;
  --surface3: #22222f;
  --line: rgba(255,255,255,.08);
  --accent: #e8ff47;
  --accent2: #47ffe8;
  --text: #f0f0f5;
  --muted: #9999b1;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 'Segoe UI', system-ui, sans-serif; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 15% 0,rgba(232,255,71,.06),transparent 55%),radial-gradient(ellipse at 95% 95%,rgba(71,255,232,.05),transparent 55%); }
.app-shell { position: relative; max-width: 1440px; min-height: 100vh; margin: auto; display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
.authenticated .app-shell { grid-template-columns: 260px minmax(0,1fr); }
header { grid-column: 1/-1; display: flex; align-items: center; gap: 24px; padding: 20px 30px; border-bottom: 1px solid var(--line); background: rgba(9,9,15,.9); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(16px); }
.logo { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 22px; font-weight: 800; letter-spacing: -.7px; text-decoration: none; white-space: nowrap; }
.logo b { color: var(--accent); }
.logo small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .6px; }
.logo-icon { display: grid; place-items: center; background: var(--accent); color: var(--bg); width: 38px; height: 38px; border-radius: 10px; font-size: 20px; }
nav { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; }
button { border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; background: var(--surface2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: background .15s,border-color .15s; }
button:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .55; cursor: wait; }
nav button { border-radius: 100px; font-size: 12px; padding: 6px 13px; color: var(--muted); }
nav button.active,.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.primary:hover { background: #f1ff90; color: var(--bg); box-shadow: 0 0 28px rgba(232,255,71,.12); }
.account-actions { display: flex; gap: 12px; align-items: center; margin-left: auto; }
#account-name { font-size: 11px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { grid-column: 1; grid-row: 2; min-width: 0; padding: 28px 36px; }
.authenticated main { grid-column: 2; }
aside { grid-column: 1; grid-row: 2; border-right: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-section { text-transform: uppercase; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); padding: 10px 12px 0; }
aside button { text-align: left; background: transparent; border-color: transparent; padding: 11px 12px; display: flex; align-items: center; gap: 12px; }
aside button.active { background: rgba(232,255,71,.08); color: var(--accent); border-color: rgba(232,255,71,.15); }
.sidebar-note { padding: 16px 12px; margin-top: auto; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.sidebar-note p { font-size: 11px; }
.live-dot { display: inline-block; width: 7px; height: 7px; background: var(--accent2); border-radius: 50%; margin-right: 7px; box-shadow: 0 0 10px rgba(71,255,232,.5); }
#status { min-height: 1.5rem; margin: 0 0 24px; color: var(--muted); font-size: 12px; }
#status.error { color: #ffacac; }
.view { animation: appear .2s ease; }
.eyebrow { color: var(--accent2); font-size: 10px; font-weight: 700; letter-spacing: 2px; margin: 0 0 10px; }
h1 { font-size: clamp(25px,3vw,34px); line-height: 1.2; font-weight: 800; letter-spacing: -.9px; margin: 0 0 14px; }
h2 { font-size: 20px; margin: 28px 0 14px; }
p,footer { color: var(--muted); }
.view > p:not(.eyebrow) { font-size: 13px; margin-bottom: 25px; }
.sign-in-panel { max-width: 780px; margin: 35px auto; padding: 45px 24px; text-align: center; }
.sign-in-panel h1 { font-size: clamp(34px,5vw,58px); letter-spacing: -2px; margin: 18px 0 22px; }
.sign-in-panel h1 em { color: var(--accent); font-style: normal; }
.sign-in-panel > p:not(.eyebrow) { max-width: 510px; margin: 16px auto 28px; }
.welcome-icon { display: grid; place-items: center; width: 78px; height: 78px; margin: 0 auto 28px; border-radius: 23px; background: var(--accent); color: var(--bg); font-size: 34px; box-shadow: 0 0 45px rgba(232,255,71,.13); }
#login { padding: 14px 26px; font-size: 15px; }
.sign-in-note { font-size: 11px; }
label { display: block; margin: 16px 0; color: var(--muted); font-size: 12px; }
input,select,textarea { display: block; width: 100%; margin: 7px 0; border-radius: 8px; border: 1px solid var(--line); padding: 12px 14px; background: var(--surface2); color: var(--text); font-size: 14px; line-height: 1.5; font-family: inherit; }
input:focus,select:focus,textarea:focus { border-color: var(--accent); }
select[multiple] { height: 215px; }
option { padding: 8px; }
textarea { resize: vertical; min-height: 95px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.toolbar label { flex: 1; min-width: 180px; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input { width: auto; flex-shrink: 0; margin-top: 4px; accent-color: var(--accent); }
.table-wrap { overflow: auto; padding: 20px; margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th,td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; }
td { color: var(--text); }
tbody tr:hover { background: rgba(255,255,255,.025); }
.winner { color: #4ade80; background: rgba(74,222,128,.08); font-weight: 700; }
.answer,.message { white-space: pre-wrap; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin: 16px 0; }
.message { margin-left: 10%; background: var(--surface2); }
#chat-form,#upload-form,#recommend-form,#extraction-review { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.job { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
#extraction-json { font: 12px/1.6 ui-monospace,monospace; min-height: 350px; }
footer { grid-column: 1/-1; border-top: 1px solid var(--line); text-align: center; padding: 18px; font-size: 10px; }
a { color: var(--accent2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
/* Estado cerrado por defecto aun si JavaScript no carga o falla. */
body:not(.authenticated) #workspace,
body:not(.authenticated) #app-nav,
body:not(.authenticated) #sidebar,
body:not(.authenticated) .view,
body:not(.authenticated) [data-view] { display: none !important; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media(max-width:1100px) { header { gap: 14px; flex-wrap: wrap; } nav { order: 3; flex-basis: 100%; } }
@media(max-width:800px) { .authenticated .app-shell { grid-template-columns: 1fr; } .authenticated main { grid-column: 1; } aside { display: none; } header { padding: 16px 20px; } main { padding: 24px 20px; } .table-wrap { padding: 12px; } .sign-in-panel { margin: 10px auto; padding: 25px 0; } #account-name { max-width: 110px; } }
@media(prefers-reduced-motion:reduce) { * { animation: none !important; transition: none !important; } }
