:root {
    --pa-red: #b3131b;
    --pa-red-dark: #7f0e14;
    --pa-red-soft: #f6d4d7;
    --pa-white: #ffffff;
    --pa-cream: #fff7f7;
    --pa-text: #342628;
    --pa-border: rgba(179, 19, 27, 0.12);
    --pa-shadow: 0 18px 45px rgba(115, 16, 22, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans Thai", sans-serif;
    color: var(--pa-text);
    background:
        radial-gradient(circle at top left, rgba(179, 19, 27, 0.10), transparent 28%),
        linear-gradient(180deg, #fffdfd 0%, #fff3f3 100%);
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    width: 100%;
    background: linear-gradient(135deg, var(--pa-red-dark) 0%, var(--pa-red) 55%, #d9363e 100%);
}

.site-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-brand-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.site-brand-copy {
    min-width: 0;
}

.site-eyebrow {
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.02em;
    font-size: 0.85rem;
    font-weight: 500;
}

.site-title {
    color: var(--pa-white);
    font-size: clamp(1.4rem, 1.15vw + 0.95rem, 2.1rem);
    font-weight: 700;
    line-height: 1.16;
    max-width: 860px;
    text-wrap: balance;
}

.site-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    padding: 0;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.16));
}

.site-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.84rem;
    line-height: 1.4;
    max-width: 620px;
}

.site-header-meta {
    max-width: 300px;
    flex: 0 0 290px;
    align-self: center;
    padding: 0.65rem 0 0.65rem 1.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.site-header-meta p {
    line-height: 1.35;
}

.admin-shell {
    width: 100%;
    padding: 2rem 0 2.5rem;
}

/* Admin panels contain stacked sections, so they must grow only with content. */
.admin-shell .panel-card {
    height: auto;
}

.admin-sidebar {
    border-radius: 1.5rem;
    background: #fff;
    border: 1px solid var(--pa-border);
    box-shadow: var(--pa-shadow);
    padding: 1rem;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--pa-text);
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    font-weight: 600;
}

.admin-sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1.05rem;
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
    background: var(--pa-red);
    color: #fff;
}

.table-card {
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--pa-border);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--pa-shadow);
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .panel-head {
    padding: 1.2rem 1.4rem 0.85rem;
}

.table-card .panel-head > :last-child {
    margin-bottom: 0;
}

.table-card .table th,
.table-card .table td {
    padding: 0.82rem 1.4rem;
    vertical-align: middle;
}

.table-card .table thead th {
    color: var(--pa-text);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-card .table th.text-end,
.table-card .table td.text-end {
    min-width: 150px;
}

.table-card:has(#bulk-delete-form) th.text-end,
.table-card:has(#bulk-delete-form) td.text-end {
    min-width: 290px;
}

.table-card:has(#bulk-delete-form) td.text-end form {
    margin-left: 0.25rem;
}

.table-card .btn-sm {
    white-space: nowrap;
}

.admin-stat-link {
    display: block;
    color: var(--pa-text);
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.admin-stat-link:hover {
    color: var(--pa-text);
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(115, 16, 22, 0.14);
}

.site-main {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.hero-section {
    width: 100%;
    padding: 2rem 0 2.5rem;
}

.panel-card {
    height: 100%;
    border: 1px solid var(--pa-border);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--pa-shadow);
    overflow: hidden;
}

.panel-card .panel-head {
    padding: 1.25rem 1.5rem 0;
}

.panel-card .panel-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.calendar-wrap {
    --calendar-orange: #e77a24;
    --calendar-orange-dark: #a94714;
    --calendar-orange-soft: #f9d7bf;
    background: linear-gradient(180deg, #ffffff 0%, #fff6f6 100%);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.3rem;
}

.calendar-weekday,
.calendar-day {
    text-align: center;
    border-radius: 1rem;
    padding: 0.45rem 0.28rem;
}

.calendar-day.has-event {
    cursor: pointer;
    color: var(--calendar-orange-dark);
    font: inherit;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.calendar-day.has-event:hover,
.calendar-day.has-event:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(169, 71, 20, 0.16);
    outline: 2px solid rgba(231, 122, 36, 0.42);
}

.calendar-event-item + .calendar-event-item {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pa-border);
}

.calendar-event-item h3 {
    margin-bottom: 0.35rem;
    color: var(--pa-red-dark);
    font-size: 1rem;
    font-weight: 700;
}

.calendar-event-item p {
    margin: 0;
    color: #6d5b5d;
}

.calendar-weekday {
    background: var(--calendar-orange-soft);
    color: var(--calendar-orange-dark);
    font-weight: 700;
    font-size: 0.86rem;
}

.calendar-day {
    min-height: 54px;
    border: 1px solid rgba(231, 122, 36, 0.20);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.calendar-day.is-today {
    background: linear-gradient(180deg, #fff5ed 0%, #ffe1cb 100%);
    border-color: rgba(231, 122, 36, 0.45);
    font-weight: 700;
}

.calendar-day.is-empty {
    background: rgba(255, 255, 255, 0.45);
}

.calendar-day .badge-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--calendar-orange);
}

.calendar-wrap .text-bg-danger {
    background-color: var(--calendar-orange) !important;
}

.calendar-month-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.calendar-month-nav {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--calendar-orange);
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease;
}

.calendar-month-nav:hover,
.calendar-month-nav:focus {
    color: #fff;
    background: var(--calendar-orange-dark);
    transform: translateY(-1px);
}

.news-list .list-group-item {
    border-color: var(--pa-border);
    padding-left: 0;
    padding-right: 0;
}

.login-card {
    position: relative;
}

.btn-password-toggle {
    border: 0;
    color: #725b5e;
    background: #f2e8e9;
}

.btn-password-toggle:hover,
.btn-password-toggle:focus {
    border: 0;
    color: #fff;
    background: var(--pa-red-dark);
    box-shadow: none;
}

.login-support-note {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    color: #765a2c;
    background: #fff3d8;
    font-size: 0.9rem;
    line-height: 1.65;
}

.login-support-note i {
    flex: 0 0 auto;
    margin-top: 0.18rem;
    color: #d97918;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: auto -60px -50px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(179, 19, 27, 0.20), transparent 65%);
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: var(--pa-cream);
    border: 1px solid var(--pa-border);
    font-size: 0.9rem;
}

.btn-pa {
    background: linear-gradient(135deg, var(--pa-red) 0%, #d53139 100%);
    color: #fff;
    border: none;
    border-radius: 0.95rem;
    padding: 0.8rem 1rem;
    font-weight: 700;
}

.btn-pa:hover,
.btn-pa:focus {
    background: linear-gradient(135deg, var(--pa-red-dark) 0%, var(--pa-red) 100%);
    color: #fff;
}

.btn-register {
    border: 1px solid #d9861e;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, #fff4df 0%, #ffe4b8 100%);
    color: #9a4d08;
    padding: 0.8rem 1rem;
    font-weight: 700;
}

.btn-register:hover,
.btn-register:focus {
    border-color: #b45e0c;
    background: linear-gradient(135deg, #ffe7ba 0%, #ffd18a 100%);
    color: #753600;
}

.form-control,
.form-select {
    border-radius: 0.95rem;
    padding: 0.8rem 0.95rem;
    border-color: rgba(125, 31, 36, 0.18);
}

.feature-stat {
    border-radius: 1.25rem;
    border: 1px solid var(--pa-border);
    background: rgba(255, 247, 247, 0.8);
    padding: 1rem;
    height: 100%;
}

.eportfolio-card {
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.eportfolio-card:hover,
.eportfolio-card:focus-visible {
    transform: translateY(-5px);
    border-color: rgba(198, 31, 40, 0.55);
    background: #fff;
    box-shadow: 0 14px 28px rgba(115, 16, 22, 0.16);
    outline: none;
}

.eportfolio-card-active {
    border-color: rgba(25, 135, 84, 0.36);
    background: linear-gradient(135deg, #effbf4 0%, #dcf5e7 100%);
}

.eportfolio-card-active:hover,
.eportfolio-card-active:focus-visible {
    border-color: rgba(25, 135, 84, 0.7);
    background: linear-gradient(135deg, #f5fdf8 0%, #d2f0df 100%);
    box-shadow: 0 14px 28px rgba(25, 135, 84, 0.18);
}

.btn-pa-document {
    border-width: 1px;
    font-weight: 600;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.btn-pa-document:hover,
.btn-pa-document:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(31, 52, 92, 0.12);
}

.btn-pa-agreement {
    color: #195aaf;
    border-color: #a9c9f3;
    background: #edf5ff;
}

.btn-pa-agreement:hover,
.btn-pa-agreement:focus-visible {
    color: #114987;
    border-color: #76a9e8;
    background: #dcecff;
}

.btn-pa-report {
    color: #167348;
    border-color: #a8ddc1;
    background: #ecfaf2;
}

.btn-pa-report:hover,
.btn-pa-report:focus-visible {
    color: #0e5a35;
    border-color: #70bd95;
    background: #d9f3e5;
}

.group-filter-action {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.teacher-cards-admin .btn-outline-danger {
    color: #fff;
    border-color: var(--pa-red);
    background: var(--pa-red);
}

.teacher-cards-admin .btn-outline-danger:hover,
.teacher-cards-admin .btn-outline-danger:focus-visible {
    color: #fff;
    border-color: var(--pa-red-dark);
    background: var(--pa-red-dark);
}

.teacher-cards-admin .btn-outline-secondary {
    color: #fff;
    border-color: #6c757d;
    background: #6c757d;
}

.teacher-cards-admin .btn-outline-secondary:hover,
.teacher-cards-admin .btn-outline-secondary:focus-visible {
    color: #fff;
    border-color: #545b62;
    background: #545b62;
}

.users-admin .btn-outline-danger {
    color: #fff;
    border-color: var(--pa-red);
    background: var(--pa-red);
}

.users-admin .btn-outline-danger:hover,
.users-admin .btn-outline-danger:focus-visible {
    color: #fff;
    border-color: var(--pa-red-dark);
    background: var(--pa-red-dark);
}

.users-admin .btn-outline-secondary {
    color: #fff;
    border-color: #6c757d;
    background: #6c757d;
}

.users-admin .btn-outline-secondary:hover,
.users-admin .btn-outline-secondary:focus-visible {
    color: #fff;
    border-color: #545b62;
    background: #545b62;
}

.users-admin .table th:nth-child(2),
.users-admin .table td:nth-child(2) {
    min-width: 240px;
}

.users-admin .table td:nth-child(2) .fw-semibold {
    white-space: nowrap;
}

.pa-document-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    border: 1px solid var(--pa-border);
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #fffafa 0%, #fff2f3 100%);
}

.pa-document-icon {
    display: inline-grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border-radius: 0.85rem;
    color: #fff;
    background: linear-gradient(135deg, var(--pa-red-dark), var(--pa-red));
    font-size: 1.3rem;
}

.dashboard-hero {
    border-radius: 1.5rem;
    padding: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #8d1017 0%, #c61f28 60%, #e8545a 100%);
    box-shadow: var(--pa-shadow);
}

.site-footer {
    width: 100%;
    background: #7a1117;
    color: rgba(255, 255, 255, 0.9);
}

.teacher-sidebar {
    position: sticky;
    top: 1.25rem;
    display: grid;
    gap: 1rem;
}

.teacher-profile-card,
.teacher-side-section {
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--pa-border);
    box-shadow: var(--pa-shadow);
    padding: 1.2rem;
}

.teacher-profile-card {
    text-align: center;
}

.teacher-avatar {
    width: 88px;
    height: 88px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f9d7d9 0%, #fff4f4 100%);
    color: var(--pa-red-dark);
    font-size: 1.9rem;
    font-weight: 700;
    border: 1px solid rgba(179, 19, 27, 0.15);
}

.teacher-avatar-img {
    display: block;
    object-fit: cover;
    background: #fff;
}

.teacher-profile-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    color: var(--pa-red-dark);
    background: #fff1f2;
    font-size: 0.8rem;
    font-weight: 600;
}

.teacher-side-title {
    margin-bottom: 0.85rem;
    color: var(--pa-red);
    font-weight: 700;
    font-size: 0.95rem;
}

.teacher-subject-list {
    display: grid;
    gap: 0.65rem;
}

.teacher-side-item {
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    background: #fff8f8;
    border: 1px solid var(--pa-border);
}

.teacher-subject-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--pa-text) !important;
    text-decoration: none !important;
    transition: transform 160ms ease, background-color 160ms ease;
}

.teacher-subject-link:visited,
.teacher-subject-link:focus,
.teacher-subject-link:hover {
    color: var(--pa-red-dark) !important;
    text-decoration: none !important;
}

.teacher-subject-link > span:last-child {
    color: var(--pa-red);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.teacher-subject-link:hover {
    color: var(--pa-red-dark);
    background: #ffeef0;
    transform: translateX(3px);
}

.subject-link-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.subject-link-copy i {
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    border-radius: 0.7rem;
    color: #fff;
    background: linear-gradient(135deg, var(--pa-red-dark), #d53139);
    font-size: 1rem;
    box-shadow: 0 5px 12px rgba(127, 14, 20, 0.2);
}

.teacher-message-status {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.2rem 0.35rem 0.2rem 0.55rem;
    border-radius: 999px;
    color: #fff;
    background: var(--pa-red);
    font-size: 0.76rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(179, 19, 27, 0.22);
}

.teacher-subject-link > .teacher-message-status {
    color: #fff;
    font-size: 0.76rem;
    line-height: 1.2;
}

.teacher-message-status b {
    display: inline-grid;
    min-width: 1.28rem;
    height: 1.28rem;
    place-items: center;
    border-radius: 50%;
    color: var(--pa-red-dark);
    background: #fff;
}

.message-compose {
    max-width: 880px;
}

.messages-page .btn-outline-secondary {
    border-color: transparent;
    color: #5e4c4e;
    background: #f1e8e9;
}

.messages-page .btn-outline-secondary:hover,
.messages-page .btn-outline-secondary:focus {
    border-color: transparent;
    color: #fff;
    background: #806a6d;
    box-shadow: none;
}

.message-home-button,
.message-nav-button {
    border: 0 !important;
    box-shadow: none !important;
    color: #624d50;
    background: #f2e9ea;
}

.message-home-button:hover,
.message-home-button:focus,
.message-nav-button:hover,
.message-nav-button:focus {
    color: #fff;
    background: #866e72;
}

.message-nav-button.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--pa-red-dark), #cf2c35);
    box-shadow: 0 8px 18px rgba(127, 14, 20, 0.2) !important;
}

.message-list {
    display: grid;
    gap: 0.7rem;
}

.message-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--pa-border);
    border-radius: 1rem;
    color: var(--pa-text);
    background: #fffafa;
    text-decoration: none !important;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.message-item:hover {
    color: var(--pa-text);
    background: #fff;
    box-shadow: 0 10px 24px rgba(126, 15, 23, 0.1);
    transform: translateY(-2px);
}

.message-item:visited,
.message-item:focus {
    color: var(--pa-text);
    text-decoration: none !important;
}

.message-item strong {
    color: #311d20;
    font-size: 1.02rem;
}

.message-item.is-unread {
    border-color: #ed9ca2;
    background: linear-gradient(90deg, #fff0f1 0%, #fffafa 70%);
    box-shadow: inset 4px 0 0 var(--pa-red);
}

.message-item-icon {
    display: grid;
    flex: 0 0 2.6rem;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border-radius: 0.85rem;
    color: #fff;
    background: linear-gradient(135deg, var(--pa-red-dark), #d53139);
}

.message-item-copy {
    min-width: 0;
    flex: 1;
}

.message-item-copy p {
    margin-top: 0.2rem;
}

.message-unread-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--pa-red);
    animation: message-pulse 1.6s ease-in-out infinite;
}

.message-new-badge {
    flex: 0 0 auto;
    padding: 0.12rem 0.48rem;
    border-radius: 999px;
    color: #fff;
    background: var(--pa-red);
    font-size: 0.7rem;
    font-weight: 700;
}

@keyframes message-pulse {
    50% {
        opacity: 0.45;
        transform: scale(0.75);
    }
}

.message-role {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: var(--pa-red-dark);
    background: #fff0f1;
    font-size: 0.86rem;
    font-weight: 700;
}

.message-body {
    min-height: 11rem;
    padding: 1.25rem;
    border: 1px solid var(--pa-border);
    border-radius: 1rem;
    background: #fffafa;
    line-height: 1.85;
    white-space: normal;
}

.message-thread {
    display: grid;
    gap: 1rem;
}

.thread-message {
    max-width: min(760px, 88%);
    padding: 1rem 1.1rem;
    border: 1px solid var(--pa-border);
    border-radius: 1.15rem 1.15rem 1.15rem 0.35rem;
    background: #fff9f9;
}

.thread-message.is-own {
    justify-self: end;
    border-color: transparent;
    border-radius: 1.15rem 1.15rem 0.35rem;
    color: #fff;
    background: linear-gradient(135deg, var(--pa-red-dark), #d7353d);
    box-shadow: 0 10px 22px rgba(127, 14, 20, 0.15);
}

.thread-message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
    align-items: baseline;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
}

.thread-message-meta span {
    color: #7a6669;
}

.thread-message.is-own .thread-message-meta span {
    color: rgba(255, 255, 255, 0.78);
}

.thread-message-body {
    line-height: 1.75;
}

.reply-form {
    padding: 1.1rem;
    border: 1px solid var(--pa-border);
    border-radius: 1rem;
    background: #fff6f7;
}

@media (max-width: 575.98px) {
    .thread-message {
        max-width: 100%;
    }
}

.department-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.7rem;
}

.department-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--pa-border);
    border-radius: 0.9rem;
    background: #fff8f8;
    cursor: pointer;
}

.position-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem 0.45rem 0.8rem;
    border-radius: 999px;
    background: #fff2f3;
    color: var(--pa-red-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.position-chip a,
.position-chip button {
    border: 0;
    border-radius: 999px;
    padding: 0.18rem 0.5rem;
    color: var(--pa-red-dark);
    background: #fff;
    text-decoration: none;
    font: inherit;
}

.position-chip form {
    display: inline;
}

.profile-work-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.profile-work-summary > div {
    padding: 0.9rem 1rem;
    border: 1px solid var(--pa-border);
    border-radius: 1rem;
    background: #fff8f8;
}

.profile-work-summary span,
.profile-work-summary strong {
    display: block;
}

.profile-work-summary span {
    margin-bottom: 0.25rem;
    color: var(--pa-red);
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .profile-work-summary {
        grid-template-columns: 1fr;
    }
}

.profile-photo {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 8px 22px rgba(115, 16, 22, 0.14);
}

.teacher-card-photo {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 1.15rem;
    border: 4px solid #fff;
    box-shadow: 0 8px 22px rgba(115, 16, 22, 0.14);
}

.profile-photo-fallback,
.teacher-card-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f4c9cc, #fff8f8);
    color: var(--pa-red-dark);
    font-size: 2.35rem;
    font-weight: 700;
}

.teacher-card {
    height: 100%;
    overflow: hidden;
    text-align: center;
    border: 1px solid var(--pa-border);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--pa-shadow);
}

.teacher-card-photo {
    margin: 1.5rem auto 0;
    display: grid;
}

.teacher-card-body {
    padding: 1rem 1.25rem 1.3rem;
}

.teacher-card-label {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: var(--pa-red);
    font-size: 0.8rem;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .site-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-header-meta {
        max-width: none;
        width: 100%;
        flex: none;
        padding: 0;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        padding-top: 1rem;
    }

    .site-logo {
        width: 70px;
        height: 70px;
    }

    .site-title {
        font-size: clamp(1.4rem, 2vw + 1rem, 1.95rem);
        white-space: normal;
    }

    .site-subtitle {
        font-size: 0.88rem;
    }

    .calendar-day {
        min-height: 48px;
    }

    .teacher-sidebar {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .table-card .panel-head {
        padding: 1rem;
    }

    .table-card .table th,
    .table-card .table td {
        padding: 0.72rem 1rem;
    }
}

@media (min-width: 1200px) {
    .site-title {
        white-space: nowrap;
    }
}
