.upg-page .upg-lessons-link,
.upg-lessons-page .upg-lessons-back {
    text-decoration: none;
}

.upg-page .upg-lessons-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid #d6e4ff;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f9ff 0%, #eef4ff 100%);
    color: #1e3a5f;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.upg-page .upg-lessons-link:hover {
    border-color: #0057b7;
    box-shadow: 0 6px 20px rgba(0, 87, 183, 0.12);
    color: #0057b7;
    transform: translateY(-1px);
}

.upg-page .upg-lessons-link__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #0057b7;
    color: #fff;
    font-size: 1.35rem;
}

.upg-page .upg-lessons-link__title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.15rem;
}

.upg-page .upg-lessons-link__desc {
    font-size: 0.9rem;
    color: #5a6b7d;
    line-height: 1.4;
}

.upg-page .upg-lessons-link__badge {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #0057b7;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.upg-page .upg-lessons-link__arrow {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: #0057b7;
}

.upg-page .upg-accordion .accordion-button,
.ppg-page .upg-accordion .accordion-button,
.phd-page .upg-accordion .accordion-button,
.sg-page .upg-accordion .accordion-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 1.25rem;
    font-weight: 600;
    color: #1e3a5f;
}

.upg-page .upg-accordion .accordion-button::after,
.ppg-page .upg-accordion .accordion-button::after,
.phd-page .upg-accordion .accordion-button::after,
.sg-page .upg-accordion .accordion-button::after {
    order: -1;
    margin-left: 0;
    margin-right: 0;
}

.upg-page .upg-accordion .accordion-button:not(.collapsed),
.ppg-page .upg-accordion .accordion-button:not(.collapsed),
.phd-page .upg-accordion .accordion-button:not(.collapsed),
.sg-page .upg-accordion .accordion-button:not(.collapsed) {
    background: #f0f5ff;
    color: #0057b7;
    box-shadow: none;
}

.upg-page .upg-accordion .accordion-heading-icon,
.ppg-page .upg-accordion .accordion-heading-icon,
.phd-page .upg-accordion .accordion-heading-icon,
.sg-page .upg-accordion .accordion-heading-icon {
    color: #0057b7;
}

.upg-page .upg-link-list,
.ppg-page .upg-link-list,
.phd-page .upg-link-list,
.sg-page .upg-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upg-page .upg-link-list li + li,
.ppg-page .upg-link-list li + li,
.phd-page .upg-link-list li + li,
.sg-page .upg-link-list li + li {
    margin-top: 0.65rem;
}

.upg-page .upg-link-list a,
.ppg-page .upg-link-list a,
.phd-page .upg-link-list a,
.sg-page .upg-link-list a {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #1e3a5f;
    text-decoration: none;
    line-height: 1.45;
    transition: color 0.2s ease;
}

.upg-page .upg-link-list a:hover,
.ppg-page .upg-link-list a:hover,
.phd-page .upg-link-list a:hover,
.sg-page .upg-link-list a:hover {
    color: #0057b7;
}

.upg-page .upg-link-list a i,
.ppg-page .upg-link-list a i,
.phd-page .upg-link-list a i,
.sg-page .upg-link-list a i {
    margin-top: 0.15rem;
    flex-shrink: 0;
    color: #0057b7;
}

.upg-page .upg-structure__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0057b7;
    margin-bottom: 1rem;
}

.upg-page .upg-structure__intro {
    line-height: 1.65;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.upg-page .upg-structure__sections {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upg-page .upg-structure__section {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 1.35rem;
}

.upg-page .upg-structure__section::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: #0057b7;
    font-weight: 700;
    font-size: 1.1rem;
}

.upg-page .upg-structure__section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 0.5rem;
}

.upg-page .upg-mandatory-table {
    max-width: 420px;
    font-size: 0.95rem;
}

.upg-page .upg-mandatory-table thead th {
    background: #eef2f7;
    font-weight: 600;
    color: #1e3a5f;
}

/* --- Postgraduate content --- */
.ppg-page .ppg-content {
    line-height: 1.7;
    color: #334155;
    font-size: 0.975rem;
}

.ppg-page .ppg-content__lead {
    margin-bottom: 1.35rem;
    color: #2c3e50;
}

.ppg-page .ppg-content__program {
    margin-bottom: 1.15rem;
}

.ppg-page .ppg-content__program-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    line-height: 1.45;
}

.ppg-page .ppg-content__program-title a {
    color: #1e4a7a;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ppg-page .ppg-content__program-title a:hover {
    color: #0057b7;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ppg-page .ppg-content__program p {
    color: #475569;
}

.ppg-page .ppg-content__closing {
    margin-top: 1.15rem;
    margin-bottom: 0;
    color: #334155;
}

.ppg-page .ppg-content__closing a {
    color: #1e4a7a;
    font-weight: 600;
    text-decoration: none;
}

.ppg-page .ppg-content__closing a:hover,
.phd-page .phd-content__document-title a:hover {
    color: #0057b7;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ppg-page .qa-content::after {
    content: "";
    display: table;
    clear: both;
}

.ppg-page .qa-content__logo {
    float: left;
    margin: 0 1rem 0.75rem 0;
    max-width: 140px;
}

.ppg-page .qa-content__logo img {
    display: block;
    width: 100%;
    height: auto;
}

.ppg-page .qa-content__body ul {
    padding-left: 1.25rem;
}

/* --- Doctoral content --- */
.phd-page .phd-content {
    line-height: 1.7;
    color: #334155;
    font-size: 0.975rem;
}

.phd-page .phd-content__lead {
    margin-bottom: 1.35rem;
    color: #2c3e50;
}

.phd-page .phd-content__document {
    margin-bottom: 1.15rem;
}

.phd-page .phd-content__document-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    line-height: 1.45;
}

.phd-page .phd-content__document-title a {
    color: #1e4a7a;
    text-decoration: none;
    transition: color 0.15s ease;
}

.phd-page .phd-content__document p {
    color: #475569;
}

/* --- Student groups --- */
.sg-page .sg-content__lead {
    line-height: 1.7;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 0.975rem;
}

.sg-page .sg-groups {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sg-page .sg-groups-accordion .accordion-item {
    border: 1px solid #dde4ed;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.sg-page .sg-groups-accordion .accordion-item:last-child {
    margin-bottom: 0;
}

.sg-page .sg-content-block__placeholder {
    color: #64748b;
    font-style: italic;
    margin-bottom: 0.85rem;
}

.sg-page .sg-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid #dde4ed;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sg-page .sg-link-card:hover {
    border-color: #b8cce8;
    background: #f8fbff;
    box-shadow: 0 2px 10px rgba(0, 87, 183, 0.08);
    color: inherit;
}

.sg-page .sg-link-card__icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef4fb;
    color: #0057b7;
    font-size: 1.35rem;
}

.sg-page .sg-link-card__body {
    flex: 1;
    min-width: 0;
}

.sg-page .sg-link-card__title {
    display: block;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.4;
}

.sg-page .sg-link-card__subtitle {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.45;
}

.sg-page .sg-link-card__action {
    flex-shrink: 0;
    color: #0057b7;
    font-size: 1.15rem;
}

.sg-page .sg-group-accordion .accordion-button {
    align-items: flex-start;
}

.sg-page .sg-accordion-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    text-align: left;
}

.sg-page .sg-accordion-heading__title {
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.4;
}

.sg-page .sg-accordion-heading__subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.4;
}

.sg-page .sg-content-block p {
    color: #475569;
    line-height: 1.65;
    margin-bottom: 0.85rem;
}

.sg-page .sg-board {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e8eef5;
    border-radius: 8px;
}

.sg-page .sg-board__row {
    display: grid;
    grid-template-columns: minmax(8rem, 11rem) 1fr;
    gap: 0.35rem 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eef2f7;
}

.sg-page .sg-board__row:last-child {
    border-bottom: 0;
}

.sg-page .sg-board__row dt {
    margin: 0;
    font-weight: 600;
    color: #1e4a7a;
    font-size: 0.875rem;
}

.sg-page .sg-board__row dd {
    margin: 0;
    color: #334155;
    font-size: 0.9rem;
}

.sg-page .sg-inline-links {
    margin-top: 0.5rem;
}

.sg-page .sg-subgroups {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sg-page .sg-subgroup {
    padding: 0.85rem 0.95rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    border-left: 3px solid #0057b7;
}

.sg-page .sg-subgroup--compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.65rem 0.85rem;
}

.sg-page .sg-subgroup--compact .sg-subgroup__title {
    margin: 0;
}

.sg-page .sg-subgroup__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e4a7a;
    margin: 0 0 0.55rem;
    line-height: 1.35;
}

.sg-page .sg-subgroup__body {
    margin-bottom: 0.35rem;
}

.sg-page .sg-subgroup__text {
    margin: 0 0 0.55rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #475569;
    text-align: justify;
}

.sg-page .sg-subgroup__contact-label {
    margin: 0.15rem 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
}

.sg-page .sg-subgroup__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sg-page .sg-subgroup__links--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sg-page .sg-subgroup__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0b3f8a;
    text-decoration: none;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sg-page .sg-subgroup__link:hover,
.sg-page .sg-subgroup__link:focus-visible {
    color: #0044a3;
    background: #f0f6ff;
    border-color: #b8d0f0;
}

.sg-page .sg-subgroup__link:focus-visible {
    outline: 2px solid rgba(0, 87, 183, 0.25);
    outline-offset: 2px;
}

.sg-page .sg-subgroup__link i {
    font-size: 0.95rem;
    color: #0057b7;
    flex-shrink: 0;
}

.sg-page .sg-subgroup__link span {
    line-height: 1.35;
}

.sg-page .upg-link-list a {
    font-weight: 700;
    color: #0b3f8a;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

.sg-page .upg-link-list a:hover,
.sg-page .upg-link-list a:focus-visible {
    color: #0044a3;
    text-decoration-thickness: 2px;
}

.sg-page .upg-link-list a:focus-visible {
    outline: 2px solid rgba(0, 87, 183, 0.25);
    outline-offset: 2px;
    border-radius: 4px;
}

.sg-page .upg-link-list a i {
    color: #004ca8;
}

.upg-lessons-page.defaultcard > .card-header .upg-lessons-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.upg-lessons-page.defaultcard > .card-header .upg-lessons-back i {
    font-size: 1rem;
    opacity: 0.9;
}

.upg-lessons-page.defaultcard > .card-header .upg-lessons-back:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.85);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Semester navigation --- */
.upg-lessons-page {
    --upg-navy: #1e4a7a;
    --upg-blue: #0057b7;
    --upg-blue-soft: #e8f0fa;
    --upg-border: #dde4ed;
    --upg-surface: #f8fafc;
    --upg-text: #334155;
    --upg-text-muted: #64748b;
}

.upg-lessons-page .upg-semester-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    background: var(--upg-surface);
    border: 1px solid var(--upg-border);
    border-radius: 10px;
}

.upg-lessons-page .upg-semester-nav__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--upg-border);
    border-radius: 8px;
    background: #fff;
    color: var(--upg-navy);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.upg-lessons-page .upg-semester-nav__pill:hover {
    border-color: var(--upg-blue);
    color: var(--upg-blue);
    background: var(--upg-blue-soft);
}

.upg-lessons-page .upg-semester-nav__pill--active {
    background: var(--upg-navy);
    border-color: var(--upg-navy);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(30, 74, 122, 0.2);
}

.upg-lessons-page .upg-semester-nav__pill--active:hover {
    background: #163a61;
    border-color: #163a61;
    color: #fff;
}

.upg-lessons-page .upg-semester-nav__pill--num {
    min-width: 2.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* --- Semester cards --- */
.upg-lessons-page .upg-semester-card__inner {
    border: 1px solid var(--upg-border);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.upg-lessons-page .upg-semester-card__header {
    background: var(--upg-navy);
    border-bottom: none;
    color: #fff;
}

.upg-lessons-page .upg-semester-card__header .card-title {
    color: #fff;
    font-size: 1.05rem;
}

.upg-lessons-page .upg-semester-card__header i {
    color: rgba(255, 255, 255, 0.85);
}

.upg-lessons-page .upg-semester-card__inner > .card-body {
    padding: 1.25rem 1.35rem 1.5rem;
}

/* --- Lesson type sections --- */
.upg-lessons-page .upg-lesson-type {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: var(--upg-surface);
    border-left: 3px solid var(--upg-blue);
    border-radius: 0 6px 6px 0;
}

.upg-lessons-page .upg-lesson-type:first-child {
    margin-top: 0;
}

.upg-lessons-page .upg-lesson-type i {
    color: var(--upg-blue);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.upg-lessons-page .upg-lesson-type__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--upg-text);
}

/* --- Cycle subsections --- */
.upg-lessons-page .upg-lesson-cycle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.65rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--upg-navy);
}

.upg-lessons-page .upg-lesson-cycle i {
    color: var(--upg-text-muted);
    font-size: 1rem;
}

/* --- Course tables --- */
.upg-lessons-page .upg-lessons-table {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    border-color: var(--upg-border);
}

.upg-lessons-page .upg-lessons-table thead th {
    background: #eef2f7;
    border-color: var(--upg-border);
    color: var(--upg-navy);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.65rem 0.75rem;
    white-space: nowrap;
}

.upg-lessons-page .upg-lessons-table tbody td {
    border-color: var(--upg-border);
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    color: var(--upg-text);
}

.upg-lessons-page .upg-lessons-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.upg-lessons-page .upg-lessons-table tbody tr:hover {
    background: var(--upg-blue-soft);
}

.upg-lessons-page .upg-lessons-table__code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    color: var(--upg-text-muted);
    white-space: nowrap;
}

.upg-lessons-page .upg-lessons-table__num {
    text-align: center;
    color: var(--upg-text-muted);
    font-variant-numeric: tabular-nums;
}

.upg-lessons-page .upg-lessons-table__link {
    color: var(--upg-navy);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.upg-lessons-page .upg-lessons-table__link:hover {
    color: var(--upg-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Lesson detail view --- */
.upg-lessons-page .upg-lesson-detail {
    border: 1px solid var(--upg-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.upg-lessons-page .upg-lesson-detail__header {
    background: var(--upg-navy);
    color: #fff;
    border-bottom: none;
}

.upg-lessons-page .upg-lesson-detail__header .card-title {
    color: #fff;
}

.upg-lessons-page .upg-lesson-detail__table {
    margin-bottom: 0;
}

.upg-lessons-page .upg-lesson-detail__table th {
    width: 35%;
    background: var(--upg-surface);
    color: var(--upg-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-color: var(--upg-border);
}

.upg-lessons-page .upg-lesson-detail__table td {
    color: var(--upg-text);
    border-color: var(--upg-border);
}

@media (max-width: 767.98px) {
    .upg-page .upg-lessons-link {
        flex-wrap: wrap;
    }

    .upg-page .upg-lessons-link__badge {
        margin-left: 0;
        order: 4;
    }

    .upg-page .upg-lessons-link__arrow {
        margin-left: auto;
    }
}
