/* Milton Park Academy - Enhanced Premium Design */
:root {
    /* Fluid spacing system */
    --space-xs: clamp(0.5rem, 1vw, 0.75rem);
    --space-sm: clamp(0.75rem, 1.5vw, 1rem);
    --space-md: clamp(1rem, 2vw, 1.5rem);
    --space-lg: clamp(1.5rem, 3vw, 2rem);

    /* Fluid typography */
    --text-sm: clamp(0.8rem, 0.9vw, 0.9rem);
    --text-base: clamp(0.9rem, 1.1vw, 1.1rem);
    --text-lg: clamp(1.1rem, 1.5vw, 1.5rem);
    --text-xl: clamp(1.5rem, 2.5vw, 2.5rem);

    /* Existing color variables */
    --primary: #1a2332;
    --primary-dark: #0f1419;
    --primary-light: #2a3a4d;
    --secondary: #c9a876;
    --secondary-light: #d9b896;
    --accent: #d97706;
    --accent-light: #f59e0b;
    --success: #10b981;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0891b2;
    --bg-dark: #1a2332;
    --bg-light: #f5ede1;
    --bg-cream: #f5ede1;
    --text-dark: #1a2332;
    --text-light: #64748b;
    --border-color: #e8dcc8;
    --card-bg: #ffffff;
    --stat-card-bg: #f5ede1;
    
    /* Layout */
    --container-width: min(1200px, 95%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* Responsive Form Layout */
form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    width: 100%;
    box-sizing: border-box;
}

.form-group {
    flex: 1 1 200px; /* Grow, shrink, base width */
    min-width: 200px;
    max-width: 100%;
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 700;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.85rem;
    border: 3px solid var(--primary);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-dark);
    font-weight: 700;
    font-size: var(--text-base);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

select.form-control {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2332' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--text-base);
}

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

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-md);
    font-size: var(--text-base);
}

.table th {
    padding: var(--space-md);
    text-align: left;
    font-weight: 800;
    color: var(--text-dark);
    border-bottom: 2px solid var(--accent);
}

.table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.table-striped tbody tr:nth-child(odd) {
    background: rgba(245, 237, 225, 0.3);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    max-width: 100%;
}

.card-header {
    background: var(--stat-card-bg);
    padding: var(--space-lg);
    border-bottom: 2px solid var(--border-color);
}

.card-body {
    padding: var(--space-lg);
}

/* List Items */
.list-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.list-item:hover {
    background: rgba(245, 237, 225, 0.5);
}

.list-item:last-child {
    border-bottom: none;
}

/* Alert Classes */
.alert {
    padding: var(--space-md);
    border-radius: 6px;
    margin-bottom: var(--space-md);
    border: 1px solid transparent;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #03a9f4;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* Mobile Responsive Media Queries */
@media (max-width: 600px) {
    form {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .form-group {
        flex: 1 1 100%;
        min-width: 100%;
        margin-bottom: var(--space-sm);
    }
    
    .btn {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
    
    .table {
        font-size: var(--text-sm);
    }
    
    .table th,
    .table td {
        padding: var(--space-sm);
    }
    
    .card {
        margin-bottom: var(--space-md);
    }
    
    .card-header,
    .card-body {
        padding: var(--space-md);
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0 var(--space-sm);
    }
    
    .table-responsive {
        border-radius: 6px;
        border: 1px solid var(--border-color);
    }
}

/* ===== ACCESSIBILITY UTILITIES ===== */

/* Utility classes for accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1002;
    transition: top 0.3s ease;
}

.skip-to-main:focus {
    top: 6px;
}

/* Enhanced focus indicators */
.btn:focus,
.form-control:focus,
.sidebar-menu a:focus,
.mobile-menu-toggle:focus,
.nav-menu a:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid;
    }
    
    .form-control {
        border: 2px solid;
    }
    
    .card {
        border: 2px solid;
    }
}

/* Header & Navigation */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Top Header Section */
.header-top {
    background: white;
    padding: 1rem 0;
}

.header-top-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-section {
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-section:hover {
    transform: scale(1.02);
}

/* Navigation Container */
.nav-container {
    background: #af936b;
    max-width: 100%;
    margin: 0;
    padding: 1.2rem 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 3rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    position: relative;
    z-index: 1001;
}

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

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.portal-login-btn:hover {
    background: white !important;
    color: #001BB7 !important;
    border-color: white !important;
    transform: scale(1.05);
}

/* Portal Login Button Hover - Handled by portal-login-btn class */
.nav-menu li:last-child a:hover {
    background: white !important;
    color: #001BB7 !important;
    border-color: white !important;
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--secondary) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: clamp(0.5rem, 1vw, 0.9rem) clamp(1rem, 2vw, 1.5rem);
    border: none;
    border-radius: 6px;
    font-size: var(--text-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    outline: none;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #c9a876;
    color: white;
    box-shadow: 0 4px 15px rgba(201, 168, 118, 0.3);
    position: relative;
    z-index: 1;
    font-weight: 600;
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #b8956a;
    box-shadow: 0 6px 20px rgba(201, 168, 118, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

.main-content .container {
    padding: 2rem 20px;
    background: white;
}

/* Vertical Stack Layout - Force Vertical Stacking */
.vertical-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
    width: 100% !important;
}

.vertical-stack > * {
    width: 100% !important;
    flex-shrink: 0 !important;
}

/* Dashboard section spacing fixes */
.stats-section,
.recent-activity-section,
.quick-actions-section,
.system-overview-section {
    margin-bottom: 0 !important;
}

.stats-section > *,
.recent-activity-section > *,
.quick-actions-section > *,
.system-overview-section > * {
    margin-bottom: 0 !important;
}

/* Responsive Forms - No Information Cutoff - ALL SCREENS */
.form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.form-horizontal .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.form-horizontal .control-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
}

.form-horizontal .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    padding: clamp(0.5rem, 1vw, 0.75rem);
}

/* Responsive Tables - No Information Cutoff - ALL SCREENS */
.table-responsive {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
}

table th,
table td {
    padding: clamp(0.5rem, 1vw, 0.75rem) !important;
    text-align: left !important;
    border-bottom: 1px solid #ddd !important;
    word-wrap: break-word !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    min-width: 100px; /* Increased minimum width */
}

/* Ensure tables don't cut off on any screen */
@media (min-width: 1200px) {
    table {
        font-size: clamp(0.9rem, 1vw, 1rem);
        min-width: 800px;
    }
    
    table th,
    table td {
        padding: clamp(0.6rem, 0.8vw, 0.8rem);
        min-width: 120px;
    }
}

@media (min-width: 1600px) {
    table {
        font-size: clamp(1rem, 0.8vw, 1.1rem);
        min-width: 1000px;
    }
    
    table th,
    table td {
        padding: clamp(0.7rem, 0.7vw, 0.9rem);
        min-width: 150px;
    }
}

/* Form Field Groups - Responsive - ALL SCREENS */
.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 250px; /* Increased minimum width */
}

@media (max-width: 1200px) {
    .form-row .form-group {
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
}

/* List Items - Responsive - ALL SCREENS */
.list-group-item {
    padding: clamp(0.75rem, 1.2vw, 1rem) !important;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.list-group-item .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .list-group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .list-group-item .actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Dashboard specific grids */
.dashboard-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.dashboard-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

/* Responsive breakpoints for dashboard grids */
@media (max-width: 1200px) {
    .dashboard-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid-2-1 {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: linear-gradient(135deg, #1a2332 0%, #2a3a4d 100%);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    min-width: 0; /* Prevents flex items from overflowing */
    flex-shrink: 0; /* Prevents cards from shrinking */
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #c9a876 0%, #d9b896 100%);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6 {
    color: white !important;
    margin-bottom: 1rem !important;
    font-weight: 700 !important;
}

.card p,
.card span,
.card a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.card a {
    text-decoration: underline !important;
}

/* Override cards in main content to have cream background */
.main-content .card {
    background: #f5ede1 !important;
    color: #1a2332 !important;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}

.main-content .card::before {
    display: none !important;
}

.main-content .card h1,
.main-content .card h2,
.main-content .card h3,
.main-content .card h4,
.main-content .card h5,
.main-content .card h6 {
    color: #1a2332 !important;
}

.main-content .card p,
.main-content .card span,
.main-content .card a {
    color: #1a2332 !important;
}

.main-content .card a {
    text-decoration: none;
}

/* Stat Card Override */
.card.stat-card {
    background: linear-gradient(135deg, #1a2332 0%, #2a3a4d 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.card.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c9a876 0%, #d9b896 100%);
}

.card.stat-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3) !important;
}

.card.stat-card::before {
    display: none;
}

.card.stat-card h3 {
    color: white !important;
    opacity: 1;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem !important;
}

.card.stat-card p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
}

.card.stat-card p:first-of-type {
    font-size: 2.8rem;
    font-weight: 800;
    color: white !important;
    margin: 0.5rem 0 !important;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: clamp(0.6rem, 1vw, 0.9rem);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--text-base);
    background: white;
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:hover {
    border-color: #999;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 50, 0.1);
}

/* Validation states */
.form-control:invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.form-control:valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-control::placeholder {
    color: #9ca3af;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    color: var(--text-dark);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left-color: var(--success);
}

.alert-error {
    background: #fef2f2;
    color: #7f1d1d;
    border-left-color: var(--danger);
}

.alert-info {
    background: #ecf9ff;
    color: #0c4a6e;
    border-left-color: var(--info);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1a2332;
    z-index: 102;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-header-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

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

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #f5ede1 0%, #f0e6d8 100%);
    color: #1a2332;
    padding: 2rem 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
display: block;
padding: 0.5rem 1rem;
color: #1a2332;
text-decoration: none;
border-left: 3px solid transparent;
transition: all 0.2s ease;
font-weight: 500;
cursor: pointer;
font-size: 0.95rem;
}

.sidebar-menu a:hover {
    background: rgba(201, 168, 118, 0.25);
    color: #1a2332;
    border-left-color: #c9a876;
    padding-left: 1.2rem;
}

.sidebar-menu a:active {
    background: rgba(201, 168, 118, 0.35);
    color: #1a2332;
    border-left-color: #c9a876;
}

.sidebar-menu a.active {
    background: rgba(201, 168, 118, 0.35);
    color: #1a2332;
    border-left-color: #c9a876;
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: clamp(1rem, 3vw, 2rem);
    background: linear-gradient(135deg, #1a2332 0%, #2a3a4d 100%) !important;
    color: white !important;
    min-height: 100vh;
    margin-left: 0 !important; /* Eliminate sidebar space completely */
    width: 100%;
    box-sizing: border-box;
}

.main-content > * {
    background: #f5ede1 !important;
    border-radius: clamp(8px, 2vw, 15px) !important;
    padding: clamp(1rem, 3vw, 2rem) !important;
    margin-bottom: clamp(1rem, 2vw, 1.5rem) !important;
    box-shadow: 0 clamp(4px, 1vw, 10px) clamp(8px, 2vw, 30px) rgba(0, 0, 0, 0.15) !important;
    color: #1a2332 !important;
    width: 100%;
    box-sizing: border-box;
}

/* Typography - fluid scaling */
.main-content > * h1,
.main-content > * h2,
.main-content > * h3,
.main-content > * h4,
.main-content > * h5,
.main-content > * h6,
.main-content > * p {
    color: #1a2332 !important;
}

h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); }
p { font-size: clamp(0.9rem, 2vw, 1.1rem); }

/* Button groups - fluid layout */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    width: 100%;
}

.button-group button,
.button-group .btn {
    flex: 1 1 auto;
    min-width: clamp(80px, 15vw, 120px);
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.75rem, 2vw, 1rem);
    font-size: clamp(0.8rem, 2vw, 1rem);
    box-sizing: border-box;
}

/* Filter buttons - responsive */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.4rem, 1.2vw, 0.6rem);
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.filter-buttons button {
    padding: clamp(0.4rem, 1.2vw, 0.6rem) clamp(0.8rem, 2vw, 1.2rem);
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    min-width: clamp(60px, 12vw, 100px);
    border-radius: clamp(4px, 1vw, 8px);
    box-sizing: border-box;
}

/* Tables - fully fluid with proper scrolling */
.table-container {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    box-sizing: border-box;
    border-radius: clamp(8px, 2vw, 12px);
    box-shadow: 0 clamp(2px, 0.5vw, 4px) clamp(4px, 1vw, 8px) rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100% !important;
    min-width: 800px !important; /* Ensure table is wide enough for all content */
    border-collapse: collapse !important;
    box-sizing: border-box !important;
    font-size: clamp(0.8rem, 2vw, 1rem);
    table-layout: auto !important;
}

th, td {
    padding: clamp(0.5rem, 1.5vw, 0.8rem) clamp(0.8rem, 2vw, 1.2rem) !important;
    text-align: left !important;
    border: 1px solid #ddd !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem) !important;
    white-space: nowrap !important;
    min-width: 120px !important; /* Ensure minimum column width */
}

/* Email column - ensure full visibility */
td.email-column,
th.email-column {
    min-width: 200px !important;
    max-width: 300px !important;
    word-break: break-all !important;
    white-space: normal !important;
}

/* Action column - ensure buttons are visible */
td.action-column,
th.action-column {
    min-width: 150px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Mobile table optimization */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto !important;
        max-height: 70vh;
    }
    
    table {
        min-width: 700px !important;
        font-size: clamp(0.75rem, 2.5vw, 0.85rem) !important;
    }
    
    th, td {
        padding: clamp(0.4rem, 1.2vw, 0.6rem) clamp(0.6rem, 1.5vw, 0.9rem) !important;
        min-width: 100px !important;
        font-size: clamp(0.7rem, 2vw, 0.8rem) !important;
    }
    
    td.email-column,
    th.email-column {
        min-width: 180px !important;
        max-width: 250px !important;
    }
    
    td.action-column,
    th.action-column {
        min-width: 120px !important;
    }
}

@media (max-width: 480px) {
    .table-container {
        overflow-x: auto !important;
        max-height: 60vh;
    }
    
    table {
        min-width: 600px !important;
        font-size: clamp(0.7rem, 3vw, 0.8rem) !important;
    }
    
    th, td {
        padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.5rem, 1.2vw, 0.8rem) !important;
        min-width: 80px !important;
        font-size: clamp(0.65rem, 2.5vw, 0.75rem) !important;
    }
    
    td.email-column,
    th.email-column {
        min-width: 150px !important;
        max-width: 200px !important;
    }
    
    td.action-column,
    th.action-column {
        min-width: 100px !important;
    }
}

/* Form fields - fluid */
input, select, textarea {
    width: 100%;
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    font-size: clamp(0.85rem, 2vw, 1rem);
    border-radius: clamp(4px, 1vw, 8px);
    box-sizing: border-box;
    border: 1px solid #ccc;
}

/* Action buttons in tables */
.action-btn {
    padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.6rem, 1.5vw, 0.8rem);
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    border-radius: clamp(3px, 0.8vw, 6px);
    min-width: clamp(50px, 10vw, 80px);
}

/* Dashboard sections - fluid */
.stats-section,
.recent-activity-section,
.quick-actions-section,
.system-overview-section {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

/* Vertical stack - fluid gaps */
.vertical-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: clamp(1rem, 2vw, 1.5rem) !important;
    width: 100% !important;
    box-sizing: border-box;
}

.vertical-stack > * {
    width: 100% !important;
    flex-shrink: 0 !important;
    box-sizing: border-box;
}

/* Grid system - fluid */
.grid {
    display: grid;
    gap: clamp(0.8rem, 2vw, 1.5rem);
    width: 100%;
    box-sizing: border-box;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 20vw, 250px), 1fr));
}

/* Responsive sidebar - fluid */
.sidebar {
    width: clamp(200px, 25vw, 280px);
    box-sizing: border-box;
}

.sidebar-menu a {
    padding: clamp(0.5rem, 1.5vw, 0.8rem) clamp(1rem, 2.5vw, 1.5rem);
    font-size: clamp(0.85rem, 2vw, 1rem);
}

/* Cards - fluid */
.card {
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: clamp(8px, 2vw, 15px);
    box-shadow: 0 clamp(2px, 0.5vw, 6px) clamp(4px, 1vw, 12px) rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Stat cards - fluid */
.stat-card {
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: clamp(8px, 2vw, 15px);
    text-align: center;
    box-sizing: border-box;
}

.stat-card h3 {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
}

.stat-card p {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin: clamp(0.8rem, 2vw, 1.5rem) 0;
}

/* Medium screens optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-content {
        padding: clamp(1.2rem, 2.5vw, 1.8rem);
    }
    
    .filter-buttons {
        justify-content: space-between;
        align-items: center;
    }
    
    .filter-buttons button {
        min-width: clamp(80px, 10vw, 120px);
    }
    
    table {
        font-size: clamp(0.85rem, 1.5vw, 1rem);
    }
    
    th, td {
        padding: clamp(0.6rem, 1.2vw, 0.9rem) clamp(0.9rem, 1.8vw, 1.1rem);
    }
}

/* Large screens optimization */
@media (min-width: 1025px) and (max-width: 1440px) {
    .main-content {
        padding: clamp(1.5rem, 2vw, 2.5rem);
    }
    
    .filter-buttons {
        gap: clamp(0.8rem, 1.2vw, 1.2rem);
    }
    
    .button-group button,
    .button-group .btn {
        min-width: clamp(100px, 8vw, 150px);
    }
    
    table {
        font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    }
}

/* Extra large screens */
@media (min-width: 1441px) {
    .main-content {
        padding: clamp(2rem, 1.5vw, 3rem);
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 15vw, 300px), 1fr));
        gap: clamp(1rem, 1.5vw, 2rem);
    }
    
    .filter-buttons button {
        min-width: clamp(120px, 6vw, 160px);
        padding: clamp(0.6rem, 1vw, 0.8rem) clamp(1rem, 1.5vw, 1.5rem);
    }
}

.main-content > * h1,
.main-content > * h2,
.main-content > * h3,
.main-content > * h4,
.main-content > * h5,
.main-content > * h6,
.main-content > * p {
    color: #1a2332 !important;
}

.main-content > .alert {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    color: #1a2332 !important;
}

/* Stat Cards - Override all colors */
.stat-card,
.stat-box,
[class*="stat"] {
    background: var(--stat-card-bg) !important;
    color: white !important;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.stat-card:hover,
.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(44, 82, 130, 0.4);
}

.stat-card h3,
.stat-box h3,
.stat-card h2,
.stat-box h2 {
    color: white !important;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-card .value,
.stat-box .value,
.stat-card strong,
.stat-box strong {
    font-size: 2.5rem;
    font-weight: 700;
    color: white !important;
    margin: 0.5rem 0;
    display: block;
}

.stat-card p,
.stat-box p,
.stat-card span,
.stat-box span {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.9rem;
    margin: 0;
}

/* Override inline styles for stat cards */
.main-content [style*="background"] {
    background: var(--stat-card-bg) !important;
    /* Removed color: white !important; to allow proper text colors */
}

/* Ensure proper text colors in main content areas */
.main-content a {
    color: #0066cc !important;
}

.main-content a:hover {
    color: #0052a3 !important;
}

.main-content table a {
    color: #0066cc !important;
}

.main-content table td,
.main-content table th {
    color: #333 !important;
}

/* Admissions page specific fixes */
.main-content .container {
    color: #333 !important;
}

.main-content .container h1,
.main-content .container h2,
.main-content .container h3,
.main-content .container p {
    color: #333 !important;
}

.main-content .detail-value,
.main-content .detail-label {
    color: #333 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
    }
    
    .nav-menu {
        position: fixed;
        left: 0;
        top: 60px;
        width: 100%;
        background: #f5ede1;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        display: none;
        z-index: 999;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #e8dcc8;
        color: #1a2332;
    }
    
    .nav-menu a:hover {
        background: rgba(201, 168, 118, 0.15);
    }
    
    .mobile-menu-toggle {
        display: flex;
        position: relative;
        z-index: 1001;
    }
    
    /* Show mobile header and hamburger menu on mobile */
    .mobile-header {
        display: flex;
    }
    
    .dashboard-layout {
        flex-direction: row;
        padding-top: 60px;
    }
    
    .sidebar {
        width: 250px;
        position: fixed;
        left: 0;
        top: 60px;
        height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        flex: 1;
        padding: 1rem;
        margin-left: 0;
        padding-top: 1rem;
        width: 100%;
    }
    
    /* Ensure all grid items stack properly on mobile */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .dashboard-grid-2-1,
    .dashboard-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

/* Social Media Sidebar */
.social-sidebar {
    position: fixed;
    bottom: 120px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
}

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
    transition: all 0.3s;
}

.chatbot-button:hover {
    background: linear-gradient(135deg, #047857 0%, var(--secondary-light) 100%);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
    transform: scale(1.08);
}

.chatbot-window {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(15, 23, 42, 0.2);
    flex-direction: column;
}

.chatbot-window.open {
    display: flex;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
}

.chatbot-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.chatbot-input {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

/* Tabs & Navigation */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-tabs li {
    margin: 0;
}

.nav-tabs a,
.nav-tabs button {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    border-bottom: 3px solid transparent;
}

.nav-tabs a:hover,
.nav-tabs button:hover {
    color: var(--primary);
    background: rgba(30, 58, 138, 0.05);
}

.nav-tabs a.active,
.nav-tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--secondary);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 2rem 0;
}

.tab-content.active {
    display: block;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    margin-top: 2rem;
}

.welcome-card h2 {
    color: white;
    margin-bottom: 1rem;
}

.welcome-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
}

.welcome-card .btn-group {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.welcome-card .btn {
    text-decoration: none;
    display: inline-block;
}

.welcome-card .btn-white {
    background: white;
    color: var(--primary);
}

.welcome-card .btn-white:hover {
    background: rgba(255, 255, 255, 0.9);
}

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

.welcome-card .btn-outline:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Menu Items */
.menu-item,
.menu-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover,
.menu-link:hover {
    background: rgba(30, 58, 138, 0.05);
    color: var(--primary);
    border-left-color: var(--secondary);
}

.menu-item.active,
.menu-link.active {
    background: rgba(30, 58, 138, 0.1);
    color: var(--primary);
    border-left-color: var(--secondary);
    font-weight: 600;
}
