* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1e293b;
    display: flex;
    position: relative;
    background-color: #006b37;
    min-height: 100vh;
}

/* ====================================================================
   UNIFORM GLOBAL KLD BACKGROUND IMAGE & LIGHT GREEN GRADIENT OVERLAY
   ==================================================================== */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(0, 107, 55, 0.45) 0%, rgba(0, 50, 20, 0.55) 100%), 
                url('image_6f66dc.jpg') no-repeat center center fixed;
    background-size: cover;
    z-index: -1;
}

/* ====================================================================
   DESKTOP VIEW: SIDEBAR NAVIGATION (FROSTED GLASS)
   ==================================================================== */
nav {
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(0, 200, 83, 0.45) 0%, rgba(0, 107, 55, 0.60) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 0 24px 24px 0;
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
}

.logo-container {
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

.sidebar-logo {
    width: 85px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.brand-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 11px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    margin-top: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-links a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.nav-links a.active {
    background: #ffffff;
    color: #006b37;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* MAIN WRAPPER PARA SA DESKTOP */
.main-wrapper {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 30px;
    box-sizing: border-box;
}

.styled-card, .hero-card, .about-card, form {
    background: #ffffff;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(16, 138, 0, 0.08);
    width: 100%;
    max-width: 750px;
    box-sizing: border-box;
    margin: auto;
}

.profile-card-layout, .teacher-profile-card-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ffffff 0%, #f4fbf7 100%);
    border-left: 6px solid #108a00;
    position: relative;
}

.user-profile-avatar, .teacher-profile-avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 50%;
    border: 3px solid #00c853;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f8f0;
    color: #00c853;
    font-size: 32px;
    flex-shrink: 0;
}

.user-profile-avatar img, .teacher-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name-title, .teacher-name-title {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e293b;
    margin: 8px 0;
}

.modal-overlay, .qr-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
}

.modal-content, .qr-modal-box {
    background: #fff;
    padding: 20px 25px;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
}

/* ====================================================================
   MOBILE VIEW ONLY (max-width: 768px)
   ==================================================================== */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        min-height: 100vh;
        overflow-x: hidden;
    }

    body::before {
        position: fixed;
        width: 100vw;
        height: 100vh;
        background-attachment: fixed;
        background-size: cover;
    }

    body {
        flex-direction: column;
    }

    nav {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        left: 0;
        border-radius: 0 0 16px 16px;
        padding: 10px 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: linear-gradient(180deg, rgba(0, 200, 83, 0.5) 0%, rgba(0, 107, 55, 0.65) 100%);
        backdrop-filter: blur(12px);
    }

    .logo-container {
        margin-bottom: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: auto;
        text-align: left;
    }

    .sidebar-logo {
        width: 28px;
    }

    .brand-title {
        font-size: 14px;
        margin-top: 0;
        font-weight: 700;
    }

    .brand-subtitle {
        display: none;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        width: auto;
    }

    .nav-links a {
        font-size: 11px;
        font-weight: 600;
        padding: 5px 8px;
        border-radius: 8px;
        gap: 4px;
        white-space: nowrap;
    }

    .nav-links a i {
        font-size: 11px;
        width: auto;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 10px !important;
        justify-content: flex-start !important;
        box-sizing: border-box !important;
    }

    .styled-card, .hero-card, .about-card, form {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px !important;
        margin: 0 auto 10px auto !important;
        box-sizing: border-box !important;
    }

    .styled-card h1, .hero-card h1, .about-card h1, 
    .styled-card h2, .hero-card h2, .about-card h2 {
        font-size: 17px !important;
        line-height: 1.2 !important;
        margin-bottom: 5px !important;
    }

    .styled-card p, .hero-card p, .about-card p {
        font-size: 11px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }

    .styled-card .feature-card, 
    .hero-card .feature-card,
    .styled-card > div[style*="background"],
    .hero-card > div[style*="background"] {
        padding: 10px !important;
        margin-bottom: 8px !important;
        border-radius: 10px !important;
    }

    .styled-card h3, .hero-card h3, .about-card h3 {
        font-size: 13px !important;
        margin-bottom: 3px !important;
    }

    /* 100% UNIFORM STYLE PARA SA STUDENT AT TEACHER PROFILE CARDS SA MOBILE */
    .profile-card-layout, .teacher-profile-card-layout {
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 10px !important;
        padding: 15px 12px !important;
        position: relative !important;
    }

    .profile-card-layout .profile-right-container,
    .teacher-profile-card-layout .profile-right-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        gap: 6px !important;
        order: 1 !important;
    }

    .profile-card-layout .profile-right-container > div:last-child,
    .teacher-profile-card-layout .profile-right-container > div:last-child {
        order: 1 !important;
    }
    .profile-card-layout .profile-right-container .btn-edit-profile,
    .teacher-profile-card-layout .profile-right-container .btn-edit-profile {
        order: 2 !important;
    }
    .profile-card-layout .profile-right-container .signed-in-badge,
    .teacher-profile-card-layout .profile-right-container .signed-in-badge {
        order: 0 !important;
        margin-right: auto !important;
    }

    .profile-card-layout .profile-content,
    .teacher-profile-card-layout .profile-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 10px !important;
        width: 100% !important;
        order: 2 !important;
    }

    .user-profile-avatar, .teacher-profile-avatar {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        font-size: 24px !important;
    }

    .user-details, .teacher-details {
        text-align: left !important;
        width: 100% !important;
    }

    .user-info-row, .teacher-info-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .user-details p, .teacher-details p, 
    .user-info-row p, .teacher-info-row p, 
    .user-info-row span, .teacher-info-row span {
        font-size: 11.5px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        width: 100% !important;
        margin: 1px 0 !important;
    }

    .user-name-title, .teacher-name-title {
        text-align: left !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        white-space: normal !important;
        width: 100% !important;
    }

    /* METRICS GRID */
    .metrics-grid-row {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px !important;
        margin-top: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .metric-mini-card {
        padding: 6px 4px !important;
        gap: 4px !important;
        border-radius: 6px !important;
        min-width: 0 !important;
    }

    .metric-mini-icon {
        width: 22px !important;
        height: 22px !important;
        font-size: 9px !important;
        border-radius: 4px !important;
    }

    .metric-mini-card div div:first-child {
        font-size: 8px !important;
        white-space: nowrap !important;
    }

    .metric-mini-card div div:last-child {
        font-size: 11px !important;
    }

    /* ENROLLED CLASSES HEADER & BUTTONS */
    .section-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .section-header h3 {
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    .header-right-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 4px !important;
        align-items: center !important;
    }

    .btn-scan-qr-header, .btn-add {
        padding: 4px 6px !important;
        font-size: 9.5px !important;
        border-radius: 5px !important;
        white-space: nowrap !important;
        gap: 3px !important;
    }

    /* ADD CLASS FORM & ENTER BUTTON */
    .add-form-container {
        padding: 10px !important;
        margin-top: 10px !important;
    }

    .form-row {
        display: flex !important;
        gap: 5px !important;
        align-items: center !important;
        width: 100% !important;
    }

    .form-input {
        flex: 1 !important;
        padding: 5px 8px !important;
        font-size: 11px !important;
        border-radius: 5px !important;
        min-width: 0 !important;
    }

    .btn-enter {
        padding: 5px 10px !important;
        font-size: 11px !important;
        border-radius: 5px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* SUBJECT CARDS GRID */
    .subject-cards-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-top: 12px !important;
    }

    .subject-card {
        border-radius: 10px !important;
    }

    .subject-card-banner {
        padding: 10px !important;
        min-height: 70px !important;
    }

    .teacher-card-avatar {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        font-size: 16px !important;
        border-width: 2px !important;
    }

    .subject-card-body {
        padding: 10px !important;
        gap: 4px !important;
    }

    .subject-card-body h4 {
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin-bottom: 2px !important;
    }

    .subject-card-body p {
        font-size: 10px !important;
        line-height: 1.1 !important;
    }
}