/* Panel de administración (usa los colores y botones de styles.css) */
body.adm { background: var(--soft); min-height: 100vh; }
[hidden] { display: none !important; }
.plus { font-size: 1.2rem; line-height: 1; font-weight: 700; }
.err { color: #b42318; background: #fef3f2; border-radius: var(--r); padding: .6rem .8rem; font-size: .88rem; margin: 0; }
textarea { font: 400 .95rem/1.5 var(--sans); color: var(--ink); padding: .7rem .8rem; border: 1px solid #cfd5dd; border-radius: var(--r); width: 100%; resize: vertical; background: var(--white); }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* Acceso */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 80% 20%, #0a4fd6, #001e50 65%); }
.login-box { background: var(--white); border-radius: 10px; padding: 2.2rem; width: min(400px, 100%); display: flex; flex-direction: column; gap: 1rem; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.login-box .brand-mark { background: var(--navy); color: var(--white); }
.login-box h1 { font: 800 1.4rem var(--serif); color: var(--navy); }
.login-box p { margin: 0; color: var(--muted); font-size: .92rem; }
.login-box label { display: flex; flex-direction: column; gap: .35rem; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.login-box .btn { justify-content: center; }
.volver { font-size: .88rem; color: var(--muted); text-decoration: none; text-align: center; }

/* Encabezado y pestañas */
.adm .top-in { gap: 1.2rem; }
.tabs { display: flex; gap: .3rem; margin-left: 1rem; }
.tabs button { background: none; border: 0; color: #c3d2ea; font: 600 .92rem var(--sans); padding: .5rem .9rem; border-radius: 6px; cursor: pointer; }
.tabs button.on { background: rgba(255,255,255,.12); color: var(--white); }
.top-actions { margin-left: auto; display: flex; gap: .5rem; }

.panel { padding-top: 2rem; padding-bottom: 5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.panel-head h2 { margin-bottom: .3rem; font-size: 1.8rem; }
.panel-head p { margin: 0; max-width: 46rem; }

/* Lista de autos */
.lista { display: grid; gap: .8rem; }
.fila { display: grid; grid-template-columns: 120px 1fr auto; gap: 1rem; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem; }
.fila.vendido { opacity: .6; }
.fila img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; background: var(--soft); }
.fila h3 { font: 700 1.05rem var(--serif); color: var(--navy); display: flex; align-items: center; gap: .4rem; }
.fila .det { font-size: .85rem; color: var(--muted); margin: .15rem 0 .5rem; }
.fila .det b { color: var(--navy); font-size: .95rem; }
.fila .ops { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.fila select { width: auto; padding: .45rem .6rem; font-size: .85rem; }
.fila select.disponible { color: var(--ok); }
.fila select.apartado { color: var(--warn); }
.fila select.vendido { color: #9b2c2c; }
.ico { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--white); border-radius: 6px; cursor: pointer; color: var(--muted); }
.ico:hover { border-color: var(--accent); color: var(--accent); }
.ico.star.on { color: #f5a300; border-color: #f5c451; background: #fff8e6; }
.ico.del:hover { color: #b42318; border-color: #f3b5ae; }
.ico .ic { width: 18px; height: 18px; }
.star-tag { color: #f5a300; }
.star-tag .ic { width: 16px; height: 16px; }
.vacio { text-align: center; padding: 3rem 1rem; background: var(--white); border: 1px dashed #c7d2e3; border-radius: var(--r); color: var(--muted); }

/* Editor */
.editor { border: 0; padding: 0; border-radius: 10px; width: min(860px, 96vw); max-height: 94vh; }
.editor::backdrop { background: rgba(0,18,47,.75); }
.editor form { display: flex; flex-direction: column; max-height: 94vh; }
.ed-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); }
.ed-head h3 { font: 800 1.2rem var(--serif); color: var(--navy); }
.ed-head .x { background: none; border: 0; font-size: 1.8rem; cursor: pointer; color: var(--muted); }
.ed-body { overflow-y: auto; padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 1.4rem; }
.ed-fotos h4 { font: 700 .95rem var(--serif); color: var(--navy); margin: 0 0 .7rem; }
.ed-fotos small { font: 400 .8rem var(--sans); color: var(--muted); margin-left: .4rem; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.fotos:empty { display: none; }
.foto { position: relative; aspect-ratio: 4/3; border-radius: 6px; overflow: hidden; background: var(--soft); border: 2px solid transparent; }
.foto:first-child { border-color: var(--accent); }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto .tag { position: absolute; left: 4px; top: 4px; background: var(--accent); color: var(--white); font-size: .65rem; font-weight: 700; padding: .15rem .4rem; border-radius: 3px; text-transform: uppercase; letter-spacing: .05em; }
.foto .acc { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.foto .acc button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; font-size: .95rem; line-height: 1; color: var(--navy); }
.foto .acc button:disabled { opacity: .3; cursor: default; }
.foto .acc .rm { color: #b42318; }
.add-foto { cursor: pointer; }
.ed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.ed-grid label { display: flex; flex-direction: column; gap: .35rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ed-grid .full { grid-column: 1 / -1; }
.ed-grid .check { flex-direction: row; align-items: center; gap: .5rem; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); align-self: end; padding-bottom: .7rem; }
.ed-grid .check input { width: 18px; height: 18px; }
.ed-foot { display: flex; gap: .6rem; justify-content: flex-end; align-items: center; padding: 1rem 1.4rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ed-foot .err { margin-right: auto; }

/* Asistente */
.asis { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; align-items: start; }
.asis-form { display: flex; flex-direction: column; gap: 1rem; }
.asis fieldset { border: 1px solid var(--line); background: var(--white); border-radius: var(--r); padding: 1rem 1.1rem 1.1rem; margin: 0; }
.asis legend { font: 700 .95rem var(--serif); color: var(--navy); padding: 0 .3rem; }
.hint { margin: 0 0 .6rem; font-size: .82rem; color: var(--muted); }
.faq { display: grid; gap: .4rem; padding: .8rem; background: var(--soft); border-radius: var(--r); margin-bottom: .6rem; position: relative; }
.faq input, .faq textarea { font-size: .9rem; }
.faq .rm { position: absolute; top: .4rem; right: .4rem; background: none; border: 0; font-size: 1.3rem; color: var(--muted); cursor: pointer; }
.faq input { padding-right: 2rem; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; background: rgba(245,246,248,.95); padding: .8rem 0; }
.probar { position: sticky; top: 90px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.probar h3 { font: 700 1.05rem var(--serif); color: var(--navy); }
.probar p { margin: 0; font-size: .85rem; }
.probar .chat-log { flex: none; height: 380px; border-radius: var(--r); border: 1px solid var(--line); }
.probar .chat-in { padding: 0; }
.probar .autos-rec { margin-top: .4rem; font-size: .8rem; color: var(--accent); font-weight: 600; }
.link { background: none; border: 0; color: var(--accent); font: 500 .85rem var(--sans); cursor: pointer; align-self: flex-start; padding: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: var(--white); padding: .8rem 1.2rem; border-radius: 8px; font-size: .9rem; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.toast.mal { background: #b42318; }

@media (max-width: 900px) {
  .asis { grid-template-columns: 1fr; }
  .probar { position: static; }
  .ed-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .adm .top-in { height: auto; flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; gap: .6rem; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tabs button { flex: 1; }
  .top-actions .btn { padding: .45rem .7rem; font-size: .8rem; }
  .panel-head { flex-direction: column; }
  .panel-head .btn { width: 100%; justify-content: center; }
  .fila { grid-template-columns: 96px 1fr; }
  .fila img { width: 96px; height: 72px; }
  .fila .ops { grid-column: 1 / -1; justify-content: space-between; }
  .fila select { flex: 1; }
  .editor { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; margin: 0; }
  .editor form { max-height: 100vh; height: 100%; }
  .ed-body { flex: 1; }
  .ed-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .ed-foot .btn { flex: 1; justify-content: center; }
  .ed-foot .err { flex-basis: 100%; }
  .fotos { grid-template-columns: repeat(3, 1fr); }
}
