@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --eva-ink: #1d2125;
    --eva-teal: #0f6cbf;
    --eva-sky: #0f6cbf;
    --mdl-primary: #0f6cbf;
    --mdl-primary-dark: #0b5ea8;
    --mdl-blue: #0f6cbf;
    --mdl-blue-dark: #0b5ea8;
    --mdl-danger: #ca3120;
    --mdl-success: #357a32;
    --mdl-bg: #f8f9fa;
    --mdl-border: #dee2e6;
    --mdl-text: #1d2125;
    --mdl-muted: #6a737b;
}

body {
    font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    background: var(--mdl-bg);
    color: var(--mdl-text);
}

[x-cloak] {
    display: none !important;
}

.ql-editor {
    min-height: 160px;
}

.ql-opcion .ql-editor {
    min-height: 110px;
}

.ql-editor img {
    max-width: 100%;
    height: auto;
    cursor: nwse-resize;
}

.prose img,
.eva-opcion-html img {
    max-width: 100%;
    height: auto;
}

.eva-opcion-html p {
    margin: 0;
}

.eva-opcion-html p + p {
    margin-top: 0.35rem;
}

@layer components {
    .eva-shell {
        background: #f8f9fa;
        min-height: 100vh;
    }

    .eva-login-bg {
        background:
            radial-gradient(circle at 20% 20%, rgba(15, 108, 191, 0.16), transparent 40%),
            radial-gradient(circle at 80% 10%, rgba(15, 108, 191, 0.10), transparent 35%),
            linear-gradient(160deg, #eef5fb 0%, #f8f9fa 50%, #e7f0f8 100%);
    }

    .eva-login-logo-image {
        display: inline-block;
        max-height: 5rem;
        width: auto;
        max-width: min(100%, 16rem);
        object-fit: contain;
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
    }

    .eva-login-page {
        position: relative;
        background-color: #f8f9fa;
    }

    .eva-login-page--custom-bg {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .eva-login-page--custom-bg::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.72);
        pointer-events: none;
    }

    .eva-nav {
        @apply bg-slate-900/95 backdrop-blur border-b border-slate-800 shadow-lg shadow-slate-900/10;
    }

    .eva-nav-link {
        @apply px-3 py-2 rounded-lg text-sm font-medium text-slate-300 hover:text-white hover:bg-white/10 transition;
    }

    .eva-nav-link-active {
        @apply text-white bg-white/10;
    }

    .eva-card {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 0.4rem;
        box-shadow: none;
    }

    .eva-alert {
        border-radius: 0.35rem;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border: 1px solid;
    }

    .eva-alert-success {
        background: #eaf6ea;
        color: #275a25;
        border-color: #b7dfb5;
    }

    .eva-alert-error {
        background: #fdeceb;
        color: #8a2216;
        border-color: #f1b5ae;
    }

    .eva-badge {
        @apply inline-flex items-center rounded px-2 py-0.5 text-xs font-semibold;
    }

    .eva-badge-ready {
        background: #eaf6ea;
        color: #275a25;
    }

    .eva-badge-done {
        background: #e8f2fb;
        color: #0b5ea8;
    }

    .eva-badge-wait {
        @apply bg-amber-100 text-amber-900;
    }

    .eva-badge-closed {
        @apply bg-slate-100 text-slate-600;
    }

    :root {
        --eva-page-gutter: 1rem;
        --eva-header-height: 3.5rem;
    }

    @media (min-width: 640px) {
        :root {
            --eva-page-gutter: 1.25rem;
        }
    }

    @media (min-width: 1280px) {
        :root {
            --eva-page-gutter: 1.5rem;
        }
    }

    .eva-page-gutter {
        width: 100%;
        max-width: 100%;
        padding-left: var(--eva-page-gutter);
        padding-right: var(--eva-page-gutter);
    }

    .eva-app {
        background: #f8f9fa;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .eva-app-header {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-height: var(--eva-header-height);
        padding: 0.5rem var(--eva-page-gutter);
        background: #fff;
        border-bottom: 1px solid #dee2e6;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .eva-app-brand {
        display: inline-flex;
        align-items: center;
        gap: 0.65rem;
        min-width: 0;
        text-decoration: none;
    }

    .eva-app-brand-image {
        flex-shrink: 0;
        background: #fff;
        border: 1px solid #e2e8f0;
        padding: 0.15rem;
    }

    .eva-app-brand-logo {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 0.45rem;
        background: #0f6cbf;
        color: #fff;
        font-size: 0.8125rem;
        font-weight: 700;
        box-shadow: 0 1px 2px rgba(15, 108, 191, 0.25);
        flex-shrink: 0;
        transition: background 0.15s ease;
    }

    .eva-app-brand:hover .eva-app-brand-logo {
        background: #0b5ea8;
    }

    .eva-app-brand-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
        line-height: 1.15;
    }

    .eva-app-brand-name {
        font-size: 1rem;
        font-weight: 700;
        color: #1d2125;
        letter-spacing: -0.01em;
    }

    .eva-app-brand-tag {
        font-size: 0.6875rem;
        font-weight: 500;
        color: #6a737b;
        margin-top: 0.1rem;
    }

    .eva-app-header-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .eva-user-menu-trigger {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.2rem 0.55rem 0.2rem 0.2rem;
        border: 1px solid #e2e8f0;
        border-radius: 9999px;
        background: #fff;
        color: #334155;
        transition: background 0.15s ease, border-color 0.15s ease;
    }

    .eva-user-menu-trigger:hover {
        background: #f8fafc;
        border-color: #cbd5e1;
    }

    .eva-user-menu-name {
        max-width: 10rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.875rem;
        font-weight: 600;
    }

    .eva-user-menu-chevron {
        width: 1rem;
        height: 1rem;
        color: #94a3b8;
        flex-shrink: 0;
    }

    .eva-shell {
        display: flex;
        flex: 1;
        min-width: 0;
        min-height: 0;
    }

    .eva-sidebar {
        position: fixed;
        top: var(--eva-header-height);
        bottom: 0;
        left: 0;
        z-index: 40;
        width: 16.5rem;
        display: flex;
        flex-direction: column;
        background: #1d2125;
        border-right: 1px solid #2a2e32;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .eva-sidebar-open {
        transform: translateX(0);
    }

    .eva-sidebar-backdrop {
        position: fixed;
        top: var(--eva-header-height);
        inset-inline: 0;
        bottom: 0;
        z-index: 30;
        background: rgba(29, 33, 37, 0.45);
    }

    .eva-sidebar-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        background: #16191c;
    }

    .eva-sidebar-nav {
        flex: 1;
        overflow-y: auto;
        padding: 0.75rem 0.65rem;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .eva-side-section {
        margin: 0.85rem 0.5rem 0.35rem;
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #8b949e;
    }

    .eva-side-link {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding: 0.55rem 0.75rem;
        border-radius: 0.35rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: #c8cdd2;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .eva-side-link:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .eva-side-link-active {
        background: #0f6cbf;
        color: #fff;
    }

    .eva-side-icon {
        width: 1.15rem;
        height: 1.15rem;
        flex-shrink: 0;
        opacity: 0.85;
    }

    .eva-side-link:hover .eva-side-icon,
    .eva-side-toggle:hover .eva-side-icon,
    .eva-side-sublink:hover .eva-side-icon {
        opacity: 1;
    }

    .eva-side-link-active .eva-side-icon {
        opacity: 1;
        color: #fff;
    }

    .eva-side-group {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }

    .eva-side-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
        padding: 0.55rem 0.75rem;
        border-radius: 0.35rem;
        border: 0;
        background: transparent;
        font-size: 0.875rem;
        font-weight: 500;
        color: #c8cdd2;
        cursor: pointer;
        text-align: left;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .eva-side-toggle-label {
        display: inline-flex;
        align-items: center;
        gap: 0.7rem;
        min-width: 0;
    }

    .eva-side-toggle:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .eva-side-chevron {
        width: 1rem;
        height: 1rem;
        opacity: 0.7;
        transition: transform 0.15s ease;
        flex-shrink: 0;
    }

    .eva-side-chevron-open {
        transform: rotate(180deg);
    }

    .eva-side-submenu {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        padding: 0.15rem 0 0.25rem 0.55rem;
        margin-left: 0.35rem;
        border-left: 1px solid rgba(148, 163, 184, 0.25);
    }

    .eva-side-sublink {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.45rem 0.7rem;
        border-radius: 0.35rem;
        font-size: 0.8125rem;
        font-weight: 500;
        color: #9aa3ab;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .eva-side-sublink .eva-side-icon {
        width: 1rem;
        height: 1rem;
    }

    .eva-side-sublink:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .eva-side-sublink.eva-side-link-active {
        background: #0f6cbf;
        color: #fff;
    }

    .eva-sidebar-footer {
        padding: 0.85rem 0.75rem 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        background: #16191c;
    }

    .eva-main {
        flex: 1;
        min-width: 0;
        min-height: calc(100vh - var(--eva-header-height));
        background: #f8f9fa;
    }

    .eva-page-header {
        background: #fff;
        border-bottom: 1px solid #dee2e6;
    }

    .mdl-page-heading {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    .mdl-page-subtitle {
        margin: -0.55rem 0 0;
        color: #6a737b;
        font-size: 0.9rem;
    }

    .mdl-page-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }

    .mdl-table-wrap {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 0.4rem;
        overflow: hidden;
    }

    .mdl-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.875rem;
    }

    .mdl-table thead {
        background: #f1f3f5;
        color: #6a737b;
        text-align: left;
    }

    .mdl-table th,
    .mdl-table td {
        padding: 0.75rem 1rem;
        border-top: 1px solid #f1f3f5;
        vertical-align: middle;
    }

    .mdl-table thead th {
        border-top: 0;
        font-weight: 600;
    }

    .mdl-table tbody tr:hover {
        background: #f8f9fa;
    }

    .mdl-link {
        color: #0f6cbf;
        font-weight: 600;
        text-decoration: none;
    }

    .mdl-link:hover {
        text-decoration: underline;
    }

    @media (min-width: 1024px) {
        .eva-sidebar {
            transform: translateX(0);
        }

        .eva-main {
            margin-left: 16.5rem;
        }
    }

    .eva-cal-weekdays {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        background: #f1f5f9;
        border-bottom: 1px solid #e2e8f0;
    }

    .eva-cal-weekdays > * {
        padding: 0.65rem 0.25rem;
        text-align: center;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #64748b;
    }

    .eva-cal-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 1px;
        background: #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
    }

    .eva-cal-day {
        background: #fff;
        min-height: 5.75rem;
        padding: 0.35rem;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .eva-cal-day.is-muted {
        background: #f8fafc;
    }

    .eva-cal-day-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.6rem;
        height: 1.5rem;
        padding: 0 0.25rem;
        margin-left: auto;
        margin-bottom: 0.25rem;
        border-radius: 9999px;
        font-size: 0.8rem;
        font-weight: 600;
        color: #334155;
    }

    .eva-cal-day.is-muted .eva-cal-day-num {
        color: #cbd5e1;
    }

    .eva-cal-day-num.is-today {
        background: #0f766e;
        color: #fff;
    }

    .eva-cal-event {
        display: block;
        border-radius: 0.25rem;
        padding: 0.15rem 0.35rem;
        margin-bottom: 0.15rem;
        font-size: 0.65rem;
        font-weight: 600;
        line-height: 1.25;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-decoration: none;
    }

    .eva-cal-event.is-evaluacion {
        background: #0d9488;
    }

    .eva-cal-event.is-saber {
        background: #0284c7;
    }

    .eva-cal-event:hover {
        filter: brightness(0.95);
    }

    .eva-cal-more {
        width: 100%;
        text-align: left;
        padding: 0 0.25rem;
        font-size: 0.65rem;
        font-weight: 600;
        color: #64748b;
        background: transparent;
        border: 0;
        cursor: pointer;
    }

    .eva-cal-more:hover {
        color: #0f766e;
    }

    @media (min-width: 640px) {
        .eva-cal-day {
            min-height: 7.5rem;
            padding: 0.4rem;
        }

        .eva-cal-event,
        .eva-cal-more {
            font-size: 0.7rem;
        }

        .eva-cal-weekdays > * {
            font-size: 0.75rem;
        }
    }

    /* —— Estilo tipo Moodle (aula / mis cursos) —— */
    .mdl-page {
        --mdl-blue: #0f6cbf;
        --mdl-blue-dark: #0b5ea8;
        --mdl-ink: #1d2125;
        --mdl-muted: #6a737b;
        --mdl-line: #dee2e6;
        --mdl-soft: #f1f3f5;
        --mdl-panel: #ffffff;
        width: 100%;
        background:
            radial-gradient(ellipse 80% 40% at 10% -10%, rgba(15, 108, 191, 0.07), transparent 55%),
            radial-gradient(ellipse 60% 35% at 90% 0%, rgba(0, 129, 150, 0.05), transparent 50%),
            #f4f6f8;
        min-height: 60vh;
        margin: -0.25rem 0 0;
        padding-bottom: 2.5rem;
    }

    .mdl-wrap {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1rem var(--eva-page-gutter) 2rem;
    }

    .mdl-breadcrumb {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.8125rem;
        color: var(--mdl-muted);
        margin-bottom: 0.85rem;
    }

    .mdl-breadcrumb a {
        color: var(--mdl-blue);
        text-decoration: none;
        font-weight: 500;
    }

    .mdl-breadcrumb a:hover {
        text-decoration: underline;
    }

    .mdl-breadcrumb-sep {
        opacity: 0.55;
    }

    .mdl-page-title {
        font-size: 1.55rem;
        font-weight: 700;
        color: var(--mdl-ink);
        margin: 0 0 1rem;
        letter-spacing: -0.02em;
        line-height: 1.2;
    }

    .mdl-course-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    @media (min-width: 640px) {
        .mdl-course-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (min-width: 1024px) {
        .mdl-course-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
    }

    .mdl-course-card {
        display: flex;
        flex-direction: column;
        background: var(--mdl-panel);
        border: 1px solid var(--mdl-line);
        border-radius: 0.65rem;
        overflow: hidden;
        text-decoration: none;
        color: inherit;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    }

    .mdl-course-card:hover {
        box-shadow: 0 10px 28px rgba(15, 108, 191, 0.14);
        transform: translateY(-3px);
        border-color: #c5d8f5;
    }

    .mdl-course-banner {
        height: 8.25rem;
        position: relative;
        background-size: cover;
        background-position: center;
        isolation: isolate;
    }

    .mdl-course-banner::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image:
            radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18) 0, transparent 42%),
            radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.12) 0, transparent 35%),
            linear-gradient(135deg, transparent 40%, rgba(0, 0, 0, 0.12) 100%);
        z-index: 0;
    }

    .mdl-course-banner::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, transparent 25%, rgba(0, 0, 0, 0.5) 100%);
        z-index: 0;
    }

    .mdl-course-banner-title {
        position: absolute;
        left: 1rem;
        right: 1rem;
        bottom: 0.85rem;
        z-index: 1;
        color: #fff;
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1.3;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }

    .mdl-course-body {
        padding: 0.95rem 1.05rem 1.1rem;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        flex: 1;
    }

    .mdl-course-meta {
        font-size: 0.8125rem;
        color: var(--mdl-muted);
        line-height: 1.4;
    }

    .mdl-progress {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .mdl-progress-bar {
        height: 0.5rem;
        background: #e9ecef;
        border-radius: 999px;
        overflow: hidden;
    }

    .mdl-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #0f6cbf, #3d8fd4);
        border-radius: 999px;
        transition: width 0.35s ease;
    }

    .mdl-progress-label {
        font-size: 0.75rem;
        color: var(--mdl-muted);
        font-weight: 500;
    }

    .mdl-course-hero {
        border-radius: 0.75rem;
        overflow: hidden;
        border: 1px solid var(--mdl-line);
        margin-bottom: 1.1rem;
        background: var(--mdl-panel);
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    }

    .mdl-course-hero-banner {
        min-height: 10.5rem;
        display: flex;
        align-items: flex-end;
        padding: 1.5rem 1.5rem 1.35rem;
        position: relative;
        background-size: cover;
        background-position: center;
        isolation: isolate;
    }

    .mdl-course-hero-banner::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
            radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.16), transparent 40%),
            linear-gradient(105deg, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.45) 48%, rgba(15, 23, 42, 0.2) 100%);
        z-index: 0;
    }

    .mdl-course-hero-banner::after {
        content: "";
        position: absolute;
        inset: 0;
        opacity: 0.18;
        background-image:
            linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
        background-size: 28px 28px;
        mask-image: linear-gradient(90deg, transparent, #000 30%, #000);
        z-index: 0;
        pointer-events: none;
    }

    .mdl-course-hero-text {
        position: relative;
        z-index: 1;
        color: #fff;
        max-width: 42rem;
    }

    .mdl-course-hero-text h1 {
        margin: 0;
        font-size: clamp(1.4rem, 2.4vw, 1.85rem);
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: -0.02em;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    }

    .mdl-course-hero-text p {
        margin: 0.45rem 0 0;
        opacity: 0.94;
        font-size: 0.925rem;
    }

    .mdl-course-hero-footer {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.85rem;
        padding: 0.85rem 1.25rem;
        background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
        border-top: 1px solid #eef1f4;
    }

    .mdl-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        margin-bottom: 0;
        background: #f8f9fa;
        border-radius: 0.55rem 0.55rem 0 0;
        overflow: hidden;
        border: 1px solid var(--mdl-line);
        border-bottom: 0;
    }

    .mdl-tab {
        padding: 0.8rem 1.15rem;
        font-size: 0.875rem;
        font-weight: 600;
        color: #495057;
        text-decoration: none;
        border-bottom: 3px solid transparent;
        background: transparent;
        transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    }

    .mdl-tab:hover {
        color: var(--mdl-blue);
        background: rgba(255, 255, 255, 0.7);
    }

    .mdl-tab-active {
        color: var(--mdl-blue);
        background: #fff;
        border-bottom-color: var(--mdl-blue);
    }

    .mdl-panel {
        background: var(--mdl-panel);
        border: 1px solid var(--mdl-line);
        border-radius: 0 0 0.55rem 0.55rem;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    }

    .mdl-panel-narrow {
        max-width: 56rem;
        margin-left: auto;
        margin-right: auto;
    }

    .mdl-section {
        border: 1px solid var(--mdl-line);
        border-radius: 0.5rem;
        margin-bottom: 0.9rem;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .mdl-section-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.9rem 1.05rem;
        background: linear-gradient(180deg, #f8f9fa 0%, #f3f5f7 100%);
        border-bottom: 1px solid #e9ecef;
        border-left: 3px solid var(--mdl-blue);
        cursor: pointer;
        user-select: none;
        transition: background 0.15s ease;
    }

    .mdl-section-header:hover {
        background: #eef2f6;
    }

    .mdl-section-title-wrap {
        display: flex;
        align-items: flex-start;
        gap: 0.55rem;
        min-width: 0;
        flex: 1;
    }

    .mdl-section-chevron {
        width: 1.15rem;
        height: 1.15rem;
        margin-top: 0.2rem;
        color: #6a737b;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    .mdl-section-chevron-open {
        transform: rotate(90deg);
    }

    .mdl-section-title {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--mdl-ink);
        letter-spacing: -0.01em;
    }

    .mdl-section-desc {
        margin: 0.2rem 0 0;
        font-size: 0.8125rem;
        color: var(--mdl-muted);
    }

    .mdl-section-body {
        padding: 0.15rem 0;
        background: #fff;
    }

    .mdl-lesson {
        border-top: 1px solid #e9ecef;
    }

    .mdl-lesson:first-child {
        border-top: 0;
    }

    .mdl-lesson-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.8rem 1.05rem;
        cursor: pointer;
        user-select: none;
        background: #fff;
        transition: background 0.15s ease;
    }

    .mdl-lesson-header:hover {
        background: #f7f9fc;
    }

    .mdl-lesson-header .mdl-activity-name {
        font-size: 1rem;
        font-weight: 700;
        color: #1d2125;
    }

    .mdl-lesson-header:hover .mdl-activity-name {
        color: #0f6cbf;
        text-decoration: none;
    }

    .mdl-lesson-body {
        position: relative;
        background: #f3f6f9;
        border-top: 1px solid #e6ebf0;
        padding: 0.35rem 0.75rem 0.55rem 0;
        margin: 0;
    }

    /* Guía vertical del árbol (bajo el icono de la lección) */
    .mdl-lesson-body::before {
        content: "";
        position: absolute;
        left: 2.35rem;
        top: 0;
        bottom: 0.55rem;
        width: 2px;
        background: #c5d0db;
        border-radius: 2px;
        z-index: 0;
    }

    .mdl-activity-nested {
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.7rem;
        margin: 0.2rem 0.5rem 0.2rem 2.85rem;
        padding: 0.55rem 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.45rem;
        background: #fff;
        border-top: 1px solid #e2e8f0;
        z-index: 1;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    /* Codo del árbol hacia la actividad */
    .mdl-activity-nested::before {
        content: "";
        position: absolute;
        left: -1.35rem;
        top: 50%;
        width: 1.15rem;
        height: 2px;
        background: #c5d0db;
        z-index: 0;
    }

    .mdl-activity-nested:hover {
        background: #f8fbff;
        border-color: #b7d0ef;
        box-shadow: 0 1px 4px rgba(15, 108, 191, 0.08);
    }

    .mdl-activity-nested .mdl-activity-name {
        font-size: 0.9rem;
        font-weight: 600;
        color: #0f6cbf;
    }

    .mdl-activity-nested-empty {
        margin: 0.2rem 0.5rem 0.2rem 2.85rem;
        padding: 0.55rem 0.75rem;
        color: #6a737b;
        font-size: 0.8125rem;
        position: relative;
        z-index: 1;
    }

    .mdl-activity-nested-empty::before {
        content: "";
        position: absolute;
        left: -1.35rem;
        top: 50%;
        width: 1.15rem;
        height: 2px;
        background: #c5d0db;
    }

    .mdl-activity {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.7rem 1rem;
        border-top: 1px solid #f1f3f5;
        text-decoration: none;
        color: inherit;
        transition: background 0.15s ease;
    }

    .mdl-activity:hover {
        background: #f8f9fa;
    }

    /* Jerarquía: actividad hija de lección (más específica) */
    .mdl-activity.mdl-activity-nested {
        margin: 0.2rem 0.5rem 0.2rem 2.85rem;
        padding: 0.55rem 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.45rem;
        background: #fff;
    }

    .mdl-activity.mdl-activity-nested:hover {
        background: #f8fbff;
        border-color: #b7d0ef;
    }

    .mdl-activity-icon {
        width: 2.05rem;
        height: 2.05rem;
        border-radius: 0.4rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        color: #fff;
        box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    }

    .mdl-activity-icon svg {
        width: 1.15rem;
        height: 1.15rem;
    }

    .mdl-activity-icon-sm {
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 0.3rem;
    }

    .mdl-activity-icon-sm svg {
        width: 0.85rem;
        height: 0.85rem;
    }

    .mdl-icon-page { background: linear-gradient(145deg, #1a7fd4, #0f6cbf); }
    .mdl-icon-assign { background: linear-gradient(145deg, #d64536, #ca3120); }
    .mdl-icon-file { background: linear-gradient(145deg, #6f74f8, #5d63f6); }
    .mdl-icon-url { background: linear-gradient(145deg, #0a97ad, #008196); }
    .mdl-icon-forum { background: linear-gradient(145deg, #ff7a2e, #f7630c); }
    .mdl-icon-grade { background: linear-gradient(145deg, #439640, #357a32); }
    .mdl-icon-quiz { background: linear-gradient(145deg, #439640, #2f6b2d); }
    .mdl-icon-workshop { background: linear-gradient(145deg, #e35a2b, #c4451a); }
    .mdl-icon-label { background: linear-gradient(145deg, #64748b, #475569); }

    .mdl-activity-main {
        min-width: 0;
        flex: 1;
    }

    .mdl-activity-name {
        font-size: 0.9375rem;
        font-weight: 600;
        color: var(--mdl-blue);
        margin: 0;
        line-height: 1.3;
    }

    .mdl-activity:hover .mdl-activity-name {
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .mdl-activity-meta {
        font-size: 0.75rem;
        color: var(--mdl-muted);
        margin-top: 0.15rem;
        line-height: 1.35;
    }

    .mdl-activity-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        align-items: center;
    }

    .mdl-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.4rem 0.75rem;
        border-radius: 0.35rem;
        font-size: 0.8125rem;
        font-weight: 600;
        border: 1px solid #ced4da;
        background: #fff;
        color: var(--mdl-ink);
        text-decoration: none;
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        line-height: 1.2;
    }

    .mdl-btn:hover {
        background: #f8f9fa;
        border-color: #adb5bd;
    }

    .mdl-btn-primary {
        background: var(--mdl-blue, var(--mdl-primary, #0f6cbf));
        border-color: var(--mdl-blue, var(--mdl-primary, #0f6cbf));
        color: #fff;
    }

    .mdl-btn-primary:hover:not(:disabled) {
        background: var(--mdl-blue-dark, var(--mdl-primary-dark, #0b5ea8));
        border-color: var(--mdl-blue-dark, var(--mdl-primary-dark, #0b5ea8));
        color: #fff;
    }

    .mdl-btn-primary:disabled {
        background: var(--mdl-blue, var(--mdl-primary, #0f6cbf));
        border-color: var(--mdl-blue, var(--mdl-primary, #0f6cbf));
        color: #fff;
        opacity: 0.65;
        cursor: not-allowed;
    }

    .mdl-btn-danger {
        color: #ca3120;
        border-color: #f1b5ae;
        background: #fff;
    }

    .mdl-btn-danger:hover {
        background: #fdeceb;
        color: #ca3120;
    }

    .mdl-completion {
        width: 1.15rem;
        height: 1.15rem;
        border-radius: 999px;
        border: 2px solid #adb5bd;
        flex-shrink: 0;
        transition: background 0.15s ease, border-color 0.15s ease;
    }

    .mdl-completion-done {
        background: #357a32;
        border-color: #357a32;
        box-shadow: inset 0 0 0 2px #fff;
    }

    .mdl-empty {
        text-align: center;
        padding: 2.75rem 1.25rem;
        color: var(--mdl-muted);
        font-size: 0.9375rem;
        background:
            radial-gradient(circle at 50% 0%, rgba(15, 108, 191, 0.06), transparent 55%);
        border-radius: 0.5rem;
    }

    .mdl-manage-box {
        border: 1px dashed #b8c4d0;
        border-radius: 0.5rem;
        padding: 1.05rem 1.1rem;
        margin-bottom: 1rem;
        background: linear-gradient(180deg, #fbfcfd 0%, #f5f7fa 100%);
    }

    .mdl-manage-box h3 {
        margin: 0 0 0.85rem;
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--mdl-ink);
    }

    .mdl-badge {
        display: inline-block;
        font-size: 0.7rem;
        font-weight: 700;
        padding: 0.15rem 0.45rem;
        border-radius: 0.25rem;
        background: #fff3cd;
        color: #856404;
        vertical-align: middle;
    }

    .mdl-status {
        display: inline-flex;
        align-items: center;
        font-size: 0.75rem;
        font-weight: 700;
        padding: 0.2rem 0.55rem;
        border-radius: 999px;
        white-space: nowrap;
    }

    .mdl-status-pending {
        background: #f1f3f5;
        color: #495057;
    }

    .mdl-status-sent {
        background: #e8f0fe;
        color: #084f8c;
    }

    .mdl-status-done {
        background: #e6f4ea;
        color: #1e5c28;
    }

    .mdl-list-card {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.95rem 1.05rem;
        border: 1px solid var(--mdl-line);
        border-radius: 0.5rem;
        background: #fff;
        text-decoration: none;
        color: inherit;
        margin-bottom: 0.7rem;
        transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    }

    .mdl-list-card:hover {
        border-color: #b7d0ef;
        background: #f8fbff;
        box-shadow: 0 2px 8px rgba(15, 108, 191, 0.08);
    }

    .mdl-list-card-static {
        cursor: default;
        align-items: flex-start;
    }

    .mdl-list-card-static:hover {
        border-color: var(--mdl-line);
        background: #fff;
        box-shadow: none;
    }

    .mdl-block {
        border: 1px solid var(--mdl-line);
        border-radius: 0.5rem;
        overflow: hidden;
        background: #fff;
        margin-bottom: 0.7rem;
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .mdl-block:hover {
        border-color: #c9d5e2;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    }

    .mdl-detail-head {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        padding-bottom: 1rem;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid #eef1f4;
    }

    @media (min-width: 640px) {
        .mdl-detail-head {
            flex-direction: row;
            align-items: flex-start;
            justify-content: space-between;
        }
    }

    .mdl-detail-title {
        margin: 0;
        font-size: 1.35rem;
        font-weight: 700;
        color: var(--mdl-ink);
        letter-spacing: -0.02em;
        line-height: 1.25;
    }

    .mdl-detail-meta {
        margin: 0.35rem 0 0;
        font-size: 0.875rem;
        color: var(--mdl-muted);
    }

    .mdl-section-label {
        margin: 0 0 0.75rem;
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #8492a6;
    }

    .mdl-post {
        border: 1px solid var(--mdl-line);
        border-radius: 0.5rem;
        padding: 0.9rem 1rem;
        background: #fff;
    }

    .mdl-post-reply {
        margin-top: 0.75rem;
        margin-left: 0.75rem;
        padding-left: 0.85rem;
        border-left: 3px solid #d9e2ec;
    }

    .mdl-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        margin-bottom: 0.85rem;
    }

    @media (max-width: 640px) {
        .mdl-activity {
            flex-wrap: wrap;
        }

        .mdl-activity-actions {
            width: 100%;
            padding-left: 2.8rem;
        }

        .mdl-activity-nested {
            margin-left: 1.35rem;
        }

        .mdl-activity-nested-empty {
            margin-left: 1.35rem;
        }

        .mdl-lesson-body::before {
            left: 1.35rem;
        }

        .mdl-course-hero-banner {
            min-height: 8.5rem;
            padding: 1.15rem;
        }
    }

    .mdl-manage-toolbar {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border: 1px dashed #cbd5e1;
        border-radius: 0.5rem;
        background: #f8fafc;
        font-size: 0.8125rem;
        color: #64748b;
    }

    .mdl-drag-handle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.35rem;
        color: #94a3b8;
        cursor: grab;
        flex-shrink: 0;
        touch-action: none;
    }

    .mdl-drag-handle:active {
        cursor: grabbing;
    }

    .mdl-drag-handle:hover {
        color: #64748b;
        background: #f1f5f9;
    }

    .mdl-visibility-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.35rem;
        border: 1px solid #e2e8f0;
        background: #fff;
        color: #0f6cbf;
        flex-shrink: 0;
    }

    .mdl-visibility-toggle.is-hidden {
        color: #94a3b8;
        background: #f8fafc;
    }

    .mdl-visibility-toggle:hover {
        border-color: #cbd5e1;
        background: #f1f5f9;
    }

    .mdl-visibility-toggle svg {
        width: 1rem;
        height: 1rem;
    }

    .mdl-visibility-toggle .icon-eye-closed {
        display: none;
    }

    .mdl-visibility-toggle.is-hidden .icon-eye-open {
        display: none;
    }

    .mdl-visibility-toggle.is-hidden .icon-eye-closed {
        display: block;
    }

    .mdl-sortable-ghost {
        opacity: 0.45;
    }

    .mdl-sortable-drag {
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    }

    .mdl-item-hidden {
        opacity: 0.78;
    }

    .mdl-section-header .mdl-section-controls,
    .mdl-lesson-header .mdl-lesson-controls {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        margin-right: 0.35rem;
    }

    .mdl-activity-sortable {
        display: flex;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .mdl-activity-sortable > .mdl-activity,
    .mdl-activity-sortable > .mdl-activity-nested-wrap {
        flex: 1;
        min-width: 0;
    }
}
