/* --- Collapsible summary/detail sections --- */
.es-section {
    border: 1px solid #dee2e6;
    border-left: 4px solid #0d6efd;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.es-section--summary { border-left-color: #198754; }
.es-section--info { border-left-color: #0dcaf0; }
.es-section--danger { border-left-color: #dc3545; }

.es-section__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, #f8f9fa, #eef1f4);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

/* Hide the native disclosure triangle in favour of the chevron below */
.es-section__summary::-webkit-details-marker { display: none; }
.es-section__summary::marker { content: ''; }

.es-section__summary:hover { background: linear-gradient(180deg, #eef1f4, #e2e6ea); }

.es-section__summary:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

.es-section__title {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.es-section__icon {
    margin-right: 0.5rem;
    color: #0d6efd;
}

.es-section--summary .es-section__icon { color: #198754; }
.es-section--info .es-section__icon { color: #0aa2c0; }
.es-section--danger .es-section__icon { color: #dc3545; }

.es-section__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-left: auto;
    font-weight: 500;
}

/* Chevron indicator, drawn in CSS so it needs no icon font */
.es-section__meta::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.35rem;
    border-right: 2px solid #6c757d;
    border-bottom: 2px solid #6c757d;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.2s ease;
}

.es-section[open] > .es-section__summary .es-section__meta::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}

.es-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #e9ecef;
    color: #495057;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.es-chip--accent {
    background: #d1e7dd;
    color: #0f5132;
}

.es-section__body {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    animation: esReveal 0.18s ease-out;
}

@keyframes esReveal {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 575.98px) {
    .es-section__summary { padding: 0.65rem 0.75rem; }
    .es-section__body { padding: 0.75rem; }
    .es-section__meta { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .es-section__body { animation: none; }
    .es-section__meta::after { transition: none; }
}

@media print {
    .es-section__body { display: block !important; }
    .es-section__meta::after { display: none; }
}

@keyframes flash {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

.alert-flash {
    animation: flash 2s infinite;
}

.alert-danger.alert-flash {
    border-width: 3px;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}