/* =================================================================================================
   dossiers.css - las pantallas del modulo de expedientes de AsuntosPropios
   Modulo Dossiers · .NET 10.00

   Solo lo que Framework1000 no cubre: la composicion de pagina, el panel, el filtro de dos
   posiciones, las opciones de visibilidad, el dialogo modal y el editor a dos columnas. Todo el
   color sale de las variables --dm-* de dameti.css, que el interior sobrescribe con la tinta azul
   en mainmodule.css.
   ================================================================================================= */

/* --- Pagina ----------------------------------------------------------------------------- */

.page { display: flex; flex-direction: column; gap: var(--dm-space-5); }

.page__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--dm-space-4);
}

.page__heading { display: flex; flex-direction: column; gap: var(--dm-space-1); min-width: 0; }
.page__heading--row { flex-direction: row; align-items: center; gap: var(--dm-space-3); }

/* A la escala del titulo del panel (2026-09-11): con la estrecha del tema, 22px a 600 quedaba
   como un rotulo y no como el titulo de la pantalla. */
.page__title { margin: 0; font-size: 28px; line-height: 34px; font-weight: 800; }
.page__subtitle { margin: 0; font-size: 16px; font-weight: 600; }
.page__back { display: inline-flex; color: var(--dm-text-muted); }
.page__back:hover { color: var(--dm-primary); }

.page__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dm-space-4);
    flex-wrap: wrap;
}

.page__filters { display: flex; align-items: center; gap: var(--dm-space-3); flex: 1 1 auto; flex-wrap: wrap; }
.page__buttons { display: flex; gap: var(--dm-space-3); }
.page__column { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 640px; }
.page__column .card { margin-bottom: 0; }
.page__foot { margin: 0; font-size: var(--dm-text-sm); color: var(--dm-text-muted); }

.page .btn svg { flex: 0 0 auto; }
.small { font-size: var(--dm-text-sm); }
.btn--danger-text { color: var(--dm-danger); }

/* --- Busqueda y filtro ------------------------------------------------------------------ */

.search {
    display: flex;
    align-items: center;
    gap: var(--dm-space-2);
    padding: 0 var(--dm-space-3);
    background: var(--dm-surface);
    border: 1px solid var(--dm-border-strong);
    border-radius: var(--dm-radius-sm);
    color: var(--dm-text-muted);
    flex: 0 1 320px;
}

.search__input {
    flex: 1 1 auto;
    padding: 8px 0;
    font: inherit;
    color: var(--dm-text);
    background: transparent;
    border: none;
    outline: none;
}

.toggle {
    display: flex;
    background: var(--dm-surface);
    border: 1px solid var(--dm-border-strong);
    border-radius: var(--dm-radius-sm);
    overflow: hidden;
}

.toggle__opt {
    padding: 7px 16px;
    font: inherit;
    color: var(--dm-text-soft);
    background: transparent;
    border: none;
    border-left: 1px solid var(--dm-border);
    cursor: pointer;
}

.toggle__opt:first-child { border-left: none; }
.toggle__opt--on { font-weight: 600; color: var(--dm-primary); background: var(--dm-primary-light); }

/* =================================================================================================
   Panel del usuario (2026-09-11)

   Copiado de mockups/propuestas/Panel.html, aprobada: mismas clases y misma estructura. Todo bajo
   .pnl porque la maqueta usa nombres cortos -.row, .rows, .head, .count, .t, .m- y sin raiz
   chocarian con las hojas de otras pantallas.

   Sustituye a las cuatro tarjetas de cifra con icono tenido y a las dos tarjetas gemelas de antes
   (.stats, .stat, .dash, .item), que eran plantilla de panel SaaS y no llevaban a leer nada.

   Los colores de la maqueta son los tokens del tema del interior y se leen por su variable: tinta
   = --dm-primary, tinta honda = --dm-primary-dark, banda = --dm-primary-light, banda suave =
   --dm-surface-alt, impresora = --dm-text, las dos rayas de tinta = --dm-border y
   --dm-border-strong. La estrecha llega de mainmodule.css (--app-font-condensed); si el modulo se
   monta en un host que no la declara, cae en la misma familia escrita aqui.
   ================================================================================================= */

.pnl {
    --pnl-form: var(--app-font-condensed, "Sofia Sans Condensed", "Arial Narrow", "Segoe UI", sans-serif);
    --pnl-ease: cubic-bezier(.16, 1, .3, 1);
    max-width: 1156px;
    font: 400 15px/24px var(--dm-font);
    color: var(--dm-text);
}

.pnl h1,
.pnl h2,
.pnl p,
.pnl ul { margin: 0; padding: 0; }

.pnl ul { list-style: none; }

.pnl .lbl { font: 700 11px/16px var(--pnl-form); letter-spacing: .1em; text-transform: uppercase; color: var(--dm-primary); }
.pnl .data { font: 400 13px/20px var(--dm-font-mono); font-variant-numeric: tabular-nums; }
.pnl svg.i { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- Cabeza: saludo, resumen accionable y la accion principal --------------------------- */

.pnl .head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.pnl .h1 { font: 800 34px/40px var(--pnl-form); letter-spacing: -.015em; color: var(--dm-primary); text-wrap: balance; }
.pnl .summary { margin-top: 6px; font-size: 16px; line-height: 24px; max-width: 66ch; text-wrap: pretty; }
.pnl .summary a { color: var(--dm-primary); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pnl .summary a:hover { text-decoration-thickness: 2px; }

/* El boton es el del framework (btn btn--primary), que con el tema ya pinta la tinta y la tinta
   honda al pasar: aqui solo la medida de la maqueta. */
.pnl .btn { height: 44px; gap: 10px; padding: 0 18px; font: 700 16px/24px var(--pnl-form); letter-spacing: .01em; text-decoration: none; transition: background-color .2s var(--pnl-ease); }

/* --- Totales: una linea de listado, no cuatro tarjetas ---------------------------------- */

.pnl .counts { margin-top: 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); box-shadow: inset 0 1px 0 var(--dm-primary), inset 0 -1px 0 var(--dm-border-strong); }
.pnl .count { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 18px 14px; color: inherit; text-decoration: none; }
.pnl .count + .count { box-shadow: inset 1px 0 0 var(--dm-border); }
.pnl .count .n { font: 700 30px/36px var(--pnl-form); font-variant-numeric: tabular-nums; color: var(--dm-text); }
.pnl .count .lbl { display: flex; align-items: center; gap: 4px; }
.pnl a.count { transition: background-color .15s var(--pnl-ease); }
.pnl a.count:hover { background: var(--dm-surface-alt); }
.pnl a.count:hover .lbl span { text-decoration: underline; text-underline-offset: 3px; }
.pnl .count .go { width: 12px; height: 12px; stroke-width: 2.4; }

/* «Documentos aportados» no lleva a ningun sitio (D40): sin flecha, sin fondo al pasar y la cifra
   en tinta, para que no parezca un enlace roto al lado de tres que si lo son. */
.pnl .count--static .n { color: var(--dm-primary); }

/* --- Listas ----------------------------------------------------------------------------- */

.pnl .cols { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: start; }
.pnl .sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 8px; box-shadow: inset 0 -1px 0 var(--dm-primary); }
.pnl .h2 { font: 700 19px/24px var(--pnl-form); color: var(--dm-text); }
.pnl .more { color: var(--dm-primary); font: 600 14px/24px var(--pnl-form); text-decoration: none; }
.pnl .more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Caja, borde, sombra, raya inferior y hueco de fila se anulan a proposito: signup.css traia el
   2026-09-11 un .rows y un .row sueltos, de caja con borde, que se colaban aqui. */
.pnl .rows { background: none; border: 0; box-shadow: none; }
.pnl .rows li { position: relative; }
.pnl .rows li:nth-child(even) { background: var(--dm-surface-alt); }
.pnl .rows li:hover { background: var(--dm-primary-light); }
.pnl .row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 0 14px; padding: 12px; border-bottom: 0; }
.pnl .row > svg { color: var(--dm-primary); }
.pnl .t { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 15px/24px var(--dm-font); color: var(--dm-text); text-decoration: none; }

/* El titulo cubre la fila entera con su ::after: toda la fila es el enlace sin anidar un enlace
   dentro de otro. «Seguir la narrativa» queda por encima con su z-index. */
.pnl .t::after { content: ""; position: absolute; inset: 0; }
.pnl .m { display: block; font-size: 13px; line-height: 20px; color: var(--dm-primary); }
.pnl .vis { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/20px var(--pnl-form); color: var(--dm-primary); white-space: nowrap; }
.pnl .vis svg { width: 15px; height: 15px; }
.pnl .vis--own { color: var(--dm-text); }
.pnl .when { white-space: nowrap; color: var(--dm-text); }

/* --- El ultimo asunto tocado, en grande: se retoma desde aqui ---------------------------- */

.pnl .row--lead { grid-template-columns: 20px minmax(0, 1fr) auto; padding: 16px 12px; }
.pnl .row--lead .t { font: 700 22px/28px var(--pnl-form); letter-spacing: -.005em; white-space: normal; }
.pnl .row--lead .m { margin-top: 2px; }
.pnl .resume { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--dm-primary); font: 700 15px/24px var(--pnl-form); text-decoration: none; box-shadow: inset 0 -1px 0 var(--dm-border-strong); }
.pnl .resume:hover { box-shadow: inset 0 -2px 0 var(--dm-primary); }
.pnl .resume svg { width: 15px; height: 15px; }
.pnl .rows li:first-child.is-lead { background: var(--dm-surface-alt); box-shadow: inset 0 -1px 0 var(--dm-border); }
.pnl .rows li:first-child.is-lead:hover { background: var(--dm-primary-light); }

/* --- Vacio: el primer acceso tras el alta ------------------------------------------------
   En la maqueta el vacio se escondia con display:none y lo destapaba su script con ?vacio. Aqui
   lo decide el .razor, que pinta la lista o el vacio y nunca los dos. */

.pnl .empty { padding: 20px 12px 22px; }
.pnl .empty p { max-width: 44ch; }
.pnl .empty .btn { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
    .pnl * { transition: none !important; }
}

@media (max-width: 1100px) {
    .pnl .cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .pnl .head { flex-direction: column; align-items: stretch; }
    .pnl .head .btn { width: 100%; }
    .pnl .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pnl .count:nth-child(3) { box-shadow: inset 0 1px 0 var(--dm-border); }
    .pnl .count:nth-child(4) { box-shadow: inset 1px 0 0 var(--dm-border), inset 0 1px 0 var(--dm-border); }
    .pnl .row--lead .t { font-size: 20px; line-height: 24px; }
}

@media (max-width: 520px) {
    .pnl .row,
    .pnl .row--lead { grid-template-columns: 20px minmax(0, 1fr); }
    .pnl .row .vis,
    .pnl .row .when { grid-column: 2; justify-self: start; margin-top: 4px; }
    .pnl .t { white-space: normal; }
}

/* --- Celdas de tabla -------------------------------------------------------------------- */

.cell-title { display: flex; flex-direction: column; gap: 1px; }
.cell-title__link { font-weight: 500; color: var(--dm-text); text-decoration: none; }
.cell-title__link:hover { color: var(--dm-primary); }
.cell-title__sub { font-size: var(--dm-text-sm); color: var(--dm-text-muted); }

.cell-name { display: flex; align-items: center; gap: var(--dm-space-2); }
.cell-name--bin { color: var(--dm-text-soft); }
.cell-name--bin .cell-name__text { text-decoration: line-through; }
.cell-name__icon { display: inline-flex; color: var(--dm-neutral); }
.cell-name__icon--success { color: var(--dm-success); }
.cell-name__icon--info { color: var(--dm-info); }
.cell-name__text--strong { font-weight: 600; }

/* La fila de la narrativa, verde caiga donde caiga. Desde el 2026-09-11 las filas pares llevan
   banda (mainmodule.css, dos clases de peso): con la regla de una sola clase de antes, una
   narrativa en fila par salia azul. Tres clases, y ninguna es del armazon del host. */
.tbl .tbl__row.tbl__row--narrative { background: var(--dm-success-light); }

.row-actions { justify-content: flex-end; gap: var(--dm-space-1); white-space: nowrap; }
a.row-action { text-decoration: none; }

/* --- Ficha del expediente --------------------------------------------------------------- */

.dossier-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--dm-space-5);
    padding: var(--dm-space-4) 20px;
    background: var(--dm-surface);
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius);
    box-shadow: var(--dm-shadow);
}

.dossier-head__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dossier-head__description { margin: 0; color: var(--dm-text-soft); }
.dossier-head__meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: var(--dm-text-sm); color: var(--dm-text-muted); }
.dossier-head__actions { display: flex; gap: var(--dm-space-2); flex: 0 0 auto; }

.narrative-card {
    display: flex;
    align-items: center;
    gap: var(--dm-space-4);
    padding: var(--dm-space-4) 20px;
    background: var(--dm-surface);
    border: 1px solid var(--dm-success);
    border-left-width: 3px;
    border-radius: var(--dm-radius);
    box-shadow: var(--dm-shadow);
}

.narrative-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--dm-radius);
    color: var(--dm-success);
    background: var(--dm-success-light);
    flex: 0 0 auto;
}

.narrative-card__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.narrative-card__title { display: flex; align-items: center; gap: var(--dm-space-2); font-weight: 600; }
.narrative-card__meta { font-size: var(--dm-text-sm); color: var(--dm-text-soft); }

/* --- Opciones de visibilidad ------------------------------------------------------------ */

.opts { display: flex; gap: var(--dm-space-3); }

.opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1 1 0;
    padding: var(--dm-space-3);
    border: 1px solid var(--dm-border-strong);
    border-radius: var(--dm-radius);
    cursor: pointer;
}

.opt--on { border-color: var(--dm-primary); background: var(--dm-primary-light); }
.opt input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--dm-primary); }
.opt__text { display: flex; flex-direction: column; gap: 2px; }
.opt__title { font-weight: 600; }
.opt__hint { font-size: var(--dm-text-sm); color: var(--dm-text-soft); }

/* --- Dialogo modal ---------------------------------------------------------------------- */

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 48px; }
.modal__veil { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }

.modal__card {
    position: relative;
    width: 100%;
    background: var(--dm-surface);
    border-radius: var(--dm-radius);
    box-shadow: var(--dm-shadow-lg);
    overflow: hidden;
    max-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
}

.modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--dm-space-4);
    padding: 20px;
    border-bottom: 1px solid var(--dm-border);
}

.modal__heading { display: flex; align-items: flex-start; gap: 14px; }

.modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    color: var(--dm-primary);
    background: var(--dm-primary-light);
    flex: 0 0 auto;
}

.modal__icon--danger { color: var(--dm-danger); background: var(--dm-danger-light); }
.modal__icon--warning { color: var(--dm-warning); background: var(--dm-warning-light); }
.modal__titles { display: flex; flex-direction: column; gap: 4px; }
.modal__title { margin: 0; font-size: 18px; font-weight: 600; }
.modal__subtitle { margin: 0; color: var(--dm-text-soft); }
.modal__close { width: 32px; height: 32px; padding: 0; flex: 0 0 auto; }
.modal__body { padding: 20px; display: flex; flex-direction: column; gap: var(--dm-space-4); overflow: auto; }
.modal__body .form-field:last-child { margin-bottom: 0; }

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--dm-space-3);
    padding: var(--dm-space-4) 20px;
    background: var(--dm-surface-alt);
    border-top: 1px solid var(--dm-border);
}

.preview-row {
    display: flex;
    align-items: center;
    gap: var(--dm-space-3);
    padding: 12px 14px;
    color: var(--dm-neutral);
    background: var(--dm-surface-alt);
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius);
}

.preview-row__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; color: var(--dm-text); }
.preview-row__title { font-weight: 600; }
.preview-row__meta { font-size: var(--dm-text-sm); color: var(--dm-text-muted); }

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
    color: var(--dm-text-muted);
    border: 2px dashed var(--dm-border-strong);
    border-radius: var(--dm-radius);
    background: var(--dm-surface-alt);
    cursor: pointer;
}

.dropzone__title { font-weight: 500; color: var(--dm-text); }
.dropzone__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* --- Editor ----------------------------------------------------------------------------- */

.editor { display: flex; flex-direction: column; gap: 0; min-height: calc(100vh - var(--dm-header-height) - 48px); }

.editor__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dm-space-4);
    padding-bottom: var(--dm-space-3);
    border-bottom: 1px solid var(--dm-border);
}

.editor__heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.editor__kind { display: inline-flex; }
.editor__kind--success { color: var(--dm-success); }
.editor__kind--info { color: var(--dm-info); }
.editor__title { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor__actions { display: flex; align-items: center; gap: var(--dm-space-3); flex: 0 0 auto; }

.editor__notice {
    display: flex;
    align-items: center;
    gap: var(--dm-space-3);
    padding: 10px var(--dm-space-4);
    color: var(--dm-text-soft);
    background: var(--dm-success-light);
    border-bottom: 1px solid var(--dm-border);
}

.editor__notice svg { color: var(--dm-success); flex: 0 0 auto; }
.editor__form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

.editor__fields {
    display: flex;
    align-items: flex-end;
    gap: var(--dm-space-4);
    padding: var(--dm-space-4) 0;
    border-bottom: 1px solid var(--dm-border);
}

.editor__fields .form-field { margin-bottom: 0; }
.editor__field--name { flex: 1 1 auto; max-width: 420px; }

.editor__panes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 1 auto;
    min-height: 480px;
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius);
    overflow: hidden;
    background: var(--dm-surface);
}

.editor__pane { display: flex; flex-direction: column; min-height: 0; }
.editor__pane:first-child { border-right: 1px solid var(--dm-border); }
.editor__pane--preview { background: var(--dm-bg); }

.editor__bar {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--dm-border);
    background: var(--dm-surface-alt);
}

.editor__textarea {
    flex: 1 1 auto;
    width: 100%;
    min-height: 440px;
    padding: 20px;
    font-family: var(--dm-font-mono);
    font-size: var(--dm-text-sm);
    line-height: 1.7;
    color: var(--dm-text);
    background: var(--dm-surface);
    border: none;
    outline: none;
    resize: vertical;
}

.editor__preview { flex: 1 1 auto; padding: 24px 28px; line-height: 1.65; overflow: auto; }
.editor__preview h1 { font-size: 24px; margin: 0 0 12px; }
.editor__preview h2 { font-size: 19px; margin: 20px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--dm-border); }
.editor__preview h3 { font-size: 15px; margin: 14px 0 4px; }
.editor__preview p { margin: 0 0 14px; color: var(--dm-text-soft); }
.editor__preview ul, .editor__preview ol { margin: 0 0 16px; padding-left: 20px; color: var(--dm-text-soft); }
.editor__preview li { margin-bottom: 4px; }
.editor__preview pre { margin: 0 0 14px; padding: 12px; font-family: var(--dm-font-mono); font-size: var(--dm-text-sm); background: var(--dm-surface-alt); border-radius: var(--dm-radius-sm); overflow: auto; }
.editor__preview code { font-family: var(--dm-font-mono); font-size: var(--dm-text-sm); }
.editor__preview a { color: var(--dm-primary); }

.editor__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 0;
    font-size: var(--dm-text-sm);
    color: var(--dm-text-muted);
}

@media (max-width: 900px) {
    .editor__panes { grid-template-columns: minmax(0, 1fr); }
    .editor__pane:first-child { border-right: none; border-bottom: 1px solid var(--dm-border); }
}

/* =================================================================================================
   Iconos del menu

   Son SVG de trazo pintados como MASCARA, no formas dibujadas con bordes de CSS.

   Antes cada icono era un <span> vacio con un ::before al que se le daban bordes, radios y
   tamanos hasta que se pareciera a algo: un circulo por «regional», medio rectangulo por
   «clientes». De cerca parecian glifos rotos, y no habia forma de dibujar un engranaje o una
   papelera con esa tecnica.

   Con mask el color lo pone `background: currentColor`, asi que el icono hereda el color del
   enlace -- incluido el estado activo y el hover -- sin repetir un solo valor. Y sin fuente de
   iconos ni fichero externo: van como data URI en esta misma hoja, que es lo que pide la regla de
   no meter bibliotecas de terceros.
   ================================================================================================= */

.icon-dossiers::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207a2%202%200%200%201%202-2h4l2%202h8a2%202%200%200%201%202%202v9a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207a2%202%200%200%201%202-2h4l2%202h8a2%202%200%200%201%202%202v9a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
}

.icon-bin::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206h18%22%2F%3E%3Cpath%20d%3D%22M19%206v14a2%202%200%200%201-2%202H7a2%202%200%200%201-2-2V6%22%2F%3E%3Cpath%20d%3D%22M8%206V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2%22%2F%3E%3Cpath%20d%3D%22M10%2011v6M14%2011v6%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206h18%22%2F%3E%3Cpath%20d%3D%22M19%206v14a2%202%200%200%201-2%202H7a2%202%200%200%201-2-2V6%22%2F%3E%3Cpath%20d%3D%22M8%206V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2%22%2F%3E%3Cpath%20d%3D%22M10%2011v6M14%2011v6%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
}

/* =================================================================================================
   Historial de versiones del editor

   Un <details> y no un panel siempre abierto: la mayoria de las veces se entra a escribir, no a
   mirar lo que habia. El open lo controla el componente para que sobreviva a los repintados.
   ================================================================================================= */

.history {
    margin-top: var(--dm-space-5);
    padding: var(--dm-space-4);
    background: var(--dm-surface);
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius);
}

.history__summary {
    display: flex;
    align-items: baseline;
    gap: var(--dm-space-2);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.history__summary::-webkit-details-marker { display: none; }

.history__empty { margin-top: var(--dm-space-3); }

.history__list {
    margin: var(--dm-space-4) 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--dm-space-2);
}

.history__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dm-space-4);
    padding: var(--dm-space-3);
    background: var(--dm-surface-alt);
    border-radius: var(--dm-radius-sm);
}

.history__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.history__when { font-weight: 500; }

.history__excerpt {
    color: var(--dm-text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* La fila de acciones de la papelera, empujada a la derecha para no competir con el aviso. */
.page__buttons--right { justify-content: flex-end; margin-bottom: var(--dm-space-4); }

/* La cabecera del editor por debajo de 900px: en una columna.

   En horizontal, el titulo y las acciones compartian fila con flex y sin envolver, asi que en una
   pantalla estrecha la fila se desbordaba y el titulo quedaba pisado por los botones. */
@media (max-width: 900px) {
    .editor__head {
        flex-direction: column;
        align-items: stretch;
        gap: var(--dm-space-3);
    }

    .editor__heading { flex-wrap: wrap; }

    .editor__actions { flex-wrap: wrap; justify-content: flex-start; }

    .editor__title { font-size: var(--dm-text-lg); }

    /* Las dos columnas del editor -- texto y vista previa -- una debajo de otra. */
    .editor__panes { grid-template-columns: minmax(0, 1fr); }

    .dossier-head { flex-direction: column; align-items: stretch; gap: var(--dm-space-3); }
}

/* Orden de la lista y paginacion. */
/* --- De quien: el filtro al que llevan las cifras del panel ------------------------------- */

.dequien {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius);
}

.dequien__opt {
    padding: 7px 12px;
    font-size: var(--dm-text-sm);
    color: var(--dm-text-soft);
    text-decoration: none;
    white-space: nowrap;
    background: var(--dm-surface);
    border-left: 1px solid var(--dm-border);
}

.dequien__opt:first-child { border-left: none; }
.dequien__opt:hover { background: var(--dm-surface-alt); }
.dequien__opt--on { font-weight: 600; color: var(--dm-primary); background: var(--dm-primary-light); }

.orden { display: flex; align-items: center; gap: var(--dm-space-2); }

.orden__etiqueta { font-size: var(--dm-text-sm); color: var(--dm-text-soft); white-space: nowrap; }

.orden__control {
    padding: var(--dm-space-1) var(--dm-space-2);
    font: inherit;
    color: var(--dm-text);
    background: var(--dm-surface);
    border: 1px solid var(--dm-border-strong);
    border-radius: var(--dm-radius-sm);
}

.paginacion { display: flex; align-items: center; gap: var(--dm-space-3); }

.page__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--dm-space-4); flex-wrap: wrap; }

/* La lista de personas con las que se comparte. Casillas y no un desplegable multiple: con menos
   de una docena de compañeros se ven todos de un vistazo, y un <select multiple> obliga a saber
   que hay que pulsar Ctrl. */
.gente {
    display: flex;
    flex-direction: column;
    gap: var(--dm-space-2);
    margin-top: var(--dm-space-3);
    padding: var(--dm-space-3);
    background: var(--dm-surface-alt);
    border-radius: var(--dm-radius-sm);
}

.gente__titulo { font-size: var(--dm-text-sm); font-weight: 600; color: var(--dm-text-soft); }

.gente__item { display: flex; align-items: center; gap: var(--dm-space-2); cursor: pointer; }

.gente__item input { width: 16px; height: 16px; accent-color: var(--dm-primary); }

.gente__aviso { font-size: var(--dm-text-sm); color: var(--dm-warning); }

/* Estado, responsable y plazo en la cabecera del expediente. */
.meta { display: flex; flex-wrap: wrap; gap: var(--dm-space-3); margin-top: var(--dm-space-2); }

.meta__dato { font-size: var(--dm-text-sm); color: var(--dm-text-soft); }

.meta__dato--vencido { color: var(--dm-danger); font-weight: 600; }

/* El aviso de plazo vencido, debajo del estado en la lista. */
.celda__vencido { font-size: var(--dm-text-sm); color: var(--dm-danger); font-weight: 600; }
