﻿/* Fixed layout to prevent scrolling below footer */
html {
    height: 97%;
    margin: 0;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* Focus styles */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--focus-ring);
}

/* Layout Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
}

    .sidebar-brand:hover {
        color: var(--accent);
        text-decoration: none;
    }

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Sidebar brand logo - responsive sizing */
.sidebar-brand img {
    width: 48px;
    height: auto;
    transition: all 0.3s ease;
}

/* Smaller on mobile */
@media (max-width: 768px) {
    .sidebar-brand img {
        width: 36px;
    }
}

/* Compact sidebar state */
.sidebar.collapsed .sidebar-brand img {
    width: 32px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
        text-decoration: none;
    }

    .nav-link i {
        width: 20px;
        text-align: center;
    }

/* Submenu Styles */
.has-submenu > .nav-link {
    position: relative;
}

.submenu-arrow {
    transition: transform 0.3s ease;
}

.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-submenu.open .submenu {
    max-height: 500px;
}

/* Menu items */
.nav-item .nav-link {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
}
.nav-link.active {
    background-color: var(--accent);
    color: white;
}
/* Default state for submenu items */
.submenu-item .submenu-link {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
}

    .submenu-item .submenu-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .submenu-item .submenu-link.active {
        background-color: rgba(255, 255, 255, 0.15);
        color: #fff;
        border-left: 3px solid var(--accent);
    }

/* Parent nav-item with open submenu */
.has-submenu.open .nav-link {
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.has-submenu .nav-link.active {
    background-color: transparent;
}

.has-submenu.open .nav-link.parent-of-active {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Parent nav-item with active submenu child - ENHANCED */
.has-submenu .nav-link.parent-active {
    background-color: rgba(52, 152, 219, 0.15);
    color: #fff;
}


/* Keep parent highlighted when submenu is open */
.has-submenu.open .nav-link.submenu-toggle {
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

/* Extra emphasis when parent has active child */
.has-submenu .nav-link.parent-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--accent);
}

/* Make parent relative for the ::before indicator */
.has-submenu .nav-link {
    position: relative;
}

/* Organization menu special styling */
#organization .submenu-link {
    font-size: 0.85rem;
    padding-left: 3rem;
}

    #organization .submenu-link i {
        color: #f39c12;
    }

    #organization .submenu-link:hover i {
        color: #e67e22;
    }

/* Hierarchy action links styling */
.submenu-link[onclick*="showCreateModal"] {
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

    .submenu-link[onclick*="showCreateModal"]:hover {
        border-left-color: #f39c12;
        background-color: rgba(243, 156, 18, 0.1);
    }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--sidebar-solid);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 1.2rem;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

/* Main Content */
/*.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}*/
/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100vw - 250px);
    width: 100%;
    box-sizing: border-box;
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
}

/* Title Bar */
.title-bar {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h4 {
    margin: 0;
    color: var(--text-dark);
    font-weight: 600;
}

.page-title small {
    color: #6c757d;
    font-size: 0.875rem;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar i {
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
}

    .user-avatar i:hover {
        color: var(--accent);
    }

.user-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: #6c757d;
}

.user-dropdown .btn {
    border: none;
    background: none;
    color: #6c757d;
    padding: 0.25rem;
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

/* Guest Info */
.guest-info {
    display: flex;
    align-items: center;
}

.guest-text {
    margin-right: 1rem;
}

.auth-buttons .btn {
    font-size: 0.875rem;
}

/* Content width constraints */
/*.content-container {
    flex: 1;
    padding: 2rem;
    background-color: #f8f9fa;
    max-width: 100%;
    box-sizing: border-box;
}*/

/* Content width constraints */
.content-container {
    flex: 1;
    padding: 2rem;
    background-color: var(--content-bg);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Ensure cards and other elements don't overflow */
.card, .row, .container, .container-fluid {
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure tables and other potentially wide elements don't cause overflow */
table, img, iframe {
    max-width: 100%;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 1rem 2rem;
    margin-top: auto;
    height: 50px;
    z-index: 10;
}

/* Cards and Components */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Feature Cards */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .feature-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Info Cards */
.info-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
}

    .info-card .card-body {
        padding: 2rem;
    }

    .info-card .btn-light {
        background-color: rgba(255, 255, 255, 0.9);
        border: none;
        color: var(--text-dark);
        font-weight: 600;
    }

        .info-card .btn-light:hover {
            background-color: white;
            transform: translateY(-2px);
        }

/* ==================================================================
   COMPONENT LIBRARY
   ================================================================== */

/* Standard Grid Container */
.cgs-grid-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.cgs-grid-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.cgs-grid-title {
    margin: 0;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

.cgs-grid-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.cgs-grid-body {
    padding: 1.5rem;
}

/* Standard Action Buttons */
.cgs-btn-group {
    display: flex;
    gap: 0.25rem;
}

.cgs-action-btn {
    border: none;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .cgs-action-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .cgs-action-btn.info {
        background-color: #17a2b8;
        color: white;
    }

    .cgs-action-btn.primary {
        background-color: var(--accent);
        color: white;
    }

    .cgs-action-btn.danger {
        background-color: #dc3545;
        color: white;
    }

/* Standard Modal Styling */
.cgs-modal .modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
}

    .cgs-modal .modal-dialog.modal-lg {
        max-width: 1000px;
    }

    .cgs-modal .modal-dialog.modal-xl {
        max-width: 1200px;
    }

.cgs-modal .modal-header {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.cgs-modal .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.cgs-modal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

    .cgs-modal .btn-close:hover {
        opacity: 1;
    }

.cgs-modal .modal-body {
    padding: 2rem 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.cgs-modal .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Section Headers */
.cgs-form-section {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

    .cgs-form-section:first-child {
        margin-top: 0;
    }

.cgs-form-section-title {
    color: #3a444f;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

    .cgs-form-section-title i {
        margin-right: 0.5rem;
        color: var(--accent);
    }

/* Standard Slide-Out Panels */
.cgs-slide-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background-color: white;
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .cgs-slide-panel.show {
        right: 0;
    }

    .cgs-slide-panel.wide {
        width: 550px;
        right: -550px;
    }

        .cgs-slide-panel.wide.show {
            right: 0;
        }

.cgs-panel-header {
    padding: 1rem;
    background-color: #34495e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cgs-panel-title {
    font-weight: 500;
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
}

.cgs-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

    .cgs-panel-close:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

/* Panel Body */
.cgs-panel-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #fafafa;
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 152, 219, 0.3) transparent;
}

    .cgs-panel-body::-webkit-scrollbar {
        width: 8px;
    }

/* Panel Footer */
.cgs-panel-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: white;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

/* Panel Sections */
.cgs-panel-section {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cgs-slide-panel.show .cgs-panel-section {
    opacity: 1;
    transform: translateY(0);
}

    .cgs-slide-panel.show .cgs-panel-section:nth-child(1) {
        transition-delay: 0.1s;
    }

    .cgs-slide-panel.show .cgs-panel-section:nth-child(2) {
        transition-delay: 0.2s;
    }

    .cgs-slide-panel.show .cgs-panel-section:nth-child(3) {
        transition-delay: 0.3s;
    }

    .cgs-slide-panel.show .cgs-panel-section:nth-child(4) {
        transition-delay: 0.4s;
    }

    .cgs-slide-panel.show .cgs-panel-section:nth-child(5) {
        transition-delay: 0.5s;
    }

.cgs-panel-section-title {
    color: #3a444f;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

    .cgs-panel-section-title i {
        margin-right: 0.5rem;
        flex-shrink: 0;
    }

/* Panel Overlay */
.cgs-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .cgs-panel-overlay.show {
        opacity: 1;
        visibility: visible;
    }

/* Form Components */

/* ✅ Native dropdown arrows for all form-control selects */
select.form-control,
select.injury-field {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
}

.cgs-field-group {
    margin-bottom: 1rem;
}

    .cgs-field-group label {
        font-weight: 500;
        color: #495057;
        margin-bottom: 0.5rem;
        display: block;
    }

    .cgs-field-group .form-control,
    .cgs-field-group .form-select {
        border-radius: 0.375rem;
        border: 1px solid #ced4da;
        transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    }

        .cgs-field-group .form-control:focus,
        .cgs-field-group .form-select:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
        }

.cgs-required {
    color: #dc3545;
    margin-left: 0.25rem;
}

.cgs-field-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Detail Display Components */
.cgs-detail-field {
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cgs-detail-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cgs-detail-value {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin: 0;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
}

    .cgs-detail-value.emphasized {
        font-weight: 600;
        font-size: 1.1rem;
    }

    .cgs-detail-value.muted {
        color: #6c757d;
        font-style: italic;
    }

.cgs-address-card {
    border-left: 4px solid var(--accent);
    background-color: #f8f9fa;
    border-radius: 0.4rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

    .cgs-address-card h6 {
        color: var(--accent);
        margin-bottom: 0.75rem;
        font-weight: 600;
    }

/* Loading States */
.cgs-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    flex-direction: column;
}

.cgs-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: cgs-spin 1s linear infinite;
}

.cgs-loading-text {
    margin-top: 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

@keyframes cgs-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toast/Notification System */
.cgs-toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1080;
    max-width: 400px;
}

.cgs-toast {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.75rem;
    overflow: hidden;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

    .cgs-toast.show {
        opacity: 1;
        transform: translateX(0);
    }

.cgs-toast-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: white;
}

    .cgs-toast-header.success {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    }

    .cgs-toast-header.error {
        background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    }

    .cgs-toast-header.warning {
        background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
        color: #333;
    }

    .cgs-toast-header.info {
        background: linear-gradient(135deg, #17a2b8 0%, var(--accent) 100%);
    }

.cgs-toast-body {
    padding: 1rem;
    color: #495057;
}

.cgs-toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    padding: 0.25rem;
}

    .cgs-toast-close:hover {
        opacity: 1;
    }

/* Utility Classes */
.cgs-text-primary {
    color: var(--accent) !important;
}

.cgs-bg-primary {
    background-color: var(--accent) !important;
}

.cgs-border-primary {
    border-color: var(--accent) !important;
}

.cgs-shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.cgs-shadow {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.cgs-shadow-lg {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.cgs-rounded {
    border-radius: 0.375rem !important;
}

.cgs-rounded-lg {
    border-radius: 0.5rem !important;
}

.cgs-fade-in {
    animation: cgs-fadeIn 0.3s ease-in;
}

@keyframes cgs-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* DataTables Fixes */
div.dataTables_length {
    position: relative;
    z-index: 20;
}

    div.dataTables_length select {
        width: auto !important;
        min-width: 60px;
    }

.dataTables_length .dropdown-menu {
    position: absolute !important;
    z-index: 1000 !important;
    transform: none !important;
    top: 100% !important;
    left: 0 !important;
    will-change: auto !important;
    min-width: fit-content !important;
}

.dataTables_length .dropdown-toggle::after {
    vertical-align: middle;
}

.dataTables_length .bootstrap-select > .dropdown-toggle {
    position: relative;
}

div.dataTables_filter {
    margin-bottom: 0.5rem;
}

.dataTables_wrapper .table-responsive {
    overflow-x: auto;
    min-height: 300px;
}

@media screen and (max-width: 767px) {
    div.dataTables_length,
    div.dataTables_filter,
    div.dataTables_info,
    div.dataTables_paginate {
        text-align: left;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

        div.dataTables_length select {
            width: 60px !important;
        }
}

.dataTables_paginate .paginate_button {
    padding: 0.25rem 0.35rem !important;
    margin: 0 1px !important;
    font-size: 0.875rem !important;
    min-width: 1.5rem !important;
    box-sizing: border-box !important;
}

    .dataTables_paginate .paginate_button.previous,
    .dataTables_paginate .paginate_button.next {
        padding: 0.25rem 0.5rem !important;
    }

.dataTables_paginate {
    white-space: nowrap !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.1rem !important;
}

    .dataTables_paginate .ellipsis {
        padding: 0 0.25rem !important;
    }

div.dataTables_length select {
    height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    min-width: 60px !important;
    width: auto !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    font-weight: 500 !important;
}

.dataTables_paginate .paginate_button:not(.current):hover {
    background: #e9ecef !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

/* Enhanced DataTable Responsive Fixes */
.dataTables_wrapper {
    width: 100%;
    overflow-x: auto;
}

    .dataTables_wrapper .table {
        max-width: 100%;
        table-layout: auto;
    }

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Responsive padding adjustments */
@media (max-width: 1200px) {
    .content-container {
        padding: 1.20rem;
    }

    .dataTables_wrapper .row {
        flex-wrap: wrap;
    }
    .cgs-grid-body {
        padding: 1rem;
    }
}

@media (max-width: 992px) {
    .content-container {
        padding: 1rem;
    }

    .cgs-grid-body {
        padding: 0.75rem;
    }

    .cgs-grid-header {
        padding: 0.75rem 1rem;
    }
}


@media (max-width: 768px) {
    .content-container {
        padding: 0.75rem;
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }

    .cgs-grid-body {
        padding: 0.5rem;
    }

    .cgs-grid-header {
        padding: 0.75rem;
    }

    /* Reduce title bar padding on mobile */
    .title-bar {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .content-container {
        padding: 0.5rem;
    }

    .cgs-grid-body {
        padding: 0.5rem;
    }

    .cgs-grid-container {
        margin-bottom: 1rem;
    }
}

/* Application Cards */
.app-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    border: 1px solid #f1f3f4;
}

    .app-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.12);
        border-color: #0d6efd;
    }

.app-icon {
    margin-bottom: 16px;
}

.app-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
}

.app-description {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 0;
}

.content-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #f1f3f4;
}

/* Activity List */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

    .activity-item:last-child {
        border-bottom: none;
    }

    .activity-item i {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: #f8f9fa;
        margin-right: 12px;
        flex-shrink: 0;
    }

.activity-content {
    flex-grow: 1;
}

.activity-text {
    display: block;
    color: #495057;
    font-size: 14px;
}

.activity-time {
    color: #6c757d;
    font-size: 12px;
}

/* AI Summary Styling */
.ai-summary-content {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border-left: 4px solid #28a745;
}

    .ai-summary-content h5 {
        color: #28a745;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
    }

        .ai-summary-content h5 i {
            margin-right: 0.5rem;
        }

    .ai-summary-content .summary-text {
        line-height: 1.6;
        white-space: pre-wrap;
    }

.ai-summary-loading {
    text-align: center;
    padding: 2rem;
}

.ai-summary-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
}

.ai-summary-link {
    position: relative;
    overflow: hidden;
}

    .ai-summary-link .fa-star {
        transition: all 0.3s ease;
    }

    .ai-summary-link:hover .fa-star {
        transform: scale(1.2) rotate(5deg);
        color: #ffc107 !important;
        text-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
    }

.ai-star-glow {
    animation: aiStarGlow 2s ease-in-out infinite;
}

@keyframes aiStarGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 20px rgba(255, 193, 7, 0.8), 0 0 30px rgba(255, 193, 7, 0.6);
        transform: scale(1.1);
    }
}

.ai-processing .fa-star {
    animation: aiProcessing 1.5s ease-in-out infinite;
}

@keyframes aiProcessing {
    0%, 100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

.ai-summary-content h5 .fa-star {
    color: #ffc107;
    margin-right: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.ai-quality-rating .fa-star,
.ai-quality-rating .fa-star-half {
    font-size: 0.9rem;
    margin-right: 1px;
}

/* Mobile Navigation Enhancements */
@media (max-width: 991.98px) {
    .mobile-menu-toggle {
        display: block !important;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .nav-link, .submenu-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .submenu-toggle {
        min-height: 52px;
    }

    .submenu-item .submenu-link {
        padding: 1rem 2rem;
        font-size: 0.95rem;
    }

    main {
        animation: fadeIn 0.2s ease-in;
    }

    @keyframes fadeIn {
        from {
            opacity: 0.95;
        }

        to {
            opacity: 1;
        }
    }
}

@media (max-width: 575.98px) {
    .sidebar {
        width: 100%;
    }

    .title-bar {
        padding: 0.75rem 1rem;
    }

    .title-bar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .user-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .user-avatar {
        display: none;
    }

    .content-container {
        padding: 1rem;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

        .auth-buttons .btn {
            width: 100%;
        }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 250px;
    }
}

/* ==================================================================
   LOGIN PAGE STYLES
   ================================================================== */

/* Login page background */
.login-page {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    min-height: 100vh;
    margin: 0;
    padding: 0;
}


/* Right side form container - vertically centered */
.login-form-container {
    max-width: 500px;
    width: 100%;
    padding: 2rem;
}

    .login-form-container .card {
        border: none;
        border-radius: 15px;
        overflow: hidden;
    }

/* Responsive adjustments */
@media (max-width: 991px) {
    .login-branding {
        display: none !important;
    }

    .login-form-container {
        max-width: 600px;
    }
}

@media (max-width: 576px) {
    .login-form-container {
        padding: 1rem;
    }

    .login-form-container .card-body {
        padding: 2rem 1.5rem !important;
    }
}
