/* Central Shared Stylesheet - CSE Webportal */

:root {
    --primary-color: #002147;      /* Christ University Deep Navy */
    --primary-hover: #1e40af;      /* Deep Blue Hover & Highlights */
    --accent-gold: #d97706;        /* Rich Gold / Amber Accent */
    --accent-gold-light: #c5a059;  /* Soft Warm Gold Accent */
    --bg-light: #f4f6f9;           /* Soft neutral grey */
    --card-shadow: 0 4px 12px rgba(0, 33, 71, 0.08);
    --border-radius: 8px;
}

body {
    background-color: var(--bg-light);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    margin: 0;
    padding: 0;
}

/* Header & Top Banner */
.portal-header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.portal-header img {
    max-height: 48px;
}

.portal-header .title {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#sidebarMenu {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-top: 15px !important;
    padding-bottom: 10px !important;
}

.sidebar .nav-item.logout {
    flex: 0 0 55px !important;
    flex-shrink: 0 !important;
    height: 55px !important;
    background: #ffffff !important;
    border-top: 2px solid #e2e8f0 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 25px !important;
    color: #dc3545 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    margin: 0 !important;
    font-size: 15px !important;
    z-index: 1050 !important;
    position: relative !important;
}

.sidebar .nav-link {
    color: #64748b;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: var(--primary-hover);
    background-color: #eff6ff;
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Sidebar Navigation Items & Sub-items Alignment */
.nav-item {
    padding: 14px 25px;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-decoration: none;
}

.nav-item span {
    display: flex !important;
    align-items: center !important;
}

.nav-item i {
    margin-right: 14px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: #f0f4ff !important;
    color: #0E6FFD !important;
    border-right: 4px solid #0E6FFD !important;
}

.nav-sub-item {
    padding: 10px 25px 10px 52px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
}

.nav-sub-item:hover,
.nav-sub-item.active {
    background: #f8fafc !important;
    color: #0E6FFD !important;
}


/* Cards & Panels */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    background-color: #ffffff;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Custom Buttons */
.btn-primary {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #ffffff;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #b45309;
    border-color: #b45309;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    border-radius: 6px;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Tables */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.875rem 1rem;
    border: none;
}

.table tbody td {
    padding: 0.875rem 1rem;
    border-color: #f1f5f9;
    font-size: 0.9375rem;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.75em;
    border-radius: 50rem;
}

/* Modal Enhancements & Positioning Fix */
.modal-backdrop {
    z-index: 10040 !important;
}

.modal {
    z-index: 10050 !important;
    padding-top: 20px !important;
}

.modal-dialog {
    margin-top: 0 !important;
    margin-bottom: 70px !important;
}

.modal-header {
    background-color: var(--primary-color);
    color: #ffffff;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1055;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 0.375rem;
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

/* Fixed Sidebar & Fixed Logout Footer */
.sidebar {
    position: fixed !important;
    top: 140px !important;
    bottom: 60px !important;
    width: 260px !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #ffffff !important;
    z-index: 1045 !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05) !important;
}

.sidebar-scroll-area, #sidebarMenu {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-top: 15px !important;
    padding-bottom: 10px !important;
}

.sidebar-logout-area, .nav-item.logout, .sidebar .logout {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 55px !important;
    flex: 0 0 55px !important;
    flex-shrink: 0 !important;
    background: #ffffff !important;
    border-top: 2px solid #e2e8f0 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    padding: 0 25px !important;
    color: #dc3545 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 1050 !important;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05) !important;
}

.sidebar-logout-area:hover, .nav-item.logout:hover, .sidebar .logout:hover {
    background: #fff0f0 !important;
    color: #dc3545 !important;
    border-right: 4px solid #dc3545 !important;
}

/* Dashboard Widget Framework Enhancements */
.widget-skeleton {
    background: linear-gradient(90deg, #f0f3f8 25%, #e2e8f0 50%, #f0f3f8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.widget-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.widget-error-state {
    text-align: center;
    padding: 1.5rem;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc3545;
}

.quick-action-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 33, 71, 0.12) !important;
    border-color: #0E6FFD !important;
}

/* ==========================================================================
   GLOBAL LAYOUT, FOOTER OVERLAP & SCROLLING CLEARANCE FIX (PHASE 26)
   ========================================================================== */

/* 1. Ensure body allows full vertical page scrolling with sufficient footer clearance */
body {
    padding-bottom: 110px !important;
    overflow-y: auto !important;
}

/* 2. Main content container clearance to guarantee 100% unobscured content & action buttons */
.main-content,
.app-container,
.content-wrapper,
.content-section,
.page-container {
    padding-bottom: 60px !important;
    margin-bottom: 30px !important;
}

/* 3. Table containers: preserve horizontal scrolling and ensure final row buttons are fully clickable */
.table-responsive {
    margin-bottom: 40px !important;
    padding-bottom: 15px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* 4. Form Action Buttons & Card footers clearance */
.form-actions,
.card-footer {
    margin-bottom: 20px !important;
}

/* 5. Fixed Footer positioning & z-index consistency */
footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: #002147 !important;
    border-top: 4px solid #c5a059 !important;
    color: #ffffff !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    z-index: 1030 !important;
    box-sizing: border-box !important;
}

.sidebar {
    bottom: 60px !important;
    overflow-y: auto !important;
}

/* Custom Native Multiselect Dropdown Styling */
.info-card, .filter-group {
    overflow: visible !important;
}
.filter-group .dropdown {
    position: relative !important;
}
.filter-custom-btn {
    user-select: none;
    -webkit-user-select: none;
}
.filter-custom-btn + .dropdown-menu {
    display: none !important;
}
.filter-custom-btn + .dropdown-menu.show {
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    min-width: 200px !important;
    margin-top: 2px !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18) !important;
    z-index: 9999 !important;
    max-height: 260px !important;
    overflow-y: auto !important;
}
.multiselect.dropdown-toggle {
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

