.courses-heading { flex-wrap: wrap; }
.courses-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.courses-header-actions .data-table-button { min-height: 42px; }
.courses-generate { color: var(--t-accent); background: var(--t-subtle); border-color: var(--t-line); }
.courses-generate svg, .courses-stat-symbol svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.courses-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.courses-stats article { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 20px; border: 1px solid var(--t-line); border-radius: 12px; background: var(--t-surface); }
.courses-stat-symbol { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 10px; background: var(--t-subtle); color: var(--t-accent); }
.courses-stats p { margin: 0 0 10px; color: var(--t-muted); font-size: calc(12px * var(--ui-scale, 1)); }
.courses-stats strong { display: block; color: var(--t-text); font-size: calc(28px * var(--ui-scale, 1)); font-weight: 700; line-height: 1.2; }
.courses-stats small { color: var(--t-muted); font-size: calc(13px * var(--ui-scale, 1)); font-weight: 400; }
.courses-stats .courses-teacher-name { font-size: calc(21px * var(--ui-scale, 1)); }
.courses-stats div > span { display: block; margin-top: 8px; color: var(--t-muted); font-size: calc(11px * var(--ui-scale, 1)); line-height: 1.5; }
.courses-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.courses-advanced-filters summary { margin: 14px 0; color: var(--t-accent); font-size: calc(12px * var(--ui-scale, 1)); cursor: pointer; }
.courses-table { min-width: 1250px; }
.student-courses-table { min-width: 900px; }
.courses-table tbody th { min-width: 165px; }
.courses-table td:nth-child(3) { min-width: 225px; }
@media (max-width: 1100px) {
    .courses-stats article { align-items: flex-start; padding: 16px; }
    .courses-stat-symbol { display: none; }
    .courses-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .courses-heading { flex-direction: column; }
    .courses-header-actions { width: 100%; }
    .courses-header-actions .data-table-button { width: 100%; }
    .courses-stats, .courses-filters { grid-template-columns: 1fr; }
    .courses-stat-symbol { display: grid; }
}

/* Tarjetas del listado de cursos: solo en celular; en escritorio se usa la tabla. */
.course-cards { display: none; }
@media (max-width: 640px) {
    .courses-table-region { display: none; }
    .course-cards { display: grid; gap: 12px; margin: 0; padding: 4px 16px 16px; list-style: none; }
    .course-card { display: grid; gap: 14px; min-width: 0; padding: 16px; border: 1px solid var(--t-line); border-radius: 12px; background: var(--t-surface); box-shadow: 0 1px 2px #10173510; }
    .course-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    .course-card-title { display: block; color: var(--t-text); font-size: calc(15px * var(--ui-scale, 1)); line-height: 1.3; overflow-wrap: anywhere; }
    .course-card-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
    .course-card-info div { min-width: 0; }
    .course-card-info dt { color: var(--t-muted); font-size: calc(10px * var(--ui-scale, 1)); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
    .course-card-info dd { margin: 2px 0 0; color: var(--t-text); font-size: calc(12px * var(--ui-scale, 1)); overflow-wrap: anywhere; }
    .course-card-grades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .course-card-grades > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 9px; background: var(--t-subtle); }
    .course-card-grades span { color: var(--t-muted); font-size: calc(10px * var(--ui-scale, 1)); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
    .course-card-grades strong { color: var(--t-text); font-size: calc(18px * var(--ui-scale, 1)); font-variant-numeric: tabular-nums; }
    .course-card-grades small { color: var(--t-muted); font-size: calc(10px * var(--ui-scale, 1)); font-weight: 400; }
    .course-card-grades em { color: var(--t-muted); font-size: calc(12px * var(--ui-scale, 1)); font-style: normal; }
    .course-card-actions { justify-content: stretch; }
    .course-card-actions .data-table-button { flex: 1 1 0; justify-content: center; min-height: 42px; text-align: center; text-decoration: none; }
    .course-card-empty { padding: 28px 12px; border: 1px dashed var(--t-line); border-radius: 12px; color: var(--t-muted); text-align: center; }
}
