:root {
    /* Verdigris palette */
    --verdigris: #1C6561;
    --verdigris-light: #287D77;
    --verdigris-lighter: #5BA19C;
    --verdigris-dark: #144A46;
    --verdigris-darker: #0C2E2B;

    /* Rust palette */
    --rust: #A13942;
    --rust-light: #B54B54;
    --rust-dark: #7A2B31;
    --rust-darker: #5C1F24;

    --cream: #F5F2E9;
    --dark-gray: #333333;
    --medium-gray: #666666;
    --light-gray: #E5E5E5;
}

.btn-primary {
    background-color: var(--verdigris);
    border-color: var(--verdigris);
}

.btn-primary:hover {
    background-color: var(--verdigris-dark);
    border-color: var(--verdigris-dark);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    padding-bottom: 2rem;
}

.top-nav {
    background-color: var(--verdigris);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

.sidebar {
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    width: 250px;
    position: fixed;
    top: 56px; /* Height of the navbar */
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    overflow-y: auto;
}

.main-content {
    margin-left: 250px;
    margin-top: 56px; /* Push content below the fixed navbar */
    padding: 20px;
    min-height: calc(100vh - 56px);
}

/* Menu text in black, icons in rust */
.sidebar .nav-link {
    color: var(--dark-gray);
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    font-weight: 400;
    font-size: 0.9375rem;
}

/* Make just the icons rust-colored */
.sidebar .nav-link i {
    color: var(--rust);
}

.sidebar .nav-link:hover {
    background-color: var(--light-gray);
    color: var(--dark-gray);
}

/* Active menu items with white text and rust background */
.sidebar .nav-link.active {
    background-color: var(--rust);
    color: white;
    border-left: 4px solid var(--rust-darker);
}

/* Keep icons white when menu item is active */
.sidebar .nav-link.active i {
    color: white;
}

.sidebar .submenu {
    background-color: #f8f9fa;
    padding-left: 1rem;
}

.sidebar .submenu .nav-link {
    padding: 0.5rem 1.25rem;
    font-weight: normal;
    font-size: 0.875rem;
}

.navbar-brand {
    font-weight: bold;
    color: white !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dropdown-item:hover {
    background-color: var(--verdigris-lighter);
}

.btn-primary {
    background-color: var(--verdigris);
    border-color: var(--verdigris);
}

.btn-primary:hover {
    background-color: var(--verdigris-dark);
    border-color: var(--verdigris-dark);
}

/* Completely remove all default Bootstrap carets */
.dropdown-toggle::after,
.submenu-toggle::after {
    display: none !important;
}

/* Style for the right-aligned caret */
.submenu-toggle .fa-chevron-down {
    transition: transform 0.2s;
    font-size: 0.75rem;
    opacity: 0.7;
}

.submenu-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Card styling */
.card {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

/* Table styling */
.table {
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
}

.table thead th {
    border-top: none;
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--medium-gray);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* Form styling */
.form-control:focus {
    border-color: var(--verdigris-light);
    box-shadow: 0 0 0 0.25rem rgba(28, 101, 97, 0.25);
}

.btn-success {
    background-color: var(--verdigris);
    border-color: var(--verdigris);
}

.btn-success:hover {
    background-color: var(--verdigris-dark);
    border-color: var(--verdigris-dark);
}

.btn-danger {
    background-color: var(--rust);
    border-color: var(--rust);
}

.btn-danger:hover {
    background-color: var(--rust-dark);
    border-color: var(--rust-dark);
}

/* Toast notifications */
.toast {
    background-color: white;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Badge styling */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge-primary {
    background-color: var(--verdigris);
}

.badge-secondary {
    background-color: var(--medium-gray);
}

.badge-success {
    background-color: #198754;
}

.badge-danger {
    background-color: var(--rust);
}

/* Modal styling */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Chart container */
.chart-container {
    position: relative;
    margin: auto;
    min-height: 250px;
}

/* Ensure consistent card heights */
@media (min-width: 992px) {
    .row {
        display: flex;
        flex-wrap: wrap;
    }

    .row > [class*='col-'] {
        display: flex;
        flex-direction: column;
    }

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

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

    .chart-container {
        flex: 1;
    }
}

/* Stat card icon styling */
.rounded-circle.text-center {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.3em 0.8em;
    border-radius: 0.25rem;
    border: none !important;
    background: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--verdigris-lighter) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: transparent !important;
    color: #6c757d !important;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 0.25rem;
    padding: 0.2rem 1.75rem 0.2rem 0.75rem;
}

/* Mobile view adjustments */
@media (max-width: 991px) {
    .sidebar {
        margin-left: -250px;
        transition: margin-left 0.3s;
        z-index: 1030;
    }

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

    .main-content {
        margin-left: 0;
        transition: margin-left 0.3s;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1025;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    /* Slightly increase mobile font weight for better readability on small screens */
    .sidebar .nav-link {
        font-weight: 500;
    }
}

/* User icon button in mobile view */
.btn-link {
    padding: 0.25rem 0.5rem;
    text-decoration: none;
}

.btn-link:focus {
    box-shadow: none;
}
