/*
  Módulos que vieram do PDF ASTUR MAKER: pedidos, envíos, facturas,
  inventario, tareas, publicaciones, ajustes e as ferramentas de design.

  Tudo por tokens --am-*: o tema escuro vem de graça. Os tons de estado
  (neutral, info, primary, success, warning, danger) são os mesmos em todos
  os módulos — "Enviado" e "Programada" têm a mesma cor porque significam o
  mesmo tipo de coisa: saiu das mãos da oficina.
*/

:root {
  --am-info: #0891b2;
  --am-info-soft: #ecfeff;
  --am-neutral: #475569;
  --am-neutral-soft: #f1f5f9;
}

[data-am-theme="dark"] {
  --am-info: #22d3ee;
  --am-info-soft: rgba(34, 211, 238, 0.14);
  --am-neutral: #cbd5e1;
  --am-neutral-soft: rgba(148, 163, 184, 0.14);
}

/* ── mensagem de resultado ─────────────────────────────────────────── */

.am-flash {
  display: flex;
  align-items: center;
  gap: var(--am-space-3);
  margin: 0 0 var(--am-space-5);
  padding: var(--am-space-3) var(--am-space-4);
  border-radius: var(--am-radius);
  border: 1px solid transparent;
  font-weight: 500;
}

.am-flash--success { background: var(--am-success-soft); color: var(--am-success); border-color: var(--am-success-soft); }
.am-flash--danger  { background: var(--am-danger-soft);  color: var(--am-danger);  border-color: var(--am-danger-soft); }

/* ── estado ────────────────────────────────────────────────────────── */

.am-estado {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.6;
}

.am-estado::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: currentColor;
}

.am-estado--neutral { background: var(--am-neutral-soft); color: var(--am-neutral); }
.am-estado--info    { background: var(--am-info-soft);    color: var(--am-info); }
.am-estado--primary { background: var(--am-primary-soft); color: var(--am-primary); }
.am-estado--success { background: var(--am-success-soft); color: var(--am-success); }
.am-estado--warning { background: var(--am-warning-soft); color: var(--am-warning); }
.am-estado--danger  { background: var(--am-danger-soft);  color: var(--am-danger); }

/* ── cabeçalho de módulo: título já vem do page-top; aqui as ações ──── */

.am-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--am-space-3);
  margin-bottom: var(--am-space-5);
}

.am-toolbar__spacer { flex: 1 1 auto; }

.am-toolbar form.am-search {
  display: flex;
  gap: var(--am-space-2);
  min-width: 220px;
}

/* ── indicadores ───────────────────────────────────────────────────── */

.am-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--am-space-4);
  margin-bottom: var(--am-space-5);
}

.am-kpi {
  display: block;
  padding: var(--am-space-4);
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  color: var(--am-text);
  text-decoration: none;
  transition: border-color var(--am-transition), box-shadow var(--am-transition);
}

a.am-kpi:hover { border-color: var(--am-primary); box-shadow: var(--am-shadow); color: var(--am-text); }

.am-kpi__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--am-text-muted);
}

.am-kpi__value {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.am-kpi--alerta .am-kpi__value { color: var(--am-danger); }

/* ── chips de filtro com contagem (os botões do PDF "AMAZON 25") ────── */

.am-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--am-space-2);
  margin-bottom: var(--am-space-4);
}

.am-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--am-space-2);
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--am-border);
  border-radius: 999px;
  background: var(--am-surface);
  color: var(--am-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--am-transition), color var(--am-transition), background var(--am-transition);
}

.am-chip:hover { border-color: var(--am-primary); color: var(--am-text); }
.am-chip.is-active { background: var(--am-primary); border-color: var(--am-primary); color: #fff; }

.am-chip__n {
  min-width: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--am-surface-hover);
  color: var(--am-text);
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
}

.am-chip.is-active .am-chip__n { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* ── tabelas simples (sem DataTables) ──────────────────────────────── */

.am-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.am-tabla th {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--am-border);
  background: var(--am-surface-hover);
  color: var(--am-text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.am-tabla td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--am-border);
  color: var(--am-text);
  vertical-align: middle;
}

.am-tabla tbody tr:hover td { background: var(--am-surface-hover); }
.am-tabla tbody tr:last-child td { border-bottom: 0; }
.am-tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.am-tabla .acc { text-align: right; white-space: nowrap; }
.am-tabla a.am-fila-link { color: var(--am-text); font-weight: 600; text-decoration: none; }
.am-tabla a.am-fila-link:hover { color: var(--am-primary); }
.am-tabla .sub { display: block; color: var(--am-text-muted); font-size: 0.75rem; }
.am-tabla tr.is-alerta td:first-child { box-shadow: inset 3px 0 0 var(--am-danger); }

.am-tabla-wrap {
  overflow-x: auto;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  background: var(--am-surface);
}

.am-vacio {
  padding: var(--am-space-8) var(--am-space-4);
  color: var(--am-text-muted);
  text-align: center;
}

.am-vacio i { display: block; margin-bottom: var(--am-space-3); font-size: 1.75rem; opacity: 0.5; }

/* ── formulários ───────────────────────────────────────────────────── */

.am-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--am-space-4);
}

.am-form-grid .am-span-2 { grid-column: span 2; }
.am-form-grid .am-span-all { grid-column: 1 / -1; }

@media (max-width: 575px) {
  .am-form-grid .am-span-2 { grid-column: 1 / -1; }
}

/* relative: as sugestões de cliente abrem por baixo do campo (data-am-cliente). */
.am-field { position: relative; display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.am-field > label { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--am-text); }
.am-field .am-hint { font-size: 0.75rem; color: var(--am-text-muted); }
.am-req { color: var(--am-danger); }

.am-form-section + .am-form-section {
  margin-top: var(--am-space-6);
  padding-top: var(--am-space-6);
  border-top: 1px solid var(--am-border);
}

.am-form-section__title {
  margin: 0 0 var(--am-space-4);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--am-text);
}

.am-form-error {
  margin-bottom: var(--am-space-4);
  padding: var(--am-space-3) var(--am-space-4);
  border-radius: var(--am-radius-sm);
  background: var(--am-danger-soft);
  color: var(--am-danger);
  font-weight: 500;
}

.am-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--am-space-2);
  margin-top: var(--am-space-6);
}

/* Linhas editáveis (itens do pedido, linhas da factura) */
.am-lineas td { padding: 0.375rem; }
.am-lineas input, .am-lineas select { min-width: 0; }
.am-lineas .col-cant { width: 90px; }
.am-lineas .col-precio { width: 110px; }
.am-lineas .col-total { width: 110px; }
.am-lineas .col-quitar { width: 44px; }
.am-lineas .col-sku { width: 190px; }
.am-lineas .col-prod { width: 200px; }

.am-sugerencias {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 2px;
  background: var(--am-surface);
  border: 1px solid var(--am-border-strong);
  border-radius: var(--am-radius-sm);
  box-shadow: var(--am-shadow-lg);
}

.am-sugerencias button {
  display: flex;
  align-items: center;
  gap: var(--am-space-2);
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--am-text);
  font-size: 0.8125rem;
  text-align: left;
}

.am-sugerencias button:hover, .am-sugerencias button:focus { background: var(--am-surface-hover); outline: none; }
.am-sugerencias img { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; background: #fff; }

.am-totales {
  margin-left: auto;
  width: min(320px, 100%);
  font-variant-numeric: tabular-nums;
}

.am-totales div { display: flex; justify-content: space-between; padding: 0.25rem 0; }
.am-totales .is-total { margin-top: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--am-border); font-size: 1.125rem; font-weight: 700; }

/* ── ficha de detalhe ──────────────────────────────────────────────── */

.am-detalle {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: var(--am-space-5);
}

@media (max-width: 991px) {
  .am-detalle { grid-template-columns: 1fr; }
}

.am-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; margin: 0; font-size: 0.875rem; }
.am-dl dt { color: var(--am-text-muted); font-weight: 500; }
.am-dl dd { margin: 0; color: var(--am-text); }

.am-pasos { display: flex; flex-wrap: wrap; gap: var(--am-space-2); }

.am-linea-foto { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--am-border); }

/* ── tareas (tela 8.1) ─────────────────────────────────────────────── */

.am-grupo { margin-bottom: var(--am-space-5); }

.am-grupo__titulo {
  display: flex;
  align-items: center;
  gap: var(--am-space-2);
  margin: 0 0 var(--am-space-2);
  color: var(--am-primary);
  font-size: 0.9375rem;
  font-weight: 700;
}

.am-grupo--vencidas .am-grupo__titulo { color: var(--am-danger); }
.am-grupo--listas .am-grupo__titulo { color: var(--am-success); }

/* O <select> de estado pinta-se da cor do estado, como as células do PDF. */
.am-estado-select {
  min-width: 128px;
  padding: 0.25rem 1.75rem 0.25rem 0.625rem;
  border: 0;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.am-estado-select--pendiente { background-color: #94a3b8; }
.am-estado-select--en_curso  { background-color: #f59e0b; }
.am-estado-select--listo     { background-color: #10b981; }
.am-estado-select--detenido  { background-color: #ef4444; }
.am-estado-select option { color: var(--am-text); background: var(--am-surface); }

.am-resumen-bar {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--am-surface-hover);
}

.am-resumen-bar span { display: block; height: 100%; }

.am-prio-alta { color: var(--am-danger); font-weight: 700; }

/* ── envíos (tela 19.19) ───────────────────────────────────────────── */

.am-envios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--am-space-4);
}

.am-envio {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm);
  background: var(--am-bg);
  font-size: 0.8125rem;
}

.am-envio + .am-envio { margin-top: var(--am-space-2); }
.am-envio a { color: var(--am-text); font-weight: 600; text-decoration: none; }
.am-envio a:hover { color: var(--am-primary); }
.am-envio__meta { color: var(--am-text-muted); }

.am-subtitulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--am-space-3) 0 var(--am-space-2);
  color: var(--am-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── calendario (tela 12.12) ───────────────────────────────────────── */

.am-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  overflow: hidden;
  background: var(--am-border);
  gap: 1px;
}

.am-cal__dow {
  padding: 0.5rem;
  background: var(--am-surface-hover);
  color: var(--am-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.am-cal__day {
  position: relative;
  min-height: 108px;
  padding: 0.375rem;
  background: var(--am-surface);
}

.am-cal__day.is-otro { background: var(--am-bg); }
.am-cal__day.is-otro .am-cal__num { color: var(--am-text-subtle); }

.am-cal__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.625rem;
  height: 1.625rem;
  border-radius: 999px;
  color: var(--am-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.am-cal__day.is-hoy .am-cal__num { background: var(--am-primary); color: #fff; }

.am-cal__add {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  color: var(--am-text-subtle);
  line-height: 1.5rem;
  text-align: center;
  opacity: 0;
  transition: opacity var(--am-transition);
}

.am-cal__day:hover .am-cal__add, .am-cal__add:focus { opacity: 1; }
.am-cal__add:hover { background: var(--am-surface-hover); color: var(--am-primary); }

.am-cal__pub {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  padding: 0.125rem 0.375rem;
  border-left: 3px solid var(--am-red, var(--am-primary));
  border-radius: 4px;
  background: var(--am-surface-hover);
  color: var(--am-text);
  font-size: 0.6875rem;
  line-height: 1.4;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.am-cal__pub:hover { color: var(--am-primary); }
.am-cal__pub.is-publicada { opacity: 0.55; text-decoration: line-through; }

.am-red--instagram { --am-red: #e1306c; }
.am-red--facebook  { --am-red: #1877f2; }
.am-red--tiktok    { --am-red: #111827; }
.am-red--twitter   { --am-red: #1d9bf0; }
.am-red--youtube   { --am-red: #ff0000; }
[data-am-theme="dark"] .am-red--tiktok { --am-red: #e2e8f0; }

.am-red-icon { color: var(--am-red); }

@media (max-width: 767px) {
  .am-cal__day { min-height: 64px; }
  .am-cal__pub span { display: none; }
}

/* ── ferramentas de design ─────────────────────────────────────────── */

.am-tool {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--am-space-5);
  align-items: start;
}

@media (max-width: 991px) {
  .am-tool { grid-template-columns: 1fr; }
}

.am-tool__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--am-space-4);
}

.am-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  /* tabuleiro de xadrez: mostra a transparência do PNG */
  background:
    conic-gradient(var(--am-surface-hover) 25%, var(--am-surface) 0 50%, var(--am-surface-hover) 0 75%, var(--am-surface) 0)
    0 0 / 24px 24px;
  overflow: hidden;
}

.am-stage img, .am-stage canvas { max-width: 100%; max-height: 520px; }

.am-stage__nav {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 1px solid var(--am-border);
  border-radius: 50%;
  background: var(--am-surface);
  color: var(--am-text);
  box-shadow: var(--am-shadow);
}

.am-stage__nav:hover { color: var(--am-primary); border-color: var(--am-primary); }
.am-stage__nav--prev { left: var(--am-space-3); }
.am-stage__nav--next { right: var(--am-space-3); }

.am-stage__loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--am-surface) 70%, transparent);
  color: var(--am-text-muted);
}

.am-stage.is-loading .am-stage__loading { display: flex; }

.am-productos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--am-space-2);
}

.am-producto-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--am-border);
  border-radius: 999px;
  background: var(--am-surface);
  color: var(--am-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.am-producto-btn.is-active { background: var(--am-primary); border-color: var(--am-primary); color: #fff; }

.am-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--am-space-2);
  max-height: 300px;
  overflow-y: auto;
}

.am-thumb {
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--am-surface-hover);
  cursor: pointer;
}

.am-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.am-thumb.is-active { border-color: var(--am-primary); }

.am-swatches { display: flex; flex-wrap: wrap; gap: 6px; }

.am-swatch {
  width: 28px;
  height: 28px;
  border: 2px solid var(--am-border);
  border-radius: 50%;
  cursor: pointer;
}

.am-swatch.is-active { border-color: var(--am-primary); box-shadow: 0 0 0 2px var(--am-surface), 0 0 0 4px var(--am-primary); }

.am-formas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--am-space-3);
  width: 100%;
}

.am-forma {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--am-space-2);
  padding: var(--am-space-3);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  background:
    conic-gradient(var(--am-surface-hover) 25%, var(--am-surface) 0 50%, var(--am-surface-hover) 0 75%, var(--am-surface) 0)
    0 0 / 16px 16px;
}

.am-forma canvas { width: 100%; height: auto; }
.am-forma__pie { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 0.8125rem; font-weight: 600; color: var(--am-text); }

.am-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--am-space-2);
  padding: var(--am-space-5);
  border: 2px dashed var(--am-border-strong);
  border-radius: var(--am-radius);
  color: var(--am-text-muted);
  text-align: center;
  cursor: pointer;
}

.am-drop.is-over, .am-drop:hover { border-color: var(--am-primary); color: var(--am-primary); }

.am-crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
}

.am-crop-box::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
  cursor: nwse-resize;
}

/* ── impressão ─────────────────────────────────────────────────────── */

@media print {
  #sidebar, #page-header, #page-footer, .am-no-print, .am-nav-progress, .am-flash { display: none !important; }
  #page-container.am-app #main-container { padding: 0 !important; margin: 0 !important; }
  .am-panel { border: 0 !important; box-shadow: none !important; }
}

/* ── painéis dos módulos ───────────────────────────────────────────── */

/* Um painel a seguir ao outro respira; o .am-panel base não traz margem. */
.am-modulo .am-panel + .am-panel,
.am-modulo .am-panel + .am-detalle,
.am-modulo .am-detalle + .am-panel { margin-top: var(--am-space-5); }

.am-panel__header--acciones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--am-space-3);
}

/* O .am-panel base tem overflow:hidden (cantos redondos); a lista de
   sugestões do SKU tem de poder sair por baixo do painel. */
.am-panel.am-panel--abierto { overflow: visible; }

/* ── documento de factura (tela e impressão) ───────────────────────────
   A página de impressão só carrega este CSS, sem os tokens: por isso cada
   var() leva o valor claro de reserva. */

.am-doc { color: var(--am-text, #0f172a); font-size: 0.875rem; line-height: 1.5; }
.am-doc__head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--am-text, #0f172a); }
.am-doc__empresa { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.am-doc__muted { color: var(--am-text-muted, #64748b); font-size: 0.8125rem; }
.am-doc__titulo { text-align: right; }
.am-doc__rot { color: var(--am-text-muted, #64748b); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.am-doc__rot.mt { margin-top: 12px; }
.am-doc__num { font-size: 1.25rem; font-weight: 800; }
.am-doc__cliente { margin: 20px 0; }
.am-doc__tabla { width: 100%; border-collapse: collapse; }
.am-doc__tabla th { padding: 8px; border-bottom: 1px solid var(--am-border-strong, #cbd5e1); color: var(--am-text-muted, #64748b); font-size: 0.6875rem; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
.am-doc__tabla td { padding: 8px; border-bottom: 1px solid var(--am-border, #e2e8f0); }
.am-doc__tabla .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.am-doc__pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; margin-top: 20px; }
.am-doc__pago { flex: 1 1 260px; }
.am-doc__totales { width: min(280px, 100%); font-variant-numeric: tabular-nums; }
.am-doc__totales div { display: flex; justify-content: space-between; padding: 3px 0; }
.am-doc__totales .is-total { margin-top: 6px; padding-top: 8px; border-top: 2px solid var(--am-text, #0f172a); font-size: 1.125rem; font-weight: 800; }

/* Botões com a mesma altura na barra de ações: o .btn-primary global
   (astur-components.css) tem padding maior, e um <form> com um botão
   ficava mais alto do que um <a class="btn"> ao lado. */
.am-modulo .btn:not(.btn-sm) {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: var(--am-radius-sm);
}

.am-modulo .btn-primary:hover:not(:disabled) { transform: none; }

/* Duas colunas de alturas diferentes: cada painel com a sua altura. */
.am-detalle { align-items: start; }

/* ── compras (tela 19.19, "China compras") ─────────────────────────── */

.am-envio--compra { border-left: 3px solid var(--am-info); }

/* ── horarios (tela 15.15) ─────────────────────────────────────────── */

.am-semana { font-size: 0.9375rem; color: var(--am-text); white-space: nowrap; }

.am-horario th.is-hoy, .am-horario td.is-hoy { background: var(--am-primary-soft); }
.am-horario th { text-align: center; }
.am-horario th:first-child { text-align: left; }

.am-horario__dia {
  position: relative;
  min-width: 96px;
  height: 64px;
  padding: 0.375rem !important;
  vertical-align: top !important;
  text-align: center;
}

.am-turno {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
  padding: 0.125rem 0.25rem 0.125rem 0.5rem;
  border-radius: 6px;
  background: var(--am-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.am-turno form { display: contents; }

.am-turno__x {
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.6875rem;
  line-height: 1;
}

.am-turno__x:hover, .am-turno__x:focus-visible { background: rgba(255, 255, 255, 0.2); color: #fff; }

.am-horario__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  color: var(--am-text-subtle);
  font-size: 0.75rem;
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--am-transition);
}

.am-horario__dia:hover .am-horario__add, .am-horario__add:focus-visible { opacity: 1; }
.am-horario__add:hover { background: var(--am-surface-hover); color: var(--am-primary); }

@media (hover: none) {
  .am-horario__add { opacity: 1; }
}

.am-fichar { display: flex; flex-direction: column; gap: var(--am-space-2); }

.am-fichar__fila {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--am-space-3);
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--am-border);
}

.am-fichar__fila:last-child { border-bottom: 0; }
.am-fichar__nombre { font-weight: 600; color: var(--am-text); }

.am-lista-simple { margin: 0; padding-left: 1.125rem; font-size: 0.875rem; color: var(--am-text); }
.am-lista-simple li + li { margin-top: 0.25rem; }

.am-legend { margin: 0 0 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--am-text); float: none; }

.am-dias { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.am-dia {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  border: 1px solid var(--am-border);
  border-radius: 999px;
  color: var(--am-text);
  font-size: 0.8125rem;
  cursor: pointer;
  user-select: none;
}

.am-dia:has(input:checked) { border-color: var(--am-primary); background: var(--am-primary-soft); color: var(--am-primary); font-weight: 600; }
.am-dia input { accent-color: var(--am-primary); }

/* ── experimentos (tela 14.14) ─────────────────────────────────────── */

.am-tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--am-space-4);
}

.am-tarjeta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  background: var(--am-surface);
}

.am-tarjeta__img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background:
    conic-gradient(var(--am-surface-hover) 25%, var(--am-surface) 0 50%, var(--am-surface-hover) 0 75%, var(--am-surface) 0)
    0 0 / 18px 18px;
  color: var(--am-text-subtle);
  font-size: 2rem;
}

.am-tarjeta__img a { display: block; width: 100%; height: 100%; }
.am-tarjeta__img img { width: 100%; height: 100%; object-fit: contain; }

.am-tarjeta__body { display: flex; flex: 1; flex-direction: column; gap: 0.25rem; padding: var(--am-space-3) var(--am-space-4); }
.am-tarjeta__tipo { color: var(--am-primary); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.am-tarjeta__titulo { margin: 0; color: var(--am-text); font-size: 0.9375rem; font-weight: 700; }

.am-tarjeta__desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--am-text-muted);
  font-size: 0.8125rem;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.am-tarjeta__meta { margin-top: auto; padding-top: 0.25rem; color: var(--am-text-subtle); font-size: 0.75rem; }

.am-tarjeta__pie {
  display: flex;
  align-items: center;
  gap: var(--am-space-2);
  padding: var(--am-space-2) var(--am-space-3);
  border-top: 1px solid var(--am-border);
}

.am-tarjeta__pie form:first-child { flex: 1; min-width: 0; }

.am-muestra-actual { max-width: 100%; max-height: 160px; object-fit: contain; border: 1px solid var(--am-border); border-radius: var(--am-radius-sm); background: #fff; }

/* ── mensajes (telas 7.1 e 20.20) ──────────────────────────────────── */

.am-mensaje + .am-mensaje { margin-top: var(--am-space-4); }
.am-mensaje__asunto { margin: 0 0 var(--am-space-2); color: var(--am-text); font-weight: 600; }
.am-mensaje__asunto span { color: var(--am-text-muted); font-weight: 500; }

.am-mensaje__cuerpo {
  margin: 0;
  padding: var(--am-space-3);
  max-height: 260px;
  overflow: auto;
  border-radius: var(--am-radius-sm);
  background: var(--am-surface-hover);
  color: var(--am-text);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.am-aviso {
  margin: var(--am-space-2) 0 0;
  padding: 0.375rem 0.625rem;
  border-radius: var(--am-radius-sm);
  background: var(--am-warning-soft);
  color: var(--am-warning);
  font-size: 0.8125rem;
  font-weight: 500;
}

.am-marcadores summary { color: var(--am-primary); font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.am-marcadores ul { margin: var(--am-space-2) 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--am-text-muted); }
.am-marcadores li + li { margin-top: 0.25rem; }

.am-marcador {
  padding: 0 0.375rem;
  border: 1px solid var(--am-border);
  border-radius: 4px;
  background: var(--am-surface-hover);
  color: var(--am-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}

.am-marcador:hover { border-color: var(--am-primary); color: var(--am-primary); }

/* ── formación (tela 21.21) ────────────────────────────────────────── */

.am-cursos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--am-space-4);
}

.am-curso {
  display: flex;
  flex-direction: column;
  gap: var(--am-space-2);
  padding: var(--am-space-4);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  background: var(--am-surface);
}

.am-curso__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--am-primary-soft);
  color: var(--am-primary);
  font-size: 1.25rem;
  font-weight: 800;
}

.am-curso__titulo { margin: 0; color: var(--am-text); font-size: 1rem; font-weight: 700; }
.am-curso__desc { margin: 0; color: var(--am-text-muted); font-size: 0.8125rem; }
.am-curso__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: var(--am-space-2); margin-top: auto; padding-top: var(--am-space-2); }
.am-curso__spacer { flex: 1; }

/* ── copia de seguridad (tela 18.18) ───────────────────────────────── */

.am-disco {
  height: 8px;
  margin: 0.5rem 0 0.25rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--am-surface-hover);
}

.am-disco span { display: block; height: 100%; border-radius: inherit; background: var(--am-primary); }
.am-kpi--alerta .am-disco span { background: var(--am-danger); }
.am-disco--fino { height: 5px; margin-bottom: 0; }

.am-carpeta { font-size: 0.875rem; color: var(--am-text); }
.am-carpeta + .am-carpeta { margin-top: var(--am-space-3); }
.am-carpeta__dl { color: var(--am-text-subtle); }
.am-carpeta__dl:hover { color: var(--am-primary); }

/* Texto de ajuda também fora de .am-field (rodapés de painel, KPIs). */
.am-modulo .am-hint { font-size: 0.75rem; color: var(--am-text-muted); }
.am-kpi .am-hint { display: block; }

/* Dois painéis lado a lado na grelha de detalhe: sem o espaço de "painel a
   seguir a painel", que só faz sentido empilhado. */
.am-modulo .am-detalle > .am-panel + .am-panel { margin-top: 0; }
@media (max-width: 991px) {
  .am-modulo .am-detalle > .am-panel + .am-panel { margin-top: var(--am-space-5); }
}

.am-horario td:first-child { min-width: 150px; }

/* ── vectorizar (tela 4.1) ─────────────────────────────────────────── */

.am-vec-comparar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--am-space-4);
  width: 100%;
}

@media (max-width: 767px) {
  .am-vec-comparar { grid-template-columns: 1fr; }
}

.am-vec-panel { margin: 0; }
.am-vec-panel figcaption { margin-bottom: var(--am-space-2); color: var(--am-text); font-size: 0.8125rem; font-weight: 600; }
.am-stage--vec { min-height: 300px; aspect-ratio: 1; }
.am-stage--vec img { max-width: 92%; max-height: 92%; }

.am-paleta { display: flex; flex-wrap: wrap; gap: var(--am-space-2); }

.am-color {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  border: 1px solid var(--am-border);
  border-radius: 999px;
  color: var(--am-text);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.am-color__muestra {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
}

.am-color__hex { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.am-color__pct { color: var(--am-text-muted); }

.am-notas { padding-left: 1.125rem; color: var(--am-text-muted); font-size: 0.8125rem; }
.am-notas:empty { display: none; }

/* Ficha técnica: invisível no ecrã, só ela na impressão. */
.am-ficha { display: none; }

@media print {
  html.am-print-ficha body * { visibility: hidden; }
  html.am-print-ficha .am-ficha, html.am-print-ficha .am-ficha * { visibility: visible; }
  html.am-print-ficha .am-ficha {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12mm;
    color: #0f172a;
    background: #fff;
    font-size: 11pt;
  }
  .am-ficha__rot { margin: 0; color: #64748b; font-size: 8pt; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
  .am-ficha h1 { margin: 2mm 0 6mm; font-size: 18pt; }
  .am-ficha__cuerpo { display: flex; gap: 10mm; align-items: flex-start; margin-bottom: 8mm; }
  .am-ficha__cuerpo img { flex-shrink: 0; max-width: 90mm; border: 0.3mm dashed #94a3b8; }
  .am-ficha__datos { display: grid; grid-template-columns: max-content 1fr; gap: 2mm 6mm; margin: 0; }
  .am-ficha__datos dt { color: #64748b; }
  .am-ficha__datos dd { margin: 0; font-weight: 600; }
  .am-ficha__colores { border-collapse: collapse; margin-bottom: 6mm; }
  .am-ficha__colores th, .am-ficha__colores td { padding: 1.5mm 4mm; border-bottom: 0.3mm solid #e2e8f0; text-align: left; }
}

/* ── editor de publicaciones (telas 2.2, 7.1) ─────────────────────── */

.am-editor {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 290px;
  gap: var(--am-space-4);
  align-items: start;
}

@media (max-width: 1399px) {
  .am-editor { grid-template-columns: 250px minmax(0, 1fr); }
  .am-editor > .am-editor__lado:last-child { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  .am-editor { grid-template-columns: 1fr; }
  .am-editor > .am-editor__lado:last-child { grid-template-columns: 1fr; }
  .am-editor__centro { order: -1; }
}

.am-editor__centro { display: flex; flex-direction: column; gap: var(--am-space-3); min-width: 0; position: sticky; top: calc(var(--am-topbar-h, 64px) + 12px); }

.am-editor__barra { display: flex; flex-wrap: wrap; gap: var(--am-space-2); align-items: center; }
.am-editor__barra input[data-am-titulo] { flex: 1 1 180px; min-width: 0; }

.am-editor__lienzo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--am-space-4);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  background:
    conic-gradient(var(--am-surface-hover) 25%, var(--am-surface) 0 50%, var(--am-surface-hover) 0 75%, var(--am-surface) 0)
    0 0 / 24px 24px;
  min-height: 320px;
}

.am-editor__lienzo canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 260px);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.2);
  touch-action: none;
  outline: none;
}

.am-editor__lienzo canvas:focus-visible { box-shadow: 0 0 0 3px var(--am-primary); }

.am-editor__botones { display: flex; flex-wrap: wrap; gap: var(--am-space-2); }

.am-capas { margin: 0; padding: 0; list-style: none; max-height: 260px; overflow-y: auto; }

.am-capa {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--am-radius-sm);
}

.am-capa.is-active { background: var(--am-primary-soft); }

.am-capa button {
  padding: 0.3125rem 0.375rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--am-text-muted);
  font-size: 0.75rem;
}

.am-capa button:hover { background: var(--am-surface-hover); color: var(--am-text); }

.am-capa .am-capa__nombre {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--am-text);
  font-size: 0.8125rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.am-capa.is-active .am-capa__nombre { color: var(--am-primary); font-weight: 600; }

.am-guardados { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--am-space-2); }

.am-guardado {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--am-text-muted);
  font-size: 0.6875rem;
  text-decoration: none;
}

.am-guardado img { width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--am-border); border-radius: 6px; background: var(--am-surface-hover); }
.am-guardado span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-guardado:hover { color: var(--am-primary); }

/* Banners: a forma do formato, à escala, na primeira coluna. */
.am-proporcion {
  flex-shrink: 0;
  display: inline-block;
  border: 2px solid var(--am-primary);
  border-radius: 3px;
  background: var(--am-primary-soft);
}

/* Caixas de seleção nos painéis com a mesma letra dos rótulos à volta. */
.am-modulo .form-check { font-size: 0.875rem; }

/* ── mockup libre (tela 13.13) ─────────────────────────────────────── */

.am-formas--grandes { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.am-mockup-libre { padding: var(--am-space-2); background: var(--am-surface); }
.am-mockup-libre canvas { border-radius: 8px; }
.am-mockup-libre__grupo { color: var(--am-text-muted); font-weight: 500; }

/* ── biblioteca general (tela 22.22) ───────────────────────────────── */

.am-bib-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--am-space-3);
  margin-bottom: var(--am-space-5);
}

.am-bib-cat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--am-space-3);
  align-items: center;
  padding: var(--am-space-3) var(--am-space-4);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  background: var(--am-surface);
  color: var(--am-text);
  text-decoration: none;
  transition: border-color var(--am-transition), box-shadow var(--am-transition);
}

.am-bib-cat i { grid-row: 1 / 3; color: var(--am-primary); font-size: 1.25rem; }
.am-bib-cat__nombre { font-size: 0.8125rem; font-weight: 600; }
.am-bib-cat__n { color: var(--am-text-muted); font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.am-bib-cat:hover { border-color: var(--am-primary); box-shadow: var(--am-shadow); color: var(--am-text); }
.am-bib-cat.is-active { border-color: var(--am-primary); background: var(--am-primary-soft); }

.am-tarjeta__img video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* ── creador de vídeos (tela 4.1) ──────────────────────────────────── */

[data-am-video] .am-editor__lienzo canvas { max-height: 60vh; }

.am-progreso { width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: var(--am-surface-hover); }
.am-progreso span { display: block; width: 0; height: 100%; background: var(--am-primary); transition: width 0.1s linear; }

.am-diapos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--am-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: diapo;
}

.am-diapo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--am-space-2);
  padding: var(--am-space-2);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm);
  background: var(--am-surface);
  counter-increment: diapo;
}

.am-diapo::before {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 1.375rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--am-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  content: counter(diapo);
}

.am-diapo img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: var(--am-surface-hover); }
.am-diapo__acc { display: flex; justify-content: space-between; }
.am-diapo__acc button { padding: 0.25rem 0.5rem; border: 0; border-radius: 6px; background: transparent; color: var(--am-text-muted); }
.am-diapo__acc button:hover { background: var(--am-surface-hover); color: var(--am-text); }

/* ── Tareas: buscar · ordenar · ocultar, comentarios ─────────────── */
.am-tareas-barra { margin-top: var(--am-space-3); }
.am-tareas-barra .am-search { min-width: 220px; }
.am-columnas { position: relative; }
.am-columnas > summary { list-style: none; }
.am-columnas > summary::-webkit-details-marker { display: none; }
.am-columnas__menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
  display: flex; flex-direction: column; gap: .35rem;
  min-width: 160px; padding: .6rem .8rem;
  background: var(--am-surface, #fff); border: 1px solid var(--am-border, #e2e8f0);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}
.am-columnas__menu label { display: flex; align-items: center; gap: .5rem; margin: 0; cursor: pointer; font-size: .875rem; }
.am-coment-btn { white-space: nowrap; }
.am-comentario {
  padding: .6rem .8rem; border-radius: 8px;
  background: var(--am-surface-hover); border: 1px solid var(--am-border, #e2e8f0);
}
.am-comentario__cab { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; font-size: .8125rem; }
.am-comentario p { white-space: pre-wrap; }

/* Vista previa: "Guardar como" em grelha de 2 (JPG PNG / SVG PDF). */
.am-guardar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

/* ── Chat del equipo (PDF 16.16) ─────────────────────────────────── */
.am-chat {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--am-space-4, 1rem);
  height: calc(100vh - 220px); min-height: 460px;
}
.am-chat > .am-panel { display: flex; flex-direction: column; min-height: 0; }
.am-chat__buscar { position: relative; padding: .75rem; border-bottom: 1px solid var(--am-border); }
.am-chat__buscar i { position: absolute; left: 1.4rem; top: 50%; transform: translateY(-50%); color: var(--am-text-muted); font-size: .8rem; }
.am-chat__buscar input { padding-left: 2rem; }
.am-chat__lista { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; flex: 1; }
.am-chat__canal {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem; border-radius: var(--am-radius-sm, 8px);
  color: var(--am-text); text-decoration: none;
}
.am-chat__canal:hover { background: var(--am-surface-hover); color: var(--am-text); }
.am-chat__canal.is-active { background: var(--am-primary-soft); }
.am-chat__canal-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.am-chat__canal-txt strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-chat__canal-txt small { font-size: .75rem; }
.am-chat__avatar {
  position: relative; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: #1e3a8a; color: #fff; font-weight: 700;
}
.am-chat__avatar--general { background: var(--am-primary); }
.am-chat__punto {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: #94a3b8; border: 2px solid var(--am-surface);
}
.am-chat__punto.is-online { background: #10b981; }
.am-chat__badge {
  margin-left: auto; min-width: 1.35rem; padding: 0 .4rem; border-radius: 999px;
  background: var(--am-primary); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.35rem; text-align: center;
}
.am-chat__cab { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--am-border); }
.am-chat__titulo { margin: 0; font-size: 1rem; font-weight: 700; }
.am-chat__conexion { margin-left: auto; font-size: .75rem; color: var(--am-text-muted); white-space: nowrap; }
.am-chat__conexion i { font-size: .5rem; vertical-align: middle; color: #94a3b8; }
.am-chat__conexion.is-on i { color: #10b981; }
.am-chat__mensajes { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .45rem; }
.am-chat__vacio { margin: auto; color: var(--am-text-muted); }
.am-chat__dia { text-align: center; margin: .5rem 0; }
.am-chat__dia span { font-size: .72rem; color: var(--am-text-muted); background: var(--am-surface-hover); padding: .15rem .6rem; border-radius: 999px; }
.am-chat__msg {
  align-self: flex-start; max-width: min(72%, 560px); padding: .45rem .75rem .35rem;
  border-radius: 14px 14px 14px 4px; background: var(--am-surface-hover);
}
.am-chat__msg.is-mio { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--am-primary); color: #fff; }
.am-chat__msg p { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
.am-chat__autor { display: block; font-size: .75rem; color: var(--am-primary); }
.am-chat__msg time { display: block; text-align: right; font-size: .68rem; opacity: .7; margin-top: .1rem; }
.am-chat__escribiendo { min-height: 1.2rem; margin: 0; padding: 0 1rem; font-size: .75rem; color: var(--am-text-muted); font-style: italic; }
.am-chat__form { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem; border-top: 1px solid var(--am-border); }
.am-chat__form textarea { resize: none; min-height: 42px; max-height: 160px; }
.am-chat__form .btn { height: 42px; width: 46px; flex-shrink: 0; }

@media (max-width: 767.98px) {
  .am-chat { grid-template-columns: 1fr; grid-template-rows: auto minmax(420px, 1fr); height: auto; }
  .am-chat__lista { max-height: 180px; }
  .am-chat__msg { max-width: 88%; }
}

/* ── Mockup libre: fotos de producto da equipa ───────────────────── */
.am-fotos { display: flex; flex-direction: column; gap: var(--am-space-3, .75rem); margin-bottom: var(--am-space-4, 1rem); }
.am-fotos__cab { display: flex; align-items: center; gap: .75rem; }
.am-fotos__titulo { margin: 0; font-size: 1rem; font-weight: 700; }
.am-fotos__cab .btn { margin-left: auto; }
.am-mockup-foto.is-error canvas { min-height: 120px; background: var(--am-surface-hover); }
.am-foto-lienzo { position: relative; align-self: center; max-width: 100%; line-height: 0; touch-action: none; user-select: none; }
.am-foto-lienzo canvas { max-width: 100%; max-height: 70vh; width: auto; height: auto; border-radius: 8px; }
.am-foto-asa {
  position: absolute; width: 24px; height: 24px; padding: 0; margin: 0;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--am-primary); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(15, 23, 42, .45);
  cursor: grab; touch-action: none;
}
.am-foto-asa:active { cursor: grabbing; }
.am-foto-asa:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.am-tool__stage > .am-fotos, .am-tool__stage > .am-fotos__titulo { align-self: stretch; text-align: left; }

/* ── Formas: versões de cor do design (PDF 6.1) ──────────────────── */
.am-versiones { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.am-version {
  display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .35rem;
  border: 2px solid var(--am-border); border-radius: 10px; background: var(--am-surface); color: var(--am-text);
  font-size: .7rem; line-height: 1.15; cursor: pointer;
}
.am-version canvas { width: 100%; height: 56px; object-fit: contain; }
.am-version:hover { border-color: var(--am-border-strong, #cbd5e1); }
.am-version.is-active { border-color: var(--am-primary); background: var(--am-primary-soft); }
.am-paleta-dis { display: flex; flex-wrap: wrap; gap: .45rem; }
.am-paleta-dis__color { position: relative; width: 36px; height: 36px; margin: 0; cursor: pointer; }
.am-paleta-dis__color input {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 2px solid var(--am-border);
  border-radius: 50%; cursor: pointer; background: none;
}
.am-paleta-dis__color input::-webkit-color-swatch-wrapper { padding: 0; }
.am-paleta-dis__color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.am-paleta-dis__color input::-moz-color-swatch { border: 0; border-radius: 50%; }
/* A cor original, num quarto do círculo, para se ver o que foi trocado. */
.am-paleta-dis__muestra {
  position: absolute; right: -3px; bottom: -3px; z-index: 1; width: 14px; height: 14px;
  border-radius: 50%; border: 2px solid var(--am-surface); pointer-events: none;
}

/* ── Editor de vídeo (PDF 4.1) ───────────────────────────────────── */
[data-am-edvid] .am-editor__lienzo canvas { max-height: 60vh; }
.am-edvid-bib { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; max-height: 220px; overflow-y: auto; }
.am-edvid-corte {
  display: flex; flex-direction: column; gap: .5rem; padding: .75rem;
  border: 1px solid var(--am-border); border-radius: 12px; background: var(--am-surface);
}
.am-edvid-barra { position: relative; }
.am-edvid-barra__sel {
  position: absolute; top: 50%; height: 14px; transform: translateY(-50%);
  background: var(--am-primary-soft); border: 2px solid var(--am-primary); border-radius: 6px; pointer-events: none;
}
.am-edvid-barra .form-range { position: relative; }
.am-edvid-clips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.am-edvid-clip {
  display: flex; flex-direction: column; border: 2px solid var(--am-border); border-radius: 12px;
  background: var(--am-surface); overflow: hidden;
}
.am-edvid-clip.is-active { border-color: var(--am-primary); }
.am-edvid-clip__sel { display: flex; flex-direction: column; padding: 0; border: 0; background: none; color: var(--am-text); text-align: left; cursor: pointer; }
.am-edvid-clip__sel img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0f172a; }
.am-edvid-clip__txt { display: flex; flex-direction: column; padding: .4rem .6rem 0; min-width: 0; }
.am-edvid-clip__txt strong { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-edvid-clip__txt small { color: var(--am-text-muted); font-size: .75rem; }
.am-edvid-clip__acc { display: flex; gap: .25rem; justify-content: flex-end; padding: .35rem .5rem .5rem; }
.am-edvid-clip__acc button {
  width: 30px; height: 28px; border: 1px solid var(--am-border); border-radius: 6px;
  background: var(--am-surface); color: var(--am-text-muted);
}
.am-edvid-clip__acc button:hover { color: var(--am-text); background: var(--am-surface-hover); }

/* ── Vista 3D ────────────────────────────────────────────────────── */
.am-3d-escena {
  position: relative; width: 100%; height: min(70vh, 640px); min-height: 360px;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--am-border); background: var(--am-surface-hover);
}
.am-3d-escena canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.am-3d-escena canvas:active { cursor: grabbing; }
.am-3d-aviso { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 1rem; text-align: center; color: var(--am-text-muted); }

/* Chat: videochamada Jitsi por cima das mensagens. */
.am-chat__video { border-bottom: 1px solid var(--am-border); background: var(--am-surface); }
.am-chat__video-barra { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; }
.am-chat__video-marco { height: min(46vh, 420px); background: #0f172a; }
.am-chat__video-nota { margin: 0; padding: .35rem .75rem; font-size: .72rem; line-height: 1.3; color: var(--am-text-muted); }
/* Em chamada, a conversa cresce para as mensagens continuarem à vista por baixo do vídeo. */
.am-chat.is-video { height: auto; }
.am-chat.is-video .am-chat__conversacion { min-height: calc(100vh - 160px); }
.am-chat.is-video .am-chat__mensajes { min-height: 220px; }
.am-chat__video-marco iframe { width: 100%; height: 100%; border: 0; display: block; }
.am-chat__msg a { overflow-wrap: anywhere; text-decoration: underline; }
.am-chat__msg.is-mio a { color: #fff; }

/* Datos del evento en Auditoría: no deben empujar la tabla a lo ancho. */
.am-audit-datos {
  display: inline-block;
  max-width: 34rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-size: 0.75rem;
  color: var(--am-text-muted);
}


/* ── Selección múltiple y acciones en lote (UX-008) ──────────────────── */
.am-col-sel { width: 36px; text-align: center; }
.am-col-sel input { width: 16px; height: 16px; accent-color: var(--am-primary, #2563eb); }

.am-barra-sel {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--am-space-3);
  margin-bottom: var(--am-space-3);
  padding: .6rem .9rem;
  border: 1px solid var(--am-border-strong, var(--am-border));
  border-radius: 8px;
  background: var(--am-surface-hover);
}
.am-barra-sel__n { font-size: .875rem; color: var(--am-text); }
.am-barra-sel__acciones { display: flex; flex-wrap: wrap; gap: var(--am-space-2); }
.am-barra-sel > [data-am-sel-limpiar] { margin-left: auto; }
