/* --- Global Variables for Branding --- */
:root {
    --brand-green-dark: #0a3622;
    --brand-green-mid: #0f5132;
    --brand-green-light: #198754;
    --brand-gradient: linear-gradient(90deg, #0a3622 0%, #0f5132 50%, #198754 100%);
    --brand-gradient-diagonal: linear-gradient(145deg, #146c43, #0f5132);
}

/* 1. Force the Dialog Title text to white */
.mud-dialog-title .mud-typography {
    color: white !important;
}

/* 2. Target the Close Icon button */
.mud-dialog-title .mud-button-root.mud-icon-button {
    color: rgba(255, 255, 255, 0.85) !important; /* Slightly transparent white */
}

/* 3. Hover effect for the Close Icon */
.mud-dialog-title .mud-button-root.mud-icon-button:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* --- MudTabs Styling (Bootstrap Style) --- */
.custom-bootstrap-pills .mud-tab-slider {
    display: none !important;
}

/* --- 1. Text Field & Input Styling --- */

/* Changes the label color when the field is focused */
.mud-input-control.mud-input-input-control > .mud-input-control-input-container > .mud-input-label.mud-input-label-animated.mud-input-label-input-control.mud-input-label-focused {
    color: #0f5132 !important;
}

/* Changes the bottom border/underline color on focus */
.mud-input.mud-input-underline:after {
    border-bottom: 2px solid #0f5132 !important;
}

/* If using Outlined fields, change the border color */
.mud-input-outlined.mud-input-outlined-focused .mud-input-outlined-border {
    border-color: #0f5132 !important;
}

.custom-bootstrap-pills .mud-tab {
    border-radius: 50px !important;
    margin: 5px 4px;
    text-transform: none !important;
    font-weight: 500;
    min-height: 40px;
    transition: background-color 0.2s ease;
}

.custom-bootstrap-pills .mud-tab.mud-tab-active {
    background: var(--brand-gradient-diagonal) !important;
    color: white !important;
}

/* --- Dashboard Stat Cards --- */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e0e6ed !important;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
}

.stat-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.stat-icon-container.primary { background: linear-gradient(135deg, #e3f2fd, #bbdefb); color: #1976d2; }
.stat-icon-container.success { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); color: #2e7d32; }
.stat-icon-container.error   { background: linear-gradient(135deg, #ffebee, #ffcdd2); color: #d32f2f; }
.stat-icon-container.warning { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #ef6c00; }

/* --- Table Toolbar & Search Bar --- */
.mud-table-toolbar {
    height: auto !important;
    min-height: 52px !important;
    padding: 8px 16px !important;
}

.themed-search-bar.mud-input-control {
    max-width: 300px;
    background: white;
    border-radius: 50px !important;
}

.themed-search-bar .mud-outline-input {
    border-radius: 50px !important;
    border: 1.5px solid #dee2e6 !important;
}

.themed-search-bar .mud-input-outlined.mud-input-focus .mud-input-outlined-border {
    border: 2px solid var(--brand-green-mid) !important;
    box-shadow: 0 0 8px rgba(15, 81, 50, 0.1);
}

/* --- The Seamless Pill Button Group --- */

/* This is the parent container (The Pill) */
.custom-split-button {
    /* 1. The Background Gradient across the whole group */
    background: var(--brand-gradient) !important;

    /* 2. Shape & Border */
    border-radius: 50px !important;
    border: none !important;

    /* 3. Layout: Keeps buttons and dropdowns in a single horizontal line */
    display: inline-flex !important;
    align-items: center !important;

    /* 4. Cleanup: Prevents inner square buttons from 'bleeding' out of the rounded edges */
    overflow: hidden;
    height: 42px;
    padding: 0 4px; /* Optional: adds a tiny bit of space at the very start/end */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Fixes for MudBlazor's internal button margins inside a container */
.custom-split-button .mud-button-root {
    margin: 0 !important;
    height: 100% !important;
    background: transparent !important; /* Crucial: shows the container's gradient */
    box-shadow: none !important;
}

/*themed-search-bar */

.themed-search-bar.mud-input-control {
    max-width: 300px;
    background: white;
    border-radius: 50px !important;
}

.themed-search-bar .mud-outline-input {
    border-radius: 50px !important;
    border: 2px solid #e0e0e0 !important;
    transition: border-color 0.3s ease;
}

/* Glow effect on focus using your brand green */
.themed-search-bar .mud-input-outlined.mud-input-focus .mud-input-outlined-border {
    border: 2px solid #0f5132 !important;
    box-shadow: 0 0 8px rgba(15, 81, 50, 0.2);
}

.themed-search-bar .mud-input-adornment-start .mud-icon-root {
    color: #0f5132 !important;
}

.custom-split-button .mud-button-root {
    background-color: transparent !important;
    color: white !important;
    box-shadow: none !important;
    border-radius: 0px !important;
    height: 100% !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

.split-dropdown-border {
    display: flex;
    align-items: center;
    height: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* --- Outlined Refresh Button --- */
.refresh-btn-custom {
    border: 1px solid var(--brand-green-mid) !important;
    color: var(--brand-green-mid) !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    text-transform: none !important;
    height: 42px;
    min-width: 120px;
}

/* --- Table Header Styling --- */

/* Table Header Transformation */
.header-gradient {
    /* Very subtle light-to-darker gray gradient */
    background: linear-gradient(180deg, #ffffff 0%, #f1f3f5 100%) !important;
}

.header-gradient th {
    /* Brand Green Text */
    color: #0f5132 !important;
    font-weight: 800 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 12px !important;

    /* The Green Accent Line */
    border-bottom: 3px solid #0f5132 !important;

    /* Remove vertical lines for a cleaner look */
    border-right: none !important;
}

/* Hover effect on sort labels to show the green theme */
.header-gradient th:hover {
    background-color: #e9ecef !important;
}

.header-gradient .mud-table-sort-label-icon {
    color: #198754 !important; /* Lighter green for the sort arrow */
}

.table-header-custom {
    background-color: #f8f9fa !important;
}

.table-header-custom th {
    font-weight: 700 !important;
    color: #495057 !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    padding: 12px !important;
}

.info-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.info-label {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-value {
    font-size: 1rem;
    color: #2d3436;
    font-weight: 500;
}

.details-decorator {
    width: 4px;
    height: 24px;
    background: #0f5132; /* Your green */
    border-radius: 2px;
}

/* Container for the Pill effect */
.custom-button-group {
    display: flex;
    background-color: #0f5132; /* Your primary dark green */
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-pill {
    color: white !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    padding: 6px 20px !important;
    border-radius: 50px !important;
    elevation: 0 !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

/* Individual Button Gradients */
.btn-first {
    background: linear-gradient(145deg, #145c3a, #0f5132) !important;
}

.btn-middle {
    background: transparent !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-last {
    background: #198754 !important;
}

.btn-pill:hover {
    background: #157347 !important;
    filter: brightness(1.1);
}

/* --- Custom Table Pager Styling --- */
.mud-table-pager {
    padding: 12px 24px !important;
    border-top: 1px solid #dee2e6 !important;
    background-color: #f8f9fa !important; /* Matches the header background */
}

/* Style the navigation buttons (Next/Prev) */
.mud-table-pager .mud-button-root {
    color: var(--brand-green-mid) !important;
    transition: all 0.2s ease;
}

.mud-table-pager .mud-button-root:hover {
    background-color: rgba(15, 81, 50, 0.08) !important;
    border-radius: 50%;
}

/* Style the 'Rows per page' select and text */
.mud-table-pager .mud-select .mud-input {
    color: var(--brand-green-mid) !important;
    font-weight: 600;
}

.mud-table-pager .mud-typography {
    font-size: 0.85rem !important;
    font-weight: 500;
    color: #6c757d; /* Bootstrap muted color */
}

/* Change the color of the active pagination arrows */
.mud-table-pager .mud-icon-root.mud-svg-icon {
    fill: var(--brand-green-mid) !important;
}