/* ===== BASE ===== */

html, body {
    overflow-x: hidden;
    font-size: 12px;
}

body,
.pagina-body,
.login-body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    font-size: 12px;
}

/* ===== CONTENEDORES GENERALES ===== */

.pagina-contenedor {
    padding: 0 30px 10px 30px;
    box-sizing: border-box;
    width: 100%;
}

.pagina-contenedor-sin-caja {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.pagina-caja {
    background: #ffffff;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    border-radius: 8px;
}

.pagina-caja h1 {
    margin-top: 0;
    margin-bottom: 15px;
}

.usuario-sesion {
    margin-top: 0;
    margin-bottom: 20px;
}

.acciones-superiores {
    margin-bottom: 20px;
}

.mensaje-error {
    color: red;
}

.mensaje-sin-resultados {
    text-align: center;
    padding: 14px;
}

.oculto {
    display: none !important;
}

/* ===== BOTONES / ENLACES ===== */
.en_fila {
    display: flex;
    align-items: center;
    gap: 6px;
}
/*
|--------------------------------------------------------------------------
| FILTROS RÁPIDOS
|--------------------------------------------------------------------------
*/

.segmentacion-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 6px;

    margin-bottom: 5px;
}

.segmentacion-acciones {
    display: flex;
    align-items: center;

    gap: 4px;
}


/*
|--------------------------------------------------------------------------
| TODOS / NINGUNO
|--------------------------------------------------------------------------
*/

.segmentacion-todos,
.segmentacion-ninguno {
    border: 1px solid #c8c8c8;

    border-radius: 6px;

    padding: 2px 6px;

    font-size: 10px;
    font-weight: 600;

    cursor: pointer;
}

.segmentacion-todos {
    background: #c9f1d8;
    color: #116b37;
}

.segmentacion-ninguno {
    background: #f7caca;
    color: #8c2020;
}


/*
|--------------------------------------------------------------------------
| BOTONES INDIVIDUALES
|--------------------------------------------------------------------------
*/

/* NO aplicado */

.segmento-boton {
    background: #f7caca;

    color: #6f1f1f;

    border: 1px solid #e0aaaa;

    border-radius: 6px;

    padding: 4px 9px;

    cursor: pointer;

    font-weight: 600;
}


/* Aplicado */

/*.segmento-boton.activo {
    background: #10b26c;

    color: #ffffff;

    border-color: #10b26c;
}*/


.segmento-boton:hover {
    filter: brightness(0.96);
}

.boton-accion-superior {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    box-sizing: border-box;
    line-height: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    background:
        linear-gradient(to bottom, #F4B084, #EF894B) padding-box;
    cursor: pointer;
    font-size: 13px;
    padding: 5px 6px;
    text-decoration: none;
    color: #000000;
}

.boton-accion-superior:hover {
    background: #F4B084;
    text-decoration: none;
    color: #000000;
}

.boton-enlace,
.formulario-grid button,
.fila-botones-filtros button,
.filtro-tabla-listas button {
    display: inline-block;
    background: #10b26c;
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

.boton-enlace:hover,
.formulario-grid button:hover,
.fila-botones-filtros button:hover,
.filtro-tabla-listas button:hover {
    background: #0d995c;
}

.boton-enlace-pequeno {
    padding: 10px 16px;
}

/* ===== LOGIN ===== */

.login-contenedor {
    min-height: calc(100vh - 58px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
}

.login-caja {
    background: #ffffff;
    padding: 30px;
    width: 360px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    border-radius: 8px;
    text-align: center;
}

.login-caja h1 {
    margin-top: 0;
    margin-bottom: 25px;
}

.login-caja form {
    text-align: left;
}

.login-caja input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin-top: 6px;
}

.login-caja button {
    width: 100%;
    padding: 12px;
    background: #10b26c;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.login-caja button:hover {
    background: #0d995c;
}

/* ===== FORMULARIOS ===== */

.formulario-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.fila-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 15px;
}

.fila-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 5px;
}

.campo {
    display: flex;
    flex-direction: column;
}

.campo label {
    margin: 4px;
    font-weight: 600;
}

.campo input,
.campo textarea,
.campo select {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
    font-size: 12px;
}

.campo-completo {
    margin-bottom: 5px;
}

.campo-completo textarea {
    width: 100%;
    min-height: 65px;
    height: 65px;
    resize: vertical;
}

/* ===== TABLA PRINCIPAL ===== */

.asunto-tarea {
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
    text-align: right;
}

.flecha-tarea {
    font-size:18px;
    line-height: 1;
    flex: 0 0 auto;
}

.texto-tarea {
    text-align: right;
}

.tabla-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    max-height: 300px;
}

.tabla-wrap-agenda {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    height: calc(100vh - 105px);
    max-height: calc(100vh - 105px);
    position: relative;
}

.tabla-agenda {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: fixed;
}

.tabla-agenda th {
    background: #2f2f2f;
    color: #fff;
    text-align: left;
    padding: 8px;
    border: 1px solid #dcdcdc;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
    font-size: 12px;
}

.tabla-agenda thead th {
    text-align: center;
    position: sticky;
}

.tabla-agenda thead tr:nth-child(1) th {
    top: 0;
    z-index: 30;
    background: #2f2f2f;
    font-size: 15px;
}

.tabla-agenda thead tr:nth-child(2) th {
    top: 34px;
    z-index: 29;
    background: #2f2f2f;
    vertical-align: middle;

}

.tabla-agenda thead tr:nth-child(3) th {
    top: 71px;
    z-index: 28;
    background: #d0d0d0;
    padding: 4px;
}

.tabla-agenda thead tr th {
    box-shadow: 0 1px 0 #dcdcdc;
}

.tabla-agenda td {
    padding: 8px;
    border: 1px solid #dcdcdc;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 12px;
}



.tabla-agenda td:first-child {
    padding: 4px 4px;
}

/* ===== FILAS ESPECIALES TABLA AGENDA ===== */

.tabla-agenda tbody tr.fila-tarea td {
    background: #f2f2f2;
    color: rgb(0,0,255);
}
.tabla-agenda tbody tr.fila-cabecera td {
    background: #757171;
    color: #ffffff;
}

.fila-seleccionable {
    cursor: pointer;
}

.tabla-agenda tbody tr.fila-seleccionable:hover td {
    background: #a9a5a5;
    cursor: pointer;
}

/*.tabla-agenda tbody tr.fila-seleccionable.fila-editando td {
    background-color: #e3f2fd !important;
}

.tabla-agenda tbody tr.fila-tarea:hover td{
    background: #fff;
}
.tabla-agenda tbody tr.fila-cabecera:hover td {
    
}*/

.btn-filtro {
    padding: 0;
    margin:0;
    width: auto;
    height: auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    line-height: 1;
    cursor: pointer;
}

.tabla-agenda thead tr:first-child th {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
}

/* =========================================================
   FILTRO DESPLEGABLE DE LOS ENCABEZADOS
   ========================================================= */

.encabezado-con-filtro {
    overflow: visible !important;
}

/* TÍTULO + FLECHA EN UNA SOLA LÍNEA */

.titulo-encabezado {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    flex-wrap: nowrap;
    white-space: nowrap;
}


/* PANEL */

.panel-filtro-encabezado {
    display: none;

    position: absolute !important;
    top: 100%;
    left: 0;

    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;

    padding: 9px;

    background: #fff;
    color: #111;

    border: 1px solid #aaa;
    border-radius: 4px;

    box-shadow: 0 7px 18px rgba(0,0,0,.22);

    box-sizing: border-box;

    text-align: left;
    font-size: 12px;
    font-weight: normal;

    white-space: normal !important;

    z-index: 1000;
}

.panel-filtro-encabezado.abierto {
    display: block;
}


/* BUSCADOR */

.buscador-filtro-encabezado {
    display: block;

    width: 100% !important;
    height: 25px;

    box-sizing: border-box;

    margin: 0 0 8px 0;
    padding: 2px 6px;

    border: 2px solid #222;
    border-radius: 7px;

    font-size: 12px;
}


/* SELECCIONAR TODO */

.acciones-filtro-encabezado {
    width: 100%;

    box-sizing: border-box;

    padding: 4px 3px 7px 3px;
    margin: 0;

    border-bottom: 1px solid #ddd;
}


/* LISTA DE OPCIONES */

.opciones-filtro-encabezado {
    width: 100% !important;
    max-height: 210px;

    box-sizing: border-box;

    padding: 5px 0;
    margin: 0;

    overflow-y: auto;
    overflow-x: hidden;

    border-bottom: 1px solid #ddd;
}


/* CADA OPCIÓN */

.opcion-filtro-encabezado {
    display: flex !important;
    align-items: center;

    width: 100%;

    box-sizing: border-box;

    gap: 5px;

    padding: 3px 3px;
    margin: 0;

    color: #111;

    font-size: 12px;
    font-weight: normal;
    line-height: 16px;

    white-space: nowrap !important;

    cursor: pointer;
}


/* CHECKBOX */

.opcion-filtro-encabezado input[type="checkbox"] {
    width: 13px;
    height: 13px;

    flex: 0 0 auto;

    margin: 0;
}


/* TEXTO OPCIONES */

.opcion-filtro-encabezado span {
    display: block;

    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;

    white-space: nowrap;
}


/* PIE */

.pie-filtro-encabezado {
    display: flex;

    justify-content: flex-end;
    align-items: center;

    gap: 7px;

    width: 100%;

    box-sizing: border-box;

    padding-top: 8px;
}


/* ACEPTAR / CANCELAR */

.pie-filtro-encabezado button {
    width: auto !important;
    min-width: 68px;
    height: 27px;

    padding: 2px 8px;

    background: #f5f5f5;
    color: #111;

    border: 1px solid #888;
    border-radius: 5px;

    font-size: 12px;
    font-weight: normal;

    cursor: pointer;
}

/* Primera fila del encabezado */
.tabla-agenda thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Segunda fila del encabezado */
.tabla-agenda thead tr:nth-child(2) th {
    position: sticky;
    top: 34px; /* altura de la primera fila */
    z-index: 19;
}

/* ===== ANCHOS TABLA ===== */

.tabla-agenda th:nth-child(1),
.tabla-agenda td:nth-child(1) { width: 45px; }

.tabla-agenda th:nth-child(2),
.tabla-agenda td:nth-child(2) { width: 115px; }

.tabla-agenda th:nth-child(3),
.tabla-agenda td:nth-child(3) { width: 69px; }

.tabla-agenda th:nth-child(4),
.tabla-agenda td:nth-child(4) { width: 140px; }

.tabla-agenda th:nth-child(5),
.tabla-agenda td:nth-child(5) { width: 72px; }

.tabla-agenda th:nth-child(6),
.tabla-agenda td:nth-child(6) { width: 55px; }

.tabla-agenda th:nth-child(7),
.tabla-agenda td:nth-child(7) { width: 100px; }

.tabla-agenda th:nth-child(8),
.tabla-agenda td:nth-child(8) { width: 64px; }

.tabla-agenda th:nth-child(9),
.tabla-agenda td:nth-child(9) { width: 150px; }

.tabla-agenda th:nth-child(10),
.tabla-agenda td:nth-child(10) { width: 150px; }

.tabla-agenda th:nth-child(11),
.tabla-agenda td:nth-child(11) { width: 150px; }

.tabla-agenda th:nth-child(12),
.tabla-agenda td:nth-child(12) { width: 60px; }

.tabla-agenda th:nth-child(13),
.tabla-agenda td:nth-child(13) { width: 72px; }

.tabla-agenda th:nth-child(14),
.tabla-agenda td:nth-child(14) { width: 110px; }

.tabla-agenda th:nth-child(15),
.tabla-agenda td:nth-child(15) { width: 65px; }

.tabla-agenda th:nth-child(16),
.tabla-agenda td:nth-child(16) { width: 72px; }

/* ===== ACCIONES TABLA ===== */

.acciones-tabla {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.acciones-tabla a {
    color: #10b26c;
    text-decoration: none;
    font-weight: 600;
}

.acciones-tabla a:hover {
    text-decoration: underline;
}

.accion-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.accion-icono:hover {
    transform: scale(1.06);
}

.accion-editar {
    background: #eef3ff;
}

.accion-editar:hover {
    background: #dbe7ff;
}

.accion-eliminar {
    background: #fff1f1;
}

.accion-eliminar:hover {
    background: #ffdede;
}

.boton-eliminar {
    background: #fff1f1;
    color: #c9302c;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.boton-eliminar:hover {
    background: #ffdede;
}

.form-estado-inline {
    margin: 0;
    width: 100%;
    display: block;
}

.tabla-agenda td .form-estado-inline {
    width: 100%;
}

.select-estado-inline {
    display: block;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    font-size: 13px;
    margin: 0;
}

.fila-orden-tabla th {
    background: #dcdcdc;
    vertical-align: middle;
}

.select-orden-tabla {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    font-size: 12px;
    margin: 0;
    background: #ededed;
}

/* ===== FILTROS TOM-SELECT PANEL LATERAL ===== */

.ts-control {
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 7px !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    flex-wrap: nowrap !important;
    align-items: center !important;
}

.ts-control > input {
    flex: 1 1 auto !important;
    width: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* ===== FILTROS ===== */
.label-con-plus {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-mini-plus {
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #d18b5a;
    background: #ffb07a;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    line-height: 22px;
}

.btn-mini-plus:hover {
    background: #e0e0e0;
}

.filtros-linea {
    margin-bottom: 25px;
}

.fila-filtros {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 15px;
    align-items: end;
}

.fila-botones-filtros {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* filtros dentro de tabla */

.fila-filtros-tabla th {
    padding: 4px;
    min-width: 0;
    vertical-align: top;
}

.fila-filtros-tabla select {
    width: 100%;
}

.fila-filtros-tabla .ts-wrapper {
    width: 100%;
    min-width: 0 !important;
}

.fila-filtros-tabla .ts-control {
    min-width: 0 !important;
    padding: 4px 6px;
    font-size: 13px;
}

.celda-acciones-filtro {
    min-width: 0;
    text-align: center;

}

.boton-limpiar-tabla {
    padding: 4px 5px;
    text-decoration: none;
    border-radius: 6px;
    background: #e9ecef;
    color: #000;
    white-space: normal;
    font-size: 9px;
}

/* Cada elemento seleccionado en una sola línea */
.ts-wrapper.multi .ts-control > div {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

/* El texto interno también en una sola línea */
.ts-wrapper.multi .ts-control > div.item {
    max-width: calc(100% - 12px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* La zona de selección no crece hacia abajo sin control */
.fila-filtros-tabla .ts-control,
.fila-prioridad-tabla .ts-control {
    max-height: 32px;
    overflow: hidden;
    flex-wrap: nowrap;
}

/* El input interno no empuje la altura */
.fila-filtros-tabla .ts-control input,
.fila-prioridad-tabla .ts-control input {
    min-width: 25px !important;
}

/* ===== PANEL COLUMNAS / SEGMENTACIONES ===== */

.barra-controles-superior {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.panel-columnas {
    position: relative;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.barra-botones-orden {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 0;
}

.segmentacion-plegable {
    margin-bottom: 0;
}

#toggleColumnas,
.btn-segmentacion,
.boton-orden-az {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    box-sizing: border-box;
    line-height: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    background:
        linear-gradient(to bottom, #F4B084, #EF894B) padding-box;
    cursor: pointer;
    font-size: 13px;
    padding: 5px 6px;
}

#toggleColumnas:hover,
.btn-segmentacion:hover,
.boton-orden-az:hover,
.formulario-grid button:hover {
    background: #F4B084;
}

.bloque-columnas {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.menu-columnas {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 8px;
    min-width: 125px;
}

.menu-columnas label {
    font-size: 12px;
}

.segmentaciones-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 18px;
}

.segmentaciones-wrap.oculto {
    display: none;
}

.segmentacion-bloque {
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 8px;
    min-width: 200px;
}

.segmentacion-titulo {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: left;
}

.segmentacion-opciones {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.segmento-boton {
    border: 1px solid #ccc;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #222;
}

.segmento-boton:hover {
    background: #e8edf2;
}



/* ===== TOM SELECT ===== */

.ts-dropdown .option {
    padding: 8px 10px;
    line-height: 1.3;
    border-bottom: 1px solid #e6e6e6;
    box-sizing: border-box;
}

.ts-dropdown .option:last-child {
    border-bottom: none;
}

.ts-dropdown .option.active {
    background: #eef3f7;
    color: #000;
}

.ts-dropdown .option.selected {
    background: #e2f3ea;
    color: #000;
    font-weight: 600;
}

/* ===== LISTAS ===== */

.bloques-listas {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.bloque-lista {
    width: 100%;
}
.campo select {
    appearance: auto;
    background: #fff;
}

.bloque-lista h2,
.bloque-lista h3 {
    margin-top: 0;
}

.bloque-lista .formulario-grid {
    max-width: 100%;
    margin: 0;
}

.bloque-lista .campo-completo {
    margin-bottom: 16px;
}

.bloque-lista .campo input,
.bloque-lista .campo select,
.bloque-lista .campo textarea,
.bloque-lista .campo-completo input,
.bloque-lista .campo-completo select,
.bloque-lista .campo-completo textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
}

.bloque-lista button {
    border-radius: 10px;
}

.form-eliminar {
    margin: 0;
}

.cabecera-tabla-listas {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 16px;
}

.cabecera-tabla-listas h3 {
    margin: 0;
}

.filtro-tabla-listas {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.filtro-tabla-listas label {
    font-weight: 600;
    margin: 0;
}

.filtro-tabla-listas select {
    min-width: 180px;
    padding: 10px;
    box-sizing: border-box;
}

/* ===== INICIO ===== */

.inicio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    align-items: start;
    box-sizing: border-box;
}

.apartado {
    background: #ffffff;
    border: 1px solid #d7deea;
    border-radius: 8px;
    padding: 14px;
    min-height: 410px;
    box-sizing: border-box;
    min-width: 0;
    margin-top: 10px;
}

.apartado h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
}

/* ===== TABLA MINI FECHAS ===== */

.tabla-mini-wrap {
    width: 100%;
    max-height: 360px;
    overflow-x: auto;
    overflow-y: auto;
}

.tabla-agenda-fechas {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.tabla-agenda-fechas th,
.tabla-agenda-fechas td {
    border: 1px solid #9fb4d8;
    padding: 6px 8px;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tabla-agenda-fechas thead th {
    background: #2f5da8;
    color: #fff;
    text-transform: uppercase;
    font-size: 12px;
}

.tabla-agenda-fechas .col-fecha {
    background: #b9c9e8;
    font-weight: bold;
    white-space: nowrap;
}

.cols-tareas col:nth-child(1) { min-width: 65px; }
.cols-tareas col:nth-child(2) { min-width: 100px; }
.cols-tareas col:nth-child(3) { min-width: 55px; }
.cols-tareas col:nth-child(4) { min-width: 72px; }
.cols-tareas col:nth-child(5) { min-width: 65px; }
.cols-tareas col:nth-child(6) { min-width: 150px; }

/* ===== CALENDARIO 14 DÍAS ===== */

.tareas14-wrap {
    overflow: visible;
}

.tareas14-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 2px;
    align-items: start;
}

.tareas14-dia-nombre {
    font-weight: 700;
    text-align: center;
    padding: 6px 4px;
    background: #f1f1f1;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    font-size: 13px;
}

.tareas14-celda {
    border: 1px solid #d3d3d3;
    background: #fff;
    border-radius: 6px;
    padding: 6px;
    box-sizing: border-box;
    min-height: 60px;
    height: auto;
    overflow: visible;
}

.tareas14-celda.fuera-rango {
    background: #fafafa;
    opacity: 0.55;
}

.tareas14-celda.hoy {
    border: 2px solid #7da2d6;
}

.tareas14-numero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.tareas14-fecha-mini {
    font-size: 11px;
    color: #666;
    font-weight: 400;
}

.tarea14-item {
    background: #ffffff;
    border: 1px solid #dbe2ee;
    border-left: 3px solid #3366b0;
    border-radius: 6px;
    padding: 4px 4px;
    margin-bottom: 5px;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
}

.tarea14-linea {
    border-top: 1px solid #e1e1e1;
    margin: 1px 0;
}

.tarea14-plazo {
    text-align: right;
    font-size: 10px;
    line-height: 1.15;
    color: #c62828;
    font-weight: 700;
    min-height: 13px;
}

.tarea14-tarea {
    text-align: left;
    font-size: 12px;
    line-height: 1.2;
    color: #111;
    font-weight: 600;
    word-break: break-word;
}

.tarea14-hora {
    color: #333;
    font-weight: 400;
    white-space: nowrap;
}

.tarea14-asunto {
    text-align: left;
    font-size: 12px;
    line-height: 1.2;
    color: #111;
    word-break: break-word;
}

.tarea14-urgencia {
    text-align: right;
    font-size: 10px;
    line-height: 1.15;
    color: #1565c0;
    font-weight: 700;
    min-height: 13px;
    word-break: break-word;
}

.tarea14-tarea,
.tarea14-asunto,
.tarea14-urgencia,
.tarea14-plazo {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tarea14-item,
.tarea14-item * {
    font-weight: normal !important;
}
/* ===== CALENDARIO ALARMAS ===== */

.calendario-wrap {
    overflow: visible;
}

.calendario-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.calendario-cabecera h3 {
    margin: 0;
}

.calendario-cabecera a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    height: 36px;
    padding: 0 12px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    background: #2f2f2f;
    color: #fff;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
}

.calendario-cabecera a:hover {
    background: #444;
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 2px;
    align-items: start;
}

.cal-dia-nombre {
    font-weight: 700;
    text-align: center;
    padding: 6px 4px;
    background: #f1f1f1;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    font-size: 13px;
}

.cal-celda {
    border: 1px solid #d3d3d3;
    background: #fff;
    border-radius: 6px;
    padding: 6px;
    box-sizing: border-box;
    min-height: 60px;
    height: auto;
    overflow: visible;
}

.cal-celda.vacia {
    background: #fafafa;
}

.cal-celda.hoy {
    border: 2px solid #7da2d6;
}

.cal-numero {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.cal-evento {
    margin-bottom: 6px;
    padding-left: 6px;
    border-left: 3px solid #2ab673;
}

.cal-asunto {
    font-size: 12px;
    line-height: 1.2;
    word-break: break-word;
}
.fila-2-listas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}

/* ===== TAREAS POR HERRAMIENTA ===== */
.apartado3-contenedor {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: start;
}

.apartado3-bloque {
    min-width: 0;
}

.apartado3-bloque h3 {
    margin: 0 0 8px 0;
    font-size: 13px;
}

.apartado3-tabla-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #bfcde3;
    border-radius: 6px;
    background: #fff;
}

.apartado3-tabla {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
    background: #fff;
}

.apartado3-tabla th,
.apartado3-tabla td {
    border: 1px solid #d6deeb;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.apartado3-tabla thead th {
    background: #2f5da8;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.apartado3-tabla tbody tr:nth-child(even) td {
    background: #f7f9fc;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
    .apartado3-contenedor {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 900px) {
    .inicio-grid,
    .bloques-listas,
    .fila-2-listas {
        grid-template-columns: 1fr;
    }

    .cabecera-tabla-listas {
        flex-direction: column;
        align-items: stretch;
    }

    .filtro-tabla-listas {
        align-items: stretch;
    }
}

@media (min-width: 1600px) {
    /*.tabla-agenda thead tr:nth-child(2) th {
        top: 34px;
    }

    .tabla-agenda thead tr:nth-child(3) th {
        top: 71px;
    }*/

    .cols-tareas col:nth-child(1) { min-width: 65px; }
    .cols-tareas col:nth-child(2) { min-width: 130px; }
    .cols-tareas col:nth-child(3) { min-width: 50px; }
    .cols-tareas col:nth-child(4) { min-width: 65px; }
    .cols-tareas col:nth-child(5) { min-width: 65px; }
    .cols-tareas col:nth-child(6) { min-width: 255px; }
}

.layout-agenda {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.zona-agenda {
    width: 80%;
    min-width: 0;
    margin-top: 5px;
}

.zona-agenda.expandida {
    width: 100%;
}

.panel-agenda-lateral {
    width: 20%;
    min-width: 240px;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 0 8px rgba(0,0,0,0.12);
    box-sizing: border-box;
    overflow-y: auto;
    max-height: calc(100vh - 105px);
    margin-top: 5px;
}

.panel-agenda-lateral.oculto {
    display: none;
}

.bloque-panel {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: #fafafa;
}

.bloque-panel h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.panel-agenda-lateral .boton-accion-superior {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    text-align: center;
}

.panel-agenda-lateral .menu-columnas {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
}

.panel-agenda-lateral .menu-columnas label {
    display: block;
    margin-bottom: 6px;
}

.panel-tabs-agenda {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-panel {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    background: #2f2f2f;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.tab-panel.activo {
    background: #2f6f57;
}

.boton-panel-agenda {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: #f28c4b;
    color: black;
    font-weight: 700;
    cursor: pointer;
}

.fila-lista-click,
.fila-tipo-lista-click {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.fila-lista-click:hover,
.fila-tipo-lista-click:hover {
    background-color: #eaf3ff;
    box-shadow: inset 4px 0 0 #2f80ed;
}

.fila-lista-click:active,
.fila-tipo-lista-click:active {
    transform: scale(0.99);
}

.fila-lista-click.fila-editando,
.fila-tipo-lista-click.fila-editando {
    background-color: #d9ecff;
    box-shadow: inset 4px 0 0 #005bbb;
    font-weight: 600;
}

.fila-superior-agenda {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.fila-generar-tarea {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.fila-generar-tarea input {
    width: 220px;
}

.fila-generar-tarea button {
    white-space: nowrap;
}
.formulario-grid button{
    padding: 5px;
    box-sizing: border-box;
    line-height: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    background:
        linear-gradient(to bottom, #F4B084, #EF894B) padding-box;
    cursor: pointer;
    font-size: 13px;
    padding: 5px 6px;
    text-decoration: none;
    color: #000000;

}

.fila-grupo-tarea {
    cursor: pointer;
}

.fila-grupo-tarea:hover,
.fila-grupo-tarea:hover td  {
    background-color: #a3c3ff !important;
}

.enlace-asunto-servas {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.enlace-asunto-servas:hover {
    text-decoration: underline;
}


/* Estadística */

.estadistica-form-materia {
    margin-bottom: 18px;
}

.estadistica-form-materia select {
    min-width: 280px;
    padding: 7px;
}

/* Máximo 4 vistas por fila */
.estadistica-grid-vistas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

/* Cada vista ocupa una columna */
.estadistica-vista {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.estadistica-vista-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.estadistica-vista-cabecera h3 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.estadistica-vista-cabecera span {
    white-space: nowrap;
    font-size: 13px;
    color: #666;
}

.estadistica-configuracion {
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    background: #fafafa;
}

.estadistica-campo {
    min-width: 0;
}

/* Panel desplegable de descriptores */
details.estadistica-campo {
    position: relative;
}

details.estadistica-campo[open] .estadistica-checks {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;

    width: 260px;
    max-height: 250px;
    overflow-y: auto;

    padding: 10px;
    margin-top: 5px;

    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.estadistica-checks label {
    display: block;
    margin-bottom: 5px;
}

.estadistica-campo select {
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    box-sizing: border-box;
}

.estadistica-tabla-wrap {
    width: 100%;
    overflow-x: auto;
}

.estadistica-tabla-wrap table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
}

.estadistica-tabla-wrap th,
.estadistica-tabla-wrap td {
    overflow-wrap: anywhere;
}

.fila-grupo-estadistica {
    cursor: pointer;
    font-weight: bold;
}

/* 3 vistas por fila */
@media (max-width: 1600px) {
    .estadistica-grid-vistas {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* 2 vistas por fila */
@media (max-width: 1200px) {
    .estadistica-grid-vistas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 1 vista por fila */
@media (max-width: 700px) {
    .estadistica-grid-vistas {
        grid-template-columns: minmax(0, 1fr);
    }

    .estadistica-form-materia select {
        width: 100%;
        min-width: 0;
    }
}

/* Inicio */

/* =========================================================
   CONTENEDOR DE LOS BOTONES DE ORDEN
   ========================================================= */

.ordenes-tabla {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}


/* =========================================================
   CADA COLUMNA ORDENABLE
   ========================================================= */

.orden-columna {
    position: relative;
}


/* =========================================================
   BOTÓN PRINCIPAL: ASUNTO / TAREA / URGENCIA
   ========================================================= */

.orden-desplegable-btn {
    display: block;

    height: 22px;
    padding: 1px 7px;

    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: normal;
    line-height: 18px;

    color: #111;
    background: #fff;

    border: 1px solid #888;
    border-radius: 3px;

    cursor: pointer;
    white-space: nowrap;
}

.orden-desplegable-btn:hover {
    background: #f5f5f5;
}


/* =========================================================
   MENÚ DESPLEGABLE
   ========================================================= */

.orden-desplegable-menu {
    display: none;

    position: absolute;
    top: calc(100% + 1px);
    left: 0;

    z-index: 9999;

    min-width: 65px;

    padding: 3px;

    background: #fff;

    border: 1px solid #d4d4d4;
    border-radius: 4px;

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15);
}


/* Cuando está abierto */

.orden-desplegable-menu.abierto {
    display: flex;
    flex-direction: column;
    gap: 1px;
}


/* =========================================================
   OPCIONES A → Z / Z → A
   ========================================================= */

.orden-desplegable-menu button {
    display: block;

    width: 100%;

    padding: 5px 7px;

    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: normal;
    line-height: 16px;

    color: #111;
    text-align: left;

    background: transparent;

    border: 0;
    border-radius: 4px;

    cursor: pointer;
    white-space: nowrap;
}


/* Al pasar el ratón */

.orden-desplegable-menu button:hover {
    background: #f0f0f0;
}


/* =========================================================
   ORDEN ACTUAL
   Igual que el "No" naranja de tu imagen
   ========================================================= */

.orden-desplegable-menu button.activo {
    color: #fff;
    background: #f28a50;
}


/* Mantener naranja aunque pases el ratón */

.orden-desplegable-menu button.activo:hover {
    color: #fff;
    background: #f28a50;
}

.asunto-con-fecha {
    color: red !important;
    text-decoration: none;
    font: inherit;
}

button.asunto-con-fecha {
    color: red !important;
    text-decoration: none;
    font: inherit;
}


