/* =====================================================
   V.S. PUBLIC SCHOOL — TEACHER PORTAL STYLESHEET
   CSS/teacher-portal.css
===================================================== */

:root {
    --tp-primary: #10316b;
    --tp-primary-dark: #0b224a;
    --tp-primary-light: #1e429f;
    --tp-accent: #d97706;
    --tp-accent-light: #fef3c7;
    --tp-gold: #f59e0b;
    --tp-success: #10b981;
    --tp-success-light: #d1fae5;
    --tp-danger: #ef4444;
    --tp-danger-light: #fee2e2;
    --tp-bg: #f8fafc;
    --tp-surface: #ffffff;
    --tp-border: #e2e8f0;
    --tp-text-main: #1e293b;
    --tp-text-muted: #64748b;
    --tp-radius: 12px;
    --tp-shadow: 0 4px 18px rgba(16, 49, 107, 0.08);
    --tp-shadow-lg: 0 10px 30px rgba(16, 49, 107, 0.12);
}

* {
    box-sizing: border-box;
}

body.tp-body {
    background-color: var(--tp-bg);
    color: var(--tp-text-main);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─────────────────────────────────────────────────────────────
   Teacher Portal Top Navigation
───────────────────────────────────────────────────────────── */
.tp-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--tp-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tp-topbar-inner {
    max-width: 98%;
    max-width: 1760px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tp-brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.tp-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: contain;
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--tp-border);
    flex-shrink: 0;
}

.tp-brand-text h1 {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--tp-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.tp-brand-text span {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--tp-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.tp-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tp-session-badge {
    background: #eef2ff;
    color: var(--tp-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #c7d2fe;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 4px 12px 4px 6px;
    border-radius: 30px;
    border: 1px solid var(--tp-border);
}

.tp-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--tp-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    overflow: hidden;
}

.tp-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.tp-user-meta {
    line-height: 1.2;
}

.tp-user-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--tp-primary);
    display: block;
}

.tp-user-empid {
    font-size: 0.72rem;
    color: var(--tp-text-muted);
}

.tp-btn-logout {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tp-btn-logout:hover {
    background: #ef4444;
    color: #ffffff;
}

.tp-btn-site {
    background: #f8fafc;
    color: #334155;
    border: 1px solid var(--tp-border);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.tp-btn-site:hover {
    background: #e2e8f0;
}

/* ─────────────────────────────────────────────────────────────
   Main Container (Stretched Full Width)
───────────────────────────────────────────────────────────── */
.tp-main-container {
    max-width: 98%;
    max-width: 1760px;
    margin: 14px auto;
    padding: 0 12px;
    flex: 1;
    width: 100%;
}

/* ─────────────────────────────────────────────────────────────
   Login Card View
───────────────────────────────────────────────────────────── */
.tp-auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(85vh - 100px);
    padding: 20px 0;
}

.tp-login-card {
    background: #ffffff;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow-lg);
    width: 100%;
    max-width: 460px;
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
}

.tp-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--tp-primary), var(--tp-accent));
}

.tp-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.tp-login-header img {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
}

.tp-login-header h2 {
    color: var(--tp-primary);
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0 0 6px;
}

.tp-login-header p {
    color: var(--tp-text-muted);
    font-size: 0.88rem;
    margin: 0;
}

.tp-auth-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: none;
}

.tp-auth-alert.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tp-auth-alert.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tp-form-group {
    margin-bottom: 18px;
}

.tp-form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.tp-form-group label span.req {
    color: var(--tp-danger);
}

.tp-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tp-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--tp-text-main);
    transition: all 0.2s;
    font-family: inherit;
}

.tp-input:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(16, 49, 107, 0.12);
}

.tp-input-icon-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tp-text-muted);
    font-size: 1rem;
    padding: 4px;
}

.tp-btn-submit {
    width: 100%;
    background: var(--tp-primary);
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.tp-btn-submit:hover {
    background: var(--tp-primary-dark);
    box-shadow: 0 4px 12px rgba(16, 49, 107, 0.25);
}

/* ─────────────────────────────────────────────────────────────
   Dashboard Profile View (Authenticated)
───────────────────────────────────────────────────────────── */
.tp-dashboard-section {
    display: none;
}

/* Hero profile card */
.tp-hero-card {
    background: linear-gradient(135deg, var(--tp-primary) 0%, #1e429f 100%);
    color: #ffffff;
    border-radius: var(--tp-radius);
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: var(--tp-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.tp-hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.tp-hero-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--tp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid #fbbf24;
    flex-shrink: 0;
    overflow: hidden;
}

.tp-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.tp-hero-info h2 {
    margin: 0 0 6px;
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
}

.tp-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tp-badge-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.tp-badge-tag.gold {
    background: #f59e0b;
    color: #1e293b;
    font-weight: 700;
}

.tp-hero-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.tp-btn-hero {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tp-btn-hero:hover {
    background: #ffffff;
    color: var(--tp-primary);
}

/* Hamburger Menu Button (Top Left) */
.tp-hamburger-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    user-select: none;
    flex-shrink: 0;
}

.tp-hamburger-btn:hover {
    background: #ffffff;
    color: var(--tp-primary);
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.tp-hamburger-btn:active {
    transform: translateY(0);
}

.tp-hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 15px;
}

.tp-hamburger-icon span {
    display: block;
    height: 2.5px;
    width: 100%;
    background-color: currentColor;
    border-radius: 3px;
    transition: all 0.25s ease;
}

.tp-hamburger-text {
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.8px;
}

/* Slide-over Side Menu Drawer & Overlay */
.tp-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.tp-sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tp-sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 360px;
    max-width: 88vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

/* Sidebar Header */
.tp-sidebar-header {
    background: linear-gradient(135deg, var(--tp-primary) 0%, #1e429f 100%);
    color: #ffffff;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tp-sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: contain;
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.tp-sidebar-brand-text h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.tp-sidebar-brand-text p {
    margin: 2px 0 0;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.tp-sidebar-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tp-sidebar-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg);
}

/* Sidebar Profile Mini Card */
.tp-sidebar-profile-card {
    background: #f8fafc;
    border-bottom: 1px solid var(--tp-border);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.tp-sidebar-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tp-primary), #3b82f6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    border: 2px solid #fbbf24;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    overflow: hidden;
}

.tp-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.tp-sidebar-profile-info {
    overflow: hidden;
}

.tp-sidebar-profile-info h4 {
    margin: 0 0 4px;
    font-size: 0.96rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-sidebar-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tp-sidebar-id-badge {
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.tp-sidebar-role-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Sidebar Body & Nav */
.tp-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tp-sidebar-group-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0 10px 4px;
}

.tp-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-sidebar-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
}

.tp-sidebar-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    transform: translateX(3px);
}

.tp-sidebar-item.active {
    background: #eef2ff;
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.tp-sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: var(--tp-primary);
    border-radius: 0 4px 4px 0;
}

.tp-sidebar-item.gold.active {
    background: #fffbeb;
    border-color: #fde68a;
}

.tp-sidebar-item.gold.active::before {
    background: #f59e0b;
}

.tp-side-icon {
    font-size: 1.35rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.tp-sidebar-item.active .tp-side-icon {
    background: var(--tp-primary);
    color: #ffffff;
}

.tp-side-text {
    flex: 1;
    overflow: hidden;
}

.tp-side-title {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.25;
}

.tp-sidebar-item.active .tp-side-title {
    color: var(--tp-primary);
}

.tp-side-desc {
    display: block;
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-side-badge {
    background: #e2e8f0;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

.tp-side-badge.pulse {
    background: #dcfce7;
    color: #15803d;
}

.tp-side-badge.gold {
    background: #fef3c7;
    color: #92400e;
}

.tp-sidebar-item.action {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.tp-sidebar-item.action:hover {
    background: #e2e8f0;
}

.tp-sidebar-item.action.logout:hover {
    background: #fee2e2;
    border-color: #fecaca;
}

.tp-sidebar-item.action.logout:hover .tp-side-title {
    color: #dc2626;
}

/* Sidebar Footer */
.tp-sidebar-footer {
    background: #f8fafc;
    border-top: 1px solid var(--tp-border);
    padding: 14px 20px;
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tp-sidebar-session-info strong {
    color: var(--tp-primary);
}

/* Active Section Bar */
.tp-active-section-bar {
    background: #ffffff;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tp-active-section-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tp-btn-back-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #1e293b;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tp-btn-back-nav:hover {
    background: var(--tp-primary);
    color: #ffffff;
    border-color: var(--tp-primary);
    transform: translateX(-2px);
    box-shadow: 0 3px 8px rgba(16, 49, 107, 0.2);
}

.tp-btn-back-nav .tp-back-arrow {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 0.2s ease;
}

.tp-btn-back-nav:hover .tp-back-arrow {
    transform: translateX(-2px);
}

.tp-btn-open-menu-chip {
    background: linear-gradient(135deg, var(--tp-primary), #1e429f);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(16, 49, 107, 0.2);
}

.tp-btn-open-menu-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 49, 107, 0.3);
}

.tp-breadcrumb-sep {
    color: #cbd5e1;
    font-size: 1.1rem;
    font-weight: bold;
}

.tp-active-module-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-active-module-icon {
    font-size: 1.1rem;
}

.tp-active-module-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--tp-primary);
}

.tp-active-section-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-current-session-chip {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

/* Button to open menu inside hero right (responsive) */
.tp-btn-hero-menu {
    display: none;
}

@media (max-width: 900px) {
    .tp-btn-hero-menu {
        display: inline-flex;
    }
}

/* Navigation Tabs */
.tp-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--tp-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tp-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--tp-text-muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tp-tab-btn:hover {
    color: var(--tp-primary);
}

.tp-tab-btn.active {
    color: var(--tp-primary);
    font-weight: 700;
}

.tp-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tp-primary);
    border-radius: 3px 3px 0 0;
}

.tp-tab-pill {
    background: #e2e8f0;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 4px;
}

.tp-tab-btn.active .tp-tab-pill {
    background: var(--tp-primary);
    color: #ffffff;
}

.tp-tab-ct {
    color: #854d0e;
}

#tpTabBtnClassTeacher:not([style*="display: inline-flex"]) {
    display: none !important;
}

#tpClassTeacherCallout:not([style*="display: flex"]) {
    display: none !important;
}

.tp-ct-chip {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tp-ct-chip.large {
    font-size: 0.8rem;
    padding: 3px 10px;
    background: #fef3c7;
    color: #78350f;
    border-color: #fcd34d;
}

.tp-badge-tag.success {
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
}

/* Tab Panels */
.tp-tab-pane {
    display: none;
}

.tp-tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modern Card */
.tp-card {
    background: #ffffff;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.tp-card-header {
    padding: 18px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--tp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tp-card-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tp-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-card-header-sub {
    font-size: 0.8rem;
    color: var(--tp-text-muted);
}

.tp-card-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* Edit Mode Toggle Button */
.tp-btn-edit-mode {
    background: #10316b;
    color: #ffffff;
    border: 1px solid #0d2757;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(16, 49, 107, 0.2);
}

.tp-btn-edit-mode:hover {
    background: #0d2757;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 49, 107, 0.3);
}

.tp-btn-edit-mode.active-edit {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
    box-shadow: none;
}

.tp-btn-edit-mode.active-edit:hover {
    background: #ef4444;
    color: #ffffff;
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────
   View Mode & Edit Mode Styling
───────────────────────────────────────────────────────────── */
.tp-card.tp-view-mode .tp-input,
.tp-card.tp-view-mode .tp-select {
    background-color: #f8fafc;
    color: #1e293b;
    border-color: #e2e8f0;
    cursor: default;
    font-weight: 500;
    user-select: text;
    pointer-events: none;
}

.tp-card.tp-view-mode .tp-input:focus,
.tp-card.tp-view-mode .tp-select:focus {
    outline: none;
    box-shadow: none;
    border-color: #e2e8f0;
}

.tp-card.tp-edit-mode {
    border-color: #93c5fd;
    box-shadow: 0 4px 20px rgba(16, 49, 107, 0.08);
}

.tp-card.tp-edit-mode .tp-card-header {
    background: #f8fafc;
}

.tp-card.tp-edit-mode .tp-input:not(.locked),
.tp-card.tp-edit-mode .tp-select:not(.locked) {
    background-color: #ffffff;
    border-color: #cbd5e1;
    cursor: text;
    pointer-events: auto;
}

.tp-card.tp-edit-mode .tp-input:not(.locked):focus,
.tp-card.tp-edit-mode .tp-select:not(.locked):focus {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(16, 49, 107, 0.12);
}

.tp-card-body {
    padding: 24px;
}

/* Form Grids */
.tp-grid-1 { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
.tp-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.tp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }

.tp-section-subtitle {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--tp-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-section-subtitle:first-of-type {
    margin-top: 0;
}

/* Locked / Read-Only Fields */
.tp-input.locked {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    font-weight: 600 !important;
    pointer-events: none !important;
}

.tp-locked-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Form Actions Row */
.tp-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--tp-border);
    margin-top: 24px;
}

.tp-btn-primary {
    background: var(--tp-primary);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tp-btn-primary:hover {
    background: var(--tp-primary-dark);
    box-shadow: 0 4px 12px rgba(16, 49, 107, 0.2);
}

.tp-btn-secondary {
    background: #ffffff;
    color: #475569;
    border: 1px solid var(--tp-border);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tp-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Allotments Table */
.tp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--tp-border);
    border-radius: 8px;
}

.tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.tp-table th {
    background: #f8fafc;
    color: var(--tp-primary);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 2px solid var(--tp-border);
    white-space: nowrap;
}

.tp-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--tp-border);
    color: #334155;
}

.tp-table tbody tr:hover {
    background: #f8fafc;
}

.tp-badge-role {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.tp-badge-role.class-teacher {
    background: #d1fae5;
    color: #065f46;
}

.tp-badge-role.assistant-teacher {
    background: #fef3c7;
    color: #92400e;
}

/* ─────────────────────────────────────────────────────────────
   Class Teacher Callout Banner
───────────────────────────────────────────────────────────── */
.tp-ct-callout {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: var(--tp-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.tp-ct-callout-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.tp-ct-callout-content {
    flex: 1;
}

.tp-ct-callout-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 3px;
}

.tp-ct-callout-desc {
    font-size: 0.83rem;
    color: #78350f;
    line-height: 1.4;
}

.tp-btn-ct-action {
    background: #92400e;
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tp-btn-ct-action:hover {
    background: #78350f;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(146, 64, 14, 0.25);
}

/* ─────────────────────────────────────────────────────────────
   Summary Stats Row
───────────────────────────────────────────────────────────── */
.tp-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.tp-stat-box {
    background: #ffffff;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--tp-shadow);
    transition: transform 0.2s;
}

.tp-stat-box:hover {
    transform: translateY(-2px);
}

.tp-stat-num {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--tp-primary);
}

.tp-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ─────────────────────────────────────────────────────────────
   Class Teacher Overview Banner
───────────────────────────────────────────────────────────── */
.tp-ct-overview-banner {
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tp-ct-banner-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tp-ct-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-ct-value {
    font-size: 0.96rem;
    font-weight: 700;
    color: #1e293b;
}

.tp-ct-value.highlight {
    color: var(--tp-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

/* Faculty Cell in Table */
.tp-faculty-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-faculty-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--tp-primary);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tp-faculty-avatar.unassigned {
    background: #94a3b8;
}

.tp-faculty-info {
    display: flex;
    flex-direction: column;
}

.tp-faculty-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.88rem;
}

.tp-faculty-id {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.tp-status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tp-status-pill.active {
    background: #dcfce7;
    color: #15803d;
}

.tp-status-pill.pending {
    background: #fee2e2;
    color: #b91c1c;
}

/* Toast Notifications */
.tp-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-toast {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.3s ease-out;
}

.tp-toast.success {
    background: #065f46;
    border-left: 4px solid #10b981;
}

.tp-toast.error {
    background: #991b1b;
    border-left: 4px solid #ef4444;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer in Teacher Portal */
.tp-footer {
    background: #ffffff;
    border-top: 1px solid var(--tp-border);
    padding: 16px 20px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--tp-text-muted);
    margin-top: auto;
}

/* ─────────────────────────────────────────────────────────────
   Responsive Design
───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .tp-grid-3 { grid-template-columns: 1fr; }
    .tp-grid-2 { grid-template-columns: 1fr; }
    .tp-stats-row { grid-template-columns: repeat(2, 1fr); }
    .tp-ct-overview-banner { grid-template-columns: repeat(2, 1fr); }
    .tp-hero-card { flex-direction: column; align-items: flex-start; }
    .tp-hero-right { width: 100%; justify-content: flex-start; }
    .tp-ct-callout { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
    .tp-topbar-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .tp-topbar-right { width: 100%; justify-content: space-between; }
    .tp-card-body { padding: 16px; }
    .tp-hero-card { padding: 20px 16px; }
    .tp-hero-left { flex-direction: column; align-items: flex-start; gap: 12px; }
    .tp-login-card { padding: 24px 18px; }
    .tp-stats-row { grid-template-columns: 1fr; }
    .tp-ct-overview-banner { grid-template-columns: 1fr; }
    .tp-marks-filter-grid { grid-template-columns: 1fr !important; }
    .tp-roster-stats-strip { grid-template-columns: 1fr 1fr !important; }
}

/* ─────────────────────────────────────────────────────────────
   Marks Entry System Styles
───────────────────────────────────────────────────────────── */
.tp-tab-pill.success {
    background: #10b981;
    color: #ffffff;
}

.tp-tab-btn.tp-tab-ct.gold {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.12));
    border-color: rgba(245, 158, 11, 0.35);
}
.tp-tab-btn.tp-tab-ct.gold:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.22));
}

.tp-ct-chip.gold {
    background: #f59e0b;
    color: #ffffff;
}

.tp-marks-filter-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.tp-marks-filter-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tp-primary);
    margin-bottom: 14px;
}

.tp-marks-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: flex-start;
}

.tp-filter-select {
    font-weight: 600;
}

.tp-max-marks-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-max-presets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tp-preset-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
}
.tp-preset-btn:hover {
    background: var(--tp-primary);
    color: #ffffff;
    border-color: var(--tp-primary);
}
.tp-preset-btn.active {
    background: var(--tp-primary) !important;
    color: #ffffff !important;
    border-color: var(--tp-primary) !important;
    box-shadow: 0 2px 5px rgba(16, 49, 107, 0.3) !important;
    font-weight: 700 !important;
}

.tp-btn-load-roster {
    width: 100%;
    margin-top: 2px;
    font-weight: 700;
}

/* Roster Header & Stats Bar */
.tp-roster-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.tp-roster-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.tp-roster-title-wrap h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--tp-primary);
}

.tp-roster-meta {
    font-size: 0.82rem;
    color: var(--tp-text-muted);
}

.tp-roster-actions {
    display: flex;
    gap: 8px;
}

.tp-btn-tool {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tp-btn-tool:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Live Stats Strip */
.tp-roster-stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.tp-stat-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tp-chip-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}
.tp-stat-chip strong {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--tp-primary);
}
.tp-stat-chip strong.text-success { color: #10b981; }
.tp-stat-chip strong.text-gold { color: #d97706; }

/* Marks Table Inputs */
.tp-marks-table th {
    background: #f1f5f9;
    color: #1e293b;
    font-size: 0.8rem;
    padding: 10px 8px;
    vertical-align: middle;
}

.tp-marks-table td {
    padding: 8px 6px;
    vertical-align: middle;
}

.tp-mark-input {
    width: 100%;
    padding: 8px 6px;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.15s;
    background: #ffffff;
}
.tp-mark-input:focus {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(16, 49, 107, 0.15);
    outline: none;
}
.tp-mark-input.input-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

.tp-att-select {
    padding: 6px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}
.tp-att-select.att-absent {
    background: #fee2e2;
    color: #dc2626;
    border-color: #f87171;
}
.tp-att-select.att-medical {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}

.tp-total-display {
    font-size: 1rem;
    font-weight: 800;
    color: var(--tp-primary);
    text-align: center;
}

.tp-grade-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.82rem;
    text-align: center;
}
.grade-a1 { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.grade-a2 { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.grade-b1, .grade-b2 { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.grade-c1, .grade-c2 { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.grade-d { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
.grade-e, .grade-f { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.tp-rem-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.82rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

/* Save Bar */
.tp-marks-save-bar {
    background: #ffffff;
    border: 2px solid var(--tp-primary);
    padding: 14px 20px;
    border-radius: 12px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--tp-shadow);
    flex-wrap: wrap;
    gap: 12px;
}
.tp-save-bar-info {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}
.tp-save-bar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ─────────────────────────────────────────────────────────────
   Class Teacher Console — Master Marksheet & Report Cards
───────────────────────────────────────────────────────────── */
.tp-ct-report-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tp-ct-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.tp-ct-filter-item label {
    font-weight: 600;
    color: #475569;
}

.tp-subject-submission-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
.tp-submission-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.tp-submission-box-header h5 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--tp-primary);
}
.tp-submission-count {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--tp-accent);
}

.tp-submission-pills-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-sub-status-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}
.tp-sub-status-pill.submitted {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}
.tp-sub-status-pill.pending {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

/* Master Gradebook Table & Sticky Header */
#tpCumulTableContainer,
.tp-master-gradebook-wrap {
    min-height: 650px !important;
    max-height: 85vh !important;
    height: calc(100vh - 250px) !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.08) !important;
    position: relative !important;
    margin-bottom: 20px !important;
}

.tp-gradebook-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.tp-gradebook-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tp-gradebook-table thead tr.tp-cumul-hdr-row-1 th {
    position: sticky;
    top: 0;
    z-index: 12;
}

.tp-gradebook-table thead tr.tp-cumul-hdr-row-2 th {
    position: sticky;
    top: 38px;
    z-index: 11;
}

.tp-gradebook-table thead tr.tp-cumul-hdr-row-3 th {
    position: sticky;
    top: 72px;
    z-index: 10;
}

.tp-gradebook-table th {
    font-size: 0.8rem;
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    box-sizing: border-box;
}

.tp-gradebook-table td {
    font-size: 0.86rem;
    padding: 9px 8px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.tp-gradebook-table tbody tr:hover td {
    background-color: #f8fafc;
}

.tp-gradebook-table td.stu-name-cell {
    text-align: left;
    font-weight: 700;
    color: var(--tp-primary);
    white-space: nowrap;
}

.tp-btn-rc-generate {
    background: linear-gradient(135deg, #10316b, #1e429f);
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.tp-btn-rc-generate:hover {
    background: #0b224a;
    box-shadow: 0 2px 6px rgba(16,49,107,0.3);
}

/* ─────────────────────────────────────────────────────────────
   Report Card Modal & Preview Sheet
───────────────────────────────────────────────────────────── */
.tp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.tp-report-card-modal {
    background: #ffffff;
    width: 100%;
    max-width: 1040px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    max-height: 94vh;
}

.tp-modal-toolbar {
    background: #10316b;
    color: #ffffff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tp-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tp-toolbar-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.tp-student-switcher {
    background: #ffffff;
    color: #0f172a;
    padding: 4px 10px;
    font-size: 0.84rem;
    border-radius: 6px;
    font-weight: 600;
}

.tp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-btn-modal-action {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tp-btn-modal-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tp-btn-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: all 0.15s;
}
.tp-btn-modal-close:hover {
    color: #ef4444;
}

.tp-report-card-printable-wrap {
    padding: 24px 16px;
    overflow-y: auto !important;
    overflow-x: auto !important;
    background: #334155;
    flex: 1;
    min-height: 0;
    text-align: center;
    display: block !important;
}

/* ─────────────────────────────────────────────────────────────
   Official ICSE VSPS Report Card Sheet Layout (Sunrise Public School Luxury Theme)
───────────────────────────────────────────────────────────── */
.vsps-report-card-sheet {
    width: 200mm !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 4mm 5mm 3mm !important;
    border: 2.2px solid #c59b27 !important;
    border-radius: 8px !important;
    position: relative !important;
    background: #ffffff !important;
    box-shadow: 0 4px 25px rgba(0,0,0,0.25);
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    text-align: left !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
}
.vsps-report-card-sheet::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid #10316b;
    border-radius: 6px;
    pointer-events: none;
    z-index: 2;
}

/* Watermark Background */
.rc-watermark-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.055;
    pointer-events: none;
    width: 320px;
    text-align: center;
    z-index: 0;
}
.rc-watermark-bg img {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
}

/* Top Corner Decorative Waves */
.rc-top-swoosh-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 3;
}
.rc-swoosh-left {
    width: 110px;
    height: 8px;
    background: linear-gradient(135deg, #0f2e5a 0%, #1e40af 70%, #c59b27 100%);
    border-bottom-right-radius: 8px;
}
.rc-swoosh-right {
    width: 110px;
    height: 8px;
    background: linear-gradient(225deg, #0f2e5a 0%, #1e40af 70%, #c59b27 100%);
    border-bottom-left-radius: 8px;
}

/* Header Section */
.rc-header-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
}
.rc-logo-col {
    width: 65px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rc-logo-laurel-wrap {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1.5px solid #c59b27;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfdfc;
    box-shadow: 0 1px 4px rgba(197, 155, 39, 0.25);
}
.rc-school-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.rc-school-info-col {
    flex: 1;
    text-align: center;
    line-height: 1.15;
}
.rc-school-title {
    font-size: 1.26rem;
    font-weight: 900;
    color: #0f2e5a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'Times New Roman', serif;
    margin: 0;
    line-height: 1.1;
}
.rc-school-tagline {
    font-size: 0.62rem;
    font-weight: 600;
    font-style: italic;
    color: #475569;
    margin-top: 1px;
}
.rc-school-motto {
    font-size: 0.58rem;
    font-weight: 800;
    color: #b45309;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-top: 0.5px;
}
.rc-school-affil {
    font-size: 0.60rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1px;
}
.rc-school-addr {
    font-size: 0.56rem;
    color: #475569;
    margin-top: 0.5px;
}
.rc-school-contact {
    font-size: 0.56rem;
    color: #64748b;
    margin-top: 0.5px;
}

/* Medal Column (1st, 2nd, 3rd Rank Holders Only) */
.rc-medal-col {
    width: 110px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.rc-medal-container {
    display: flex;
    align-items: center;
    gap: 5px;
}
.rc-medal-svg-wrap {
    width: 66px;
    height: 80px;
    flex-shrink: 0;
}
.rc-medal-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}
.rc-medal-quote {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}
.rc-quote-line1 {
    font-family: 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-size: 0.60rem;
    font-weight: 700;
    color: #0f2e5a;
}
.rc-quote-line2 {
    font-family: 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-size: 0.60rem;
    font-weight: 800;
    color: #b45309;
}

/* Ribbon Banner */
.rc-ribbon-banner-wrap {
    text-align: center;
    margin: 2px 0 3px;
    position: relative;
    z-index: 1;
}
.rc-ribbon-banner {
    display: inline-block;
    background: linear-gradient(180deg, #10316b 0%, #0a2540 100%);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    padding: 2px 18px;
    border-radius: 4px;
    box-shadow: 0 1.5px 4px rgba(16, 49, 107, 0.35);
    border: 1px solid #eab308;
    text-transform: uppercase;
    line-height: 1.2;
}
.rc-star-icon {
    color: #f59e0b;
    margin: 0 4px;
    font-size: 0.70rem;
}
.rc-ribbon-subtag {
    display: inline-block;
    background: #fef08a;
    border: 1px solid #eab308;
    color: #78350f;
    font-size: 0.61rem;
    font-weight: 800;
    padding: 1.5px 12px;
    border-radius: 9999px;
    margin-top: 2.5px;
    letter-spacing: 0.04em;
    box-shadow: 0 1px 3px rgba(234, 179, 8, 0.25);
}

/* Student Particulars Card (Sunrise Theme) */
.rc-student-particulars-card {
    background: #fffdf9;
    border: 1.2px solid #e6c875;
    border-radius: 5px;
    padding: 3px 8px;
    margin-bottom: 3px;
    display: flex;
    gap: 14px;
    position: relative;
    z-index: 1;
}
.rc-part-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.rc-part-row {
    display: flex;
    align-items: baseline;
    font-size: 0.66rem;
    line-height: 1.25;
}
.rc-part-label {
    width: 90px;
    color: #475569;
    font-weight: 700;
    flex-shrink: 0;
}
.rc-part-colon {
    width: 10px;
    color: #64748b;
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
}
.rc-part-val {
    flex: 1;
    color: #0f172a;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rc-name-highlight {
    color: #10316b;
    font-weight: 800;
    font-size: 0.72rem;
}

/* Section Ribbon */
.rc-section-ribbon {
    background: linear-gradient(90deg, #0e3a6c 0%, #174e8c 100%);
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
    position: relative;
    z-index: 1;
}
.rc-sec-icon {
    font-size: 0.70rem;
}

/* Common Table Styling */
.rc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 3px;
    font-size: 0.65rem;
    background: #ffffff;
    position: relative;
    z-index: 1;
}
.rc-table th {
    background: #0e3a6c !important;
    color: #ffffff !important;
    padding: 2px 2.5px;
    font-weight: 700;
    border: 1px solid #10316b;
    text-align: center;
    font-size: 0.63rem;
    line-height: 1.15;
    vertical-align: middle;
}
.rc-table td {
    padding: 1.5px 2.5px;
    border: 1px solid #cbd5e1;
    text-align: center;
    vertical-align: middle;
    line-height: 1.18;
    font-size: 0.64rem;
}
.rc-td-subject {
    text-align: left !important;
    font-weight: 700;
    color: #0f172a;
    padding-left: 5px !important;
    width: 32%;
}
.rc-td-num {
    font-weight: 600;
    color: #1e293b;
}
.rc-td-grade {
    font-weight: 700;
    color: #0f172a;
}
.rc-bold-mark {
    font-weight: 800;
    color: #10316b;
}
.rc-bold-grade {
    font-weight: 800;
    color: #047857;
}
.rc-mark-ab {
    color: #ef4444;
    font-weight: 800;
}
.rc-grade-ab {
    color: #ef4444;
    font-weight: 800;
}
.rc-scholastic-table {
    table-layout: fixed !important;
    width: 100% !important;
}

.rc-tr-top-head th {
    border-bottom: none;
}
.rc-tr-sub-head th {
    border-top: none;
    background: #174e8c !important;
    font-size: 0.61rem;
}
.rc-tr-total td {
    background: #f8fafc !important;
    font-weight: 800;
    border-top: 1.5px solid #0e3a6c;
    color: #10316b;
    font-size: 0.66rem;
}
.rc-tr-rank td {
    background: #fffdf5 !important;
    font-weight: 800;
    color: #0f2e5a;
    border-top: 1px solid #cbd5e1;
    font-size: 0.65rem;
}
.rc-rank-badge-cell {
    color: #b45309 !important;
    font-weight: 900 !important;
}
.rc-pct-badge-cell {
    color: #047857 !important;
    font-weight: 900 !important;
}

/* Lower Grid (Image 3: Exact 2-Column Split for Attendance & Co-Scholastic) */
.rc-lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-bottom: 3px;
    position: relative;
    z-index: 1;
}

.rc-lower-card {
    border: 1.2px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.rc-card-ribbon {
    background: linear-gradient(90deg, #0e3a6c 0%, #174e8c 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 2.5px 7px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rc-lower-card-inner {
    padding: 3.5px 5px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.rc-att-table-v, .rc-co-table-v {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 0.62rem;
}

.rc-att-table-v th, .rc-co-table-v th {
    background: #0e3a6c !important;
    color: #ffffff !important;
    padding: 2px 3px;
    font-weight: 700;
    border: 1px solid #10316b;
    text-align: center;
    font-size: 0.60rem;
    line-height: 1.15;
}

.rc-att-table-v td, .rc-co-table-v td {
    padding: 1.5px 3px;
    border: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1.2;
}

.rc-att-month-cell, .rc-co-area-cell {
    text-align: left !important;
    font-weight: 600;
    color: #334155;
    padding-left: 5px !important;
}

.rc-co-grade-cell {
    color: #047857 !important;
    font-weight: 800;
}

.rc-att-total-row td {
    background: #f8fafc;
    border-top: 1.5px solid #0e3a6c;
    font-weight: 800;
}

/* Teacher's Remarks Nested Sub-Card (Soft Gold inside Co-Scholastic Card matching Image 3) */
.rc-remarks-subcard {
    background: #fffdf0;
    border: 1px solid #fde047;
    border-radius: 4px;
    padding: 3px 6px;
    margin-top: 3px;
}

.rc-remark-header {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.63rem;
    color: #10316b;
    font-weight: 800;
}

.rc-remark-star {
    color: #f59e0b;
    font-size: 0.68rem;
}

.rc-remark-body {
    font-size: 0.61rem;
    color: #1e293b;
    font-style: italic;
    margin-top: 1px;
    line-height: 1.22;
}

/* Grading Scales Reference (Junior Only) */
.rc-scales-row {
    display: flex;
    gap: 6px;
    margin-bottom: 3px;
    position: relative;
    z-index: 1;
}
.rc-scale-card {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
}
.rc-scale-title {
    background: #0e3a6c;
    color: #ffffff;
    font-size: 0.57rem;
    font-weight: 800;
    text-align: center;
    padding: 1.2px 3px;
    letter-spacing: 0.03em;
}
.rc-mini-scale-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.55rem;
    text-align: center;
}
.rc-mini-scale-table td {
    padding: 1px 2px;
    border: 1px solid #e2e8f0;
    line-height: 1.1;
}
.rc-scale-head {
    background: #f1f5f9;
    font-weight: 700;
    color: #334155;
}

/* Bottom Decorative Swoosh & Accents (Image 3) */
.rc-bottom-swoosh-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 3px 0 2px 0;
    position: relative;
    z-index: 1;
}

.rc-bottom-curve-left, .rc-bottom-curve-right {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d97706, transparent);
}

.rc-bottom-star {
    color: #f59e0b;
    font-size: 0.68rem;
}

/* Signatures Section with Cursive Strokes and Motivational Quote (Image 3) */
.rc-footer-signatures-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 3px;
    padding-top: 2px;
    position: relative;
    z-index: 1;
}

.rc-sig-block {
    width: 28%;
    text-align: center;
}

.rc-sig-cursive-graphic {
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.rc-sig-line {
    border-top: 1.2px solid #0f172a;
    margin-bottom: 2px;
}

.rc-sig-label {
    font-size: 0.63rem;
    font-weight: 700;
    color: #1e293b;
}

.rc-sig-quote-block {
    width: 40%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rc-sig-quote-title {
    font-family: 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-size: 0.72rem;
    font-weight: 800;
    color: #10316b;
    line-height: 1.1;
}

.rc-sig-quote-text {
    font-family: 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-size: 0.68rem;
    font-weight: 700;
    color: #10316b;
    line-height: 1.1;
}

.rc-sig-star-top, .rc-sig-star-bottom {
    color: #f59e0b;
    font-size: 0.58rem;
    line-height: 1;
    margin: 1px 0;
}

.rc-bold { font-weight: 800 !important; }
.rc-text-left { text-align: left !important; }
.rc-text-center { text-align: center !important; }
.rc-text-right { text-align: right !important; }
.rc-navy-highlight { color: #10316b !important; }

/* Edit Extras Modal Dialog */
.tp-modal-dialog {
    background: #ffffff;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--tp-shadow-lg);
}

.tp-modal-header {
    background: #10316b;
    color: #ffffff;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tp-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.tp-modal-body {
    padding: 18px 20px;
}

.tp-remarks-quick-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.tp-chip-rem {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    font-size: 0.73rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.tp-chip-rem:hover {
    background: #e2e8f0;
    color: var(--tp-primary);
}

/* (Note: Consolidated A4 print stylesheet is located at the end of this CSS file) */

/* ─────────────────────────────────────────────────────────────
   Class Teacher: Student Roster (Table & Graph View) & Controls
───────────────────────────────────────────────────────────── */
.tp-view-switcher-group {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.tp-btn-switcher {
    padding: 7px 16px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tp-btn-switcher:hover {
    color: var(--tp-primary);
    background: rgba(255, 255, 255, 0.6);
}

.tp-btn-switcher.active {
    background: #ffffff;
    color: var(--tp-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

.tp-search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.tp-search-bar .tp-input {
    padding-left: 36px;
    min-width: 220px;
    height: 38px;
    border-radius: 8px;
}

.tp-search-bar::before {
    content: "🔍";
    position: absolute;
    left: 11px;
    font-size: 0.82rem;
    opacity: 0.55;
    pointer-events: none;
}

/* Student Table Customization */
.tp-students-table td {
    vertical-align: middle;
    padding: 10px 14px;
}

.tp-student-avatar-thumb {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.tp-student-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tp-student-name-main {
    font-weight: 700;
    color: var(--tp-text);
    line-height: 1.25;
}

.tp-student-subtext {
    font-size: 0.76rem;
    color: var(--tp-text-muted);
}

.tp-roll-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 0.84rem;
}

.tp-bpl-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.tp-bpl-badge.yes {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.tp-bpl-badge.no {
    background: #f1f5f9;
    color: #64748b;
}

.tp-cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #334155;
}

/* Student Action Buttons */
.tp-student-actions-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tp-btn-action-sm {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.tp-btn-action-sm:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: var(--tp-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.tp-btn-action-sm.tp-btn-photo {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}
.tp-btn-action-sm.tp-btn-photo:hover {
    background: #dbeafe;
    border-color: #3b82f6;
}

.tp-btn-action-sm.tp-btn-edit-stud {
    border-color: #fde68a;
    color: #b45309;
    background: #fffbeb;
}
.tp-btn-action-sm.tp-btn-edit-stud:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

.tp-btn-action-sm.tp-btn-dossier {
    border-color: #c7d2fe;
    color: #4338ca;
    background: #eef2ff;
}
.tp-btn-action-sm.tp-btn-dossier:hover {
    background: #e0e7ff;
    border-color: #6366f1;
}

/* ─────────────────────────────────────────────────────────────
   Demographic Graph & Bar Meter Analytics System
───────────────────────────────────────────────────────────── */
.tp-demographics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.tp-analytics-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.tp-analytics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.tp-analytics-card-header h4 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--tp-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-stat-pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tp-stat-pill {
    flex: 1;
    min-width: 90px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: center;
}
.tp-stat-pill-num {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--tp-primary);
    line-height: 1.1;
}
.tp-stat-pill-lbl {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 4px;
}

.tp-bar-chart-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    justify-content: center;
}

.tp-bar-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tp-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.tp-bar-label {
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-bar-val {
    font-weight: 700;
    color: var(--tp-primary);
    font-family: monospace;
    font-size: 0.86rem;
}

.tp-bar-track {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.tp-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.tp-bar-fill.pink { background: linear-gradient(90deg, #ec4899, #be185d); }
.tp-bar-fill.gold { background: linear-gradient(90deg, #f59e0b, #d97706); }
.tp-bar-fill.green { background: linear-gradient(90deg, #10b981, #047857); }
.tp-bar-fill.purple { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.tp-bar-fill.teal { background: linear-gradient(90deg, #14b8a6, #0f766e); }
.tp-bar-fill.orange { background: linear-gradient(90deg, #f97316, #c2410c); }

/* ─────────────────────────────────────────────────────────────
   Marks Upload Progress Tracker Styles
───────────────────────────────────────────────────────────── */
.tp-progress-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.tp-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    gap: 16px;
}
.tp-kpi-icon {
    font-size: 2rem;
    line-height: 1;
}
.tp-kpi-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--tp-primary);
    line-height: 1.1;
}
.tp-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tp-text-muted);
}

.tp-progress-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tp-progress-badge.uploaded {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.tp-progress-badge.partial {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.tp-progress-badge.pending {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.tp-progress-bar-thin {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}
.tp-progress-bar-thin .fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
}

/* ─────────────────────────────────────────────────────────────
   Cumulative Class Report & Gradebook Analytics
───────────────────────────────────────────────────────────── */
.tp-cumul-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.tp-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.82rem;
}
.tp-rank-badge.rank-1 { background: #fef08a; color: #854d0e; border: 2px solid #eab308; }
.tp-rank-badge.rank-2 { background: #e2e8f0; color: #334155; border: 2px solid #94a3b8; }
.tp-rank-badge.rank-3 { background: #ffedd5; color: #9a3412; border: 2px solid #f97316; }
.tp-rank-badge.rank-other { background: #f1f5f9; color: #64748b; font-weight: 600; }

.tp-toppers-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    padding: 20px 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tp-topper-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: relative;
    transition: transform 0.2s ease;
}
.tp-topper-card:hover { transform: translateY(-4px); }
.tp-topper-card.rank-1 { border: 2px solid #f59e0b; background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%); order: 2; transform: scale(1.06); }
.tp-topper-card.rank-2 { border: 2px solid #94a3b8; order: 1; }
.tp-topper-card.rank-3 { border: 2px solid #f97316; order: 3; }

.tp-topper-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Photo Upload Modal Dropzone */
.tp-photo-dropzone {
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}
.tp-photo-dropzone:hover, .tp-photo-dropzone.dragover {
    border-color: var(--tp-primary);
    background: #eff6ff;
}

.tp-photo-preview-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    border: 3px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: block;
}

/* Dossier Card Sheet */
.tp-dossier-card {
    background: #ffffff;
    border: 2px solid var(--tp-primary);
    border-radius: 10px;
    padding: 24px;
    font-family: inherit;
}

/* ─────────────────────────────────────────────────────────────
   Full Width & Compact Table Rules (No Horizontal Scrolling)
───────────────────────────────────────────────────────────── */
.mgr-detail-table-wrap,
.tp-marks-table-wrap,
.tp-table-wrap {
    width: 100% !important;
    overflow-x: auto;
}

.stu-class-detail-table {
    width: 100% !important;
    min-width: 100% !important;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: #ffffff;
}

.stu-class-detail-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    font-size: 0.81rem;
    padding: 8px 6px !important;
    border: 1px solid #cbd5e1;
    text-align: left;
    white-space: nowrap;
}

.stu-class-detail-table td {
    padding: 6px 6px !important;
    border: 1px solid #cbd5e1;
    vertical-align: middle;
    color: #334155;
    font-size: 0.84rem;
}

.stu-inline-roll {
    width: 52px !important;
    padding: 2px 4px !important;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    font-size: 0.82rem;
    background: #ffffff;
    font-weight: 600;
    height: 27px !important;
}

.stu-inline-house {
    width: 102px !important;
    padding: 2px 4px !important;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    font-size: 0.77rem;
    background: #ffffff;
    margin-top: 2px !important;
    display: block;
    height: 27px !important;
}

.stu-detail-actions {
    display: grid !important;
    grid-template-columns: 26px 26px !important;
    gap: 3px !important;
    justify-content: center;
    align-items: center;
}

.stu-icon-btn {
    width: 26px !important;
    height: 26px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.82rem !important;
    font-weight: 700;
    transition: all 0.12s ease;
    text-decoration: none;
    line-height: 1;
}

/* ─────────────────────────────────────────────────────────────
   Tab 8: Add Comments & Student Evaluation Table Styles
───────────────────────────────────────────────────────────── */
.tp-row-failed {
    background-color: #fef2f2 !important;
}

.tp-row-failed td {
    color: #dc2626 !important;
}

.tp-row-failed .tp-stu-name {
    color: #b91c1c !important;
    font-weight: 700 !important;
}

.tp-rank-badge-gold {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1.5px solid #f59e0b;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
}

.tp-rank-badge-silver {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #334155;
    border: 1.5px solid #94a3b8;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(148, 163, 184, 0.2);
}

.tp-rank-badge-bronze {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #9a3412;
    border: 1.5px solid #f97316;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(249, 115, 22, 0.2);
}

.tp-rank-badge-std {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 3px 9px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-block;
}

.tp-rank-badge-fail {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 3px 9px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.76rem;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tp-comment-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 280px;
}

.tp-comment-select {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tp-comment-select:focus {
    border-color: var(--tp-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 49, 107, 0.15);
}

.tp-comment-textarea {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.82rem;
    line-height: 1.35;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    resize: vertical;
    min-height: 48px;
    transition: all 0.15s ease;
}

.tp-comment-textarea:focus {
    border-color: var(--tp-primary);
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(16, 49, 107, 0.15);
}

.tp-sub-marks-cell {
    text-align: center;
    white-space: nowrap;
}

.tp-sub-marks-val {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
}

.tp-sub-marks-max {
    font-size: 0.74rem;
    color: #64748b;
}

.tp-sub-marks-fail {
    color: #dc2626 !important;
    font-weight: 800 !important;
}

/* ─────────────────────────────────────────────────────────────
   Teacher Subject Uploads Progress Bar & Freeze State Styles
───────────────────────────────────────────────────────────── */
.tp-teacher-progress-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(16, 49, 107, 0.04);
}

.tp-progress-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.tp-progress-bar-wrap {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981, #059669);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.tp-progress-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.tp-pstat-item {
    font-size: 0.82rem;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tp-pstat-label {
    color: #64748b;
    font-weight: 500;
}

.tp-breakup-status-chip {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.tp-breakup-status-chip.completed {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.tp-breakup-status-chip.pending {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.tp-breakup-status-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tp-marks-frozen-banner {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1.5px solid #f87171;
    border-radius: 10px;
    padding: 12px 18px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
    animation: fadeInFreeze 0.3s ease;
}

@keyframes fadeInFreeze {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.tp-marks-row.frozen input,
.tp-marks-row.frozen select {
    background: #f1f5f9 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    border-color: #e2e8f0 !important;
}

.tp-mark-input.input-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.tp-att-select.att-ab {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    font-weight: 800 !important;
}

.tp-att-select.att-na {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    font-weight: 700 !important;
}

.tp-grade-badge.grade-ab {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #f87171 !important;
    font-weight: 800 !important;
}

.tp-grade-badge.grade-na {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

/* ─────────────────────────────────────────────────────────────
   My Class Students Table Customizations
───────────────────────────────────────────────────────────── */
.stu-class-detail-table tbody tr {
    background-color: #ffffff !important;
    transition: background-color 0.15s ease;
}

.stu-class-detail-table tbody tr:hover {
    background-color: #f8fafc !important;
}

.stu-new-badge {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 1px 4px rgba(244, 63, 94, 0.35);
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.stu-icon-btn.stu-icon-view {
    background-color: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.stu-icon-btn.stu-icon-view:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.stu-icon-btn.stu-icon-photo {
    background-color: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.stu-icon-btn.stu-icon-photo:hover {
    background-color: #0369a1;
    transform: translateY(-1px);
}

.stu-concession-badge {
    background: #f59e0b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────
   Rank Color Distinguishers: Rank 1 (Gold), Rank 2 (Silver), Rank 3 (Bronze), No Rank (Red)
───────────────────────────────────────────────────────────── */
#tpCumulMasterTable tbody tr.row-rank-1,
#tpCumulMasterTable tbody tr.row-rank-1 td,
tr.row-rank-1,
tr.row-rank-1 td {
    background-color: #fef9c3 !important;
    color: #1e293b;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#tpCumulMasterTable tbody tr.row-rank-1 td.admin-col-sticky-1,
#tpCumulMasterTable tbody tr.row-rank-1 td.admin-col-sticky-2,
#tpCumulMasterTable tbody tr.row-rank-1 td.admin-col-sticky-3,
#tpCommentsTable tbody tr.row-rank-1 td.admin-col-sticky-1,
#tpCommentsTable tbody tr.row-rank-1 td.admin-col-sticky-2,
#tpCommentsTable tbody tr.row-rank-1 td.admin-col-sticky-3 {
    background-color: #fef9c3 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#tpCumulMasterTable tbody tr.row-rank-1:hover td,
#tpCumulMasterTable tbody tr.row-rank-1:hover td.admin-col-sticky-1,
#tpCumulMasterTable tbody tr.row-rank-1:hover td.admin-col-sticky-2,
#tpCumulMasterTable tbody tr.row-rank-1:hover td.admin-col-sticky-3,
#tpCommentsTable tbody tr.row-rank-1:hover td,
#tpCommentsTable tbody tr.row-rank-1:hover td.admin-col-sticky-1,
#tpCommentsTable tbody tr.row-rank-1:hover td.admin-col-sticky-2,
#tpCommentsTable tbody tr.row-rank-1:hover td.admin-col-sticky-3 {
    background-color: #fef08a !important;
}

#tpCumulMasterTable tbody tr.row-rank-2,
#tpCumulMasterTable tbody tr.row-rank-2 td,
#tpCommentsTable tbody tr.row-rank-2,
#tpCommentsTable tbody tr.row-rank-2 td,
tr.row-rank-2,
tr.row-rank-2 td {
    background-color: #e2e8f0 !important;
    color: #1e293b;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#tpCumulMasterTable tbody tr.row-rank-2 td.admin-col-sticky-1,
#tpCumulMasterTable tbody tr.row-rank-2 td.admin-col-sticky-2,
#tpCumulMasterTable tbody tr.row-rank-2 td.admin-col-sticky-3,
#tpCommentsTable tbody tr.row-rank-2 td.admin-col-sticky-1,
#tpCommentsTable tbody tr.row-rank-2 td.admin-col-sticky-2,
#tpCommentsTable tbody tr.row-rank-2 td.admin-col-sticky-3 {
    background-color: #e2e8f0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#tpCumulMasterTable tbody tr.row-rank-2:hover td,
#tpCumulMasterTable tbody tr.row-rank-2:hover td.admin-col-sticky-1,
#tpCumulMasterTable tbody tr.row-rank-2:hover td.admin-col-sticky-2,
#tpCumulMasterTable tbody tr.row-rank-2:hover td.admin-col-sticky-3,
#tpCommentsTable tbody tr.row-rank-2:hover td,
#tpCommentsTable tbody tr.row-rank-2:hover td.admin-col-sticky-1,
#tpCommentsTable tbody tr.row-rank-2:hover td.admin-col-sticky-2,
#tpCommentsTable tbody tr.row-rank-2:hover td.admin-col-sticky-3 {
    background-color: #cbd5e1 !important;
}

#tpCumulMasterTable tbody tr.row-rank-3,
#tpCumulMasterTable tbody tr.row-rank-3 td,
#tpCommentsTable tbody tr.row-rank-3,
#tpCommentsTable tbody tr.row-rank-3 td,
tr.row-rank-3,
tr.row-rank-3 td {
    background-color: #ffedd5 !important;
    color: #1e293b;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#tpCumulMasterTable tbody tr.row-rank-3 td.admin-col-sticky-1,
#tpCumulMasterTable tbody tr.row-rank-3 td.admin-col-sticky-2,
#tpCumulMasterTable tbody tr.row-rank-3 td.admin-col-sticky-3,
#tpCommentsTable tbody tr.row-rank-3 td.admin-col-sticky-1,
#tpCommentsTable tbody tr.row-rank-3 td.admin-col-sticky-2,
#tpCommentsTable tbody tr.row-rank-3 td.admin-col-sticky-3 {
    background-color: #ffedd5 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#tpCumulMasterTable tbody tr.row-rank-3:hover td,
#tpCumulMasterTable tbody tr.row-rank-3:hover td.admin-col-sticky-1,
#tpCumulMasterTable tbody tr.row-rank-3:hover td.admin-col-sticky-2,
#tpCumulMasterTable tbody tr.row-rank-3:hover td.admin-col-sticky-3,
#tpCommentsTable tbody tr.row-rank-3:hover td,
#tpCommentsTable tbody tr.row-rank-3:hover td.admin-col-sticky-1,
#tpCommentsTable tbody tr.row-rank-3:hover td.admin-col-sticky-2,
#tpCommentsTable tbody tr.row-rank-3:hover td.admin-col-sticky-3 {
    background-color: #fed7aa !important;
}

#tpCumulMasterTable tbody tr.row-no-rank,
#tpCumulMasterTable tbody tr.row-no-rank td,
#tpCommentsTable tbody tr.row-no-rank,
#tpCommentsTable tbody tr.row-no-rank td,
tr.row-no-rank,
tr.row-no-rank td {
    background-color: #fee2e2 !important;
    color: #1e293b;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#tpCumulMasterTable tbody tr.row-no-rank td.admin-col-sticky-1,
#tpCumulMasterTable tbody tr.row-no-rank td.admin-col-sticky-2,
#tpCumulMasterTable tbody tr.row-no-rank td.admin-col-sticky-3,
#tpCommentsTable tbody tr.row-no-rank td.admin-col-sticky-1,
#tpCommentsTable tbody tr.row-no-rank td.admin-col-sticky-2,
#tpCommentsTable tbody tr.row-no-rank td.admin-col-sticky-3 {
    background-color: #fee2e2 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

/* Color Scale & Performance Indicators Bar */
.marks-color-scale-bar,
.tp-cumul-scale-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.8rem;
}

.marks-color-scale-title {
    font-weight: 800;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    margin-right: 4px;
}

.marks-scale-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.marks-scale-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.marks-scale-topper {
    background: #fef08a;
    color: #854d0e;
    border-color: #eab308;
}

.marks-scale-rank1 {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde047;
}

.marks-scale-rank2 {
    background: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

.marks-scale-rank3 {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fdba74;
}

.marks-scale-passed {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bfdbfe;
}

.marks-scale-gt {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.marks-scale-pct {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.marks-scale-failed {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.marks-scale-absent {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.marks-scale-na {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

/* ─────────────────────────────────────────────────────────────
   A4 Portrait Print & PDF Export Styling for Report Cards
───────────────────────────────────────────────────────────── */
@page {
    size: A4 portrait;
    margin: 4mm 6mm;
}

@media print {
    /* 1. Global Reset - Strict zero padding/margin on root */
    html, body, body.tp-body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        display: block !important;
        overflow: visible !important;
        position: static !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 2. COMPLETELY HIDE all outer portal chrome and modals from layout flow */
    body > *:not(#tpReportCardModalBackdrop) {
        display: none !important;
    }

    /* 3. Flush Report Card Modal at coordinate (0, 0) with zero displacement */
    #tpReportCardModalBackdrop {
        display: block !important;
        position: static !important;
        top: 0 !important;
        left: 0 !important;
        inset: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        z-index: auto !important;
    }

    .tp-report-card-modal {
        display: block !important;
        position: static !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .tp-modal-toolbar,
    .tp-btn-modal-close,
    #tpBtnCloseReportCardModal,
    #tpBtnModalPrintReportCard,
    #tpBtnModalDownloadPdf,
    #tpBtnModalEditExtras,
    #tpModalStudentSwitcher {
        display: none !important;
    }

    .tp-report-card-printable-wrap {
        display: block !important;
        position: static !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        overflow: visible !important;
        width: 100% !important;
        height: auto !important;
    }

    .vsps-report-card-sheet {
        border: 2px solid #10316b !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 4mm 5mm !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: auto;
        break-after: auto;
    }

    .vsps-bulk-report-card-item {
        page-break-after: always !important;
        break-after: page !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Print color adjustments */
    .rc-marks-table th,
    .rc-monthly-att-table th,
    .rc-card-title-banner,
    .rc-marks-table tr.total-row td,
    .rc-student-photo-box,
    .rc-topper-qr-box,
    .tp-grade-badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}








