:root {
    --primary-color: #4a6ee0;
    --primary-hover: #3a5bbf;
    --secondary-color: #6c757d;
    --bg-color: #f4f7fa;
    --sidebar-bg: #1a1e27;
    --sidebar-hover: #293040;
    --text-primary: #333333;
    --text-muted: #888888;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    /* Added smoothed font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Beautiful custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Overriding Bootstrap Cards */
.card {
    border: none !important;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background-color: var(--card-bg);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1rem;
}

/* Auth Page specific styling */
.auth-bg {
    background: linear-gradient(135deg, #f4f7fa 0%, #e0e8f5 100%);
    position: relative;
}

.auth-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 15% 50%, rgba(74, 110, 224, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(74, 110, 224, 0.08), transparent 25%);
    z-index: 0;
    pointer-events: none;
}

.auth-card {
    z-index: 1;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.auth-logo-text {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 2.25rem 0.6rem 1rem;
    /* right padding must stay large to clear the arrow */
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 110, 224, 0.2);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 0.4rem;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon .form-control {
    padding-left: 2.5rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 110, 224, 0.3);
}

/* Sidebar Layout */
#sidebar {
    background-color: var(--sidebar-bg) !important;
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1040;
    transition: all 0.3s;
}

#sidebar .brand-container {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
}

#sidebar .brand-text {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    font-size: 1.1rem;
}

#sidebar .nav-item {
    margin: 0.05rem 1rem;
}

#sidebar .nav-link {
    color: #a0aec0 !important;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
}

#sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

#sidebar .nav-link:hover,
#sidebar .nav-link:focus,
#sidebar .nav-link.active {
    background-color: var(--sidebar-hover);
    color: #fff !important;
    transform: translateX(4px);
}

#sidebar .nav-link:hover i,
#sidebar .nav-link.active i {
    opacity: 1;
    color: #60a5fa;
}

#sidebar .nav-link[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* Sidebar Responsive Behavior */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        /* Hidden by default */
        bottom: 0;
        height: 100vh;
        z-index: 1050;
        visibility: hidden;
    }

    #sidebar.show {
        left: 0;
        /* Slide in */
        visibility: visible;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1045;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Navbar Top */
.top-navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1.5rem;
    border: none !important;
    z-index: 1030;
    position: sticky;
    top: 0;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.navbar-user:hover {
    background: #f1f5f9;
}

.user-avatar {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* DataTables Overrides */
table.dataTable.table-striped>tbody>tr:nth-of-type(2n+1)>* {
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.01) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
}

.dataTables_wrapper .row {
    margin-bottom: 0.5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.25rem !important;
    margin-top: 0 !important;
}

table.dataTable {
    border-collapse: collapse !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.5rem !important;
}

table.dataTable thead th {
    border-bottom: 2px solid #e2e8f0;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.5rem !important;
}

table.dataTable tbody td {
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem !important;
}

/* Responsive Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 500;
}

/* Add generic page header padding */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Public landing page */
.landing-hero {
    position: relative;
    z-index: 1;
}

.landing-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.landing-chip {
    background: #ffffff;
    border: 1px solid #dbe5f1;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
}

.landing-feature-card {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}