/* ============================================================
   WashFlow · Sistema de diseño (SaaS)
   Tokens + componentes. Complementa a Tailwind + Flowbite.
   ============================================================ */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
    /* Marca / Primario (dorado · oro y divisas) */
    --wf-primary-50:  #fdf7e8;
    --wf-primary-100: #faedc6;
    --wf-primary-200: #f4dc8f;
    --wf-primary-500: #d4a017;
    --wf-primary-600: #b8860b;
    --wf-primary-700: #92670a;

    /* Neutros (base del producto) */
    --wf-ink:        #0b1220;  /* títulos */
    --wf-ink-soft:   #1f2a3d;  /* texto fuerte */
    --wf-body:       #46506a;  /* cuerpo */
    --wf-muted:      #6b7689;  /* secundario */
    --wf-faint:      #9aa3b5;  /* terciario / placeholders */
    --wf-line:       #e8ebf2;  /* bordes */
    --wf-line-soft:  #f0f2f7;  /* bordes internos */
    --wf-surface:    #ffffff;  /* tarjetas */
    --wf-bg:         #f6f7fb;  /* fondo de página */
    --wf-bg-subtle:  #eef0f6;  /* fondos sutiles */

    /* Estados semánticos */
    --wf-success:  #12a36b;
    --wf-success-bg: #e8f7f0;
    --wf-warning:  #d98a00;
    --wf-warning-bg: #fdf3e2;
    --wf-danger:   #e04355;
    --wf-danger-bg: #fdecef;
    --wf-info:     #b8860b;

    /* Tipografía */
    --wf-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Radios */
    --wf-radius-sm: 7px;
    --wf-radius:    10px;
    --wf-radius-lg: 14px;
    --wf-radius-xl: 18px;
    --wf-radius-full: 9999px;

    /* Sombras: sutiles, multicapa, estilo SaaS */
    --wf-shadow-xs: 0 1px 2px rgba(11, 18, 32, 0.04);
    --wf-shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.04), 0 1px 3px rgba(11, 18, 32, 0.06);
    --wf-shadow:    0 2px 4px rgba(11, 18, 32, 0.04), 0 4px 12px rgba(11, 18, 32, 0.06);
    --wf-shadow-md: 0 4px 8px rgba(11, 18, 32, 0.05), 0 12px 28px rgba(11, 18, 32, 0.10);
    --wf-shadow-primary: 0 2px 6px rgba(184, 134, 11, 0.30);

    --wf-transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--wf-font);
    color: var(--wf-body);
    background: var(--wf-bg);
    letter-spacing: -0.006em;
}
a { text-decoration: none; color: inherit; }
::selection { background: var(--wf-primary-100); color: var(--wf-primary-700); }

/* Tipografía utilitaria con tracking afinado */
.t-title { color: var(--wf-ink); font-weight: 700; letter-spacing: -0.02em; }
.t-heading { color: var(--wf-ink-soft); font-weight: 650; letter-spacing: -0.015em; }
.t-muted { color: var(--wf-muted); }
.t-faint { color: var(--wf-faint); }
.t-num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------- 2. SCROLLBARS ---------- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d3d8e4; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b9c0d1; background-clip: content-box; }
#sidebar::-webkit-scrollbar-thumb { background: #2a3650; background-clip: content-box; }

/* ---------- 3. BOTONES ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-weight: 600; font-size: 0.8125rem; line-height: 1;
    padding: 0.6rem 1rem; border-radius: var(--wf-radius-sm);
    border: 1px solid transparent; cursor: pointer;
    transition: var(--wf-transition); white-space: nowrap; user-select: none;
    letter-spacing: -0.01em;
}
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--wf-primary-200); }
.btn i { font-size: 0.75rem; }

.btn-primary { background: var(--wf-primary-600); color: #fff; box-shadow: var(--wf-shadow-xs); }
.btn-primary:hover { background: var(--wf-primary-700); box-shadow: var(--wf-shadow-primary); }

.btn-secondary { background: #fff; color: var(--wf-ink-soft); border-color: var(--wf-line); box-shadow: var(--wf-shadow-xs); }
.btn-secondary:hover { background: var(--wf-bg-subtle); border-color: #dadfea; }

.btn-danger { background: var(--wf-danger); color: #fff; }
.btn-danger:hover { background: #c7384a; }

.btn-success { background: var(--wf-success); color: #fff; }
.btn-success:hover { background: #0e8d5c; }

.btn-ghost { background: transparent; color: var(--wf-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--wf-bg-subtle); color: var(--wf-ink-soft); }

.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 0.875rem; }
.btn-icon { width: 2.3rem; height: 2.3rem; padding: 0; }
.btn-block { width: 100%; }

/* Acciones de tabla */
.btn-action {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.35rem 0.7rem; font-size: 0.75rem; font-weight: 550;
    border-radius: var(--wf-radius-sm); transition: var(--wf-transition);
    border: 1px solid transparent;
}
.btn-action i { font-size: 10px; }
.btn-action--edit { color: var(--wf-primary-700); background: var(--wf-primary-50); }
.btn-action--edit:hover { background: var(--wf-primary-100); }
.btn-action--delete { color: #b3303f; background: var(--wf-danger-bg); }
.btn-action--delete:hover { background: #fbdce0; }

/* ---------- 4. TARJETAS ---------- */
.card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-lg);
    box-shadow: var(--wf-shadow-sm);
}
.card-pad { padding: 1.5rem; }
.card-header {
    padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--wf-line-soft);
    display: flex; align-items: center; justify-content: space-between;
}
.card-footer {
    padding: 1.15rem 1.5rem; border-top: 1px solid var(--wf-line-soft);
    background: #fbfcfe;
}

/* Stat card (KPI) — sobria, jerárquica */
.stat-card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-lg);
    box-shadow: var(--wf-shadow-sm);
    padding: 1.4rem;
    transition: var(--wf-transition);
}
.stat-card:hover { box-shadow: var(--wf-shadow); border-color: #dde2ee; }
.stat-icon {
    width: 2.6rem; height: 2.6rem; border-radius: var(--wf-radius);
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--wf-ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-trend { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; }
.stat-trend--up { color: var(--wf-success); }
.stat-trend--down { color: var(--wf-danger); }

/* ---------- 5. BADGES ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.6rem;
    border-radius: var(--wf-radius-full); line-height: 1.4; letter-spacing: 0.005em;
}
.badge i { font-size: 0.65rem; }
.badge-primary { background: var(--wf-primary-50); color: var(--wf-primary-700); }
.badge-success { background: var(--wf-success-bg); color: #0d7a50; }
.badge-warning { background: var(--wf-warning-bg); color: #a8690a; }
.badge-danger  { background: var(--wf-danger-bg); color: #b3303f; }
.badge-neutral { background: var(--wf-bg-subtle); color: var(--wf-muted); }
.badge-purple  { background: #f1edff; color: #6d4bd8; }
/* Punto de estado dentro del badge */
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- 6. FORMULARIOS ---------- */
.form-label { display: block; font-size: 0.8125rem; font-weight: 550; color: var(--wf-ink-soft); margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.form-label .req { color: var(--wf-danger); }
.form-hint { font-size: 0.75rem; color: var(--wf-faint); margin-top: 0.35rem; }
.form-control {
    width: 100%; padding: 0.6rem 0.875rem;
    background: #fff; border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm); font-size: 0.875rem; color: var(--wf-ink-soft);
    transition: var(--wf-transition); outline: none; box-shadow: var(--wf-shadow-xs);
}
.form-control::placeholder { color: var(--wf-faint); }
.form-control:hover { border-color: #d7dce8; }
.form-control:focus { border-color: var(--wf-primary-500); box-shadow: 0 0 0 3px var(--wf-primary-100); }
.form-control-icon { position: relative; }
.form-control-icon .form-control { padding-left: 2.5rem; }
.form-control-icon > i { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--wf-faint); font-size: 0.8125rem; pointer-events: none; }

/* ---------- 7. TABLAS ---------- */
.data-table { width: 100%; font-size: 0.875rem; border-collapse: collapse; }
.data-table thead th {
    text-align: left; padding: 0.7rem 1.5rem;
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--wf-muted);
    background: #fbfcfe; border-bottom: 1px solid var(--wf-line);
}
.data-table td { padding: 0.85rem 1.5rem; vertical-align: middle; color: var(--wf-body); }
.data-table tbody tr { border-top: 1px solid var(--wf-line-soft); transition: background 0.12s; }
.data-table tbody tr:first-child { border-top: none; }
.data-table tbody tr:hover { background: #fafbfe; }
.table-empty { padding: 3.5rem 1rem; text-align: center; color: var(--wf-faint); }
.table-empty i { font-size: 1.75rem; margin-bottom: 0.6rem; display: block; opacity: 0.6; }
.table-empty p { font-size: 0.875rem; }

/* Avatar iniciales */
.avatar {
    width: 2.35rem; height: 2.35rem; border-radius: var(--wf-radius-full);
    background: linear-gradient(135deg, var(--wf-primary-50), #e3ecff);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8125rem; font-weight: 650; color: var(--wf-primary-700);
    flex-shrink: 0; border: 1px solid #e0e8ff;
}

/* ---------- 8. PAGE HEADER ---------- */
.page-header {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.75rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--wf-ink); letter-spacing: -0.025em; line-height: 1.2; }
.page-subtitle { font-size: 0.875rem; color: var(--wf-muted); margin-top: 0.3rem; }

/* Separador de sección */
.section-label { font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--wf-faint); margin-bottom: 0.9rem; }

/* ---------- 9. SIDEBAR NAV ---------- */
.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.75rem; border-radius: var(--wf-radius-sm);
    font-size: 0.8125rem; font-weight: 550; margin-bottom: 0.15rem;
    color: #99a3ba; transition: var(--wf-transition); position: relative;
}
.nav-link i { width: 1.15rem; text-align: center; font-size: 0.875rem; color: #737e97; transition: var(--wf-transition); }
.nav-link:hover { background: rgba(255,255,255,0.05); color: #e6eaf2; }
.nav-link:hover i { color: #aeb8cf; }
.nav-link.is-active { background: rgba(79,124,255,0.14); color: #fff; }
.nav-link.is-active i { color: var(--wf-primary-500); }
.nav-link.is-active::before {
    content: ''; position: absolute; left: -0.75rem; top: 50%; transform: translateY(-50%);
    width: 3px; height: 1.1rem; border-radius: 0 3px 3px 0; background: var(--wf-primary-500);
}
.nav-section { font-size: 0.65rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: #5a657e; padding: 0 0.75rem; margin: 1rem 0 0.4rem; }

/* ---------- 10. SWEETALERT2 ---------- */
.swal2-container { z-index: 99999 !important; }
.swal2-popup { font-family: var(--wf-font) !important; font-size: 14px !important; border-radius: 14px !important; padding: 2rem !important; }
.swal2-title { font-size: 18px !important; color: var(--wf-ink) !important; }
.swal2-actions { margin-top: 1.5rem !important; gap: 0.5rem; }
.swal2-confirm { background-color: var(--wf-danger) !important; color: #fff !important; padding: 10px 22px !important; border-radius: 8px !important; font-size: 13px !important; font-weight: 600 !important; }
.swal2-confirm:hover { background-color: #c7384a !important; }
.swal2-cancel { background-color: #fff !important; color: var(--wf-ink-soft) !important; border: 1px solid var(--wf-line) !important; padding: 10px 22px !important; border-radius: 8px !important; font-size: 13px !important; font-weight: 600 !important; }
.swal2-cancel:hover { background-color: var(--wf-bg-subtle) !important; }

/* ---------- 11. PAGINACIÓN ---------- */
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination button { min-width: 34px; height: 34px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); font-size: 12px; font-weight: 550; color: var(--wf-muted); background: #fff; cursor: pointer; transition: var(--wf-transition); }
.pagination button:hover:not(:disabled) { background: var(--wf-bg-subtle); color: var(--wf-ink); }
.pagination button.active { background: var(--wf-primary-600); color: #fff; border-color: var(--wf-primary-600); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   12. RESPONSIVE · móvil / tablet / escritorio
   ============================================================ */

/* Evitar desbordamiento horizontal global */
html, body { max-width: 100%; overflow-x: hidden; }
.card { max-width: 100%; }
.data-table { max-width: 100%; }
/* En tablet+/escritorio el contenedor permite scroll si hiciera falta */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
img, svg, video { max-width: 100%; height: auto; }

/* ---- TABLET (<= 1024px) ---- */
@media (max-width: 1024px) {
    .page-title { font-size: 1.3rem; }
    .card-pad { padding: 1.25rem; }
    .card-header, .card-footer { padding: 1rem 1.25rem; }
}

/* ---- MÓVIL (<= 640px) ---- */
@media (max-width: 640px) {
    /* Jerarquía tipográfica un poco menor */
    .page-title { font-size: 1.2rem; }
    .page-subtitle { font-size: 0.8125rem; }
    .stat-value { font-size: 1.5rem; }

    /* Paddings más ajustados pero cómodos */
    .card-pad { padding: 1.1rem; }
    .card-header, .card-footer { padding: 0.9rem 1.1rem; }
    .stat-card { padding: 1.1rem; }

    /* ---- TABLAS como TARJETAS APILADAS en móvil ---- */
    /* No scroll horizontal: cada fila se vuelve una ficha */
    .table-scroll { overflow-x: visible; }
    .data-table { min-width: 0 !important; }
    .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .data-table tbody tr {
        display: block;
        overflow: hidden;
        border: 1px solid var(--wf-line);
        border-radius: var(--wf-radius);
        margin: 0.75rem;
        background: #fff;
        box-shadow: var(--wf-shadow-xs);
    }
    .data-table tbody tr:first-child { border-top: 1px solid var(--wf-line); }
    .data-table tbody tr:hover { background: #fff; }
    .data-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        text-align: right;
        padding: 0.55rem 1rem !important;
        border: none;
        border-bottom: 1px solid var(--wf-line-soft);
    }
    .data-table td:last-child { border-bottom: none; }
    /* Etiqueta de columna inyectada vía data-label */
    .data-table td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--wf-muted);
        text-align: left;
        flex-shrink: 0;
    }
    /* Celdas sin etiqueta (ej. acciones) ocupan todo el ancho */
    .data-table td[data-label=""]::before,
    .data-table td.cell-full::before { content: none; }
    .data-table td.cell-full {
        justify-content: flex-start;
        text-align: left;
        background: #fbfcfe;
        border-bottom: 1px solid var(--wf-line);
        padding: 0.7rem 1rem !important;
        border-radius: var(--wf-radius) var(--wf-radius) 0 0;
    }
    .data-table td.cell-actions { justify-content: stretch; gap: 0.5rem; padding-top: 0.75rem !important; }
    .data-table td.cell-actions::before { content: none; }
    .data-table td.cell-actions > div { display: flex; gap: 0.5rem; width: 100%; }
    .data-table td.cell-actions .btn-action { flex: 1 1 auto; justify-content: center; }
    /* Estado vacío: a todo el ancho sin formato ficha */
    .data-table td.cell-empty { display: block; text-align: center; }
    .data-table td.cell-empty::before { content: none; }

    /* Page header: acciones a lo ancho */
    .page-header { gap: 0.75rem; }
    .page-header .btn { flex: 1 1 auto; justify-content: center; }

    /* Botones de acción de tabla: tamaño táctil mínimo */
    .btn-action { padding: 0.45rem 0.6rem; }

    /* Footer de formularios apilado y botones full-width */
    .card-footer { flex-wrap: wrap; }
    .card-footer .btn { flex: 1 1 100%; }
}

/* ---- MÓVIL pequeño (<= 400px) ---- */
@media (max-width: 400px) {
    .data-table thead th, .data-table td { padding-left: 0.75rem; padding-right: 0.75rem; }
    .avatar { width: 2rem; height: 2rem; font-size: 0.75rem; }
}

/* Área táctil mínima para elementos interactivos en pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .btn, .btn-action, .nav-link, .form-control, .pagination button { min-height: 40px; }
    .btn-icon { min-width: 40px; }
}

/* ============================================================
   13. SELECTOR DE MÓDULOS (checkbox cards)
   ============================================================ */
.module-check {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.9rem; border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm); background: #fff;
    cursor: pointer; transition: var(--wf-transition); user-select: none;
}
.module-check:hover { border-color: #d7dce8; background: #fafbfe; }
.module-check input { position: absolute; opacity: 0; pointer-events: none; }
.module-check .module-icon {
    width: 2rem; height: 2rem; flex-shrink: 0; border-radius: var(--wf-radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--wf-bg-subtle); color: var(--wf-muted); font-size: 0.8rem;
    transition: var(--wf-transition);
}
.module-check .module-tick {
    flex-shrink: 0; width: 1.25rem; height: 1.25rem; border-radius: 5px;
    border: 1.5px solid var(--wf-line); display: inline-flex; align-items: center;
    justify-content: center; font-size: 0.6rem; color: transparent; transition: var(--wf-transition);
}
.module-check.is-checked {
    border-color: var(--wf-primary-500);
    background: var(--wf-primary-50);
    box-shadow: 0 0 0 1px var(--wf-primary-200) inset;
}
.module-check.is-checked .module-icon { background: var(--wf-primary-100); color: var(--wf-primary-700); }
.module-check.is-checked .module-tick { background: var(--wf-primary-600); border-color: var(--wf-primary-600); color: #fff; }

/* ============================================================
   14. TOM SELECT (selects con búsqueda) acorde al diseño
   ============================================================ */
.ts-wrapper.single .ts-control,
.ts-control {
    min-height: 2.6rem;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm);
    background: #fff;
    box-shadow: var(--wf-shadow-xs);
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    color: var(--wf-ink-soft);
    transition: var(--wf-transition);
}
.ts-wrapper.single .ts-control:hover { border-color: #d7dce8; }
.ts-wrapper.focus .ts-control {
    border-color: var(--wf-primary-500);
    box-shadow: 0 0 0 3px var(--wf-primary-100);
}
.ts-control .ts-control input,
.ts-control input { font-size: 0.875rem; color: var(--wf-ink-soft); }
.ts-control::placeholder { color: var(--wf-faint); }

/* Dropdown */
.ts-dropdown {
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow-md);
    margin-top: 4px;
    font-size: 0.875rem;
    overflow: hidden;
}
.ts-dropdown .option {
    padding: 0.55rem 0.85rem;
    color: var(--wf-body);
}
.ts-dropdown .option.active {
    background: var(--wf-primary-50);
    color: var(--wf-primary-700);
}
.ts-dropdown .no-results {
    padding: 0.55rem 0.85rem;
    color: var(--wf-faint);
}
.ts-dropdown-content { max-height: 260px; }

/* Flecha desplegable */
.ts-wrapper.single .ts-control:after {
    border-color: var(--wf-faint) transparent transparent;
}

/* Tom Select copia la clase .form-control del <select> original al wrapper,
   lo que dibuja un segundo borde encima del .ts-control. Neutralizar el
   wrapper: el borde/padding/sombra los pone únicamente el .ts-control. */
.ts-wrapper.form-control {
    border: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
    min-height: 0;
    height: auto;
}

/* ============================================================
   15. FILTRO DE FECHA GLOBAL (topbar)
   ============================================================ */
.wf-datebox {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.25rem;
    padding: 0 0.6rem;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm);
    background: #fff;
    box-shadow: var(--wf-shadow-xs);
    cursor: pointer;
    transition: var(--wf-transition);
}
.wf-datebox:hover { border-color: #d7dce8; }
.wf-datebox:focus-within {
    border-color: var(--wf-primary-500);
    box-shadow: 0 0 0 3px var(--wf-primary-100);
}
.wf-datebox > i { color: var(--wf-faint); font-size: 0.8rem; }
.wf-datebox input[type="date"] {
    border: 0;
    outline: none;
    background: transparent;
    font-size: 0.8125rem;
    color: var(--wf-ink-soft);
    font-family: var(--wf-font);
    width: 118px;
    padding: 0;
}
/* Oculta el icono nativo del date (usamos el nuestro a la izquierda) */
.wf-datebox input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0; cursor: pointer; position: absolute; right: 0; width: 100%; height: 100%;
}
.wf-datebox { position: relative; }

.wf-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wf-muted);
    background: #fff;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm);
    cursor: pointer;
    transition: var(--wf-transition);
    white-space: nowrap;
}
.wf-chip:hover { background: var(--wf-bg-subtle); color: var(--wf-ink-soft); }
.wf-chip.is-on {
    background: var(--wf-primary-600);
    border-color: var(--wf-primary-600);
    color: #fff;
}

/* En móvil: el filtro de fecha se mantiene compacto pero visible */
@media (max-width: 640px) {
    .wf-datebox { padding: 0 0.45rem; height: 2.1rem; }
    .wf-datebox input[type="date"] { width: 92px; font-size: 0.75rem; }
    .wf-chip { height: 2.1rem; padding: 0 0.55rem; font-size: 0.7rem; }
}

/* ============================================================
   16. SUB-PERMISO: editar históricos (bajo cada módulo)
   ============================================================ */
.module-item { display: flex; flex-direction: column; }
.hist-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0 0 0.5rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--wf-muted);
    border: 1px dashed var(--wf-line);
    border-radius: var(--wf-radius-sm);
    cursor: pointer;
    user-select: none;
    transition: var(--wf-transition);
}
.hist-check:hover { background: var(--wf-bg-subtle); }
.hist-check input { width: 15px; height: 15px; accent-color: var(--wf-primary-600); cursor: pointer; }
.hist-check > i { font-size: 0.75rem; color: var(--wf-faint); }
.hist-check.is-on {
    color: var(--wf-primary-700);
    border-color: var(--wf-primary-200);
    border-style: solid;
    background: var(--wf-primary-50);
}
.hist-check.is-on > i { color: var(--wf-primary-600); }

/* ============================================================
   17. BARRA DE BÚSQUEDA (listados)
   ============================================================ */
.wf-search { display: flex; align-items: center; gap: 0.5rem; }
.wf-search-box {
    position: relative;
    flex: 1 1 auto;
    max-width: 420px;
    display: flex;
    align-items: center;
}
.wf-search-box > i {
    position: absolute;
    left: 0.85rem;
    color: var(--wf-faint);
    font-size: 0.8125rem;
    pointer-events: none;
}
.wf-search-box input {
    width: 100%;
    height: 2.4rem;
    padding: 0 2.3rem;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm);
    background: #fff;
    box-shadow: var(--wf-shadow-xs);
    font-size: 0.875rem;
    color: var(--wf-ink-soft);
    outline: none;
    transition: var(--wf-transition);
}
.wf-search-box input::placeholder { color: var(--wf-faint); }
.wf-search-box input:hover { border-color: #d7dce8; }
.wf-search-box input:focus {
    border-color: var(--wf-primary-500);
    box-shadow: 0 0 0 3px var(--wf-primary-100);
}
.wf-search-clear {
    position: absolute;
    right: 0.6rem;
    width: 1.5rem; height: 1.5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--wf-faint);
    transition: var(--wf-transition);
}
.wf-search-clear:hover { background: var(--wf-bg-subtle); color: var(--wf-ink-soft); }
