.hidden {
    display: none !important;
}

.app-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.main-wrapper {
    flex: 1 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    height: calc(100vh - 60px) !important;
    padding: 24px 32px 40px !important;
    margin: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* --- Quick Links Grid --- */
.quick-links-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
}

.quick-link-anchor {
    text-decoration: none;
}

.quick-link-card {
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

/* --- Search Bar Container --- */
.search-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
}

.search-input-code {
    flex: 1;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    margin: 0;
    height: 48px;
}

.search-btn-custom {
    width: 100px;
    font-weight: 700;
    font-size: 15px;
    margin: 0;
    height: 48px;
    flex-shrink: 0;
}

.error-box {
    padding: 12px;
    background: #ffeaea;
    color: #e02d2d;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    font-weight: 500;
}

/* --- Hero Profile & Behavior Banner --- */
.hero-point-card {
    background: linear-gradient(135deg, #1e5eff 0%, #0b1437 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(30, 94, 255, 0.15);
    width: 100% !important;
    box-sizing: border-box !important;
}

.hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.8;
    font-weight: 700;
}

.student-name-heading {
    margin: 4px 0 2px 0;
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 800;
    word-break: break-word;
}

.student-class-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-top: 6px;
}

.hero-point-badge {
    font-size: clamp(2.2rem, 7vw, 3rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}

/* --- Dashboard Grid & Cards --- */
.box {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    /* Clips wide children inside card */
    padding: 20px !important;
    margin-bottom: 20px !important;
}

.profile-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    width: 100% !important;
}

/* --- Table Overrides (Fixes 550px Min-Width Bug) --- */
.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    min-height: 0 !important;
    border-radius: 8px !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
}

.table-responsive table {
    width: 100% !important;
    min-width: 0 !important;
    /* CRITICAL FIX: Removes admin.css 550px min-width */
    table-layout: auto !important;
    white-space: normal !important;
}

th,
td {
    padding: 10px 12px !important;
    font-size: 13px !important;
    word-break: break-word !important;
}

.live-updates-tag {
    background: #eef2ff;
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ======================================================
   MOBILE & TABLET RESPONSIVE BREAKPOINTS (iPhone 13 / iPads)
   ====================================================== */
@media screen and (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

@media screen and (max-width: 768px) {
    .main-wrapper {
        padding: 12px 12px 32px !important;
    }

    .student-header {
        padding: 12px 16px !important;
    }

    .quick-links-grid,
    .profile-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .hero-point-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 16px !important;
    }

    .hero-point-card>div:last-child {
        text-align: left !important;
    }

    .hero-point-badge {
        text-align: left !important;
    }

    .box {
        padding: 14px !important;
    }

    .search-wrapper {
        flex-direction: row !important;
        gap: 8px !important;
    }

    .search-input-code {
        height: 44px !important;
        font-size: 14px !important;
    }

    .search-btn-custom {
        height: 44px !important;
        width: 80px !important;
        font-size: 14px !important;
    }
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Space between dark mode and teacher button */
}

/* Styling for the For Teacher button */
.teacher-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2b6cb0;
    color: #ffffff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.teacher-btn:hover {
    background-color: #2c5282;
}

/* ======================================================
   REDESIGNED SCHOOL NOTICES CARD LAYOUT
   ====================================================== */

.notice-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

/* Header Row: Title on Left, Small Date Tag on Right */
.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
}

.notice-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-blue, #1e5eff);
    line-height: 1.3;
}

/* Small, subtle date badge */
.notice-date-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-gray, #707eae);
    background: var(--bg-body, #f4f7fe);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color, #e2e8f0);
    white-space: nowrap;
}

/* Notice Content Body - Prominent & Easy to Read */
.notice-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark, #2b3674);
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: 400;
}

/* ==========================================================================
   LOGO & ICON SIZING FIXES
   ========================================================================== */

/* 1. Header Layout & Yellow Logo Box Fix */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 2px;
}

/* Enforce sleek, proportional dimensions on the brand logo box */
.brand-badge,
.brand-logo-container,
.brand>div:first-child {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}

/* Force the logo image to scale down inside the box */
.brand-badge-img,
.brand-logo-container img,
.brand>div:first-child img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* 2. Topbar Action Buttons & Icons Fix */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle-btn,
.teacher-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    height: 42px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer;
    box-sizing: border-box;
}

/* Restrict topbar button icons */
.btn-icon {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    display: inline-block;
}

/* 3. Quick Link Cards & Icon Containers Fix */
.quick-link-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Fixed container box for Quiz & Timeline icons */
.stat-icon {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 10px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

/* Restrict card icons */
.stat-icon-img {
    width: 26px !important;
    height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    object-fit: contain !important;
    display: block;
}

/* ======================================================
   REDESIGNED STUDENT PORTAL SIDEBAR & HERO BANNER
   ====================================================== */
.sidebar,
.student-sidebar {
    width: 100vw !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    background: var(--sidebar-bg, #0b1437) !important;
    color: white !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 24px !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 1000 !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.student-greeting-banner {
    background-color: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    padding: 32px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.dark-theme .student-greeting-banner {
    background-color: #0f172a;
    border-color: #1e293b;
}

.greeting-text-container {
    z-index: 2;
    max-width: 55%;
    position: relative;
}

.greeting-title {
    margin: 0 0 6px 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark, #0f172a);
    letter-spacing: -0.5px;
}

.dark-theme .greeting-title {
    color: #ffffff;
}

.greeting-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--text-gray, #64748b);
    font-weight: 500;
}

.school-building-img-wrapper {
    position: absolute;
    right: 0;
    bottom: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.school-building-img,
.school-building-video {
    position: absolute;
    right: 0;
    top: 0;
    width: 60%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 100%);
}

/* Quick Cards Row */
.quick-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.quick-card-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 16px;
    text-decoration: none;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.quick-card-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.blue-card {
    background: #eff6ff;
    border-color: #dbeafe;
}

.dark-theme .blue-card {
    background: #172554;
    border-color: #1e40af;
}

.green-card {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.dark-theme .green-card {
    background: #052e16;
    border-color: #166534;
}

.quick-card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.blue-icon {
    background: #2563eb;
    color: #ffffff;
}

.green-icon {
    background: #16a34a;
    color: #ffffff;
}

.quick-card-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
}

.blue-title {
    color: #1d4ed8;
}

.dark-theme .blue-title {
    color: #60a5fa;
}

.green-title {
    color: #15803d;
}

.dark-theme .green-title {
    color: #4ade80;
}

.quick-card-desc {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.dark-theme .quick-card-desc {
    color: #94a3b8;
}

.quick-card-arrow {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.quick-card-box:hover .quick-card-arrow {
    transform: translateX(4px);
}

.blue-arrow {
    color: #2563eb;
}

.green-arrow {
    color: #16a34a;
}

/* ======================================================
   BEHAVIOR ACTIVITY FEED CARDS
   ====================================================== */
.behavior-activity-item {
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.behavior-activity-item:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.behavior-item-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.behavior-item-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.behavior-item-details {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.behavior-item-title {
    margin: 0 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--text-dark, #0f172a) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.dark-theme .behavior-item-title,
body.dark-mode .behavior-item-title {
    color: #f8fafc !important;
}

.behavior-item-date {
    margin: 2px 0 0 0 !important;
    font-size: 11.5px !important;
    color: var(--text-gray, #64748b) !important;
}

.behavior-item-badge {
    font-size: 13.5px !important;
    font-weight: 800 !important;
    padding: 3px 10px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ======================================================
   ROUNDED PILL BUTTON STYLING SYSTEM (LIGHT & DARK THEME)
   ====================================================== */
button:not(.mobile-kebab-btn):not(#mobileTopbarKebabBtn):not(.notif-btn):not(#notifToggleBtn):not(.card-kebab-btn):not(#profileCardKebabBtn):not(.profile-dropdown-item):not(.menu-btn):not(.submenu-btn):not(.kebab-item):not(.kebab-btn):not(.edit-btn):not(.delete-btn),
.btn-pill,
.teacher-btn,
.theme-toggle-btn,
#studentLoginBtn,
#submitPostBtn,
#verifyBtn,
#startSelectedQuizBtn,
#submitQuizBtn,
#loginBtn {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 24px !important;
    padding: 10px 22px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

button:not(.mobile-kebab-btn):not(#mobileTopbarKebabBtn):not(.notif-btn):not(#notifToggleBtn):not(.card-kebab-btn):not(#profileCardKebabBtn):not(.profile-dropdown-item):hover,
.btn-pill:hover,
.teacher-btn:hover,
.theme-toggle-btn:hover,
#studentLoginBtn:hover,
#submitPostBtn:hover,
#verifyBtn:hover,
#startSelectedQuizBtn:hover,
#submitQuizBtn:hover,
#loginBtn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

button:active,
.btn-pill:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* Dark Theme Button Overrides */
.dark-theme button:not(.mobile-kebab-btn):not(#mobileTopbarKebabBtn):not(.notif-btn):not(#notifToggleBtn):not(.card-kebab-btn):not(#profileCardKebabBtn):not(.profile-dropdown-item):not(.menu-btn):not(.submenu-btn):not(.kebab-item):not(.kebab-btn):not(.edit-btn):not(.delete-btn),
.dark-theme .btn-pill,
.dark-theme .teacher-btn,
.dark-theme .theme-toggle-btn,
.dark-theme #studentLoginBtn,
.dark-theme #submitPostBtn,
.dark-theme #verifyBtn,
.dark-theme #startSelectedQuizBtn,
.dark-theme #submitQuizBtn,
.dark-theme #loginBtn {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.dark-theme button:not(.mobile-kebab-btn):not(#mobileTopbarKebabBtn):not(.notif-btn):not(#notifToggleBtn):not(.card-kebab-btn):not(#profileCardKebabBtn):not(.profile-dropdown-item):not(.menu-btn):not(.submenu-btn):not(.kebab-item):not(.kebab-btn):not(.edit-btn):not(.delete-btn):hover,
.dark-theme .btn-pill:hover,
.dark-theme .teacher-btn:hover,
.dark-theme .theme-toggle-btn:hover,
.dark-theme #studentLoginBtn:hover,
.dark-theme #submitPostBtn:hover,
.dark-theme #verifyBtn:hover,
.dark-theme #startSelectedQuizBtn:hover,
.dark-theme #submitQuizBtn:hover,
.dark-theme #loginBtn:hover {
    background: #334155 !important;
    border-color: #475569 !important;
}

/* Danger / Logout Button Pill Variant */
#studentLogoutBtn,
#logoutBtn {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
}

.dark-theme #studentLogoutBtn,
.dark-theme #logoutBtn {
    background: #450a0a !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}

/* ======================================================
   MOBILE & TABLET RESPONSIVE ENHANCEMENTS (IPHONE & IPAD)
   ====================================================== */

/* ======================================================
   COMPREHENSIVE DARK THEME SYSTEM FOR STUDENT PORTAL
   ====================================================== */
body.dark-theme,
body.dark-mode {
    --bg-body: #0b1437 !important;
    --card-bg: #111c44 !important;
    --text-dark: #f4f7fe !important;
    --text-gray: #a3aed1 !important;
    --border-color: #1b254b !important;
    --sidebar-bg: #080f28 !important;
    --sidebar-hover: #152046 !important;
    background: #0b1437 !important;
    color: #f4f7fe !important;
}

body.dark-theme .app-container,
body.dark-mode .app-container,
body.dark-theme .main-wrapper,
body.dark-mode .main-wrapper {
    background: #0b1437 !important;
    color: #f4f7fe !important;
}

body.dark-theme .box,
body.dark-mode .box,
body.dark-theme #newsTicker,
body.dark-mode #newsTicker,
body.dark-theme .stat-card,
body.dark-mode .stat-card {
    background: #111c44 !important;
    border: 1px solid #1b254b !important;
    color: #f4f7fe !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

body.dark-theme .box h3,
body.dark-mode .box h3,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: #f4f7fe !important;
}

body.dark-theme p,
body.dark-mode p {
    color: #a3aed1;
}

body.dark-theme .sidebar,
body.dark-mode .sidebar,
body.dark-theme .student-sidebar,
body.dark-mode .student-sidebar {
    background: #080f28 !important;
    border-bottom: 1px solid #1b254b !important;
}

body.dark-theme .student-greeting-banner,
body.dark-mode .student-greeting-banner {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}

body.dark-theme .behavior-activity-item,
body.dark-mode .behavior-activity-item {
    background: #0b1437 !important;
    border-color: #1b254b !important;
}

/* iPad & Medium Tablet Breakpoint (<= 1024px) */
/* ======================================================
   RESPONSIVE MEDIA QUERIES (IPAD & IPHONE OPTIMIZATION)
   ====================================================== */

/* iPad & Tablet Breakpoint (<= 1024px) */
@media screen and (max-width: 1024px) {
    .main-wrapper {
        padding: 16px 20px 32px !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    .dashboard-overview-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile & iPhone Breakpoint (<= 768px) */
@media screen and (max-width: 768px) {

    .sidebar,
    .student-sidebar {
        padding: 0 16px !important;
        height: 56px !important;
        min-height: 56px !important;
    }

    .brand {
        gap: 10px !important;
        margin-left: 4px !important;
    }

    .brand p {
        display: none !important;
    }

    .brand h2 {
        font-size: 13.5px !important;
    }

    .menu-bar {
        gap: 4px !important;
    }

    .menu-btn {
        width: 40px !important;
        height: 40px !important;
        border-radius: 8px !important;
    }

    .menu-icon {
        width: 20px !important;
        height: 20px !important;
    }

    .user-profile-bottom {
        gap: 6px !important;
    }

    .theme-toggle-btn,
    .teacher-btn {
        padding: 5px 8px !important;
        font-size: 12px !important;
        height: 34px !important;
    }

    .main-wrapper {
        padding: 14px 14px 32px !important;
        height: calc(100vh - 56px) !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .quick-links-grid,
    .quick-cards-row,
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .student-greeting-banner {
        padding: 20px 18px !important;
        min-height: 120px !important;
    }

    .greeting-title {
        font-size: 20px !important;
    }

    .school-building-img,
    .school-building-video {
        width: 45% !important;
        opacity: 0.2 !important;
    }

    .hero-point-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .hero-point-badge {
        font-size: 2.2rem !important;
    }

    #spotlightHeroCard {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 24px !important;
    }

    #spotlightHeroCard>div {
        max-width: 100% !important;
    }

    .post-box {
        padding: 14px !important;
    }

    .post-options-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #submitPostBtn {
        width: 100% !important;
    }

    /* Input & Button touch targets for iPhone & iPad */
    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
        /* Prevents auto-zoom on iOS Safari */
    }
}

/* Small iPhone Breakpoint (<= 480px) */
@media screen and (max-width: 480px) {
    .brand div:nth-child(2) {
        display: none !important;
        /* Hide brand text on tiny screens, show logo badge */
    }

    .sidebar,
    .student-sidebar {
        padding: 0 14px !important;
    }

    .brand {
        margin-left: 2px !important;
    }

    .menu-bar {
        gap: 2px !important;
    }

    .menu-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .teacher-btn span {
        display: none !important;
        /* Icon-only teacher button on tiny mobile */
    }

    .teacher-btn {
        padding: 6px !important;
        width: 34px !important;
        height: 34px !important;
        border-radius: 50% !important;
    }

    #mainThemeText,
    #themeToggleText {
        display: none !important;
        /* Icon-only theme button on tiny mobile */
    }

    .theme-toggle-btn {
        padding: 6px !important;
        width: 34px !important;
        height: 34px !important;
        border-radius: 50% !important;
    }

    .main-wrapper {
        padding: 12px 10px 24px !important;
    }
}

/* ======================================================
   MOBILE KEBAB TOPBAR NAVIGATION SYSTEM (<= 768px)
   ====================================================== */

.sidebar,
.student-sidebar {
    overflow: visible !important;
}

.mobile-kebab-container {
    display: none;
    position: relative;
    z-index: 999999;
}

button.mobile-kebab-btn,
.mobile-kebab-btn,
#mobileTopbarKebabBtn {
    background: #1e5eff !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-radius: 10px !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 3px 10px rgba(30, 94, 255, 0.45) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

button.mobile-kebab-btn:hover,
.mobile-kebab-btn:hover,
#mobileTopbarKebabBtn:hover {
    background: #2563eb !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    transform: scale(1.05) !important;
}

button.mobile-kebab-btn:active,
.mobile-kebab-btn:active,
#mobileTopbarKebabBtn:active {
    transform: scale(0.92) !important;
    background: #1d4ed8 !important;
}

button.mobile-kebab-btn svg,
.mobile-kebab-btn svg,
#mobileTopbarKebabBtn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    fill: none !important;
    stroke-width: 2.2 !important;
    color: #ffffff !important;
    pointer-events: none !important;
    display: block !important;
}

/* Dark mode override for mobile kebab button */
body.dark-theme button.mobile-kebab-btn,
body.dark-mode button.mobile-kebab-btn,
body.dark-theme #mobileTopbarKebabBtn,
body.dark-mode #mobileTopbarKebabBtn {
    background: #2563eb !important;
    border: 1px solid rgba(147, 197, 253, 0.6) !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.6) !important;
}

body.dark-theme button.mobile-kebab-btn:hover,
body.dark-mode button.mobile-kebab-btn:hover,
body.dark-theme #mobileTopbarKebabBtn:hover,
body.dark-mode #mobileTopbarKebabBtn:hover {
    background: #3b82f6 !important;
    border-color: #93c5fd !important;
}

body.dark-theme button.mobile-kebab-btn svg,
body.dark-mode button.mobile-kebab-btn svg,
body.dark-theme #mobileTopbarKebabBtn svg,
body.dark-mode #mobileTopbarKebabBtn svg {
    stroke: #ffffff !important;
    fill: none !important;
    color: #ffffff !important;
}

.mobile-topbar-dropdown {
    position: fixed !important;
    top: 54px !important;
    right: 12px !important;
    width: 240px !important;
    max-width: calc(100vw - 24px) !important;
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 16px !important;
    padding: 12px !important;
    box-shadow: 0 20px 45px -5px rgba(0, 0, 0, 0.45) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    animation: kebabDropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes kebabDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mobile-topbar-dropdown.hidden {
    display: none !important;
}

.kebab-group-label {
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
    color: var(--text-gray, #64748b) !important;
    padding: 6px 10px 4px !important;
    text-transform: uppercase !important;
}

.kebab-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--text-dark, #0f172a) !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: background 0.15s, color 0.15s !important;
    box-sizing: border-box !important;
}

.kebab-item:hover,
.kebab-item.active {
    background: var(--input-bg, #f1f5f9) !important;
    color: var(--primary-blue, #1e5eff) !important;
}

.kebab-item.active {
    font-weight: 700 !important;
}

.kebab-divider {
    height: 1px !important;
    background: var(--border-color, #e2e8f0) !important;
    margin: 4px 0 !important;
}

.kebab-btn-danger {
    color: #ef4444 !important;
}

.kebab-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* RESPONSIVE HIDING/SHOWING OF TOPBAR ON MOBILE (<= 768px) */
@media screen and (max-width: 768px) {
    .brand>div:first-child,
    .brand-badge,
    .brand-logo-container {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        padding: 3px !important;
        border-radius: 7px !important;
    }

    .brand h2 {
        font-size: 13px !important;
    }

    .brand p {
        font-size: 10px !important;
    }

    .desktop-menu-bar,
    .desktop-user-actions {
        display: none !important;
    }

    .mobile-kebab-container {
        display: block !important;
    }
}