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

/* --- DESIGN SYSTEM TOKENS --- */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Light Theme Palette (Default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-solid: #ffffff;
    --surface-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(226, 232, 240, 0.8);
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --secondary: #0ea5e9;
    --secondary-hover: #0284c7;
    --accent: #8b5cf6;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-inverse: #ffffff;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-primary: 0 10px 20px -5px rgba(79, 70, 229, 0.2);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark Theme Palette */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --surface: rgba(17, 24, 39, 0.8);
    --surface-solid: #111827;
    --surface-card: rgba(31, 41, 55, 0.6);
    --border-color: rgba(75, 85, 99, 0.3);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --secondary: #38bdf8;
    --secondary-hover: #0ea5e9;
    --accent: #a78bfa;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-primary: 0 10px 20px -5px rgba(99, 102, 241, 0.3);
}

/* --- RESET & GLOBALS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
}

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

/* --- REUSABLE PATTERNS / GLASSMORPHISM --- */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.glass-card {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.4);
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--text-inverse);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -5px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: var(--text-inverse);
}

.btn-accent:hover {
    transform: translateY(-2px);
}

.btn-icon-only {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    aspect-ratio: 1;
}

/* --- BADGES & TAGS --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    gap: 0.25rem;
}

.badge-primary { background-color: var(--primary-glow); color: var(--primary); }
.badge-secondary { background-color: rgba(14, 165, 233, 0.15); color: var(--secondary); }
.badge-success { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }

/* --- HEADER / NAVIGATION --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: filter var(--transition-normal);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-item a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
}

.nav-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width var(--transition-normal);
}

.nav-item a:hover::after,
.nav-item.active a::after {
    width: 100%;
}

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

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    padding: 120px 5% 60px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 50%, transparent 100%);
    z-index: -1;
    filter: blur(80px);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 100%);
    z-index: -1;
    filter: blur(80px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
}

.stat-item h3 {
    font-size: 2rem;
    color: var(--primary);
}

.stat-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-circle {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-glow), rgba(139, 92, 246, 0.2));
    position: relative;
    animation: pulse 8s infinite alternate ease-in-out;
}

.hero-card-overlay {
    position: absolute;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    width: 240px;
    bottom: 10%;
    left: -10%;
}

.hero-card-overlay-2 {
    position: absolute;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    width: 200px;
    top: 10%;
    right: -10%;
}

@keyframes pulse {
    0% { transform: scale(1) rotate(0deg); border-radius: 50%; }
    100% { transform: scale(1.1) rotate(30deg); border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

/* --- SECTION GENERAL --- */
.section {
    padding: 100px 5%;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-tag {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--text-muted);
}

/* --- COURSES --- */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 2rem;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.course-icon-box {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--primary);
    font-size: 1.75rem;
}

.course-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.course-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item i {
    color: var(--primary);
}

.course-topics {
    list-style: none;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.course-topics li {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.course-topics li i {
    color: var(--success);
    font-size: 0.8rem;
}

.course-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- ABOUT & STATS --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content h2 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

.about-p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.about-points {
    list-style: none;
    margin-bottom: 2rem;
}

.about-points li {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 550;
}

.about-points li i {
    color: var(--primary);
    margin-top: 0.25rem;
}

.about-visual {
    position: relative;
}

.about-map-box {
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 350px;
    box-shadow: var(--shadow-lg);
}

.about-info-overlay {
    position: absolute;
    bottom: -20px;
    left: -20px;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    max-width: 320px;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--bg-secondary);
    padding: 80px 5% 30px;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin: 1rem 0 1.5rem;
    max-width: 320px;
}

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

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.social-icon:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-3px);
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

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

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 1rem;
}

/* --- MODAL DIALOGS --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

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

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    z-index: 2001;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 2rem;
}

/* --- FORMS & INPUTS --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
    cursor: pointer;
}

/* --- ADMIN PANEL LAYOUT --- */
.admin-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
}

.admin-login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    background-color: var(--surface-solid);
}

.admin-main {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2rem 3rem;
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-muted);
}

.sidebar-item a:hover,
.sidebar-item.active a {
    background-color: var(--primary-glow);
    color: var(--primary);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* --- ADMIN DASHBOARD CONTENTS --- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.admin-title-box h1 {
    font-size: 2rem;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.admin-stat-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card-details h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-card-details p {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* --- TABLES & UTILITIES --- */
.data-table-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface-solid);
    text-align: left;
}

.data-table th, 
.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.data-table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.02);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

/* --- DYNAMIC COURSE DETAIL STYLES --- */
.syllabus-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1.5rem;
}

.syllabus-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid var(--bg-primary);
}

.timeline-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- PRINT-ONLY WRAPPER STYLES --- */
.print-area {
    display: none;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .hero-grid, .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .hero {
        padding-top: 100px;
    }
    .hero-visual {
        order: -1;
    }
    .admin-sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
    }
    .admin-sidebar .sidebar-logo span,
    .admin-sidebar .sidebar-item a span,
    .admin-sidebar .sidebar-footer {
        display: none;
    }
    .admin-sidebar .sidebar-item a {
        justify-content: center;
        padding: 0.75rem;
    }
    .admin-main {
        margin-left: 80px;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    .nav-links {
        display: none; /* In production a mobile menu would be toggled */
    }
    .section {
        padding: 60px 1rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* --- PRINT MEDIA QUERIES (A4 PRINT PAGES) --- */
@media print {
    body * {
        visibility: hidden;
    }
    
    /* Show only the designated print area */
    .print-area, .print-area * {
        visibility: visible;
    }
    
    .print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #000000 !important;
        background-color: #ffffff !important;
    }

    /* Print settings for Invoices (Portrait) */
    @page portrait-page {
        size: A4 portrait;
        margin: 20mm;
    }

    .invoice-print {
        page: portrait-page;
        padding: 20mm;
        font-family: 'Inter', sans-serif;
        color: #000;
        background: #fff;
        font-size: 12px;
    }
    
    .invoice-print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    .invoice-print-logo {
        height: 60px;
        filter: grayscale(100%);
    }

    .invoice-print-title {
        font-family: 'Outfit', sans-serif;
        font-size: 28px;
        font-weight: 700;
        text-align: right;
    }

    .invoice-print-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }

    .invoice-print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 30px;
    }

    .invoice-print-table th,
    .invoice-print-table td {
        border: 1px solid #ccc;
        padding: 8px 12px;
        text-align: left;
    }

    .invoice-print-table th {
        background-color: #f0f0f0;
    }

    .invoice-print-total-section {
        display: flex;
        justify-content: flex-end;
    }

    .invoice-print-total-box {
        width: 250px;
    }

    .invoice-print-total-row {
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
        font-size: 13px;
    }

    .invoice-print-total-row.grand {
        font-weight: 700;
        border-top: 2px double #000;
        font-size: 15px;
    }
    
    .invoice-print-footer {
        margin-top: 50px;
        text-align: center;
        font-size: 10px;
        color: #666;
        border-top: 1px solid #ccc;
        padding-top: 10px;
    }

    .certificate-print {
        width: 297mm;
        height: 210mm;
        box-sizing: border-box;
        background-color: #ffffff;
        background-image: url("Certificate/Student Certificate.png");
        background-size: 100% 100%;
        background-repeat: no-repeat;
        position: relative;
        font-family: 'Outfit', 'Inter', sans-serif;
        color: #1a1a1a;
        overflow: hidden;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Absolute Positioned Dynamic Fields */
    .cert-dyn-id {
        position: absolute;
        left: 15mm;
        top: 100mm;
        text-align: left;
        font-size: 15px;
        font-weight: 700;
        color: #1a1a1a;
        letter-spacing: 0.05em;
    }

    .cert-dyn-issue-date {
        position: absolute;
        left: 15mm;
        top: 125mm;
        text-align: left;
        font-size: 15px;
        font-weight: 700;
        color: #1a1a1a;
        letter-spacing: 0.02em;
    }

    .cert-dyn-qr {
        position: absolute;
        left: 15mm;
        top: 147mm;
        width: 31mm;
        height: 31mm;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #ffffff;
        padding: 1mm;
        box-sizing: border-box;
    }

    .cert-dyn-qr-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .cert-dyn-name {
        position: absolute;
        left: 80mm;
        width: 202mm;
        top: 106mm;
        text-align: center;
        font-size: 34px;
        font-weight: 800;
        color: #000;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .cert-dyn-description {
        position: absolute;
        left: 88mm;
        width: 186mm;
        top: 136mm;
        text-align: center;
        font-size: 13.5px;
        line-height: 1.8;
        color: #1a1a1a;
    }

    .cert-dyn-description strong {
        color: #000;
        font-weight: 700;
    }
}

/* --- MOBILE RESPONSIVENESS REFINEMENTS --- */
@media (max-width: 768px) {
    /* Main website mobile nav toggle */
    #mobile-nav-toggle {
        display: inline-flex !important;
    }
    .hide-mobile {
        display: none !important;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--surface-solid);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem 0;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
        gap: 1.25rem;
        align-items: center;
    }
    .nav-links.active {
        display: flex;
    }
    .hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    /* Admin Mobile Layout adjustments */
    .admin-sidebar {
        width: 100%;
        height: 65px;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 0 1rem;
        align-items: center;
        justify-content: space-around;
        z-index: 1500;
        background-color: var(--surface-solid);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    }
    .admin-sidebar .sidebar-logo,
    .admin-sidebar .sidebar-footer {
        display: none !important;
    }
    .admin-sidebar .sidebar-menu {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        margin: 0;
        padding: 0;
        gap: 0;
        height: 100%;
    }
    .admin-sidebar .sidebar-item {
        margin: 0;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-grow: 1;
    }
    .admin-sidebar .sidebar-item a {
        flex-direction: column;
        gap: 4px;
        padding: 6px;
        font-size: 0.75rem;
        justify-content: center;
        align-items: center;
        width: 100%;
        color: var(--text-muted);
    }
    .admin-sidebar .sidebar-item.active a {
        color: var(--primary);
    }
    .admin-sidebar .sidebar-item a i {
        font-size: 1.25rem;
        margin: 0;
    }
    .admin-sidebar .sidebar-item a span {
        display: inline !important;
    }
    .admin-main {
        margin-left: 0 !important;
        padding: 1.5rem 1rem 85px 1rem !important; /* Bottom padding to clear the nav bar */
    }

    /* Admin top header layout on mobile */
    .admin-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100%;
        gap: 0.5rem;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    .admin-title-box h1 {
        font-size: 1.5rem;
    }
    .admin-title-box p {
        display: none; /* Hide subtitle to keep header compact */
    }
    
    /* Responsive grids inside Admin views */
    .batches-grid,
    .books-grid,
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* General card list grids inside Admin */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }
    .data-table-container {
        overflow-x: auto;
    }
    
    /* Modals size adjustment for mobile screen */
    .modal-container {
        width: 95% !important;
        margin: 10px !important;
        max-height: 90vh !important;
        padding: 1.5rem !important;
    }
    
    .modal-body {
        padding: 1rem 0 !important;
    }
}
