/* Teacher Portal — EduDash */
:root {
    --tp-sidebar: 260px;
    --tp-header-height: 72px;
    --tp-blue: #2563eb;
    --tp-blue-dark: #1d4ed8;
    --tp-green-active: #059669;
    --tp-bg: #f1f5f9;
    --tp-card: #ffffff;
    --tp-text: #1e293b;
    --tp-muted: #64748b;
    --tp-border: #e2e8f0;
    --tp-shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
}

* { box-sizing: border-box; }

body.tp-body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--tp-bg);
    color: var(--tp-text);
    min-height: 100vh;
}

/* Custom scrollbar (global) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: #d3dcec;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}
:hover::-webkit-scrollbar-thumb {
    background-color: #b2bfd6;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #2563eb;
    border-width: 1px;
}
::-webkit-scrollbar-thumb:active {
    background-color: #1e40af;
    border-width: 1px;
}
::-webkit-scrollbar-button {
    display: none;
}
@supports (-moz-appearance: none) {
    * {
        scrollbar-width: thin;
        scrollbar-color: #bfcbe0 transparent;
    }
    .tp-sidebar {
        scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    }
}

a { text-decoration: none; color: inherit; }

/* Login */
.tp-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: #0f172a;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.tp-login-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%);
    z-index: 0;
}

.tp-login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    pointer-events: none;
}

.tp-login-orb-1 {
    width: 420px;
    height: 420px;
    background: #60a5fa;
    top: -120px;
    right: -80px;
}

.tp-login-orb-2 {
    width: 320px;
    height: 320px;
    background: #818cf8;
    bottom: -80px;
    left: -60px;
}

.tp-login-orb-3 {
    width: 200px;
    height: 200px;
    background: #38bdf8;
    top: 40%;
    left: 35%;
    opacity: 0.25;
}

.tp-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
}

.tp-login-wrap {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--tp-card);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tp-login-brand {
    background: linear-gradient(160deg, #1d4ed8 0%, #1e40af 50%, #172554 100%);
    color: #fff;
    padding: 40px 36px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.tp-login-brand::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.tp-login-brand-inner {
    position: relative;
    z-index: 1;
}

.tp-login-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.tp-login-logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.tp-login-logo-icon.has-logo {
    background: rgba(255, 255, 255, 0.92);
}

.tp-login-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.tp-login-logo-tag {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.75;
    font-weight: 600;
}

.tp-login-logo h1 {
    margin: 2px 0 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.tp-login-tagline {
    margin: 0 0 28px;
    opacity: 0.88;
    line-height: 1.65;
    font-size: 0.95rem;
    max-width: 340px;
}

.tp-login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tp-login-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.tp-login-feature:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tp-login-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tp-login-feature strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.tp-login-feature span {
    font-size: 0.72rem;
    opacity: 0.75;
    line-height: 1.35;
}

.tp-login-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    opacity: 0.7;
}

.tp-login-brand-footer i {
    margin-right: 6px;
}

.tp-login-form-panel {
    padding: 48px 44px;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.tp-login-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.tp-login-form-head {
    margin-bottom: 28px;
}

.tp-login-form-badge {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
    border: 1px solid #bfdbfe;
}

.tp-login-form h2 {
    margin: 0 0 6px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.tp-login-form-head > p {
    margin: 0;
    color: var(--tp-muted);
    font-size: 0.92rem;
}

.tp-login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.tp-login-alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

.tp-login-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tp-login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.tp-login-input {
    display: flex;
    align-items: stretch;
    min-height: 52px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.tp-login-input:focus-within {
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.tp-login-input-icon {
    width: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    font-size: 1rem;
    border-right: 1px solid #e2e8f0;
}

.tp-login-input input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.4;
}

.tp-login-input input:focus {
    outline: none;
}

.tp-login-input input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.tp-login-input-password input {
    padding-right: 8px;
}

.tp-login-eye {
    flex-shrink: 0;
    width: 48px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: color 0.2s, background 0.2s;
}

.tp-login-eye:hover {
    color: #2563eb;
    background: #f8fafc;
}

.tp-login-submit {
    width: 100%;
    justify-content: center;
    padding: 15px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 6px;
    border-radius: 14px;
    letter-spacing: 0.02em;
}

.tp-login-submit span {
    flex: 1;
    text-align: center;
}

.tp-login-help {
    display: flex;
    gap: 14px;
    margin-top: 28px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
}

.tp-login-help-icon {
    width: 36px;
    height: 36px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tp-login-help strong {
    display: block;
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 4px;
}

.tp-login-help p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--tp-muted);
    line-height: 1.55;
}

.tp-login-help em {
    font-style: normal;
    color: #2563eb;
    font-weight: 500;
}

.tp-login-copyright {
    text-align: center;
    margin: 20px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

.tp-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.88rem;
}

.tp-alert-success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #059669;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Layout */
.tp-wrapper {
    display: flex;
    min-height: 100vh;
}

.tp-sidebar {
    width: var(--tp-sidebar);
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.tp-sidebar::-webkit-scrollbar {
    width: 6px;
}
.tp-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.22);
}
.tp-sidebar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.34);
}
.tp-sidebar::-webkit-scrollbar-thumb:hover,
.tp-sidebar::-webkit-scrollbar-thumb:active {
    background-color: rgba(255, 255, 255, 0.6);
}

.tp-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.tp-brand-text {
    flex: 1;
    min-width: 0;
}

.tp-brand-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.tp-brand-icon.has-logo {
    background: rgba(255, 255, 255, 0.92);
}

.tp-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.tp-brand h2 {
    margin: 0;
    font-size: 1.15rem;
    word-break: break-word;
}

.tp-brand span {
    font-size: 0.75rem;
    opacity: 0.75;
}

.tp-brand.is-logo {
    padding: 14px 16px;
}

.tp-brand-logo-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
}

.tp-brand-logo {
    display: block;
    width: 100%;
    max-height: 52px;
    object-fit: contain;
}

.tp-sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.15s, border-color 0.15s;
}

.tp-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
}

.tp-user-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tp-user-card img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tp-user-card strong {
    display: block;
    font-size: 0.92rem;
}

.tp-user-card small {
    opacity: 0.75;
    font-size: 0.78rem;
}

.tp-nav {
    flex: 1;
    padding: 16px 12px;
}

.tp-nav-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.5;
    padding: 8px 12px;
    margin: 0;
}

.tp-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
    transition: all 0.2s;
}

.tp-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tp-nav a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
}

.tp-nav a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.tp-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tp-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #fca5a5;
    font-weight: 500;
    font-size: 0.9rem;
}

.tp-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

.tp-main {
    flex: 1;
    margin-left: var(--tp-sidebar);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar — matches admin-header */
.tp-topbar {
    height: var(--tp-header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tp-border);
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 1px 8px rgba(43, 54, 116, 0.04);
}

.tp-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.tp-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
}

.tp-breadcrumb-root {
    color: var(--tp-muted);
    font-weight: 500;
}

.tp-header-breadcrumb > i {
    font-size: 0.55rem;
    color: #cbd5e1;
}

.tp-breadcrumb-current {
    color: var(--tp-text);
    font-weight: 600;
}

.tp-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 560px;
}

.tp-search-bar {
    display: flex;
    align-items: center;
    background: var(--tp-card);
    border-radius: 14px;
    border: 1.5px solid var(--tp-border);
    padding: 0 18px;
    width: 100%;
    height: 48px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(43, 54, 116, 0.07);
    position: relative;
}

.tp-search-bar:focus-within {
    border-color: var(--tp-green-active);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12), 0 4px 16px rgba(43, 54, 116, 0.1);
}

.tp-search-bar > i {
    color: #94a3b8;
    margin-right: 12px;
    font-size: 1rem;
    flex-shrink: 0;
}

.tp-search-bar:focus-within > i {
    color: var(--tp-green-active);
}

.tp-search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    color: var(--tp-text);
    font-size: 0.95rem;
    font-weight: 500;
}

.tp-search-bar input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.tp-search-shortcut {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: 0.72rem;
    font-family: inherit;
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 8px;
}

.tp-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
}

.tp-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
}

.tp-search-item:hover {
    background: #f0fdf4;
}

.tp-search-item i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ecfdf5;
    color: var(--tp-green-active);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-search-item strong {
    display: block;
    font-size: 0.9rem;
}

.tp-search-item span {
    font-size: 0.78rem;
    color: var(--tp-muted);
}

.tp-search-empty {
    padding: 16px;
    text-align: center;
    color: var(--tp-muted);
    font-size: 0.88rem;
}

.tp-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tp-header-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background-color: #f8fafc;
    border: 1px solid var(--tp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tp-text);
    font-size: 1.05rem;
    transition: all 0.2s ease;
    position: relative;
}

.tp-header-icon-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--tp-green-active);
}

.tp-header-user {
    position: relative;
    margin-left: 6px;
    z-index: 200;
}

.tp-header-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    background: var(--tp-card);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tp-header-user-trigger:hover,
.tp-header-user.open .tp-header-user-trigger {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(43, 54, 116, 0.06);
}

.tp-header-user-trigger img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}

.tp-header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.tp-header-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tp-text);
    line-height: 1.2;
}

.tp-header-user-role {
    font-size: 0.72rem;
    color: var(--tp-muted);
    margin-top: 1px;
}

.tp-header-user-chevron {
    font-size: 0.65rem;
    color: var(--tp-muted);
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.tp-header-user.open .tp-header-user-chevron {
    transform: rotate(180deg);
}

.tp-header-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(43, 54, 116, 0.12);
    display: none;
    z-index: 300;
    overflow: hidden;
}

.tp-header-user.open .tp-header-user-dropdown {
    display: block;
}

.tp-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--tp-border);
    background: #f8fafc;
}

.tp-dropdown-header img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.tp-dropdown-header strong {
    display: block;
    font-size: 0.9rem;
    color: var(--tp-text);
}

.tp-dropdown-header span {
    font-size: 0.75rem;
    color: var(--tp-muted);
}

.tp-dropdown-menu {
    padding: 8px;
    list-style: none;
    margin: 0;
}

.tp-dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.2s ease;
}

.tp-dropdown-menu li a i {
    width: 18px;
    font-size: 0.85rem;
    color: var(--tp-muted);
}

.tp-dropdown-menu li a:hover {
    background: #f1f5f9;
    color: var(--tp-text);
}

.tp-dropdown-menu li a:hover i {
    color: var(--tp-green-active);
}

.tp-dropdown-footer {
    padding: 8px;
    border-top: 1px solid var(--tp-border);
}

.tp-dropdown-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 500;
    transition: background 0.2s ease;
}

.tp-dropdown-footer a:hover {
    background: #fef2f2;
}

.tp-page-title-block {
    margin-bottom: 20px;
}

.tp-page-title-block h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tp-text);
}

.tp-page-title-block p {
    margin: 0;
    color: var(--tp-muted);
    font-size: 0.9rem;
}

.tp-content {
    padding: 24px 28px;
    flex: 1;
    overflow-x: clip;
}

.tp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 30px;
    background-color: var(--tp-card);
    border-top: 1px solid var(--tp-border);
    margin-top: auto;
    min-width: 0;
    width: 100%;
}

.tp-footer-left {
    min-width: 0;
    flex: 1 1 auto;
}

.tp-footer p {
    color: var(--tp-muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.45;
    word-break: break-word;
}

.tp-footer strong {
    color: var(--tp-text);
}

.tp-footer-right {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    min-width: 0;
}

.tp-footer-right a {
    color: var(--tp-muted);
    font-size: 0.9rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.tp-footer-right a:hover {
    color: var(--tp-green-active);
}

.tp-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--tp-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    color: var(--tp-text);
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tp-menu-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Buttons */
.tp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.tp-btn-primary {
    background: linear-gradient(135deg, var(--tp-blue), var(--tp-blue-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.tp-btn-outline {
    background: #fff;
    color: var(--tp-blue);
    border: 1px solid #bfdbfe;
}

.tp-btn-outline:hover {
    background: #eff6ff;
}

/* Stats */
.tp-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.tp-stat-card {
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--tp-shadow);
}

.tp-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tp-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.tp-stat-icon.green { background: #ecfdf5; color: #059669; }
.tp-stat-icon.orange { background: #fff7ed; color: #ea580c; }
.tp-stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.tp-stat-icon.red { background: #fef2f2; color: #dc2626; }

.tp-stat-card span {
    display: block;
    font-size: 0.76rem;
    color: var(--tp-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.tp-stat-card strong {
    font-size: 1.35rem;
}

/* Cards & grid */
.tp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.tp-card {
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--tp-shadow);
}

.tp-card-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: -22px -22px 18px;
    padding: 14px 22px;
    border-bottom: 1px solid #e8eefb;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.tp-card-head::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--tp-blue), var(--tp-blue-dark));
}

.tp-card-head h3 {
    margin: 0;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--tp-text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-card-head h3 i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: var(--tp-blue);
    font-size: 0.85rem;
}

.tp-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #fff;
    font-size: 0.8rem;
    color: var(--tp-blue);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}

.tp-card-link:hover {
    background: var(--tp-blue);
    border-color: var(--tp-blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

@media (max-width: 640px) {
    .tp-card-head {
        margin: -22px -22px 14px;
        padding: 12px 16px;
    }
    .tp-card-head h3 { font-size: 0.94rem; }
    .tp-card-head h3 i { width: 30px; height: 30px; border-radius: 9px; font-size: 0.8rem; }
}

/* Schedule list */
.tp-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tp-schedule-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
}

.tp-schedule-item.is-now {
    border-color: #93c5fd;
    background: linear-gradient(145deg, #eff6ff, #f0fdf4);
}

.tp-period-num {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--tp-blue), var(--tp-blue-dark));
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tp-schedule-item.is-free .tp-period-num {
    background: #e2e8f0;
    color: #94a3b8;
}

.tp-schedule-body {
    flex: 1;
    min-width: 0;
}

.tp-schedule-body strong {
    display: block;
    font-size: 0.95rem;
}

.tp-schedule-body span {
    font-size: 0.82rem;
    color: var(--tp-muted);
}

.tp-schedule-time {
    font-size: 0.78rem;
    color: var(--tp-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* Class chips */
.tp-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.tp-class-chip {
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s;
}

.tp-class-chip:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.tp-class-chip strong {
    display: block;
    margin-bottom: 4px;
}

.tp-class-chip span {
    font-size: 0.82rem;
    color: var(--tp-muted);
}

/* Profile page */
.tp-profile-hero {
    position: relative;
    margin: -8px -8px 20px;
}

.tp-profile-cover {
    height: 140px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0891b2 100%);
    border-radius: 18px 18px 0 0;
}

.tp-profile-hero-inner {
    padding: 0 24px 24px;
    margin-top: -56px;
}

.tp-profile-hero-card {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 24px;
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    box-shadow: var(--tp-shadow);
}

.tp-profile-photo-ring {
    flex-shrink: 0;
    padding: 4px;
    background: linear-gradient(145deg, #93c5fd, #2563eb);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.tp-profile-photo-ring img {
    display: block;
    width: 108px;
    height: 108px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid #fff;
}

.tp-profile-identity {
    flex: 1;
    min-width: 200px;
    padding-bottom: 4px;
}

.tp-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tp-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.tp-profile-badge i.fa-circle {
    font-size: 6px;
}

.tp-profile-badge.is-active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.tp-profile-badge.is-inactive {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.tp-profile-badge.is-subject {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.tp-profile-identity h2 {
    margin: 0 0 4px;
    font-size: 1.45rem;
    color: var(--tp-text);
}

.tp-profile-role {
    margin: 0 0 6px;
    font-size: 0.92rem;
    color: var(--tp-muted);
    font-weight: 500;
}

.tp-profile-id {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
}

.tp-profile-id i {
    color: var(--tp-blue);
    margin-right: 4px;
}

.tp-profile-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
    align-self: center;
}

.tp-profile-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.tp-profile-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    box-shadow: var(--tp-shadow);
}

.tp-profile-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.tp-profile-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.tp-profile-stat-icon.green { background: #ecfdf5; color: #059669; }
.tp-profile-stat-icon.orange { background: #fff7ed; color: #ea580c; }
.tp-profile-stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.tp-profile-stat span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--tp-muted);
    font-weight: 600;
}

.tp-profile-stat strong {
    display: block;
    font-size: 0.92rem;
    margin-top: 2px;
    color: var(--tp-text);
}

.tp-profile-section .tp-card-head {
    margin-bottom: 16px;
}

.tp-profile-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tp-profile-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s;
}

.tp-profile-field:hover {
    border-color: #bfdbfe;
    background: #f0f9ff;
}

.tp-profile-field-full {
    grid-column: 1 / -1;
}

.tp-profile-field-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--tp-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tp-profile-field label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tp-muted);
    font-weight: 600;
    margin-bottom: 3px;
}

.tp-profile-field span {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--tp-text);
    word-break: break-word;
}

.tp-profile-salary {
    background: linear-gradient(145deg, #eff6ff, #f0fdf4);
    border-color: #bfdbfe;
}

.tp-profile-salary .tp-profile-field-icon {
    background: #2563eb;
    color: #fff;
}

.tp-profile-address-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.5;
}

.tp-profile-address-summary i {
    color: var(--tp-blue);
    margin-top: 3px;
    flex-shrink: 0;
}

.tp-profile-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.78rem;
    color: var(--tp-muted);
}

.tp-profile-note i {
    color: #94a3b8;
}

.tp-profile-remarks {
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    line-height: 1.65;
    color: #475569;
    font-size: 0.92rem;
}

/* Signature card */
.tp-sign-desc {
    margin: 0 0 16px;
    color: var(--tp-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.tp-sign-wrap {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: stretch;
}

.tp-sign-preview {
    flex: 1;
    min-width: 240px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    padding: 16px;
}

.tp-sign-preview.has-image {
    border-style: solid;
    border-color: var(--tp-border);
    background: #fff;
}

.tp-sign-preview img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
}

.tp-sign-empty {
    color: #94a3b8;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tp-sign-form {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.tp-sign-file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.tp-sign-file-label:hover {
    border-color: var(--tp-green-active);
    color: var(--tp-green-active);
}

.tp-sign-file-label input[type="file"] {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 400;
    cursor: pointer;
}

.tp-sign-hint {
    font-size: 0.78rem;
    color: #94a3b8;
}

.tp-sign-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.tp-profile-footer-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    font-size: 0.84rem;
    color: #92400e;
    line-height: 1.5;
}

.tp-profile-footer-note i {
    color: #d97706;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Legacy profile (dashboard etc.) */
.tp-profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--tp-card);
    border-radius: 18px;
    border: 1px solid var(--tp-border);
    box-shadow: var(--tp-shadow);
}

.tp-profile-header img {
    width: 100px;
    height: 100px;
    border-radius: 18px;
    object-fit: cover;
    border: 3px solid #bfdbfe;
}

.tp-profile-header h2 {
    margin: 0 0 6px;
}

.tp-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.tp-meta-chip {
    background: #eff6ff;
    color: #2563eb;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tp-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.tp-detail-item {
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
}

.tp-detail-item label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tp-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.tp-detail-item span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Timetable visual */
.tp-tt-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.22);
}

.tp-tt-hero h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.tp-tt-hero p {
    margin: 0;
    font-size: 0.88rem;
    opacity: 0.92;
}

.tp-tt-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tp-tt-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.tp-tt-hero.is-orange {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f59e0b 100%);
    box-shadow: 0 8px 28px rgba(234, 88, 12, 0.22);
}

.tp-tt-hero.is-green {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
    box-shadow: 0 8px 28px rgba(5, 150, 105, 0.22);
}

.tp-tt-hero.is-purple {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #8b5cf6 100%);
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.22);
}

.tp-tt-hero.is-teal {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 50%, #06b6d4 100%);
    box-shadow: 0 8px 28px rgba(8, 145, 178, 0.22);
}

.tp-tt-hero.is-slate {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    box-shadow: 0 8px 28px rgba(51, 65, 85, 0.25);
}

.tp-tt-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tp-tt-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    transition: all 0.2s;
}

.tp-tt-hero-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.tp-tt-hero-btn.is-solid {
    background: #fff;
    color: #1d4ed8;
    border-color: #fff;
}

.tp-tt-hero-btn.is-solid:hover {
    background: #eff6ff;
    color: #1e40af;
}

.tp-tt-today-panel {
    margin-bottom: 20px;
}

/* Today panel summary */
.tpt-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 0.7fr)) minmax(0, 1.6fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tpt-sum-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.tpt-sum-item span {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tp-muted);
}

.tpt-sum-item strong { font-size: 1.45rem; font-weight: 800; line-height: 1.2; color: var(--tp-text); }

.tpt-sum-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.tpt-sum-status > i {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    font-size: 1rem;
}

.tpt-sum-status strong { display: block; font-size: 0.95rem; font-weight: 800; }
.tpt-sum-status small { font-size: 0.76rem; color: #dbeafe; }

.tpt-sum-status.is-live > i { color: #6ee7b7; font-size: 0.7rem; animation: tpdPulse 1.4s infinite; }

.tpt-progress { grid-column: 1 / -1; }

.tpt-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 6px;
}

.tpt-progress-bar span {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.tpt-progress small { font-size: 0.76rem; color: var(--tp-muted); }

/* Sessions */
.tpt-sessions { display: flex; flex-direction: column; gap: 18px; }

.tpt-session-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.tpt-session-head strong { font-size: 0.92rem; color: var(--tp-text); }

.tpt-session-head small {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 0.74rem;
    font-weight: 600;
    color: #475569;
}

.tpt-session-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.tpt-session-icon.is-morning { background: #fffbeb; color: #d97706; }
.tpt-session-icon.is-evening { background: #eef2ff; color: #4f46e5; }

.tpt-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.tpt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    background: linear-gradient(160deg, #f8fbff, #fff);
    overflow: hidden;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.tpt-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #93c5fd;
}

.tpt-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1); }

.tpt-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tpt-period {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 26px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #fff;
    background: #2563eb;
}

.tpt-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: #eff6ff;
    color: #2563eb;
}

.tpt-time { font-size: 0.95rem; font-weight: 800; color: var(--tp-text); }
.tpt-time em { font-style: normal; font-size: 0.76rem; font-weight: 600; color: #94a3b8; }

.tpt-subject { font-size: 0.9rem; font-weight: 700; color: #1e40af; }

.tpt-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.76rem; color: var(--tp-muted); }
.tpt-meta i { color: #93c5fd; margin-right: 2px; }

.tpt-free { font-size: 0.78rem; color: #94a3b8; }
.tpt-free i { margin-right: 4px; }

.tpt-card.is-live {
    border-color: #2563eb;
    background: linear-gradient(160deg, #1e40af, #2563eb);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

.tpt-card.is-live::before { background: #6ee7b7; }
.tpt-card.is-live .tpt-period { background: #fff; color: #1e40af; }
.tpt-card.is-live .tpt-state { background: #10b981; color: #fff; }
.tpt-card.is-live .tpt-state i { font-size: 0.42rem; animation: tpdPulse 1.4s infinite; }
.tpt-card.is-live .tpt-time,
.tpt-card.is-live .tpt-subject { color: #fff; }
.tpt-card.is-live .tpt-time em,
.tpt-card.is-live .tpt-meta,
.tpt-card.is-live .tpt-meta i { color: #dbeafe; }

.tpt-card.is-done { background: #f8fafc; border-color: #e2e8f0; }
.tpt-card.is-done::before { background: #cbd5e1; }
.tpt-card.is-done .tpt-period { background: #94a3b8; }
.tpt-card.is-done .tpt-state { background: #ecfdf5; color: #059669; }
.tpt-card.is-done .tpt-subject,
.tpt-card.is-done .tpt-time { color: #64748b; }

.tpt-card.is-free {
    background: #fff;
    border: 1px dashed #cbd5e1;
}

.tpt-card.is-free::before { display: none; }
.tpt-card.is-free .tpt-period { background: #e2e8f0; color: #64748b; }
.tpt-card.is-free .tpt-state { background: #f1f5f9; color: #94a3b8; }
.tpt-card.is-free .tpt-time { color: #94a3b8; font-weight: 700; }
.tpt-card.is-free:hover { transform: none; box-shadow: none; }

@media (max-width: 1200px) {
    .tpt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .tpt-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tpt-sum-status { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
    .tpt-summary { gap: 8px; }
    .tpt-sum-item { padding: 10px; }
    .tpt-sum-item strong { font-size: 1.2rem; }
    .tpt-cards {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
    }
    .tpt-card { flex: 0 0 72%; scroll-snap-align: start; }
}

.tp-tt-view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    width: fit-content;
}

.tp-tt-view-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tp-muted);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.tp-tt-view-tab:hover {
    color: var(--tp-text);
}

.tp-tt-view-tab.is-active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.tp-tt-view-panel {
    display: none;
}

.tp-tt-view-panel.is-active {
    display: block;
}

.tp-tt-grid {
    overflow-x: auto;
    padding-bottom: 4px;
}

.tp-tt-row {
    display: grid;
    grid-template-columns: 72px repeat(8, minmax(108px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
    min-width: 960px;
}

.tp-tt-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 12px;
    padding: 8px 4px;
    min-height: 52px;
}

.tp-tt-row:first-child .tp-tt-day {
    background: linear-gradient(180deg, #1e40af, #2563eb);
    color: #fff;
    min-height: 56px;
}

.tp-tt-slot {
    padding: 10px 10px 8px;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
    font-size: 0.76rem;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.tp-tt-slot.filled {
    background: linear-gradient(160deg, #eff6ff 0%, #ecfdf5 100%);
    border-color: #bfdbfe;
}

.tp-tt-slot.filled:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}

.tp-tt-slot.free {
    background: #f8fafc;
    color: #cbd5e1;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

.tp-tt-slot.free i {
    font-size: 0.9rem;
}

.tp-tt-slot.is-now {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.tp-tt-slot-subject {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    color: #1e40af;
    margin-bottom: 4px;
    line-height: 1.2;
}

.tp-tt-slot-class {
    display: block;
    color: #475569;
    font-weight: 600;
    font-size: 0.74rem;
    margin-bottom: 4px;
}

.tp-tt-slot-room {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    font-size: 0.68rem;
    color: #2563eb;
    font-weight: 600;
    width: fit-content;
}

.tp-tt-day-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tp-tt-day-group {
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.tp-tt-day-group.is-today {
    border-color: #93c5fd;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.tp-tt-day-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--tp-border);
}

.tp-tt-day-group.is-today .tp-tt-day-group-head {
    background: linear-gradient(90deg, #eff6ff, #f0fdf4);
}

.tp-tt-day-group-head strong {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-tt-day-count {
    font-size: 0.78rem;
    color: var(--tp-muted);
    font-weight: 600;
}

.tp-tt-period-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    padding: 14px;
}

.tp-tt-period-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
}

.tp-tt-period-card.is-now {
    border-color: #2563eb;
    background: linear-gradient(145deg, #eff6ff, #ecfdf5);
}

.tp-tt-period-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.tp-tt-period-body strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.tp-tt-period-body span {
    display: block;
    font-size: 0.78rem;
    color: var(--tp-muted);
    line-height: 1.4;
}

.tp-tt-period-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tp-tt-period-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.tp-tt-empty-day {
    padding: 18px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.84rem;
}

/* Forms */
.tp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.tp-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #475569;
}

.tp-field input,
.tp-field select,
.tp-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--tp-border);
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
}

.tp-field input:focus,
.tp-field select:focus,
.tp-field textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tp-field-full {
    grid-column: 1 / -1;
}

/* Table */
.tp-table-wrap {
    overflow-x: auto;
}

.tp-table {
    width: 100%;
    border-collapse: collapse;
}

.tp-table th,
.tp-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
}

.tp-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--tp-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.tp-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--tp-muted);
}

.tp-empty i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 12px;
    display: block;
}

.tp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 190;
}

.tp-overlay.open {
    display: block;
}

.tp-btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
}

/* Shared page components */
.tp-page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #0891b2 100%);
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.22);
}

.tp-page-hero-greet {
    margin: 0 0 4px;
    font-size: 0.82rem;
    opacity: 0.88;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-page-hero h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.tp-page-hero-desc {
    margin: 0;
    font-size: 0.88rem;
    opacity: 0.92;
}

.tp-page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tp-page-hero-actions .tp-btn-outline {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.tp-page-hero-actions .tp-btn-outline:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.tp-page-hero-actions .tp-btn-primary {
    background: #fff;
    color: #1d4ed8;
    box-shadow: none;
}

.tp-page-hero-actions .tp-btn-primary:hover {
    background: #eff6ff;
    color: #1e40af;
}

.tp-stat-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tp-stat-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.tp-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.tp-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tp-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    transition: all 0.2s;
    color: inherit;
}

.tp-action-card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    transform: translateY(-1px);
}

.tp-action-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.tp-action-card-icon.blue { background: #eff6ff; color: #2563eb; }
.tp-action-card-icon.green { background: #ecfdf5; color: #059669; }
.tp-action-card-icon.orange { background: #fff7ed; color: #ea580c; }
.tp-action-card-icon.purple { background: #f5f3ff; color: #7c3aed; }

.tp-action-card strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.tp-action-card span {
    font-size: 0.78rem;
    color: var(--tp-muted);
}

.tp-filter-card {
    margin-bottom: 20px;
}

.tp-filter-card .tp-card-head {
    margin-bottom: 16px;
}

.tp-filter-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-items: end;
}

.tp-filter-form .tp-field-btn {
    display: flex;
    align-items: flex-end;
}

.tp-att-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.tp-att-stat {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
    text-align: center;
}

.tp-att-stat span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--tp-muted);
    margin-bottom: 4px;
}

.tp-att-stat strong {
    font-size: 1.4rem;
}

.tp-att-stat.is-present { background: #ecfdf5; border-color: #bbf7d0; }
.tp-att-stat.is-present strong { color: #059669; }
.tp-att-stat.is-absent { background: #fef2f2; border-color: #fecaca; }
.tp-att-stat.is-absent strong { color: #dc2626; }
.tp-att-stat.is-late { background: #fffbeb; border-color: #fde68a; }
.tp-att-stat.is-late strong { color: #d97706; }
.tp-att-stat.is-half { background: #eff6ff; border-color: #bfdbfe; }
.tp-att-stat.is-half strong { color: #2563eb; }

.tp-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
}

.tp-bulk-bar span {
    font-size: 0.82rem;
    color: var(--tp-muted);
    font-weight: 600;
    margin-right: 4px;
    align-self: center;
}

.tp-bulk-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--tp-border);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.tp-bulk-btn:hover { border-color: #93c5fd; background: #eff6ff; }
.tp-bulk-btn.is-present { color: #059669; border-color: #bbf7d0; }
.tp-bulk-btn.is-absent { color: #dc2626; border-color: #fecaca; }

.tp-att-select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--tp-border);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    min-width: 130px;
    cursor: pointer;
    background: #fff;
}

.tp-att-select[data-status="Present"] { background: #ecfdf5; border-color: #bbf7d0; color: #059669; }
.tp-att-select[data-status="Absent"] { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.tp-att-select[data-status="Late"] { background: #fffbeb; border-color: #fde68a; color: #d97706; }
.tp-att-select[data-status="Half Day"] { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }

.tp-student-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-student-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, #dbeafe, #eff6ff);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tp-hw-card {
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    transition: border-color 0.2s;
}

.tp-hw-card:hover {
    border-color: #c4b5fd;
}

.tp-hw-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.tp-hw-card-head strong {
    font-size: 0.95rem;
    color: var(--tp-text);
}

.tp-hw-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.tp-hw-meta {
    font-size: 0.8rem;
    color: var(--tp-muted);
    margin-bottom: 6px;
}

.tp-hw-desc {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

.tp-hw-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-form-panel {
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    padding: 18px;
}

.tp-pwd-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.tp-pwd-card {
    max-width: 100%;
}

.tp-pwd-card .tp-card-head {
    margin: 0 0 8px;
    padding: 0;
    background: none;
    border-radius: 0;
}

.tp-pwd-card .tp-card-head::before {
    display: none;
}

.tp-pwd-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(145deg, #dbeafe, #eff6ff);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.tp-pwd-tips {
    padding: 22px;
}

.tp-pwd-tips h4 {
    margin: 0 0 14px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-pwd-tips h4 i { color: #2563eb; }

.tp-pwd-tip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-pwd-tip-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.45;
}

.tp-pwd-tip-list li i {
    color: #059669;
    margin-top: 3px;
    flex-shrink: 0;
}

.tp-alert-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 0.88rem;
}

.tp-alert-warning i {
    color: #d97706;
    font-size: 1.1rem;
    margin-top: 2px;
}

.tp-alert-warning strong {
    display: block;
    margin-bottom: 4px;
}

.tp-alert-warning p {
    margin: 0;
    font-size: 0.84rem;
    opacity: 0.95;
}

.tp-alert-warning code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.tp-tt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
}

.tp-tt-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--tp-muted);
    font-weight: 600;
}

.tp-tt-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--tp-border);
}

.tp-tt-legend-dot.filled { background: linear-gradient(145deg, #eff6ff, #f0fdf4); border-color: #bfdbfe; }
.tp-tt-legend-dot.free { background: #f8fafc; }
.tp-tt-legend-dot.today { outline: 2px solid #2563eb; outline-offset: 1px; }

.tp-tt-row.is-today {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 10px;
    padding: 2px;
    background: rgba(239, 246, 255, 0.5);
}

.tp-tt-row.is-today .tp-tt-day:first-child {
    background: #2563eb;
    color: #fff;
}

.tp-tt-period-head {
    font-size: 0.65rem;
    color: #b1d1ff;
    font-weight: 600;
    margin-top: 2px;
}

.tp-table tbody tr:hover {
    background: #f8fafc;
}

.tp-table td strong {
    color: var(--tp-text);
}

.tp-schedule-item.is-now {
    border-color: #2563eb;
    background: linear-gradient(145deg, #eff6ff, #ecfdf5);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.tp-schedule-now-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #2563eb;
    color: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 8px;
}

/* Notices */
.tp-notice-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-notice-card {
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    border-left: 4px solid #2563eb;
}

.tp-notice-card.is-important {
    border-left-color: #d97706;
    background: #fffbeb;
}

.tp-notice-card.is-urgent {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.tp-notice-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.tp-notice-card-head strong {
    font-size: 0.98rem;
    color: var(--tp-text);
}

.tp-notice-priority {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #fef2f2;
    color: #dc2626;
    white-space: nowrap;
}

.tp-notice-card.is-important .tp-notice-priority {
    background: #fffbeb;
    color: #d97706;
}

.tp-notice-body {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 10px;
}

.tp-notice-foot {
    font-size: 0.78rem;
    color: var(--tp-muted);
    font-weight: 600;
}

.tp-notice-card {
    transition: box-shadow 0.15s;
}

.tp-notice-card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.tp-notice-empty-state {
    padding: 48px 24px;
    text-align: center;
}

.tp-notice-empty-state h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--tp-text);
}

.tp-notice-empty-state p {
    margin: 0;
    color: var(--tp-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.tp-empty-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #ea580c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tp-dash-notices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-dash-notice-item {
    display: block;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}

.tp-dash-notice-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.tp-dash-notice-item.is-urgent {
    border-left: 3px solid #dc2626;
    background: #fef2f2;
}

.tp-dash-notice-item strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 3px;
}

.tp-dash-notice-item span {
    font-size: 0.76rem;
    color: var(--tp-muted);
}

.tp-dash-notice-empty {
    color: var(--tp-muted);
    font-size: 0.88rem;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Leave */
.tp-leave-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 24px 26px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 45%, #f59e0b 100%);
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 8px 28px rgba(234, 88, 12, 0.25);
}

.tp-leave-hero-greet {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-leave-hero h2 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 800;
}

.tp-leave-hero-desc {
    margin: 0 0 14px;
    font-size: 0.88rem;
    opacity: 0.92;
    max-width: 520px;
    line-height: 1.5;
}

.tp-leave-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tp-leave-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 0.76rem;
    font-weight: 700;
}

.tp-leave-hero-chip.is-active {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.45);
}

.tp-leave-hero-chip.is-active i {
    font-size: 0.5rem;
    animation: tp-leave-pulse 1.5s ease infinite;
}

@keyframes tp-leave-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.tp-leave-hero-aside {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.tp-leave-hero-stat {
    min-width: 110px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    text-align: center;
}

.tp-leave-hero-stat span {
    display: block;
    font-size: 0.72rem;
    opacity: 0.88;
    margin-bottom: 4px;
    font-weight: 600;
}

.tp-leave-hero-stat strong {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.tp-leave-active-banner,
.tp-leave-upcoming-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 14px;
    border: 1px solid;
}

.tp-leave-active-banner {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #bbf7d0;
}

.tp-leave-upcoming-banner {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
}

.tp-leave-active-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tp-leave-active-banner .tp-leave-active-icon {
    background: #fff;
    color: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.tp-leave-upcoming-banner .tp-leave-active-icon {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.tp-leave-active-banner strong,
.tp-leave-upcoming-banner strong {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.tp-leave-active-banner p,
.tp-leave-upcoming-banner p {
    margin: 0;
    font-size: 0.84rem;
    color: #475569;
}

.tp-leave-stats {
    margin-bottom: 20px;
}

.tp-leave-layout {
    display: grid;
    grid-template-columns: minmax(320px, 500px) 1fr;
    gap: 20px;
    align-items: start;
}

.tp-leave-form-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tp-leave-form-card .tp-card-head {
    border-bottom: 1px solid var(--tp-border);
}

.tp-leave-date-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 14px;
}

.tp-leave-date-field {
    flex: 1;
    min-width: 0;
}

.tp-leave-date-field label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-leave-date-field label i {
    color: #ea580c;
    font-size: 0.82rem;
}

.tp-leave-date-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #ea580c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.tp-leave-duration-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 0.84rem;
    color: #9a3412;
}

.tp-leave-duration-preview i {
    color: #ea580c;
}

.tp-leave-duration-preview strong {
    color: #c2410c;
}

.tp-leave-submit {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.92rem;
}

.tp-leave-tips {
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
}

.tp-leave-tips h4 {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-leave-tips h4 i {
    color: #f59e0b;
}

.tp-leave-tips ul {
    margin: 0;
    padding: 0 0 0 18px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.65;
}

.tp-leave-tips li + li {
    margin-top: 6px;
}

.tp-leave-history-card {
    min-height: 320px;
}

.tp-leave-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 680px;
    overflow-y: auto;
    padding-right: 4px;
}

.tp-leave-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.tp-leave-card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.tp-leave-card.is-approved {
    border-left: 4px solid #10b981;
}

.tp-leave-card.is-pending {
    border-left: 4px solid #f59e0b;
}

.tp-leave-card.is-rejected {
    border-left: 4px solid #ef4444;
}

.tp-leave-card.is-cancelled {
    border-left: 4px solid #94a3b8;
    opacity: 0.92;
}

.tp-leave-card.is-current {
    background: linear-gradient(135deg, #f0fdf4, #fff);
    border-color: #bbf7d0;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
}

.tp-leave-card-status {
    flex-shrink: 0;
}

.tp-leave-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.tp-leave-card.is-approved .tp-leave-card-icon {
    background: #ecfdf5;
    color: #059669;
}

.tp-leave-card.is-pending .tp-leave-card-icon {
    background: #fffbeb;
    color: #d97706;
}

.tp-leave-card.is-rejected .tp-leave-card-icon {
    background: #fef2f2;
    color: #dc2626;
}

.tp-leave-card.is-cancelled .tp-leave-card-icon {
    background: #f1f5f9;
    color: #64748b;
}

.tp-leave-card-body {
    flex: 1;
    min-width: 0;
}

.tp-leave-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tp-leave-card-dates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    color: #0f172a;
}

.tp-leave-card-sep {
    color: #94a3b8;
    font-size: 0.82rem;
}

.tp-leave-card-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-leave-days-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
}

.tp-leave-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.tp-leave-card-tag.is-active {
    background: #dcfce7;
    color: #15803d;
}

.tp-leave-card-tag.is-active i {
    font-size: 0.45rem;
}

.tp-leave-card-tag.is-upcoming {
    background: #dbeafe;
    color: #1d4ed8;
}

.tp-leave-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.72rem;
    color: #94a3b8;
}

.tp-leave-cancel-form {
    margin: 0;
}

.tp-leave-cancel-btn {
    color: #dc2626;
    border-color: #fecaca;
    background: #fff;
}

.tp-leave-cancel-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.tp-leave-card-foot i {
    margin-right: 4px;
}

.tp-leave-empty {
    padding: 48px 24px;
}

.tp-leave-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #ea580c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tp-leave-empty h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #0f172a;
}

.tp-leave-empty p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--tp-muted);
    line-height: 1.5;
}

.tp-leave-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-leave-item {
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
}

.tp-leave-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.tp-leave-item-head strong {
    font-size: 0.9rem;
}

.tp-leave-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.tp-leave-status.badge-active {
    background: #ecfdf5;
    color: #059669;
}

.tp-leave-status.badge-inactive {
    background: #fef2f2;
    color: #dc2626;
}

.tp-leave-status.is-pending {
    background: #fffbeb;
    color: #d97706;
}

.tp-leave-status.badge-cancelled {
    background: #f1f5f9;
    color: #64748b;
}

.tp-leave-reason {
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.45;
}

.tp-leave-reason i {
    color: #cbd5e1;
    margin-right: 6px;
    font-size: 0.72rem;
}

.tp-leave-date {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* My Classes */
.tp-mc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.tp-mc-card {
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--tp-shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tp-mc-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}

.tp-mc-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.tp-mc-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(145deg, #dbeafe, #eff6ff);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tp-mc-card-top h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.tp-mc-card-top h3 span {
    color: var(--tp-muted);
    font-weight: 600;
}

.tp-mc-card-top p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--tp-muted);
}

.tp-mc-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.tp-mc-stat {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    text-align: center;
}

.tp-mc-stat span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--tp-muted);
    margin-bottom: 4px;
}

.tp-mc-stat strong {
    font-size: 1.2rem;
    color: var(--tp-text);
}

.tp-mc-stat.is-green strong { color: #059669; }
.tp-mc-stat.is-red strong { color: #dc2626; }

.tp-mc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Attendance pills (class students) */
.tp-att-pill {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.tp-att-pill.is-present { background: #ecfdf5; color: #059669; }
.tp-att-pill.is-absent { background: #fef2f2; color: #dc2626; }
.tp-att-pill.is-late { background: #fffbeb; color: #d97706; }
.tp-att-pill.is-half { background: #eff6ff; color: #2563eb; }
.tp-att-pill.is-none { background: #f1f5f9; color: #94a3b8; }

/* Homework actions */
.tp-hw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

/* Self attendance */
.tp-self-att-today .tp-form-panel {
    margin-top: 0;
}

.tp-self-att-status {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid var(--tp-border);
    background: #f8fafc;
}

.tp-self-att-status.is-present {
    background: linear-gradient(145deg, #ecfdf5, #f0fdf4);
    border-color: #bbf7d0;
}

.tp-self-att-status.is-late {
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
}

.tp-self-att-status.is-absent {
    background: #fef2f2;
    border-color: #fecaca;
}

.tp-self-att-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tp-self-att-status.is-present .tp-self-att-status-icon { color: #059669; }
.tp-self-att-status.is-late .tp-self-att-status-icon { color: #d97706; }
.tp-self-att-status.is-absent .tp-self-att-status-icon { color: #dc2626; }

.tp-self-att-status strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.tp-self-att-status > div > span {
    font-size: 0.82rem;
    color: var(--tp-muted);
}

.tp-self-att-remark {
    margin: 8px 0 0;
    font-size: 0.84rem;
    color: #475569;
}

.tp-self-att-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-self-att-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
}

.tp-self-att-date {
    width: 44px;
    text-align: center;
    flex-shrink: 0;
}

.tp-self-att-date strong {
    display: block;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--tp-text);
}

.tp-self-att-date span {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--tp-muted);
    font-weight: 700;
}

.tp-self-att-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tp-self-att-row-note {
    font-size: 0.82rem;
    color: #64748b;
}

.tp-self-att-times {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0 4px;
}

.tp-self-att-time-box {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 16px 14px;
    border-radius: 14px;
    border: 1px solid var(--tp-border);
    background: #f8fafc;
}

.tp-self-att-time-box i {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.tp-self-att-time-box span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--tp-muted);
    margin-bottom: 4px;
}

.tp-self-att-time-box strong {
    font-size: 1.05rem;
    color: var(--tp-text);
}

.tp-self-att-time-box.is-in {
    background: linear-gradient(145deg, #ecfdf5, #f0fdf4);
    border-color: #bbf7d0;
}

.tp-self-att-time-box.is-in i { color: #059669; }

.tp-self-att-time-box.is-out {
    background: linear-gradient(145deg, #eff6ff, #f0f9ff);
    border-color: #bfdbfe;
}

.tp-self-att-time-box.is-out i { color: #2563eb; }

.tp-self-att-time-box.is-out.is-pending {
    background: #f8fafc;
    border-style: dashed;
    opacity: 0.85;
}

.tp-self-att-time-box.is-out.is-pending strong {
    color: #94a3b8;
    font-size: 0.88rem;
}

.tp-self-att-time-arrow {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.tp-self-att-row-time {
    display: block;
    width: 100%;
    font-size: 0.78rem;
    color: #475569;
    font-weight: 600;
}

.tp-self-att-row-time i {
    color: #2563eb;
    font-size: 0.72rem;
}

.tp-class-chip {
    position: relative;
}

.tp-class-chip-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .tp-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .tp-grid-2 { grid-template-columns: 1fr; }
    .tp-detail-grid { grid-template-columns: 1fr; }
    .tp-profile-stat-row { grid-template-columns: repeat(2, 1fr); }
    .tp-profile-fields { grid-template-columns: 1fr; }
    .tp-stat-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .tp-filter-form { grid-template-columns: repeat(2, 1fr); }
    .tp-att-summary { grid-template-columns: repeat(2, 1fr); }
    .tp-pwd-layout { grid-template-columns: 1fr; }
    .tp-action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .tp-login-page { padding: 16px; align-items: center; padding-top: 24px; }

    .tp-login-wrap {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .tp-login-brand {
        display: none;
    }

    .tp-login-help {
        display: none;
    }

    .tp-login-form-panel {
        padding: 28px 24px 32px;
    }

    .tp-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(280px, 86vw);
        height: auto !important;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none !important;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 12px 0 32px rgba(15, 23, 42, 0.28);
        overflow: hidden;
    }

    .tp-sidebar.open { transform: translateX(0); }

    .tp-sidebar-close { display: flex; }

    .tp-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tp-sidebar-footer {
        margin-top: auto;
        flex-shrink: 0;
    }

    .tp-main { margin-left: 0; }

    .tp-menu-toggle { display: flex; }

    .tp-header-center { display: none; }

    .tp-header-user-info,
    .tp-header-user-chevron { display: none; }

    .tp-header-user-trigger {
        padding: 4px;
        border-radius: 10px;
    }

    .tp-content { padding: 16px; }

    .tp-stat-grid { grid-template-columns: 1fr; }

    .tp-stat-grid.cols-4 { grid-template-columns: 1fr 1fr; }

    .tp-leave-layout { grid-template-columns: 1fr; }

    .tp-leave-hero { flex-direction: column; }

    .tp-leave-hero-aside { width: 100%; }

    .tp-leave-hero-stat { flex: 1; }

    .tp-leave-date-row { flex-direction: column; align-items: stretch; }

    .tp-leave-date-arrow {
        align-self: center;
        margin: 0;
        transform: rotate(90deg);
    }

    .tp-leave-timeline { max-height: none; }

    .tp-form-grid { grid-template-columns: 1fr; }

    .tp-profile-header { flex-direction: column; text-align: center; }

    .tp-profile-hero { margin: -8px 0 20px; }

    .tp-profile-hero-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tp-profile-hero-actions {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .tp-profile-stat-row { grid-template-columns: 1fr; }

    .tp-profile-badges { justify-content: center; }

    .tp-page-hero { flex-direction: column; align-items: flex-start; }

    .tp-page-hero-actions { width: 100%; }

    .tp-filter-form { grid-template-columns: 1fr; }

    .tp-att-summary { grid-template-columns: 1fr 1fr; }

    .tp-tt-hero { flex-direction: column; align-items: flex-start; }

    .tp-tt-view-tabs { width: 100%; }

    .tp-tt-view-tab { flex: 1; text-align: center; }

    .tp-self-att-times {
        flex-direction: column;
    }

    .tp-self-att-time-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 640px) {
    .tp-topbar {
        padding: 0 12px;
    }

    .tp-header-breadcrumb {
        display: none;
    }

    .tp-header-actions .tp-header-icon-btn:last-of-type {
        display: none;
    }

    .tp-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px 14px 20px;
    }

    .tp-footer-left {
        width: 100%;
    }

    .tp-footer p {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .tp-footer-right {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .tp-footer-right a {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        text-align: center;
        padding: 9px 8px;
        border-radius: 10px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        font-size: 0.74rem;
        font-weight: 600;
        color: #475569;
    }

    .tp-footer-right a:hover {
        background: #ecfdf5;
        border-color: #bbf7d0;
        color: var(--tp-green-active);
    }
}

@media (max-width: 480px) {
    .tp-footer {
        padding: 14px 12px 18px;
    }

    .tp-footer-right a {
        flex: 1 1 calc(50% - 6px);
        font-size: 0.72rem;
        padding: 8px 6px;
    }
}

/* ===== Dashboard (tpd-*) ===== */
.tpd-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: stretch;
    padding: 26px;
    margin-bottom: 20px;
    border-radius: 20px;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(circle at 92% -10%, rgba(255, 255, 255, 0.16) 0, transparent 42%),
        radial-gradient(circle at -5% 120%, rgba(96, 165, 250, 0.35) 0, transparent 45%),
        linear-gradient(135deg, #1e3a8a 0%, #1e40af 55%, #2563eb 100%);
    box-shadow: 0 14px 34px rgba(30, 64, 175, 0.25);
}

.tpd-hero-main {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.tpd-hero-photo {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    background: #fff;
}

.tpd-hero-text { min-width: 0; }

.tpd-hero-greet {
    margin: 0 0 4px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #bfdbfe;
}

.tpd-hero-greet i { color: #fde68a; margin-right: 4px; }

.tpd-hero h2 {
    margin: 0 0 12px;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #fff;
}

.tpd-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tpd-hero-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.76rem;
    font-weight: 600;
    color: #e0ecff;
}

.tpd-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.tpd-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 11px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    transition: background .15s, transform .15s;
}

.tpd-hero-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; transform: translateY(-1px); }

.tpd-hero-btn.is-solid {
    background: #fff;
    color: #1e40af;
    border-color: #fff;
}

.tpd-hero-btn.is-solid:hover { background: #eff6ff; color: #1e40af; }

.tpd-next {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
}

.tpd-next-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tpd-next-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tpd-next.is-live .tpd-next-label { background: #10b981; }
.tpd-next.is-live .tpd-next-label i { font-size: 0.5rem; animation: tpdPulse 1.4s infinite; }

.tpd-next-note { font-size: 0.78rem; font-weight: 600; color: #bfdbfe; }

.tpd-next-subject {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.tpd-next-meta { display: flex; flex-direction: column; gap: 6px; }

.tpd-next-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: #e0ecff;
}

.tpd-next-meta i { width: 14px; text-align: center; color: #93c5fd; }

.tpd-next-progress { margin-top: auto; padding-top: 4px; }

.tpd-next-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
    margin-bottom: 6px;
}

.tpd-next-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #93c5fd, #fff);
}

.tpd-next-progress small { font-size: 0.74rem; color: #bfdbfe; }

.tpd-next-empty {
    margin: auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.tpd-next-empty i { font-size: 1.6rem; color: #93c5fd; margin-bottom: 4px; }
.tpd-next-empty span { font-size: 0.8rem; color: #bfdbfe; }

@keyframes tpdPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Stats */
.tpd-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.tpd-stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    box-shadow: var(--tp-shadow);
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}

.tpd-stat::after {
    content: '';
    position: absolute;
    right: -26px;
    top: -26px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #eff6ff;
    opacity: 0.7;
}

.tpd-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(37, 99, 235, 0.12); }

.tpd-stat-icon {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.tpd-stat-icon.is-indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 6px 14px rgba(79, 70, 229, 0.28); }
.tpd-stat-icon.is-green { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 6px 14px rgba(5, 150, 105, 0.28); }
.tpd-stat-icon.is-amber { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 6px 14px rgba(217, 119, 6, 0.28); }

.tpd-stat-body { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; }

.tpd-stat-body span {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tp-muted);
}

.tpd-stat-body strong {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--tp-text);
}

.tpd-stat-body small { font-size: 0.76rem; color: #94a3b8; }

/* Grid */
.tpd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Timeline */
.tpd-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tpd-tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 74px 16px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.tpd-tl-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 93px;
    top: 26px;
    bottom: -14px;
    width: 2px;
    background: #e2e8f0;
}

.tpd-tl-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-top: 10px;
    text-align: right;
}

.tpd-tl-time strong { font-size: 0.84rem; font-weight: 800; color: var(--tp-text); white-space: nowrap; }
.tpd-tl-time span { font-size: 0.72rem; color: #94a3b8; white-space: nowrap; }

.tpd-tl-dot {
    position: relative;
    z-index: 1;
    width: 14px;
    height: 14px;
    margin-top: 13px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #93c5fd;
}

.tpd-tl-card {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.tpd-tl-card:hover { border-color: #bfdbfe; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08); }

.tpd-tl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.tpd-tl-head strong { font-size: 0.95rem; color: var(--tp-text); }

.tpd-tl-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    background: #eff6ff;
    color: #2563eb;
}

.tpd-tl-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--tp-muted); }
.tpd-tl-meta span:first-child {
    padding: 1px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    font-weight: 700;
    color: #475569;
}
.tpd-tl-meta i { color: #93c5fd; margin-right: 3px; }

.tpd-tl-item.is-live .tpd-tl-dot { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18); }
.tpd-tl-item.is-live .tpd-tl-card {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #eff6ff, #fff);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}
.tpd-tl-item.is-live .tpd-tl-status { background: #2563eb; color: #fff; }
.tpd-tl-item.is-live .tpd-tl-status i { font-size: 0.45rem; animation: tpdPulse 1.4s infinite; }

.tpd-tl-item.is-done .tpd-tl-dot { border-color: #cbd5e1; background: #cbd5e1; }
.tpd-tl-item.is-done .tpd-tl-card { background: #f8fafc; }
.tpd-tl-item.is-done .tpd-tl-head strong,
.tpd-tl-item.is-done .tpd-tl-time strong { color: #94a3b8; }
.tpd-tl-item.is-done .tpd-tl-status { background: #ecfdf5; color: #059669; }

/* Week overview */
.tpd-week {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 6px 4px 14px;
    border-bottom: 1px dashed #e2e8f0;
    margin-bottom: 12px;
}

.tpd-week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.tpd-week-count { font-size: 0.82rem; font-weight: 800; color: var(--tp-text); }

.tpd-week-track {
    position: relative;
    width: 100%;
    max-width: 34px;
    height: 96px;
    border-radius: 10px;
    background: #f1f5f9;
    overflow: hidden;
}

.tpd-week-track span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #93c5fd, #3b82f6);
}

.tpd-week-name { font-size: 0.74rem; font-weight: 700; color: var(--tp-muted); text-transform: uppercase; }

.tpd-week-day.is-off .tpd-week-count { color: #cbd5e1; }

.tpd-week-day.is-today .tpd-week-track { box-shadow: 0 0 0 2px #bfdbfe; }
.tpd-week-day.is-today .tpd-week-track span { background: linear-gradient(180deg, #2563eb, #1e40af); }
.tpd-week-day.is-today .tpd-week-name {
    color: #fff;
    background: #2563eb;
    padding: 1px 7px;
    border-radius: 999px;
}

.tpd-week-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.tpd-week-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 0.84rem;
}

.tpd-week-list li span { font-weight: 600; color: var(--tp-text); }
.tpd-week-list li small { color: var(--tp-muted); white-space: nowrap; }
.tpd-week-list li em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: 4px;
}
.tpd-week-list li.is-today { background: #eff6ff; }
.tpd-week-list li.is-empty { justify-content: center; color: var(--tp-muted); }
.tpd-week-list li.is-empty span { color: var(--tp-muted); font-weight: 500; }

/* Batches */
.tpd-batches-card { margin-bottom: 20px; }

.tpd-batches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.tpd-batch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #f8fbff, #fff);
    color: inherit;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.tpd-batch:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
    color: inherit;
}

.tpd-batch-grade {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.tpd-batch-grade small { font-size: 0.62rem; font-weight: 700; opacity: 0.85; margin-top: 3px; }

.tpd-batch-body { min-width: 0; flex: 1; }
.tpd-batch-body strong { display: block; font-size: 0.98rem; color: var(--tp-text); }

.tpd-batch-board {
    display: inline-block;
    margin: 3px 0 8px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #dbeafe;
    color: #1d4ed8;
}

.tpd-batch-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.78rem; color: var(--tp-muted); }
.tpd-batch-meta i { color: #93c5fd; margin-right: 3px; }

.tpd-batch-go { color: #93c5fd; transition: transform .15s, color .15s; }
.tpd-batch:hover .tpd-batch-go { color: #2563eb; transform: translateX(3px); }

.tpd-batch.is-cbse { border-color: #e0e7ff; background: linear-gradient(135deg, #f8f8ff, #fff); }
.tpd-batch.is-cbse:hover { border-color: #a5b4fc; box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12); }
.tpd-batch.is-cbse .tpd-batch-grade { background: linear-gradient(135deg, #818cf8, #4338ca); box-shadow: 0 6px 14px rgba(79, 70, 229, 0.25); }
.tpd-batch.is-cbse .tpd-batch-board { background: #e0e7ff; color: #4338ca; }
.tpd-batch.is-cbse .tpd-batch-meta i,
.tpd-batch.is-cbse .tpd-batch-go { color: #a5b4fc; }
.tpd-batch.is-cbse:hover .tpd-batch-go { color: #4f46e5; }

/* Quick actions */
.tpd-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tpd-action {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--tp-border);
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}

.tpd-action:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
    color: inherit;
}

.tpd-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    background: #eff6ff;
    color: #2563eb;
    transition: background .15s, color .15s;
}

.tpd-action-icon.is-green { background: #ecfdf5; color: #059669; }
.tpd-action-icon.is-indigo { background: #eef2ff; color: #4f46e5; }
.tpd-action-icon.is-amber { background: #fffbeb; color: #d97706; }

.tpd-action:hover .tpd-action-icon { background: #2563eb; color: #fff; }

.tpd-action strong { font-size: 0.86rem; color: var(--tp-text); }
.tpd-action span { font-size: 0.74rem; color: var(--tp-muted); line-height: 1.35; }

/* Office */
.tpd-office { display: flex; flex-direction: column; gap: 10px; }

.tpd-office-name {
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #f8fbff);
    border: 1px solid #dbeafe;
    font-weight: 800;
    color: #1e40af;
}

.tpd-office-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}

a.tpd-office-row:hover { border-color: #bfdbfe; background: #f8fbff; color: inherit; }

.tpd-office-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.85rem;
}

.tpd-office-row label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tp-muted);
}

.tpd-office-row span { font-size: 0.86rem; font-weight: 600; color: var(--tp-text); word-break: break-word; }

/* Empty */
.tpd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 28px 16px;
}

.tpd-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 1.4rem;
    background: #eff6ff;
    color: #3b82f6;
}

.tpd-empty strong { color: var(--tp-text); }
.tpd-empty span { font-size: 0.84rem; color: var(--tp-muted); }

@media (max-width: 1200px) {
    .tpd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tpd-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .tpd-hero { grid-template-columns: 1fr; }
    .tpd-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .tpd-hero { padding: 18px; border-radius: 16px; }
    .tpd-hero-main { flex-direction: column; align-items: flex-start; gap: 14px; }
    .tpd-hero-photo { width: 72px; height: 72px; border-radius: 18px; }
    .tpd-hero h2 { font-size: 1.35rem; }
    .tpd-hero-btn { flex: 1 1 auto; justify-content: center; }
    .tpd-stats { gap: 10px; }
    .tpd-stat { padding: 14px; gap: 10px; }
    .tpd-stat-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 0.95rem; }
    .tpd-stat-body strong { font-size: 1.3rem; }
    .tpd-stat-body small { display: none; }
    .tpd-tl-item { grid-template-columns: 60px 14px minmax(0, 1fr); gap: 8px; }
    .tpd-tl-item:not(:last-child)::after { left: 74px; }
    .tpd-tl-time strong { font-size: 0.76rem; }
    .tpd-batches { grid-template-columns: 1fr; }
    .tpd-week-track { height: 72px; }
}

@media (max-width: 420px) {
    .tpd-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
    .tpd-action { padding: 12px; }
}

/* ===== My Batches (tpm-*) ===== */
.tpm-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
    padding: 26px;
    margin-bottom: 20px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 95% -20%, rgba(255, 255, 255, 0.16) 0, transparent 45%),
        radial-gradient(circle at 0% 130%, rgba(96, 165, 250, 0.35) 0, transparent 45%),
        linear-gradient(135deg, #1e3a8a 0%, #1e40af 55%, #2563eb 100%);
    box-shadow: 0 14px 34px rgba(30, 64, 175, 0.25);
}

.tpm-hero-text { min-width: 0; flex: 1 1 320px; }

.tpm-hero-kicker {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #bfdbfe;
}

.tpm-hero h2 { margin: 0 0 6px; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.tpm-hero-desc { margin: 0 0 16px; font-size: 0.88rem; color: #dbeafe; }
.tpm-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.tpm-hero-boards { display: flex; gap: 12px; }

.tpm-hero-board {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 140px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.tpm-hero-board strong { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.tpm-hero-board small { font-size: 0.76rem; color: #bfdbfe; }

.tpm-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25);
    flex-shrink: 0;
}

.tpm-hero-board.is-cbse .tpm-dot { background: #a5b4fc; box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.25); }

.tpm-stat-text { font-size: 1.05rem !important; line-height: 1.6 !important; }

/* Batch cards */
.tpm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.tpm-card {
    --tpm-a: #2563eb;
    --tpm-b: #1e40af;
    --tpm-soft: #eff6ff;
    --tpm-line: #dbeafe;
    --tpm-ink: #1d4ed8;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    box-shadow: var(--tp-shadow);
    overflow: hidden;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.tpm-card:hover {
    transform: translateY(-3px);
    border-color: var(--tpm-line);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.14);
}

.tpm-card.is-cbse {
    --tpm-a: #6366f1;
    --tpm-b: #4338ca;
    --tpm-soft: #eef2ff;
    --tpm-line: #e0e7ff;
    --tpm-ink: #4338ca;
}

.tpm-card-top {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--tpm-soft), #fff 85%);
    border-bottom: 1px solid var(--tpm-line);
}

.tpm-card-top::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tpm-a), var(--tpm-b));
}

.tpm-grade {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--tpm-a), var(--tpm-b));
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.tpm-card.is-cbse .tpm-grade { box-shadow: 0 8px 18px rgba(79, 70, 229, 0.25); }
.tpm-grade small { font-size: 0.62rem; font-weight: 700; opacity: 0.85; margin-top: 4px; }

.tpm-card-title { min-width: 0; flex: 1; }
.tpm-card-title h3 { margin: 0 0 6px; font-size: 1.08rem; font-weight: 800; color: var(--tp-text); }

.tpm-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tpm-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--tpm-a);
    color: #fff;
}

.tpm-tag.is-soft { background: #fff; color: var(--tpm-ink); border: 1px solid var(--tpm-line); }
.tpm-tag.is-soft i { font-size: 0.65rem; }

.tpm-today {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.tpm-today i { font-size: 0.45rem; animation: tpdPulse 1.4s infinite; }

.tpm-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 16px 20px 4px;
}

.tpm-metric {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.tpm-metric > i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: var(--tpm-soft);
    color: var(--tpm-a);
}

.tpm-metric strong { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1.1; color: var(--tp-text); }
.tpm-metric span { font-size: 0.72rem; color: var(--tp-muted); }

.tpm-metric.is-green > i { background: #ecfdf5; color: #059669; }
.tpm-metric.is-red > i { background: #fef2f2; color: #dc2626; }

.tpm-section { padding: 14px 20px 0; }

.tpm-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tp-muted);
}

.tpm-section-label i { color: var(--tpm-a); }

.tpm-slots { display: flex; flex-wrap: wrap; gap: 8px; }

.tpm-slot {
    display: flex;
    flex-direction: column;
    padding: 7px 11px;
    border-radius: 10px;
    border: 1px solid var(--tpm-line);
    background: #fff;
    min-width: 108px;
}

.tpm-slot strong { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; color: var(--tpm-ink); }
.tpm-slot span { font-size: 0.78rem; font-weight: 600; color: var(--tp-text); white-space: nowrap; }
.tpm-slot small { font-size: 0.7rem; color: var(--tp-muted); }

.tpm-slot.is-today {
    background: linear-gradient(135deg, var(--tpm-a), var(--tpm-b));
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.tpm-slot.is-today strong,
.tpm-slot.is-today span,
.tpm-slot.is-today small { color: #fff; }

.tpm-people { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.tpm-avatars { display: flex; }

.tpm-avatars span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--tpm-a), var(--tpm-b));
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.tpm-avatars span:first-child { margin-left: 0; }
.tpm-avatars span:nth-child(2) { filter: hue-rotate(20deg); }
.tpm-avatars span:nth-child(3) { filter: hue-rotate(-25deg); }
.tpm-avatars span:nth-child(4) { filter: hue-rotate(40deg); }
.tpm-avatars span.is-more { background: #f1f5f9; color: #475569; filter: none; font-size: 0.7rem; }

.tpm-people small { font-size: 0.78rem; color: var(--tp-muted); min-width: 0; }

.tpm-muted { margin: 0; font-size: 0.82rem; color: #94a3b8; }

.tpm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding: 16px 20px 18px;
}

.tpm-section:last-of-type { margin-bottom: 16px; }
.tpm-actions { border-top: 1px solid #f1f5f9; }

.tpm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--tpm-ink, #1d4ed8);
    background: #fff;
    border: 1px solid var(--tpm-line, #dbeafe);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}

.tpm-btn:hover { background: var(--tpm-soft, #eff6ff); color: var(--tpm-ink, #1d4ed8); }

.tpm-btn.is-primary {
    flex: 1 1 auto;
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--tpm-a, #2563eb), var(--tpm-b, #1e40af));
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.tpm-btn.is-primary:hover { color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3); }
.tpm-btn.is-icon { width: 38px; padding: 8px 0; }

@media (max-width: 1024px) {
    .tpm-hero-boards { width: 100%; }
    .tpm-hero-board { flex: 1; }
}

@media (max-width: 640px) {
    .tpm-hero { padding: 18px; border-radius: 16px; }
    .tpm-hero h2 { font-size: 1.3rem; }
    .tpm-hero-actions .tpd-hero-btn { flex: 1 1 auto; justify-content: center; }
    .tpm-hero-board { min-width: 0; padding: 12px; }
    .tpm-grid { grid-template-columns: 1fr; }
    .tpm-card-top { padding: 16px; }
    .tpm-grade { width: 52px; height: 52px; font-size: 1.15rem; }
    .tpm-metrics, .tpm-section { padding-left: 16px; padding-right: 16px; }
    .tpm-actions { padding: 14px 16px 16px; }
}

.tpd-office-phone { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.8rem; font-weight: 700; color: #2563eb; text-decoration: none; }
.tpd-office-phone:hover { text-decoration: underline; }
