/* =========================================================
   parentsPortal.css — Parent Dashboard Styles
   ========================================================= */

/* --- 1. GLOBAL RESET & MOBILE ZOOM PROTECTION --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
    /* Stops horizontal "wobble" and zoom */
    position: relative;
    -webkit-text-size-adjust: 100%;
    /* Prevents iPhone font-scaling */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* --- 2. LAYOUT STRUCTURE --- */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e3a5f 0%, #1e293b 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.parent-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #7dd3fc;
    font-size: 18px;
}

.sidebar-header-text {
    min-width: 0;
}

.sidebar-role {
    font-size: 10px;
    font-weight: 700;
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}

.sidebar-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-details p {
    font-size: 0.8rem;
    color: #64748b;
}

.nav-menu {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background-color: #f1f5f9;
    color: #3b82f6;
    border-right-color: #3b82f6;
}

/* Parent portal nav items (navy sidebar) */
.nav-link.parent-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin: 2px 12px;
    color: #cbd5e1;
    border-radius: 8px;
    border-right: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.nav-link.parent-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.nav-link.parent-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-link.parent-nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Parent identity / child switcher */
.parent-identity {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin: 4px 12px 12px;
}

.parent-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.child-switcher-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: white;
    cursor: pointer;
}

/* Sidebar footer (logout) */
.sidebar-footer {
    margin-top: auto;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout {
    color: #f87171;
    font-weight: 700;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* --- 3. MAIN CONTENT & HEADER --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.welcome-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

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

.notification-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- 4. CARDS & PERFORMANCE GRID --- */
.section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.section-content {
    padding: 2rem;
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-container {
    position: relative;
    height: 250px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}
/* --- BUTTON STYLING --- */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: auto; /* Overrides the 'full-width' behavior of block buttons */
}

.btn-primary {
    background-color: #7cfc00; /* Your Lawn Green */
    color: #0f172a; /* Dark text for contrast */
}

.btn-primary:hover {
    background-color: #66cc00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 252, 0, 0.2);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* Ensure icons inside buttons are sized correctly */
.btn-primary i, .btn-secondary i {
    font-size: 14px;
}

/* --- 5. MOBILE RESPONSIVENESS (THE LOCKDOWN) --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 2000;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
        /* Reduced padding for mobile */
    }

    .header {
        padding: 1rem !important;
        flex-direction: row !important;
        /* Keep items horizontal */
        gap: 10px;
    }

    .welcome-section h1 {
        font-size: 1.3rem !important;
        /* Scale down heading */
    }

    .welcome-section p {
        display: none;
        /* Hide subtitle for space */
    }

    .performance-grid {
        grid-template-columns: 1fr !important;
        /* Stack columns */
        gap: 1.5rem;
    }

    .section-content {
        padding: 1rem !important;
    }

    .mobile-menu-btn {
        display: flex !important;
    }
    .modal-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100% !important;
        padding: 14px; /* Larger hit area for thumbs */
    }
}

/* --- 6. UNIVERSAL INPUT PROTECTION --- */
/* Strictly enforces 16px font to prevent iOS Safari auto-zoom */
input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select,
button {
    font-size: 16px !important;
    touch-action: manipulation !important;
}