html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    height: 100%; /* Ensure html and body take full screen height */
    margin: 0;
    padding: 0;
    overflow: hidden; /* Temporarily hide overflow on the body to see if the issue is in the main layout */
}

/* If you need the scrollbar on the main content, but not the whole page */
.page {
    /* If you are setting .page to 100vh, use min-height instead */
    min-height: 100vh;
    /* or ensure no extra padding/margin is forcing the scrollbar */
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD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uNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.inline-dots-spinner span {
    width: var(--dot-size, 12px);
    height: var(--dot-size, 12px);
    background-color: var(--dot-color, green);
    border-radius: 50%;
    display: inline-block;
    margin: 0 var(--dot-gap, 4px);
    animation: bounce 1.2s infinite ease-in-out;
}

    /* stagger animation */
    .inline-dots-spinner span:nth-child(1) {
        animation-delay: 0s;
    }

    .inline-dots-spinner span:nth-child(2) {
        animation-delay: 0.2s;
    }

    .inline-dots-spinner span:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}


/*.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}*/

/*    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #00A65A;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }*/

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.submenu-color {
    color: white !important;
}

.no-bullets {
    list-style-type: none;
    padding: 0; /* Optional: to remove default indentation */
}

mr-2 {
    margin-right: 2% !important;
}

justify-content-end {
    justify-content: end;
}

font-size-small {
    font-size: small;
}

font-size-medium {
    font-size: medium;
}

/*#app .spinner-border {
    color: green !important;*/ /* Change to your desired color (e.g., #00A65A) */
/*}*/

.font-medium {
    font-size: medium !important;
}

.d-flex.justify-content-between.align-middle.flex-wrap.mt-2 > nav[aria-label="Pagination links"] {
    margin: 0 auto; /* centers GRID pagination */
}

/*MAIN LAYOUT CSS*/

:root {
    /* --- DIMENSIONS --- */
    --sidebar-width-full: 280px;
    --sidebar-width-collapsed: 70px;
    /* --- ELEGANT THEME COLORS --- */
    /* Dark Slate Blue Background (Premium Look) */
    --sidebar-bg: #1e1e2d;
    /* Muted Blue-Grey for inactive text (Reduces eye strain) */
    --sidebar-text: #9899ac;
    /* Vibrant Teal/Green for Active State */
    --active-color: #20c997;
    --active-bg: rgba(32, 201, 151, 0.15); /* Transparent Teal */
}

/* =========================================
   1. SIDEBAR BASE STYLING
   ========================================= */
.sidebar {
    background: var(--sidebar-bg);
    width: var(--sidebar-width-full);
    color: var(--sidebar-text);
    /* Positioning */
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    /* Layout & Animation */
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smoother animation */
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
}

    /* Width Toggles */
    .sidebar.full {
        width: var(--sidebar-width-full);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width-collapsed);
    }

    /* =========================================
   2. NAVIGATION LINKS
   ========================================= */
    .sidebar .nav-link {
        width: auto; /* Allow auto width for margins */
        display: flex;
        align-items: center;
        /* Text Styling */
        color: var(--sidebar-text) !important;
        font-weight: 500;
        /* Spacing & Shape */
        padding: 12px 15px;
        margin: 4px 15px;
        border-radius: 8px;
        transition: all 0.2s ease-in-out;
    }

        /* Hover State */
        .sidebar .nav-link:hover {
            color: #ffffff !important;
            background-color: rgba(255, 255, 255, 0.04);
            transform: translateX(3px); /* Elegant micro-interaction */
        }

        /* Active State */
        .sidebar .nav-link.active {
            background: var(--active-bg) !important;
            color: var(--active-color) !important;
            font-weight: 600;
            box-shadow: none; /* Removed heavy shadow for cleaner look */
        }

        /* Icon Styling */
        .sidebar .nav-link i {
            font-size: 1.1rem;
            margin-right: 12px;
            transition: color 0.2s;
        }

        .sidebar .nav-link.active i {
            color: var(--active-color);
        }

    /* =========================================
   3. COLLAPSED MODE LOGIC (Fixed for Tablet)
   ========================================= */

    /* 1. Reset the Link Container */
    .sidebar.collapsed .nav-link {
        justify-content: center !important; /* Center the content flexbox */
        padding: 0 !important;
        width: 46px;
        height: 46px;
        margin: 6px auto !important;
        border-radius: 10px;
    }

        /* 2. Target the Icon directly to fix "More on right" issue */
        /* We reset margins on the icon AND any wrapper spans */
        .sidebar.collapsed .nav-link i,
        .sidebar.collapsed .nav-link svg {
            margin: 0 !important; /* Remove the gap meant for text */
            font-size: 1.35rem;
            display: block !important; /* Ensure it's never hidden */
            line-height: 1;
        }

        /* 3. Handle Wrapper Spans (The "Administration" Fix) */
        /* If the icon is inside a span, we need that span to shrink-wrap the icon */
        .sidebar.collapsed .nav-link > span {
            display: flex !important;
            align-items: center;
            justify-content: center;
            margin: 0 !important;
            padding: 0 !important;
            width: 100%;
        }

        /* 4. HIDE TEXT LABELS ONLY (Do not hide generic spans) */
        /* Hide elements specifically marked for text or spacing */
        .sidebar.collapsed .nav-link .ms-2,
        .sidebar.collapsed .nav-link .me-2,
        .sidebar.collapsed .nav-link .fade-in,
        .sidebar.collapsed .text-truncate {
            display: none !important;
        }

    /* 5. Hide the Dropdown Arrow (Chevron) */
    .sidebar.collapsed .bi-chevron-down,
    .sidebar.collapsed .bi-chevron-right,
    .sidebar.collapsed .collapse {
        display: none !important;
    }

    /* 6. Header & Footer Centering */
    /* 1. Center the link container itself */
    .sidebar.collapsed .user-profile-link {
        display: flex !important;
        justify-content: center !important; /* Forces content to center */
        padding: 0 !important; /* Remove padding that might push it */
        width: 46px; /* Match the width of other icons */
        height: 46px; /* Match height */
        margin: 0 auto !important; /* Center the box itself */
    }

        /* 2. Fix the Avatar (Green Circle) */
        .sidebar.collapsed .user-profile-link .rounded-circle {
            margin-right: 0 !important; /* Remove the "me-2" gap */
            margin-left: 0 !important; /* Reset any left margins */
            /* Optional: If you still feel it needs to go right, change to: */
            /* margin-left: 4px !important; */
        }

    /* 3. Ensure the logout button aligns with it */
    .sidebar.collapsed .sidebar-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px 0 !important;
        gap: 10px;
    }

    .sidebar.collapsed .sidebar-footer {
        justify-content: center !important;
        padding: 12px 0 !important;
    }

        .sidebar.collapsed .sidebar-footer .ms-2,
        .sidebar.collapsed .sidebar-footer .btn-link {
            display: none !important;
        }

        .sidebar.collapsed .sidebar-footer .rounded-circle {
            margin-right: 0 !important;
            margin-left: 6px; /* Adjust this number to move it more/less right */
        }

/* =========================================
   4. USER PROFILE ANIMATIONS
   ========================================= */
.user-profile-link {
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0 10px; /* Add margin so it doesn't touch edges */
}

    .user-profile-link:hover {
        background-color: rgba(255, 255, 255, 0.05); /* Subtle highlight */
        cursor: pointer;
    }

    /* The Glowing Arrow Effect */
    .user-profile-link .bi-chevron-right {
        opacity: 0.3;
        transition: all 0.3s ease;
    }

    .user-profile-link:hover .bi-chevron-right {
        opacity: 1 !important;
        transform: translateX(3px);
        color: #fff;
    }

    /* Avatar Gradient */
    .user-profile-link .bg-success {
        background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
        box-shadow: 0 3px 8px rgba(32, 201, 151, 0.3);
    }

/* Logout Button Hover */
.hover-danger {
    transition: all 0.2s;
    margin: 0 10px;
    width: auto;
    border-radius: 8px;
}

    .hover-danger:hover {
        background-color: rgba(241, 65, 108, 0.15); /* Soft Red */
        color: #f1416c !important; /* Bright Red */
    }

        .hover-danger:hover i {
            color: #f1416c !important;
        }

/* =========================================
   5. MAIN CONTENT WRAPPER
   ========================================= */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa; /* Light gray page background */
    transition: padding-left 0.3s ease-in-out;
    width: 100%;
}

@media (min-width: 768px) {
    .main-full {
        padding-left: var(--sidebar-width-full);
    }

    .main-collapsed {
        padding-left: var(--sidebar-width-collapsed);
    }
}

/* Mobile Styling */
/* =========================================
   6. MOBILE RESPONSIVENESS (FIXED)
   ========================================= */

/* Mobile Breakpoint (Phones & Tablets < 768px) */
@media (max-width: 767.98px) {

    /* 1. Reset the sidebar position for mobile */
    .sidebar {
        position: fixed;
        top: 56px; /* Height of the top mobile navbar */
        left: 0;
        bottom: 0;
        width: 100% !important; /* Full width on mobile looks better for menus */
        max-width: 300px; /* Limit width if you prefer */
        z-index: 2000;
        box-shadow: 4px 0 15px rgba(0,0,0,0.2);
        /* IMPORTANT: Let Bootstrap control visibility via .collapse */
        display: none;
    }

        /* 2. When Bootstrap adds the 'show' class (Open State) */
        .sidebar.collapse.show {
            display: flex !important; /* Force Flex to override 'block' */
            flex-direction: column;
        }

        /* 3. Disable the 'collapsed' logic on mobile */
        /* Even if isCollapsed is true in C#, on mobile we want full view or hidden */
        .sidebar.collapsed {
            width: 100% !important;
        }

            /* Ensure elements hidden in desktop-collapsed mode are VISIBLE on mobile */
            .sidebar.collapsed .nav-link span,
            .sidebar.collapsed .bi-chevron-down,
            .sidebar.collapsed .collapse,
            .sidebar.collapsed .sidebar-logo,
            .sidebar.collapsed .ms-2 {
                display: inline-block !important; /* Force text to show */
            }

            /* Revert centering logic */
            .sidebar.collapsed .nav-link {
                justify-content: flex-start !important;
                padding-left: 20px !important;
            }

    /* 4. Main Content Adjustment */
    .main-wrapper {
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-top: 60px; /* Push content down so mobile nav doesn't cover it */
        width: 100%;
    }

    /* 5. Hide the Sidebar Toggler inside the sidebar (redundant on mobile) */
    .sidebar .btn-link {
        display: none !important;
    }
}

/*END MAIN LAYOUT CSS*/

/* 1. PAGINATION: Active Page (The current page number) */
.pagination .page-item.active .page-link {
    background-color: #198754 !important; /* Bootstrap Success Green */
    border-color: #198754 !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25); /* Optional: Green Glow on focus */
}

/* 2. PAGINATION: Standard Links (Text color) */
.pagination .page-link {
    color: #198754 !important; /* Green Text */
    border: 1px solid #dee2e6;
}

    /* 3. PAGINATION: Hover State */
    .pagination .page-link:hover {
        background-color: #f8fcf9 !important; /* Very light green background */
        color: #146c43 !important; /* Darker green text */
        border-color: #c3e6cb !important;
    }

    /* 4. PAGINATION: Focus State (Clicking) */
    .pagination .page-link:focus {
        box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25) !important;
    }

/* CUSTOM USER GRID STYLES */
.custom-user-grid thead th {
    background-color: #f9fafb !important;
    color: #6c757d !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e9ecef;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.custom-user-grid tbody td {
    vertical-align: middle;
    border-bottom: 1px solid #f2f2f2;
}

.custom-user-grid tbody tr:hover {
    background-color: #f8fcf9 !important;
}

@media (min-width: 992px) {
    /* Only stick on Large Screens (Landscape Tablet / Desktop) */
    .col-lg-4 .card {
        position: sticky;
        top: 80px; /* Distance from top header */
        z-index: 1;
    }
}

.required::after {
    content: "*";
    color: red;
    margin-left: 2px;
}

.cursor-pointer {
    cursor: pointer;
}

/* CUSTOM REPORT TEMPLATE GRID STYLES */
.custom-report-template-grid thead th {
    background-color: #f9fafb !important;
    color: #6c757d !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e9ecef;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.custom-report-template-grid tbody td {
    vertical-align: middle;
    border-bottom: 1px solid #f2f2f2;
}

.custom-report-template-grid tbody tr:hover {
    background-color: #f8fcf9 !important;
}

.table-fixed {
    table-layout: fixed;
}
 