.manager-body { min-height: 100vh; background: #efeee9; }
.manager-nav { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; padding: 26px 20px; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.08); color: white; background: #17191b; }
.manager-nav .brand small { color: rgba(255,255,255,.5); }
.manager-nav nav { margin-top: 48px; display: grid; gap: 8px; }
.nav-item { width: 100%; padding: 13px 15px; border: 0; border-radius: 12px; color: rgba(255,255,255,.62); background: transparent; text-align: left; font-weight: 750; }
.nav-item:hover, .nav-item.is-active { color: white; background: rgba(255,255,255,.09); }
.manager-nav__footer { margin-top: auto; padding-top: 20px; display: flex; align-items: center; gap: 11px; border-top: 1px solid rgba(255,255,255,.1); }
.manager-nav__footer .avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); font-size: 12px; font-weight: 900; }
.manager-nav__footer strong, .manager-nav__footer small { display: block; }
.manager-nav__footer strong { font-size: 13px; }.manager-nav__footer small { margin-top: 2px; color: rgba(255,255,255,.5); font-size: 11px; }
.logout-link { margin-left: auto; padding: 9px 11px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 850; white-space: nowrap; }
.logout-link:hover, .logout-link:focus-visible { border-color: rgba(255,255,255,.4); color: white; background: rgba(255,255,255,.08); outline: 0; }
.manager-main { max-width: 1460px; min-height: 100vh; margin-left: 260px; padding: 34px 42px 70px; }
.manager-status { margin-bottom: 26px; padding: 11px 15px; display: flex; align-items: center; gap: 8px; border: 1px solid #cbd6dc; border-radius: 12px; color: #293b46; background: #eef3f6; font-size: 13px; }
.manager-status__dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #607985; box-shadow: 0 0 0 4px rgba(96,121,133,.13); }
.manager-status strong { white-space: nowrap; }.manager-status strong::after { content: "·"; margin-left: 8px; font-weight: 500; }
.manager-status--live { border-color: #a7d7b8; color: #185a36; background: #e7f5ec; }.manager-status--live .manager-status__dot { background: #23834d; box-shadow: 0 0 0 4px rgba(35,131,77,.13); }
.manager-status--preview { border-color: #e3c170; color: #654509; background: #fff4d5; }.manager-status--preview .manager-status__dot { background: #9a6b0d; box-shadow: 0 0 0 4px rgba(154,107,13,.13); }
.manager-status--error { border-color: #e8aaa4; color: #75261f; background: #fdeae8; }.manager-status--error .manager-status__dot { background: #b83228; box-shadow: 0 0 0 4px rgba(184,50,40,.13); }
.manager-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.manager-header h1 { margin: 5px 0 0; color: #17191b; font-size: clamp(40px,5vw,62px); line-height: .95; }
.manager-header > div > p:last-child { margin: 13px 0 0; color: var(--muted); }
.manager-stats { margin-top: 28px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.manager-stats article { padding: 22px; border: 1px solid rgba(0,0,0,.09); border-radius: 20px; background: white; }
.manager-stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.manager-stats strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -.03em; }
.manager-list { margin-top: 18px; overflow: hidden; border: 1px solid rgba(0,0,0,.09); border-radius: 22px; background: white; }
.manager-toolbar { padding: 16px; display: grid; grid-template-columns: 1fr 220px; gap: 12px; border-bottom: 1px solid rgba(0,0,0,.08); }
.manager-toolbar input, .manager-toolbar select { min-width: 0; padding: 13px 14px; border: 1px solid rgba(0,0,0,.13); border-radius: 11px; outline: 0; background: white; }
.manager-toolbar input:focus, .manager-toolbar select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185,44,35,.14); }
.manager-vehicle { padding: 15px 17px; display: grid; grid-template-columns: 88px minmax(200px,1fr) 110px 110px 130px 42px 42px; align-items: center; gap: 10px; border-bottom: 1px solid rgba(0,0,0,.07); }
.manager-vehicle:last-child { border-bottom: 0; }
.manager-vehicle > img { width: 88px; aspect-ratio: 16/10; border-radius: 10px; object-fit: cover; background: #e7e5df; }
.manager-vehicle__name strong, .manager-vehicle__name span { display: block; }.manager-vehicle__name span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.manager-vehicle__metric strong, .manager-vehicle__metric small { display: block; }.manager-vehicle__metric small { margin-top: 3px; color: var(--muted); }
.state-pill { justify-self: start; padding: 7px 10px; border-radius: 999px; background: #def5e8; color: #187344; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.state-pill--reserved { color: #7a5615; background: #fff0c9; }.state-pill--sold { color: #6b6c6e; background: #e8e8e8; }.state-pill--hidden { color: #783d38; background: #f8dfdc; }
.row-menu, .row-social { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #efeee9; font-size: 19px; font-weight: 900; }
.row-social { color: white; background: var(--red); font-size: 18px; }
.row-social:hover { background: #932119; }
.row-social:disabled { color: #9a9b9c; background: #e5e4df; cursor: not-allowed; }
.mobile-add { display: none; }
.manager-modal[hidden], .toast[hidden] { display: none; }
.manager-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.manager-modal__backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(5px); }
.vehicle-form, .import-panel { position: relative; z-index: 1; width: min(820px,100%); max-height: 94vh; overflow-y: auto; border-radius: 26px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.32); }
.vehicle-form > header, .import-panel > header { padding: 24px 26px; display: flex; align-items: start; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,.08); }
.vehicle-form h2, .import-panel h2 { margin: 6px 0 0; font-size: 32px; }
.form-close, .import-close { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #efeee9; font-size: 23px; font-weight: 900; }
.form-grid { padding: 24px 26px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-width: 0; padding: 12px 13px; border: 1px solid rgba(0,0,0,.15); border-radius: 10px; outline: 0; color: #17191b; background: white; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185,44,35,.14); }
.form-wide { grid-column: 1/-1; }
.photo-input { padding: 18px; border: 1px dashed rgba(0,0,0,.22); border-radius: 14px; text-align: center; cursor: pointer; }
.photo-input input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-input span { color: var(--red); font-size: 14px; font-weight: 900; text-transform: none; }.photo-input small { color: var(--muted); text-transform: none; }
.vehicle-form > footer { position: sticky; bottom: 0; z-index: 4; width: 100%; margin: 0; padding: 18px 26px; display: flex; justify-content: end; gap: 10px; border-top: 1px solid rgba(0,0,0,.08); background: rgba(250,249,247,.97); backdrop-filter: blur(10px); }
.form-cancel { border: 1px solid rgba(0,0,0,.12); background: white; }
.editor-photos { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 12px; }
.editor-photo { min-width: 0; overflow: hidden; border: 1px solid #d9d7d2; border-radius: 14px; background: #f7f6f2; }
.editor-photo img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.editor-photo span { display: block; padding: 9px 10px 0; color: #53565a; font-size: 12px; }
.editor-photo button { width: calc(100% - 16px); min-height: 44px; margin: 8px; border: 1px solid #c5a09d; border-radius: 9px; background: white; color: #8b2720; font-size: 13px; font-weight: 750; }
.editor-photo--pending { border-style: dashed; }
.editor-photo__order { padding: 8px 8px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.editor-photo__order button { width: 100%; margin: 0; border-color: #d1cfca; color: #292c2e; font-size: 20px; }
.editor-photo__order .editor-photo__primary { grid-column: 1/-1; padding: 6px; font-size: 12px; color: #8b2720; border-color: #c5a09d; }
.vehicle-form .editor-photo__order button:disabled { cursor: default; }
.vehicle-form[aria-busy="true"] .editor-photo__order button { cursor: wait; }
.editor-photo:focus-visible, .editor-photo button:focus-visible { outline: 2px solid var(--red); outline-offset: -3px; }
.editor-photos-empty { grid-column: 1/-1; margin: 0; padding: 18px; border-radius: 12px; background: #f3f2ee; color: #53565a; font-size: 14px; }
.editor-help, .vehicle-danger p { margin: 12px 0 0; color: #53565a; font-size: 13px; line-height: 1.6; }
.vehicle-danger { padding: 18px; border: 1px solid #e8c2bd; border-radius: 14px; background: #fff7f6; }
.vehicle-danger h3 { margin: 0; font-size: 17px; }
.button--danger { margin-top: 14px; border: 1px solid #b92c23; color: #92251e; background: white; }
.form-status { margin: 0; color: #7d241d; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.form-status:empty { display: none; }
.vehicle-form button:disabled { opacity: .55; cursor: wait; }
.photo-input:focus-within { outline: 2px solid var(--red); outline-offset: 3px; }
.vehicle-form > footer { flex-wrap: wrap; }
@media (max-width: 430px) { .vehicle-form > footer .button { flex: 1 1 140px; padding-inline: 12px; } }
.import-panel { width: min(600px,100%); padding-bottom: 24px; }.import-panel > p { padding: 0 26px; color: var(--muted); line-height: 1.6; }
.import-drop { margin: 20px 26px 0; min-height: 140px; display: grid; place-items: center; border: 2px dashed rgba(0,0,0,.18); border-radius: 18px; color: var(--red); font-weight: 900; cursor: pointer; }.import-drop input { position: absolute; opacity: 0; }
.import-result { margin: 18px 26px 0; padding: 16px; border-radius: 14px; background: #efeee9; line-height: 1.6; }
.social-panel { position: relative; z-index: 1; width: min(1080px,100%); max-height: 94vh; max-height: 94dvh; overflow-y: auto; border-radius: 26px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.32); }
.social-panel > header { position: sticky; top: 0; z-index: 3; padding: 22px 24px; display: flex; align-items: start; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(0,0,0,.08); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.social-panel h2 { margin: 6px 0 0; font-size: 34px; }
.social-close { width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #efeee9; font-size: 23px; font-weight: 900; }
.social-layout { padding: 24px; display: grid; grid-template-columns: minmax(280px,420px) minmax(0,1fr); align-items: start; gap: 30px; }
.social-preview { width: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; border-radius: 22px; color: rgba(255,255,255,.66); background: #17191b; box-shadow: 0 18px 50px rgba(0,0,0,.2); font-size: 13px; font-weight: 800; }
.social-preview--story { aspect-ratio: 9/16; }
.social-preview--post { aspect-ratio: 4/5; }
.social-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.social-preview img[hidden] { display: none; }
.social-controls { min-width: 0; display: grid; gap: 20px; }
.social-label, .social-caption { display: grid; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.social-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.social-formats button { padding: 12px; border: 1px solid rgba(0,0,0,.13); border-radius: 11px; color: var(--muted); background: white; font-weight: 850; }
.social-formats button.is-active { border-color: var(--ink); color: white; background: var(--ink); }
.social-caption textarea { width: 100%; resize: vertical; padding: 13px; border: 1px solid rgba(0,0,0,.13); border-radius: 12px; color: var(--ink); background: #f7f6f2; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.55; text-transform: none; letter-spacing: 0; }
.social-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.social-actions .button { width: 100%; }
.social-actions .button:disabled { opacity: .5; cursor: wait; }
.social-public-link { justify-self: start; color: var(--red); font-size: 13px; font-weight: 850; }
.social-help { margin: 0; padding: 14px; border-radius: 12px; color: var(--muted); background: #efeee9; font-size: 12px; line-height: 1.55; }
.print-tune { padding: 12px 14px; border: 1px solid rgba(0,0,0,.1); border-radius: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.print-tune summary { color: var(--ink); font-size: 13px; font-weight: 850; cursor: pointer; }
.print-tune p { margin: 10px 0 0; }
.print-tune__fields { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.print-tune label { display: grid; gap: 6px; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.print-tune input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid rgba(0,0,0,.15); border-radius: 10px; outline: 0; color: var(--ink); background: white; font-size: 15px; font-weight: 700; }
.print-tune input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185,44,35,.14); }
.social-progress { min-height: 20px; margin: 0; color: #226e44; font-size: 13px; font-weight: 800; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: 360px; padding: 15px 18px; border-radius: 13px; color: white; background: #17191b; box-shadow: 0 18px 50px rgba(0,0,0,.28); font-size: 14px; font-weight: 750; }

@media (max-width: 1080px) {
  .manager-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .manager-vehicle { grid-template-columns: 76px minmax(180px,1fr) 100px 120px 42px 42px; }.manager-vehicle > img { width: 76px; }.manager-vehicle__metric:nth-of-type(2) { display: none; }
}
@media (max-width: 900px) {
  .manager-nav { position: static; width: auto; height: 72px; padding: 14px 16px; flex-direction: row; align-items: center; }.manager-nav nav { display: none; }
  .manager-nav__footer { margin: 0 0 0 auto; padding: 0; display: flex; border: 0; }.manager-nav__footer .avatar, .manager-nav__identity { display: none; }.logout-link { padding: 10px 13px; border-color: rgba(255,255,255,.24); font-size: 12px; }
  .manager-main { margin-left: 0; padding: 20px 16px 100px; }.manager-status { align-items: start; flex-wrap: wrap; }.manager-status__dot { margin-top: 4px; }.manager-status strong::after { content: none; }.manager-status > span:last-child { width: 100%; padding-left: 16px; }
  .manager-header { align-items: start; }.manager-header > .button { display: none; }.manager-header h1 { font-size: 44px; }
  .manager-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }.manager-stats article { padding: 16px; }.manager-stats strong { font-size: 23px; }
  .manager-toolbar { grid-template-columns: 1fr; }.manager-vehicle { grid-template-columns: 72px minmax(0,1fr) 36px 36px; gap: 9px; }.manager-vehicle > img { width: 72px; }.manager-vehicle__metric, .state-pill { display: none; }
  .mobile-add { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 60px; height: 60px; display: grid; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--red); box-shadow: 0 12px 30px rgba(185,44,35,.35); font-size: 32px; }
  .manager-modal { place-items: end; padding: 0; }.vehicle-form, .import-panel { max-height: 96vh; border-radius: 26px 26px 0 0; }
  .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 20px 18px; }.vehicle-form > header, .vehicle-form > footer, .import-panel > header { padding-left: 18px; padding-right: 18px; }
  .social-layout { grid-template-columns: minmax(240px,360px) minmax(0,1fr); padding: 18px; gap: 20px; }
}
@media (max-width: 680px) {
  .social-panel { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .social-layout { grid-template-columns: 1fr; }
  .social-preview { width: min(100%,340px); min-height: 0; margin: auto; }
}
@media (max-width: 430px) { .form-grid { grid-template-columns: 1fr; }.form-wide { grid-column: auto; }.social-actions { grid-template-columns: 1fr; } }

.login-body { min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px 16px; background: #17191b; }
.login-card { width: min(420px, 100%); padding: 32px 28px; border-radius: 24px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-brand { margin-bottom: 22px; }
.login-card h1 { margin: 0 0 18px; font-size: 26px; letter-spacing: -.02em; }
.login-form { display: grid; gap: 8px; }
.login-form label { margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.login-form input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid rgba(0,0,0,.18); border-radius: 12px; outline: 0; color: var(--ink); background: white; font-size: 16px; }
.login-form input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185,44,35,.18); }
.login-form .button { min-height: 48px; margin-top: 10px; }
.login-form .button:disabled { opacity: .6; cursor: wait; }
.login-status { min-height: 20px; margin: 6px 0 0; color: #a3251c; font-size: 14px; font-weight: 750; }
.login-help { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Etiqueta de concesionario (A4) */
.social-panel [hidden] { display: none !important; }
.social-formats button[data-social-format="label"] { grid-column: 1 / -1; }
.social-preview--label { aspect-ratio: 210/297; }
.print-label { display: none; }
/* Marco del PDF para imprimir: invisible, pero cargado para que el visor de PDF pueda imprimirlo. */
.print-label-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }
/* Página con nombre: el formato A4 sin márgenes solo afecta a la etiqueta,
   nunca a un Ctrl+P normal del panel (un @page sin nombre sería global). */
@page etiqueta-espino { size: A4 portrait; margin: 0; }
@media print {
  html:has(body.printing-label), body.printing-label { margin: 0; padding: 0; background: white; }
  body.printing-label > *:not(.print-label) { display: none !important; }
  /* Borde blanco de 10 mm por cada lado: casi ninguna impresora imprime hasta el
     canto del papel y, sin este borde, recorta la etiqueta de forma desigual y la
     descentra. La imagen queda centrada dentro de la hoja, sin deformar. */
  body.printing-label .print-label { display: block; box-sizing: border-box; height: 100vh; padding: 10mm; overflow: hidden; page: etiqueta-espino; }
  /* Ajuste fino por impresora (gestion.js): desplaza la etiqueta dentro del borde. */
  body.printing-label .print-label img { display: block; width: 100%; height: 100%; object-fit: contain; break-inside: avoid; transform: translate(var(--print-offset-x, 0mm), var(--print-offset-y, 0mm)); }
}
