/* ============================================
   Dashboard - Modulo Agenda
   ============================================ */

/* Lista: una fila por ítem (horizontal) */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: stretch;
}

.agenda-list > .text-center {
    width: 100%;
}

.agenda-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.45rem 0.6rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    min-height: 0;
    min-width: 0;
}

.agenda-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.agenda-item-pinned { border-left: 4px solid #f59e0b; background: #fffdf5; }

/* Fila horizontal: un movimiento por línea */
.agenda-item.agenda-item--row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    cursor: pointer;
}

.agenda-item-time {
    flex: 0 0 3.1rem;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    font-weight: 700;
    color: #212529;
    white-space: nowrap;
}

.agenda-item-badges-compact {
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.agenda-item-badges-compact .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-align: left;
    line-height: 1.25;
    max-width: none;
}

.agenda-item-lawyer {
    flex: 0 1 8.5rem;
    min-width: 5rem;
    font-size: 0.78rem;
    color: #495057;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
}

.agenda-item-center {
    flex: 1 1 16rem;
    min-width: min(100%, 12rem);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    justify-content: flex-start;
}

.agenda-item-title-strong {
    font-size: 0.84rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.agenda-item-sub {
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.agenda-item-tags-compact {
    flex: 1 1 14rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem 0.2rem;
    min-width: 0;
}

.agenda-item-tags-compact .badge {
    font-size: 0.62rem;
    padding: 0.15em 0.35em;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    text-align: left;
    line-height: 1.25;
}

.agenda-item-toolbar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    margin-left: auto;
    align-self: center;
}

.agenda-item-toolbar .btn-group-sm > .btn,
.agenda-item-toolbar .btn-sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.72rem;
}

.agenda-item-toolbar .btn-group-sm .dropdown-toggle {
    padding: 0.15rem 0.4rem;
}

/* Legacy (por si queda HTML antiguo en caché) */
.agenda-item-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 0.5rem; gap: 0.35rem; }
.agenda-item-title { font-weight: 600; font-size: 0.95rem; color: #212529; flex: 1; margin-right: 0; min-width: 0; }
.agenda-item-expediente { font-size: 0.85rem; color: #6c757d; font-family: monospace; }
.agenda-item-tags { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }

.badge-fuente-pjn { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important; color: #fff !important; border: none; }
.badge-fuente-srt { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important; color: #fff !important; border: none; }
.badge-fuente-mev { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; color: #fff !important; border: none; }
.badge-fuente-eje { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; color: #fff !important; border: none; }

.agenda-item-caratula,
.agenda-item-damnificado {
    color: #6c757d; font-size: 0.8rem; line-height: 1.35; word-break: break-word; max-width: 100%;
}
.agenda-item-body {
    color: #495057;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: 7.5rem;
}

.agenda-item-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; }
.agenda-item-meta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.agenda-item-responsable { display: flex; align-items: center; gap: 0.25rem; }
.agenda-item-vencimiento { display: flex; align-items: center; gap: 0.25rem; color: #dc3545; font-weight: 500; }
.agenda-item-vencimiento.vencido { color: #dc3545; }
.agenda-item-vencimiento.proximo { color: #ffc107; }
.agenda-item-acciones { display: flex; gap: 0.5rem; }
.agenda-item-acciones button {
    background: none; border: none; padding: 0.25rem 0.5rem; cursor: pointer; color: #6c757d; transition: color 0.2s;
}
.agenda-item-acciones button:hover { color: #212529; }

.badge-importante { background-color: #0d6efd; color: white; }
.badge-judicial { background-color: #6f42c1; color: white; }
.badge-pendiente { background-color: #dc3545; color: white; }
.badge-hecho { background-color: #6c757d; color: white; }

@media (max-width: 767.98px) {
    .agenda-item-lawyer {
        flex-basis: 100%;
        order: 3;
    }
    .agenda-item-center {
        flex-basis: 100%;
        order: 2;
    }
    .agenda-item-toolbar {
        width: 100%;
        justify-content: flex-end;
        order: 10;
    }
}

/* --- Ordenar por (estilo menú tipo marketplace) --- */
.agenda-sort-inline-label {
    font-size: 0.9rem;
    font-weight: 400;
    color: #212529;
    white-space: nowrap;
}

.agenda-sort-dropdown {
    position: relative;
}

.agenda-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    padding: 0.2rem 0.3rem;
    font-size: 0.9rem;
    color: #212529;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1.2;
}

.agenda-sort-trigger:hover {
    background: rgba(13, 110, 253, 0.06);
}

.agenda-sort-trigger[aria-expanded="true"] .agenda-sort-chevron {
    transform: rotate(180deg);
}

.agenda-sort-chevron {
    color: #0d6efd;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.agenda-sort-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    margin: 0;
    padding: 0.4rem 0;
    list-style: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8eaed;
    z-index: 1080;
}

.agenda-sort-option {
    padding: 0.55rem 1rem 0.55rem 0.75rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #212529;
    border-bottom: 1px solid #ececec;
    border-left: 4px solid transparent;
    transition: background 0.15s ease;
}

.agenda-sort-option:last-child {
    border-bottom: none;
}

.agenda-sort-option:hover {
    background: #f8f9fa;
}

.agenda-sort-option.is-active {
    color: #0d6efd;
    font-weight: 600;
    border-left-color: #0d6efd;
    background: #fff;
}

/* --- Paginación bajo la lista --- */
.agenda-list-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.agenda-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1rem;
    padding: 0.65rem 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid #e9ecef;
}

.agenda-pagination-info {
    min-width: 8rem;
    text-align: center;
}
