.suggestion-Item:hover{
    cursor: pointer;
    padding-left: 3px;;
 }
 
 
 /* lg and up: hide horizontal overflow */
 @media (min-width: 992px) {
    .overflow-lg-invisible {
      overflow: hidden !important;
    }
  }
 
#customerSuggestions {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.suggestion-item {
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

.drop-zone {
    border: 2px dashed #007bff;
    background-color: #f8f9fa;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.drop-zone.highlight {
    background-color: #e2f0ff;
    border-color: #0056b3;
}

#editProofOfPayment[type="file"] {
    display: none;
}

/* Search Functionality Styles */
.search-section .form-control:focus,
.search-section .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Search button improvements */
#searchFilter {
    transition: all 0.2s ease;
}

#searchFilter:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading state for search */
.search-section.loading {
    opacity: 0.7;
    pointer-events: none;
}

.search-section.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive improvements */
@media (max-width: 1200px) {
    .search-section .row-cols-1 > .col {
        margin-bottom: 1rem;
    }
    
    .search-section .d-flex.align-items-end {
        align-items: stretch !important;
    }
}

/* DataTable search improvements */
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty state styling */
.dataTables_empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Prevent unnecessary scrolling when content is minimal */
#main {
    min-height: auto !important;
    height: auto;
    display: flex;
    flex-direction: column;
}

#main .section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main .section .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main .section .card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main .section .card .card-body .table-responsive {
    flex: 1;
    min-height: 0;
}

/* Horizontal scrolling for tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scroll-x {
    min-width: 800px; /* Ensure minimum width for proper scrolling */
}

/* Ensure table headers stay visible during horizontal scroll */
.table-responsive thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

/* Ensure the page doesn't scroll unnecessarily on small content */
@media (max-height: 600px) {
    #main {
        padding: 10px 20px;
    }
    
    .pagetitle {
        margin-bottom: 5px;
    }
    
    .search-section {
        padding-bottom: 10px;
    }
}

/* Optimize layout for different screen sizes */
@media (min-height: 800px) {
    #main {
        min-height: calc(100vh - 60px);
    }
}

/* Ensure proper spacing without forcing full height */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html, body {
    height: auto;
    overflow-x: hidden;
}

/* Item Search Suggestions Styling */
.suggestions-container {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1050;
}

.suggestion-item {
    transition: background-color 0.15s ease-in-out;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8f9fa !important;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

.suggestion-item .fw-bold {
    color: #212529;
    font-size: 0.875rem;
}

.suggestion-item small {
    font-size: 0.75rem;
}

/* Ensure the search input has proper border radius when suggestions are shown */
.item-desc-container input:focus {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Loading state for suggestions */
.suggestions-loading {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* No results state */
.suggestions-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Mobile Sidebar Styles */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        z-index: 999;
        transition: left 0.3s ease;
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    #sidebar.sidebar-show {
        left: 0;
    }

    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    #mobileMenuBtn {
        cursor: pointer;
        font-size: 1.5rem;
        color: #6c757d;
        transition: color 0.3s ease;
    }

    #mobileMenuBtn:hover {
        color: #0d6efd;
    }

    /* Ensure main content doesn't shift on mobile */
    #main {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Profile Dropdown Fixes */
.nav-profile {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.dropdown-toggle {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Hide dropdown arrow for profile */
.nav-profile.dropdown-toggle::after {
    display: none !important;
}

.dropdown-menu {
    z-index: 1050 !important;
}

.dropdown-menu.show {
    display: block !important;
}

/* Desktop sidebar behavior */
@media (min-width: 992px) {
    #mobileMenuBtn {
        display: none !important;
    }
}

/* Job Order Enhancements */
.client-suggestion-item,
.item-description-suggestion-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.client-suggestion-item:hover,
.item-description-suggestion-item:hover {
    background-color: #f8f9fa !important;
    border-left-color: #0d6efd;
    transform: translateX(2px);
}

.client-suggestion-item:last-child,
.item-description-suggestion-item:last-child {
    border-bottom: none !important;
}

/* Order Items Styling */
.order-item-row {
    transition: all 0.3s ease;
}

.order-item-row:hover {
    background-color: #f8f9fa;
}

.order-item-row td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* Enhanced form styling */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Loading states */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Suggestions container */
#clientSuggestions,
#editClientSuggestions,
#itemDescriptionSuggestions,
#editItemDescriptionSuggestions {
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Total amount display - simplified */
#totalAmountDisplay,
#editTotalAmountDisplay {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Item count display - simplified */
#itemCountDisplay,
#editItemCountDisplay {
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Animation for new items */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.order-item-row {
    animation: slideInFromRight 0.3s ease-out;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .order-item-row td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Enhanced table styling */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badge improvements */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Form validation styling */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Enhanced modal styling */
.modal-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
}

/* Success/Error message styling */
.toast-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.toast-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Job Order Expenses Styles */
#itemSuggestions {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    background: white;
    z-index: 1050;
}

#itemSuggestions .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
    cursor: pointer;
}

#itemSuggestions .list-group-item:first-child {
    border-top: none;
}

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

#itemSuggestions .list-group-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item {
    transition: background-color 0.15s ease-in-out;
}

/* Financial Summary Cards */
.card.bg-light {
    border: 1px solid #dee2e6;
}

.card.bg-light .card-title {
    color: #495057;
    font-weight: 600;
}

/* Profit/Loss styling */
.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Expenses table styling */
#expensesTable .btn-group .btn {
    margin-right: 2px;
}

#expensesTable .btn-group .btn:last-child {
    margin-right: 0;
}

/* SweetAlert2 Modal - No Scroll */
.swal2-no-scroll {
    overflow: hidden !important;
}

.swal2-no-scroll .swal2-html-container {
    overflow: visible !important;
    max-height: none !important;
}

.swal2-no-scroll .swal2-content {
    overflow: visible !important;
    max-height: none !important;
}

/* Dashboard refresh */
.dashboard-main {
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 30%, #ffffff 100%);
    min-height: calc(100vh - 60px);
}

.dashboard-hero {
    border-radius: 24px;
    padding: 2.5rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 55%);
    pointer-events: none;
}

.dashboard-hero__text,
.dashboard-hero__cta {
    position: relative;
    z-index: 1;
}

.dashboard-hero__text {
    flex: 1 1 320px;
}

.dashboard-hero__cta {
    align-self: flex-end;
}

.hero-eyebrow {
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.75rem;
    opacity: 0.8;
}

.hero-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1rem;
    max-width: 540px;
    color: rgba(255, 255, 255, 0.9);
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.hero-chip--neutral {
    background: rgba(255, 255, 255, 0.15);
}

.hero-chip--role {
    background: rgba(14, 165, 233, 0.3);
}

.hero-chip--accent {
    background: rgba(245, 158, 11, 0.3);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.85rem 1.4rem;
    box-shadow: 0 20px 45px rgba(79, 70, 229, 0.4);
}

.dashboard-section {
    position: relative;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-eyebrow {
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    border-radius: 20px;
    padding: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.15);
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.25;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent);
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    z-index: 1;
}

.stat-card__body {
    z-index: 1;
}

.stat-card__label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.stat-card__value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-card__meta {
    font-size: 0.85rem;
}

.stat-card.accent-1 {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.stat-card.accent-2 {
    background: linear-gradient(135deg, #059669, #10b981);
}

.stat-card.accent-3 {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.stat-card.accent-4 {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.quick-actions-card,
.recent-activity-card {
    border-radius: 20px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.quick-action-link {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-action-link:hover {
    transform: translateY(-2px);
    border-color: #c7d2fe;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

.quick-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #eef2ff;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.quick-action-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.quick-action-label {
    font-weight: 600;
    color: #0f172a;
}

.quick-action-copy small {
    color: #475569;
}

.quick-action-arrow {
    color: #94a3b8;
}

.recent-activity-card {
    padding-bottom: 0.5rem;
}

.recent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

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

.timeline-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #e0f2fe;
    color: #0369a1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

@media (max-width: 991.98px) {
    .dashboard-hero {
        padding: 2rem;
    }
}

@media (max-width: 767.98px) {
    .dashboard-hero {
        flex-direction: column;
        text-align: left;
    }

    .hero-cta {
        width: 100%;
        justify-content: center;
    }

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

/* Logout Modal Styles */
.logout-modal-popup {
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: visible;
    position: relative;
    background: white;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

/* Icon animations */
@keyframes iconBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-30px) rotate(-180deg);
    }
    50% {
        transform: scale(1.1) translateY(0) rotate(10deg);
    }
    70% {
        transform: scale(0.95) translateY(0) rotate(-5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logout-modal-title {
    margin: 0;
    padding: 0;
}

.logout-modal-content {
    padding: 0.5rem 0;
}

.logout-confirm-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    border-radius: 10px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logout-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

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

.logout-cancel-btn {
    background: #6c757d;
    border: none;
    border-radius: 10px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logout-cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

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

.logout-modal-actions {
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0 1.5rem 1.5rem;
}

/* SweetAlert2 Custom Styling for Logout */
.swal2-popup.logout-modal-popup .swal2-html-container {
    margin: 0;
    padding: 0;
}

.swal2-popup.logout-modal-popup .swal2-title {
    padding: 1.5rem 1.5rem 0.5rem;
    margin: 0;
}

.swal2-popup.logout-modal-popup .swal2-actions {
    margin: 0;
    padding: 0;
}

/* Loading state for logout */
.swal2-popup .spinner-border {
    border-width: 0.25rem;
}

/* Pop-up Animation for Logout Modal */
@keyframes popupShow {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-80px) rotate(-5deg);
        filter: blur(15px);
    }
    40% {
        opacity: 0.8;
        transform: scale(1.1) translateY(10px) rotate(2deg);
        filter: blur(3px);
    }
    60% {
        transform: scale(0.95) translateY(-5px) rotate(-1deg);
        filter: blur(1px);
    }
    80% {
        transform: scale(1.02) translateY(2px) rotate(0.5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
        filter: blur(0);
    }
}

@keyframes popupHide {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
        filter: blur(5px);
    }
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes backdropFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Remove duplicate - handled below */

/* Enhanced backdrop animation */
.swal2-backdrop.swal2-backdrop-show {
    animation: backdropFadeIn 0.4s ease-out forwards !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
}

.swal2-backdrop.swal2-backdrop-hide {
    animation: backdropFadeOut 0.3s ease-in forwards !important;
}

/* Add subtle pulse effect on modal */
.logout-modal-popup {
    position: relative;
}

.logout-modal-popup::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 300% 300%;
    border-radius: 24px;
    z-index: -1;
    opacity: 0.6;
    animation: borderGlow 3s ease-in-out infinite, gradientShift 4s ease infinite;
    border: 2px solid transparent;
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        filter: blur(15px);
        transform: scale(1.02);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Pop-up animation - override SweetAlert2 defaults with high specificity */
.swal2-popup.logout-modal-popup.swal2-show-popup,
.swal2-popup.logout-modal-popup.swal2-show-popup-active,
.swal2-popup.swal2-show-popup.logout-modal-popup {
    animation: popupShow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, shadowPulse 0.6s ease-out 0.2s forwards;
    box-shadow: 0 0 0 rgba(102, 126, 234, 0), 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Don't override when hiding */
.swal2-popup.logout-modal-popup.swal2-hide-popup {
    animation: popupHide 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
    pointer-events: none;
}

@keyframes shadowPulse {
    0% {
        box-shadow: 0 0 0 rgba(102, 126, 234, 0), 0 20px 60px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.4), 0 25px 80px rgba(0, 0, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 0 rgba(102, 126, 234, 0), 0 20px 60px rgba(0, 0, 0, 0.3);
    }
}

/* Lessons Page Specific Styles */
.lessons-pagetitle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.lessons-pagetitle::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.lessons-pagetitle::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.pagetitle-content {
    position: relative;
    z-index: 1;
}

.lessons-main-title {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.title-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.title-icon i {
    font-size: 2rem;
    color: #ffffff;
}

.title-text {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lessons-breadcrumb {
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: inline-block;
}

.lessons-breadcrumb .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lessons-breadcrumb .breadcrumb-item a:hover {
    color: #ffffff;
    transform: translateX(3px);
}

.lessons-breadcrumb .breadcrumb-item.active {
    color: #ffffff;
    font-weight: 600;
}

.lessons-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
    content: "›";
}

.lessons-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: calc(100vh - 100px);
    padding: 1.5rem 0;
}

.lessons-card {
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lessons-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.card-header-lessons {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.75rem 2rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.card-header-lessons::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.card-title-lessons {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lessons-icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.lessons-icon-wrapper i {
    font-size: 1.5rem;
    color: #ffffff;
}

.lessons-title-text {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lessons-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.btn-add-lesson {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.btn-add-lesson:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
}

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

#lessonsTable {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

#lessonsTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1.25rem 1rem;
    border: none;
    white-space: nowrap;
    position: relative;
}

#lessonsTable thead th:first-child {
    border-top-left-radius: 12px;
}

#lessonsTable thead th:last-child {
    border-top-right-radius: 12px;
}

#lessonsTable thead th i {
    margin-right: 0.5rem;
    opacity: 0.9;
}

#lessonsTable tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
    background: #ffffff;
}

#lessonsTable tbody tr {
    transition: all 0.3s ease;
}

#lessonsTable tbody tr:hover {
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

#lessonsTable tbody tr:last-child td {
    border-bottom: none;
}

#lessonsTable tbody tr.table-active {
    background: linear-gradient(90deg, #e7f3ff 0%, #f0f8ff 100%);
    border-left: 4px solid #667eea;
}

#lessonsTable .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border-width: 2px;
}

#lessonsTable .btn-outline-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    color: #667eea;
}

#lessonsTable .btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#lessonsTable .btn-outline-danger {
    background: linear-gradient(135deg, rgba(245, 87, 108, 0.1) 0%, rgba(240, 147, 251, 0.1) 100%);
    border-color: #f5576c;
    color: #f5576c;
}

#lessonsTable .btn-outline-danger:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    border-color: #f5576c;
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

/* Card improvements for lessons page */
.card .card-title {
    color: #012970;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card .card-title i {
    color: #4154f1;
}

/* DataTables wrapper improvements */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}

/* Lesson Modal Styling */
.lesson-modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lesson-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.lesson-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

.lesson-modal-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.lesson-modal-title i {
    font-size: 1.75rem;
    margin-right: 0.5rem;
}

.lesson-modal-footer {
    border-top: 2px solid #f1f3f5;
    padding: 1.5rem 2rem;
    background: #fafbfc;
}

.btn-cancel-lesson {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-cancel-lesson:hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
    color: white;
}

.btn-save-lesson {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-save-lesson:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white;
}

/* Enhanced form styling in modal */
.lesson-modal-content .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.lesson-modal-content .form-control,
.lesson-modal-content select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.lesson-modal-content .form-control:focus,
.lesson-modal-content select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.lesson-modal-content textarea {
    resize: vertical;
    min-height: 200px;
}

/* Student Modal Form Enhancements */
#studentModal .form-control-lg {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.875rem 1.25rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

#studentModal .form-control-lg:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
    transform: translateY(-1px);
}

#studentModal .form-control-lg.is-valid {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

#studentModal .form-control-lg.is-invalid {
    border-color: #ef4444;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

#studentModal .form-text {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

#studentModal .form-text.text-success {
    color: #10b981;
    font-weight: 500;
}

#studentModal .form-text.text-danger {
    color: #ef4444;
    font-weight: 500;
}

/* Enhanced badge styling */
#lessonsTable .badge {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#lessonsTable .badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

/* Enhanced link styling */
#lessonsTable a.lesson-link {
    color: #667eea;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

#lessonsTable a.lesson-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

#lessonsTable a.lesson-link:hover i {
    color: white !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card-header-lessons {
        padding: 1.25rem 1.5rem;
    }
    
    .card-title-lessons {
        font-size: 1.25rem;
    }
    
    .lessons-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .lessons-icon-wrapper i {
        font-size: 1.25rem;
    }
    
    .btn-add-lesson {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   Students Page Specific Styles
   Updated: Enhanced table columns styling
   ============================================ */

/* Students Page Title Section */
.students-pagetitle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
}

.students-pagetitle::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.students-pagetitle::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.students-main-title {
    color: #ffffff;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.title-icon-picture {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    backdrop-filter: blur(10px);
    border: 3px solid #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3), inset 0 0 20px rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.title-icon-picture::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

.title-icon-picture i {
    font-size: 2.5rem;
    color: #667eea !important;
    position: relative;
    z-index: 10;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

/* Force icon color with maximum specificity */
.students-pagetitle .title-icon-picture i.bi-mortarboard-fill,
.students-pagetitle .title-icon-picture i,
.students-pagetitle .pagetitle-content .title-icon-picture i,
.students-pagetitle .pagetitle-content .d-flex .title-icon-picture i {
    color: #667eea !important;
    fill: #667eea !important;
    stroke: #667eea !important;
}

/* Target SVG elements inside the icon */
.students-pagetitle .title-icon-picture i svg,
.students-pagetitle .title-icon-picture svg {
    fill: #667eea !important;
    color: #667eea !important;
}

.students-pagetitle .title-icon-picture i svg path,
.students-pagetitle .title-icon-picture svg path {
    fill: #667eea !important;
    stroke: #667eea !important;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.students-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
}

.students-breadcrumb {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: inline-block;
}

.students-breadcrumb .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.students-breadcrumb .breadcrumb-item a:hover {
    color: #ffffff;
    transform: translateX(3px);
}

.students-breadcrumb .breadcrumb-item.active {
    color: #ffffff;
    font-weight: 600;
}

.students-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
    content: "›";
    padding: 0 0.5rem;
}

/* Students Section */
.students-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: calc(100vh - 200px);
    padding: 1.5rem 0;
    border-radius: 20px;
}

.students-main {
    padding: 20px 30px;
}

@media (max-width: 1199px) {
    .students-main {
        padding: 20px;
    }
}

.students-card {
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.students-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* Students Table Styles */
.students-table-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#studentsTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
}

/* Force override DataTables default styles */
table#studentsTable.table {
    border-collapse: separate !important;
}

table#studentsTable.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 0.75rem 0.5rem !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    font-size: 0.8rem !important;
    letter-spacing: 1px !important;
}

table#studentsTable.table tbody td {
    padding: 1rem 0.75rem !important;
    font-size: 0.85rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Additional override for DataTables wrapper */
.dataTables_wrapper #studentsTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 0.75rem 0.5rem !important;
    font-size: 0.85rem !important;
}

.dataTables_wrapper #studentsTable tbody td {
    padding: 1rem 0.75rem !important;
    font-size: 0.85rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Add subtle column dividers */
#studentsTable thead th:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

#studentsTable tbody td:not(:last-child) {
    border-right: 1px solid #f1f5f9;
}

#studentsTable tbody tr:hover td:not(:last-child) {
    border-right-color: #e2e8f0;
}

#studentsTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    padding: 0.75rem 0.5rem !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    letter-spacing: 1px !important;
    padding: 1.5rem 1.25rem !important;
    border: none !important;
    white-space: nowrap;
    position: relative;
    vertical-align: middle;
    text-align: left !important;
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.1) !important;
}

#studentsTable thead th:first-child {
    border-top-left-radius: 12px;
    padding-left: 1rem !important;
}

#studentsTable thead th:last-child {
    border-top-right-radius: 12px;
    padding-right: 1.75rem;
}

#studentsTable thead th i {
    margin-right: 0.75rem !important;
    opacity: 1 !important;
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 24px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    padding: 4px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

#studentsTable tbody td {
    padding: 1rem 0.75rem !important;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #ffffff !important;
    font-size: 0.85rem !important;
    color: #475569 !important;
    transition: all 0.2s ease;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 180px !important;
}

#studentsTable tbody td:first-child {
    padding-left: 1rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    max-width: 150px !important;
    text-align: left !important;
}

#studentsTable tbody td:last-child {
    padding-right: 1.75rem;
}

#studentsTable tbody td strong {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.9rem !important;
    letter-spacing: -0.01em;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column-specific styling */
#studentsTable tbody td:nth-child(1) {
    /* Full Name column */
    font-weight: 600 !important;
    color: #1e293b !important;
    max-width: 150px !important;
    min-width: 120px !important;
}

#studentsTable tbody td:nth-child(2),
#studentsTable tbody td:nth-child(3) {
    /* Activity and Quiz columns */
    text-align: center !important;
    font-weight: 500 !important;
    max-width: 100px !important;
}

#studentsTable tbody td:nth-child(4) {
    /* Average Grade column */
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    max-width: 120px !important;
}

#studentsTable tbody td:nth-child(5) {
    /* Date Created column */
    color: #64748b !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    max-width: 130px !important;
    text-align: center !important;
}

#studentsTable tbody td:nth-child(6) {
    /* Status column */
    text-align: center !important;
    max-width: 120px !important;
}

#studentsTable tbody td:nth-child(7) {
    /* Actions column */
    text-align: center !important;
    min-width: 150px !important;
    max-width: 150px !important;
}

#studentsTable tbody tr {
    transition: all 0.3s ease;
}

#studentsTable tbody tr {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    background: #ffffff;
}

#studentsTable tbody tr:hover {
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%) !important;
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.08) !important;
    border-left: 3px solid #667eea !important;
}

#studentsTable tbody tr:hover td {
    background: transparent !important;
}

#studentsTable tbody tr:hover td {
    color: #1e293b;
    border-bottom-color: #e2e8f0;
}

#studentsTable tbody tr:nth-child(even) {
    background: #fafbfc !important;
}

#studentsTable tbody tr:nth-child(even) td {
    background: #fafbfc !important;
}

#studentsTable tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, #f8f9ff 0%, #fafbfc 100%);
}

#studentsTable tbody tr:last-child td {
    border-bottom: none;
}

#studentsTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

#studentsTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Empty state styling */
#studentsTable tbody tr td.dataTables_empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    font-size: 1rem;
}

/* Badge Improvements */
#studentsTable .badge {
    padding: 0.5rem 0.875rem;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    letter-spacing: 0.3px;
    min-width: 50px;
    justify-content: center;
    transition: all 0.2s ease;
}

#studentsTable .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#studentsTable .badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

#studentsTable .badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

#studentsTable .badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

#studentsTable .badge.bg-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

#studentsTable .badge.bg-light {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

/* Action Buttons */
#studentsTable .btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#studentsTable .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border-width: 2px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

#studentsTable .btn-outline-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    color: #667eea;
}

#studentsTable .btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#studentsTable .btn-outline-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border-color: #10b981;
    color: #10b981;
}

#studentsTable .btn-outline-success:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

#studentsTable .btn-outline-danger {
    background: linear-gradient(135deg, rgba(245, 87, 108, 0.1) 0%, rgba(240, 147, 251, 0.1) 100%);
    border-color: #f5576c;
    color: #f5576c;
}

#studentsTable .btn-outline-danger:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    border-color: #f5576c;
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

/* Action Buttons in Header */
.btn-action {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Override for specific action buttons in tables - ensure solid backgrounds */
.btn-action-view,
.btn-action-edit,
.btn-action-delete {
    backdrop-filter: none !important;
}

.btn-action-view {
    background: #007bff !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5) !important;
    border-width: 2px !important;
}

.btn-action-view:hover {
    background: #0056b3 !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.btn-action-view:active {
    background: #004085 !important;
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-action-edit {
    background: #ffc107 !important;
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5) !important;
    border-width: 2px !important;
}

.btn-action-edit:hover {
    background: #ffb300 !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 193, 7, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #000000 !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.btn-action-edit:active {
    background: #ffa000 !important;
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-action-delete {
    background: #dc3545 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5) !important;
    border-width: 2px !important;
}

.btn-action-delete:hover {
    background: #c82333 !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.btn-action-delete:active {
    background: #bd2130 !important;
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Lessons Table Actions Column Styling */
.lesson-actions-cell {
    width: 15% !important;
    min-width: 180px !important;
}

.lesson-actions-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lesson-actions-group .btn-action {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Lesson Details Modal Styling */
.lesson-details-modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lesson-details-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.lesson-details-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

.lesson-details-modal-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.lesson-details-modal-title i {
    font-size: 1.75rem;
}

.lesson-details-modal-body {
    padding: 2rem;
    background: #ffffff;
}

.lesson-details-modal-footer {
    border-top: 2px solid #f1f3f5;
    padding: 1.5rem 2rem;
    background: #fafbfc;
}

.btn-close-lesson-details {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-close-lesson-details:hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
    color: white;
}

.lesson-details-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.lesson-details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.lesson-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lesson-detail-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.lesson-detail-label i {
    color: #667eea;
    font-size: 1rem;
}

.lesson-detail-value {
    color: #212529;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.lesson-content-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-left: 4px solid #667eea;
}

.lesson-content-box::-webkit-scrollbar {
    width: 8px;
}

.lesson-content-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.lesson-content-box::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.lesson-content-box::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.btn-lesson-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn-lesson-link:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white;
    text-decoration: none;
}

/* Activity Details Modal Styling */
.activity-details-modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.activity-details-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.activity-details-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

.activity-details-modal-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.activity-details-modal-title i {
    font-size: 1.75rem;
}

.activity-details-modal-body {
    padding: 2rem;
    background: #ffffff;
}

.activity-details-modal-footer {
    border-top: 2px solid #f1f3f5;
    padding: 1.5rem 2rem;
    background: #fafbfc;
}

.btn-close-activity-details {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-close-activity-details:hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
    color: white;
}

.activity-details-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.activity-details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.activity-section-subtitle {
    color: #495057;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.activity-section-subtitle i {
    color: #667eea;
    font-size: 1.1rem;
}

.activity-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-detail-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.activity-detail-label i {
    color: #667eea;
    font-size: 1rem;
}

.activity-detail-value {
    color: #212529;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.activity-content-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-left: 4px solid #667eea;
    min-height: 100px;
}

.btn-activity-file {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn-activity-file:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white;
    text-decoration: none;
}

.activity-info-box {
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
    border: 2px solid #b3d9ff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.activity-info-box h6 {
    color: #0c63e4;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.activity-info-box h6 i {
    font-size: 1.25rem;
}

.activity-info-box ul {
    color: #0c63e4;
}

.activity-info-box ul li {
    margin-bottom: 0.5rem;
}

.btn-add-student {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add-student:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
}

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

/* DataTables Customization */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.625rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 1.5rem;
    padding: 0 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px;
    margin: 0 0.25rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white !important;
    transform: translateY(-2px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.dataTables_wrapper .dataTables_info {
    padding: 0.75rem 0.5rem;
    color: #6b7280;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_processing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1rem 2rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .students-pagetitle {
        padding: 2rem 1.5rem;
    }
    
    .students-main-title {
        font-size: 1.75rem;
    }
    
    .title-icon {
        width: 50px;
        height: 50px;
    }
    
    .title-icon-picture {
        width: 70px;
        height: 70px;
    }
    
    .title-icon i {
        font-size: 1.5rem;
    }
    
    .title-icon-picture i {
        font-size: 2rem;
        color: #667eea !important;
    }
}

@media (max-width: 767.98px) {
    .students-pagetitle {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .students-main-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .title-icon {
        width: 45px;
        height: 45px;
    }
    
    .title-icon-picture {
        width: 60px;
        height: 60px;
        border-radius: 15px;
    }
    
    .title-icon i {
        font-size: 1.25rem;
    }
    
    .title-icon-picture i {
        font-size: 1.75rem;
        color: #667eea !important;
    }
    
    .students-subtitle {
        font-size: 0.9rem;
    }
    
    .card-header-lessons {
        padding: 1.25rem 1rem;
    }
    
    .card-title-lessons {
        font-size: 1.1rem;
    }
    
    .lessons-icon-wrapper {
        width: 35px;
        height: 35px;
    }
    
    .lessons-icon-wrapper i {
        font-size: 1rem;
    }
    
    .btn-add-student {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        width: 100%;
        justify-content: center;
    }
    
    .btn-action {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    #studentsTable thead th {
        padding: 1rem 0.75rem;
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }
    
    #studentsTable thead th:first-child {
        padding-left: 1rem;
    }
    
    #studentsTable thead th:last-child {
        padding-right: 1rem;
    }
    
    #studentsTable thead th i {
        display: none;
    }
    
    #studentsTable tbody td {
        padding: 1.25rem 0.75rem;
        font-size: 0.875rem;
    }
    
    #studentsTable tbody td:first-child {
        padding-left: 1rem;
    }
    
    #studentsTable tbody td:last-child {
        padding-right: 1rem;
    }
    
    #studentsTable tbody td:nth-child(2),
    #studentsTable tbody td:nth-child(3),
    #studentsTable tbody td:nth-child(4),
    #studentsTable tbody td:nth-child(6) {
        text-align: center;
    }
    
    .students-section {
        padding: 1rem 0;
    }
}

@media (max-width: 575.98px) {
    .students-pagetitle {
        padding: 1.25rem 0.75rem;
    }
    
    .students-main-title {
        font-size: 1.25rem;
    }
    
    .students-breadcrumb {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    #studentsTable {
        font-size: 0.8rem;
    }
    
    #studentsTable thead th,
    #studentsTable tbody td {
        padding: 0.625rem 0.375rem;
    }
    
    #studentsTable .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Filter Group Styling */
.filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-group .form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.filter-group .form-select-sm {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-group .form-select-sm:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.1);
}

.filter-group .form-select-sm:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: 0;
}

.card-header-lessons .filter-group {
    gap: 0.75rem;
}

.card-header-lessons .filter-group .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.card-header-lessons .filter-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-header-lessons .filter-group > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grading Period Select Styling */
.grading-period-select {
    transition: all 0.3s ease;
    border-width: 2px;
}

.grading-period-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: 0;
}

.grading-period-select option[value="prelim"] {
    background-color: #667eea;
    color: white;
    font-weight: 600;
}

.grading-period-select option[value="midterm"] {
    background-color: #f093fb;
    color: white;
    font-weight: 600;
}

.grading-period-select option[value="finals"] {
    background-color: #4facfe;
    color: white;
    font-weight: 600;
}

/* Quiz Submission Cards */
.quiz-submission-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef !important;
}

.quiz-submission-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.quiz-submission-card .card-body {
    padding: 1.5rem;
}

.quiz-submission-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.quiz-submission-card .small {
    font-size: 0.875rem;
}

.quiz-submission-card .bg-light {
    background-color: #f8f9fa !important;
    border-radius: 0.375rem;
}

.dataTables-info,
.dataTables-paginate {
    margin: 0.5rem 0;
}

.dataTables-paginate .pagination {
    margin-bottom: 0;
}

/* Vertical Submission Table */
.vertical-submission-row {
    padding: 1.25rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.vertical-submission-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.vertical-submission-row .bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.vertical-submission-row .bg-light:hover {
    background-color: #e9ecef !important;
    transform: translateY(-1px);
}

.vertical-submission-row .field-label {
    min-width: 140px;
    max-width: 140px;
    width: 140px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.vertical-submission-row .field-value {
    flex: 1;
    color: #212529;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.vertical-submission-row .d-flex {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 32px;
    align-items: center;
}

.vertical-submission-row .d-flex:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.vertical-submission-row .d-flex.align-items-center {
    align-items: center !important;
}

.vertical-submission-row .row {
    margin: 0;
}

.vertical-submission-row .row.g-3 {
    --bs-gutter-y: 0.5rem;
    --bs-gutter-x: 0.75rem;
}

.vertical-submission-row .mb-3 {
    margin-bottom: 0.5rem !important;
}

.vertical-submission-row .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.vertical-submission-row .status-badge,
.vertical-submission-row .grading-period-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.vertical-submission-row .btn-action {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

.vertical-submission-row .btn-action:first-child {
    margin-left: 0;
}

.vertical-submission-row .btn-action i {
    font-size: 0.875rem;
}

.vertical-submission-row .field-value .lesson-actions-group {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}

.vertical-submission-row .field-value .btn,
.vertical-submission-row .field-value .dropdown {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.vertical-submission-row .field-value .dropdown-toggle {
    white-space: nowrap;
}

/* Hide empty DataTable header columns */
.lessons-table thead th.dt-orderable-none:empty,
.lessons-table thead th:empty,
.lessons-table thead th[data-dt-column="0"]:not(:has(.dt-column-title:not(:empty))),
.lessons-table thead th .dt-column-title:empty {
    display: none !important;
}

/* Hide thead if it only contains empty th */
.lessons-table thead:has(th:only-child .dt-column-title:empty) {
    display: none !important;
}

.lessons-table tbody td {
    vertical-align: top;
    padding: 0 !important;
}

.lessons-table tbody tr {
    border-bottom: 2px solid #dee2e6;
}

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

/* Attendance Date Range Filter */
.date-filter-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.date-filter-wrapper label {
    font-weight: 500;
    color: #495057;
}

.date-filter-wrapper #attendanceDateRangePicker {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.date-filter-wrapper #attendanceDateRangePicker:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.date-filter-wrapper #dateRangeError {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.date-filter-wrapper .btn-outline-secondary {
    border-color: #dee2e6;
}

.date-filter-wrapper .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

/* Flatpickr customization for Material-style appearance */
.flatpickr-calendar {
    font-family: inherit;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
}

.flatpickr-day.selected.startRange,
.flatpickr-day.selected.endRange,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.flatpickr-day.inRange {
    background: #e7f1ff;
    border-color: #e7f1ff;
    color: #000;
}

/* Grades Page Table Styling Improvements */
.grade-section-content .table tbody tr:has(td.bg-info) {
    background: transparent !important;
}

.grade-section-content .table tbody tr:has(td.bg-info):hover {
    background: transparent !important;
}

.grade-section-content .table tbody tr:has(td.bg-dark) {
    background: transparent !important;
}

.grade-section-content .table tbody tr:has(td.bg-dark):hover {
    background: transparent !important;
}

.grade-section-content .table tbody tr:has(td.bg-danger) {
    background: transparent !important;
}

.grade-section-content .table tbody tr:has(td.bg-danger):hover {
    background: transparent !important;
}

.grade-section-content .table tbody tr:has(td.bg-dark) td {
    border-bottom: none;
}

/* Announcements Table Header Styling */
#announcementsTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 1rem 1.25rem !important;
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    text-align: center !important;
    position: relative !important;
}

#announcementsTable thead th:last-child {
    border-right: none !important;
}

#announcementsTable thead th:first-child {
    border-top-left-radius: 12px !important;
}

#announcementsTable thead th:last-child {
    border-top-right-radius: 12px !important;
}

#announcementsTable thead th .dt-column-title {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

#announcementsTable thead th .dt-column-title i {
    opacity: 0.95 !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    padding: 4px !important;
}

#announcementsTable thead th .dt-column-order {
    display: inline-flex !important;
    align-items: center !important;
    margin-left: 0.5rem !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s ease !important;
}

#announcementsTable thead th:hover .dt-column-order {
    opacity: 1 !important;
}

#announcementsTable thead th.dt-ordering-asc .dt-column-order::after,
#announcementsTable thead th.dt-ordering-desc .dt-column-order::after {
    content: '' !important;
    display: inline-block !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 4px solid transparent !important;
    border-right: 4px solid transparent !important;
    margin-left: 0.25rem !important;
}

#announcementsTable thead th.dt-ordering-asc .dt-column-order::after {
    border-bottom: 6px solid #ffffff !important;
}

#announcementsTable thead th.dt-ordering-desc .dt-column-order::after {
    border-top: 6px solid #ffffff !important;
}

#announcementsTable thead th.dt-orderable-none {
    cursor: default !important;
}

#announcementsTable thead th.dt-orderable-asc,
#announcementsTable thead th.dt-orderable-desc {
    cursor: pointer !important;
}

#announcementsTable thead th.dt-orderable-asc:hover,
#announcementsTable thead th.dt-orderable-desc:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

/* Activities Table - Center all column contents */
/* Activities Table Content Styling */
#activitiesTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.5rem 1.25rem !important;
    min-height: 60px !important;
}

/* Allow left alignment for text content within centered cells */
#activitiesTable tbody td .d-flex {
    justify-content: flex-start;
    align-items: center;
    text-align: left;
}

#activitiesTable tbody td .d-flex.align-items-start {
    justify-content: flex-start;
    text-align: left;
}

/* Center badges and status elements */
#activitiesTable tbody td .grading-period-badge,
#activitiesTable tbody td .status-badge,
#activitiesTable tbody td .lesson-date-wrapper,
#activitiesTable tbody td .lesson-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Title column styling */
#activitiesTable tbody td .fw-semibold {
    font-weight: 600;
    color: #012970;
    transition: color 0.2s ease;
}

#activitiesTable tbody td .fw-semibold:hover {
    color: #667eea;
}

/* Description column styling */
#activitiesTable tbody td .text-dark {
    color: #495057;
    line-height: 1.5;
}

/* Date wrapper improvements */
#activitiesTable tbody td .lesson-date-wrapper.text-danger {
    color: #dc3545 !important;
}

#activitiesTable tbody td .lesson-date-wrapper.text-warning {
    color: #ffc107 !important;
}

#activitiesTable tbody tr {
    height: auto !important;
    min-height: 60px !important;
    transition: background-color 0.2s ease;
}

#activitiesTable tbody tr:hover {
    background-color: #f8f9fa;
}

#activitiesTable tbody td:first-child {
    text-align: center !important;
}

#activitiesTable thead th {
    text-align: center !important;
    padding: 1.25rem 1.25rem !important;
}

#activitiesTable thead th:first-child {
    text-align: center !important;
}

/* Quizzes Table - Center all column contents */
#quizzesTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.5rem 1.25rem !important;
    min-height: 60px !important;
}

#quizzesTable tbody tr {
    height: auto !important;
    min-height: 60px !important;
}

#quizzesTable tbody td:first-child {
    text-align: center !important;
}

#quizzesTable thead th {
    text-align: center !important;
    padding: 1.25rem 1.25rem !important;
}

#quizzesTable thead th:first-child {
    text-align: center !important;
}

/* Quizzes Table - Grading Period Column Overflow Fix */
/* Quizzes Table - Grading Period Badge Styling (matching grading periods page) */
#quizzesTable tbody td .grading-period-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Attendance Table Content Styling */
#attendanceTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.5rem 1.25rem !important;
    min-height: 70px !important;
}

/* Center all content within attendance table cells */
#attendanceTable tbody td .d-flex {
    justify-content: center !important;
    align-items: center;
}

/* Center badges, status elements, and action buttons */
#attendanceTable tbody td .badge,
#attendanceTable tbody td .status-badge,
#attendanceTable tbody td .lesson-date-wrapper,
#attendanceTable tbody td .lesson-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Attendance Table Row Styling */
#attendanceTable tbody tr {
    height: auto !important;
    min-height: 70px !important;
    transition: background-color 0.2s ease;
}

#attendanceTable tbody tr:hover {
    background-color: #f8f9fa;
}

#attendanceTable thead th {
    text-align: center !important;
    padding: 1.25rem 1.25rem !important;
    vertical-align: middle !important;
}

/* Students Table Content Styling - Shortened Content */
#studentsTable {
    table-layout: fixed !important;
    width: 100% !important;
}

#studentsTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0.75rem 0.5rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Full Name column - shorter width */
#studentsTable tbody td:first-child {
    width: 150px !important;
    max-width: 150px !important;
    text-align: left !important;
    padding-left: 0.75rem !important;
}

/* Allow full name to show on hover but keep it short */
#studentsTable tbody td strong {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem !important;
}

/* Activity and Quiz columns - centered and compact */
#studentsTable tbody td:nth-child(2),
#studentsTable tbody td:nth-child(3) {
    width: 90px !important;
    max-width: 90px !important;
    text-align: center !important;
}

/* Average Grade column - centered and compact */
#studentsTable tbody td:nth-child(4) {
    width: 110px !important;
    max-width: 110px !important;
    text-align: center !important;
}

/* Date Created column - shorter format */
#studentsTable tbody td:nth-child(5) {
    width: 120px !important;
    max-width: 120px !important;
    text-align: center !important;
    font-size: 0.75rem !important;
}

/* Status column - centered */
#studentsTable tbody td:nth-child(6) {
    width: 100px !important;
    max-width: 100px !important;
    text-align: center !important;
}

/* Actions column - keep original width */
#studentsTable tbody td:nth-child(7) {
    width: 140px !important;
    max-width: 140px !important;
    text-align: center !important;
}

/* Center badges and action buttons */
#studentsTable tbody td .badge,
#studentsTable tbody td .status-badge,
#studentsTable tbody td .lesson-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 0.85rem !important;
    padding: 0.4rem 0.6rem !important;
}

/* Semesters Table Content Styling */
#semestersTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.5rem 1.25rem !important;
    min-height: 70px !important;
}

/* Center all content within semesters table cells */
#semestersTable tbody td .d-flex {
    justify-content: center !important;
    align-items: center;
}

/* Center badges, status elements, and action buttons */
#semestersTable tbody td .badge,
#semestersTable tbody td .status-badge,
#semestersTable tbody td .lesson-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Semesters Table Row Styling */
#semestersTable tbody tr {
    height: auto !important;
    min-height: 70px !important;
    transition: background-color 0.2s ease;
}

#semestersTable tbody tr:hover {
    background-color: #f8f9fa;
}

#semestersTable thead th {
    text-align: center !important;
    padding: 1.25rem 1.25rem !important;
    vertical-align: middle !important;
}

/* Students Table Row Styling - more compact */
#studentsTable tbody tr {
    height: auto !important;
    min-height: 55px !important;
}

/* Students Table Header - more compact */
#studentsTable thead th {
    text-align: center !important;
    padding: 0.75rem 0.5rem !important;
    vertical-align: middle !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#studentsTable thead th:first-child {
    width: 150px !important;
    text-align: left !important;
    padding-left: 0.75rem !important;
}

#studentsTable thead th:nth-child(2),
#studentsTable thead th:nth-child(3) {
    width: 90px !important;
}

#studentsTable thead th:nth-child(4) {
    width: 110px !important;
}

#studentsTable thead th:nth-child(5) {
    width: 120px !important;
}

#studentsTable thead th:nth-child(6) {
    width: 100px !important;
}

#studentsTable thead th:nth-child(7) {
    width: 140px !important;
}

#studentsTable thead th:nth-child(2),
#studentsTable thead th:nth-child(3) {
    width: 90px !important;
}

#studentsTable thead th:nth-child(4) {
    width: 110px !important;
}

#studentsTable thead th:nth-child(5) {
    width: 120px !important;
}

#studentsTable thead th:nth-child(6) {
    width: 100px !important;
}

#studentsTable thead th:nth-child(7) {
    width: 140px !important;
}

/* Teachers Table Content Styling */
#teachersTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.5rem 1.25rem !important;
    min-height: 60px !important;
}

/* Allow left alignment for text content within centered cells */
#teachersTable tbody td .d-flex {
    justify-content: flex-start;
    align-items: center;
    text-align: left;
}

/* Center badges, status elements, and action buttons */
#teachersTable tbody td .badge,
#teachersTable tbody td .status-badge,
#teachersTable tbody td .lesson-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Center ID and Department badges */
#teachersTable tbody td .d-flex.justify-content-center {
    justify-content: center !important;
}

/* Full Name column styling */
#teachersTable tbody td .fw-semibold {
    font-weight: 600;
    color: #012970;
    transition: color 0.2s ease;
}

#teachersTable tbody td .fw-semibold:hover {
    color: #667eea;
}

/* Email column styling */
#teachersTable tbody td a {
    transition: color 0.2s ease;
}

#teachersTable tbody td a:hover {
    color: #667eea !important;
    text-decoration: underline !important;
}

/* Date column styling */
#teachersTable tbody td .small {
    color: #495057;
}

#teachersTable tbody tr {
    height: auto !important;
    min-height: 60px !important;
    transition: background-color 0.2s ease;
}

#teachersTable tbody tr:hover {
    background-color: #f8f9fa;
}

#teachersTable thead th {
    text-align: center !important;
    padding: 1.25rem 1.25rem !important;
}

/* Grading Periods Table Styling */
#gradingPeriodsTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.5rem 1.25rem !important;
    min-height: 70px !important;
}

/* Center all content within grading periods table cells */
#gradingPeriodsTable tbody td .d-flex {
    justify-content: center !important;
    align-items: center;
}

/* Center badges, status elements, and action buttons */
#gradingPeriodsTable tbody td .badge,
#gradingPeriodsTable tbody td .status-badge,
#gradingPeriodsTable tbody td .grading-period-badge,
#gradingPeriodsTable tbody td .lesson-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Grading Periods Table Row Styling */
#gradingPeriodsTable tbody tr {
    height: auto !important;
    min-height: 70px !important;
    transition: background-color 0.2s ease;
}

#gradingPeriodsTable tbody tr:hover {
    background-color: #f8f9fa;
}

#gradingPeriodsTable thead th {
    text-align: center !important;
    padding: 1.25rem 1.25rem !important;
    vertical-align: middle !important;
}

/* Subjects Table Styling */
#subjectsTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.5rem 1.25rem !important;
    min-height: 70px !important;
}

/* Center all content within subjects table cells */
#subjectsTable tbody td .d-flex {
    justify-content: center !important;
    align-items: center;
}

/* Center badges, status elements, and action buttons */
#subjectsTable tbody td .badge,
#subjectsTable tbody td .status-badge,
#subjectsTable tbody td .lesson-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Subjects Table Row Styling */
#subjectsTable tbody tr {
    height: auto !important;
    min-height: 70px !important;
    transition: background-color 0.2s ease;
}

#subjectsTable tbody tr:hover {
    background-color: #f8f9fa;
}

#subjectsTable thead th {
    text-align: center !important;
    padding: 1.25rem 1.25rem !important;
    vertical-align: middle !important;
}

/* Activity Modal Styling */
.activity-modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.activity-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.activity-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

.activity-modal-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.activity-modal-title i {
    font-size: 1.75rem;
    margin-right: 0.5rem;
}

.activity-modal-footer {
    border-top: 2px solid #f1f3f5;
    padding: 1.5rem 2rem;
    background: #fafbfc;
}

.btn-cancel-activity {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-cancel-activity:hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
    color: white;
}

.btn-save-activity {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-save-activity:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white;
}

/* Activity Form Styling */
.form-section {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.form-section-title {
    color: #495057;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
}

.form-section-title i {
    color: #667eea;
    font-size: 1.25rem;
}

.activity-form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.activity-form-label i {
    color: #667eea;
    margin-right: 0.25rem;
}

.activity-form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.activity-form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
    transform: translateY(-1px);
}

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

.activity-guidelines {
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
    border: 2px solid #b3d9ff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.activity-guidelines h6 {
    color: #0c63e4;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.activity-guidelines h6 i {
    font-size: 1.25rem;
}

.activity-guidelines ul {
    color: #0c63e4;
}

.activity-guidelines ul li {
    margin-bottom: 0.5rem;
}

.file-upload-wrapper {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.file-upload-wrapper:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-input-wrapper {
    position: relative;
}

/* My Activities Table Styling */
#myActivitiesTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.25rem 0.75rem !important;
    min-height: 70px !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

#myActivitiesTable tbody td:first-child {
    text-align: left !important;
    padding: 1.25rem 1rem !important;
}

/* Prevent content overflow in grade column */
#myActivitiesTable tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 130px;
}

/* Prevent content overflow in actions column */
#myActivitiesTable tbody td:last-child {
    min-width: 90px;
    max-width: 120px;
}

#myActivitiesTable tbody td .d-flex {
    justify-content: center !important;
    align-items: center;
}

#myActivitiesTable tbody td:first-child .d-flex {
    justify-content: flex-start !important;
}

#myActivitiesTable thead th {
    text-align: center !important;
    padding: 1rem 1rem !important;
    vertical-align: middle !important;
    font-size: 0.9rem;
}

#myActivitiesTable thead th:first-child {
    text-align: left !important;
    padding: 1rem 1.25rem !important;
}

/* Activity Title Column Styling */
#myActivitiesTable tbody td .activity-title-icon-wrapper {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

#myActivitiesTable tbody td .activity-title-icon-wrapper i {
    font-size: 1rem;
}

#myActivitiesTable tbody td .activity-title-content {
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

/* Improve badge and status badge display */
#myActivitiesTable tbody td .badge,
#myActivitiesTable tbody td .status-badge,
#myActivitiesTable tbody td .grading-period-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Grading Period Badge Colors - Ensure consistent sizing */
#myActivitiesTable tbody td .grading-period-badge {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.75rem !important;
    min-width: fit-content;
}

/* Better spacing for flex columns */
#myActivitiesTable tbody td .d-flex.flex-column {
    gap: 0.25rem;
}

/* Reduce button sizes in activity file column */
#myActivitiesTable tbody td .btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* Better text sizing */
#myActivitiesTable tbody td small {
    line-height: 1.3;
}

/* My Quizzes Table Styling */
#myQuizzesTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.25rem 0.75rem !important;
    min-height: 70px !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

#myQuizzesTable tbody td:first-child {
    text-align: left !important;
    padding: 1.25rem 1rem !important;
}

#myQuizzesTable tbody td:nth-child(2) {
    text-align: left !important;
}

#myQuizzesTable tbody td .d-flex {
    justify-content: center !important;
    align-items: center;
}

#myQuizzesTable tbody td:first-child .d-flex,
#myQuizzesTable tbody td:nth-child(2) .d-flex {
    justify-content: flex-start !important;
}

#myQuizzesTable thead th {
    text-align: center !important;
    padding: 1rem 1rem !important;
    vertical-align: middle !important;
    font-size: 0.9rem;
}

#myQuizzesTable thead th:first-child,
#myQuizzesTable thead th:nth-child(2) {
    text-align: left !important;
    padding: 1rem 1.25rem !important;
}

/* Quiz Title Column Styling */
#myQuizzesTable tbody td .activity-title-icon-wrapper {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

#myQuizzesTable tbody td .activity-title-icon-wrapper i {
    font-size: 1rem;
}

#myQuizzesTable tbody td .activity-title-content {
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

/* Improve badge and status badge display */
#myQuizzesTable tbody td .badge,
#myQuizzesTable tbody td .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Better spacing for flex columns */
#myQuizzesTable tbody td .d-flex.flex-column {
    gap: 0.25rem;
}

/* Prevent content overflow in score column */
#myQuizzesTable tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 130px;
}

/* Prevent content overflow in actions column */
#myQuizzesTable tbody td:last-child {
    min-width: 90px;
    max-width: 120px;
}

/* My Exams Table Styling */
#myExamsTable tbody td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 1.25rem 0.75rem !important;
    min-height: 70px !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

#myExamsTable tbody td:first-child {
    text-align: left !important;
    padding: 1.25rem 1rem !important;
}

#myExamsTable tbody td:nth-child(2) {
    text-align: left !important;
}

#myExamsTable tbody td .d-flex {
    justify-content: center !important;
    align-items: center;
}

#myExamsTable tbody td:first-child .d-flex,
#myExamsTable tbody td:nth-child(2) .d-flex {
    justify-content: flex-start !important;
}

#myExamsTable thead th {
    text-align: center !important;
    padding: 1rem 1rem !important;
    vertical-align: middle !important;
    font-size: 0.9rem;
}

#myExamsTable thead th:first-child,
#myExamsTable thead th:nth-child(2) {
    text-align: left !important;
    padding: 1rem 1.25rem !important;
}

/* Exam Title Column Styling */
#myExamsTable tbody td .activity-title-icon-wrapper {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

#myExamsTable tbody td .activity-title-icon-wrapper i {
    font-size: 1rem;
}

#myExamsTable tbody td .activity-title-content {
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

/* Improve badge and status badge display */
#myExamsTable tbody td .badge,
#myExamsTable tbody td .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Better spacing for flex columns */
#myExamsTable tbody td .d-flex.flex-column {
    gap: 0.25rem;
}

/* Prevent content overflow in score column */
#myExamsTable tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 130px;
}

/* Prevent content overflow in actions column */
#myExamsTable tbody td:last-child {
    min-width: 90px;
    max-width: 120px;
}

/* Header Logo Improvements */
.header-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover .header-logo-img {
    transform: scale(1.05);
}

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

.logo:hover {
    opacity: 0.9;
}

.logo span {
    transition: color 0.3s ease;
}

.logo:hover span {
    color: #0d6efd;
}

@media (max-width: 991px) {
    .header-logo-img {
        height: 32px;
    }
    
    .logo span {
        font-size: 1.1rem;
    }
}

/* Student Grades Table Styling - Vertical Compact Layout */
#studentGradesTable tbody td {
    text-align: center;
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

#studentGradesTable tbody td:first-child {
    text-align: left !important;
    padding: 0.75rem 1rem !important;
}

#studentGradesTable thead th {
    text-align: center !important;
    padding: 0.75rem 0.5rem !important;
    vertical-align: middle !important;
    font-size: 0.85rem;
    font-weight: 600;
}

#studentGradesTable thead th:first-child {
    text-align: left !important;
    padding: 0.75rem 1rem !important;
}

.student-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.95rem;
    flex-shrink: 0;
}

#studentGradesTable tbody td .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
}

#studentGradesTable tbody td .grade-item {
    min-width: 70px;
}

#studentGradesTable tbody td .overall-grade {
    margin-top: 0.25rem;
}

#studentGradesTable tbody td .grade-item small,
#studentGradesTable tbody td .overall-grade small {
    font-weight: 500;
    color: #6c757d;
}

/* Make table more compact */
#studentGradesTable {
    font-size: 0.9rem;
}

#studentGradesTable .lessons-table-wrapper {
    overflow-x: auto;
}