/* ==========================================================================
   Waves Legal Manager — sistema de diseño
   Portado desde el proyecto de Claude Design "Waves Shell Base".
   ========================================================================== */

:root {
    --wv-bg: linear-gradient(165deg, #eef4f9 0%, #dbe7f0 45%, #c9dbe6 100%);
    --wv-surface: #ffffff;
    --wv-surface-2: #eef3f8;
    --wv-shine-strong: rgba(80, 129, 159, .55);

    /* Paleta de marca "Wedgewood" (azul) — Palette 1, escala 50-950. */
    --wv-sidebar: #1c2935;
    --wv-sidebar-active: #2f4a5d;
    --wv-sidebar-hover: #2b3f4f;
    --wv-sidebar-text: #f5f8fa;
    --wv-sidebar-text-dim: #cfdee8;
    --wv-sidebar-text-mute: #74a1bc;
    --wv-sidebar-border: #35566f;

    /* --wv-accent/--wv-accent-hover: oscurecidos en la auditoría de
       accesibilidad (Fase 2.1) — el azul original (#50819f) daba solo 4.22:1
       de contraste con texto blanco encima (botón primario) y como color de
       enlace sobre fondo claro, por debajo del 4.5:1 mínimo. */
    --wv-accent: #406b89;
    --wv-accent-hover: #35566f;
    --wv-accent-text: #35566f;
    --wv-accent-soft: #e9eff5;
    --wv-accent-soft-border: #cfdee8;

    --wv-text: #1b2320;
    --wv-text-2: #43504a;
    --wv-text-3: #5b655e;
    /* --wv-muted/--wv-muted-2: oscurecidos en la auditoría de accesibilidad
       (Fase 2.1) — los tonos originales daban 3.81:1 y 3.05:1 contra blanco,
       por debajo del 4.5:1 mínimo para texto. --wv-muted-4 se fusionó con
       --wv-muted-2 (sin uso real distinto). */
    --wv-muted: #565e58;
    --wv-muted-2: #677069;
    --wv-muted-3: #a3aca4;

    /* --wv-border: para tarjetas/modales/paneles (decorativo, sin cambios).
       --wv-border-input: mismo propósito pero para campos de formulario
       reales (inputs/selects/textareas/nice-select) — el original (#e3e5dc)
       daba solo 1.27:1 contra blanco, muy por debajo del 3:1 mínimo para el
       límite visual de un control interactivo. */
    --wv-border: #e3e5dc;
    --wv-border-input: #83897d;
    --wv-border-2: #edeee7;
    --wv-border-3: #f2f3ec;

    --wv-danger-bg: #fbe6e2;
    --wv-danger-fg: #9b3d28;
    --wv-danger-dot: #c25b3f;

    --wv-status-activo-bg: #e4f0e7;
    --wv-status-activo-fg: #1f5a3f;
    --wv-status-tramite-bg: #fbf0dc;
    --wv-status-tramite-fg: #8a5a12;
    --wv-status-suspendido-bg: #edede9;
    --wv-status-suspendido-fg: #5c605a;
    --wv-status-concluido-bg: #e3edf3;
    --wv-status-concluido-fg: #2a566e;

    --wv-radius-card: 14px;
    --wv-radius: 10px;
    --wv-radius-sm: 8px;
    --wv-font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
    --wv-font-serif: "Century Gothic", CenturyGothic, "Poppins", "Segoe UI", sans-serif;

    /* Flecha propia para todos los <select> de la app (ver sección "Lista
       desplegable" más abajo) — un solo SVG compartido via variable para no
       repetir el data-URI en cada contexto (filtro, modal, suelto). */
    --wv-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23565e58' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--wv-bg); }

body {
    font-family: var(--wv-font-body);
    -webkit-font-smoothing: antialiased;
    color: var(--wv-text);
}

a { color: var(--wv-accent); text-decoration: none; }
a:hover { color: var(--wv-accent-text); text-decoration: underline; }

table { border-collapse: collapse; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

[x-cloak] { display: none !important; }

/* ---------------------------------------------------------------------- */
/* Shell: sidebar + topbar                                                 */
/* ---------------------------------------------------------------------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; left: 0; z-index: 40;
    flex: 0 0 auto;
    width: 232px;
    height: 100vh;
    background: linear-gradient(180deg, var(--wv-sidebar-border) 0%, var(--wv-sidebar) 100%);
    color: var(--wv-sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 18px 12px 14px;
    transition: width .2s ease;
    overflow: hidden;
}
.sidebar.is-collapsed { width: 68px; }

.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 20px; white-space: nowrap; }
.sidebar-brand-logo { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; overflow: hidden; display: grid; place-items: center; background: var(--wv-sidebar-active); }
.sidebar-brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar-brand-text { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.sidebar-brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: #f4f5ef; }
.sidebar-brand-text span { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--wv-sidebar-text-mute); }

.sidebar-nav {
    display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }

.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 9px;
    color: var(--wv-sidebar-text-dim); cursor: pointer; white-space: nowrap;
    text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.nav-item:hover { background: var(--wv-sidebar-hover); color: var(--wv-sidebar-text); text-decoration: none; }
/* El outline nativo del navegador es casi negro — invisible sobre el fondo
   marino oscuro del sidebar (falla el 3:1 de foco). Mismo azul claro que ya
   usa .is-active para el acento, así queda consistente con el resto. */
.nav-item:focus-visible { outline: 2px solid #74a1bc; outline-offset: -2px; }
.nav-item.is-active { background: var(--wv-sidebar-active); color: #fff; box-shadow: inset 2px 0 0 #74a1bc; }
.nav-item svg { flex: 0 0 auto; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; }
.nav-item.is-disabled { color: var(--wv-sidebar-text-mute); cursor: default; opacity: .65; }
.nav-item.is-disabled:hover { background: transparent; color: var(--wv-sidebar-text-mute); }

.sidebar-section-label {
    display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin-top: 14px;
    border-top: 1px solid var(--wv-sidebar-border); padding-top: 16px;
    font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    color: var(--wv-sidebar-text-mute); white-space: nowrap;
}

.sidebar-footer { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--wv-sidebar-border); margin-top: 12px; }

.sidebar-toggle {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px;
    color: var(--wv-sidebar-text-mute); cursor: pointer; font-size: 12.5px; background: transparent; border: none;
    font-family: inherit; width: 100%; text-align: left; white-space: nowrap;
}
.sidebar-toggle:hover { background: var(--wv-sidebar-hover); color: var(--wv-sidebar-text); }
.sidebar-toggle:focus-visible { outline: 2px solid #74a1bc; outline-offset: -2px; }
.sidebar-toggle svg { transition: transform .2s ease; flex: 0 0 auto; }
.sidebar.is-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

/* Encabezado de página — pulido visual Bloque 2 (opción B): dos filas en
   vez de una. Antes breadcrumb+h1+acción vivían apretados en una sola fila
   junto a notificaciones/perfil, dejando un vacío grande en pantallas sin
   acción propia (ver Carpetas) y compitiendo por espacio en las que sí la
   tenían. Fila 1 = breadcrumb + notificaciones/perfil (constante en toda
   página estándar). Fila 2 = <h1> + la acción principal de ESA pantalla
   (<x-icon>+texto vía @push('topbar-action')), alineada al título en vez
   de a notificaciones/perfil. .topbar-compact (detalle de expediente/aviso,
   ya traía su propio encabezado en el contenido) sigue siendo una sola
   fila, sin breadcrumb ni acción, como antes. */
.topbar {
    flex: 0 0 auto;
    display: flex; flex-direction: column; gap: 10px; padding: 18px 26px 14px;
}
.topbar.topbar-compact {
    flex-direction: row; align-items: center; gap: 14px 20px; flex-wrap: wrap; padding: 16px 26px 8px;
}
.topbar-row { display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; }
.topbar-title { flex: 1 1 240px; min-width: 0; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12px; color: var(--wv-muted); }
.topbar-breadcrumb strong { color: var(--wv-text-2); font-weight: 500; }
.topbar-title h1 { margin: 0; font-family: var(--wv-font-serif); font-size: 27px; font-weight: 700; letter-spacing: -.01em; color: var(--wv-text); }
.topbar-title h1.dashboard-page-heading { font-weight: 500; }
/* El foco que mueve wire:navigate aquí (layouts/app.blade.php) es
   programático sobre un tabindex="-1" — nunca alcanzable con Tab, así que
   el anillo de foco (pensado para saber dónde está el cursor de teclado)
   no aporta nada aquí y solo se veía como una caja de lado a lado. */
.topbar-title h1[tabindex="-1"]:focus { outline: none; }

/* margin-left:auto (no justify-content:space-between en .topbar-row): así
   funciona igual con o sin elemento a la izquierda — en los dashboards la
   fila 1 no tiene breadcrumb y aun así notificaciones/perfil quedan a la
   derecha. */
.topbar-actions, .topbar-action-slot { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; margin-left: auto; }

.topbar-user {
    display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px 0 5px;
    border-radius: 22px; background: var(--wv-surface); border: 1px solid var(--wv-border);
}
.topbar-user-avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--wv-sidebar); color: var(--wv-sidebar-text); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.topbar-user-info { display: flex; flex-direction: column; line-height: 1.25; }
.topbar-user-info strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.topbar-user-info span { font-size: 12px; color: var(--wv-muted); white-space: nowrap; }

.app-main {
    flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
    margin-left: 232px; transition: margin-left .2s ease;
}
.app-main.is-collapsed { margin-left: 68px; }
.app-content { flex: 1 1 auto; padding: 6px 26px 32px; }

@media (max-width: 720px) {
    .app-shell { flex-direction: column; }
    .sidebar, .sidebar.is-collapsed {
        position: static; width: 100%; height: auto;
        flex-direction: row; align-items: center; padding: 10px 14px;
    }
    .sidebar-nav { flex-direction: row; overflow-x: auto; }
    .sidebar-footer, .sidebar-section-label { display: none; }
    .app-main, .app-main.is-collapsed { margin-left: 0; }
}

/* ---------------------------------------------------------------------- */
/* Botones                                                                 */
/* ---------------------------------------------------------------------- */

.btn-link,
.page-header button,
main form button[type=submit],
button[type=submit] {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--wv-accent); color: #fff; border: 1px solid var(--wv-accent);
    text-decoration: none; padding: .6rem 1.1rem; border-radius: var(--wv-radius);
    font-family: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .15s cubic-bezier(.34,1.4,.64,1);
}
.btn-link:hover,
.page-header button:hover,
main form button[type=submit]:hover,
button[type=submit]:hover {
    background: var(--wv-accent-hover); border-color: var(--wv-accent-hover); text-decoration: none; color: #fff;
    transform: scale(1.015);
}
.btn-link:active,
.page-header button:active,
main form button[type=submit]:active,
button[type=submit]:active {
    transform: scale(.97);
}
.btn-link:disabled, .btn-link[disabled],
main form button[type=submit]:disabled, main form button[type=submit][disabled],
button[type=submit]:disabled, button[type=submit][disabled] {
    opacity: .55; cursor: not-allowed; transform: none;
}
.btn-link:disabled:hover, .btn-link[disabled]:hover,
main form button[type=submit]:disabled:hover, main form button[type=submit][disabled]:hover,
button[type=submit]:disabled:hover, button[type=submit][disabled]:hover {
    background: var(--wv-accent); border-color: var(--wv-accent); transform: none;
}

/* Brillo animado en bucle (barrido diagonal) — versión CSS del componente
   AnimatedButton (framer-motion) que compartió el usuario; sin React/JS,
   solo pseudo-elemento + keyframes, con el tono más fuerte de la paleta.
   .btn-dark reutiliza esta misma animación — ver su propia regla más abajo. */
.btn-link::after,
.page-header button::after,
main form button[type=submit]::after,
button[type=submit]::after,
.btn-dark::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
    background: linear-gradient(115deg, transparent 0%, var(--wv-shine-strong) 45%, rgba(255,255,255,.7) 50%, var(--wv-shine-strong) 55%, transparent 100%);
    transform: skewX(-20deg); pointer-events: none;
    animation: wv-btn-shine 2.8s ease-in-out infinite;
}
@keyframes wv-btn-shine {
    0% { left: -60%; }
    28% { left: 130%; }
    100% { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
    .btn-link::after, .page-header button::after, main form button[type=submit]::after, button[type=submit]::after, .btn-dark::after { animation: none; display: none; }
    .btn-link, .page-header button, main form button[type=submit], button[type=submit], .btn-dark { transition: background .18s ease, border-color .18s ease; }
    .btn-link:hover, .page-header button:hover, main form button[type=submit]:hover, button[type=submit]:hover, .btn-dark:hover { transform: none; }
}

/* Campana de notificaciones: mismo brillo diagonal en bucle que los botones
   principales, recortado dentro del círculo (overflow:hidden). */
.topbar-bell-btn { overflow: hidden; }
.topbar-bell-btn::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
    background: linear-gradient(115deg, transparent 0%, var(--wv-shine-strong) 45%, rgba(255,255,255,.7) 50%, var(--wv-shine-strong) 55%, transparent 100%);
    transform: skewX(-20deg); pointer-events: none;
    animation: wv-btn-shine 2.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .topbar-bell-btn::after { animation: none; display: none; }
}

/* ---------------------------------------------------------------------- */
/* Envoltura de tabla con scroll horizontal dentro de un panel-card angosto
   (.data-table exige min-width:640px; sin esto se sale de la tarjeta). */
/* ---------------------------------------------------------------------- */
.table-scroll {
    overflow-x: auto; border-radius: var(--wv-radius-card);
    scrollbar-width: thin; scrollbar-color: var(--wv-border) transparent;
}
.table-scroll::-webkit-scrollbar { height: 7px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--wv-border); border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: var(--wv-muted-3); }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--wv-surface); color: var(--wv-text-2); border: 1px solid var(--wv-border);
    padding: .6rem 1rem; border-radius: var(--wv-radius); font-family: inherit; font-size: .82rem;
    font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color .18s ease;
}
.btn-secondary:hover { border-color: var(--wv-accent-soft-border); }

/* Botones secundarios (editar / cancelar / descargar / acciones de tabla) */
.data-table .actions button,
.note-meta button,
.modal-content > button,
.modal button:not([type=submit]):not(.nice-select-trigger):not(.nice-select-option) {
    background: var(--wv-surface); color: var(--wv-text-2); border: 1px solid var(--wv-border);
    padding: .4rem .75rem; border-radius: var(--wv-radius-sm); font-family: inherit; font-size: .78rem;
    cursor: pointer; transition: border-color .18s ease;
}
.data-table .actions button:hover,
.note-meta button:hover,
.modal-content > button:hover,
.modal button:not([type=submit]):not(.nice-select-trigger):not(.nice-select-option):hover {
    border-color: var(--wv-accent-soft-border);
}

/* ---------------------------------------------------------------------- */
/* Page header / filtros                                                   */
/* ---------------------------------------------------------------------- */

.page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header h1 { font-family: var(--wv-font-serif); font-weight: 700; font-size: 1.7rem; color: var(--wv-text); margin: 0; }

/* ---------------------------------------------------------------------- */
/* Lista desplegable (<select>) — una sola apariencia en toda la app: se   */
/* apaga el cromo nativo del sistema operativo (appearance:none), que es  */
/* justo lo que impedía redondear sus esquinas de forma confiable, y se   */
/* reemplaza por una flecha propia. El resto (color/relleno/fondo) lo     */
/* sigue dando cada contexto (filtro, modal, formulario de página) más    */
/* abajo — esta regla solo entra si ningún otro contexto más específico   */
/* ya define esas mismas propiedades.                                      */
/* ---------------------------------------------------------------------- */
select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    height: 2.35rem; padding: 0 2.3rem 0 .85rem; border: 1px solid var(--wv-border-input);
    border-radius: var(--wv-radius); background-color: var(--wv-surface); color: var(--wv-text);
    font-family: inherit; font-size: .85rem; cursor: pointer;
    background-image: var(--wv-select-chevron); background-repeat: no-repeat;
    background-position: right .85rem center; background-size: 13px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
select::-ms-expand { display: none; }
select:hover { border-color: var(--wv-accent-soft-border); }
select:focus { outline: none; border-color: var(--wv-accent); box-shadow: 0 0 0 3px var(--wv-accent-soft); }

.filter-bar { margin-bottom: 1.25rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.filter-bar label { font-size: .8rem; color: var(--wv-muted-2); white-space: nowrap; }
.filter-bar input[type=text],
.filter-bar input[type=search],
.filter-bar input[type=date],
.filter-bar select {
    height: 2.35rem; padding: 0 .75rem; border-radius: var(--wv-radius); border: 1px solid rgba(255,255,255,.7);
    background-color: rgba(255,255,255,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    font-family: inherit; font-size: .82rem; color: var(--wv-text);
}
.filter-bar select { padding-right: 2.3rem; background-image: var(--wv-select-chevron); background-repeat: no-repeat; background-position: right .85rem center; background-size: 13px; }
.filter-bar input[type=text]:focus, .filter-bar input[type=search]:focus, .filter-bar input[type=date]:focus, .filter-bar select:focus { outline: none; border-color: var(--wv-accent); }

/* Pills de filtro (estado del expediente) */
.filter-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-pill {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
    border-radius: 16px; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
    border: 1px solid transparent; color: var(--wv-text-3); background: transparent;
    font-family: inherit;
}
.filter-pill:hover { background: var(--wv-border-3); text-decoration: none; }
.filter-pill.is-active {
    background: var(--wv-accent-soft); color: var(--wv-accent-text); border-color: var(--wv-accent-soft-border);
    font-weight: 600;
}
.filter-pill .pill-count { color: var(--wv-muted-2); font-weight: 500; }
.filter-pill.is-active .pill-count { color: var(--wv-accent-hover); }

/* ---------------------------------------------------------------------- */
/* Tarjeta de lista (encabezado de filtros + tabla + paginación, unidos)   */
/* ---------------------------------------------------------------------- */

.list-card {
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card);
    overflow-x: auto; overflow-y: hidden; transition: box-shadow .18s ease;
}
.list-card:hover { box-shadow: 0 10px 22px rgba(28,41,53,.1); }
.list-card-header {
    display: flex; align-items: center; gap: 14px; padding: 16px 20px;
    border-bottom: 1px solid var(--wv-border-2); flex-wrap: wrap;
}
.list-card-filters { padding: 14px 20px; border-bottom: 1px solid var(--wv-border-2); }
/* .filter-bar trae un borde blanco translúcido pensado para flotar sobre
   el fondo azul "vidrio" del dashboard — aquí el fondo detrás es blanco
   (.list-card), así que ese borde quedaba invisible. */
.list-card-filters.filter-bar input[type=text],
.list-card-filters.filter-bar input[type=search],
.list-card-filters.filter-bar select {
    border-color: var(--wv-border-input); background: var(--wv-surface); backdrop-filter: none; -webkit-backdrop-filter: none;
}
.list-card .data-table { border: none; border-radius: 0; }
.list-card-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 14px 20px; background: var(--wv-surface-2); border-top: 1px solid var(--wv-border-2);
}
.list-card-footer .pagination { margin-top: 0; }

.expense-row {
    display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--wv-border-3);
    transition: background .16s ease, box-shadow .16s ease;
}
.expense-row:hover { background: var(--wv-surface-2); box-shadow: inset 3px 0 0 var(--wv-accent); }
.expense-row button { flex: 0 0 auto; width: 30px; height: 30px; border-radius: var(--wv-radius-sm); border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--wv-text-3); cursor: pointer; transition: background .16s ease, color .16s ease; }
.expense-row button:hover { background: var(--wv-accent-soft); color: var(--wv-accent-text); }

/* ---------------------------------------------------------------------- */
/* Tablas                                                                   */
/* ---------------------------------------------------------------------- */

/* border-collapse:collapse ignora por completo el border-radius de la
   propia <table> (el modelo de bordes "colapsados" pinta los bordes con un
   algoritmo aparte que no respeta esquinas) — por eso las tablas sueltas
   (sin envolver en .list-card, que sí redondea porque el radio vive en el
   <div> contenedor) se veían con las esquinas superiores a escuadra pese al
   border-radius ya declarado aquí. border-collapse:separate + overflow:
   hidden sí deja que la propia tabla recorte el fondo del <thead> a sus
   esquinas — visualmente igual aquí porque las celdas solo usan
   border-bottom (sin bordes verticales que "separate" pudiera duplicar). */
.data-table {
    width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; background: var(--wv-surface);
    border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card);
    overflow: hidden;
}
/* Mismo override de min-width que .lawyer-assignment-table (ver más abajo),
   para tablas simples de 2-3 columnas (portal del cliente) que de otro modo
   forzarían scroll horizontal dentro de una tarjeta angosta sin necesitarlo. */
.table-compact { min-width: 420px; }
.data-table th, .data-table td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--wv-border-3); font-size: .85rem; }
.data-table th {
    background: var(--wv-surface-2); border-bottom: 1px solid var(--wv-border-2);
    font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--wv-muted);
}
.data-table tbody tr { transition: background .16s ease, box-shadow .16s ease; }
.data-table tbody tr:hover { background: var(--wv-surface-2); box-shadow: inset 3px 0 0 var(--wv-accent); }
.data-table tbody tr:last-child td { border-bottom: none; }
/* El <td> se queda como table-cell normal (sin tocar su display): tanto
   flex como inline-flex puestos directo en un <td> le rompen el layout de
   tabla al navegador de maneras distintas — flex duplica el alto de fila
   cuando hay dos celdas así en la misma fila (Comprobante + Acciones en
   Abonos); inline-flex arregla eso pero relaja el ancho de columna, dejando
   el contenido "flotar" fuera de su columna. El flex va en un <span>
   envoltorio adentro (.actions-inner), nunca en el <td> mismo. */
.actions-inner { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: nowrap; }
/* Columna de correo: sin esto, un correo largo sin espacios (una sola
   "palabra" para el navegador) fuerza esa columna de la tabla a estirarse
   para caber en una sola línea, en vez de partirse en dos. */
.data-table td.email-cell { max-width: 220px; overflow-wrap: anywhere; }
.data-table .actions button { margin-right: 0; transition: background .16s ease, color .16s ease, transform .16s ease; }
.data-table .actions button:hover { transform: translateY(-1px); }
.data-table .actions button.btn-danger-icon:hover { background: var(--wv-danger-bg); color: var(--wv-danger-fg); border-color: var(--wv-danger-bg); }

/* ---------------------------------------------------------------------- */
/* Badges (estado activo/inactivo, visible/oculto) — pill con punto       */
/* ---------------------------------------------------------------------- */

.badge {
    display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 11px 0 9px;
    border-radius: 12px; font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.badge-active { background: var(--wv-status-activo-bg); color: var(--wv-status-activo-fg); }
.badge-inactive { background: var(--wv-danger-bg); color: var(--wv-danger-fg); }

/* Componente <x-badge> con tonos adicionales */
.badge-tramite { background: var(--wv-status-tramite-bg); color: var(--wv-status-tramite-fg); }
.badge-suspendido { background: var(--wv-status-suspendido-bg); color: var(--wv-status-suspendido-fg); }
.badge-concluido { background: var(--wv-status-concluido-bg); color: var(--wv-status-concluido-fg); }
.badge-neutral { background: var(--wv-border-3); color: var(--wv-text-2); }
.badge-neutral::before { display: none; }
.badge-icon::before { display: none; }
/* Nombres de estado largos ("En proceso y en espera de resolución") ya no
   fuerzan la columna a estirarse — el texto se parte dentro de la misma
   píldora en vez de correr en una sola línea sin límite. */
.badge-wrap { white-space: normal; height: auto; min-height: 24px; line-height: 1.3; text-align: left; }
.data-table td.status-cell { max-width: 150px; }

.ext-badge {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    font-size: 9.5px; font-weight: 700; letter-spacing: .04em; flex: 0 0 auto;
}

.upload-dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 26px 20px; border-radius: 12px; border: 1px dashed var(--wv-accent-soft-border); background: var(--wv-surface-2);
    text-align: center; cursor: pointer; transition: border-color .18s ease;
}
.upload-dropzone:hover { border-color: var(--wv-accent); }
.upload-dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-dropzone .upload-filename { font-size: 13px; color: var(--wv-text); font-weight: 500; }
.upload-dropzone .upload-hint { font-size: 12px; color: var(--wv-muted-2); }

/* ---------------------------------------------------------------------- */
/* Avatares                                                                 */
/* ---------------------------------------------------------------------- */

.avatar {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
    color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto; line-height: 1;
}
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-right: -8px; border: 2px solid var(--wv-surface); }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }

/* ---------------------------------------------------------------------- */
/* Paginación                                                               */
/* ---------------------------------------------------------------------- */

.pagination { margin-top: 1.25rem; }
.pagination nav { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: .3rem; font-size: .78rem; color: var(--wv-muted); }
.pagination a, .pagination button, .pagination span:not(.sr-only):not(.pagination-key) {
    display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem;
    padding: 0 .6rem; border-radius: var(--wv-radius-sm); border: 1px solid var(--wv-border);
    background: var(--wv-surface); color: var(--wv-text-2); font-size: .8rem; text-decoration: none;
    font-family: inherit; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.pagination a:hover, .pagination button:hover { border-color: var(--wv-accent-soft-border); text-decoration: none; background: var(--wv-surface-2); }
.pagination span[aria-current] {
    background: var(--wv-accent); border-color: var(--wv-accent); color: #fff; font-weight: 600;
}
.pagination span[aria-disabled] { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------------- */
/* Drawer / modal                                                          */
/* ---------------------------------------------------------------------- */

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(28, 41, 53, .32); z-index: 50;
    display: flex; align-items: center; justify-content: center; padding: 28px;
    backdrop-filter: blur(1.5px);
}
.modal {
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(28, 41, 53, .22);
    width: 100%; max-width: 32rem; max-height: 90vh; overflow-y: auto;
    padding: 1.75rem 1.75rem 1.5rem;
    scrollbar-width: thin; scrollbar-color: var(--wv-border) transparent;
}
.modal.modal-wide { max-width: 40rem; }
.modal::-webkit-scrollbar { width: 7px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--wv-border); border-radius: 999px; }
.modal::-webkit-scrollbar-thumb:hover { background: var(--wv-muted-3); }
.notif-panel {
    overflow-y: auto; border-radius: 14px;
    scrollbar-width: thin; scrollbar-color: var(--wv-border) transparent;
}
.notif-panel::-webkit-scrollbar { width: 7px; }
.notif-panel::-webkit-scrollbar-track { background: transparent; }
.notif-panel::-webkit-scrollbar-thumb { background: var(--wv-border); border-radius: 999px; }
.notif-panel::-webkit-scrollbar-thumb:hover { background: var(--wv-muted-3); }
.notif-panel > div:first-child { border-radius: 14px 14px 0 0; }
.notif-panel > div:last-child { border-radius: 0 0 14px 14px; }
.btn-confirm-accept {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--wv-accent); color: #fff; border: 1px solid var(--wv-accent);
    padding: .4rem .9rem; border-radius: var(--wv-radius-sm); font-family: inherit; font-size: .78rem;
    cursor: pointer; transition: background .18s ease, border-color .18s ease;
}
.btn-confirm-accept:hover { background: var(--wv-accent-hover); border-color: var(--wv-accent-hover); }
.btn-confirm-accept.is-danger { background: #c25b3f; border-color: #c25b3f; }
.btn-confirm-accept.is-danger:hover { background: #a84a31; border-color: #a84a31; }
.modal-content label, .form-card label { display: block; font-size: .8rem; margin-bottom: .3rem; color: var(--wv-text-3); font-weight: 500; }
.modal-content input, .modal-content select, .modal-content textarea,
.form-card input, .form-card select, .form-card textarea {
    width: 100%; padding: .6rem .75rem; margin-bottom: 1rem; border: 1px solid var(--wv-border-input);
    border-radius: var(--wv-radius); box-sizing: border-box; font-family: inherit; font-size: .88rem;
    color: var(--wv-text); background-color: var(--wv-surface);
}
.modal-content select, .form-card select {
    padding-right: 2.3rem; cursor: pointer;
    background-image: var(--wv-select-chevron); background-repeat: no-repeat;
    background-position: right .85rem center; background-size: 13px;
}
.modal-content input:focus, .modal-content select:focus, .modal-content textarea:focus,
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--wv-accent); }
.modal-content fieldset, .form-card fieldset {
    border: 1px solid var(--wv-border-2); border-radius: var(--wv-radius); padding: 1rem 1.1rem 0;
    margin-bottom: 1rem; background: var(--wv-surface-2);
}
.modal-content fieldset legend, .form-card fieldset legend {
    font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wv-muted); padding: 0 .3rem;
}
.modal-content h2 {
    font-family: var(--wv-font-serif); font-weight: 700; font-size: 1.4rem; color: var(--wv-text);
    margin: 0 0 1.25rem;
}
.modal-kicker { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--wv-muted); margin-bottom: 3px; }
.modal-section-label {
    font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wv-muted);
    margin: 1.4rem 0 .9rem; padding-top: 1.3rem; border-top: 1px solid var(--wv-border-2);
}
.modal-content form > .modal-section-label:first-child,
.modal-content form > *:first-child .modal-section-label { margin-top: 0; padding-top: 0; border-top: none; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 1rem; }
.field-row > div { min-width: 0; }
.modal-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 1.5rem;
    padding-top: 1.1rem; border-top: 1px solid var(--wv-border-2);
}

/* ---------------------------------------------------------------------- */
/* Tarjetas de contenido                                                    */
/* ---------------------------------------------------------------------- */

.form-card {
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card);
    padding: 1.5rem 1.6rem; max-width: none; margin-bottom: 1.25rem;
    transition: box-shadow .18s ease;
}
.form-card:hover { box-shadow: 0 10px 22px rgba(28,41,53,.1); }
.form-card > p { margin: 0 0 .55rem; font-size: .88rem; color: var(--wv-text); line-height: 1.5; }
.form-card > p strong { color: var(--wv-text-3); font-weight: 500; margin-right: .3rem; }
.form-card h2 {
    font-family: var(--wv-font-body); font-weight: 600; font-size: 12px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--wv-muted); margin: 1.5rem 0 .9rem; padding-top: 1.4rem;
    border-top: 1px solid var(--wv-border-2);
}
.form-card > h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* Título grande de sección (serif) — para el título de la tab activa, no para
   sub-encabezados dentro de una tarjeta (esos usan form-card h2, arriba). */
.section-title {
    font-family: var(--wv-font-serif); font-weight: 700; font-size: 20px; color: var(--wv-text); margin: 0;
}
.form-card ul { padding-left: 1.2rem; margin: 0 0 1rem; font-size: .88rem; color: var(--wv-text); }
.form-card ul li { margin-bottom: .3rem; }

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 20px; }
.field {
    display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 6px 10px 6px 11px;
    border-left: 2px solid var(--wv-accent-soft); border-radius: 0 8px 8px 0;
    transition: background .15s ease, border-left-color .15s ease;
}
.field:hover { background: var(--wv-surface-2); border-left-color: var(--wv-accent); }
/* Sin ancestro .field a propósito: "Descripción" en el detalle de
   expediente reutiliza esta etiqueta fuera de un .field (bloque a ancho
   completo, no un par dt/dd de la cuadrícula) — con el selector .field
   .field-label no le llegaba ningún estilo y se veía con el tamaño por
   default del navegador, más grande que las demás etiquetas del bloque. */
.field-label { font-size: 12px; color: var(--wv-muted-2); }
/* overflow-wrap:break-word (no word-break:break-word, que partía
   "Juzgado"/nombres de contraparte a media palabra con tal de no
   desbordar): con punto de corte en espacios normales + <wbr> explícito
   después de "@" y "." en correos (ver $legalCase->client->email en
   livewire/admin/cases/show.blade.php), nunca hace falta partir una
   palabra real a la mitad. */
.field .field-value { font-size: 13px; color: var(--wv-text); overflow-wrap: break-word; }
/* .field reutilizado sobre <dt>/<dd> (en vez de <span>/<span>) en el detalle
   del expediente del cliente — <dd> trae margin-inline-start:40px por
   default del navegador, que rompe el layout en columna de .field. */
.field dt, .field dd { margin: 0; }

/* .field-grid.is-compact — Pulido visual Bloque 3 (Datos generales del
   expediente): mismos 12px de .field-label (ya en el piso, no se baja
   más) y .field-value pasa de 13px a 12px; lo que de verdad se aprieta es
   el espacio alrededor (gap, padding), no el texto. minmax baja de 160px
   a 150px nada más — valores largos (correo, juzgado) siguen envolviendo
   por overflow-wrap en vez de recortarse, igual que en .field-grid normal. */
.field-grid.is-compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.field-grid.is-compact .field { padding: 3px 8px 3px 9px; gap: 1px; }
.field-grid.is-compact .field-value { font-size: 12px; }

/* Solo 3 columnas simples (nombre + 2 casillas) — no necesita el
   min-width:640px genérico de .data-table, que era justo lo que obligaba
   a todo el modal a desplazarse horizontalmente (con flechas nativas
   feas) en vez de caber en el recuadro. */
.lawyer-assignment-table { margin-bottom: .5rem; min-width: 420px; }
.lawyer-assignment-table th:not(:first-child), .lawyer-assignment-table td:not(:first-child) { text-align: center; }
.lawyer-assignment-table input[type=checkbox], .lawyer-assignment-table input[type=radio] { width: auto; margin: 0; accent-color: var(--wv-accent); }
.lawyer-assignment-table input[type=radio]:disabled { opacity: .35; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* KPIs / tarjetas de estadística                                          */
/* ---------------------------------------------------------------------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin-bottom: 1.25rem; }
.stat-card {
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: var(--wv-radius);
    padding: 1rem 1.3rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0;
    border-top: 3px solid var(--wv-accent);
    transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(28,41,53,.12); }
.stat-card .stat-label:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card .stat-number { font-size: 1.7rem; font-weight: 600; color: var(--wv-text); font-variant-numeric: tabular-nums; }
.stat-card .stat-label { font-size: .76rem; letter-spacing: .03em; color: var(--wv-muted-2); }

/* ---------------------------------------------------------------------- */
/* Checklist con barra de progreso                                         */
/* ---------------------------------------------------------------------- */

.checklist-progress { height: 6px; border-radius: 999px; background: var(--wv-border-2); overflow: hidden; margin: .75rem 0; }
.checklist-progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--wv-accent), #74a1bc); transition: width .4s ease; }

/* ---------------------------------------------------------------------- */
/* Tabs (vista de expediente)                                              */
/* ---------------------------------------------------------------------- */

.case-detail { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.case-tabs-aside {
    flex: 1 1 220px; max-width: 262px; min-width: 210px; background: var(--wv-surface);
    border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card); overflow: hidden;
}
.case-tabs-aside-header { padding: 15px 18px; border-bottom: 1px solid var(--wv-border-2); display: flex; flex-direction: column; gap: 7px; }
.case-tabs-aside-header .folio { font-family: var(--wv-font-serif); font-size: 22px; line-height: 1.1; color: var(--wv-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.case-tabs-list { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.case-tab {
    display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
    color: var(--wv-text-3); cursor: pointer; font-size: 13px; background: transparent; border: none;
    font-family: inherit; width: 100%; text-align: left;
}
.case-tab:hover { background: var(--wv-border-3); color: var(--wv-text); }
.case-tab.is-active { background: var(--wv-accent-soft); color: var(--wv-accent-text); font-weight: 600; box-shadow: inset 3px 0 0 var(--wv-accent); }
.case-tabs-aside-section { padding: 14px 18px; border-top: 1px solid var(--wv-border-2); display: flex; flex-direction: column; gap: 4px; }
.case-tabs-aside-section .label { font-size: 12px; color: var(--wv-muted-2); }
.case-tabs-aside-section .value { font-size: 12.5px; }
.case-detail-main { flex: 1 1 300px; min-width: 0; }
.case-detail-main .form-card:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------- */
/* Pantalla de Reportes: aviso de permiso + sidebar de tarjetas + panel    */
/* ---------------------------------------------------------------------- */
.reports-banner {
    display: flex; align-items: center; gap: 10px; background: var(--wv-accent-soft);
    color: var(--wv-accent-text); border: 1px solid var(--wv-accent-soft-border); border-radius: var(--wv-radius);
    padding: .75rem 1.1rem; font-size: .85rem; font-weight: 500; margin-bottom: 20px;
}
.reports-banner svg { flex: 0 0 auto; }

.reports-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .reports-layout { grid-template-columns: 1fr; } }

.reports-nav { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.report-nav-card {
    display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%;
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card);
    padding: 14px 16px; cursor: pointer; font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.report-nav-card:hover { border-color: var(--wv-accent-soft-border); box-shadow: 0 6px 14px rgba(28,41,53,.07); }
.report-nav-icon {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: var(--wv-accent-soft); color: var(--wv-accent-text); transition: background .15s ease, color .15s ease;
}
.report-nav-body { min-width: 0; }
.report-nav-num {
    display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--wv-muted-2); margin-bottom: 2px;
}
.report-nav-title { display: block; font-size: .9rem; font-weight: 700; color: var(--wv-text); margin-bottom: 3px; }
.report-nav-desc { display: block; font-size: .78rem; color: var(--wv-muted-2); line-height: 1.35; }
.report-nav-card.is-active { background: var(--wv-sidebar); border-color: var(--wv-sidebar); }
.report-nav-card.is-active .report-nav-icon { background: rgba(255,255,255,.14); color: #fff; }
.report-nav-card.is-active .report-nav-num { color: var(--wv-sidebar-text-mute); }
.report-nav-card.is-active .report-nav-title { color: #fff; }
.report-nav-card.is-active .report-nav-desc { color: var(--wv-sidebar-text-dim); }

.reports-recent-title {
    font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--wv-muted);
    margin: 0 0 10px 4px;
}
.reports-recent-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--wv-radius-sm); transition: background .14s ease; }
.reports-recent-item:hover { background: var(--wv-surface-2); }
.reports-recent-badge {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--wv-danger-bg); color: var(--wv-danger-fg); font-size: .6rem; font-weight: 800; letter-spacing: .02em;
}
.reports-recent-body { min-width: 0; flex: 1 1 auto; }
.reports-recent-name { display: block; font-size: .8rem; font-weight: 600; color: var(--wv-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reports-recent-meta { display: block; font-size: .72rem; color: var(--wv-muted-2); }
.reports-recent-download {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px; border: none; background: transparent;
    color: var(--wv-muted); display: grid; place-items: center; cursor: pointer; transition: background .14s ease, color .14s ease;
}
.reports-recent-download:hover { background: var(--wv-accent-soft); color: var(--wv-accent-text); }

.reports-detail-card {
    background: linear-gradient(165deg, rgba(207,222,232,.85), rgba(165,194,212,.6));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55); border-radius: var(--wv-radius-card);
    padding: 20px 22px; margin-bottom: 16px;
}
.reports-detail-kicker {
    display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--wv-accent-text); margin-bottom: 4px;
}
.reports-detail-title { margin: 0 0 18px; font-family: var(--wv-font-serif); font-size: 1.3rem; font-weight: 700; color: var(--wv-text); }

.reports-filter-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
/* flex-direction:column aquí es solo para apilar "etiqueta encima del
   control" — PERO .nice-select/.nice-date traen su propio flex-basis
   pensado para un padre EN FILA (.filter-bar, .dashboard-filters), donde
   ese flex-basis fija el ANCHO; dentro de este contenedor EN COLUMNA el eje
   principal es vertical, así que ese mismo flex-basis terminaba fijando el
   ALTO (¡un <select> de 220px de alto!). flex:none en el hijo anula ese
   flex-basis heredado de su propio contexto, sin tocar nice-select/nice-date
   en ningún otro lugar donde sí viven dentro de una fila. */
.reports-field-group { display: flex; flex-direction: column; gap: 7px; }
.reports-field-group > .nice-select, .reports-field-group > .nice-date { flex: none; }
/* Desde/Hasta no necesitan los 150px de ancho mínimo que .nice-date trae
   por defecto (pensado para contextos más sueltos) — con esto "Periodo +
   Desde + Hasta" caben en la misma fila en más anchos de pantalla antes de
   que "Hasta" se baje de línea. */
.reports-field-group > .nice-date { min-width: 120px; }
.reports-field-group.is-grow { flex: 1 1 auto; min-width: 220px; }
.reports-field-label { font-size: .78rem; font-weight: 700; color: var(--wv-text-2); }
/* El segmentado de "Periodo" (4 opciones) es, con diferencia, lo más ancho
   de la fila — un poco menos de relleno horizontal libera el espacio que le
   falta a "Hasta" para quedar en la misma línea, sin tocar .segmented-toggle
   en los otros lugares donde se usa (Dashboard, Agenda). */
.reports-filter-row .segmented-toggle button { padding: 8px 9px; font-size: 12px; }

.reports-cutoff-chip {
    display: inline-flex; align-items: center; gap: 8px; height: 2.35rem; padding: 0 14px;
    background: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.8); border-radius: var(--wv-radius);
    font-size: .85rem; color: var(--wv-text-2); white-space: nowrap;
}
.reports-cutoff-chip svg { color: var(--wv-accent-text); flex: 0 0 auto; }

.reports-include-row { display: flex; gap: 8px; flex-wrap: wrap; }
/* Seleccionado vs excluido tenían casi el mismo aspecto (ambos pills claros,
   solo cambiaba la opacidad) — por eso, aunque el filtro sí funcionaba, se
   veía más como una leyenda decorativa que como botones. Ahora "seleccionado"
   es un pill blanco sólido con anillo del color del punto, y "excluido" se
   ve claramente apagado (punto y texto en gris, tachado). */
.reports-include-chip {
    display: inline-flex; align-items: center; gap: 7px; height: 2.1rem; padding: 0 13px;
    border-radius: 999px; border: 1px solid rgba(255,255,255,.75); background: rgba(255,255,255,.55);
    font-family: inherit; font-size: .82rem; font-weight: 600; color: var(--wv-text-2); cursor: pointer;
    transition: opacity .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.reports-include-chip:not(.is-off) {
    background: var(--wv-surface); border-color: var(--wv-chip-color, var(--wv-accent-soft-border));
    box-shadow: 0 0 0 1px var(--wv-chip-color, var(--wv-accent-soft-border)) inset;
    color: var(--wv-text);
}
.reports-include-chip:hover { background: rgba(255,255,255,.85); }
.reports-include-chip.is-off { background: rgba(255,255,255,.35); border-color: transparent; color: var(--wv-muted-2); font-weight: 500; text-decoration: line-through; }
.reports-include-chip.is-off .dot { background: var(--wv-muted-3) !important; }
.reports-include-chip .dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }

.reports-detail-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding-top: 14px; margin-top: 2px; border-top: 1px solid rgba(255,255,255,.55);
}
.reports-detail-footer-text { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--wv-text-2); }
.reports-detail-footer-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.reports-preview-card { background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card); overflow: hidden; }
.reports-preview-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px;
    border-bottom: 1px solid var(--wv-border-2); background: var(--wv-surface-2);
}
.reports-preview-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wv-muted); }
.reports-preview-meta { font-size: .78rem; color: var(--wv-muted-2); }
.reports-preview-group { padding: 16px 20px; border-bottom: 1px solid var(--wv-border-2); }
.reports-preview-group:last-child { border-bottom: none; }
.reports-preview-group-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.reports-preview-group-title { font-size: .92rem; font-weight: 700; color: var(--wv-text); }
.reports-preview-group-count { font-size: .76rem; color: var(--wv-muted-2); }
.reports-preview-empty { padding: 28px 20px; text-align: center; }

/* ---------------------------------------------------------------------- */
/* Agenda (calendario mensual)                                             */
/* ---------------------------------------------------------------------- */

.agenda-layout { display: flex; gap: 16px; align-items: flex-start; }
.agenda-aside {
    flex: 1 1 260px; max-width: 300px; min-width: 260px;
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card);
    padding: 18px;
}
.agenda-mini-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.agenda-nav-btn {
    width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--wv-border); background: var(--wv-surface);
    display: grid; place-items: center; cursor: pointer; color: var(--wv-text-3); transition: border-color .16s ease;
}
.agenda-nav-btn:hover { border-color: var(--wv-accent-soft-border); }
.agenda-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.agenda-mini-weekday { font-size: 10px; color: var(--wv-muted-2); padding: 4px 0; }
.agenda-mini-day {
    position: relative; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 12px; color: var(--wv-text-2);
    border: none; background: transparent; padding: 0; width: 100%; font-family: inherit; cursor: pointer;
}
/* --wv-muted-2 (no muted-3): son <button> interactivos, no exentos del
   3:1/4.5:1 por ser "decorativos" — y un fondo tenue como segunda señal,
   para no depender solo del color para distinguir "otro mes". */
.agenda-mini-day.is-out { color: var(--wv-muted-2); background: var(--wv-border-3); }
.agenda-mini-day.is-today { background: var(--wv-sidebar); color: #fff; font-weight: 700; }
.agenda-mini-day .dot { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 999px; background: var(--wv-accent); }
.agenda-mini-day.is-today .dot { background: #fff; }

.agenda-upcoming-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--wv-muted); margin: 22px 0 4px; }
.agenda-upcoming-item { display: flex; flex-direction: column; gap: 3px; padding: 9px 0; border-bottom: 1px solid var(--wv-border-3); text-decoration: none; color: inherit; }
.agenda-upcoming-item:last-child { border-bottom: none; }
.agenda-upcoming-item:hover { text-decoration: none; }
.agenda-upcoming-item:hover .agenda-upcoming-title { color: var(--wv-accent-text); }
.agenda-upcoming-title { font-size: 12.5px; font-weight: 500; color: var(--wv-text); display: flex; align-items: center; gap: 7px; transition: color .14s ease; }
.agenda-upcoming-meta { font-size: 11px; color: var(--wv-muted-2); padding-left: 14px; }

.agenda-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.agenda-view-toggle { display: flex; gap: 2px; background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: var(--wv-radius); padding: 3px; }
.agenda-view-toggle button { border: none; background: transparent; padding: 7px 13px; border-radius: 8px; font-family: inherit; font-size: 12.5px; color: var(--wv-text-3); cursor: pointer; transition: background .16s ease, color .16s ease; }
.agenda-view-toggle button.is-active { background: var(--wv-sidebar); color: #fff; font-weight: 600; }
.agenda-month-nav { display: flex; align-items: center; gap: 8px; }
.agenda-month-title { font-family: var(--wv-font-serif); font-size: 20px; color: var(--wv-text); font-weight: 700; white-space: nowrap; }
.agenda-month-count { font-size: 12px; color: var(--wv-muted); white-space: nowrap; }

.agenda-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--wv-border); border-radius: var(--wv-radius-card); overflow: hidden; background: var(--wv-surface); min-width: 760px; }
.agenda-grid-header { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wv-muted); background: var(--wv-surface-2); padding: 9px 12px; border-bottom: 1px solid var(--wv-border-2); }
.agenda-day { min-height: 112px; padding: 8px; border-right: 1px solid var(--wv-border-3); border-bottom: 1px solid var(--wv-border-3); display: flex; flex-direction: column; gap: 4px; transition: background .16s ease; }
.agenda-grid-month .agenda-day { max-height: 112px; overflow: hidden; }
.agenda-day:hover { background: var(--wv-surface-2); }
.agenda-day:nth-child(7n) { border-right: none; }
.agenda-day.is-out { background: var(--wv-surface-2); }
.agenda-day-number { font-size: 12px; color: var(--wv-text-2); }
/* --wv-muted-2 (no muted-3): mismo criterio que .agenda-mini-day.is-out.
   La señal no-color ya existe un nivel arriba (.agenda-day.is-out tiene su
   propio fondo, línea de arriba), así que aquí solo hace falta el color. */
.agenda-day.is-out .agenda-day-number { color: var(--wv-muted-2); }
.agenda-day.is-today .agenda-day-number { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 999px; background: var(--wv-sidebar); color: #fff; font-weight: 700; }
.agenda-chip {
    display: block; padding: 3px 7px; border-radius: 7px; font-size: 11px; line-height: 1.35;
    text-decoration: none; overflow: hidden;
    transition: transform .14s ease, box-shadow .14s ease;
}
.agenda-chip:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(28, 41, 53, .14); text-decoration: none; }
.agenda-chip .chip-time { font-weight: 600; margin-right: 3px; }
.agenda-chip-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-chip-meta { display: block; font-size: 9.5px; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-chip-more { font-size: 10.5px; color: var(--wv-muted-2); padding-left: 7px; }

.agenda-grid-scroll { overflow-x: auto; }

/* ---------------------------------------------------------------------- */
/* input-icon-wrap / toggle-visibility genéricos                           */
/* ---------------------------------------------------------------------- */

/* Versión no ligada a .guest-card: el botón de mostrar/ocultar contraseña
   del login se reutiliza también en el formulario de alta/edición de
   usuario (dentro de .modal-content), que ya define su propio ancho/alto
   de input vía otra regla — solo se añade el hueco para el botón. */
.input-icon-wrap { position: relative; }
.input-icon-wrap input[type=password] { padding-right: 2.5rem; }
.input-icon-wrap .toggle-visibility {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 8px;
    border: none; background: transparent; color: var(--wv-muted-2); cursor: pointer; display: grid; place-items: center;
}
.input-icon-wrap .toggle-visibility:hover { background: var(--wv-border-3); color: var(--wv-text-2); }

/* ---------------------------------------------------------------------- */
/* Login                                                                    */
/* ---------------------------------------------------------------------- */

.guest-card h1 { font-family: var(--wv-font-serif); font-weight: 700; font-size: 1.4rem; color: var(--wv-text); margin: 0 0 .2rem; }
.guest-card .subtitle { font-size: .85rem; color: var(--wv-muted); margin: 0 0 .8rem; }
.guest-card label { display: block; font-size: .82rem; font-weight: 500; color: var(--wv-text-3); margin-bottom: .3rem; }
.guest-card .input-icon-wrap { position: relative; margin-bottom: .8rem; }
.guest-card .input-icon-wrap svg.leading-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--wv-muted-2); pointer-events: none; }
.guest-card input[type=email], .guest-card input[type=password], .guest-card input[type=text] {
    width: 100%; height: 46px; padding: 0 14px 0 40px; border: 1px solid var(--wv-border-input); border-radius: var(--wv-radius);
    background: var(--wv-surface-2); font-family: inherit; font-size: .92rem; color: var(--wv-text); box-sizing: border-box;
}
.guest-card input:focus { outline: none; border-color: var(--wv-accent); background: var(--wv-surface); }
.guest-card .toggle-visibility {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 8px;
    border: none; background: transparent; color: var(--wv-muted-2); cursor: pointer; display: grid; place-items: center;
}
.guest-card .toggle-visibility:hover { background: var(--wv-border-3); color: var(--wv-text-2); }
.guest-card .remember { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -.2rem 0 .8rem; font-size: .82rem; flex-wrap: wrap; }
.guest-card .remember label { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 400; color: var(--wv-text-3); margin: 0; }
.guest-card .remember input[type=checkbox] { width: auto; accent-color: var(--wv-accent); }
/* Sin ícono antes del texto (a diferencia de otros submit del sistema que
   combinan ícono+texto y dependen de justify-content:flex-start heredado
   con gap) — sin esto el texto quedaba pegado a la izquierda del botón. */
.guest-card button[type=submit] { width: 100%; height: 46px; font-size: .92rem; justify-content: center; }

/* ---------------------------------------------------------------------- */
/* Varios (checkbox, notas, ayuda, errores)                                */
/* ---------------------------------------------------------------------- */

.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--wv-text-3); margin-bottom: 1rem; }
.checkbox-label input[type=checkbox], .checkbox-label input[type=radio] { width: auto; margin: 0; accent-color: var(--wv-accent); }

.note-item { border-bottom: 1px solid var(--wv-border-3); padding: .85rem 0; }
.note-item:last-child { border-bottom: none; }
.note-meta { display: flex; align-items: center; gap: .6rem; font-size: .78rem; color: var(--wv-muted); margin-bottom: .35rem; flex-wrap: wrap; }
.note-meta strong { color: var(--wv-text); font-weight: 600; }
.note-meta button { margin-left: auto; }
.note-body { margin: 0; white-space: pre-wrap; font-size: .88rem; color: var(--wv-text); line-height: 1.5; }

.help-text { font-size: .8rem; color: var(--wv-muted); margin: -.3rem 0 .9rem; }

.error { color: #b3452f; font-size: .78rem; margin: -.7rem 0 .9rem; }

/* ---------------------------------------------------------------------- */
/* Dashboard — "Panorama del despacho" (Waves Shell Base 7)                */
/* ---------------------------------------------------------------------- */

.dashboard-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap;
    margin-top: 2px; margin-bottom: 20px;
}
.dashboard-header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }

/* Selector de pestaña (Expedientes / Usuarios y reportes) y de periodo:
   mismo control segmentado, solo cambia si lleva ícono. */
.segmented-toggle { display: flex; align-items: center; background: var(--wv-surface-2); border: 1px solid var(--wv-border); border-radius: 999px; padding: 3px; }
.segmented-toggle button {
    display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent;
    padding: 8px 16px; border-radius: 999px; font-family: inherit; font-size: 12.5px; font-weight: 600;
    color: var(--wv-muted); cursor: pointer; white-space: nowrap; transition: background .18s ease, color .18s ease;
}
.segmented-toggle button.is-active { background: var(--wv-sidebar); color: #fff; }
.segmented-toggle button:not(.is-active):hover { color: var(--wv-text-2); }
.segmented-toggle.segmented-toggle-period button.is-active { background: var(--wv-accent-text); }

.btn-dark {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; gap: 8px; background: var(--wv-sidebar); color: #fff;
    border: none; border-radius: var(--wv-radius); padding: 10px 18px; font-size: 13px; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: background .18s ease, transform .15s cubic-bezier(.34,1.4,.64,1);
}
.btn-dark:hover { background: var(--wv-sidebar-hover); color: #fff; text-decoration: none; transform: scale(1.015); }
.btn-dark:active { transform: scale(.97); }

/* Transición al alternar de pestaña */
.dashboard-tab-panel { animation: wv-fade-up .35s ease both; }
@keyframes wv-fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* KPI cards */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card {
    background: linear-gradient(165deg, rgba(207,222,232,.8), rgba(165,194,212,.55));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55); border-radius: var(--wv-radius-card);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(28,41,53,.1); }
.kpi-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-card-head span:first-child { font-size: 13px; color: var(--wv-text-2); font-weight: 500; }
.kpi-icon {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.6);
    display: grid; place-items: center; color: var(--wv-accent-text);
}
.kpi-card-body { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.kpi-number { font-family: var(--wv-font-serif); font-size: 2rem; font-weight: 700; color: var(--wv-text); line-height: 1; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--wv-muted); width: fit-content; text-align: right; }
.kpi-delta.is-up { color: var(--wv-accent-text); }

/* .kpi-row.is-compact — Pulido visual Bloque 4 (dashboard del cliente,
   design-system/waves/pages/portal-cliente.md: "evitar tarjetas grandes
   con poco contenido"). .kpi-card normal está pensado para los
   dashboards internos, con gráficas/filtros al lado — aquí es solo un
   número de 1-2 dígitos, así que el número baja de 2rem a 1.5rem y el
   padding se aprieta; el texto no baja de 12px (.kpi-card-head/.kpi-delta
   ya estaban ahí). No toca .kpi-card a secas, usado tal cual en los 3
   dashboards internos. */
.kpi-row.is-compact { gap: 12px; margin-bottom: 16px; }
.kpi-row.is-compact .kpi-card { padding: 12px 14px; gap: 6px; }
.kpi-row.is-compact .kpi-icon { width: 24px; height: 24px; }
.kpi-row.is-compact .kpi-number { font-size: 1.5rem; }

/* ---------------------------------------------------------------------- */
/* Línea de tiempo del expediente (dashboard del cliente) — Pulido visual */
/* Bloque 4. Vertical (no horizontal) dentro de cada paso: "Procedimiento */
/* resuelto y/o en etapa de ejecución" no cabe en una columna angosta sin */
/* envolver en varias líneas desalineadas entre pasos de distinta altura. */
/* Con 2+ expedientes activos, las tarjetas van en 2 columnas a partir de */
/* 900px (el nombre más largo cabe en ~490px); con 1 solo expediente, la  */
/* tarjeta ocupa el ancho completo y sus pasos se reparten en 2 columnas  */
/* internas (.case-timeline.is-grid) para no alargar la tarjeta. Cada     */
/* paso lleva símbolo Y texto ("Completado"/"Estado actual"/"Pendiente")  */
/* — nunca solo color — y el <li> actual lleva aria-current="step" (ver   */
/* la vista).                                                              */
/* ---------------------------------------------------------------------- */
.case-timeline-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.case-timeline-group.is-single { grid-template-columns: 1fr; }
@media (max-width: 900px) {
    .case-timeline-group { grid-template-columns: 1fr; }
}
.case-timeline-card { padding: 14px 16px; border: 1px solid var(--wv-border-2); border-radius: var(--wv-radius); }
.case-timeline-card-head {
    display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
    margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--wv-border-2);
}
.case-timeline-card-head strong { font-size: 14px; color: var(--wv-text); margin-right: 8px; }
.case-timeline-lawyer { font-size: 12.5px; color: var(--wv-muted-2); white-space: nowrap; }
.case-timeline { list-style: none; margin: 0; padding: 0; }
.case-timeline-step { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.case-timeline-step:last-child { padding-bottom: 0; }
.case-timeline-dot {
    position: relative; flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; border-radius: 999px;
    display: grid; place-items: center; background: var(--wv-surface); border: 2px solid var(--wv-border-input);
    color: var(--wv-muted-2); z-index: 1;
}
.case-timeline-step:not(:last-child) .case-timeline-dot::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    width: 2px; height: 16px; background: var(--wv-border-input);
}
.case-timeline-step-completado .case-timeline-dot { background: var(--wv-accent); border-color: var(--wv-accent); color: #fff; }
.case-timeline-step-completado:not(:last-child) .case-timeline-dot::after { background: var(--wv-accent); }
.case-timeline-step-actual .case-timeline-dot { border-color: var(--wv-accent); box-shadow: 0 0 0 3px var(--wv-accent-soft); }
.case-timeline-dot-current { width: 8px; height: 8px; border-radius: 999px; background: var(--wv-accent); }
.case-timeline-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.case-timeline-name { font-size: 13px; color: var(--wv-text-2); }
.case-timeline-step-actual .case-timeline-name { font-weight: 700; color: var(--wv-text); }
.case-timeline-state-text { font-size: 11.5px; color: var(--wv-muted-2); }
.case-timeline-step-actual .case-timeline-state-text { color: var(--wv-accent-text); font-weight: 600; }

/* .case-timeline.is-grid: pasos en 2 columnas internas, solo cuando hay   */
/* un único expediente activo (tarjeta a ancho completo). Asume el        */
/* catálogo fijo de 6 estados (ver design-system/waves/MASTER.md) para    */
/* repartir 3 pasos por columna y cortar la línea conectora al final de   */
/* cada columna (pasos 3 y 6, no solo el último del DOM).                 */
.case-timeline.is-grid {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, auto);
    grid-auto-flow: column; column-gap: 32px; row-gap: 0;
}
.case-timeline.is-grid .case-timeline-step:nth-child(3) .case-timeline-dot::after,
.case-timeline.is-grid .case-timeline-step:nth-child(6) .case-timeline-dot::after {
    display: none;
}
@media (max-width: 900px) {
    .case-timeline.is-grid { display: block; }
    .case-timeline.is-grid .case-timeline-step:nth-child(3) .case-timeline-dot::after {
        display: block;
    }
}

/* Filtros del panel — envueltos en una tarjeta de vidrio, igual que las
   demás tarjetas del dashboard (antes flotaban sueltas sobre el fondo). */
/* --wv-muted (no muted-2): el fondo "vidrio" de esta tarjeta es más oscuro
   que --wv-surface-2, mismo caso que .chart-panel-title/.panel-card-title. */
.dashboard-filters-card .filter-bar label { color: var(--wv-muted); }
.dashboard-filters-card {
    /* position+z-index explícitos a propósito: backdrop-filter ya crea su
       propio contexto de apilamiento, así que sin esto el z-index del
       panel del nice-select queda atrapado dentro de esta tarjeta y las
       tarjetas KPI de abajo (que también tienen backdrop-filter) ganan la
       pelea de stacking por venir después en el DOM — interceptando los
       clics del dropdown abierto aunque visualmente se vea "encima".     */
    position: relative; z-index: 25;
    background: linear-gradient(165deg, rgba(207,222,232,.75), rgba(165,194,212,.55));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55); border-radius: var(--wv-radius-card);
    padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.dashboard-filters-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(28,41,53,.1); }
.dashboard-filters { align-items: center; margin-bottom: 0; }
.filter-active-badge {
    display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.7);
    border-radius: 999px; padding: 0 13px; height: 2.35rem; font-size: 12px; color: var(--wv-text-2); white-space: nowrap;
    flex: 0 0 auto;
}
.filter-active-badge strong { color: var(--wv-accent-text); }

.filter-clear-btn {
    display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
    background: var(--wv-sidebar); color: #fff; border: none; border-radius: 999px;
    height: 2.35rem; padding: 0 15px; font-family: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background .18s ease, transform .15s ease;
}
.filter-clear-btn:hover { background: var(--wv-sidebar-hover); transform: translateY(-1px); }
.filter-clear-btn svg { transition: transform .4s ease; }
.filter-clear-btn:hover svg { transform: rotate(-90deg); }

.dashboard-filters-search {
    display: flex; align-items: center; gap: 9px; flex: 1 1 200px; min-width: 180px;
    background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.7); border-radius: var(--wv-radius);
    padding: 0 14px; height: 2.35rem;
}
/* El <input> interno quita su propio outline (ver regla de abajo); sin esto
   no queda ningún indicador de foco visible al tabular hasta el buscador. */
.dashboard-filters-search:focus-within { border-color: var(--wv-accent); box-shadow: 0 0 0 2px var(--wv-accent-soft); }
.dashboard-filters-search input {
    border: none; background: transparent; outline: none; font-family: inherit;
    font-size: .82rem; color: var(--wv-text); flex: 1 1 auto; min-width: 0; padding: 0; height: 100%;
}
.dashboard-filters-search input::placeholder { color: var(--wv-muted); }

/* Dropdown personalizado (reemplaza los <select> nativos, cuyo panel
   desplegable el navegador no deja redondear ni estilizar). flex-grow:0 (no
   1): con varios de estos en una sola .filter-bar que se envuelve en
   flex-wrap, uno que cae solo en su propia línea se estiraba a lo ancho de
   toda la fila — solo .nice-select dentro de un .modal-content/.form-card
   (un solo campo por línea, ver más abajo) sí debe ocupar el 100%. */
.nice-select { position: relative; flex: 0 1 220px; min-width: 160px; }
.nice-select-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    height: 2.35rem; padding: 0 14px; border-radius: var(--wv-radius); border: 1px solid rgba(255,255,255,.7);
    background: rgba(255,255,255,.6); font-family: inherit; font-size: .82rem; color: var(--wv-text);
    cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease;
}
.nice-select-trigger span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nice-select-trigger:hover { background: rgba(255,255,255,.8); }
.nice-select.is-open .nice-select-trigger { border-color: var(--wv-accent); background: var(--wv-surface); }
.nice-select-chevron { display: inline-flex; color: var(--wv-muted); flex: 0 0 auto; transition: transform .2s ease; }
.nice-select-chevron.is-rotated { transform: rotate(180deg); }
/* El borde blanco translúcido de .nice-select-trigger está pensado para
   flotar sobre el fondo azul "vidrio" de la página/dashboard — dentro de un
   modal, un formulario de página (.form-card) o un filtro ya metido en una
   tarjeta blanca (.list-card) ese borde quedaba invisible, mismo cuidado
   que ya tiene .list-card-filters.filter-bar para los <select> nativos. */
.modal-content .nice-select, .form-card .nice-select { width: 100%; margin-bottom: 1rem; }
.modal-content .nice-select-trigger, .form-card .nice-select-trigger, .list-card .nice-select-trigger {
    border-color: var(--wv-border-input); background: var(--wv-surface);
}
.modal-content .nice-select-trigger:hover, .form-card .nice-select-trigger:hover, .list-card .nice-select-trigger:hover { border-color: var(--wv-accent-soft-border); }

/* top/left los pone Alpine Anchor (x-anchor) en tiempo real a partir del
   disparador — el panel ya no se teletransporta a <body>, vive dentro de
   .nice-select (position:relative, ver arriba), así que width:100% calza
   exacto con el ancho del botón disparador sin necesidad de JS. z-index
   alto para ganarle a .modal-content/.modal-backdrop cuando el selector
   está dentro de un modal. */
.nice-select-panel {
    position: absolute; z-index: 200; width: 100%;
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: 14px;
    box-shadow: 0 14px 32px rgba(28,41,53,.16); padding: 6px; max-height: 280px; overflow-y: auto;
}
.nice-select-option {
    display: block; width: 100%; text-align: left; background: transparent; border: none;
    border-radius: 9px; padding: 8px 12px; font-family: inherit; font-size: .82rem; color: var(--wv-text-2);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background .12s ease, color .12s ease;
}
.nice-select-option:hover { background: var(--wv-accent-soft); color: var(--wv-accent-text); }
.nice-select-option.is-selected { background: var(--wv-accent); color: #fff; font-weight: 600; }

/* ---------------------------------------------------------------------- */
/* Selector de fecha personalizado (reemplaza <input type="date">, cuyo    */
/* calendario desplegable es del navegador/SO y el CSS no puede alcanzar  */
/* — mismo motivo y mismo patrón visual que .nice-select con los <select>.*/
/* ---------------------------------------------------------------------- */
.nice-date { position: relative; flex: 0 1 180px; min-width: 150px; }
.nice-date-trigger {
    display: flex; align-items: center; gap: 8px; width: 100%;
    height: 2.35rem; padding: 0 14px; border-radius: var(--wv-radius); border: 1px solid rgba(255,255,255,.7);
    background: rgba(255,255,255,.6); font-family: inherit; font-size: .82rem; color: var(--wv-text);
    cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease;
}
.nice-date-trigger svg { color: var(--wv-muted); flex: 0 0 auto; }
.nice-date-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nice-date-trigger:hover { background: rgba(255,255,255,.8); }
.nice-date.is-open .nice-date-trigger { border-color: var(--wv-accent); background: var(--wv-surface); }
.modal-content .nice-date, .form-card .nice-date { width: 100%; margin-bottom: 1rem; }
.modal-content .nice-date-trigger, .form-card .nice-date-trigger, .list-card .nice-date-trigger {
    border-color: var(--wv-border); background: var(--wv-surface);
}
.modal-content .nice-date-trigger:hover, .form-card .nice-date-trigger:hover, .list-card .nice-date-trigger:hover { border-color: var(--wv-accent-soft-border); }

/* top/left los pone Alpine Anchor (x-anchor), igual que .nice-select-panel
   — ver su propio comentario. */
.nice-date-panel {
    position: absolute; z-index: 200; width: 262px;
    background: var(--wv-surface); border: 1px solid var(--wv-border); border-radius: 14px;
    box-shadow: 0 14px 32px rgba(28,41,53,.16); padding: 12px;
}
.nice-date-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nice-date-month-label { font-size: .84rem; font-weight: 600; color: var(--wv-text); }
.nice-date-nav {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; border: none;
    background: transparent; color: var(--wv-muted); cursor: pointer; transition: background .14s ease, color .14s ease;
}
.nice-date-nav:hover { background: var(--wv-accent-soft); color: var(--wv-accent-text); }
.nice-date-weekdays, .nice-date-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.nice-date-weekdays span {
    text-align: center; font-size: .66rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
    color: var(--wv-muted-2); padding: 4px 0;
}
.nice-date-day {
    aspect-ratio: 1; width: 100%; border: none; background: transparent; border-radius: 999px;
    font-family: inherit; font-size: .78rem; color: var(--wv-text-2); cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.nice-date-day:hover { background: var(--wv-accent-soft); color: var(--wv-accent-text); }
.nice-date-day.is-muted { color: var(--wv-muted-3); }
.nice-date-day.is-today { box-shadow: inset 0 0 0 1px var(--wv-accent); font-weight: 600; }
.nice-date-day.is-selected { background: var(--wv-accent); color: #fff; font-weight: 600; }
.nice-date-panel-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px;
    padding-top: 10px; border-top: 1px solid var(--wv-border-2);
}
.nice-date-link {
    background: none; border: none; padding: 2px; font-family: inherit; font-size: .78rem; font-weight: 600;
    color: var(--wv-accent-text); cursor: pointer;
}
.nice-date-link:hover { text-decoration: underline; }

/* Gráficas grandes: evolución de la cartera / audiencias por semana */
.dashboard-charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 20px; align-items: stretch; }
.chart-panel {
    background: linear-gradient(165deg, rgba(207,222,232,.8), rgba(165,194,212,.55));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55); border-radius: 20px; padding: 20px 22px;
    display: flex; flex-direction: column; gap: 18px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.chart-panel:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(28,41,53,.1); }
.chart-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* --wv-muted en vez de --wv-muted-2: .chart-panel tiene fondo "vidrio"
   (gradiente translúcido) más oscuro que --wv-surface-2, donde muted-2 no
   alcanza 4.5:1 (ver comentario en .panel-card.panel-card-solid). */
.chart-panel-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wv-muted); }
.chart-panel-meta { font-size: 12px; color: var(--wv-muted); }
.chart-legend { display: flex; align-items: center; gap: 14px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--wv-text-2); }
.chart-legend-dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }

.grouped-bar-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 160px; }
.grouped-bar-group { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.grouped-bar-pair { flex: 1 1 auto; display: flex; align-items: flex-end; gap: 4px; width: 100%; justify-content: center; }
.grouped-bar {
    width: 15px; border-radius: 5px 5px 2px 2px; height: 0%;
    transition: height .8s cubic-bezier(.22,.9,.3,1);
}
.grouped-bar.is-light { background: #a5c2d4; }
.grouped-bar.is-solid { background: var(--wv-accent); }
.grouped-bar-group span:last-child { font-size: 11px; color: var(--wv-muted-2); }

.line-chart { width: 100%; height: 150px; }
.line-chart-svg { width: 100%; height: 120px; overflow: visible; }
.line-chart-path {
    fill: none; stroke: var(--wv-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 400; stroke-dashoffset: 400;
    animation: wv-draw-line 1.1s ease forwards .1s;
}
@keyframes wv-draw-line { to { stroke-dashoffset: 0; } }
.line-chart-labels { display: flex; justify-content: space-between; margin-top: 6px; }
.line-chart-labels span { font-size: 10.5px; color: var(--wv-muted-2); }

/* Fila de 3 paneles (materia / documentos pendientes / estado) */
.dashboard-panels-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; align-items: start; }

.bar-list-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.bar-list-row .bar-list-label { flex: 0 0 90px; font-size: 12.5px; color: var(--wv-text-2); }
.bar-track { flex: 1 1 auto; height: 9px; background: var(--wv-border-2); border-radius: 999px; overflow: hidden; }
.bar-track > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--wv-sidebar-active), var(--wv-accent)); border-radius: 999px; transition: width .7s cubic-bezier(.22,.9,.3,1); }
.bar-list-row .bar-list-total { flex: 0 0 auto; width: 28px; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--wv-text); }

.doc-matter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.doc-matter-box { background: rgba(255,255,255,.7); border: 1px solid var(--wv-accent-soft-border); border-radius: 10px; padding: 12px 14px; transition: transform .15s ease; }
.doc-matter-box:hover { transform: translateY(-1px); }
.doc-matter-box strong { display: block; font-size: 1.4rem; font-weight: 700; color: var(--wv-text); }
.doc-matter-box span { font-size: 12px; color: var(--wv-muted-2); }

.stacked-bar { display: flex; width: 100%; height: 12px; border-radius: 999px; overflow: hidden; background: var(--wv-border-2); margin-bottom: 16px; }
.stacked-bar > span { display: block; height: 100%; width: 0%; transition: width .7s cubic-bezier(.22,.9,.3,1); }
.stacked-legend { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.stacked-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--wv-text-2); }
.stacked-legend-item strong { color: var(--wv-text); margin-left: 2px; }
.legend-dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }

/* Panel oscuro: equipo del despacho */
.team-panel { background: var(--wv-sidebar); border-radius: var(--wv-radius-card); padding: 22px 24px; margin-bottom: 20px; color: var(--wv-sidebar-text); }
.team-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.team-panel-header h2 { margin: 0; font-family: var(--wv-font-serif); font-size: 1.2rem; font-weight: 700; color: #fff; }
.team-panel-meta { font-size: 12px; color: var(--wv-sidebar-text-mute); white-space: nowrap; }

.feed-toggle { display: flex; align-items: center; background: rgba(255,255,255,.06); border-radius: 999px; padding: 3px; }
.feed-toggle button {
    border: none; background: transparent; padding: 7px 14px; border-radius: 999px;
    font-family: inherit; font-size: 12px; font-weight: 500; color: var(--wv-sidebar-text-dim); cursor: pointer; white-space: nowrap;
    transition: background .18s ease, color .18s ease;
}
.feed-toggle button.is-active { background: var(--wv-accent); color: #fff; }

.team-panel-body { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr); gap: 16px; }

.team-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.team-row {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
    background: rgba(255,255,255,.04); border: 1px solid transparent; border-radius: 12px; padding: 10px 14px;
    font-family: inherit; color: var(--wv-sidebar-text);
    transition: background .15s ease, border-color .15s ease;
}
.team-row:hover { background: rgba(255,255,255,.08); }
.team-row:focus-visible { outline: 2px solid #74a1bc; outline-offset: -2px; }
.team-row.is-selected { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.team-row-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.team-row-info strong { font-size: 13.5px; font-weight: 600; color: #fff; }
.team-row-info span { font-size: 12px; color: var(--wv-sidebar-text-mute); }
.team-row-count { flex: 0 0 auto; font-size: 12px; color: var(--wv-sidebar-text-dim); white-space: nowrap; }

.team-detail { background: rgba(255,255,255,.05); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; animation: wv-fade-up .3s ease both; }
.team-detail-header { display: flex; align-items: center; gap: 12px; }
.team-detail-header .team-row-info { flex: 1 1 auto; }
.team-detail-header strong { font-size: 15px; color: #fff; }
.btn-ghost-light {
    flex: 0 0 auto; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
    padding: 8px 16px; font-size: 12px; font-weight: 600; color: #fff; text-decoration: none; cursor: pointer;
    transition: background .15s ease;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.18); color: #fff; text-decoration: none; }

.team-detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.team-detail-stat { background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px 12px; }
.team-detail-stat strong { display: block; font-size: 17px; color: #fff; }
.team-detail-stat span { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--wv-sidebar-text-mute); }

.team-feed { display: flex; flex-direction: column; gap: 8px; }
.team-feed-item { background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px 14px; font-size: 12.5px; }
.team-feed-item .team-feed-text { color: var(--wv-sidebar-text); }
.team-feed-item .team-feed-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--wv-sidebar-text-mute); }
.team-feed-empty { font-size: 12.5px; color: var(--wv-sidebar-text-mute); padding: 6px 0; }

/* Fila inferior de 3 columnas (pestaña Usuarios y reportes) */
.dashboard-bottom-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.panel-card {
    background: linear-gradient(165deg, rgba(207,222,232,.75), rgba(165,194,212,.5));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55); border-radius: var(--wv-radius-card); padding: 18px 20px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.panel-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(28,41,53,.1); }
/* --wv-muted por defecto (no muted-2): .panel-card "vidrio" (sin
   .panel-card-solid) tiene un fondo más oscuro que --wv-surface-2, donde
   muted-2 no alcanza 4.5:1 — mismo caso que .chart-panel-title. La variante
   sólida (fondo blanco) sí puede usar el tono más claro, ver abajo. */
.panel-card-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wv-muted); margin-bottom: 14px; }

.user-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.user-stat-box { background: var(--wv-surface); border: 1px solid var(--wv-border-2); border-radius: 10px; padding: 12px 14px; transition: transform .15s ease; }
.user-stat-box:hover { transform: translateY(-1px); }
.user-stat-box .stat-label { font-size: 12px; color: var(--wv-muted); }
.user-stat-box strong { display: block; font-size: 1.4rem; font-weight: 700; color: var(--wv-text); margin: 2px 0; }
.user-stat-box small { font-size: 12px; color: var(--wv-muted-2); }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; align-items: flex-start; gap: 10px; border-radius: 10px; padding: 12px 14px; transition: transform .15s ease; }
.alert-item:hover { transform: translateY(-1px); }
.alert-item svg { flex: 0 0 auto; margin-top: 1px; }
.alert-item strong { display: block; font-size: 13px; color: var(--wv-text); }
.alert-item span { font-size: 12px; color: var(--wv-text-2); }
.alert-item.is-danger { background: var(--wv-danger-bg); }
.alert-item.is-danger svg { color: var(--wv-danger-fg); }
.alert-item.is-warning { background: var(--wv-status-tramite-bg); }
.alert-item.is-warning svg { color: var(--wv-status-tramite-fg); }
.alert-item.is-neutral { background: var(--wv-border-3); }
.alert-item.is-neutral svg { color: var(--wv-muted); }
.alert-list-empty { font-size: 12.5px; color: var(--wv-muted); }

/* Panel "Generar reporte": tarjeta sólida (no el vidrio azul translúcido de
   sus vecinas) — con texto gris claro sobre fondo azul se leía muy pobre. */
.panel-card.panel-card-solid {
    background: var(--wv-surface); backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 1px solid var(--wv-border);
}
.panel-card-solid .panel-card-title { color: var(--wv-muted-2); }

.report-list { display: flex; flex-direction: column; gap: 4px; }
.report-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 8px;
    border-bottom: 1px solid var(--wv-border-2); transition: opacity .15s ease;
}
.report-item:last-child { border-bottom: none; }
.report-item svg { flex: 0 0 auto; color: var(--wv-accent-text); }
.report-item-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.report-item-info strong { font-size: 12.5px; color: var(--wv-text); font-weight: 600; }
.report-item-info span { font-size: 12px; color: var(--wv-muted); }
.report-item.is-generating { opacity: .6; }
a.report-item { text-decoration: none; cursor: pointer; transition: background .14s ease; }
a.report-item:hover { background: var(--wv-surface-2); }

.report-item-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.report-item-actions button {
    background: var(--wv-accent-soft); color: var(--wv-accent-text); border: 1px solid var(--wv-accent-soft-border);
    border-radius: 999px; padding: 5px 11px; font-family: inherit; font-size: 12px; font-weight: 700;
    letter-spacing: .02em; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.report-item-actions button:hover { background: var(--wv-accent); color: #fff; }
.report-item.is-generating .report-item-actions button { cursor: wait; }

@media (max-width: 900px) {
    .team-panel-body { grid-template-columns: 1fr; }
    .grouped-bar { width: 10px; }
}

/* ---------------------------------------------------------------------- */
/* Buscador de topbar (solo en páginas que lo empujan vía @push('topbar-search')) */
/* ---------------------------------------------------------------------- */

.topbar-search {
    display: flex; align-items: center; gap: 9px; flex: 1 1 260px; max-width: 320px; min-width: 160px;
    background: var(--wv-surface); border: 1px solid var(--wv-border-input); border-radius: 999px;
    padding: 0 15px; height: 2.5rem;
}
.topbar-search input {
    border: none; background: transparent; outline: none; font-family: inherit;
    font-size: .82rem; color: var(--wv-text); flex: 1 1 auto; min-width: 0; padding: 0; height: 100%;
}
.topbar-search input::placeholder { color: var(--wv-muted-2); }

/* ---------------------------------------------------------------------- */
/* Notas recientes — feed de tarjetas agrupado por fecha (abogado)         */
/* ---------------------------------------------------------------------- */

.notes-group { margin-bottom: 26px; }
.notes-group-header { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--wv-border-2); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.note-card {
    display: flex; flex-direction: column; gap: 11px;
    background: linear-gradient(165deg, rgba(187,207,222,.9), rgba(140,172,197,.75));
    border-color: rgba(255,255,255,.9);
    /* .panel-card trae backdrop-filter:blur(16px) — con muchas tarjetas a
       la vez en la cuadrícula, ese desenfoque es caro de componer y el
       navegador las deja "en blanco" unos segundos al hacer scroll rápido
       hasta terminar de pintarlas. El fondo ya es lo bastante sólido
       (arriba) como para no necesitar el desenfoque detrás. */
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.note-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-folio-badge {
    background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.8); border-radius: 999px;
    padding: 3px 12px; font-size: 12px; font-weight: 700; color: var(--wv-text); white-space: nowrap;
}
.note-client-name { font-size: 12.5px; color: var(--wv-text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-card-body { margin: 0; font-size: 13px; line-height: 1.55; color: var(--wv-text); }
.note-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.8); }
.note-card-author { display: flex; align-items: center; gap: 9px; min-width: 0; }
.note-card-author strong { display: block; font-size: 12.5px; color: var(--wv-text); font-weight: 600; }
.note-card-author span { font-size: 12px; color: var(--wv-muted-2); }
.note-card-link { font-size: 12px; font-weight: 600; color: var(--wv-accent-text); white-space: nowrap; flex: 0 0 auto; }
.note-card-link:hover { text-decoration: underline; }
.notes-feed-empty { font-size: 13px; color: var(--wv-muted); padding: 30px 0; text-align: center; }

/* ---------------------------------------------------------------------- */
/* Avisos internos — bandeja de dos paneles estilo mensajería (abogado)    */
/* ---------------------------------------------------------------------- */

.inbox-layout { display: flex; gap: 16px; align-items: stretch; height: calc(100vh - 150px); min-height: 480px; }

/* .inbox-sidebar/.inbox-main comparten la misma fórmula "vidrio" que
   .dashboard-filters-card (mismos stops de gradiente, mismo blur, mismo
   borde) — antes tenían cada una su propio gradiente ad hoc. .inbox-main
   usa una variante un tono más oscura para diferenciarse de la barra
   lateral sin salirse de la misma familia de color. El fondo renderizado
   real (gradiente + blur sobre el fondo de página) ronda #cfdfe9 en
   .inbox-sidebar — los colores de texto de abajo están verificados contra
   ese tono, no contra los valores rgba() en crudo (ver auditoría de
   contraste en design-system/waves/MASTER.md). */
.inbox-sidebar {
    flex: 0 0 300px; display: flex; flex-direction: column; min-height: 0;
    background: linear-gradient(165deg, rgba(207,222,232,.75), rgba(165,194,212,.55));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55); border-radius: var(--wv-radius-card);
    overflow: hidden;
}
.inbox-sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; flex: 0 0 auto; }
/* --wv-muted en vez de --wv-muted-2 en estos 6: .inbox-sidebar/.inbox-main
   tienen fondo "vidrio" (gradiente translúcido), más oscuro que
   --wv-surface-2, donde muted-2 no alcanza 4.5:1. */
.inbox-sidebar-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--wv-muted); }
.inbox-compose-btn {
    width: 30px; height: 30px; border-radius: 9px; background: var(--wv-sidebar); color: #fff; border: none;
    display: grid; place-items: center; cursor: pointer; transition: background .15s ease; flex: 0 0 auto;
}
.inbox-compose-btn:hover { background: var(--wv-sidebar-hover); }

.inbox-search {
    flex: 0 0 auto; margin: 0 18px 12px; display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 0 13px; height: 2.2rem;
}
/* El <input> interno quita su propio outline; sin esto no queda ningún
   indicador de foco visible al tabular hasta el buscador. */
.inbox-search:focus-within { border-color: var(--wv-accent); box-shadow: 0 0 0 2px var(--wv-accent-soft); }
.inbox-search input { border: none; background: transparent; outline: none; font-family: inherit; font-size: .8rem; color: var(--wv-text); flex: 1 1 auto; min-width: 0; }
.inbox-search input::placeholder { color: var(--wv-muted); }

.inbox-conversations {
    flex: 1 1 auto; overflow-y: auto; border-top: 1px solid rgba(255,255,255,.5); min-height: 0; padding: 6px;
    display: flex; flex-direction: column; gap: 3px;
    scrollbar-width: thin; scrollbar-color: var(--wv-accent-text) transparent;
}
.inbox-conversations::-webkit-scrollbar { width: 6px; }
.inbox-conversations::-webkit-scrollbar-track { background: transparent; }
.inbox-conversations::-webkit-scrollbar-thumb { background: var(--wv-accent-text); border-radius: 999px; }
/* La fila ya no es un solo <button> (eliminar conversación necesita su
   propio botón, y un <button> no puede anidar otro <button> — ver nota
   en el blade). .inbox-conversation-row es ahora el contenedor: el fondo
   hover/activo vive aquí para que cubra toda la fila, incluido el botón
   de eliminar. */
.inbox-conversation-row {
    display: flex; align-items: center; gap: 2px; width: 100%;
    border-radius: 12px; transition: background .14s ease, box-shadow .14s ease;
}
.inbox-conversation-row:hover { background: rgba(255,255,255,.35); }
.inbox-conversation-row.is-active { background: var(--wv-surface); box-shadow: 0 6px 16px rgba(7, 46, 82, 0.473); }
.inbox-conversation-main {
    display: flex; align-items: flex-start; gap: 10px; flex: 1 1 auto; min-width: 0;
    padding: 10px 4px 10px 12px; border: none; background: transparent; border-radius: 12px;
    text-align: left; cursor: pointer; font-family: inherit;
}
.inbox-conversation-hide {
    flex: 0 0 auto; width: 28px; height: 28px; margin-right: 6px; border-radius: 999px;
    background: transparent; border: none; color: var(--wv-muted); display: grid; place-items: center;
    cursor: pointer; transition: background .15s ease, color .15s ease;
}
.inbox-conversation-hide:hover { background: var(--wv-danger-bg); color: var(--wv-danger-fg); }
.inbox-conversation-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-conversation-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.inbox-conversation-name { font-size: 13px; color: var(--wv-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-conversation-row.has-unread .inbox-conversation-name { font-weight: 700; }
.inbox-conversation-time { font-size: 12px; color: var(--wv-muted); flex: 0 0 auto; }
.inbox-conversation-preview { font-size: 12px; color: var(--wv-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.inbox-conversation-badge {
    flex: 0 0 auto; min-width: 17px; height: 17px; border-radius: 999px; background: var(--wv-sidebar); color: #fff;
    font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; margin-top: 2px;
}
.inbox-empty { padding: 24px 18px; font-size: 12.5px; color: var(--wv-muted); text-align: center; line-height: 1.6; }
/* .inbox-main es un tono más oscuro que .inbox-sidebar (ver su regla más
   abajo) — sobre ese fondo, --wv-muted ya no llega a 4.5:1 (medido:
   3.78:1 sobre el panel vacío). --wv-text-2 sí lo hace con margen. Mismo
   fondo/texto que .inbox-attachment-loading más abajo. */
.inbox-main .inbox-empty { color: var(--wv-text-2); }

.inbox-main {
    flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0;
    background: linear-gradient(165deg, rgba(184,203,217,.78), rgba(140,172,194,.6));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55); border-radius: var(--wv-radius-card); overflow: hidden;
}
/* Envuelve header+mensajes+compositor dentro de .inbox-main (ver nota en
   el blade sobre por qué existe este div envoltorio) — sin esto, el
   compositor no quedaba pegado abajo: al no ser flex, rompía la cadena
   flexbox que hace crecer .inbox-messages y empuja .inbox-composer al
   fondo, así que el compositor terminaba flotando justo debajo del
   último mensaje en vez de fijo en el borde inferior del panel. */
.inbox-conversation-pane { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.inbox-main-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.5); flex: 0 0 auto; background: rgba(255,255,255,.25); }
.inbox-main-header-info { flex: 1 1 auto; min-width: 0; }
.inbox-main-header-info strong { display: block; font-size: 14px; color: var(--wv-text); }
.inbox-main-header-info span { font-size: 12px; color: var(--wv-muted); }

.inbox-messages {
    flex: 1 1 auto; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-height: 0;
    scrollbar-width: thin; scrollbar-color: var(--wv-accent-text) transparent;
}
.inbox-messages::-webkit-scrollbar { width: 6px; }
.inbox-messages::-webkit-scrollbar-track { background: transparent; }
.inbox-messages::-webkit-scrollbar-thumb { background: var(--wv-accent-text); border-radius: 999px; }
.inbox-day-divider { align-self: center; font-size: 12px; color: var(--wv-text-2); background: rgba(255,255,255,.7); border-radius: 999px; padding: 3px 13px; margin: 4px 0; }
.inbox-message { display: flex; flex-direction: column; gap: 4px; max-width: 62%; }
.inbox-message.is-own { align-self: flex-end; align-items: flex-end; }
.inbox-message.is-other { align-self: flex-start; align-items: flex-start; }
.inbox-message-row { display: flex; align-items: flex-end; gap: 8px; }
.inbox-bubble { padding: 11px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.inbox-message.is-own .inbox-bubble { background: var(--wv-accent-text); color: #fff; border-bottom-right-radius: 4px; }
.inbox-message.is-other .inbox-bubble { background: rgba(255,255,255,.75); color: var(--wv-text); border-bottom-left-radius: 4px; }
.inbox-message-meta { font-size: 12px; color: var(--wv-text-2); }
.inbox-message.is-other .inbox-message-meta { padding-left: 38px; }

.inbox-composer { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.5); flex: 0 0 auto; background: rgba(255,255,255,.2); }
.inbox-composer-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.inbox-tool-btn {
    width: 2.2rem; height: 2.2rem; border-radius: 999px; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.7);
    color: var(--wv-text-2); display: grid; place-items: center; flex: 0 0 auto; cursor: pointer; transition: background .15s ease;
}
.inbox-tool-btn:hover { background: rgba(255,255,255,.85); }
.inbox-tool-btn:disabled, .inbox-tool-btn[disabled] { cursor: not-allowed; opacity: .65; }
.inbox-tool-btn:disabled:hover, .inbox-tool-btn[disabled]:hover { background: rgba(255,255,255,.6); }
.inbox-composer input {
    flex: 1 1 auto; min-width: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 0 16px; height: 2.6rem;
    font-family: inherit; font-size: .85rem; background: rgba(255,255,255,.65); color: var(--wv-text);
}
.inbox-composer input:focus { outline: none; border-color: var(--wv-accent); background: var(--wv-surface); }
/* Selector por id: gana sobre ".inbox-composer input" (más específico que
   .sr-only sola) para que el <input type="file"> oculto no herede el
   padding/alto/flex-grow pensados para el campo de texto visible. */
#inbox-attachment-input { display: none; }

.inbox-composer-wrap { display: flex; flex-direction: column; flex: 0 0 auto; }
.inbox-attachment-staged {
    display: flex; align-items: center; gap: 8px; margin: 0 20px 8px; padding: 7px 12px;
    background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.7); border-radius: 10px;
    font-size: 12px; color: var(--wv-text-2); width: fit-content; max-width: calc(100% - 40px);
}
.inbox-attachment-staged span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-attachment-staged button { flex: 0 0 auto; background: none; border: none; cursor: pointer; color: var(--wv-muted); display: grid; place-items: center; padding: 2px; }
.inbox-attachment-staged button:hover { color: var(--wv-danger-fg); }
/* --wv-text-2 (no --wv-muted): mismo motivo que .inbox-main .inbox-empty
   arriba — vive sobre el compositor, un overlay claro encima del fondo
   oscurecido de .inbox-main, donde --wv-muted no llega a 4.5:1. */
.inbox-attachment-loading { font-size: 12px; color: var(--wv-text-2); padding: 0 20px 6px; }

.inbox-attachment-chip {
    display: flex; align-items: center; gap: 8px; width: 100%; max-width: 240px; margin-bottom: 6px;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 8px 10px;
    font-family: inherit; font-size: 12px; color: inherit; cursor: pointer; text-align: left; transition: background .14s ease;
}
.inbox-message.is-other .inbox-attachment-chip { background: rgba(80,129,159,.1); border-color: var(--wv-accent-soft-border); }
.inbox-attachment-chip:hover { background: rgba(255,255,255,.3); }
.inbox-message.is-other .inbox-attachment-chip:hover { background: rgba(80,129,159,.18); }
.inbox-attachment-chip svg { flex: 0 0 auto; }
.inbox-attachment-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.inbox-attachment-size { flex: 0 0 auto; opacity: .75; font-size: 12px; }
.inbox-bubble-text { display: block; }
/* .inbox-composer button.inbox-send-btn (no solo .inbox-send-btn ni
   button.inbox-send-btn): este botón vive dentro de <main><form
   wire:submit>, así que también hace match con el reset global
   "main form button[type=submit]" — 3 elementos + 1 atributo, más
   específico que una sola clase o que "button" + una clase. Sin este
   segundo calificador de clase, ese reset ganaba e imponía su propio
   padding/radio/fondo, recortando el ícono circular dentro de una caja
   cuadrada con relleno. */
.inbox-composer button.inbox-send-btn {
    width: 2.75rem; height: 2.75rem; border-radius: 999px; background: var(--wv-accent); color: #fff; border: none; padding: 0;
    display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
    transition: background .15s ease, transform .15s ease; overflow: hidden;
}
.inbox-composer button.inbox-send-btn:hover { transform: scale(1.06); background: var(--wv-accent-hover); }
.inbox-composer button.inbox-send-btn:disabled, .inbox-composer button.inbox-send-btn[disabled] {
    opacity: .5; cursor: not-allowed; background: var(--wv-accent);
}
.inbox-composer button.inbox-send-btn:disabled:hover, .inbox-composer button.inbox-send-btn[disabled]:hover {
    transform: none; background: var(--wv-accent);
}
/* Estado de carga (wire:loading.class durante el envío) — mismo criterio
   que .report-item.is-generating: opacidad reducida + cursor de espera,
   sin inventar un spinner nuevo para un solo botón. */
.inbox-composer button.inbox-send-btn.is-sending { opacity: .7; cursor: wait; }

@media (max-width: 860px) {
    .inbox-layout { flex-direction: column; height: auto; }
    .inbox-sidebar { flex: 0 0 auto; max-height: 320px; }
    .inbox-main { min-height: 480px; }
}
