.temarios-page {
    padding: 56px 0 84px;
    background: #ffffff;
}

.temarios-hero {
    text-align: center;
    margin-bottom: 34px;
}

.temarios-hero h1 {
    margin: 0 0 12px;
    color: #102447;
    font-size: clamp(2.1rem, 3vw, 3.1rem);
    line-height: 1.15;
}

.temarios-hero p {
    width: min(100%, 800px);
    margin: 0 auto;
    color: #4a617f;
    font-size: 1rem;
    line-height: 1.7;
}

.temarios-year-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.temarios-year-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #eef6f0;
    color: #1f5c42;
    font-weight: 700;
    border: 1px solid #cfe2d4;
}

.temarios-year-link.active {
    background: #41b359;
    color: #ffffff;
    border-color: #41b359;
}

.temarios-year-section {
    margin-bottom: 48px;
}

.temarios-year-title {
    margin: 0 0 22px;
    color: #2a3f7e;
    font-size: clamp(1.7rem, 2.4vw, 2.3rem);
    text-align: center;
}

.temarios-course-block {
    margin-bottom: 28px;
}

.temarios-course-title {
    margin: 0 0 16px;
    color: #16325d;
    font-size: 1.35rem;
}

.temarios-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.temarios-month-list {
    display: grid;
    gap: 10px;
}

.temarios-month-folder {
    border: 1px solid #d7e0eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(16, 36, 71, 0.04);
    overflow: hidden;
}

.temarios-month-summary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto 14px;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
}

.temarios-month-summary::-webkit-details-marker {
    display: none;
}

.temarios-month-summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid #4a617f;
    border-bottom: 2px solid #4a617f;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.temarios-month-folder[open] .temarios-month-summary::after {
    transform: rotate(225deg);
}

.temarios-folder-icon {
    width: 30px;
    height: 23px;
    border-radius: 6px;
    background: #f3c456;
    border: 1px solid #e4b23f;
    position: relative;
}

.temarios-folder-icon::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 3px;
    width: 14px;
    height: 8px;
    border-radius: 6px 6px 0 0;
    background: #f7d16d;
    border: 1px solid #e4b23f;
    border-bottom: 0;
}

.temarios-month-name {
    color: #102447;
    font-size: 1rem;
    font-weight: 800;
}

.temarios-month-count {
    justify-self: end;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef6f0;
    color: #1f5c42;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.temarios-month-content {
    padding: 0 16px 16px;
}

.temarios-month-content .temarios-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 10px 12px;
}

.temario-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #d7e0eb;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(16, 36, 71, 0.04);
}

.temario-card-icon {
    width: 34px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f4f7fb 0%, #ebf0f7 100%);
    border: 1px solid #d4dde9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.temario-card-icon::before {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    background: #ffffff;
    border-left: 1px solid #d4dde9;
    border-bottom: 1px solid #d4dde9;
    transform: rotate(45deg);
}

.temarios-month-folder .temario-card-icon::after {
    content: "";
    position: absolute;
    right: 6px;
    bottom: 7px;
    width: 16px;
    height: 4px;
    border-radius: 999px;
    background: #ff5a52;
    box-shadow: -4px 0 0 #ffd46b;
    transform: rotate(-38deg);
}

.temario-card-icon i {
    position: relative;
    z-index: 2;
    font-size: 1.1rem;
    color: #2a3f7e;
}

.temario-card-icon-utiles {
    background: linear-gradient(180deg, #f7f2e8 0%, #f2ead9 100%);
    border-color: #e3d4b6;
}

.temario-card-icon-utiles i {
    color: #b8771b;
}

.temario-card-icon-lectura-complementaria {
    background: linear-gradient(180deg, #eef3fb 0%, #dfe8f6 100%);
    border-color: #c9d7ec;
}

.temario-card-icon-lectura-complementaria i {
    color: #2a5ea8;
}

.temario-card-body h3 {
    margin: 0;
    color: #102447;
    font-size: 0.98rem;
    line-height: 1.3;
}

.temario-card-body p {
    margin: 3px 0 0;
    color: #617694;
    font-size: 0.94rem;
}

.temario-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 10px;
    border: 1px solid #ff5a52;
    color: #ff5a52;
    font-weight: 700;
    background: #ffffff;
}

.temarios-month-folder .temario-card {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: none;
}

.temarios-month-folder .temario-card-icon {
    width: 30px;
    height: 35px;
    border-radius: 7px;
}

.temarios-month-folder .temario-card-body h3 {
    font-size: 0.9rem;
    line-height: 1.25;
}

.temarios-month-folder .temario-card-body p {
    margin-top: 2px;
    font-size: 0.82rem;
}

.temarios-month-folder .temario-card-action {
    min-width: 48px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.utiles-page .temarios-course-block {
    margin-bottom: 22px;
}

.utiles-page .temarios-course-title {
    margin-bottom: 10px;
    font-size: 1.18rem;
}

.utiles-page .temarios-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 10px 12px;
}

.utiles-page .temario-card {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: none;
}

.utiles-page .temario-card-icon {
    width: 30px;
    height: 35px;
    border-radius: 7px;
}

.utiles-page .temario-card-icon i {
    font-size: 0.9rem;
}

.utiles-page .temario-card-body h3 {
    font-size: 0.9rem;
    line-height: 1.25;
}

.utiles-page .temario-card-body p {
    margin-top: 2px;
    font-size: 0.82rem;
}

.utiles-page .temario-card-action {
    min-width: 48px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.temarios-empty {
    padding: 26px;
    text-align: center;
    border: 1px dashed #c9d6e4;
    border-radius: 16px;
    background: #f8fbff;
    color: #526984;
    line-height: 1.7;
}

.temarios-empty-month {
    padding: 18px;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .temarios-page {
        padding: 42px 0 70px;
    }

    .temarios-grid {
        grid-template-columns: 1fr;
    }

    .temarios-month-content .temarios-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .utiles-page .temarios-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 640px) {
    .temarios-month-content .temarios-grid {
        grid-template-columns: 1fr;
    }

    .utiles-page .temarios-grid {
        grid-template-columns: 1fr;
    }

    .temarios-month-summary {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .temarios-month-summary::after {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .temarios-month-count {
        grid-column: 2;
        justify-self: start;
    }

    .temario-card {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .temario-card-action {
        min-width: 100%;
    }
}
