/* Panel de control. Hoja propia: el panel no carga el CSS del tema público.
   Pensada para reutilizarse en otros proyectos: todo sale de las variables de abajo. */

:root {
  --a-bg: #f4f6f9;
  --a-surface: #ffffff;
  --a-sidebar: #0e3a5c;
  --a-sidebar-soft: #15496f;
  --a-primary: #1b6aa3;
  --a-primary-dark: #15577f;
  --a-accent: #c9a227;
  --a-text: #16222c;
  --a-muted: #5d6b77;
  --a-border: #dde5ec;
  --a-ok: #2e7d6b;
  --a-warn: #b4761b;
  --a-danger: #c0392b;
  --a-radius: 10px;
  --a-radius-sm: 7px;
  --a-shadow: 0 1px 2px rgba(16, 36, 56, .06), 0 8px 24px rgba(16, 36, 56, .06);
  --a-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* El color del panel se elige en Ajustes del sitio y se guarda para este sitio. Cada paleta solo
   cambia estas seis variables; todo lo demás sale de ellas. */
body[data-panel="turquesa"] {
  --a-sidebar: #0d3b45;
  --a-sidebar-soft: #13535f;
  --a-primary: #11798c;
  --a-primary-dark: #0e6273;
  --a-accent: #d8a657;
}
body[data-panel="verde"] {
  --a-sidebar: #10403a;
  --a-sidebar-soft: #175a50;
  --a-primary: #1d7a68;
  --a-primary-dark: #156050;
  --a-accent: #c9a227;
}
body[data-panel="granate"] {
  --a-sidebar: #4a1420;
  --a-sidebar-soft: #68202f;
  --a-primary: #a32f44;
  --a-primary-dark: #852536;
  --a-accent: #d8a657;
}
body[data-panel="berenjena"] {
  --a-sidebar: #35204f;
  --a-sidebar-soft: #4a2d6b;
  --a-primary: #6f45a6;
  --a-primary-dark: #593686;
  --a-accent: #d8a657;
}
body[data-panel="grafito"] {
  --a-sidebar: #23272e;
  --a-sidebar-soft: #333942;
  --a-primary: #3f6f9f;
  --a-primary-dark: #335a82;
  --a-accent: #c9a227;
}

/* El azulón de las tarjetas de fichero sale del color del panel. */
.a-file-ext { background: color-mix(in srgb, var(--a-primary) 10%, transparent); }

/* Las muestras del selector de color del panel. */
.a-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.a-swatch { display: grid; gap: 8px; padding: 10px; cursor: pointer; text-align: left;
    background: var(--a-surface); border: 2px solid var(--a-border); border-radius: var(--a-radius-sm);
    font: inherit; color: var(--a-text); transition: border-color .12s, transform .12s; }
.a-swatch:hover { transform: translateY(-1px); }
.a-swatch.active { border-color: var(--a-primary); }
.a-swatch-bars { display: flex; height: 34px; border-radius: 6px; overflow: hidden; }
.a-swatch-bars span { flex: 1; }
.a-swatch-bars span:first-child { flex: 1.4; }
.a-swatch-name { display: flex; align-items: center; justify-content: space-between; gap: 6px;
    font-size: 13px; font-weight: 600; }
.a-swatch.active .a-swatch-name::after { content: "✓"; color: var(--a-primary); }



/* Los iconos son SVG en línea dentro del <i class="ti"> del tema; el panel no carga su hoja. */
i.ti { display: inline-flex; align-items: center; justify-content: center; font-style: normal; line-height: 1; }
i.ti > svg { width: 1em; height: 1em; display: block; }
.a-block-icon i.ti { font-size: 18px; }
.a-brand i.ti, .a-nav i.ti { font-size: 18px; }
.a-btn i.ti, .a-burger i.ti { font-size: 17px; }
.a-block-tools i.ti { font-size: 15px; }

body.admin-body {
  margin: 0;
  background: var(--a-bg);
  color: var(--a-text);
  font-family: var(--a-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--a-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--a-primary); outline-offset: 2px; }

/* ---- Estructura ---------------------------------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; }

.a-side {
  width: 260px;
  flex: none;
  background: var(--a-sidebar);
  color: #cfe0ee;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.a-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  color: #fff;
  font-weight: 650;
  font-size: 17px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.a-brand:hover { text-decoration: none; }
.a-brand small { display: block; font-weight: 400; font-size: 12px; color: #9dbcd6; }
.a-nav { padding: 14px 10px; flex: 1; }
.a-nav-group { margin-bottom: 18px; }
.a-nav-title {
  padding: 0 12px 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #87a8c4;
}
.a-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--a-radius-sm);
  color: #cfe0ee;
  font-size: 14.5px;
}
.a-nav a:hover { background: var(--a-sidebar-soft); color: #fff; text-decoration: none; }
.a-nav a.active { background: var(--a-primary); color: #fff; font-weight: 600; }
.a-nav svg { width: 18px; height: 18px; flex: none; }
.a-side-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.a-side-foot a { color: #9dbcd6; }

.a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.a-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 26px;
  background: var(--a-surface);
  border-bottom: 1px solid var(--a-border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.a-top h1 { font-size: 20px; margin: 0; }
.a-top .a-sub { color: var(--a-muted); font-size: 13.5px; }
.a-top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.a-content { padding: 26px; flex: 1; }
.a-content > h2:first-child { margin-top: 0; }

/* ---- Menú móvil ------------------------------------------------------------------------------ */
.a-burger { display: none; }
@media (max-width: 991.98px) {
  .admin-shell { flex-direction: column; }
  .a-side {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 60;
    box-shadow: 0 0 40px rgba(0, 0, 0, .3);
  }
  .a-side.open { transform: none; }
  .a-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius-sm);
    background: #fff;
    cursor: pointer;
  }
  .a-content { padding: 18px 14px; }
  .a-top { padding: 12px 14px; }
}

/* ---- Tarjetas y rejillas ---------------------------------------------------------------------- */
.a-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  box-shadow: var(--a-shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.a-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.a-card-head h2, .a-card-head h3 { margin: 0; }
.a-card-head .a-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.a-card-sub { color: var(--a-muted); font-size: 13.5px; margin: -8px 0 16px; }

.a-grid { display: grid; gap: 18px; }
.a-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.a-grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.a-grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.a-split { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.a-split-aside { grid-template-columns: 1fr 340px; }
.a-split-even { grid-template-columns: 1fr 1fr; }
/* Va al final a propósito: así gana a las variantes de arriba y todo se apila en pantallas estrechas. */
@media (max-width: 1199.98px) {
    .a-split,
    .a-split-aside,
    .a-split-even { grid-template-columns: 1fr; }
}

.a-stat { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 18px 20px; }
.a-stat .a-stat-label { color: var(--a-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.a-stat .a-stat-value { font-size: 30px; font-weight: 650; line-height: 1.2; }
.a-stat .a-stat-foot { font-size: 13px; color: var(--a-muted); }

/* ---- Botones ---------------------------------------------------------------------------------- */
.a-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--a-radius-sm);
  border: 1px solid var(--a-border);
  background: #fff;
  color: var(--a-text);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
}
.a-btn:hover { background: #f3f6f9; text-decoration: none; }
.a-btn:disabled { opacity: .55; cursor: not-allowed; }
.a-btn svg { width: 16px; height: 16px; }
.a-btn-primary { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.a-btn-primary:hover { background: var(--a-primary-dark); border-color: var(--a-primary-dark); color: #fff; }
.a-btn-danger { color: var(--a-danger); border-color: #edc9c4; background: #fdf4f3; }
.a-btn-danger:hover { background: #f9e4e1; }
.a-btn-ghost { border-color: transparent; background: transparent; }
.a-btn-ghost:hover { background: #eef2f6; }
.a-btn-sm { padding: 6px 11px; font-size: 13.5px; }
.a-btn-block { width: 100%; justify-content: center; }

/* ---- Formularios --------------------------------------------------------------------------------- */
.a-field { margin-bottom: 16px; }
.a-field > label, .a-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; color: var(--a-text); }
.a-field .a-help { display: block; font-size: 12.5px; color: var(--a-muted); margin-top: 5px; }
.a-input, .a-select, .a-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  background: #fff;
  font: inherit;
  font-size: 14.5px;
  color: var(--a-text);
}
.a-input:focus, .a-select:focus, .a-textarea:focus { border-color: var(--a-primary); outline: none; box-shadow: 0 0 0 3px rgba(27, 106, 163, .12); }
.a-textarea { min-height: 96px; resize: vertical; font-family: inherit; }
.a-textarea.a-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.a-check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; font-size: 14.5px; }
.a-check input { margin-top: 3px; }
.a-row { display: flex; gap: 12px; flex-wrap: wrap; }
.a-row > * { flex: 1 1 200px; }
.a-inline { display: flex; gap: 8px; align-items: center; }
.a-error { color: var(--a-danger); font-size: 13px; margin-top: 5px; }

/* ---- Tablas ------------------------------------------------------------------------------------- */
.a-table-wrap { overflow-x: auto; border-radius: var(--a-radius); border: 1px solid var(--a-border); background: #fff; }
.a-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.a-table th, .a-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--a-border); vertical-align: middle; }
.a-table th { background: #f7f9fb; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--a-muted); font-weight: 600; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tbody tr:hover { background: #f8fafc; }
.a-table .a-cell-actions { text-align: right; white-space: nowrap; }
.a-table td.a-cell-main { font-weight: 600; }
.a-table td.a-cell-main small { display: block; font-weight: 400; color: var(--a-muted); }

/* ---- Etiquetas de estado ----------------------------------------------------------------------- */
.a-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: #eef2f6;
  color: var(--a-muted);
  white-space: nowrap;
}
.a-badge-ok { background: #e7f4f0; color: var(--a-ok); }
.a-badge-warn { background: #fdf3e3; color: var(--a-warn); }
.a-badge-danger { background: #fdeceb; color: var(--a-danger); }
.a-badge-info { background: #e8f1f8; color: var(--a-primary); }

/* ---- Avisos --------------------------------------------------------------------------------------- */
.a-note { padding: 13px 16px; border-radius: var(--a-radius-sm); border-left: 3px solid var(--a-primary); background: #eef4f9; margin-bottom: 18px; }
.a-note-warn { border-left-color: var(--a-warn); background: #fdf6ea; }
.a-note-danger { border-left-color: var(--a-danger); background: #fdefed; }
.a-note-ok { border-left-color: var(--a-ok); background: #edf6f3; }
.a-note p:last-child { margin-bottom: 0; }
.a-empty { padding: 40px 20px; text-align: center; color: var(--a-muted); }

/* ---- Editor de páginas: lista, formulario y vista previa ---------------------------------------------- */
.a-editor {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.a-editor-list { position: sticky; top: 86px; }

/* El lienzo ocupa todo el ancho: en una columna estrecha el sitio se pinta como en un móvil. */
.a-editor-preview { grid-column: 1 / -1; }
@media (max-width: 1599.98px) {
  .a-editor { grid-template-columns: 300px minmax(0, 1fr); }
  .a-preview-frame { height: 620px; }
}
@media (max-width: 991.98px) {
  .a-editor { grid-template-columns: 1fr; }
  .a-editor-list { position: static; }
}

.a-preview-card { padding: 16px 18px; }
.a-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}
.a-select-sm { padding: 5px 9px; font-size: 13px; width: auto; }
.a-preview-frame {
  height: 620px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  background: #fff;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.a-preview-frame iframe {
  border: 0;
  height: 100%;
  max-width: 100%;
  background: #fff;
}

/* ---- Editor de bloques ------------------------------------------------------------------------------ */
.a-blocks { display: grid; gap: 10px; }
.a-blocks > * { min-width: 0; }
.a-block { min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  cursor: pointer;
}
.a-block:hover { border-color: var(--a-primary); }
.a-block.sel { border-color: var(--a-primary); box-shadow: 0 0 0 2px rgba(27, 106, 163, .15); }
.a-block.hidden-block { opacity: .55; }
.a-block-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
  background: #e8f1f8;
  color: var(--a-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.a-block-body { flex: 1; min-width: 0; }
.a-block-name { font-weight: 600; font-size: 14.5px; }
.a-block-sub { font-size: 12.5px; color: var(--a-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-block-tools { display: flex; gap: 3px; }
.a-block-tools button {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--a-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.a-block-tools button:hover { background: #eef2f6; color: var(--a-text); }

/* ---- Selector de bloques ---- */
.a-picker-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
  position: sticky;
  top: -22px;
  background: #fff;
  padding: 4px 0 12px;
  z-index: 2;
}
.a-picker-bar .a-input { max-width: 280px; }
.a-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--a-border);
  background: #fff;
  color: var(--a-muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.a-chip:hover { border-color: var(--a-primary); color: var(--a-primary); }
.a-chip.sel { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.a-picker-group {
  margin: 20px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--a-muted);
}
.a-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.a-pick {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.a-pick:hover {
  border-color: var(--a-primary);
  box-shadow: 0 6px 18px rgba(16, 36, 56, .1);
  transform: translateY(-2px);
}
.a-pick-thumb { display: block; border-bottom: 1px solid var(--a-border); background: #f6f8fb; }
.a-pick-thumb svg { display: block; width: 100%; height: auto; }
.a-pick-body { display: block; padding: 11px 14px 13px; }
.a-pick-body strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.a-pick-desc { display: block; font-size: 12.5px; color: var(--a-muted); line-height: 1.4; }
.a-pick-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--a-muted);
  font-size: 11.5px;
}

/* Miniatura pequeña, en la lista de bloques de la página */
.a-block-thumb {
  width: 52px;
  flex: none;
  border: 1px solid var(--a-border);
  border-radius: 5px;
  overflow: hidden;
  background: #f6f8fb;
}
.a-block-thumb svg { display: block; width: 100%; height: auto; }

.a-items { display: grid; gap: 12px; }
.a-item {
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  padding: 14px;
  background: #fbfcfd;
}
.a-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.a-item-head strong { font-size: 13.5px; color: var(--a-muted); }
.a-item-head .a-block-tools { margin-left: auto; }

/* ---- Pestañas ------------------------------------------------------------------------------------- */
.a-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--a-border); margin-bottom: 18px; flex-wrap: wrap; }
.a-tabs button {
  padding: 9px 16px;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: var(--a-muted);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
}
.a-tabs button.active { color: var(--a-primary); border-bottom-color: var(--a-primary); font-weight: 600; }

/* ---- Ventanas -------------------------------------------------------------------------------------
   La ventana nunca pasa del alto de la pantalla: la cabecera y el pie se quedan fijos y lo que se
   desplaza es el cuerpo. Mientras hay una ventana abierta, la página de detrás no se mueve. */
html.a-no-scroll, body.a-no-scroll { overflow: hidden; }

.a-modal-back {
  position: fixed;
  inset: 0;
  background: rgba(14, 34, 52, .5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  z-index: 80;
  overscroll-behavior: contain;
}
.a-modal {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--a-radius);
  width: 100%;
  max-width: 760px;
  max-height: 100%;
  min-height: 0;
  box-shadow: 0 24px 60px rgba(10, 30, 50, .3);
}
.a-modal-sm { max-width: 520px; }
.a-modal-lg { max-width: 1040px; }
.a-modal-xl { max-width: 1320px; }
.a-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--a-border);
  flex: none;
}
.a-modal-head h2 { margin: 0; font-size: 18px; }
.a-modal-head > button:last-child { margin-left: auto; }
.a-modal-body {
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}
.a-modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--a-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex: none;
  background: #fbfcfd;
  border-radius: 0 0 var(--a-radius) var(--a-radius);
}
@media (max-width: 575.98px) {
  .a-modal-back { padding: 0; }
  .a-modal { max-width: none; height: 100%; border-radius: 0; }
}

/* ---- Ayuda contextual ------------------------------------------------------------------------------ */
.a-help-btn {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--a-border);
  background: #fff;
  color: var(--a-muted);
  font: 600 13px/1 var(--a-font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 6px;
  padding: 0;
}
.a-help-btn:hover { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.a-help-body h4 { margin: 18px 0 6px; font-size: 15px; }
.a-help-body h4:first-child { margin-top: 0; }
.a-help-body p { margin: 0 0 10px; }
.a-help-body ul, .a-help-body ol { margin: 0 0 12px; padding-left: 20px; }
.a-help-body li { margin-bottom: 5px; }
.a-help-body code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  background: #eef2f6;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---- Biblioteca de medios -------------------------------------------------------------------------- */
.a-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.a-media {
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.a-media:hover { border-color: var(--a-primary); }
.a-media.sel { border-color: var(--a-primary); box-shadow: 0 0 0 2px rgba(27, 106, 163, .2); }
.a-media-thumb {
  aspect-ratio: 4 / 3;
  background: #eef2f6 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--a-muted);
}
.a-media-name { padding: 8px 10px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-media-missing-alt { color: var(--a-warn); font-size: 12px; padding: 0 10px 8px; }
.a-drop {
  border: 2px dashed var(--a-border);
  border-radius: var(--a-radius);
  padding: 26px;
  text-align: center;
  color: var(--a-muted);
  background: #fbfcfd;
  margin-bottom: 18px;
}

/* ---- Medidor de SEO ---------------------------------------------------------------------------------- */
.a-meter { height: 8px; border-radius: 999px; background: #e7edf3; overflow: hidden; margin: 6px 0 14px; }
.a-meter span { display: block; height: 100%; background: var(--a-ok); }
.a-meter.mid span { background: var(--a-warn); }
.a-meter.low span { background: var(--a-danger); }
.a-checks { display: grid; gap: 8px; }
.a-checkline { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.a-checkline .a-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 3px; background: #e2e8ee; }
.a-checkline.ok .a-dot { background: var(--a-ok); }
.a-checkline.no .a-dot { background: var(--a-warn); }
.a-checkline small { display: block; color: var(--a-muted); }

/* ---- Entrada al panel ----------------------------------------------------------------------------------- */
/* ── Integraciones y plantillas ──────────────────────────────────────────────────────── */

.a-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.a-int { margin: 0; }
.a-int-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.a-int-head h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; }
.a-int-head h3 i.ti { color: var(--a-primary); font-size: 17px; }

/* Lista de ficheros descargables. */
.a-files { display: grid; gap: 10px; }
.a-file { display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none;
    color: var(--a-text); border: 1px solid var(--a-border); border-radius: var(--a-radius-sm);
    background: var(--a-surface); transition: border-color .12s, box-shadow .12s, transform .12s; }
.a-file:hover { border-color: var(--a-primary); box-shadow: var(--a-shadow); transform: translateY(-1px); }
.a-file > i.ti { margin-left: auto; color: var(--a-primary); font-size: 18px; }
.a-file-ext { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 38px;
    border-radius: 8px; background: rgba(27, 106, 163, .09); color: var(--a-primary);
    font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.a-file-text { display: grid; gap: 2px; }
.a-file-text strong { font-weight: 600; font-size: 14.5px; }
.a-file-text small { color: var(--a-muted); font-size: 12.5px; }

.a-tree { margin: 0; padding: 14px; border-radius: var(--a-radius-sm); background: #0f2a3f; color: #d8e6f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7;
    white-space: pre; overflow-x: auto; }

/* ── Entrar en el panel ──────────────────────────────────────────────────────────────── */

.a-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 38%) 1fr; }

/* La franja de marca: marino con un punto de luz arriba y el filo dorado de Canarias. */
.a-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    padding: 48px 44px;
    color: #eaf2f8;
    background:
        radial-gradient(120% 90% at 12% 8%, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(160deg, var(--a-sidebar-soft) 0%, var(--a-sidebar) 55%, #0a2d48 100%);
    overflow: hidden;
}
.a-auth-brand::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: linear-gradient(90deg, var(--a-accent), #e3c75f 45%, var(--a-primary));
}

.a-auth-logo { display: inline-flex; align-items: center; justify-content: center; width: 104px; height: 104px;
    border-radius: 24px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(2px); text-decoration: none; }
.a-auth-logo img { max-width: 72px; max-height: 72px; object-fit: contain; }
.a-auth-logo-text { font-size: 24px; font-weight: 700; letter-spacing: .06em; color: #fff; }

.a-auth-name { margin: 26px 0 0; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.22; font-weight: 700;
    letter-spacing: -.01em; color: #fff; max-width: 20ch; }
.a-auth-brand-foot { position: absolute; left: 44px; right: 44px; bottom: 44px; }
.a-auth-claim { margin: 0 0 14px; font-size: 15px; color: rgba(234, 242, 248, .78); max-width: 34ch; }
.a-auth-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(234, 242, 248, .9);
    text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); }
.a-auth-back:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* El lado del formulario. */
.a-auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 48px 24px; background: var(--a-bg); }
.a-auth-card { width: 100%; max-width: 420px; background: var(--a-surface); border: 1px solid var(--a-border);
    border-radius: 18px; padding: 38px 34px 32px; box-shadow: 0 18px 50px rgba(14, 58, 92, .12); }

/* El logo pequeño de la tarjeta: solo se ve cuando la franja no está (móvil). */
.a-auth-mark { display: none; }
.a-auth-mark img { width: 64px; height: 64px; object-fit: contain; }

.a-auth-card h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.a-auth-sub { margin: 6px 0 26px; color: var(--a-muted); font-size: 14.5px; }
.a-auth-card .a-field { margin-bottom: 18px; }
.a-auth-card .a-input { height: 46px; font-size: 15px; }
.a-auth-card .a-check { margin: 4px 0 22px; }
.a-auth-help { margin: 22px 0 0; font-size: 13px; color: var(--a-muted); text-align: center; }
.a-auth-foot { margin: 0; font-size: 12.5px; color: var(--a-muted); }

.a-input-code { letter-spacing: .5em; text-align: center; font-size: 20px !important; }

.a-btn-lg { height: 46px; font-size: 15px; gap: 10px; }

@media (max-width: 899.98px) {
    .a-auth { grid-template-columns: 1fr; }
    .a-auth-brand { flex-direction: row; align-items: center; gap: 18px; padding: 20px 22px; }
    .a-auth-brand-foot { position: static; }
    .a-auth-brand-top { display: flex; align-items: center; gap: 16px; }
    .a-auth-logo { width: 60px; height: 60px; border-radius: 16px; }
    .a-auth-logo img { max-width: 40px; max-height: 40px; }
    .a-auth-name { margin: 0; font-size: 16px; max-width: none; }
    .a-auth-brand-foot { display: none; }
    .a-auth-main { padding: 28px 18px 40px; justify-content: flex-start; }
    .a-auth-card { padding: 28px 22px 26px; box-shadow: var(--a-shadow); }
}

@media (max-width: 575.98px) {
    .a-auth-brand { display: none; }
    .a-auth-main { justify-content: center; }
    .a-auth-mark { display: flex; justify-content: center; margin-bottom: 14px; }
    .a-auth-card { text-align: center; }
    .a-auth-card .a-field, .a-auth-card .a-check { text-align: left; }
}

/* ---- Varios ------------------------------------------------------------------------------------------ */
.a-muted { color: var(--a-muted); }
.a-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.a-right { text-align: right; }
.a-mb-0 { margin-bottom: 0; }
.a-sticky-side { position: sticky; top: 86px; }
.a-chip-list { display: flex; gap: 8px; flex-wrap: wrap; }
.a-color-row { display: flex; align-items: center; gap: 10px; }
.a-color-row input[type="color"] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--a-border); border-radius: 6px; background: #fff; }
.a-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  background: var(--a-text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--a-radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  font-size: 14.5px;
}

/* ---- Barra de Markdown del blog ---------------------------------------------------------------- */
.a-md-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--a-border);
  border-bottom: 0;
  border-radius: var(--a-radius-sm) var(--a-radius-sm) 0 0;
  background: #f7f9fb;
}
.a-md-bar + .a-textarea { border-radius: 0 0 var(--a-radius-sm) var(--a-radius-sm); }
.a-md-sep { width: 1px; height: 22px; background: var(--a-border); margin: 0 4px; }

/* ---- Editor de texto con formato (Telerik) ------------------------------------------------------ */
.a-editor-rte .k-editor { border-radius: var(--a-radius-sm); border-color: var(--a-border); }
.a-editor-rte .k-editor-content { font-family: var(--a-font); font-size: 15px; }

/* ---- Lista de bloques: las herramientas salen al pasar por encima, como en el lienzo ------------- */
.a-editor-list .a-block { gap: 10px; padding: 9px 10px; }
.a-editor-list .a-block-tools {
  opacity: 0;
  transition: opacity .12s ease;
}
.a-editor-list .a-block:hover .a-block-tools,
.a-editor-list .a-block.sel .a-block-tools { opacity: 1; }
.a-editor-list .a-block-name { font-size: 14px; line-height: 1.25; }
.a-editor-list .a-block-sub { font-size: 12px; }
.a-block-thumb { width: 46px; }
@media (min-width: 1600px) {
  .a-editor { grid-template-columns: 330px minmax(0, 1fr) minmax(0, 520px); }
}

/* ---- Ventanas de Telerik en el panel ------------------------------------------------------------ */
.a-win .k-window-content { padding: 22px; }

/* En el móvil, Telerik coloca sus ventanas con un ancho fijo y se salen de la pantalla:
   aquí se las ata al ancho que hay, y el contenido se desplaza dentro. */
@media (max-width: 767.98px) {
    .k-window {
        /* Telerik centra la ventana con un transform calculado para su ancho de escritorio. */
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        transform: none !important;
        left: 10px !important;
        top: 4vh !important;
        max-height: 92vh !important;
    }
    .a-win .k-window-content { padding: 16px; max-height: calc(92vh - 58px); overflow: auto; }
    .a-win-foot { flex-wrap: wrap; }
}
.a-win .k-window-titlebar {
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--a-border);
  font-weight: 650;
}
.a-win .k-window-title { font-size: 17px; color: var(--a-text); }
.a-win-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--a-border);
}

/* ---- Arrastrar y soltar --------------------------------------------------------------------------
   La fila que se arrastra se difumina; la de destino enseña una línea azul por el lado por el que
   entraría el elemento. El asa (⠿) marca por dónde se agarra. */
.a-grab {
  cursor: grab;
  color: var(--a-muted);
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 2px;
  border-radius: 4px;
  letter-spacing: -2px;
  font-size: 15px;
  line-height: 1;
  user-select: none;
}
.a-grab:hover { background: #eef2f6; color: var(--a-text); }
.a-grab:active { cursor: grabbing; }

.a-dragging { opacity: .4; }
.a-drop-above { box-shadow: inset 0 3px 0 0 var(--a-primary); }
.a-drop-below { box-shadow: inset 0 -3px 0 0 var(--a-primary); }
.a-item.a-drop-above, .a-item.a-drop-below { border-color: var(--a-primary); }

/* ---- Biblioteca de logos --------------------------------------------------------------------- */
.a-logos { display: grid; gap: 12px; }
.a-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  background: #fff;
}
.a-logo-vacio { border-style: dashed; background: #fbfcfd; }
.a-logo-img {
  width: 96px;
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--a-border);
  border-radius: 6px;
  background: #fff center/contain no-repeat;
  color: var(--a-muted);
  overflow: hidden;
}
.a-logo-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.a-logo-dark { background: var(--a-sidebar); border-color: var(--a-sidebar); }
.a-logo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.a-logo-body strong { font-size: 15px; }
.a-logo-body .a-badge { align-self: flex-start; }
.a-logo-desc { font-size: 13px; color: var(--a-muted); }
.a-logo-note { font-size: 12.5px; color: var(--a-warn); }
.a-logo-tools { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
@media (max-width: 767.98px) {
  .a-logo { flex-wrap: wrap; }
  .a-logo-tools { width: 100%; }
}

/* ---- Acerca del panel ---------------------------------------------------------------------- */
.a-about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.a-about { display: flex; gap: 13px; align-items: flex-start; }
.a-about-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  background: #e8f1f8;
  color: var(--a-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.a-about strong { display: block; font-size: 14.5px; margin-bottom: 2px; }
.a-about p { margin: 0 0 6px; font-size: 13.5px; color: var(--a-muted); line-height: 1.5; }
.a-about a { font-size: 13px; }

.a-about-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-about-table th { text-align: left; padding: 7px 0; color: var(--a-muted); font-weight: 500; width: 40%; }
.a-about-table td { text-align: right; padding: 7px 0; }
.a-about-table tr + tr th, .a-about-table tr + tr td { border-top: 1px solid var(--a-border); }

.a-doclist { margin: 0; padding-left: 18px; }
.a-doclist li { margin-bottom: 6px; font-size: 14px; }

.a-credits { border-top: 3px solid var(--a-primary); }
.a-credits-name { font-size: 19px; font-weight: 650; margin: 0 0 6px; }
.a-credits-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.a-credits-list li { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.a-credits-list i.ti { font-size: 17px; color: var(--a-primary); }

/* ---- Barra superior y menú de usuario ------------------------------------------------------- */
.a-brand-logo { width: 30px; height: 30px; border-radius: 6px; object-fit: contain; background: #fff; padding: 2px; }
.a-top-site h1 { font-size: 18px; }
.a-side-foot { display: grid; gap: 8px; }
.a-side-foot a { display: flex; align-items: center; gap: 8px; }
.a-side-foot i.ti { font-size: 15px; }

.a-user { position: relative; }
.a-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--a-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: var(--a-text);
}
.a-user-btn:hover { background: #f3f6f9; }
.a-user.open .a-user-btn { border-color: var(--a-primary); }
.a-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--a-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.a-avatar img { width: 100%; height: 100%; object-fit: cover; }
.a-user-text { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.a-user-text strong { font-size: 13.5px; }
.a-user-text small { font-size: 11.5px; color: var(--a-muted); }
.a-user-caret { font-size: 15px; color: var(--a-muted); }
.a-user.open .a-user-caret { transform: rotate(180deg); }

.a-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  box-shadow: 0 18px 44px rgba(16, 36, 56, .18);
  padding: 6px;
  z-index: 40;
}
.a-user-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--a-border); margin-bottom: 6px; }
.a-user-head strong { display: block; font-size: 14px; }
.a-user-head small { color: var(--a-muted); font-size: 12.5px; }
.a-user-menu a,
.a-user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--a-radius-sm);
  background: transparent;
  color: var(--a-text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.a-user-menu a:hover, .a-user-menu button:hover { background: #eef2f6; text-decoration: none; }
.a-user-menu i.ti { font-size: 16px; color: var(--a-muted); }
.a-user-menu form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--a-border); }
@media (max-width: 767.98px) {
  .a-user-text { display: none; }
  .a-top-site .a-sub { display: none; }
}

/* ---- Perfil y dos pasos ---------------------------------------------------------------------- */
.a-steps { margin: 0 0 14px; padding-left: 18px; font-size: 14px; }
.a-steps li { margin-bottom: 6px; }
.a-qr {
  display: flex;
  justify-content: center;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  margin-bottom: 12px;
}
.a-key {
  background: #eef2f6;
  padding: 10px 12px;
  border-radius: var(--a-radius-sm);
  letter-spacing: .08em;
  text-align: center;
  margin-bottom: 14px;
}
.a-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.a-codes span {
  padding: 9px 12px;
  background: #eef2f6;
  border-radius: var(--a-radius-sm);
  text-align: center;
  letter-spacing: .06em;
}

/* ---- Menús del armazón: casilla oculta + CSS, porque el layout no es interactivo -------------- */
.a-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.a-backdrop { display: none; }
.a-toggle:checked ~ .a-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 39;
  background: transparent;
  cursor: default;
}
.a-toggle:checked ~ .a-backdrop-nav { background: rgba(14, 34, 52, .35); z-index: 55; }

/* Menú de usuario */
.a-user-menu { display: none; }
.a-user .a-toggle:checked ~ .a-user-menu { display: block; }
.a-user .a-toggle:checked ~ .a-user-btn { border-color: var(--a-primary); }
.a-user .a-toggle:checked ~ .a-user-btn .a-user-caret { transform: rotate(180deg); }
.a-user-btn { user-select: none; }
.a-toggle:focus-visible ~ .a-user-btn { outline: 2px solid var(--a-primary); outline-offset: 2px; }

/* Menú lateral en móvil */
@media (max-width: 991.98px) {
  .a-toggle:checked ~ .a-side { transform: none; }
  .a-burger { user-select: none; }
}
@media (min-width: 992px) {
  .a-toggle:checked ~ .a-backdrop-nav { display: none; }
}

/* Quién mantiene el panel, al final del menú lateral. */
.a-made { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: 11.5px; color: rgba(255, 255, 255, .5); }
.a-made a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.a-made a:hover { color: #fff; text-decoration: underline; }
