* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    color: #1f2937;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

.page-header {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #fff;
    padding: 56px 0 32px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.8;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    margin-bottom: 24px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field label {
    font-weight: 700;
    font-size: 0.85rem;
    color: #374151;
}

.field input,
.field select {
    width: 100%;
    height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.96rem;
    background: #fff;
}

.search-field { grid-column: span 1; }

.actions-row {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 12px;
}

button,
.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    border: none;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
}

button,
.primary-button {
    background: #2563eb;
    color: #fff;
}

button:hover,
.primary-button:hover {
    transform: translateY(-1px);
}

.secondary-button {
    background: #e2e8f0;
    color: #0f172a;
}

.results-header {
    margin: 12px 0 18px;
}

.results-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.agenda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 22px;
}

.agenda-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.date-range {
    font-size: 0.8rem;
    font-weight: 700;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 6px 10px;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge.presencial {
    background: #dcfce7;
    color: #166534;
}

.badge.online {
    background: #fef3c7;
    color: #92400e;
}

h3 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.35;
    color: #0f172a;
}

.card-details {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-details li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 8px;
    font-size: 0.94rem;
}

.card-details li span {
    color: #475569;
}

.card-details li strong {
    text-align: right;
}

.card-footer {
    margin-top: auto;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.load-more-button {
    min-width: 180px;
}

.empty-state,
.alert {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    color: #334155;
}

.alert.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.alert pre {
    white-space: pre-wrap;
    margin: 16px 0 0;
    font-size: 0.85rem;
}

@media (max-width: 820px) {
    .filters {
        grid-template-columns: 1fr;
    }

    .actions-row {
        justify-content: stretch;
    }

    .actions-row > * {
        flex: 1;
    }

    .card-details li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .card-details li strong {
        text-align: left;
    }
}
