:root {
    /* Color Palette from Image */
    --primary-indigo: #4f46e5;
    --primary-hover: #4338ca;
    --active-red: #e11d48;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --header-bg: #ffffff;
    --ticker-bg: #eff6ff;
    --ticker-text: #3b82f6;
    --card-bg: #ffffff;
    --border-light: #e2e8f0;

    /* Layout Tokens */
    --radius-lg: 24px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;

    /* Device Specific Tokens */
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Cross-Browser & Mobile Normalization --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

input,
button,
select,
textarea {
    font-family: inherit;
}

/* Remove default focus ring in some browsers and replace with custom */
:focus-visible {
    outline: 2px solid var(--primary-indigo);
    outline-offset: 2px;
}

/* Firefox button padding fix */
button::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Hide scrollbar but keep functionality if needed */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Floating Scroll Button */
.scroll-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    background: var(--primary-indigo);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-btn.visible {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    background: #2563eb;
}

.scroll-btn svg {
    width: 24px;
    height: 24px;
}

/* --- Cookie Consent Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 40px);
    max-width: 600px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
    opacity: 0;
}

.cookie-banner.active {
    transform: translateX(-50%) translateY(0);
    visibility: visible;
    opacity: 1;
}

.cookie-content {
    flex: 1;
}

.cookie-content h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.cookie-content p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.cookie-actions {
    display: flex;
    gap: 12px;
}

.btn-cookie-accept {
    background: var(--primary-indigo);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-cookie-accept:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        bottom: 20px;
        padding: 20px;
    }

    .cookie-actions {
        width: 100%;
    }

    .btn-cookie-accept {
        width: 100%;
    }
}

/* Global reset merged into top level '*' selector */

html {
    /* Removed overflow-x: hidden to ensure sticky/fixed behavior works correctly */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 3rem);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Fluid Typography */
h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
        /* Reduced from 4rem to fix mobile clipping */
    }
}

/* Sticky Header Container (Navbar Only) */
.sticky-header-container {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Header & Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

/* Global Input Placeholders */
input::placeholder,
textarea::placeholder {
    color: #cbd5e1 !important;
    opacity: 1;
    font-weight: 400;
}

.navbar a:hover {
    color: #2563eb;
}

.navbar a.active {
    color: #2563eb !important;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 8px;
}

/* Drawer Header (Hidden on Desktop) */
.drawer-header {
    display: none;
}

/* Navigation Menu Desktop Styling */
#navMenu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Ticker Bar */
.ticker-wrap {
    background: var(--ticker-bg);
    padding: 0;
    font-weight: 600;
    color: var(--ticker-text);
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
    box-sizing: border-box;
}


/* Buttons */
.btn {
    background: var(--primary-indigo);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Action/Details Buttons (Tables) */
.btn-details {
    background: #0ea5e9;
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    /* Prevents wrapping on mobile */
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-details:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Cards & Containers */
.glass-panel,
.search-card,
.glass-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(1.25rem, 5vw, 2.5rem);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .perm-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {

    .data-grid,
    .perm-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Form Styling */
.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: #ffffff;
    border: 1.5px solid #f1f5f9;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    background: #fff;
    border-color: var(--primary-indigo);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

/* Job Grid */
.job-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
    /* Centers items when fewer than 4 */
    align-items: stretch;
}

@media (max-width: 1200px) {
    .job-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Package Page Styles */
.package-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-bottom: 4rem;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.package-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.package-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-indigo);
}

.package-header h3 {
    font-size: 1.25rem;
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.package-price {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    color: var(--primary-indigo);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.package-price .currency {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.6rem;
}

.package-price .amount {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -2px;
}

.package-header .duration {
    display: block;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.package-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    text-align: left;
}

.package-benefits li {
    padding: 0.75rem 0;
    color: #475569;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
}

.package-benefits li::before {
    content: "✓";
    color: #10b981;
    font-weight: 800;
    margin-right: 12px;
}

.package-section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.package-section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.package-section-title p {
    color: #64748b;
    font-size: 1.1rem;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.mt-40 {
    margin-top: 8rem;
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--primary-indigo), #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .package-grid {
        grid-template-columns: 1fr;
    }

    .package-section-title h2 {
        font-size: 2rem;
    }
}

/* --- Moto G85 & High-Density Tall Mobile Optimization --- */
@media (max-width: 480px) {
    :root {
        --radius-lg: 16px;
    }

    .container {
        padding: 0 1rem;
    }

    /* Hero Section Refinement */
    .premium-hero {
        padding: 6rem 1rem 4rem !important;
        min-height: auto !important;
    }

    .hero-tagline {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }

    .hero-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 2rem !important;
        line-height: 1.5 !important;
    }

    /* Search Card Compactness */
    .search-card-refined {
        padding: 1.25rem !important;
        margin-bottom: 2rem !important;
        border-radius: 16px !important;
    }

    .search-form-responsive {
        gap: 1rem !important;
    }

    .form-group label {
        font-size: 0.65rem !important;
        margin-bottom: 0.25rem !important;
    }

    .form-group input,
    .form-group select {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }


    /* Bottom Navigation / Safe Area */
    body {
        padding-bottom: calc(var(--safe-area-inset-bottom) + 2rem);
    }

    /* Back Button App Style */
    .back-btn-app {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        background: #f1f5f9;
        border-radius: 10px;
        color: var(--primary-indigo) !important;
        font-weight: 700;
        font-size: 0.9rem;
        text-decoration: none;
        transition: var(--transition);
    }

    .back-btn-app:active {
        transform: scale(0.95);
        background: #e2e8f0;
    }

    /* Job Details Header Optimization */
    .job-details-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .job-details-header>div:last-child {
        text-align: left !important;
        width: 100%;
    }
}

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

@media (max-width: 600px) {
    .latest-jobs-title {
        text-align: center;
    }

    .job-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 items side-by-side on mobile */
        gap: 0.75rem;
    }

    .job-card {
        padding: 0.75rem 0.5rem;
        border-radius: 12px;
    }

    .job-logo-box {
        margin-bottom: 0.75rem;
    }

    .job-institution {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }

    .job-institution-wrapper {
        height: 2rem;
    }

    .job-info-label {
        font-size: 0.6rem;
        margin-bottom: 0.1rem;
    }

    .job-info-value {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
        min-height: 1rem;
    }

    .job-card-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.65rem;
        max-width: 100%;
        margin-top: 0.5rem;
    }
}

.job-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1.5px solid #f1f5f9;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.job-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-indigo);
}

.job-logo-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    border: 1px solid #f1f5f9;
}

.job-logo-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.job-logo-placeholder {
    color: #94a3b8;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.1rem;
}

.job-institution {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    text-align: center;
}

.job-institution-wrapper {
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    width: 100%;
}

.job-info-label {
    font-size: 0.85rem;
    color: #3B7597 !important;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.job-info-value {
    font-size: 0.9rem;
    color: #5B5B5B;
    font-weight: 500;
    margin-bottom: 0.75rem;
    height: auto;
    min-height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.job-card-btn {
    margin-top: 1.25rem;
    padding: 0.3rem 0.6rem;
    background: #3f51b5;
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
    max-width: 90px;
    display: inline-block;
}

.job-card-btn:hover {
    background: #303f9f;
    box-shadow: 0 4px 10px rgba(63, 81, 181, 0.3);
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    background: transparent;
    text-align: center;
}

.footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

.footer-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-indigo);
}

.copyright {
    color: var(--ticker-text);
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Navigation & Header Responsiveness --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1010;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hamburger Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1030;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--primary-indigo);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
        position: relative;
        right: 0;
    }

    #navMenu {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 0;
        /* Changed from 80px 2rem 2rem to allow for header */
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1020;
        transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        gap: 0;
        overflow-y: auto;
    }

    .drawer-header {
        width: 100%;
        padding: 1.5rem 2rem;
        background: #f8fafc;
        border-bottom: 1px solid #f1f5f9;
        display: flex;
        align-items: center;
        margin-bottom: 1rem;
    }

    .drawer-logo img {
        height: 65px;
        width: auto;
    }

    #navMenu.active {
        left: 0;
    }

    #navMenu a {
        width: 100%;
        padding: 0.4rem 1.5rem;
        /* Tighter padding */
        margin: 0;
        border-bottom: 1px solid #f1f5f9;
        font-size: 1rem;
        color: var(--text-main);
        transition: all 0.3s ease;
    }

    #navMenu a:hover,
    #navMenu a.active {
        padding-left: 2rem;
        color: #2563eb !important;
        /* Active blue */
        background: #f8fafc;
    }

    .navbar .container {
        justify-content: space-between;
        flex-direction: row;
        padding: 0 1.25rem;
    }

    .navbar {
        padding: 0.4rem 0;
    }

    /* Styles merged into previous .menu-toggle block */
}

/* Tablet Optimizations (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        width: 94%;
    }

    .glass-panel,
    .search-card {
        padding: 2rem;
    }

    .job-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Optimizations (< 768px) */
@media (max-width: 767px) {
    .portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .portal-title {
        font-size: 1.5rem;
    }

    .perm-matrix-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-save-modern {
        max-width: 100%;
    }
}

/* Styles merged into main .search-card-refined block at line 1970 */

.search-form-responsive {
    display: grid;
    gap: 1.5rem;
    align-items: end;
}

/* Desktop: 6 columns (5 inputs + 1 button) */
@media (min-width: 1024px) {
    .search-form-responsive {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
    }
}

/* Tablet: 3 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .search-form-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .search-form-responsive {
        grid-template-columns: 1fr;
    }

    .search-card-refined {
        padding: 1.5rem !important;
        margin-bottom: 3rem !important;
    }
}

/* --- Global Grid System --- */
.form-grid-6,
.form-grid-3,
.form-grid-2 {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1200px) {
    .form-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .form-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .form-grid-6,
    .form-grid-3,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Portal Header System */
.portal-header {
    background: #fff;
    padding: 2.25rem 2.5rem;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.portal-title {
    font-size: clamp(1.5rem, 5vw, 1.85rem);
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.portal-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

.portal-badge {
    background: #eff6ff;
    color: #4f46e5;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.025em;
}

/* 📱 Responsive Grid Spans */
.span-full {
    grid-column: 1 / -1;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

@media (max-width: 768px) {

    .span-2,
    .span-3 {
        grid-column: 1 / -1;
    }
}


/* 🛡️ Permissions Matrix Refined Styles */
.perm-matrix-header {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4f46e5;
    padding-left: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.perm-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.perm-matrix-box {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.perm-matrix-title {
    font-weight: 700;
    color: #4f46e5;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 10px;
}

.perm-matrix-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #475569;
    cursor: pointer;
    transition: 0.2s;
}

.perm-matrix-item:hover {
    color: #1e293b;
}

.perm-matrix-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.btn-centered-save {
    display: flex;
    justify-content: center;
    margin-top: 3.5rem;
}

.btn-save-modern {
    background: #4f46e5;
    color: white !important;
    width: 100%;
    max-width: 280px;
    font-weight: 800;
    height: 50px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-save-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    opacity: 0.9;
}

.action-tier {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Mobile Adjustments for Portal Header */
@media (max-width: 900px) {
    .portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .portal-badge {
        width: 100%;
        text-align: center;
    }
}

/* Dynamic Experience Rows */
.dynamic-exp-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

@media (max-width: 768px) {
    .dynamic-exp-row {
        grid-template-columns: 1fr 1fr auto;
    }
}

@media (max-width: 500px) {
    .dynamic-exp-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .dynamic-exp-row button {
        justify-content: flex-start;
        padding: 5px 0;
    }
}

/* Responsive Table Wrapper */
.responsive-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2rem;
}

.responsive-table table {
    min-width: 800px;
    /* Force minimum width to trigger scroll on small screens */
}

/* Password Visibility Toggle */
.pwd-toggle-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.pwd-toggle-container input {
    padding-right: 45px !important;
}

.pwd-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 10;
    border-radius: 50%;
}

.pwd-toggle-btn:hover {
    color: var(--primary-indigo);
    background: rgba(79, 70, 229, 0.05);
}

.pwd-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* Profile Summary Card - Premium Universal Design */
.profile-summary-card {
    background: #fff;
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    margin-bottom: 3.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 3.5rem;
    align-items: center;
    transition: 0.3s;
}

.profile-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.08);
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 12px solid #f8fafc;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.profile-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #cbd5e1;
    font-weight: 800;
    border: 12px solid #f8fafc;
}

.role-badge {
    font-size: 0.7rem;
    font-weight: 800;
    color: #6366f1;
    background: #eef2ff;
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.profile-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 3rem;
    margin-top: 2.5rem;
    justify-content: flex-start;
}

.stat-item {
    text-align: left;
    min-width: 120px;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
    display: block;
}

.status-active {
    color: #10b981;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

/* 📊 Usage & Metrics */
.usage-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-top: 2rem;
}

.usage-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.usage-label {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.usage-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.usage-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

/* 👤 Overview Card (Admin/Associate Details) */
.overview-card {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.profile-img-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f1f5f9;
}

.profile-placeholder-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #cbd5e1;
    font-weight: 800;
}

.overview-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.overview-name {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #1e293b;
    font-weight: 800;
}

.overview-email {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.overview-stats-grid {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

@media (max-width: 992px) {
    .usage-grid {
        grid-template-columns: 1fr;
    }

    .overview-card {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .overview-header {
        justify-content: center;
        flex-direction: column;
    }

    .overview-stats-grid {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .usage-card {
        padding: 1.25rem;
    }

    .usage-label {
        font-size: 0.85rem;
    }

    .overview-name {
        font-size: 1.5rem;
    }
}

.subscription-value {
    color: #6366f1;
    font-weight: 800;
}

@media (max-width: 900px) {
    .profile-summary-card {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
        padding: 3rem 1.5rem;
    }

    .profile-summary-card>div:last-child {
        width: 100%;
    }

    .profile-header-group {
        flex-direction: column;
        gap: 1rem;
    }

    .profile-header-group h2 {
        font-size: 2rem !important;
    }

    .profile-stats-grid {
        justify-content: center;
        gap: 2rem 1rem;
    }

    .stat-item {
        text-align: center;
        flex: 0 0 28%;
        min-width: 90px;
    }

    /* Row 2 adjustment for mobile (3 items in row 1, rest in row 2) */
    .stat-item:nth-child(n+4) {
        flex: 0 0 42%;
    }
}

/* 💎 Standardized Premium Input Styling */
.theme-input {
    width: 100%;
    padding: 0.8rem 1.25rem;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    /* var(--radius-md) */
    font-size: 0.95rem;
    color: var(--text-main);
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.theme-input:focus {
    border-color: var(--primary-indigo) !important;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: #ffffff !important;
}

.theme-input::placeholder {
    color: #cbd5e1 !important;
}

/* Adjustments for Dynamic Rows */
.dynamic-exp-row {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr 1fr 40px;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: center;
}

@media (max-width: 992px) {
    .dynamic-exp-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .dynamic-exp-row {
        grid-template-columns: 1fr;
    }
}

/* 📱 Responsive Grid System & Utilities */
.grid-res-5,
.grid-res-6,
.grid-res-2 {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grid-res-5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid-res-6 {
    grid-template-columns: repeat(6, 1fr);
}

.grid-res-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Tablet Stacking (Large Tablets/Laptops) */
@media (max-width: 1200px) {
    .grid-res-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-res-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Stacking (Small Tablets) */
@media (max-width: 992px) {

    .grid-res-5,
    .grid-res-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Stacking */
@media (max-width: 640px) {

    .grid-res-5,
    .grid-res-6,
    .grid-res-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Responsive Table Wrapper */
.table-res-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.table-res-wrapper table {
    min-width: 800px;
}

/* 💎 Premium Stacked Table (Mobile Card Mode) */
@media (max-width: 768px) {
    .premium-table-res thead {
        display: none;
        /* Hide headers */
    }

    .premium-table-res tr {
        display: block;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        margin-bottom: 1.5rem;
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    }

    .premium-table-res td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
        font-size: 0.9rem;
    }

    .premium-table-res td:last-child {
        border-bottom: none;
    }

    .premium-table-res td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.05em;
        text-align: left;
    }

    .premium-table-res .btn-details {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* 💎 Premium Scrollable Table (Horizontal with Sticky Column) */
.premium-scroll-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: #fff;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.premium-scroll-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1100px;
    /* Force horizontal scroll on mobile */
}

.premium-scroll-table th,
.premium-scroll-table td {
    padding: 1.25rem 1rem;
    background: #fff;
    white-space: nowrap;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    /* Default */
    vertical-align: middle;
}

.premium-scroll-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

/* Center-aligned columns for better balance */
.premium-scroll-table th:nth-child(2),
.premium-scroll-table td:nth-child(2),
.premium-scroll-table th:nth-child(4),
.premium-scroll-table td:nth-child(4),
.premium-scroll-table th:nth-child(5),
.premium-scroll-table td:nth-child(5),
.premium-scroll-table th:nth-child(6),
.premium-scroll-table td:nth-child(6),
.premium-scroll-table th:nth-child(7),
.premium-scroll-table td:nth-child(7),
.premium-scroll-table th:last-child,
.premium-scroll-table td:last-child {
    text-align: center;
}

/* Sticky First Column (Name) */
.premium-scroll-table th:first-child,
.premium-scroll-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #fff;
    border-right: 2px solid #f1f5f9;
    text-align: left;
}

.premium-scroll-table th:first-child {
    z-index: 20;
    background: #f8fafc;
}

/* Enhanced Visual Indicator for Sticky Column */
.premium-scroll-table td:first-child::after {
    content: '';
    position: absolute;
    top: 0;
    right: -10px;
    bottom: 0;
    width: 10px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.03), transparent);
}

@media (max-width: 1024px) {

    .premium-scroll-table th,
    .premium-scroll-table td {
        padding: 1rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Utility: Full-width buttons on mobile */
@media (max-width: 600px) {
    .btn-res-full {
        width: 100% !important;
        max-width: none !important;
    }
}

/* --- Hero Banner Styles (moved from index.php) --- */
.premium-hero {
    position: relative;
    min-height: 80vh;
    background: linear-gradient(rgba(0, 13, 255, 0.4), rgba(0, 0, 0, 0.8)),
        url('../images/hero_banner.png') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 5%;
    color: white;
    text-align: center;
}

.hero-tagline {
    font-size: clamp(2rem, 8vw, 3.5rem);
    /* Fluid typography */
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out;
}

.accent-text {
    background: linear-gradient(135deg, #00D0FF, #009DFF, #000DFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 3vw, 1.25rem);
    /* Fluid typography */
    color: #e2e8f0;
    max-width: 700px;
    margin-bottom: 4rem;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out;
}

.search-card-refined {
    background: rgba(0, 13, 255, 0.05) !important;
    backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 208, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 157, 255, 0.15);
    color: white !important;
    animation: fadeInUp 1.2s ease-out;
    margin-bottom: 5rem !important;
}

@media (max-width: 768px) {
    .search-card-refined {
        margin-top: 2rem !important;
        /* Remove negative margin on mobile */
    }
}

.search-card-refined label {
    color: #00D0FF !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.search-card-refined input,
.search-card-refined select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(0, 208, 255, 0.3) !important;
    color: white !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    width: 100% !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.search-card-refined select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300D0FF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
}

.search-card-refined select option {
    background-color: #0f172a;
    color: white;
}

.search-card-refined input::placeholder {
    color: #DCDDDB !important;
    opacity: 0.9;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@media (max-width: 768px) {
    .hero-tagline {
        font-size: 2.5rem;
    }

    .premium-hero {
        min-height: auto;
        padding: 6rem 5%;
    }
}

/* --- Legal Page Styles (moved from legal.php) --- */
.legal-content-body h3 {
    color: #1e293b;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.legal-content-body p {
    margin-bottom: 1.5rem;
}

.legal-content-body strong {
    color: #4f46e5;
}

@media (max-width: 768px) {
    .glass-panel {
        padding: 2rem;
    }

    .glass-panel h1 {
        font-size: 2rem;
    }
}

/* ==========================================================================
   Premium Footer Section
   ========================================================================== */
.premium-footer {
    background: #1e293b;
    color: #f8fafc;
    padding: 5rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand .footer-logo img {
    height: 85px;
    margin-bottom: 0.75rem;
}

.footer-tagline {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 400px;
}

/* Footer Contact Styles */
.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .footer-contact-info {
        align-items: center;
    }

    .contact-item {
        justify-content: center;
    }
}

.social-links {
    display: flex;
    gap: 1rem;
}

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

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

.social-links svg {
    width: 20px;
    height: 20px;
}

.footer-links-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    color: #ffffff;
    position: relative;
}

.footer-links-group h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 2px;
    background: var(--primary-indigo);
}

.footer-links-group ul {
    list-style: none;
}

.footer-links-group ul li {
    margin-bottom: 0.85rem;
}

.footer-links-group ul li a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.92rem;
    transition: var(--transition);
    display: inline-block;
}

.footer-links-group ul li a:hover {
    color: var(--primary-indigo);
    transform: translateX(5px);
}

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

.footer-bottom p {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 500;
}

.footer-contact {
    display: flex;
    gap: 2rem;
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 600;
}

.footer-contact span {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .premium-footer {
        padding: 4rem 0 2rem;
    }

    .footer-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 2.5rem 0 !important;
        text-align: center;
    }

    .footer-brand {
        flex: 0 0 100% !important;
    }

    .footer-links-group {
        flex: 0 0 50% !important;
    }

    .footer-links-group:last-child {
        flex: 0 0 100% !important;
    }

    .footer-links-group h3 {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .footer-tagline {
        text-align: center !important;
        margin: 0 auto 1.5rem auto;
        max-width: 100%;
    }

    .footer-links-group h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-contact {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
}

/* ==========================================================================
   Premium Content Pages Responsiveness
   ========================================================================== */

/* Page Headers */
.badge {
    background: rgba(79, 102, 241, 0.1);
    color: var(--primary-indigo);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-header-section {
    padding: 6rem 0 3rem;
    text-align: center;
}

.page-header-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--primary-indigo);
}

.lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .page-header-section {
        padding: 4rem 0 2.5rem;
    }

    .page-header-section h1 {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1.1rem;
    }
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .stat-group {
        justify-content: center;
    }
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.featured-card {
    grid-column: span 3;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

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

    .featured-card {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .featured-card {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}

/* FAQ Section */
.faq-grid {
    display: grid;
    gap: 2rem;
}

@media (max-width: 768px) {
    .faq-grid {
        gap: 1.5rem;
    }

    .faq-item {
        padding: 1.5rem;
    }
}

/* Contact Grid & Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .premium-form {
        padding: 1.5rem;
    }
}

.social-icons-premium svg {
    width: 22px;
    height: 22px;
}

/* --- Consolidated Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal,
.modal-box {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.modal-overlay.active .custom-modal,
.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.modal-title,
.success-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
}

.modal-message,
.success-modal-text {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn,
.success-modal-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

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

.modal-btn-confirm,
.success-modal-btn {
    background: #4f46e5;
    color: white !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.modal-btn-confirm:hover,
.success-modal-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* --- Success Modal Specifics --- */
.success-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.success-modal-icon {
    background: #f0fdf4 !important;
    color: #22c55e !important;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem auto;
}

/* Removed unused @keyframes modalScale */

.ticker-wrap .container {
    display: flex;
    align-items: center;
}

.notice-label {
    background: #ef4444;
    color: white;
    padding: 0 15px;
    font-weight: 800;
    font-size: 0.75rem;
    height: 40px;
    display: flex;
    align-items: center;
    z-index: 20;
    flex-shrink: 0;
}

.ticker-scroll-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    min-width: 0;
    /* Critical for flex items with nowrap content */
}

.ticker-content {
    white-space: nowrap;
    padding-left: 10px;
    animation: ticker-loop 40s linear infinite;
    display: inline-flex;
    align-items: center;
}

.ticker-item {
    padding-right: 80px;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
}

@keyframes ticker-loop {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-wrap:hover .ticker-content {
    animation-play-state: paused;
}

@media (max-width: 600px) {
    .notice-label {
        padding: 0 10px;
        font-size: 0.7rem;
    }

    .ticker-item {
        font-size: 0.75rem;
        padding-right: 40px;
    }
}

/* ==========================================================================
   Browser & Mobile Compatibility Fixes
   ========================================================================== */

/* Fix for iOS Safari text size adjustment on orientation change */
/* Safari text-size-adjust merged into top level 'html' selector */

/* Smooth scrolling logic maintained */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Hover effects maintained via base selectors */

/* Safari specific fix for button font weight */
button,
input[type="submit"] {
    -webkit-font-smoothing: antialiased;
}

/* Chrome/Edge/Safari scrollbar styling (optional but ensures consistency) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Scrollbar styling merged into top level '*' selector */

/* Fix for Edge/IE clearing input "X" */
input::-ms-clear,
input::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
}

/* Prevent zoom on input focus in iOS Safari (only if font-size < 16px) */
@media screen and (max-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* --- Global Mobile Optimization (360px Viewport Simulation) --- */
@media (max-width: 600px) {
    :root {
        --radius-lg: 16px;
    }

    .container {
        padding: 0 0.75rem !important;
        /* Minimized horizontal padding */
    }

    .glass-panel,
    .search-card,
    .glass-card {
        padding: 1.25rem 1rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 16px !important;
    }

    .data-grid,
    .perm-grid,
    .usage-grid {
        gap: 1rem !important;
    }
}

/* Standardize Admin Controls globally */
.admin-controls {
    margin-top: 3rem;
    padding: 1.5rem;
    text-align: center;
    /* Changed from left */
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.admin-controls-label {
    display: block;
    font-weight: 700;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    /* Changed from flex-start */
    align-items: center;
    flex-wrap: wrap;
}

.admin-actions .btn {
    height: 34px;
    /* Reduced from 40px */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    /* Reduced width */
    font-size: 0.85rem;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .admin-controls {
        padding: 1rem 0.75rem;
        text-align: center;
    }

    .admin-controls-label {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .admin-actions {
        gap: 0.5rem;
        justify-content: center;
        flex-wrap: nowrap;
    }

    .admin-actions .btn {
        flex: 0 0 75px;
        /* Reduced width */
        height: 32px;
        /* Reduced from 38px */
        font-size: 0.75rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Heading Scale Down */
@media (max-width: 600px) {
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

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