@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #facc15;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Utility Classes */
.bg-dark {
    background-color: var(--dark) !important;
}

.bg-light {
    background-color: var(--light) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-white {
    color: var(--white) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.section-padding {
    padding: 80px 0;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.opacity-90 {
    opacity: 0.9;
}

.text-center {
    text-align: center !important;
}


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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}


a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Nav */
header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05), rgba(6, 182, 212, 0.05), rgba(245, 158, 11, 0.03));
    pointer-events: none;
}

header .container {
    position: relative;
    z-index: 1;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 90px;
    gap: 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.logo:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Logo image wrapper — crops out white borders dynamically */
.logo-img-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    flex-shrink: 0;
}

.logo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.42); /* Zooms in 42% to completely crop out the solid white background border */
    transition: var(--transition);
}

.logo:hover .logo-img-wrap {
    border-color: var(--primary-light);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.logo:hover .logo-img-wrap img {
    transform: scale(1.52);
}

.mobile-brand {
    display: none;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.3px;
    line-height: 1.2;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 18px;
    font-size: 1.05rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-links a.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    font-weight: 600;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 240px;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    pointer-events: none;
}

/* Desktop Hover Interaction */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(5px);
        pointer-events: all;
    }
    
    .dropdown:hover .dropdown-toggle i {
        transform: rotate(180deg);
    }
}

.dropdown.active-dropdown .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
    pointer-events: all;
}

.dropdown-menu li {
    margin-bottom: 4px;
}

.dropdown-menu li:last-child {
    margin-bottom: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    gap: 12px;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    transform: translateX(4px);
}

.dropdown-menu a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.6;
}

.dropdown-menu a:hover i {
    opacity: 1;
    color: var(--primary-light);
}

.auth-btns {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 10px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.logout-link {
    color: #f87171;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(248, 113, 113, 0.1);
    transition: var(--transition);
}

.logout-link:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #ef4444;
}

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

/* Hero Section */
.hero {
    padding: 30px 0 40px;
    min-height: 70vh;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 64px;
}

.hero-content {
    max-width: 640px;
}

.hero-content h1 {
    font-size: clamp(3rem, 5vw, 4.6rem);
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 560px;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 560px;
    padding: 0;
}

.hero-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(99, 102, 241, 0.12));
    opacity: 1;
    border-radius: 32px;
    z-index: -1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 32px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
    transform: none;
    transition: var(--transition);
}

.hero-image img:hover {
    transform: translateY(-4px);
}

/* Cards */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.card:hover {
    transform: translateY(-10px);
}

.card-image {
    width: 100%;
    height: 180px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card-image img {
    transform: scale(1.1);
}

.card-link {
    margin-top: 15px;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.card:hover .card-link {
    gap: 12px;
}

/* CTA Section */
.cta-section {
    padding: 72px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.cta-card {
    max-width: 980px;
    margin: 0 auto;
    padding: 56px 48px;
    border-radius: 32px;
    text-align: center;
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
}

.cta-card h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    margin-bottom: 18px;
    font-weight: 800;
}

.cta-card p {
    font-size: 1.15rem;
    max-width: 780px;
    margin: 0 auto 34px;
    opacity: 0.95;
}

.cta-btn {
    background: var(--white);
    color: var(--primary);
    font-size: 1.05rem;
    padding: 14px 34px;
    box-shadow: 0 14px 30px rgba(255, 255, 255, 0.18);
}

.cta-btn:hover {
    background: #f8fafc;
    color: var(--primary-dark);
}

/* Resources & Research Tables */
.resource-section {
    padding: 28px 0 64px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.resource-header {
    text-align: center;
    margin-bottom: 18px;
}

.resource-header-spaced {
    margin-top: 28px;
}

.resource-kicker {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.6px;
}

.resource-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    color: var(--dark);
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.resource-header p {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.6;
}

.resource-table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    margin-bottom: 40px;
}

.resource-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.resource-table th {
    background: #f8fafc;
    color: var(--text-muted);
    padding: 16px 24px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid #e2e8f0;
}

.resource-table td {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.resource-table tr:last-child td {
    border-bottom: none;
}

.resource-table tbody tr:hover td {
    background: #fdfdfd;
}

.resource-table td:first-child {
    font-weight: 700;
    color: var(--primary);
    width: 25%;
}

.resource-table a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.resource-table a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.resource-table a::after {
    content: '\f35d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    opacity: 0.3;
}

.resource-table a:hover::after {
    opacity: 1;
}

/* Forms */
.form-container {
    background: var(--white);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 50px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #EEE;
    border-radius: 10px;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 80px 0 40px;
    margin-top: 100px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
    margin-bottom: 60px;
}

footer h4 {
    color: white;
    margin-bottom: 25px;
    font-weight: 700;
}

footer ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

footer ul a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

footer ul a:hover {
    color: white;
}

footer p {
    line-height: 1.6;
    margin-bottom: 30px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.newsletter-form {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 12px;
}

.newsletter-form input {
    background: transparent;
    border: none;
    padding: 12px 15px;
    color: white;
    flex: 1;
    outline: none;
}

.newsletter-form .btn {
    padding: 10px 20px;
    border-radius: 10px;
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Dashboard Styles */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--white);
    padding: 30px;
    border-right: 1px solid #EEE;
}

.main-content {
    flex: 1;
    padding: 40px;
}

.dashboard-header {
    background: transparent;
    box-shadow: none;
    padding: 0;
    position: static;
    margin-bottom: 40px;
}

.dashboard-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.dashboard-intro h1 {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    line-height: 1.1;
    margin-bottom: 8px;
}

.dashboard-intro p {
    color: var(--text-muted);
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 40px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon-primary {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
}

.stat-icon-secondary {
    background: rgba(0, 206, 201, 0.1);
    color: var(--secondary);
}

.stat-icon-accent {
    background: rgba(250, 177, 160, 0.1);
    color: var(--accent);
}

.dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 30px;
}

.dashboard-panel {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
}

.chart-wrap {
    position: relative;
    width: 100%;
    min-height: 250px;
}

.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.dashboard-tips-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--primary);
    font-weight: 600;
}

.stat-card {
    background: var(--white);
    padding: 22px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-details h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-details p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Panel header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.panel-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.panel-header .view-all {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}

.panel-header .view-all:hover {
    color: var(--primary-dark);
}

/* Child list items */
.child-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    margin-bottom: 12px;
    transition: var(--transition);
}

.child-item:last-child {
    margin-bottom: 0;
}

.child-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.child-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    flex-shrink: 0;
}

.child-info {
    flex: 1;
    min-width: 0;
}

.child-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 3px;
    color: var(--text-main);
}

.child-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--white);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Empty state */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Quick actions grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
    text-align: center;
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
    cursor: pointer;
}

.quick-action-item i {
    font-size: 1.4rem;
    color: var(--primary);
    transition: var(--transition);
}

.quick-action-item:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.2);
}

.quick-action-item:hover i {
    color: var(--white);
}



/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeIn 0.8s ease forwards;
}

.mobile-bottom-nav {
    display: none;
}

.mobile-more-btn {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.mobile-more-menu {
    display: none;
}

@media (max-width: 768px) {

    /* Fix card image margins on career counselling page */
    .career-counselling .card .card-image {
        margin: 0 !important;
        border-radius: var(--radius) !important;
    }

    /* Ensure cards stack and take full width */
    .career-counselling .grid {
        grid-template-columns: 1fr !important;
    }

    /* Adjust modal width for mobile */
    .modal-content {
        width: 95% !important;
        max-width: 400px !important;
    }

    /* Additional mobile fixes */
    .hero-image img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }

    .resource-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .resource-table th,
    .resource-table td {
        white-space: nowrap;
    }

    header {
        padding: 10px 0;
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 1000;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hero {
        padding: 15px 0 30px;
        text-align: center;
        min-height: auto;
    }

    .hero .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 32px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 24px;
    }

    .hero-content h1 {
        font-size: clamp(1.8rem, 8vw, 2.4rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
        width: 100% !important;
        overflow-wrap: break-word;
    }

    .hero-content h1 span {
        display: block !important;
    }

    .hero-content p {
        margin: 0 auto 20px !important;
        font-size: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        line-height: 1.5;
    }

    .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        text-align: center !important;
        overflow: hidden;
    }

    .hero-image {
        min-height: auto;
        width: 100%;
    }

    .hero-image img {
        height: 190px;
        max-width: 100%;
        width: 100%;
    }

    .hero-content>div {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px !important;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-content>div .btn {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .cta-section {
        padding: 56px 0;
    }

    .cta-card {
        padding: 38px 24px;
        border-radius: 24px;
    }

    .cta-card p {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .cta-btn {
        width: 100%;
        max-width: 240px;
    }

    .resource-section {
        padding: 20px 0 52px;
    }

    .resource-header {
        margin-bottom: 18px;
    }

    .resource-header-spaced {
        margin-top: 22px;
    }

    .resource-table th,
    .resource-table td {
        padding: 15px 18px;
    }

    .nav-links {
        display: none;
    }

    header {
        background: linear-gradient(135deg, rgba(7, 16, 32, 0.99), rgba(20, 32, 61, 0.99));
        padding: 10px 0;
    }

    nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0;
        min-height: 58px;
        width: 100%;
        padding: 0;
    }

    .auth-btns {
        display: none;
    }

    .mobile-more-btn {
        display: none !important;
        margin-left: 8px;
        width: 44px;
        height: 44px;
        padding: 0;
        flex: 0 0 44px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: var(--white);
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 100001;
        /* Higher than backdrop and menu so it stays clickable */
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-more-btn.active {
        display: none !important;
        background: var(--secondary);
        color: #0f172a;
        border-color: var(--secondary);
        transform: rotate(90deg);
    }

    .btn {
        padding: 9px 16px;
        font-size: 0.86rem;
    }

    .logo-img-wrap {
        height: 54px;
        width: 54px;
        flex: 0 0 54px;
        border-radius: 50%;
        overflow: hidden;
        border: 2px solid rgba(255,255,255,0.2);
        background: transparent;
        box-shadow: none;
    }

    .logo-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transform: scale(1.42);
    }

    .logo {
        width: min(100%, 318px);
        min-height: 58px;
        padding: 8px 18px;
        border-radius: 999px;
        flex: 0 1 318px;
        gap: 10px;
        justify-content: flex-start;
        min-width: 0;
        background: linear-gradient(135deg, rgba(35, 63, 86, 0.84), rgba(63, 66, 96, 0.84));
        border: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.16);
        display: flex;
        align-items: center;
    }

    .mobile-brand {
        display: block;
        flex: 0 1 auto;
        color: var(--white);
        font-size: 1.12rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        line-height: 1.2;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        min-width: 0;
    }

    .logout-link {
        padding: 8px 0;
        font-size: 0.88rem;
    }

    .mobile-more-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
        background: #0f172a;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.5);
        z-index: 100000;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
    }

    .mobile-more-menu.open {
        transform: translateY(0);
        visibility: visible;
    }

    /* Backdrop for the bottom sheet */
    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 99999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
        margin: 10px 0;
    }

    .mobile-more-menu a {
        color: rgba(255, 255, 255, 0.9);
        padding: 14px 16px;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 14px;
        transition: background 0.2s;
    }

    .mobile-more-menu a i {
        width: 24px;
        text-align: center;
        font-size: 1.1rem;
        color: var(--secondary);
    }

    .mobile-more-menu a:active {
        background: rgba(255, 255, 255, 0.08);
    }

    .mobile-menu-auth {
        color: var(--secondary) !important;
    }

    .mobile-menu-logout {
        color: #ff4757 !important;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 10px 4px calc(12px + env(safe-area-inset-bottom));
        background: #0f172a;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
        z-index: 1100;
        width: 100%;
    }

    .mobile-bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: rgba(255, 255, 255, 0.6);
        font-size: 0.6rem;
        font-weight: 500;
        padding: 4px 1px;
        border-radius: 8px;
        min-width: 0;
        flex: 1;
        text-align: center;
        transition: all 0.2s;
    }

    .mobile-bottom-nav__item.active {
        color: var(--secondary);
    }

    .mobile-bottom-nav__item i {
        font-size: 1.1rem;
        margin-bottom: 2px;
    }

    .mobile-bottom-nav__item.active i {
        transform: translateY(-2px);
    }

    .mobile-bottom-nav__item:hover,
    .mobile-bottom-nav__item:focus-visible {
        color: var(--white);
        background: rgba(255, 255, 255, 0.08);
    }

    body {
        padding-bottom: 100px;
    }

    .footer-grid {
        text-align: center;
        gap: 40px;
    }

    .footer-grid>div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-grid h4 {
        margin-bottom: 15px;
        text-align: center;
    }

    .footer-grid ul {
        align-items: center;
        margin-bottom: 20px;
    }

    .social-links {
        justify-content: center;
        margin-bottom: 20px;
    }

    .newsletter-form {
        width: 100%;
    }

    .footer-bottom {
        justify-content: center;
        text-align: center;
    }

    .resource-table td:first-child {
        width: 35%;
        font-size: 0.85rem;
    }

    .resource-table td {
        font-size: 0.85rem;
    }

    .auth-btns .btn {
        white-space: nowrap;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #EEE;
    }

    .main-content {
        padding: 20px;
    }

    .dashboard-header {
        margin-bottom: 28px;
    }

    .dashboard-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-actions .btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .dashboard-stats {
        margin-bottom: 28px;
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }

    .dashboard-panel {
        padding: 20px;
    }

    .chart-wrap {
        min-height: 220px;
    }

    .sidebar ul {
        gap: 8px;
    }

    /* --- CONSOLIDATED MOBILE AUDIT FIXES (320px - 768px) --- */

    /* 1. Global Reset & Layout */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .container {
        padding: 0 20px;
        width: 100%;
        max-width: 100%;
    }

    /* 2. Navigation Fixes */
    header {
        padding: 10px 0;
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .logo {
        width: min(100%, 418px);
        min-height: 58px;
        padding: 8px 18px;
        border-radius: 999px;
        gap: 10px;
        background: linear-gradient(135deg, rgba(35, 63, 86, 0.84), rgba(63, 66, 96, 0.84));
        border: 1px solid rgba(255, 255, 255, 0.14);
    }

    .mobile-brand {
        font-size: 5.12rem;
        -webkit-line-clamp: 2;
        max-width: 190px;
        margin-left: 20px;
    }

    .mobile-more-btn {
        display: none !important;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        margin-left: 5px;
        position: relative;
        z-index: 9999;
        cursor: pointer;
    }

    /* 3. Dashboard & Sidebar */
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        display: none !important;
        /* Hide sidebar as we have mobile bottom nav */
    }

    .main-content {
        padding: 20px 15px;
        width: 100%;
    }

    .dashboard-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .dashboard-panels {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    /* 4. Grid & Component Overrides */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Override all 2-col inline grids */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns: 1.1fr 0.9fr"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(350px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Override large inline paddings */
    section[style*="padding: 140px"],
    section[style*="padding: 160px"],
    section[style*="padding: 100px"] {
        padding: 50px 0 !important;
    }

    /* 5. Typography */
    h1 {
        font-size: clamp(1.8rem, 8vw, 2.4rem) !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: clamp(1.5rem, 6vw, 1.8rem) !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    p {
        font-size: 0.95rem !important;
    }

    /* 6. Forms & Inputs */
    .form-container {
        padding: 25px 15px !important;
        border-radius: 20px;
        width: 100%;
    }

    .form-control,
    select,
    input {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* 7. Tables */
    .resource-table,
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    /* 8. Hero Sections */
    .hero .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 15px;
    }

    .hero-content h1 span {
        display: block !important;
    }

    .hero-content>div {
        max-width: 100% !important;
        padding: 0 10px;
    }

    .hero-image img {
        height: auto !important;
        max-height: 250px;
        object-fit: contain;
    }

    /* 9. Bottom Nav Scaling (320px support) */
    .mobile-bottom-nav__item span {
        font-size: 0.58rem !important;
        letter-spacing: -0.02em;
    }
}

/* 10. About Page Mobile Fixes */
@media (max-width: 768px) {
    .about-hero {
        padding: 80px 0 40px !important;
    }

    .about-flex-row {
        gap: 30px !important;
    }

    .about-flex-row h2 {
        font-size: 2rem !important;
    }

    .grid div.card[style*='padding: 50px'] {
        padding: 30px !important;
    }
}

/* ================================================
   GLOBAL RESPONSIVE FIXES
   ================================================ */

/* 1. Career Counselling grid - 4 cols → 2 → 1 */
.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
}

@media (max-width: 992px) {
    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* 2. Career Counselling card images on mobile */
@media (max-width: 576px) {
    .card-image {
        height: 140px !important;
    }
}

/* 3. Psychology Section */
.psychology-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.learning-style-card {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .psychology-section {
        padding: 40px 0 !important;
    }

    .psychology-cards {
        grid-template-columns: 1fr !important;
    }

    .learning-style-card {
        grid-column: span 1 !important;
    }

    /* Form padding */
    #psychology-form {
        padding: 20px !important;
    }

    /* Container padding */
    .psychology-section .container {
        padding: 0 15px !important;
    }

    /* Form action buttons stacked on mobile */
    #psychology-form>div[style*="flex"] {
        flex-direction: column !important;
    }

    #psychology-form>div[style*="flex"]>* {
        width: 100% !important;
        text-align: center !important;
    }
}

/* 4. Career Counselling card modal */
@media (max-width: 576px) {
    #cardModal .modal-content {
        padding: 24px 16px !important;
        width: 95% !important;
    }
}

/* 5. CTA Section on mobile */
@media (max-width: 576px) {
    .cta-card {
        padding: 32px 20px !important;
    }
}

/* 6. Psychology Analysis standalone page */
@media (max-width: 768px) {
    .psychology-section h1.section-title {
        font-size: 1.8rem !important;
        margin-bottom: 20px !important;
    }
}

/* 7. Fix overflow on all pages (Mobile Only) */
@media (max-width: 768px) {

    section,
    .container {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* --- MODAL SYSTEM --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 32px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary) !important;
    transform: rotate(90deg);
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
}

.modal input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
}

.modal input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* ============================================================
   DESKTOP OPTIMIZATIONS (min-width: 1024px)
   ============================================================ */
@media (min-width: 1024px) {
    .container {
        max-width: 1280px;
        padding: 0 40px;
    }

    /* Navbar - compact desktop style */
    nav {
        gap: clamp(12px, 1.4vw, 24px);
    }

    .nav-links {
        gap: clamp(8px, 1.8vw, 24px);
        padding: 0;
        overflow: visible;
    }

    .nav-links a {
        font-size: clamp(0.98rem, 1.22vw, 1.22rem);
        padding: 10px clamp(10px, 1vw, 18px);
    }

    /* Hero */
    .hero {
        padding: 100px 0 120px;
    }

    .hero-content h1 {
        font-size: 4.5rem !important;
        margin-bottom: 30px !important;
    }

    .hero-image img {
        transform: perspective(1000px) rotateY(-5deg);
        box-shadow: -20px 20px 60px rgba(15, 23, 42, 0.25);
    }

    .hero-image img:hover {
        transform: perspective(1000px) rotateY(0deg) scale(1.02);
    }

    /* Grid */
    .grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
    }

    .card {
        padding: 40px 32px;
        border: 1px solid rgba(0, 0, 0, 0.03);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.04);
    }

    .card:hover {
        box-shadow: 0 40px 80px rgba(99, 102, 241, 0.12);
        transform: translateY(-12px);
    }

    /* Dashboard */
    .dashboard-layout {
        background: #f8fafc;
    }

    .sidebar {
        width: 300px;
        padding: 40px 30px;
        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.02);
    }

    .main-content {
        padding: 50px 60px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
    }

    .dashboard-panels {
        grid-template-columns: 2fr 1fr;
        gap: 45px;
    }

    .dashboard-panel {
        padding: 45px;
        border: 1px solid rgba(0, 0, 0, 0.02);
    }

    /* CTA */
    .cta-card {
        padding: 100px 80px;
    }

    .section-title {
        margin-bottom: 70px;
    }
}

/* TABLET GRACEFUL DEGRADATION */
@media (min-width: 768px) and (max-width: 1023px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .dashboard-layout {
        display: block;
    }
}


/* ============================================================
   SUB-PAGE DESKTOP POLISH (min-width: 1024px)
   ============================================================ */
@media (min-width: 1024px) {

    /* Feature Grid for sub-pages */
    .feature-grid,
    .programs-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 50px;
        margin-top: 60px;
    }

    /* Professional Form Layouts */
    .form-container {
        max-width: 540px;
        margin: 100px auto;
        padding: 60px;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Hero Section for sub-pages */
    .sub-hero {
        padding: 120px 0 80px;
    }

    /* DMIT specific desktop scaling */
    .dmit-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 60px;
    }

    /* Admin Sidebar Desktop Stability */
    .admin-layout {
        display: flex;
    }

    .admin-sidebar {
        width: 280px;
        flex-shrink: 0;
        background: #1e293b;
        color: white;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .admin-main {
        flex: 1;
        padding: 50px;
        background: #f1f5f9;
    }

    /* FINAL MASTER POLISH */
    .admin-stats-grid,
    .dashboard-stats {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 30px !important;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 25px !important;
    }

    /* Standardized Desktop Spacing */
    main.main-content {
        padding-bottom: 120px !important;
    }
}

/* ============================================================
   APP MOBILE VIEW STABILITY
   ============================================================ */
.app-mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --app-mobile-nav-height: 78px;
    }

    body {
        min-width: 0;
        padding-bottom: calc(var(--app-mobile-nav-height) + env(safe-area-inset-bottom));
    }

    .dashboard-layout {
        display: block !important;
        min-height: 100vh;
        width: 100%;
        overflow-x: hidden;
        background: #f8fafc;
    }

    .dashboard-layout .sidebar {
        display: none !important;
    }

    .dashboard-layout .main-content,
    main.main-content {
        width: 100%;
        max-width: 100%;
        padding: 18px 14px calc(var(--app-mobile-nav-height) + 28px) !important;
        overflow-x: hidden;
    }

    .dashboard-layout header,
    .dashboard-header {
        margin-bottom: 22px !important;
        overflow: visible;
    }

    .dashboard-layout header>div,
    .dashboard-header-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        width: 100%;
    }

    .dashboard-intro,
    .dashboard-layout header>div>div {
        min-width: 0;
    }

    .dashboard-layout h1,
    .dashboard-intro h1 {
        font-size: clamp(1.65rem, 8vw, 2.15rem) !important;
        line-height: 1.15 !important;
        overflow-wrap: anywhere;
    }

    .dashboard-actions,
    .dashboard-layout header form,
    #childSelectorForm {
        width: 100%;
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-actions .btn,
    .dashboard-layout header .btn,
    #childSelectorForm select {
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: center;
        text-align: center;
    }

    .dashboard-stats.grid,
    .dashboard-stats,
    .dashboard-panels,
    .quick-actions-grid,
    .dashboard-layout .grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100%;
    }

    .dashboard-panel,
    .stat-card,
    .dashboard-layout .card,
    .dashboard-layout .form-container,
    .dashboard-layout main>div[style*="background: var(--white)"],
    .dashboard-layout main>div[style*="display: grid"]>div {
        max-width: 100%;
        border-radius: 18px !important;
        padding: 20px !important;
    }

    .stat-card {
        align-items: center;
        gap: 14px;
    }

    .panel-header {
        align-items: flex-start;
        gap: 10px;
    }

    .child-item {
        padding: 12px;
        gap: 12px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .quick-action-item {
        min-height: 94px;
        padding: 14px 8px;
        word-break: break-word;
    }

    .dashboard-layout table {
        min-width: 640px;
    }

    .dashboard-layout main>div[style*="overflow: hidden"]:has(table),
    .resource-table-container {
        width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .chart-wrap,
    .dashboard-layout canvas {
        max-width: 100%;
    }

    .app-mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        min-height: var(--app-mobile-nav-height);
        padding: 9px 4px calc(10px + env(safe-area-inset-bottom));
        background: #0f172a;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.28);
        z-index: 20000;
    }

    .app-mobile-nav__item {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 5px 2px;
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.66);
        font-size: 0.62rem;
        font-weight: 700;
        text-align: center;
    }

    .app-mobile-nav__item i {
        font-size: 1.08rem;
    }

    .app-mobile-nav__item.active {
        color: var(--secondary);
        background: rgba(6, 182, 212, 0.1);
    }

    .app-mobile-nav__item--danger {
        color: #fca5a5;
    }

    .mobile-more-btn {
        display: none !important;
        z-index: 100001;
    }

    .modal {
        padding: 16px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-content {
        width: min(100%, 420px) !important;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding: 28px 18px !important;
        border-radius: 22px !important;
        margin: auto 0;
    }

    .hero-content {
        overflow: visible !important;
    }

    .hero-content h1 {
        max-width: 342px;
        margin-left: auto !important;
        margin-right: auto !important;
        font-size: clamp(1.72rem, 7.2vw, 2.05rem) !important;
    }

    .hero-content p {
        max-width: 342px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .hero-content>div {
        width: 100% !important;
        max-width: 342px !important;
        padding: 0 !important;
    }

    .hero-content>div .btn {
        width: 100% !important;
        max-width: 342px;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 0 14px;
    }

    .mobile-brand {
        max-width: 110px;
        font-size: 0.85rem;
    }

    .logo img {
        height: 50px;
        width: 50px;
        padding: 3px;
    }

    .mobile-more-btn {
        display: none !important;
        z-index: 100001;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr !important;
    }

    .app-mobile-nav__item span {
        font-size: 0.56rem;
    }

    .hero-content h1,
    .hero-content p,
    .hero-content>div,
    .hero-content>div .btn {
        max-width: 312px !important;
    }
}

/* ============================================================
   DESKTOP HEADER CLIPPING FIX
   ============================================================ */
@media (min-width: 769px) {
    header .container {
        max-width: 100%;
        padding: 0 clamp(24px, 3vw, 60px);
    }

    nav {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: clamp(12px, 1.4vw, 24px);
    }

    .logo,
    .auth-btns {
        flex: 0 0 auto;
    }

    .nav-links {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        justify-content: center;
        gap: clamp(8px, 1.8vw, 24px);
        padding: 0;
        overflow: visible;
    }

    .nav-links li {
        flex: 0 0 auto;
    }

    .nav-links a {
        padding: 10px clamp(10px, 1vw, 18px);
        font-size: clamp(0.98rem, 1.22vw, 1.22rem);
    }

    .auth-btns .btn {
        padding: 14px clamp(20px, 1.8vw, 34px);
        white-space: nowrap;
    }
}

@media (min-width: 769px) and (max-width: 1180px) {
    .logo img {
        height: 36px;
    }

    .auth-btns .btn {
        padding: 12px 18px;
        font-size: 0.9rem;
    }
}

/* About page top spacing fix */
.about-hero {
    padding: 64px 0 84px !important;
}

.about-flex-row img {
    display: block;
    width: min(100%, 520px) !important;
    height: 340px !important;
    margin: 0 auto;
    object-fit: cover;
    object-position: center;
}

.about-flex-row>div:last-child {
    display: flex;
    justify-content: center;
}

.career-hero-image {
    display: flex;
    justify-content: center;
}

.career-hero-image img {
    width: min(100%, 760px) !important;
    height: 300px !important;
    object-fit: cover;
    object-position: center 38%;
    border-radius: 18px !important;
}

@media (max-width: 768px) {
    .about-hero {
        padding: 42px 0 56px !important;
    }

    .about-flex-row img {
        width: 100% !important;
        height: 240px !important;
        border-radius: 24px !important;
    }

    .hero .container {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .hero-image {
        width: 100% !important;
        margin: 0 !important;
        min-height: auto !important;
        background: none !important;
    }

    .hero-image::before {
        display: none !important;
    }

    .hero-image img {
        width: 100% !important;
        height: 380px !important;
        object-fit: cover !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: block !important;
    }

    .career-hero-image img {
        width: 100% !important;
        height: 210px !important;
        border-radius: 16px !important;
    }

    .section-padding {
        padding: 40px 0 !important;
    }
}

/* Home page gap fix */
@media (min-width: 769px) {
    .hero {
        min-height: auto !important;
        padding: 72px 0 28px !important;
    }

    .hero-image {
        height: clamp(420px, 38vw, 560px);
        min-height: 0 !important;
    }

    .hero-image img {
        height: 100% !important;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-bottom: 18px !important;
    }
}

/* Service Grid Custom Styles */
.service-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
}

@media (max-width: 992px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .service-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Home Tuition Page Styles */
.ht-hero {
    padding: 120px 0 80px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.1), transparent 40%);
}

.flow-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 60px 0;
    position: relative;
}

.flow-container::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    z-index: 0;
}

.flow-step {
    text-align: center;
    position: relative;
    z-index: 1;
}

.flow-icon {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: var(--primary);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
    border: 2px solid var(--primary-light);
    transition: var(--transition);
}

.flow-step:hover .flow-icon {
    transform: translateY(-5px);
    background: var(--primary);
    color: var(--white);
}

.flow-step h4 {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.flow-step p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.ht-program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.ht-card {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: var(--transition);
}

.ht-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: var(--primary-light);
}

.ht-benefit-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.ht-benefit-icon {
    width: 50px;
    height: 50px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

@media (max-width: 992px) {
    .flow-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .flow-container::before {
        display: none;
    }
    .flow-step {
        display: flex;
        text-align: left;
        gap: 20px;
        align-items: center;
    }
    .flow-icon {
        margin: 0;
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
}

/* ============================================================
   MOBILE MENU (NEW DESIGN)
   ============================================================ */
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.mobile-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.mobile-more-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px 32px 0 0;
    z-index: 1002;
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-more-menu.open {
    bottom: 0;
}

.mobile-menu-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 12px auto;
}

.mobile-menu-content {
    padding: 0 24px 40px;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 10px;
}

.mobile-menu-header .logo-img-wrap {
    height: 68px;
    width: 68px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.mobile-menu-header .logo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.42);
}

.mobile-menu-header span {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.mobile-more-menu a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-more-menu a:active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.mobile-more-menu a i {
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
    opacity: 0.6;
}

.mobile-menu-section {
    padding: 20px 10px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-light);
    opacity: 0.8;
}

.mobile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 15px 10px;
}

.mobile-menu-logout {
    color: #f87171 !important;
}

.mobile-menu-auth {
    background: var(--primary);
    color: var(--white) !important;
    justify-content: center;
    margin-top: 10px;
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 991px) {
    .nav-links {
        display: none !important;
    }

    .auth-btns .btn {
        display: none !important;
    }

    .auth-btns .logout-link {
        display: none !important;
    }

    nav {
        min-height: 76px;
    }

    .logo {
        padding: 4px 14px 4px 4px;
        background: rgba(255, 255, 255, 0.07);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 50px;
        gap: 10px;
        display: flex;
        align-items: center;
    }

    .logo-img-wrap {
        height: 54px;
        width: 54px;
        flex: 0 0 54px;
        border-radius: 50%;
        overflow: hidden;
        border: 2px solid rgba(255,255,255,0.25);
        background: transparent;
        box-shadow: none;
    }

    .logo-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transform: scale(1.42);
    }

    .mobile-brand {
        display: block !important;
        font-size: 1.05rem;
        font-weight: 800;
        letter-spacing: -0.3px;
        color: var(--white);
        max-width: 145px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-more-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        color: var(--white);
        font-size: 1.2rem;
        cursor: pointer;
        transition: var(--transition);
    }

    .mobile-more-btn:active {
        transform: scale(0.92);
        background: rgba(255, 255, 255, 0.1);
    }
}

@media (min-width: 992px) {
    .mobile-more-btn {
        display: none !important;
    }
}
