html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 0;
}

/* ========== TABLE STYLES ========== */

/* Table container with enhanced styling */
.table-responsive {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: visible;
    background: white;
    margin-bottom: .5rem;
    position: relative;
}

    /* Decorative gradient bar on top of table */
    .table-responsive::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #3498db 0%, #2ecc71 25%, #f39c12 50%, #e74c3c 75%, #9b59b6 100%);
        z-index: 1;
        border-radius: 10px 10px 0 0;
    }

/* Base table styling */
.table {
    margin-bottom: 0;
}

    /* Modern table header with gradient matching navbar/footer */
    .table thead th {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
        font-weight: 600;
        border: none;
        padding: 1rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
        letter-spacing: 0.5px;
        position: relative;
    }

    /* Alternative header style for table-primary */
    .table thead.table-primary th {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
    }

    /* Table body cells with nowrap */
    .table tbody td,
    .table tbody th {
        white-space: nowrap;
        vertical-align: middle;
        border-bottom: 1px solid #e9ecef;
    }

    /* Modern table row hover effect */
    .table tbody tr {
        transition: background-color 0.2s ease;
    }

        .table tbody tr:hover {
            background-color: #f8f9fa;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

/* Striped rows with modern colors */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

    .table-striped tbody tr:nth-of-type(odd):hover {
        background-color: #f8f9fa;
    }

/* Modern table footer matching header */
.table tfoot th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    font-weight: 700;
    padding: 1rem 0.75rem;
    border: none;
    white-space: nowrap;
    position: relative;
}

    /* Decorative gradient bar on bottom of table footer */
    .table tfoot th:first-child::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #3498db 0%, #2ecc71 25%, #f39c12 50%, #e74c3c 75%, #9b59b6 100%);
    }

/* Bordered tables with softer borders */
.table-bordered {
    border: 1px solid #dee2e6;
}

    .table-bordered th,
    .table-bordered td {
        border: 1px solid #e9ecef;
    }

/* Modern table with hover effects */
.table-hover tbody tr:hover {
    background-color: rgba(44, 62, 80, 0.05);
}

/* Small table adjustments */
.table-sm th,
.table-sm td {
    padding: 0.25rem 0.65rem;
    font-size: 0.875rem;
}

/* Center aligned text in tables */
.table .text-center {
    text-align: center;
}

/* Table light header alternative */
.table thead.table-light th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
    font-weight: 600;
}

/* Sortable header styling */
.table th.sortHeader {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem;
}

    .table th.sortHeader:hover {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }

    .table th.sortHeader i {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        transition: all 0.3s ease;
    }

/* Enhanced button groups in tables */
.table .btn-group .btn {
    white-space: nowrap;
}

/* Badge styling in tables */
.table .badge {
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* Code elements in tables */
.table code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
}

/* Responsive table improvements for mobile */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
    }

    .table thead th {
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
    }

    .table tbody td,
    .table tbody th {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .table-sm th,
    .table-sm td {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ========== FORM INPUTS ========== */

.btn-nexus-sm {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

.inputSwitch {
    cursor: pointer;
}

input[readonly],
input[readonly]:hover,
input[readonly]:focus {
    background-color: var(--bs-secondary-bg, #e9ecef);
}

/* ========== BADGES ========== */

.nexus-badge-purple {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nexus-badge-cyan {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status badge color variants with gradients - Nexus specific */
.nexus-badge-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    color: #fff !important;
}

.nexus-badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: #fff !important;
}

.nexus-badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #212529 !important;
}

.nexus-badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: #fff !important;
}

.nexus-badge-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: #fff !important;
}

.nexus-badge-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%) !important;
    color: #fff !important;
}

/* ========== NEXUS CARDS ========== */

/* Base card styling with modern shadow and border radius */
.nexus-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: white;
    position: relative;
}

    /* Decorative gradient bar on top of card */
    .nexus-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #3498db 0%, #2ecc71 25%, #f39c12 50%, #e74c3c 75%, #9b59b6 100%);
        z-index: 1;
    }

    /* Card hover effect */
    .nexus-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    /* Card header with gradient matching tables - increased height */
    .nexus-card .card-header {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
        border: none;
        padding: 1.5rem 1rem;
        font-weight: 600;
        position: relative;
    }

        .nexus-card .card-header h6 {
            margin: 0;
            font-size: 0.95rem;
            letter-spacing: 0.3px;
        }

        .nexus-card .card-header i {
            color: #3498db;
        }

        /* Badge styling within card header */
        .nexus-card .card-header .badge {
            font-size: 0.7rem;
            padding: 0.25rem 0.5rem;
            font-weight: 600;
            letter-spacing: 0.5px;
        }

    /* Card body styling */
    .nexus-card .card-body {
        padding: 1.25rem;
        background: #ffffff;
    }

        /* Image containers within cards */
        .nexus-card .card-body img {
            transition: transform 0.3s ease;
            border: 2px solid #e9ecef;
            padding: 0.25rem;
            background: white;
        }

            .nexus-card .card-body img:hover {
                transform: scale(1.05);
                border-color: #3498db;
            }

        /* Text styling in card body */
        .nexus-card .card-body p {
            line-height: 1.6;
            margin-bottom: 0.5rem;
        }

        .nexus-card .card-body strong {
            color: #2c3e50;
            font-weight: 600;
        }

        /* Section titles within cards */
        .nexus-card .card-body h6 {
            color: #34495e;
            font-size: 0.875rem;
            font-weight: 700;
            margin-bottom: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #e9ecef;
            padding-bottom: 0.5rem;
        }

        /* Badge groups in card body */
        .nexus-card .card-body .badge {
            font-size: 0.75rem;
            padding: 0.35rem 0.65rem;
            font-weight: 600;
            margin: 0.15rem;
            transition: all 0.2s ease;
        }

            .nexus-card .card-body .badge:hover {
                transform: scale(1.05);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            }

.nexus-bg-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Card footer uses Bootstrap default styles */

/* Responsive adjustments for cards */
@media (max-width: 768px) {
    .nexus-card {
        border-radius: 10px;
        margin-bottom: 1rem;
    }

        .nexus-card .card-header {
            padding: 1.25rem 0.875rem;
        }

            .nexus-card .card-header h6 {
                font-size: 0.875rem;
            }

        .nexus-card .card-body {
            padding: 1rem;
        }
}

/* Animation for card entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nexus-card {
    animation: fadeInUp 0.4s ease-out;
}
