.agenda-calendar-app,
.agenda-calendar-app * {
    box-sizing: border-box;
}

.agenda-calendar-app {
    width: 100%;
    font-family: inherit;
    color: #1f2937;
}

.agenda-calendar-shell {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(320px, 1fr);
    gap: 28px;
    align-items: start;
}

.agenda-calendar-left,
.agenda-calendar-right {
    min-width: 0;
}

.agenda-calendar-box,
.agenda-day-list-box,
.agenda-event-detail {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.agenda-calendar-box {
    padding: 20px;
}

.agenda-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}

.agenda-cal-month-label {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    text-align: center;
    flex: 1;
    text-transform: capitalize;
}

.agenda-cal-nav,
.agenda-cal-today {
    appearance: none;
    border: none;
    background: #f3f4f6;
    color: #111827;
    min-width: 42px;
    min-height: 42px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    transition: all 0.2s ease;
}

.agenda-cal-nav:hover,
.agenda-cal-today:hover {
    background: #111827;
    color: #ffffff;
}

.agenda-calendar-filter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agenda-calendar-filter-label {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
}

.agenda-calendar-province-filter, .agenda-calendar-category-filter {
    min-height: 40px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 8px 12px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

.agenda-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.agenda-cal-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    padding: 8px 0;
    text-transform: uppercase;
}

.agenda-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.agenda-cal-day {
    position: relative;
    min-height: 52px;
    border: 1px solid transparent;
    background: #ffffff;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    font-weight: 700;
    color: #111827;
    transition: all 0.2s ease;
}

.agenda-cal-day:hover {
    border-color: rgba(37, 99, 235, 0.18);
    background: #f8fafc;
}

.agenda-cal-day.is-outside {
    color: #c0c4cc;
    background: #fafafa;
}

.agenda-cal-day.is-selected {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.24);
}

.agenda-cal-day.has-events::after {
    content: "";
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #2563eb;
}

.agenda-cal-day.is-selected.has-events::after {
    background: #ffffff;
}

.agenda-cal-footer {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.agenda-day-list-box {
    margin-top: 18px;
    padding: 18px;
}

.agenda-day-list-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.agenda-day-selected-label {
    margin-top: 6px;
    color: #6b7280;
    font-size: 14px;
}

.agenda-day-events {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-day-event-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
}

.agenda-day-event-item:hover {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, 0.18);
}

.agenda-day-event-item.is-active {
    border-color: #4f46e5;
    background: #eef2ff;
}

.agenda-day-event-time {
    font-size: 13px;
    font-weight: 800;
    color: #4f46e5;
    margin-bottom: 4px;
}

.agenda-day-event-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}

.agenda-day-no-events {
    color: #6b7280;
    font-size: 14px;
}

.agenda-day-show-more {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    color: #4f46e5;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
}

.agenda-day-show-more:hover {
    background: #eef2ff;
    border-color: #4f46e5;
}

.agenda-event-detail {
    overflow: hidden;
}

.agenda-event-detail-body {
    padding: 28px;
}

.agenda-event-detail-date {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    color: #4f46e5;
    background: #eef2ff;
    padding: 7px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.agenda-event-detail-title {
    margin: 0 0 14px;
    font-size: 34px;
    line-height: 1.12;
    font-weight: 800;
    color: #111827;
}

.agenda-event-detail-time,
.agenda-event-detail-location {
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
    line-height: 1.5;
}

.agenda-event-detail-description {
    margin-top: 18px;
    font-size: 16px;
    line-height: 1.75;
    color: #374151;
}

.agenda-event-detail-actions {
    margin-top: 24px;
    display: none;
}

.agenda-event-detail-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 12px;
    background: #111827;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
    cursor: pointer;
}

.agenda-event-detail-button:hover {
    background: #e11d48;
    color: #ffffff !important;
}

.agenda-google-calendar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    background: #111827;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 14px;
    padding: 12px 18px;
    margin-top: 10px;
    border-radius: 12px;
    text-decoration: none !important;
    line-height: 1;
    transition: all 0.2s ease;
    cursor: pointer;
}

.agenda-google-calendar:hover {
    background: #e11d48;
    color: #ffffff !important;
}

.agenda-event-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agenda-event-detail.is-empty .agenda-event-detail-body {
    padding: 28px;
}

.agenda-event-detail-title a {
    color: inherit;
    text-decoration: none;
}

.agenda-event-detail-title a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {

    .agenda-calendar-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "calendar"
            "detail"
            "events";
    }

    .agenda-calendar-left {
        display: contents;
    }

    .agenda-calendar-box {
        grid-area: calendar;
    }

    .agenda-calendar-right {
        grid-area: detail;
    }

    .agenda-day-list-box {
        grid-area: events;
    }

    .agenda-event-detail-title {
        font-size: 28px;
    }
}

@media (max-width: 640px) {

    .agenda-calendar-box,
    .agenda-day-list-box,
    .agenda-event-detail {
        border-radius: 16px;
    }

    .agenda-calendar-box {
        padding: 16px;
    }

    .agenda-cal-month-label {
        font-size: 22px;
    }

    .agenda-cal-grid {
        gap: 6px;
    }

    .agenda-cal-day {
        min-height: 46px;
        border-radius: 12px;
        font-size: 14px;
    }

    .agenda-event-detail-body {
        padding: 18px;
    }

    .agenda-event-detail-title {
        font-size: 24px;
    }

    .agenda-event-detail-description {
        font-size: 15px;
    }
}

.agenda-calendar-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
    align-items: start;
}

.agenda-calendar-filter-row label {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
}

.agenda-calendar-province-filter,
.agenda-calendar-category-filter {
    width: 100%;
}

@media (max-width: 640px) {

    .agenda-calendar-filters {
        grid-template-columns: 1fr;
    }

}

body[data-theme="dark"] .agenda-calendar-box,
body[data-theme="dark"] .agenda-day-list-box,
body[data-theme="dark"] .agenda-event-detail {
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

body[data-theme="dark"] .agenda-calendar-app {
    color: #e5e7eb;
}

body[data-theme="dark"] .agenda-cal-day {
    background: #111827;
    color: #e5e7eb;
}

body[data-theme="dark"] .agenda-cal-day:hover {
    background: #1f2937;
}

body[data-theme="dark"] .agenda-day-event-item {
    background: #111827;
    border-color: rgba(255,255,255,0.08);
}

body[data-theme="dark"] .agenda-day-event-item:hover {
    background: #1f2937;
}

body[data-theme="dark"] .agenda-event-detail-title {
    color: #f9fafb;
}

body[data-theme="dark"] .agenda-event-detail-time,
body[data-theme="dark"] .agenda-event-detail-location {
    color: #d1d5db;
}

body[data-theme="dark"] .agenda-day-list-title {
    color: #f9fafb;
}

body[data-theme="dark"] .agenda-day-selected-label {
    color: #9ca3af;
}

body[data-theme="dark"] .agenda-calendar-province-filter,
body[data-theme="dark"] .agenda-calendar-category-filter {
    background: #111827;
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.08);
}

body[data-theme="dark"] .agenda-calendar-province-filter option,
body[data-theme="dark"] .agenda-calendar-category-filter option {
    background: #111827;
    color: #e5e7eb;
}

body[data-theme="dark"] .agenda-calendar-filter-label {
    color: #9ca3af;
}

body[data-theme="dark"] .agenda-cal-nav,
body[data-theme="dark"] .agenda-cal-today {
    background: #111827;
    color: #e5e7eb;
}

body[data-theme="dark"] .agenda-cal-nav:hover,
body[data-theme="dark"] .agenda-cal-today:hover {
    background: #4f46e5;
    color: #ffffff;
}

body[data-theme="dark"] .agenda-cal-month-label {
    color: #f9fafb;
}

body[data-theme="dark"] .agenda-cal-weekdays span {
    color: #9ca3af;
}

body[data-theme="dark"] .agenda-day-event-title {
    color: #e5e7eb;
}

body[data-theme="dark"] .agenda-day-event-time {
    color: #818cf8;
}

body[data-theme="dark"] .agenda-day-show-more {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    color: #818cf8;
}

body[data-theme="dark"] .agenda-day-show-more:hover {
    background: #1f2937;
}

/* resaltar día seleccionado en dark mode */

body[data-theme="dark"] .agenda-cal-day.is-selected {

    background: #6366f1;
    color: #ffffff;

    box-shadow: 
        0 0 0 2px rgba(99,102,241,0.35),
        0 12px 30px rgba(99,102,241,0.35);

}

.agenda-calendar-province-filter,
.agenda-calendar-category-filter {
    cursor: pointer;
}