/* =============================================
   DELEGADOS - Listado por empresa
   ============================================= */

.deleg-section { padding: 40px 0 50px; }

.deleg-header { text-align: center; margin-bottom: 36px; }
.deleg-header-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; background: #f0faf2; border-radius: 50%; margin-bottom: 14px; }
.deleg-header-icon i { font-size: 28px; color: #0B5C21; }
.deleg-header h1 { font-family: 'Lato', sans-serif; font-size: 30px; font-weight: 700; color: #1a1a1a; margin: 0 0 8px 0; }
.deleg-header p { font-size: 15px; color: #666; margin: 0 auto; max-width: 550px; }

/* Estadísticas generales */
.deleg-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.deleg-stat {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 18px 28px;
    text-align: center;
    min-width: 140px;
    transition: border-color 0.2s;
}

.deleg-stat:hover { border-color: #c8e6cc; }

.deleg-stat-num {
    font-family: 'Lato', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0B5C21;
    display: block;
    line-height: 1;
}

.deleg-stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
    display: block;
}

/* Buscador */
.deleg-search {
    max-width: 500px;
    margin: 0 auto 32px;
    position: relative;
}

.deleg-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 16px;
}

.deleg-search input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Lato', sans-serif;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.deleg-search input:focus {
    outline: none;
    border-color: #0B5C21;
    box-shadow: 0 0 0 3px rgba(11, 92, 33, 0.1);
}

.deleg-search input::placeholder { color: #bbb; }

.deleg-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 15px;
    display: none;
}

.deleg-no-results i { font-size: 40px; color: #ddd; display: block; margin-bottom: 12px; }

/* =====================
   ACORDEÓN DE EMPRESAS
   ===================== */

.deleg-empresas {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.deleg-empresa {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.deleg-empresa:hover { border-color: #c8e6cc; }

.deleg-empresa.open {
    border-color: #0B5C21;
    box-shadow: 0 4px 16px rgba(11, 92, 33, 0.08);
}

/* Cabecera de empresa (clickeable) */
.deleg-empresa-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.deleg-empresa-header:hover { background: #f8fdf9; }

.deleg-empresa-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    background: #f0faf2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.deleg-empresa.open .deleg-empresa-icon { background: #0B5C21; }
.deleg-empresa-icon i { font-size: 18px; color: #0B5C21; transition: color 0.2s; }
.deleg-empresa.open .deleg-empresa-icon i { color: #fff; }

.deleg-empresa-info { flex: 1; }

.deleg-empresa-nombre {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.deleg-empresa-cant {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.deleg-empresa-arrow {
    color: #ccc;
    font-size: 14px;
    transition: transform 0.3s, color 0.2s;
}

.deleg-empresa.open .deleg-empresa-arrow {
    transform: rotate(180deg);
    color: #0B5C21;
}

/* Contenido desplegable */
.deleg-empresa-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.deleg-empresa.open .deleg-empresa-body {
    max-height: 1000px;
}

.deleg-lista {
    padding: 4px 20px 16px;
    list-style: none;
    margin: 0;
    border-top: 1px solid #f0f0f0;
}

.deleg-lista li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
}

.deleg-lista li:last-child { border-bottom: none; }

.deleg-lista li::before {
    content: '\f007';
    font-family: FontAwesome;
    font-size: 13px;
    color: #0B5C21;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: #f0faf2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge de cantidad */
.deleg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    background: #e8f5ea;
    color: #0B5C21;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
    flex-shrink: 0;
}

.deleg-empresa.open .deleg-badge {
    background: #0B5C21;
    color: #fff;
}

/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 768px) {
    .deleg-header h1 { font-size: 24px; }
    .deleg-stats { gap: 12px; }
    .deleg-stat { padding: 14px 20px; min-width: 110px; }
    .deleg-stat-num { font-size: 26px; }
    .deleg-empresa-header { padding: 14px 16px; gap: 12px; }
    .deleg-empresa-nombre { font-size: 15px; }
    .deleg-lista { padding: 4px 16px 12px; }
}

@media (max-width: 560px) {
    .deleg-section { padding: 24px 0 36px; }
    .deleg-header h1 { font-size: 20px; }
    .deleg-header-icon { width: 50px; height: 50px; }
    .deleg-header-icon i { font-size: 22px; }
    .deleg-stats { gap: 8px; }
    .deleg-stat { padding: 12px 16px; min-width: 90px; }
    .deleg-stat-num { font-size: 22px; }
    .deleg-stat-label { font-size: 10px; }
    .deleg-empresa-icon { width: 36px; height: 36px; min-width: 36px; }
    .deleg-empresa-icon i { font-size: 15px; }
    .deleg-empresa-nombre { font-size: 14px; }
    .deleg-empresa-cant { font-size: 11px; }
    .deleg-lista li { font-size: 13px; gap: 10px; padding: 8px 0; }
    .deleg-lista li::before { width: 24px; height: 24px; min-width: 24px; font-size: 11px; }
    .deleg-search input { font-size: 14px; padding: 11px 14px 11px 40px; }
}

/* Widescreen */
@media (min-width: 1400px) {
    .deleg-empresas { max-width: 1000px; }
}

@media (min-width: 1920px) {
    .deleg-empresas { max-width: 1100px; }
}
