/* ==========================================================================
   EduTrack — Módulo «Anuncios y tareas» (SIS). Ver docs/ANUNCIOS.md.
   Solo lo propio del módulo: .tab-nav, .tab-btn, .btn-sm, .modal-overlay,
   .form-card, .modal-foot, .empty y .field-hint vienen de app.css y consejeria.css.
   ========================================================================== */

/* ── Cabecera ────────────────────────────────────────────────────── */
.an-head      { display: flex; align-items: flex-start; justify-content: space-between;
                gap: 24px; padding: 4px 0 16px; }
.an-title     { font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.an-sub       { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 62ch;
                line-height: 1.5; }

/* ── Lista ───────────────────────────────────────────────────────── */
.an-list      { display: flex; flex-direction: column; gap: 14px; }

.an-card      { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 14px;
                background: #fff; }
/* El borrador se distingue de un vistazo: es lo único que exige una acción. */
.an-card--borrador  { border-style: dashed; background: #fcfcfc; }
.an-card--archivado { opacity: .62; }

.an-card-top  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }

.an-chip      { display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
                border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
                white-space: nowrap; }
/* Los cuatro colores son los de anuncio_tipos.color, no una decisión del front. */
.an-chip--navy   { background: #e8ecf5; color: #2c3e66; }
.an-chip--sky    { background: #e4f0f8; color: #1f5878; }
.an-chip--green  { background: #e6f2e9; color: #276141; }
.an-chip--purple { background: #eee9f6; color: #4e3a79; }
.an-chip--dest   { background: var(--chip); color: var(--ink-3); }
.an-chip--draft  { background: #fdf3e2; color: #8a5a11; }
.an-chip--arch   { background: #efefef; color: var(--muted); }

.an-fecha     { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.an-card-title { font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.2px; }
.an-card-body  { font-size: 14px; color: var(--ink-3); line-height: 1.55; margin-top: 5px;
                 white-space: pre-wrap;
                 display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
                 overflow: hidden; }

.an-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px;
                margin-top: 12px; flex-wrap: wrap; }
.an-meta      { font-size: 12px; color: var(--muted); }
.an-acciones  { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Adjuntos y enlaces ──────────────────────────────────────────── */
.an-adj       { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }

/* En la tarjeta: pastillas que se abren. */
.an-adj-it    { display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
                height: 32px; padding: 0 11px 0 8px; border: 1px solid var(--line);
                border-radius: 9px; background: #fff; cursor: pointer;
                font-family: var(--sans); font-size: 13px; color: var(--ink); }
.an-adj-it:hover { border-color: #bbb; background: var(--row-hover); }
.an-adj-ic    { flex: none; width: 18px; height: 18px; display: inline-flex; }
.an-adj-ic svg { width: 100%; height: 100%; display: block; }
.an-adj-nm    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26ch; }
.an-adj-sz    { flex: none; font-size: 11.5px; color: var(--muted); }

/* En el formulario: filas con el nombre editable. */
.an-adj--edit { flex-direction: column; gap: 7px; }
.an-adj-row   { display: flex; align-items: center; gap: 9px; width: 100%; }
.an-adj-nom   { flex: 1; min-width: 0; height: 34px; font-size: 13.5px; }
.an-adj-x     { flex: none; width: 28px; height: 28px; border: none; border-radius: 7px;
                background: transparent; color: var(--muted); font-size: 20px; line-height: 1;
                cursor: pointer; }
.an-adj-x:hover { background: #fde8e8; color: #a81c1c; }
.an-adj-add   { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Panel para pegar un enlace ──────────────────────────────────── */
/* En el flujo, como el de grupos. El formulario ya es un .modal-overlay; apilarle otro encima es
   lo que rompió el selector de grupos, y no hay razón para repetirlo. */
.an-enl      { margin-top: 10px; padding: 12px; border: 1px solid var(--line);
               border-radius: 10px; background: #fcfcfd; }
.an-enl-lab  { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted);
               margin: 0 0 5px; }
.an-enl .an-inp + .an-enl-lab { margin-top: 10px; }
.an-enl-pie  { display: flex; align-items: center; justify-content: space-between; gap: 12px;
               margin-top: 12px; flex-wrap: wrap; }
.an-enl-pie .field-hint { margin: 0; }

/* ── Contador de enterados ───────────────────────────────────────── */
.an-conteo    { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.an-barra     { height: 5px; border-radius: 999px; background: #eee; overflow: hidden; }
.an-barra span { display: block; height: 100%; background: var(--brand); border-radius: 999px;
                 transition: width .3s ease; }
.an-conteo-txt  { font-size: 13px; color: var(--ink-3); margin-top: 7px; }
/* Esta nota NO es decorativa: es la respuesta escrita a «mándale un recordatorio a los que
   faltan», que el diseño prohíbe a propósito. No quitarla. */
.an-conteo-nota { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* ── Formulario ──────────────────────────────────────────────────── */
.an-form      { max-width: 620px; max-height: 88vh; overflow-y: auto; }
.an-lab       { display: block; font-size: 12px; font-weight: 600; color: var(--muted);
                letter-spacing: .3px; text-transform: uppercase; margin: 18px 0 7px; }
.an-opt       { font-weight: 400; text-transform: none; letter-spacing: 0; }
.an-aviso     { margin: -2px 0 8px; }

.an-tipos     { display: flex; gap: 8px; flex-wrap: wrap; }
.an-dest      { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.an-tipo      { height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
                background: #fff; font-family: var(--sans); font-size: 13px; font-weight: 500;
                color: var(--ink-3); cursor: pointer; }
.an-tipo:hover:not(:disabled) { border-color: #bbb; }
.an-tipo.sel  { background: var(--brand); border-color: var(--brand); color: #fff; }
.an-tipo:disabled { opacity: .5; cursor: default; }

.an-sel, .an-inp { height: 38px; border: 1px solid var(--line); border-radius: 8px;
                   padding: 0 11px; font-family: var(--sans); font-size: 14px; color: var(--ink);
                   background: #fff; }
.an-sel:focus, .an-inp:focus { outline: none; border-color: #999; }
.an-sel:disabled { background: #f6f6f6; color: var(--muted); }
.an-inp       { width: 100%; }

/* ── Panel de grupos, con casillas ───────────────────────────────── */
/* EN EL FLUJO, no flotando. Estaba en `position: absolute` y daba dos problemas: `.an-form`
   tiene `overflow-y: auto`, que por especificación también recorta en el eje X, así que el
   modal CORTABA el panel; y al ir encima con z-index tapaba Título y Mensaje sin más forma de
   cerrarlo que el propio botón. Ahora empuja el contenido hacia abajo y el modal hace scroll
   solo: no tapa nada y no hay nada que cerrar para poder seguir. */
.an-drop-btn  { display: flex; align-items: center; justify-content: space-between; gap: 8px;
                min-width: 190px; cursor: pointer; text-align: left; }
.an-drop-btn svg { width: 16px; height: 16px; flex: none; color: var(--muted);
                   transition: transform 160ms ease; }
.an-drop-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.an-drop-btn:disabled { background: #f6f6f6; color: var(--muted); cursor: default; }

.an-drop-menu { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px;
                background: #fcfcfd; overflow: hidden; }
.an-drop-grid { max-height: 232px; overflow-y: auto; padding: 8px;
                display: grid; grid-template-columns: repeat(4, minmax(58px, 1fr)); gap: 2px; }
.an-drop-it   { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 7px;
                font-size: 13.5px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.an-drop-it:hover { background: #fff; }
.an-drop-it input { width: 15px; height: 15px; flex: none; accent-color: var(--brand);
                    cursor: pointer; margin: 0; }
.an-drop-pie  { display: flex; align-items: center; justify-content: space-between; gap: 12px;
                padding: 8px 10px; border-top: 1px solid var(--line-soft); background: #fff;
                font-size: 12.5px; color: var(--muted); }

.an-sel--wide { width: 100%; }
.an-inp--date { width: auto; min-width: 160px; }
.an-ta        { height: auto; min-height: 110px; padding: 10px 11px; line-height: 1.55;
                resize: vertical; }
.an-fila      { display: flex; gap: 10px; flex-wrap: wrap; }

.an-foot      { align-items: center; justify-content: space-between; }
.an-alcance   { font-size: 13px; color: var(--muted); }
.an-alcance strong { color: var(--ink); }

/* ── Móvil ───────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .an-head     { flex-direction: column; gap: 12px; }
  .an-fecha    { margin-left: 0; width: 100%; }
  .an-card-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .an-form     { max-width: none; }
  .an-foot     { flex-direction: column; align-items: stretch; gap: 12px; }
}
