:root {
    /* Premium Parent Identity */
    --parent-primary: #4f46e5;
    --parent-primary-light: #818cf8;
    --parent-primary-rgb: 79, 70, 229;
    --parent-success: #10b981;
    --parent-warning: #f59e0b;
    --parent-danger: #ef4444;
    
    /* Surface & Glass */
    --parent-bg: #f8fafc;
    --parent-surface: #ffffff;
    --parent-glass: rgba(255, 255, 255, 0.85);
    --parent-border: rgba(0, 0, 0, 0.08);
    
    /* Layout Tokens */
    --p-header-h: 60px;
    --p-nav-h: 72px;
    --p-radius: 20px;
    --p-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --parent-bg: #0f172a;
    --parent-surface: #1e293b;
    --parent-glass: rgba(30, 41, 59, 0.85);
    --parent-border: rgba(255, 255, 255, 0.08);
}

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-main);
}

.parent-portal-active {
    font-family: 'Inter', sans-serif;
    background-color: var(--parent-bg);
    color: var(--text-main);
}

.parent-portal-active h1, 
.parent-portal-active h2, 
.parent-portal-active h3 {
    font-family: 'Outfit', sans-serif;
}

/* --- UNIFIED MOBILE TOP BAR --- */
.mobile-top-bar {
    display: none; /* Desktop hidden */
}

@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
    }

    .mobile-top-bar {
        display: flex !important;
        height: var(--p-header-h);
        background: var(--parent-glass);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid var(--parent-border);
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
        flex-shrink: 0;
    }

    .mtb-toggle {
        background: rgba(var(--parent-primary-rgb), 0.08);
        border: none;
        width: 38px;
        height: 38px;
        border-radius: 12px;
        color: var(--parent-primary);
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .mtb-logo-fallback {
        width: 32px;
        height: 32px;
        background: var(--parent-primary);
        color: white;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        font-size: 1rem;
    }

    .mtb-title {
        font-size: 0.95rem;
        font-weight: 950;
        color: var(--text-main);
        letter-spacing: -0.02em;
        flex: 1;
        text-align: center;
        padding: 0 0.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mtb-actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .mtb-action-btn {
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .mtb-avatar {
        width: 32px;
        height: 32px;
        background: var(--parent-primary);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 0.75rem;
        border: 2px solid white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .app-main-wrapper {
        padding-bottom: var(--p-nav-h) !important;
    }

    .parent-portal-active .app-topbar-3d {
        display: none !important;
    }

    /* Mobile Sidebar Polish */
    .elite-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999 !important;
        background: var(--parent-surface) !important;
        border-right: 1px solid var(--parent-border);
        box-shadow: 20px 0 50px rgba(0,0,0,0.15);
        color: var(--text-main) !important;
    }
    
    .elite-sidebar .elite-nav-item {
        color: #475569 !important;
    }

    .elite-sidebar .elite-nav-item.active {
        color: #fff !important;
    }

    .elite-sidebar .elite-group-header {
        color: #94a3b8 !important;
    }

    .elite-sidebar .elite-brand-name {
        color: #0f172a !important;
    }

    .elite-sidebar .elite-brand-tag {
        color: #64748b !important;
    }

    .elite-sidebar #sidebarSearchInput {
        color: #0f172a !important;
    }

    .elite-sidebar .esb-icon {
        color: #94a3b8 !important;
    }
    
    .elite-sidebar.active {
        transform: translateX(0) !important;
    }
    
    .drawer-overlay {
        z-index: 9990 !important;
        background: rgba(15, 23, 42, 0.4) !important;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .app-main-wrapper {
        z-index: 1 !important;
        position: relative;
    }
}

/* --- DESKTOP LAYOUT --- */
.parent-centered-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.mobile-bottom-nav {
    display: none; /* Desktop hidden */
}

@media (max-width: 1024px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: var(--p-nav-h);
        background: var(--parent-glass);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid var(--parent-border);
        justify-content: space-around;
        align-items: center;
        padding: 0 0.5rem env(safe-area-inset-bottom);
        z-index: 1000;
    }
}

/* --- UI COMPONENTS --- */

/* STUDENT SUMMARY CARD */
.student-summary-card {
    background: var(--parent-surface);
    border-radius: var(--p-radius);
    padding: 1.25rem;
    margin: 1rem;
    box-shadow: var(--p-shadow);
    border: 1px solid var(--parent-border);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ssc-photo-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.ssc-photo {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    background: #f1f5f9;
}

.ssc-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--parent-success);
    border: 3px solid var(--parent-surface);
    border-radius: 50%;
}

.ssc-info {
    flex: 1;
}

.ssc-name {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

.ssc-class {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ssc-metrics {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.ssc-metric {
    display: flex;
    flex-direction: column;
}

.sscm-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
}

.sscm-value {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--text-main);
}

/* QUICK ACTIONS GRID */
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .quick-action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.qa-tile {
    background: var(--parent-surface);
    border-radius: var(--p-radius);
    padding: 1.25rem;
    border: 1px solid var(--parent-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.qa-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--p-shadow);
}

.qa-tile:active {
    transform: scale(0.96);
}

.qa-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.qa-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
}

/* BOTTOM NAVIGATION */
.bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    transition: all 0.3s;
    cursor: pointer;
}

.bn-item i {
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.bn-item span {
    font-size: 10px;
    font-weight: 800;
}

.bn-item.active {
    color: var(--parent-primary);
}

.bn-item.active i {
    transform: translateY(-2px);
}

/* SECTION STYLING */
.p-section {
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.p-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.p-section-title {
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.p-section-link {
    font-size: 11px;
    font-weight: 800;
    color: var(--parent-primary);
    text-transform: uppercase;
    cursor: pointer;
}

.p-card {
    background: var(--parent-surface);
    border-radius: var(--p-radius);
    padding: 1rem;
    border: 1px solid var(--parent-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* CHILD CHIPS STRIP */
.p-child-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 1rem 1rem;
    scrollbar-width: none;
}

.p-child-strip::-webkit-scrollbar { display: none; }

.p-child-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--parent-surface);
    border: 1px solid var(--parent-border);
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.p-child-chip.active {
    background: var(--parent-primary);
    color: white;
    border-color: var(--parent-primary);
    box-shadow: 0 10px 20px -5px rgba(var(--parent-primary-rgb), 0.3);
}

.p-child-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
}

.p-child-chip.active .p-child-avatar {
    background: rgba(255,255,255,0.2);
}

/* ANIMATIONS */
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-fade-in {
    animation: slideDown 0.3s ease-out forwards;
}

.body-scroll-lock {
    overflow: hidden !important;
}
