/* =============================================
   TUTOR SESSION PREP — Dark Premium Theme
   ============================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
    --tp-bg: #0b1311;
    --tp-surface: rgba(19, 27, 24, 0.85);
    --tp-surface-hover: rgba(26, 37, 32, 0.95);
    --tp-glass: rgba(255, 255, 255, 0.04);
    --tp-glass-border: rgba(255, 255, 255, 0.08);
    --tp-glass-hover: rgba(255, 255, 255, 0.08);
    --tp-text: #e6ebe8;
    --tp-text-muted: #9aa4a0;   /* ~5.3:1 on surface — AA */
    --tp-text-dim: #868f8b;     /* ~4.6:1 on surface — AA */
    --tp-accent: #10b981;       /* BoardBuddy emerald */
    --tp-accent-light: #5eead4; /* teal-200, high-contrast highlight */
    --tp-accent-glow: rgba(16, 185, 129, 0.25);
    --tp-purple: #0d9488;       /* repurposed → teal (gradient tail) */
    --tp-teal: #027e6f;
    --tp-green: #10b981;
    --tp-amber: #f59e0b;
    --tp-red: #ef4444;
    --tp-gradient: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
    --tp-radius: 14px;
    --tp-radius-sm: 8px;
    --tp-blur: blur(20px);
    --tp-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base Overrides (dark mode for this page) ---------- */
body.tutor-prep-page {
    background: var(--tp-bg);
    background-image:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 80%, rgba(13, 148, 136, 0.06) 0%, transparent 60%);
    color: var(--tp-text);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Page Header Bar ---------- */
.tp-header {
    background: var(--tp-surface);
    backdrop-filter: var(--tp-blur);
    -webkit-backdrop-filter: var(--tp-blur);
    border-bottom: 1px solid var(--tp-glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tp-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tp-header-left .tp-back-btn {
    background: none;
    border: 1px solid var(--tp-glass-border);
    color: var(--tp-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--tp-transition);
}

.tp-header-left .tp-back-btn:hover {
    background: var(--tp-glass-hover);
    color: var(--tp-text);
    border-color: var(--tp-accent);
}

.tp-header-title h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--tp-text);
    letter-spacing: -0.01em;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tp-header-title h1 .tp-title-icon {
    color: var(--tp-accent);
    display: inline-flex;
}

.tp-header-title p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--tp-text-muted);
    letter-spacing: 0.02em;
}

.tp-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tp-header-right .tp-user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem 0.4rem 0.5rem;
    background: var(--tp-glass);
    border: 1px solid var(--tp-glass-border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--tp-transition);
}

.tp-header-right .tp-user-pill:hover {
    background: var(--tp-glass-hover);
}

.tp-user-pill .tp-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--tp-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.tp-user-pill .tp-user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--tp-text);
}

.tp-btn-logout {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 0.4rem 0.8rem;
    border-radius: var(--tp-radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tp-transition);
}

.tp-btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ---------- Layout: Sidebar + Main ---------- */
.tp-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    min-height: calc(100vh - 60px - 72px); /* header + bottom bar */
}

/* ---------- Left Panel (Filters) ---------- */
.tp-sidebar {
    background: var(--tp-surface);
    border-right: 1px solid var(--tp-glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px - 72px);
}

.tp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tp-filter-group label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tp-text-muted);
}

.tp-filter-group select,
.tp-filter-group input[type="date"],
.tp-filter-group input[type="text"] {
    background: var(--tp-glass);
    border: 1px solid var(--tp-glass-border);
    color: var(--tp-text);
    padding: 0.6rem 0.75rem;
    border-radius: var(--tp-radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--tp-transition);
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.tp-filter-group select:focus,
.tp-filter-group input:focus {
    border-color: var(--tp-accent);
    box-shadow: 0 0 0 3px var(--tp-accent-glow);
}

.tp-filter-group select option {
    background: #11201b;
    color: var(--tp-text);
}

/* Student multi-select area */
.tp-student-search {
    position: relative;
}

.tp-student-search input {
    padding-left: 2rem;
}

.tp-student-search::before {
    content: '🔍';
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    pointer-events: none;
}

.tp-student-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 0.35rem;
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius-sm);
    padding: 0.35rem;
    background: rgba(0, 0, 0, 0.15);
    flex: 1;
    min-height: 120px;
}

.tp-student-list::-webkit-scrollbar {
    width: 5px;
}

.tp-student-list::-webkit-scrollbar-track {
    background: transparent;
}

.tp-student-list::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 3px;
}

.tp-student-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--tp-transition);
    font-size: 0.82rem;
    color: var(--tp-text);
}

.tp-student-item:hover {
    background: var(--tp-glass-hover);
}

.tp-student-item.selected {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.tp-student-item input[type="checkbox"] {
    accent-color: var(--tp-accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.tp-student-avatar-sm {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tp-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.tp-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.tp-date-row .tp-filter-group {
    gap: 0.3rem;
}

/* Status filter pills */
.tp-status-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tp-status-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--tp-glass-border);
    background: var(--tp-glass);
    color: var(--tp-text-muted);
    transition: all var(--tp-transition);
}

.tp-status-pill:hover {
    background: var(--tp-glass-hover);
    color: var(--tp-text);
}

.tp-status-pill.active {
    background: var(--tp-accent);
    color: #fff;
    border-color: var(--tp-accent);
    box-shadow: 0 2px 10px var(--tp-accent-glow);
}

/* Filter action buttons */
.tp-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tp-btn-filter {
    flex: 1;
    padding: 0.6rem;
    border-radius: var(--tp-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tp-transition);
    border: none;
    text-align: center;
}

.tp-btn-filter.primary {
    background: var(--tp-gradient);
    color: #fff;
    box-shadow: 0 4px 12px var(--tp-accent-glow);
}

.tp-btn-filter.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--tp-accent-glow);
}

.tp-btn-filter.secondary {
    background: var(--tp-glass);
    color: var(--tp-text-muted);
    border: 1px solid var(--tp-glass-border);
}

.tp-btn-filter.secondary:hover {
    color: var(--tp-text);
    background: var(--tp-glass-hover);
}

/* Live filter summary */
.tp-filter-summary {
    padding: 0.65rem 0.75rem;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: var(--tp-radius-sm);
    font-size: 0.75rem;
    color: var(--tp-text-muted);
    line-height: 1.6;
    transition: all var(--tp-transition);
}

.tp-filter-summary strong {
    color: var(--tp-accent-light);
    font-weight: 600;
}

.tp-filter-summary .tp-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.45rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--tp-accent-light);
    margin: 0.1rem 0.1rem;
}

.tp-filter-tag .tp-filter-tag-remove {
    background: none;
    border: none;
    color: var(--tp-accent-light);
    cursor: pointer;
    padding: 0;
    font-size: 0.7rem;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.tp-filter-tag .tp-filter-tag-remove:hover {
    opacity: 1;
}

.tp-student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp-student-badge {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.tp-student-count-badge {
    font-size: 0.6rem;
    color: var(--tp-text-dim);
    margin-left: auto;
    padding-left: 0.35rem;
    white-space: nowrap;
}

/* ---------- Main Content Area ---------- */
.tp-main {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px - 72px);
}

/* Top controls bar */
.tp-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tp-controls-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tp-result-count {
    font-size: 0.85rem;
    color: var(--tp-text-muted);
}

.tp-result-count strong {
    color: var(--tp-accent-light);
    font-weight: 700;
}

.tp-controls-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tp-btn-select {
    background: var(--tp-glass);
    border: 1px solid var(--tp-glass-border);
    color: var(--tp-text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: var(--tp-radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tp-transition);
}

.tp-btn-select:hover {
    color: var(--tp-text);
    background: var(--tp-glass-hover);
    border-color: var(--tp-accent);
}

/* ---------- Submission Cards Grid ---------- */
.tp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    padding-bottom: 5rem; /* space for sticky bar */
}

/* Individual Submission Card */
.tp-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    overflow: hidden;
    transition: all var(--tp-transition);
    position: relative;
    animation: tp-fadeIn 0.4s ease both;
}

.tp-card:hover {
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-3px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(16, 185, 129, 0.1);
}

.tp-card.selected {
    border-color: var(--tp-accent);
    box-shadow:
        0 0 0 2px var(--tp-accent-glow),
        0 8px 32px rgba(16, 185, 129, 0.15);
}

.tp-card.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tp-gradient);
}

/* Card header area */
.tp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 1rem 0.5rem;
}

.tp-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.tp-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--tp-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.tp-card-meta h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tp-text);
    line-height: 1.3;
}

.tp-card-meta .tp-card-date {
    font-size: 0.72rem;
    color: var(--tp-text-dim);
    margin: 0;
}

.tp-card-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--tp-glass-border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all var(--tp-transition);
}

.tp-card-checkbox:hover {
    border-color: var(--tp-accent);
    background: rgba(16, 185, 129, 0.08);
}

.tp-card-checkbox:checked {
    background: var(--tp-accent);
    border-color: var(--tp-accent);
}

.tp-card-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tp-card-checkbox:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--tp-accent-glow);
}

/* Subject badge */
.tp-subject-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    margin: 0 1rem 0.5rem;
}

.tp-subject-badge.step1 {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tp-subject-badge.step2 {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.tp-subject-badge.act {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.tp-subject-badge.sat {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.tp-subject-badge.mcat {
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.tp-subject-badge.gre {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.tp-subject-badge.lsat {
    background: rgba(251, 146, 60, 0.12);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

/* Photo thumbnails strip */
.tp-card-photos {
    display: flex;
    gap: 0.35rem;
    padding: 0 1rem;
    margin-bottom: 0.65rem;
    overflow-x: auto;
}

.tp-card-photos::-webkit-scrollbar {
    height: 3px;
}

.tp-card-photos::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 2px;
}

.tp-thumb {
    width: 64px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--tp-glass-border);
    cursor: pointer;
    transition: all var(--tp-transition);
    flex-shrink: 0;
}

.tp-thumb:hover {
    border-color: var(--tp-accent);
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Topic pills */
.tp-card-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

.tp-topic-pill {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--tp-accent-light);
    border: 1px solid rgba(16, 185, 129, 0.15);
    white-space: nowrap;
}

/* Card footer / status */
.tp-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--tp-glass-border);
    background: rgba(0, 0, 0, 0.1);
}

.tp-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.tp-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.tp-status-dot.new {
    background: var(--tp-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: tp-pulse 2s infinite;
}

.tp-status-dot.review {
    background: var(--tp-amber);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.tp-status-dot.done {
    background: var(--tp-text-dim);
}

.tp-topic-count {
    font-size: 0.72rem;
    color: var(--tp-text-dim);
}

/* ---------- Sticky Bottom Action Bar ---------- */
.tp-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(15, 17, 23, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--tp-glass-border);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
}

.tp-bottom-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tp-selected-count {
    font-size: 0.85rem;
    color: var(--tp-text-muted);
}

.tp-selected-count strong {
    color: var(--tp-accent-light);
    font-weight: 700;
    font-size: 1.1rem;
}

.tp-bottom-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tp-btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--tp-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tp-transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tp-btn.primary {
    background: var(--tp-gradient);
    color: #fff;
    box-shadow: 0 4px 16px var(--tp-accent-glow);
}

.tp-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--tp-accent-glow);
}

.tp-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tp-btn.secondary {
    background: var(--tp-glass);
    color: var(--tp-text);
    border: 1px solid var(--tp-glass-border);
}

.tp-btn.secondary:hover {
    background: var(--tp-glass-hover);
    border-color: var(--tp-accent);
}

/* ---------- Progress Bar ---------- */
.tp-progress-wrap {
    position: fixed;
    bottom: 72px;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 2rem;
    background: rgba(15, 17, 23, 0.95);
    border-top: 1px solid var(--tp-glass-border);
    display: none;
}

.tp-progress-wrap.visible {
    display: block;
    animation: tp-slideUp 0.3s ease;
}

.tp-progress-label {
    font-size: 0.78rem;
    color: var(--tp-accent-light);
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
}

.tp-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(16, 185, 129, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.tp-progress-bar {
    height: 100%;
    background: var(--tp-gradient);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.tp-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: tp-shimmer 1.5s infinite;
}

/* ---------- Image Lightbox Modal ---------- */
.tp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.tp-lightbox.active {
    display: flex;
    animation: tp-fadeIn 0.25s ease;
}

.tp-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--tp-radius);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

.tp-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tp-transition);
}

.tp-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ---------- Confirmation Dialog ---------- */
.tp-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
}

.tp-dialog-overlay.active {
    display: flex;
    animation: tp-fadeIn 0.2s ease;
}

.tp-dialog {
    background: var(--tp-surface);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: tp-scaleIn 0.25s ease;
}

.tp-dialog h3 {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
    color: var(--tp-text);
}

.tp-dialog p {
    margin: 0 0 1.5rem;
    color: var(--tp-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.tp-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* ---------- Empty State ---------- */
.tp-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--tp-text-muted);
}

.tp-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: grayscale(0.3);
}

.tp-empty h3 {
    margin: 0 0 0.5rem;
    color: var(--tp-text);
    font-size: 1.2rem;
}

.tp-empty p {
    font-size: 0.9rem;
    max-width: 350px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ---------- Loading Skeleton ---------- */
.tp-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.tp-skeleton-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    padding: 1rem;
    height: 200px;
}

.tp-skeleton-line {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: tp-shimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 0.6rem;
}

.tp-skeleton-line.w60 { width: 60%; height: 14px; }
.tp-skeleton-line.w80 { width: 80%; height: 12px; }
.tp-skeleton-line.w40 { width: 40%; height: 12px; }
.tp-skeleton-line.full { width: 100%; height: 48px; }

/* ---------- Loading Spinner ---------- */
.tp-loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    gap: 1.5rem;
}

.tp-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--tp-glass-border);
    border-top-color: var(--tp-accent);
    border-radius: 50%;
    animation: tp-spin 0.8s linear infinite;
}

.tp-loading-text {
    font-size: 0.9rem;
    color: var(--tp-text-muted);
}

/* ---------- Animations ---------- */
@keyframes tp-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes tp-scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes tp-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes tp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes tp-spin {
    to { transform: rotate(360deg); }
}

/* Card staggered entrance */
.tp-card:nth-child(1) { animation-delay: 0s; }
.tp-card:nth-child(2) { animation-delay: 0.04s; }
.tp-card:nth-child(3) { animation-delay: 0.08s; }
.tp-card:nth-child(4) { animation-delay: 0.12s; }
.tp-card:nth-child(5) { animation-delay: 0.16s; }
.tp-card:nth-child(6) { animation-delay: 0.20s; }
.tp-card:nth-child(7) { animation-delay: 0.24s; }
.tp-card:nth-child(8) { animation-delay: 0.28s; }
.tp-card:nth-child(9) { animation-delay: 0.32s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .tp-layout {
        grid-template-columns: 1fr;
    }

    .tp-sidebar {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--tp-glass-border);
        padding: 1rem;
    }

    .tp-main {
        max-height: none;
        padding: 1rem;
    }

    .tp-cards-grid {
        grid-template-columns: 1fr;
    }

    .tp-header {
        padding: 0.75rem 1rem;
    }

    .tp-header-title h1 {
        font-size: 1.1rem;
    }

    .tp-user-pill .tp-user-name {
        display: none;
    }

    .tp-bottom-bar {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

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

    .tp-bottom-right {
        flex-direction: column;
        width: 100%;
    }

    .tp-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ---------- Icon alignment (inline SVGs) ---------- */
.tp-btn-logout,
.tp-btn-select,
.tp-btn-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.tp-btn-logout svg,
.tp-btn-select svg,
.tp-btn-filter svg,
.tp-btn svg,
.tp-back-btn svg,
.tp-title-icon svg,
.tp-weakness-label svg {
    flex-shrink: 0;
}

.tp-weakness-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.tp-weakness-label svg {
    color: var(--tp-accent);
}
