/**
 * backstage.css — Panel «Archivo» a pantalla completa (ui/backstage.js).
 *
 * Complementa (no sustituye) el bloque «Backstage "Abrir"» de css/excel.css:
 * de allí vienen .bs-overlay, .bs-side, .bs-back, .bs-item, .bs-sep,
 * .bs-spacer, .bs-main, .bs-title, .bs-list, .bs-list-head, .bs-row,
 * .bs-row-name, .bs-row-date, .bs-hint, .bs-group y .bs-foot. Aquí solo está
 * lo que el panel nuevo añade: banda verde de Excel 2024, tarjetas de
 * plantilla con miniatura, filtros por categoría, las dos columnas de Inicio,
 * el pie de las listas paginadas, la rejilla de «Compartidos», la página
 * Cuenta y el formulario de «Guardar como».
 *
 * Todo va acotado a `.bs-full` (la clase que ui/backstage.js pone en su raíz
 * junto a .bs-overlay), de modo que la vista «Abrir» heredada de main.js
 * conserva su aspecto sin tocar excel.css.
 *
 * Paleta: variables --xl-* de css/tokens.css (verde Excel, no azul Word).
 */

/* Contenedor de montaje: no debe ocupar sitio en el layout de #app. */
#backstage-root { display: contents; }

/* ============================== Marco general ============================= */

.bs-overlay.bs-full {
  z-index: 5000;
  color: var(--xl-text);
  animation: bs-full-in .12s ease-out;
}

@keyframes bs-full-in {
  from { opacity: .4; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---- Banda de navegación (verde Excel 2024) ---- */
.bs-full .bs-side {
  width: 208px;
  padding: 10px 0 20px;
  background: var(--xl-green);
  color: #FFFFFF;
}
.bs-full .bs-back {
  margin: 4px 14px 16px;
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .16);
  color: #FFFFFF;
}
.bs-full .bs-back:hover { background: rgba(255, 255, 255, .30); }
.bs-full .bs-item {
  color: #FFFFFF;
  font-size: 13.5px;
  padding: 9px 18px;
}
.bs-full .bs-item:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.bs-full .bs-item.is-active {
  background: rgba(255, 255, 255, .22);
  border-left-color: #FFFFFF;
  color: #FFFFFF;
  font-weight: 600;
}
.bs-full .bs-sep { background: rgba(255, 255, 255, .28); }
.bs-full .bs-item:focus-visible,
.bs-full .bs-back:focus-visible { outline: 2px solid #FFFFFF; outline-offset: -2px; }

/* ---- Panel de contenido (con scroll propio) ---- */
.bs-full .bs-main {
  display: block;
  overflow: auto;
  padding: 26px 44px 44px;
}
.bs-full .bs-title { margin: 0 0 18px; }
.bs-full .bs-sub {
  margin: 22px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--xl-text-2);
}
.bs-full .bs-text {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--xl-text-secondary);
  max-width: 720px;
}
.bs-full .bs-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}
.bs-full .bs-place-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--xl-text-2);
}
.bs-full .bs-place-inline .xl-icon { width: 18px; height: 18px; }

/* ================================ Controles =============================== */

.bs-full .bs-btn {
  appearance: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 16px;
  min-height: 30px;
  border-radius: 3px;
  border: 1px solid var(--xl-separator);
  background: #FFFFFF;
  color: var(--xl-text);
}
.bs-full .bs-btn:hover:not(:disabled) { background: var(--xl-hover-solid); }
.bs-full .bs-btn:disabled { color: var(--xl-text-disabled); cursor: default; }
.bs-full .bs-btn.primary {
  background: var(--xl-green);
  border-color: var(--xl-green);
  color: #FFFFFF;
}
.bs-full .bs-btn.primary:hover:not(:disabled) {
  background: var(--xl-accent);
  border-color: var(--xl-accent);
}
.bs-full .bs-btn:focus-visible { outline: 2px solid var(--xl-accent); outline-offset: 1px; }

.bs-full .bs-input {
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
  min-width: 320px;
  border-radius: 3px;
  border: 1px solid var(--xl-text-disabled);
  background: #FFFFFF;
  color: inherit;
}
.bs-full .bs-input:focus { outline: 2px solid var(--xl-accent); outline-offset: -1px; }

.bs-full .bs-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  color: var(--xl-link);
  text-align: left;
  text-decoration: none;
}
.bs-full .bs-link:hover { text-decoration: underline; }

/* ========================= Galería de plantillas ========================== */

.bs-full .bs-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 8px;
}
.bs-full .bs-card {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font: inherit;
  color: inherit;
  width: 176px;
}
.bs-full .bs-card-thumb {
  width: 176px;
  height: 124px;
  box-sizing: border-box;
  background: #FFFFFF;
  border: 1px solid var(--xl-separator);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.bs-full .bs-card:hover .bs-card-thumb { border-color: var(--xl-green); }
.bs-full .bs-card:focus-visible .bs-card-thumb { outline: 2px solid var(--xl-accent); outline-offset: 1px; }
.bs-full .bs-card-plus { position: relative; width: 30px; height: 30px; opacity: .5; }
.bs-full .bs-card-plus::before,
.bs-full .bs-card-plus::after {
  content: "";
  position: absolute;
  background: var(--xl-text-secondary);
}
.bs-full .bs-card-plus::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
.bs-full .bs-card-plus::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); }
.bs-full .bs-card-label {
  font-size: 12.5px;
  line-height: 1.3;
  text-align: left;
}
/* Marco de la miniatura: cuadrícula tenue mientras (o si) no hay SVG. */
.bs-full .bs-card-thumb-tpl {
  background:
    linear-gradient(90deg, var(--xl-gridline) 1px, transparent 1px) 0 0 / 22px 100%,
    linear-gradient(var(--xl-gridline) 1px, transparent 1px) 0 0 / 100% 16px,
    #FFFFFF;
}
.bs-full .bs-card-thumb-tpl svg { width: 100%; height: 100%; display: block; }
.bs-full .bs-gallery-more { margin: 4px 0 2px; font-size: 13px; }

/* Filtros por categoría de la página Nuevo */
.bs-full .bs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.bs-full .bs-chip {
  appearance: none;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--xl-separator);
  background: #FFFFFF;
  color: var(--xl-text);
}
.bs-full .bs-chip:hover { background: var(--xl-hover-solid); }
.bs-full .bs-chip.sel {
  background: var(--xl-green);
  border-color: var(--xl-green);
  color: #FFFFFF;
  font-weight: 600;
}
.bs-full .bs-chip:focus-visible { outline: 2px solid var(--xl-accent); outline-offset: 1px; }

/* ============================ Listas de libros ============================ */

.bs-full .bs-list { flex: none; overflow: visible; max-width: 940px; }
.bs-full .bs-list-head.bs-head-cols {
  justify-content: flex-start;
  gap: 12px;
}
.bs-full .bs-row { align-items: center; }
.bs-full .bs-row-icon { display: inline-flex; flex: none; }
.bs-full .bs-row-icon .xl-icon { width: 22px; height: 22px; }
.bs-full .bs-col-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-full .bs-col-date,
.bs-full .bs-col-size,
.bs-full .bs-col-with,
.bs-full .bs-col-mode {
  font-size: 12px;
  color: var(--xl-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-full .bs-col-date { flex: 0 0 134px; }
.bs-full .bs-col-size { flex: 0 0 76px; text-align: right; }
/* «Compartidos»: nombre · destinatarios · permiso · fecha */
.bs-full .bs-col-with { flex: 1 1 40%; min-width: 0; }
.bs-full .bs-col-mode { flex: 0 0 88px; }
.bs-full .bs-list-shared .bs-col-name { flex: 1 1 45%; }

/* Pie de las listas paginadas: «Ver más» + «Mostrando X de N» */
.bs-full .bs-list-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 0;
}
.bs-full .bs-list-foot:empty { display: none; }
.bs-full .bs-list-count,
.bs-full .bs-list-error { font-size: 12px; color: var(--xl-text-secondary); }
.bs-full .bs-list-error { color: #A4262C; }

/* Inicio: «Recientes» y «Compartidos» en dos columnas paralelas */
.bs-full .bs-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 40px;
  align-items: start;
}
.bs-full .bs-column { min-width: 0; }
.bs-full .bs-column .bs-list { max-width: none; }
.bs-full .bs-column .bs-col-date { flex: 0 0 116px; }
.bs-full .bs-column .bs-col-size { flex: 0 0 64px; }
.bs-full .bs-column .bs-col-mode { flex: 0 0 78px; }
@media (max-width: 1180px) {
  .bs-full .bs-columns { grid-template-columns: minmax(0, 1fr); }
}

/* Pie de «Abrir»: recuperar copias locales del autoguardado */
.bs-full .bs-foot { margin-top: 18px; }
.bs-full .bs-recover { margin-top: 8px; max-width: 940px; }
.bs-full .bs-foot .bs-row {
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #F1F0EF;
  border-radius: 0;
  background: none;
  width: 100%;
}
.bs-full .bs-foot .bs-row:hover { background: var(--xl-hover-solid); }

/* =============================== Exportar ================================= */

.bs-full .bs-option {
  max-width: 640px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--xl-separator);
}
.bs-full .bs-option-title { margin: 0 0 6px; font-size: 14px; font-weight: 600; }

/* ================================ Cuenta ================================== */

.bs-full .bs-account { max-width: 640px; }
.bs-full .bs-user { display: flex; align-items: flex-start; gap: 14px; margin: 6px 0 14px; }
.bs-full .bs-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--xl-green);
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 600;
}
.bs-full .bs-user-name { font-size: 15px; font-weight: 600; }
.bs-full .bs-user-mail { font-size: 13px; color: var(--xl-text-secondary); margin: 2px 0 6px; }
.bs-full .bs-user-links { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
