/* Teacher portal — aligns with admin Caspero / pluto-topbar (style.css) */

.tp-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary, #667eea) 0%, var(--secondary, #764ba2) 100%);
    font-family: Poppins, system-ui, sans-serif;
}

.tp-body.tp-logged-in {
    background: #f8fafc;
}

.tp-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.tp-login-wrap::before,
.tp-login-wrap::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(18px);
    pointer-events: none;
}

.tp-login-wrap::before {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.38), rgba(99, 102, 241, 0));
    top: -80px;
    left: -70px;
}

.tp-login-wrap::after {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.24), rgba(16, 185, 129, 0));
    bottom: -110px;
    right: -80px;
}

.tp-login-card {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.66));
    border: 1px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    box-shadow:
        0 22px 45px rgba(15, 23, 42, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    padding: 2rem 1.85rem 1.75rem;
    position: relative;
    z-index: 1;
}

.tp-login-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #1f2937;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tp-login-brand-badge i {
    color: #4f46e5;
}

.tp-login-card .form-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.4rem;
}

.tp-input-wrap {
    position: relative;
}

.tp-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.92rem;
    pointer-events: none;
}

.tp-login-card .form-control {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.78);
    padding-left: 2.15rem;
    font-size: 0.95rem;
}

.tp-login-card .form-control:focus {
    border-color: rgba(79, 70, 229, 0.65);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.tp-login-btn {
    min-height: 46px;
    border-radius: 12px !important;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.3);
}

.tp-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.35);
}

.tp-login-card p a {
    color: #1d4ed8;
    font-weight: 600;
}

.tp-login-card p a:hover {
    color: #1e40af;
    text-decoration: underline !important;
}

@media (max-width: 575px) {
    .tp-login-card {
        max-width: 100%;
        padding: 1.35rem 1rem 1.1rem;
        border-radius: 16px;
    }
    .tp-login-card .form-control,
    .tp-login-btn {
        min-height: 44px;
    }
}

.tp-portal-main {
    background: #f8fafc;
    min-height: calc(100vh - 73px);
    margin-top: 73px;
    padding: 24px;
    box-sizing: border-box;
}

/* Offset main content for fixed Caspero sidebar (matches admin layout) */
#teacherPortalApp .tp-portal-main {
    margin-left: 250px;
    width: calc(100% - 250px);
    max-width: none;
}

@media (max-width: 767px) {
    #teacherPortalApp .tp-portal-main {
        margin-left: 0;
        width: 100%;
    }
}

.navbar-academic-info #tpNavbarCurrentYear,
.navbar-academic-info #tpNavbarCurrentTerm {
    color: #fde047 !important;
    font-weight: 700;
}

/* ——— Dashboard: focus visibility (a11y) ——— */
#teacherPortalApp .tp-dashboard :is(a, button):focus {
    outline: none;
}

#teacherPortalApp .tp-dashboard :is(a, button):focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

#teacherPortalApp .tp-dashboard .tp-next-action:focus-visible {
    outline-offset: 2px;
}

/* ——— Hero ——— */
.tp-dashboard-hero {
    position: relative;
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 250, 252, 0.98) 45%,
        rgba(241, 245, 249, 0.95) 100%
    );
    border: 1px solid rgba(15, 32, 58, 0.08);
    box-shadow:
        0 4px 24px rgba(15, 32, 58, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    overflow: hidden;
}

.tp-dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.35),
        rgba(118, 75, 162, 0.25),
        rgba(16, 185, 129, 0.15)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.tp-dashboard-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.tp-dashboard-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.tp-dashboard-kicker .badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 8px;
}

.tp-dashboard-greeting {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 0.35rem 0;
    letter-spacing: -0.02em;
}

.tp-dashboard-lede {
    font-size: 0.95rem;
    color: #475569;
    margin: 0;
    max-width: 42rem;
    line-height: 1.5;
}

.tp-dashboard-hero .dashboard-date-badge {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 32, 58, 0.06);
}

/* ——— Quick actions ——— */
.tp-next-actions {
    margin-bottom: 1.5rem;
}

.tp-next-actions-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 0 0 0.65rem 0;
}

.tp-next-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.tp-next-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 1.1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.tp-next-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 32, 58, 0.1);
}

.tp-next-action--primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
    color: #fff !important;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.tp-next-action--secondary {
    background: #fff;
    color: #334155 !important;
    border-color: #e2e8f0;
}

.tp-next-action--accent {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46 !important;
    border-color: rgba(16, 185, 129, 0.35);
}

.tp-next-action--muted {
    background: #f1f5f9;
    color: #475569 !important;
    border-color: #e2e8f0;
}

/* ——— Metrics: desktop grid + mobile snap scroll ——— */
.tp-metrics-strip {
    margin-bottom: 1.5rem;
}

/* Metric cards: full-width stack on phones (beats global 2-col grid from style.css) */
@media (max-width: 767px) {
    #teacherPortalApp .tp-metrics-strip .dashboard-metrics-grid {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap !important;
        gap: 14px;
        overflow-x: visible !important;
        padding-bottom: 0;
        margin-bottom: 0 !important;
        scroll-snap-type: none !important;
        grid-template-columns: none !important;
    }

    #teacherPortalApp .tp-metrics-strip .caspero-metric-card {
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0;
        box-sizing: border-box;
    }

    #teacherPortalApp .tp-metrics-strip .caspero-card-value {
        font-size: clamp(1.75rem, 8vw, 2.25rem);
    }

    #teacherPortalApp .tp-metrics-strip .caspero-card-label {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    #teacherPortalApp .tp-dashboard-hero-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    #teacherPortalApp .tp-dashboard-hero .dashboard-date-badge {
        align-self: flex-start;
    }

    #teacherPortalApp .tp-next-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    #teacherPortalApp .tp-next-action {
        width: 100%;
        justify-content: center;
    }
}

.tp-dashboard .caspero-metric-card.tp-metric-static {
    cursor: default;
    transition: box-shadow 0.25s ease;
}

.tp-dashboard .caspero-metric-card.tp-metric-static:hover {
    transform: none;
    box-shadow: 0 8px 28px rgba(15, 32, 58, 0.1);
}

/* ——— Assignment sections ——— */
.tp-section-class .caspero-list-title i.text-primary {
    color: #4f46e5 !important;
}

.tp-section-subject .caspero-list-title i.text-success {
    color: #047857 !important;
}

/* ——— Class teacher rows: compact grid, container-query responsive ——— */
.tp-section-class.caspero-list-card {
    container-type: inline-size;
    container-name: tp-class-list;
    padding: 0.85rem 1rem 1rem;
}

.tp-section-class .caspero-list-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.55rem;
}

.tp-section-class .caspero-list-title {
    font-size: 1.02rem;
}

.tp-section-class .caspero-list-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-right: 2px;
}

.tp-section-class .tp-class-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0.25rem;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    background: #fafbfc;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.tp-section-class .tp-class-row:hover {
    background: #f1f5f9;
    transform: none;
    box-shadow: 0 1px 3px rgba(15, 32, 58, 0.06);
}

.tp-section-class .tp-class-row-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.tp-section-class .tp-class-row-avatar .caspero-avatar-placeholder {
    font-size: 0.7rem;
}

.tp-section-class .tp-class-row-title {
    font-size: 0.88rem;
    line-height: 1.3;
    margin-bottom: 1px;
}

.tp-section-class .tp-class-row-meta {
    font-size: 0.72rem;
    line-height: 1.25;
}

.tp-section-class .tp-class-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
}

.tp-section-class .tp-class-btn {
    min-height: 40px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.tp-section-class .tp-class-btn-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
    margin-right: 0.3rem;
}

@media (min-width: 576px) {
    .tp-section-class .tp-class-btn {
        min-height: 44px;
        padding: 0.4rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Narrow class card: stack actions full width (container query) */
@container tp-class-list (max-width: 400px) {
    .tp-class-row {
        grid-template-columns: 34px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .tp-class-row-avatar {
        grid-column: 1;
        grid-row: 1;
        width: 34px;
        height: 34px;
    }

    .tp-class-row-text {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .tp-class-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 0.4rem;
        justify-self: stretch;
        margin-top: 0.15rem;
    }

    .tp-class-btn {
        width: 100%;
        min-height: 44px;
    }
}

/* Fallback: small viewport */
@media (max-width: 575px) {
    .tp-section-class .tp-class-row {
        grid-template-columns: 34px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .tp-section-class .tp-class-row-avatar {
        grid-column: 1;
        grid-row: 1;
        width: 34px;
        height: 34px;
    }

    .tp-section-class .tp-class-row-text {
        grid-column: 2;
        grid-row: 1;
    }

    .tp-section-class .tp-class-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 0.4rem;
    }

    .tp-section-class .tp-class-btn {
        width: 100%;
        min-height: 44px;
    }
}

/* ——— Subject teacher rows: same compact grid pattern as class teacher ——— */
.tp-section-subject.caspero-list-card {
    container-type: inline-size;
    container-name: tp-subject-list;
    padding: 0.85rem 1rem 1rem;
}

.tp-section-subject .caspero-list-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.55rem;
}

.tp-section-subject .caspero-list-title {
    font-size: 1.02rem;
}

.tp-section-subject .caspero-list-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-right: 2px;
}

.tp-section-subject .tp-subj-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0.25rem;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fdfb 0%, #f0fdf6 100%);
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.tp-section-subject .tp-subj-row:hover {
    background: #ecfdf5;
    transform: none;
    box-shadow: 0 1px 3px rgba(5, 95, 70, 0.08);
}

.tp-section-subject .tp-subj-row-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.tp-section-subject .tp-subj-row-avatar .caspero-avatar-placeholder {
    font-size: 0.7rem;
}

.tp-section-subject .tp-subj-row-title {
    font-size: 0.88rem;
    line-height: 1.3;
    margin-bottom: 1px;
}

.tp-section-subject .tp-subj-row-meta {
    font-size: 0.72rem;
    line-height: 1.25;
}

.tp-section-subject .tp-subj-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
}

.tp-section-subject .tp-subj-btn.tp-btn-enter-scores {
    min-height: 40px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    background: #047857 !important;
    border-color: #065f46 !important;
    color: #fff !important;
}

.tp-section-subject .tp-subj-btn.tp-btn-enter-scores:hover {
    background: #065f46 !important;
    color: #fff !important;
}

@media (min-width: 576px) {
    .tp-section-subject .tp-subj-btn.tp-btn-enter-scores {
        min-height: 44px;
        padding: 0.4rem 0.9rem;
        font-size: 0.8125rem;
    }
}

@container tp-subject-list (max-width: 400px) {
    .tp-subj-row {
        grid-template-columns: 34px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .tp-subj-row-avatar {
        grid-column: 1;
        grid-row: 1;
        width: 34px;
        height: 34px;
    }

    .tp-subj-row-text {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .tp-subj-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        margin-top: 0.15rem;
    }

    .tp-subj-btn.tp-btn-enter-scores {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 575px) {
    .tp-section-subject .tp-subj-row {
        grid-template-columns: 34px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .tp-section-subject .tp-subj-row-avatar {
        grid-column: 1;
        grid-row: 1;
        width: 34px;
        height: 34px;
    }

    .tp-section-subject .tp-subj-row-text {
        grid-column: 2;
        grid-row: 1;
    }

    .tp-section-subject .tp-subj-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .tp-section-subject .tp-subj-btn.tp-btn-enter-scores {
        width: 100%;
        min-height: 44px;
    }
}

.tp-dashboard .caspero-list-item .btn {
    white-space: nowrap;
}

.tp-subject-tile .caspero-card-value {
    white-space: normal;
    word-break: break-word;
}

.tp-breadcrumb {
    font-size: 0.9rem;
    color: #64748b;
}

.tp-breadcrumb a {
    color: #4f46e5;
    font-weight: 500;
    text-decoration: none;
}

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

.tp-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 991px) {
    .tp-subject-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .tp-subject-grid {
        grid-template-columns: 1fr;
    }
}

.tp-spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-toast-host {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 21000;
    max-width: min(400px, 92vw);
}

.tp-alert-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #f59e0b;
}

.tp-roll-card {
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

#tpRollTable {
    min-width: 520px;
}

@media (max-width: 767px) {
    #tpRollTable .form-control.tp-roll-present,
    #tpRollTable .form-control.tp-roll-conduct,
    #tpRollTable .form-control.tp-roll-interest {
        min-height: 44px;
        font-size: 16px;
    }
}

/* ——— Empty states ——— */
.tp-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem 2rem;
    max-width: 28rem;
    margin: 0 auto;
}

.tp-empty-icon-wrap {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(15, 32, 58, 0.08);
}

.tp-empty-icon-wrap i {
    font-size: 2.25rem;
    color: #64748b;
}

.tp-empty-state h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.tp-empty-state p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 1.25rem 0;
}

.tp-empty-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 1rem;
}

/* ——— Skeleton loading ——— */
@keyframes tp-skel-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.tp-skel {
    border-radius: 12px;
    background: linear-gradient(
        90deg,
        #e2e8f0 0%,
        #f1f5f9 45%,
        #e2e8f0 90%
    );
    background-size: 200% 100%;
    animation: tp-skel-shimmer 1.35s ease-in-out infinite;
}

.tp-dashboard--loading .tp-dashboard-hero.tp-skel-block {
    min-height: 140px;
    border-radius: 20px;
}

.tp-dashboard--loading .tp-skel-actions {
    height: 48px;
    border-radius: 12px;
    margin-bottom: 0.65rem;
    max-width: 100%;
}

.tp-dashboard--loading .tp-skel-metric {
    height: 108px;
    border-radius: 12px;
}

.tp-dashboard--loading .tp-skel-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.tp-dashboard--loading .tp-skel-line--short {
    max-width: 55%;
}

.tp-dashboard--loading .tp-skel-card {
    height: 72px;
    border-radius: 10px;
    margin-bottom: 10px;
}

@media (max-width: 639px) {
    .tp-dashboard--loading .tp-skel-metrics-row {
        display: flex;
        gap: 12px;
        overflow: hidden;
    }

    .tp-dashboard--loading .tp-skel-metric {
        flex: 0 0 78vw;
        min-width: 78vw;
    }
}

/* ——— Error card on dashboard load ——— */
.tp-dashboard-error-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #fecaca;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.08);
}

#tp-section-class,
#tp-section-subject,
#tp-assignments-grid {
    scroll-margin-top: 96px;
}

/* ——— My profile ——— */
.tp-profile-page .tp-profile-card {
    padding: 1.35rem 1.5rem;
}

.tp-profile-page .tp-profile-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #0f172a;
}

.tp-profile-page .tp-profile-photo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.tp-profile-page .tp-profile-photo-preview {
    width: 160px;
    height: 160px;
    object-fit: cover;
    background: #f1f5f9;
}

.tp-profile-page .tp-profile-password-fields {
    max-width: 520px;
}

#tp-profile-password {
    scroll-margin-top: 96px;
}

/*
 * Teacher scoresheet only (#tpScoreTable): column widths follow header text.
 * Shared style.css uses table-layout: fixed + wide min-widths — that leaves empty gutter; auto layout fixes it.
 */
.tp-score-entry-fullscreen .scoresheet-ui-scope#tpScoreEntryTableWrapper .tp-score-table#tpScoreTable {
    --tp-score-idx-w: 4rem;
    table-layout: auto;
    width: max-content;
    min-width: 0;
    max-width: 100%;
}

.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable thead th.tp-sc-col--idx,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable tbody td.tp-sc-col--idx {
    width: var(--tp-score-idx-w);
    min-width: var(--tp-score-idx-w);
    max-width: var(--tp-score-idx-w);
}

.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable th.tp-sc-col--student,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable td.tp-sc-col--student {
    width: auto;
    min-width: 7rem;
    max-width: 13rem;
}

.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable th.tp-sc-col--assess,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable td.tp-sc-col--assess,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable th.tp-sc-col--exam,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable td.tp-sc-col--exam,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable th.tp-sc-col--readonly,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable td.tp-sc-col--readonly {
    width: auto;
    min-width: 2.55rem;
    max-width: none;
}

.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable th.tp-sc-col--assess {
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
    max-width: 9rem;
    line-height: 1.2;
}

.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable th.tp-sc-col--exam,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable th.tp-sc-col--readonly {
    white-space: normal;
    line-height: 1.15;
    max-width: 5.25rem;
}

.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable .tp-sc-col--assess .tp-sc-input,
.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable .tp-sc-col--exam .tp-sc-input {
    max-width: 3.75rem;
    width: 100%;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
}

.tp-score-entry-fullscreen .scoresheet-ui-scope #tpScoreTable .tp-sc-col--readonly .tp-sc-input--readonly {
    max-width: 3.35rem;
    width: 100%;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
}

/* ——— Scoresheet: table chrome + sticky columns live in style.css (.scoresheet-ui-scope) ——— */
.tp-score-entry-fullscreen {
    padding: 14px 16px max(14px, env(safe-area-inset-bottom));
    gap: 0;
}

.tp-score-entry-fullscreen .tp-score-sheet-card {
    flex: 1 1 auto;
    min-height: 0;
}

.tp-score-entry-fullscreen .tp-scoresheet-actions {
    padding-top: 0.5rem;
}

.tp-scoresheet-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tp-scoresheet-topbar .tp-scoresheet-actions {
    margin-left: auto;
    padding-top: 0;
}

.tp-score-meta-line .badge {
    white-space: normal;
    text-align: left;
    line-height: 1.35;
    max-width: 100%;
}

@media (max-width: 767px) {
    .tp-scoresheet-topbar {
        align-items: stretch;
    }

    .tp-scoresheet-topbar .tp-scoresheet-actions {
        width: 100%;
        margin-left: 0;
    }

    .tp-scoresheet-actions {
        flex-direction: column;
        align-items: stretch !important;
    }

    .tp-scoresheet-actions .btn {
        width: 100%;
        min-height: 44px;
    }

    /* Info badges: compact on narrow screens */
    .score-entry-info-badge {
        gap: 4px;
        flex-wrap: wrap;
    }

    .score-entry-info-badge .badge {
        font-size: 0.72rem;
        padding: 0.3rem 0.55rem;
        letter-spacing: 0;
    }

    .tp-score-meta-line .badge {
        font-size: 0.72rem;
        padding: 0.3rem 0.55rem;
    }
}

@media (max-width: 575px) {
    .tp-score-entry-fullscreen {
        padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    }

    .tp-portal-main {
        padding: 12px 12px 1.5rem;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }

    .tp-breadcrumb {
        font-size: 0.82rem;
        word-break: break-word;
        line-height: 1.45;
    }

    .tp-toast-host {
        left: 12px;
        right: 12px;
        max-width: none;
    }

    /* Scoresheet: compact badges at small viewport */
    .score-entry-info-badge {
        gap: 0.3rem;
    }

    .score-entry-info-badge .badge {
        font-size: 0.68rem;
        padding: 0.25rem 0.45rem;
        letter-spacing: 0;
    }

    .tp-score-meta-line .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.45rem;
    }

    /* Scoresheet action buttons: stay stacked but more compact */
    .tp-scoresheet-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
    }
}

/* Landscape on mobile phones only (max-width: 991px prevents firing on small desktop windows) */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 991px) {
    .tp-scoresheet-actions {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap;
    }

    .tp-scoresheet-actions .btn {
        width: auto !important;
        min-height: 38px;
        padding: 0.35rem 0.65rem;
        font-size: 0.78rem;
        flex: 1 1 auto;
    }

    .score-entry-info-badge .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .tp-score-meta-line .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ===== Teacher + parent + school head + admin login (glassmorphism) ===== */
#teacherLoginScreen.tp-login-wrap,
#parentLoginScreen.tp-login-wrap,
#schoolHeadLoginScreen.tp-login-wrap,
#loginPage.tp-login-wrap {
    background:
        radial-gradient(900px 500px at -8% -20%, rgba(99, 102, 241, 0.42), transparent 68%),
        radial-gradient(900px 500px at 105% 105%, rgba(16, 185, 129, 0.24), transparent 72%),
        linear-gradient(140deg, #0f172a 0%, #1e293b 40%, #334155 100%);
}

#teacherLoginScreen .tp-login-shell,
#parentLoginScreen .tp-login-shell,
#schoolHeadLoginScreen .tp-login-shell,
#loginPage .tp-login-shell {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.1rem;
    align-items: stretch;
}

#teacherLoginScreen .tp-login-showcase,
#parentLoginScreen .tp-login-showcase,
#schoolHeadLoginScreen .tp-login-showcase,
#loginPage .tp-login-showcase {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.2rem 2rem;
    color: #e2e8f0;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
}

/* Subtle grid texture (login left panel) */
#teacherLoginScreen .tp-login-showcase::before,
#parentLoginScreen .tp-login-showcase::before,
#schoolHeadLoginScreen .tp-login-showcase::before,
#loginPage .tp-login-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(165deg, black 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}

#teacherLoginScreen .tp-login-showcase-logo-wrap,
#parentLoginScreen .tp-login-showcase-logo-wrap,
#schoolHeadLoginScreen .tp-login-showcase-logo-wrap,
#loginPage .tp-login-showcase-logo-wrap {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    width: fit-content;
    max-width: 100%;
}

#teacherLoginScreen .tp-login-showcase-logo,
#parentLoginScreen .tp-login-showcase-logo,
#schoolHeadLoginScreen .tp-login-showcase-logo,
#loginPage .tp-login-showcase-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 88px;
    max-height: 88px;
    object-fit: contain;
    border-radius: 14px;
    padding: 6px;
    background: rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

#teacherLoginScreen .tp-login-showcase--has-logo .tp-login-school-name,
#parentLoginScreen .tp-login-showcase--has-logo .tp-login-school-name,
#schoolHeadLoginScreen .tp-login-showcase--has-logo .tp-login-school-name,
#loginPage .tp-login-showcase--has-logo .tp-login-school-name {
    margin-top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
    #teacherLoginScreen .tp-login-showcase::before,
    #parentLoginScreen .tp-login-showcase::before,
    #schoolHeadLoginScreen .tp-login-showcase::before,
    #loginPage .tp-login-showcase::before {
        opacity: 0.1;
    }
}

#teacherLoginScreen .tp-login-showcase-lead,
#parentLoginScreen .tp-login-showcase-lead,
#schoolHeadLoginScreen .tp-login-showcase-lead,
#loginPage .tp-login-showcase-lead {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 0;
}

#teacherLoginScreen .tp-login-portal-nav,
#parentLoginScreen .tp-login-portal-nav,
#schoolHeadLoginScreen .tp-login-portal-nav,
#loginPage .tp-login-portal-nav {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

#teacherLoginScreen .tp-login-portal-link,
#parentLoginScreen .tp-login-portal-link,
#schoolHeadLoginScreen .tp-login-portal-link,
#loginPage .tp-login-portal-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
    background: rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#teacherLoginScreen .tp-login-portal-link i,
#parentLoginScreen .tp-login-portal-link i,
#schoolHeadLoginScreen .tp-login-portal-link i,
#loginPage .tp-login-portal-link i {
    font-size: 1.05rem;
    opacity: 0.9;
}

#teacherLoginScreen .tp-login-portal-link:hover,
#parentLoginScreen .tp-login-portal-link:hover,
#schoolHeadLoginScreen .tp-login-portal-link:hover,
#loginPage .tp-login-portal-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}

#teacherLoginScreen .tp-login-portal-link:focus-visible,
#parentLoginScreen .tp-login-portal-link:focus-visible,
#schoolHeadLoginScreen .tp-login-portal-link:focus-visible,
#loginPage .tp-login-portal-link:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.95);
    outline-offset: 2px;
}

#teacherLoginScreen .tp-login-showcase-title,
#parentLoginScreen .tp-login-showcase-title,
#schoolHeadLoginScreen .tp-login-showcase-title,
#loginPage .tp-login-showcase-title {
    margin: 1rem 0 0.75rem;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.25;
    font-weight: 700;
    color: #f8fafc;
}

#teacherLoginScreen .tp-login-school-name,
#parentLoginScreen .tp-login-school-name,
#schoolHeadLoginScreen .tp-login-school-name,
#loginPage .tp-login-school-name {
    margin: 0.65rem 0 0;
    width: 100%;
    text-align: center;
    font-size: clamp(0.95rem, 1.35vw, 1.2rem);
    line-height: 1.35;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.01em;
    word-break: break-word;
}

#teacherLoginScreen .tp-login-showcase-copy,
#parentLoginScreen .tp-login-showcase-copy,
#schoolHeadLoginScreen .tp-login-showcase-copy,
#loginPage .tp-login-showcase-copy {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #cbd5e1;
    max-width: 40ch;
}

#teacherLoginScreen .tp-login-card,
#parentLoginScreen .tp-login-card,
#schoolHeadLoginScreen .tp-login-card,
#loginPage .tp-login-card {
    max-width: none;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.66));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 2.1rem 1.9rem 1.8rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Right card: full-width role title (edge-to-edge within card) */
#teacherLoginScreen .tp-login-card-header-band,
#parentLoginScreen .tp-login-card-header-band,
#schoolHeadLoginScreen .tp-login-card-header-band,
#loginPage .tp-login-card-header-band {
    margin: -2.1rem -1.9rem 1.25rem;
    width: calc(100% + 3.8rem);
    max-width: none;
    align-self: stretch;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    border: 1px solid rgba(129, 140, 248, 0.35);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

#teacherLoginScreen .tp-login-card-role,
#parentLoginScreen .tp-login-card-role,
#schoolHeadLoginScreen .tp-login-card-role,
#loginPage .tp-login-card-role {
    width: 100%;
    margin: 0;
    padding: 0.95rem 1rem;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: none;
    color: #f8fafc;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 48%, #4338ca 100%);
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
}

#teacherLoginScreen .tp-login-card-home,
#parentLoginScreen .tp-login-card-home,
#schoolHeadLoginScreen .tp-login-card-home,
#loginPage .tp-login-card-home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: calc(100% + 3.8rem);
    max-width: none;
    margin-top: auto;
    margin-left: -1.9rem;
    margin-right: -1.9rem;
    margin-bottom: -1.8rem;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    background: rgba(241, 245, 249, 0.98);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0 0 20px 20px;
    transition: background 0.15s ease, color 0.15s ease;
}

#teacherLoginScreen .tp-login-card-home:hover,
#parentLoginScreen .tp-login-card-home:hover,
#schoolHeadLoginScreen .tp-login-card-home:hover,
#loginPage .tp-login-card-home:hover {
    color: #1e293b;
    background: rgba(226, 232, 240, 0.98);
}

#teacherLoginScreen .tp-login-card-home:focus-visible,
#parentLoginScreen .tp-login-card-home:focus-visible,
#schoolHeadLoginScreen .tp-login-card-home:focus-visible,
#loginPage .tp-login-card-home:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.85);
    outline-offset: -2px;
    z-index: 1;
    position: relative;
}

#teacherLoginScreen .tp-login-card-home i,
#parentLoginScreen .tp-login-card-home i,
#schoolHeadLoginScreen .tp-login-card-home i,
#loginPage .tp-login-card-home i {
    font-size: 1.1rem;
    opacity: 0.9;
}

#teacherLoginScreen .tp-login-brand-badge,
#parentLoginScreen .tp-login-brand-badge,
#schoolHeadLoginScreen .tp-login-brand-badge,
#loginPage .tp-login-brand-badge {
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* School name on login lives in the left showcase (.tp-login-school-name). */

#teacherLoginScreen .text-muted,
#parentLoginScreen .text-muted,
#schoolHeadLoginScreen .text-muted,
#loginPage .text-muted {
    color: #64748b !important;
}

#teacherLoginScreen .form-label,
#parentLoginScreen .form-label,
#schoolHeadLoginScreen .form-label,
#loginPage .form-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.4rem;
}

#teacherLoginScreen .tp-input-wrap,
#parentLoginScreen .tp-input-wrap,
#schoolHeadLoginScreen .tp-input-wrap,
#loginPage .tp-input-wrap {
    position: relative;
}

#teacherLoginScreen .tp-input-wrap i,
#parentLoginScreen .tp-input-wrap i,
#schoolHeadLoginScreen .tp-input-wrap i,
#loginPage .tp-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.92rem;
    pointer-events: none;
}

#teacherLoginScreen .tp-input-wrap .form-control,
#parentLoginScreen .tp-input-wrap .form-control,
#schoolHeadLoginScreen .tp-input-wrap .form-control,
#loginPage .tp-input-wrap .form-control {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.8);
    padding-left: 2.15rem;
    font-size: 0.95rem;
}

#teacherLoginScreen .tp-input-wrap--toggle .form-control,
#parentLoginScreen .tp-input-wrap--toggle .form-control,
#schoolHeadLoginScreen .tp-input-wrap--toggle .form-control,
#loginPage .tp-input-wrap--toggle .form-control {
    padding-right: 2.75rem;
}

#teacherLoginScreen .tp-input-wrap .tp-password-toggle,
#parentLoginScreen .tp-input-wrap .tp-password-toggle,
#schoolHeadLoginScreen .tp-input-wrap .tp-password-toggle,
#loginPage .tp-input-wrap .tp-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #64748b;
    padding: 0.25rem 0.45rem;
    border-radius: 8px;
    line-height: 1;
}

#teacherLoginScreen .tp-input-wrap .tp-password-toggle:hover,
#parentLoginScreen .tp-input-wrap .tp-password-toggle:hover,
#schoolHeadLoginScreen .tp-input-wrap .tp-password-toggle:hover,
#loginPage .tp-input-wrap .tp-password-toggle:hover {
    color: #4338ca;
    background: rgba(79, 70, 229, 0.08);
}

#teacherLoginScreen .tp-input-wrap .form-control:focus,
#parentLoginScreen .tp-input-wrap .form-control:focus,
#schoolHeadLoginScreen .tp-input-wrap .form-control:focus,
#loginPage .tp-input-wrap .form-control:focus {
    border-color: rgba(79, 70, 229, 0.65);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

#teacherLoginScreen .tp-login-btn,
#parentLoginScreen .tp-login-btn,
#schoolHeadLoginScreen .tp-login-btn,
#loginPage .tp-login-btn {
    min-height: 48px;
    border-radius: 12px !important;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.3);
}

#teacherLoginScreen .tp-login-btn:hover,
#parentLoginScreen .tp-login-btn:hover,
#schoolHeadLoginScreen .tp-login-btn:hover,
#loginPage .tp-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.35);
}

#teacherLoginScreen .tp-login-card p a,
#parentLoginScreen .tp-login-card p a,
#schoolHeadLoginScreen .tp-login-card p a,
#loginPage .tp-login-card p a {
    color: #1d4ed8;
    font-weight: 600;
}

#teacherLoginScreen .tp-login-card p a:hover,
#parentLoginScreen .tp-login-card p a:hover,
#schoolHeadLoginScreen .tp-login-card p a:hover,
#loginPage .tp-login-card p a:hover {
    color: #1e40af;
    text-decoration: underline !important;
}

#loginPage .tp-login-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.5);
}

#loginPage .tp-login-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

#loginPage #loginMessage.form-message {
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

#loginPage #loginMessage.form-message.success {
    background: rgba(220, 252, 231, 0.95);
    color: #166534;
    border: 1px solid #86efac;
}

#loginPage #loginMessage.form-message.error {
    background: rgba(255, 241, 242, 0.95);
    color: #9f1239;
    border: 1px solid #fda4af;
}

@media (max-width: 991px) {
    #teacherLoginScreen .tp-login-shell,
    #parentLoginScreen .tp-login-shell,
    #schoolHeadLoginScreen .tp-login-shell,
    #loginPage .tp-login-shell {
        grid-template-columns: 1fr;
        max-width: 540px;
    }
    #teacherLoginScreen .tp-login-showcase,
    #parentLoginScreen .tp-login-showcase,
    #schoolHeadLoginScreen .tp-login-showcase,
    #loginPage .tp-login-showcase {
        padding: 1rem 1rem 0.6rem;
        border: none;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        color: #e2e8f0;
    }

    #teacherLoginScreen .tp-login-showcase::before,
    #parentLoginScreen .tp-login-showcase::before,
    #schoolHeadLoginScreen .tp-login-showcase::before,
    #loginPage .tp-login-showcase::before {
        opacity: 0.09;
    }

    #teacherLoginScreen .tp-login-showcase-title,
    #parentLoginScreen .tp-login-showcase-title,
    #schoolHeadLoginScreen .tp-login-showcase-title,
    #loginPage .tp-login-showcase-title {
        margin-top: 0.6rem;
        font-size: 1.25rem;
    }

    #teacherLoginScreen .tp-login-school-name,
    #parentLoginScreen .tp-login-school-name,
    #schoolHeadLoginScreen .tp-login-school-name,
    #loginPage .tp-login-school-name {
        margin-top: 0.45rem;
        font-size: 1.02rem;
    }

    #teacherLoginScreen .tp-login-portal-nav,
    #parentLoginScreen .tp-login-portal-nav,
    #schoolHeadLoginScreen .tp-login-portal-nav,
    #loginPage .tp-login-portal-nav {
        margin-top: 1rem;
        padding-top: 0;
    }
    #teacherLoginScreen .tp-login-showcase-copy,
    #parentLoginScreen .tp-login-showcase-copy,
    #schoolHeadLoginScreen .tp-login-showcase-copy,
    #loginPage .tp-login-showcase-copy {
        font-size: 0.9rem;
    }
}

@media (max-width: 575px) {
    #teacherLoginScreen.tp-login-wrap,
    #parentLoginScreen.tp-login-wrap,
    #schoolHeadLoginScreen.tp-login-wrap,
    #loginPage.tp-login-wrap {
        padding: 1rem;
    }
    #teacherLoginScreen .tp-login-card,
    #parentLoginScreen .tp-login-card,
    #schoolHeadLoginScreen .tp-login-card,
    #loginPage .tp-login-card {
        padding: 1.25rem 1rem 1.1rem;
        border-radius: 16px;
    }

    #teacherLoginScreen .tp-login-card-header-band,
    #parentLoginScreen .tp-login-card-header-band,
    #schoolHeadLoginScreen .tp-login-card-header-band,
    #loginPage .tp-login-card-header-band {
        margin: -1.25rem -1rem 1rem;
        width: calc(100% + 2rem);
        border-radius: 16px 16px 0 0;
    }

    #teacherLoginScreen .tp-login-card-home,
    #parentLoginScreen .tp-login-card-home,
    #schoolHeadLoginScreen .tp-login-card-home,
    #loginPage .tp-login-card-home {
        width: calc(100% + 2rem);
        margin-left: -1rem;
        margin-right: -1rem;
        margin-bottom: -1.1rem;
        border-radius: 0 0 16px 16px;
    }

    #teacherLoginScreen .tp-input-wrap .form-control,
    #teacherLoginScreen .tp-login-btn,
    #parentLoginScreen .tp-input-wrap .form-control,
    #parentLoginScreen .tp-login-btn,
    #schoolHeadLoginScreen .tp-input-wrap .form-control,
    #schoolHeadLoginScreen .tp-login-btn,
    #loginPage .tp-input-wrap .form-control,
    #loginPage .tp-login-btn {
        min-height: 44px;
    }
    #teacherLoginScreen .tp-login-showcase,
    #parentLoginScreen .tp-login-showcase,
    #schoolHeadLoginScreen .tp-login-showcase,
    #loginPage .tp-login-showcase {
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }
    #teacherLoginScreen .tp-login-showcase-title,
    #parentLoginScreen .tp-login-showcase-title,
    #schoolHeadLoginScreen .tp-login-showcase-title,
    #loginPage .tp-login-showcase-title {
        font-size: 1.12rem;
    }

    #teacherLoginScreen .tp-login-school-name,
    #parentLoginScreen .tp-login-school-name,
    #schoolHeadLoginScreen .tp-login-school-name,
    #loginPage .tp-login-school-name {
        font-size: 0.95rem;
    }
}

/* Parent messages — unread row + sidebar / mobile pulse */
.tp-tch-fb-row-unread {
    box-shadow: inset 3px 0 0 0 rgba(220, 53, 69, 0.6);
    background-color: rgba(255, 243, 205, 0.3);
}

.tp-pm-table-card {
    border-radius: 14px;
    overflow: hidden;
}

.tp-pm-msg-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 700;
}

.tp-sidebar-nav-ico-wrap .tp-nav-msg-pulse,
.tp-mbb-ico-pulse .tp-nav-msg-pulse {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.45);
    animation: tpNavMsgPulse 1.85s ease-out infinite;
}

.tp-nav-msg-pulse--mbb {
    top: -6px;
    right: -8px;
}

.tp-sidebar-nav-ico-pulse:has(.tp-nav-msg-pulse:not(.d-none)) .bi-chat-square-text,
.tp-mbb-ico-pulse:has(.tp-nav-msg-pulse:not(.d-none)) .bi-chat-square-text {
    animation: tpNavMsgIconWiggle 2.5s ease-in-out infinite;
}

@keyframes tpNavMsgPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5);
    }
    70% {
        box-shadow: 0 0 0 9px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes tpNavMsgIconWiggle {
    0%,
    100% {
        transform: rotate(0deg);
    }
    15% {
        transform: rotate(-10deg);
    }
    30% {
        transform: rotate(8deg);
    }
    45% {
        transform: rotate(0deg);
    }
}

