@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* =========================
   RESET & BASE STYLES
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
}

body {
    min-height: 100vh;
}

/* Ensure navbar is fixed from the start */
.top-navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1100 !important;
}

/* Prevent flash of unstyled content */
#main-wrapper {
    opacity: 1;
}

/* Mobile phones only (portrait and landscape) */
@media (max-width: 576px) {
    body {
        padding-top: 75px !important;
    }
}


/* =========================
   LOGIN CONTAINER
   ========================= */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* background: #f0f5f9; */
}

.login-wrapper {
    width: 100%;
    max-width: 480px;
    /* max-width: 900px; */
    /* Change from 480px to 900px or more */
}

/* =========================
   LOGIN CARD
   ========================= */
.login-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 3rem;
    display: block;
    /* display: grid; */
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Left side - Logo centered */
/* .login-left {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
} */

/* Right side - Form */
.login-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    /* Add this */
    max-width: 100%;
    /* Add this */
}

/* Update logo header to remove the flex and margin */
.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    /* Remove bottom margin */
}

.logo-icon {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    /* Remove right margin */
}

.logo-icon img {
    max-width: 100%;
    height: auto;
}

/* =========================
   LOGO SECTION
   ========================= */
.logo-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.logo-icon {
    width: auto;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.logo-icon .icon {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

/* =========================
   WELCOME SECTION
   ========================= */
.welcome-section {
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    text-align: center;
}

.welcome-subtitle {
    color: #6b7280;
    margin-top: 1rem;
    font-size: 1rem;
    text-align: center;
}

/* =========================
   SOCIAL BUTTONS
   ========================= */
.social-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    background-color: #f9fafb;
}

.social-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

.social-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.btn-close {
    color: #fff !important;
}

/* =========================
   DIVIDER
   ========================= */
.divider-container {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #d1d5db;
}

.divider-text {
    padding: 0 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* =========================
   FORM STYLES
   ========================= */
.login-form {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: #3b82f6;
    ring: 2px;
    ring-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* =========================
   FORM OPTIONS
   ========================= */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.remember-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    color: #3b82f6;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    cursor: pointer;
}

.form-checkbox:focus {
    ring: 2px;
    ring-color: #3b82f6;
}

.remember-text {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.forgot-link {
    font-size: 0.875rem;
    color: #25418a;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #2563eb;
}

/* =========================
   SUBMIT BUTTON
   ========================= */
.submit-btn {
    width: 100%;
    background-color: #25418a;
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.submit-btn:hover {
    background-color: #25418a;
}

.submit-btn:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    ring-offset: 2px;
}

/* =========================
   SIGNUP SECTION
   ========================= */
.signup-section {
    margin-top: 1.5rem;
    text-align: center;
}

.signup-text {
    font-size: 0.875rem;
    color: #4b5563;
}

.signup-link {
    font-size: 0.875rem;
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
    margin-left: 0.25rem;
    transition: color 0.2s;
}

.signup-link:hover {
    color: #2563eb;
}

/* =========================
   FORGOT PASSWORD STYLES
   ========================= */

/* Illustration container */
.forgot-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.forgot-illustration img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Back to Login Section */
.back-to-login {
    margin-top: 0.5rem;
    text-align: center;
    padding: 1rem;
    background-color: #eff6ff;
    border-radius: 0.5rem;
    cursor: pointer;
}

.back-link {
    font-size: 0.875rem;
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: #2563eb;
}

/* Update welcome subtitle for better readability */
.welcome-subtitle {
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 640px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .social-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1.5rem;
    }

    .login-wrapper {
        max-width: 480px;
    }

    .login-left {
        padding: 1rem 0;
    }

    .login-wrapper {
        max-width: 480px;
    }
}

/* =========================
   UTILITY CLASSES
   ========================= */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 1.25rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

/* =========================
   FLASH MESSAGES
   ========================= */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* =========================
   FIX OVERLAPPING ISSUES
   ========================= */

/* Ensure login card and its children are above other elements */
.login-container {
    position: relative;
    z-index: 1;
}

.login-wrapper {
    position: relative;
    z-index: 2;
}

.login-card {
    position: relative;
    z-index: 3;
}

/* Remove any Bootstrap overlay effects */
.login-card *,
.login-card *::before,
.login-card *::after {
    pointer-events: auto !important;
}

/* Ensure form elements are clickable */
.form-input,
.form-checkbox,
.submit-btn,
.forgot-link,
.signup-link,
.social-btn {
    position: relative;
    z-index: 10;
}

/* Remove any conflicting Bootstrap shadows */
.login-card .form-control {
    box-shadow: none !important;
}

.login-card .form-control:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Override Bootstrap button styles */
.submit-btn {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

/* =========================
   HORIZONTAL NAVIGATION
   ========================= */

/* Main Navigation Container */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1100 !important;
    margin-bottom: 50rem;
}

.top-navbar .navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Add this */
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
    /* Add this */
    padding-top: 8px;
    padding-bottom: 8px;

}

.top-navbar .navbar-header>a {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    /* Add this - prevents logo from shrinking */
}

.top-navbar .navbar-header img {
    height: 25px;
    width: auto;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0 2rem;
    gap: 0;
}

/* Navigation Items */
.nav-item {
    position: relative;
}

.nav-item>a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    gap: 0.5rem;
    padding-top: 12px;
    padding-bottom: 12px;

}

.nav-item>a:hover,
.nav-item>a.active {
    color: #3b82f6;
    background-color: #eff6ff;
}

.nav-item>a i {
    font-size: 1rem;
}

/* DEFAULT hidden */
.nav-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 250px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    max-height: none;
    overflow: visible;
}

/* Two-column dropdown class for desktop only */
@media (min-width: 769px) {
    .two-column-dropdown {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-flow: column;
        grid-template-rows: repeat(5, auto);
        min-width: 500px;
        max-width: 700px;
        column-gap: 20px;
    }

    .two-column-dropdown .nav-dropdown-item {
        width: 100%;
    }
}

/* Mobile: Keep default single column behavior */
@media (max-width: 768px) {
    .two-column-dropdown {
        display: block;
        min-width: auto;
        max-width: none;
    }

    .two-column-dropdown .nav-dropdown-item {
        width: 100%;
        display: block;
    }
}

/* DESKTOP hover */
@media (min-width: 769px) {
    .nav-item:hover>.nav-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Dropdown Items */
.nav-dropdown-item {
    list-style: none;
    position: relative;
}

.nav-dropdown-item>a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-dropdown-item>a::before {
    content: "•";
    margin-right: 0.875rem;
    color: #d1d5db;
    font-size: 1rem;
}

.nav-dropdown-item>a:hover,
.nav-dropdown-item>a.sub-active {
    background-color: #f9fafb;
    color: #374151;
}

/* Nested Dropdown (Submenu) */
.nav-dropdown-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    min-width: 280px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s;
    max-height: none;
    overflow: visible;
    list-style: none;
    margin-left: 0.5rem;
    z-index: 1002;
}

/* Nested Dropdown Support */
.nav-dropdown-item.has-submenu {
    position: relative;
}

.nav-dropdown-item.has-submenu>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nested-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
    margin-left: auto;
}

/* Remove bullet point for items with submenu */
.nav-dropdown-item.has-submenu>a::before {
    content: "";
    margin-right: 0.875rem;
}

/* Desktop: Show nested submenu on hover */
@media (min-width: 769px) {
    .nav-dropdown-item.has-submenu:hover>.nav-dropdown-submenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    cursor: pointer;
    padding: 0.5rem;
}


/* =========================
   RESPONSIVE NAVIGATION
   ========================= */
@media (max-width: 768px) {

    .mobile-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 1rem;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-item {
        width: 100%;
    }

    .nav-item>a {
        width: 100%;
    }

    /* DROPDOWN (MOBILE CLICK) */
    .nav-dropdown {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
    }

    .nav-item.open>.nav-dropdown {
        display: block;
    }

    .nav-item.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    .dropdown-arrow {
        margin-left: auto;
    }

    /* Mobile nested submenu */
    .nav-dropdown-submenu {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
        margin-left: 1rem;
        border-left: 2px solid #e5e7eb;
    }

    .nav-dropdown-item.open>.nav-dropdown-submenu {
        display: block;
    }

    .nav-dropdown-item.open .nested-arrow {
        transform: rotate(90deg);
    }
}
.ml-20{
    margin-left: 20px;
}
/* Right Section Styles */
.topnav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    /* This pushes everything to the right */
    flex: 0 1 auto;
    /* Change from flex: 1 to flex: 0 1 auto */
}

/* Filter Wrapper - Full Width Layout */
.filter__wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 100%;
}

.filter__wrapper.w-100 {
    width: 100%;
}

.filter__wrapper form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Input Sections */
.input__section {
    flex: 1;
    min-width: 150px;
}

.input__section .select2-container {
    width: 100% !important;
}

.input__section .select2-container .select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #fff;
}

.input__section .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    color: #495057;
}

.input__section .select2-container .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
}

.input__section .select2-container .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 6px;
}

/* Buttons */
.input__section .btn-search {
    height: 38px;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.input__section .btn-search:hover {
    background-color: #f8f9fa;
}

.search-padding {
    padding: 0.375rem 0.75rem;
}

/* Select2 Dropdown Styling */
.select2-container--krajee .select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-container--krajee .select2-results__option {
    padding: 0.5rem 0.75rem;
}

.select2-container--krajee .select2-results__option--highlighted {
    background-color: #007bff;
    color: white;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
}

.select2-results__options {
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 9;
}

/* User Dropdown */
.topnav-user-dropdown {
    position: relative;
    margin-left: 1rem;
    flex-shrink: 0;
}

.topnav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.topnav-user-btn:hover {
    background-color: #f3f4f6;
}

.topnav-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.topnav-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.topnav-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.topnav-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
}

.topnav-user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topnav-user-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.topnav-user-menu-item:hover {
    background-color: #f3f4f6;
}

.topnav-user-menu-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.topnav-logout-btn {
    color: #ef4444;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .filter__wrapper {
        display: none;
    }
}

@media (max-width: 768px) {
    .topnav-user-info {
        display: none;
    }

    .topnav-right {
        gap: 0.5rem;
    }
}

/* Hidden class */
.hidden {
    display: none;
}

/* Z-index for dropdowns */
.select2-container {
    z-index: 1050 !important;
}

.select2-dropdown {
    z-index: 1051 !important;
}

/* =========================
   DASHBOARD COMING SOON
   ========================= */
.dashboard-wrapper {
    padding: 2rem;

}

/* Coming soon specific styles */
.dashboard-wrapper .display-3 {
    font-size: 3rem;
    font-weight: 700;
}

.dashboard-wrapper .lead {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        padding: 1rem;
        margin-top: 60px;
    }

    .dashboard-wrapper .display-3 {
        font-size: 2rem;
    }

    .dashboard-wrapper .lead {
        font-size: 1rem;
    }
}

/* Report Container Styles */
.report-container {
    padding: 2rem 1.5rem !important;
    min-height: calc(100vh - 80px) !important;
    background-color: #f9fafb !important;
    margin-left: 0 !important;
    margin-top: 90px;
}

.report-container .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Page Header */
.page-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    padding-left: 0 !important;
}
.btn-back {
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #495057;
    flex-shrink: 0;
}
.btn-back .iconify {
    font-size: 24px;
}

/* Extension for page-heading to work with back button */
.page-heading.with-back-button {
    display: flex;
    align-items: center;
}
.page-subheading {
    font-size: 0.9375rem;
    color: #6b7280;
    padding-left: 0 !important;
}

/* Filter Card */
.filter-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.filter-card-header {
    background: #25418a;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-top: 12px;
    padding-bottom: 12px;
}

.filter-card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
}

.filter-card-body {
    padding: 1rem;
    padding-top: 6px;
    padding-bottom: 6px;
    padding-left: 12px;
    padding-right: 12px;


}

/* Results Card */
.results-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-card-header {
    background: #25418a;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-top: 12px;
    padding-bottom: 12px;
}

.results-card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
}

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

/* Form Styling */
.report-filter-form .form-group {
    margin-bottom: 0;
}

.report-filter-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.report-filter-form .form-control {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.report-filter-form .form-control:focus {
    border-color: #25418a;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Action Buttons */
.filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.requisition-item-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: 8px;
    border: 1px solid #e0e0e0 !important;
}

.requisition-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.requisition-item-card .card-header {
    border-radius: 8px 8px 0 0;
}

.requisition-item-card .card-body {
    background-color: #fafafa;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-right: 12px;
    padding-left: 12px;
}

.requisition-item-details [class*="col-"] {
    transition: background-color 0.2s;
    padding: 0.5rem;
    border-radius: 4px;
}

.requisition-item-details [class*="col-"]:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
    font-weight: 500;
}

.dropdown-toggle::after {
    display: none;
}

.btn-link:hover {
    color: #333 !important;
}

.btn-submit {
    background-color: #25418a;
    border: none;
    color: white !important;
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-submit:hover {
    background-color: #25418a;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-reset {
    background-color: #25418a;
    border: 1px solid #25418a;
    color: white !important;
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-reset:hover {
    background-color: #25418a;
    border-color: #25418a;
}

/* Table Styling */
.table-responsive {
    border-radius: 0.5rem;
    overflow-x: auto !important;
    /* Make this !important */
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
    position: relative;
    /* Add this */
}

/* Prevent table from shrinking - force horizontal scroll when needed */
.table-responsive table {
    width: 100%;
    min-width: 100%;
    white-space: nowrap;
    margin-bottom: 0;
}

/* Set minimum width for table cells to prevent excessive compression */
.table-responsive th,
.table-responsive td {
    max-width: none;
    white-space: nowrap;
}

.table-responsive::-webkit-scrollbar-button {
    display: none;
}

/* Custom scrollbar styling - Reduce scrollbar height/width */
.table-responsive::-webkit-scrollbar {
    height: 4px;
    /* Reduce height of horizontal scrollbar */
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #25418a;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* For Firefox */
.table-responsive {
    scrollbar-width: thin;
    /* Options: auto, thin, none */
    scrollbar-color: #25418a #f1f1f1;
    /* thumb color, track color */
}

.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

.table-borderless th {
    font-weight: 600;
    color: #374151;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(249, 250, 251, 0.5);
}

/* ====================================
   FIX FOR GRIDVIEW WITH FILTERS
   ==================================== */

/* Ensure GridView container respects boundaries */
.custom-gridview {
    width: 100%;
    overflow: hidden;
}

.custom-gridview .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
}

/* Force table to allow horizontal scroll when filters are present */
.custom-gridview .table-responsive table {
    min-width: 100%;
    table-layout: auto;
}

/* Filter row cells - prevent expansion */
.custom-gridview table thead tr th {
    vertical-align: top;
    white-space: nowrap;
    min-width: 120px;
}

/* Select2 in table filters - constrain width */
.custom-gridview .select2-container {
    max-width: 100% !important;
    min-width: 150px !important;
}

.custom-gridview .select2-container .select2-selection--single {
    width: 100% !important;
    min-width: 0 !important;
}

/* Serial number column */
.custom-gridview table th:first-child,
.custom-gridview table td:first-child {
    min-width: 50px !important;
    width: auto;
}

/* Actions column */
.custom-gridview table th:last-child,
.custom-gridview table td:last-child {
    min-width: 80px !important;
    width: auto;
}

/* Mobile: Force horizontal scroll */
@media (max-width: 768px) {
    .custom-gridview .table-responsive {
        overflow-x: auto !important;
        display: block !important;
    }

    .custom-gridview .table-responsive table {
        min-width: 800px !important;
        /* Force scroll for tables with filters */
    }

    /* Reduce filter dropdown widths on mobile */
    .custom-gridview .select2-container {
        min-width: 120px !important;
    }

    .custom-gridview table th,
    .custom-gridview table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 576px) {
    .custom-gridview .table-responsive table {
        min-width: 700px !important;
    }

    .custom-gridview .select2-container {
        min-width: 100px !important;
    }

    .custom-gridview table th,
    .custom-gridview table td {
        padding: 0.375rem 0.25rem;
        font-size: 0.75rem;
    }
}

/* Results card body - ensure no overflow */
.results-card-body {
    overflow: hidden;
    width: 100%;
}

/* Prevent Select2 dropdowns from breaking layout */
.results-card-body .select2-container--open {
    z-index: 1051 !important;
}

/* Pagination */
.dataTables_paginate {
    display: flex;
    justify-content: flex-end;
}

.pagination {
    margin: 0;
}

.page-link {
    color: #3b82f6;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.page-link:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* DataTables Info */
.dataTables_info {
    font-size: 0.875rem;
    color: #6b7280;
    padding-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .report-container {
        padding: 1rem !important;

    }

    .page-heading {
        font-size: 1.5rem;
    }

    .filter-card-body,
    .results-card-body {
        padding: 1rem;

        padding-bottom: 12px;
        padding-top: 12px;

    }

    .filter-actions {
        flex-direction: column;
    }

    .btn-submit,
    .btn-reset {
        width: 100%;
    }

    .dataTables_info,
    .dataTables_paginate {
        text-align: center;
        justify-content: center;
    }

    .table {
        font-size: 0.8125rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.625rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .report-container {
        margin-top: 0px;
    }

    .page-heading {
        font-size: 1.25rem;
    }

    .page-subheading {
        font-size: 0.875rem;
    }

    .filter-card-header,
    .results-card-header {
        padding: 1rem;
    }

    .filter-card-title,
    .results-card-title {
        font-size: 1rem;
    }
}

/* Loading State */
#pjax_list.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Additional styles specific to consolidated report */
.table-bordered {
    border: 1px solid #dee2e6;
}

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

.table thead th {
    vertical-align: middle;
}

.table .align-middle {
    vertical-align: middle;
}

.table .text-center {
    text-align: center;
}

.table .fw-bold {
    font-weight: 700;
}

.table .fw-semibold {
    font-weight: 600;
}

.table-primary th {
    background-color: #cfe2ff !important;
    color: #084298;
}

.table-secondary tr {
    background-color: #e2e3e5 !important;
}

.table-info {
    background-color: #cff4fc !important;
}

.bg-info {
    background-color: #25418a !important;
}

.bg-primary {
    background-color: #0d6efd !important;
}

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

.bg-light {
    background-color: #f8f9fa !important;
}

/* Make table scrollable on small screens */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 800px;
        font-size: 0.75rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem;
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .table {
        font-size: 0.7rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.375rem;
    }
}

/* Empty state icon */
.fa-inbox {
    display: block;
}

.fs-5 {
    font-size: 1.25rem;
}

/* Additional styles for list page */
.btn-light {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.btn-light:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.dropdown-menu {
    min-width: 160px;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-menu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-menu .dropdown-item.text-danger:hover {
    background-color: #fff5f5;
    color: #dc3545 !important;
}

.dropdown-divider {
    margin: 0.25rem 0;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.text-primary {
    color: #25418a !important;
    text-decoration: none !important;
}

/* Link hover effect */
.text-primary:hover {
    color: #25418a !important;
    text-decoration: none !important;
}

a {
    color: #25418a !important;
    text-decoration: none !important;
}

.fw-semibold {
    font-weight: 600;
}
/* =========================
   ACTIVE TAB STYLING
   ========================= */

/* Active tab link */
.nav-tabs .nav-link.active {
    background-color: #25418a !important;
    color: #ffffff !important;
    border-color: #25418a !important;
}

/* Active tab link hover state */
.nav-tabs .nav-link.active:hover {
    background-color: #25418a !important;
    color: #ffffff !important;
}

/* Badge inside active tab */
.nav-tabs .nav-link.active .label {
    color: #ffffff !important;
}

/* Default tab styling (inactive tabs) */
.nav-tabs .nav-link {
    color: #374151;
    border: 1px solid transparent;
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s;
}

/* Inactive tab hover */
.nav-tabs .nav-link:hover:not(.active) {
    background-color: #f3f4f6;
    color: #25418a;
}

/* Tab container */
.nav-tabs {
    border-bottom: 2px solid #e5e7eb;
}

/* Badge inside active tab - ensure white color */
.nav-tabs .nav-link.active .label-warning,
.nav-tabs .nav-link.active .label-info,
.nav-tabs .nav-link.active .label-primary,
.nav-tabs .nav-link.active .label-danger {
    color: #ffffff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .label {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 576px) {
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .label {
        font-size: 0.65rem;
        margin-left: 0.25rem;
    }
}
/* Make action buttons more visible */
.table tbody td .dropdown-toggle::after {
    display: none;
}

/* Responsive button text */
@media (max-width: 768px) {
    .btn-submit {
        width: 100%;
        margin-top: 0.5rem;
    }

    .page-heading {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .btn-submit {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Loading State */
#pjx_pattern_requisition.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Improve dropdown alignment on mobile */
@media (max-width: 768px) {
    .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
    }
}

/* Item Card Styles */
.item-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
    transition: box-shadow 0.2s;
}

.item-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.item-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.item-card-body {
    padding: 1.25rem;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.25rem;
}

.bg-primary {
    background-color: #3b82f6 !important;
}

/* Input Group Styles */
.input-group-text {
    border: 1px solid #d1d5db;
    color: #6b7280;
}

.input-group-text.bg-light {
    background-color: #f9fafb;
}

.input-group .form-control:disabled {
    background-color: #f9fafb;
    cursor: not-allowed;
}
.datepicker table tr td.active:active, .datepicker table tr td.active.highlighted:active, .datepicker table tr td.active.active, .datepicker table tr td.active.highlighted.active {
    color: #fff;
    background-color: #25418a;
    border-color: #25418a;
}
/* Form Control Disabled State */
.form-control:disabled,
.form-control[readonly] {
    background-color: #f9fafb;
    opacity: 0.8;
}

/* Button spacing */
.d-flex.gap-2 {
    gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .btn-submit,
    .btn-reset {
        width: 100%;
    }

    .d-flex.gap-2 {
        flex-direction: column;
    }

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

@media (max-width: 576px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }
}

/* Empty state */
.fa-inbox {
    display: block;
}

/* Make back button consistent */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff !important;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

/* Form validation error states */
.has-error .form-control {
    border-color: #dc3545;
}

.has-error .help-block {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Select2 in disabled state */
.select2-container--disabled .select2-selection {
    background-color: #f9fafb !important;
    cursor: not-allowed;
}

/* =========================
   MODAL Z-INDEX FIX
   ========================= */

/* Bootstrap Modal Override */
.modal {
    z-index: 1200 !important;
}

.modal-backdrop {
    z-index: 1199 !important;
}

/* Ensure modal is above navigation */
#commonModalxl,
#commonModalxl .modal-dialog {
    z-index: 1200 !important;
}

/* DatePicker in Modal */
.datepicker-dropdown {
    z-index: 1201 !important;
}

/* Select2 in Modal */
.select2-container--open {
    z-index: 1201 !important;
}

.select2-dropdown {
    z-index: 1202 !important;
}

.kv-date-picker::before {
    content: '\f073';
    font-family: 'FontAwesome';
}

.kv-date-remove::before {
    content: '\f057';
    font-family: 'FontAwesome';
}

.kv-date-remove .fas {
    display: none;
}

.help-block {
    color: red !important;
    font-size: 14px;
}

.required label.control-label:after {
    color: #e32;
    content: ' *';
    display: inline;
}

/* ============================================
       COMMON CHART STYLES (Used by all graphs)
       ============================================ */
.chart-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    background: #224D9A;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    margin: -20px -20px 20px -20px;
}

.chart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chart-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coming-soon {
    font-size: 24px;
    color: #999;
    font-weight: 500;
    text-align: center;
}

/* ============================================
       AVG. VARIANCE CHART STYLES (Heatwave Chart)
       ============================================ */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.heatmap-node {
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.heatmap-node:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.heatmap-node .style-name {
    font-size: 16px;
    margin-bottom: 5px;
}

.heatmap-node .style-plant {
    font-size: 12px;
    opacity: 0.9;
}

.variance-view-more {
    text-align: center;
    margin-top: 20px;
}

.variance-view-more-btn {
    padding: 8px 20px;
    background: #224D9A;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.variance-view-more-btn:hover {
    background: #1a3d7a;
}

/* ============================================
       AVG. VARIANCE CHART - MODAL STYLES
       (Style Selection Modal for Variance Chart)
       ============================================ */
#varianceStylesListContainer .form-check {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: #fff;
}

#varianceStylesListContainer .form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    margin-top: 0;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

#varianceStylesListContainer .form-check-label {
    flex: 1;
    cursor: pointer;
    margin-left: 0;
    padding-left: 0;
}

#varianceStylesListContainer .form-check-label:hover {
    color: #224D9A;
}

/* ============================================
       RN STATUS CHART STYLES
       ============================================ */
.rn-status-style-selection {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.rn-status-style-tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: #224D9A;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    margin-right: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.rn-status-style-tag:hover {
    background-color: #1a3d7a;
}

.rn-status-style-tag .remove-style {
    margin-left: 8px;
    font-weight: bold;
    opacity: 0.8;
}

.rn-status-style-tag .remove-style:hover {
    opacity: 1;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    padding: var(--bs-modal-header-padding);
    border-bottom: var(--bs-modal-header-border-width) solid var(--bs-modal-header-border-color);
    border-top-left-radius: var(--bs-modal-inner-border-radius);
    border-top-right-radius: var(--bs-modal-inner-border-radius);
    background-color: #25418a;
    color: white;
}


/* Modal specific styles */
.modal-form-container {
    max-height: 75vh;
    overflow-y: auto;
}

/* Input group icon styling */
.input-group-text {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
    min-width: 42px;
    justify-content: center;
}

.input-group .form-control:disabled {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    color: #6b7280;
}

/* DatePicker z-index fix for modal */
.datepicker {
    z-index: 99999 !important;
}

/* Select2 in modal */
.modal .select2-container {
    z-index: 99999 !important;
}

.modal .select2-dropdown {
    z-index: 100000 !important;
}

/* Form label styling */
.modal-form-container .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Form select styling */
.form-select,
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Scrollbar styling */
.modal-form-container::-webkit-scrollbar {
    width: 6px;
}

.modal-form-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-form-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modal-form-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Button styling in modal */
.modal-form-container .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Ensure proper spacing in modal */
.modal-form-container .filter-card {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.modal-form-container .filter-card-body {
    padding: 1.25rem;
}

/* Loading state for save button */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-form-container {
        max-height: 80vh;
    }

    .modal-form-container .filter-card-body {
        padding: 1rem;
    }

    .d-flex.gap-2 {
        flex-direction: column;
    }

    .d-flex.gap-2 .btn {
        width: 100%;
    }
}

/* Icon sizing in input groups */
.input-group-text i {
    font-size: 0.875rem;
}

/* Disabled input group styling */
.input-group .input-group-text+.form-control:disabled {
    cursor: not-allowed;
}

/* Help text / Error messages */
.help-block {
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

/* Success state */
.has-success .form-control {
    border-color: #10b981;
}

/* Error state */
.has-error .form-control {
    border-color: #ef4444;
}

.has-error .input-group-text {
    border-color: #ef4444;
    color: #ef4444;
}

/* =========================================================
   GLOBAL TNA STYLES (Shared by Chart + Details Views)
   ========================================================= */

/* ------------------------------
   1. BOOTSTRAP MODAL STABILITY
   ------------------------------ */
body.modal-open {
    padding-right: 0 !important;
    overflow: hidden;
}

.modal-backdrop {
    opacity: 0.5 !important;
}

/* ------------------------------
   2. BUTTON COLOR LOCK
   ------------------------------ */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:disabled {
    background-color: #25418a !important;
    border-color: #25418a !important;
    color: #ffffff !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

/* ------------------------------
   3. CHART CONTAINER STABILITY
   ------------------------------ */
.chart-card {
    margin-bottom: 20px;
}

.chart-content {
    padding: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    contain: layout paint;
}

#tnaChartContainer {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    height: 500px;
}

canvas {
    display: block;
}

/* ------------------------------
   4. STYLE SELECTION UI
   ------------------------------ */


#tnaSelectedStyles {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.rn-status-style-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
}

/* ------------------------------
   5. RIGHT CONTROLS + LEGEND
   ------------------------------ */
.tna-right-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 180px;
}

.tna-legend-box {
    padding: 10px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: fit-content;
    box-sizing: border-box;
}

.tna-legend-row {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
}

.tna-legend-title {
    font-size: 13px;
    font-weight: 600;
    color: #224D9A;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-line {
    width: 24px;
    height: 2px;
    flex-shrink: 0;
}

.legend-line.planned {
    background-image: repeating-linear-gradient(to right,
            #666 0,
            #666 6px,
            transparent 6px,
            transparent 12px);
}

.legend-line.actual {
    background-color: #666;
}

/* ------------------------------
   6. CHART + LEGEND WRAPPER
   ------------------------------ */
.tna-chart-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* ------------------------------
   7. DETAILS VIEW STYLES
   ------------------------------ */
.tna-details-container {
    padding: 15px;
}

/* =========================================================
   DETAILS HEADER CARD - RESPONSIVE FIXES
   (Works for TNA Details, RN Status Details & WIP Details)
   ========================================================= */

/* ------------------------------
   1. CARD RESPONSIVE PADDING
   ------------------------------ */
.tna-details-container .card,
.rn-status-details-container .card,
.wip-details-container .card {
    margin-bottom: 1rem;
}

.tna-details-container .card-body,
.rn-status-details-container .card-body,
.wip-details-container .card-body {
    padding: 1.25rem;
}

@media (max-width: 768px) {

    .tna-details-container .card-body,
    .rn-status-details-container .card-body,
    .wip-details-container .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {

    .tna-details-container .card-body,
    .rn-status-details-container .card-body,
    .wip-details-container .card-body {
        padding: 0.875rem;
    }
}

/* ------------------------------
   2. STACK TWO COLUMNS ON MOBILE
   ------------------------------ */
@media (max-width: 768px) {

    .tna-details-container .card-body .row,
    .rn-status-details-container .card-body .row,
    .wip-details-container .card-body .row {
        display: flex;
        flex-direction: column;
        margin-left: 0;
        margin-right: 0;
        gap: 0.75rem;
        /* Use gap instead of margins */
    }

    .tna-details-container .card-body .col-md-6,
    .rn-status-details-container .card-body .col-md-6,
    .wip-details-container .card-body .col-md-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0;
        padding-right: 0;
    }

    /* Add visual separator between sections */
    .tna-details-container .card-body .col-md-6:first-child,
    .rn-status-details-container .card-body .col-md-6:first-child,
    .wip-details-container .card-body .col-md-6:first-child {
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #e5e7eb;
    }
}

@media (max-width: 576px) {

    .tna-details-container .card-body .row,
    .rn-status-details-container .card-body .row,
    .wip-details-container .card-body .row {
        gap: 0.5rem;
        /* Smaller gap on mobile */
    }

    .tna-details-container .card-body .col-md-6:first-child,
    .rn-status-details-container .card-body .col-md-6:first-child,
    .wip-details-container .card-body .col-md-6:first-child {
        padding-bottom: 0.5rem;
    }
}

/* ------------------------------
   3. TABLE RESPONSIVE SIZING - COMPACT HORIZONTAL
   ------------------------------ */
.tna-details-container .table-borderless,
.rn-status-details-container .table-borderless,
.wip-details-container .table-borderless {
    margin-bottom: 0;
    table-layout: auto;
    width: 100%;
}

.tna-details-container .table-borderless th,
.tna-details-container .table-borderless td,
.rn-status-details-container .table-borderless th,
.rn-status-details-container .table-borderless td,
.wip-details-container .table-borderless th,
.wip-details-container .table-borderless td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: none;
    vertical-align: top;
}

.tna-details-container .table-borderless th,
.rn-status-details-container .table-borderless th,
.wip-details-container .table-borderless th {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.tna-details-container .table-borderless td,
.rn-status-details-container .table-borderless td,
.wip-details-container .table-borderless td {
    color: #111827;
    word-break: break-word;
}

@media (max-width: 768px) {

    .tna-details-container .table-borderless th,
    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless th,
    .rn-status-details-container .table-borderless td,
    .wip-details-container .table-borderless th,
    .wip-details-container .table-borderless td {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    /* Optimize column widths */
    .tna-details-container .table-borderless th[width="40%"],
    .rn-status-details-container .table-borderless th[width="40%"],
    .wip-details-container .table-borderless th[width="40%"] {
        width: 35% !important;
        min-width: auto;
    }

    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless td,
    .wip-details-container .table-borderless td {
        width: 65%;
    }
}

@media (max-width: 576px) {

    .tna-details-container .table-borderless th,
    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless th,
    .rn-status-details-container .table-borderless td,
    .wip-details-container .table-borderless th,
    .wip-details-container .table-borderless td {
        padding: 0.25rem 0.375rem;
        font-size: 0.75rem;
        line-height: 1.4;
    }

    /* Tighter columns on mobile */
    .tna-details-container .table-borderless th[width="40%"],
    .rn-status-details-container .table-borderless th[width="40%"],
    .wip-details-container .table-borderless th[width="40%"] {
        width: 32% !important;
    }

    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless td,
    .wip-details-container .table-borderless td {
        width: 68%;
    }
}

/* ------------------------------
   4. BADGE RESPONSIVE
   ------------------------------ */
.tna-details-container .badge,
.rn-status-details-container .badge,
.wip-details-container .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: normal;
    line-height: 1.3;
}

@media (max-width: 768px) {

    .tna-details-container .badge,
    .rn-status-details-container .badge,
    .wip-details-container .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 576px) {

    .tna-details-container .badge,
    .rn-status-details-container .badge,
    .wip-details-container .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
    }
}

/* ------------------------------
   5. STRONG TEXT RESPONSIVE
   ------------------------------ */
.tna-details-container .table-borderless td strong,
.rn-status-details-container .table-borderless td strong,
.wip-details-container .table-borderless td strong {
    font-weight: 600;
    display: inline-block;
    word-break: break-word;
}

@media (max-width: 576px) {

    .tna-details-container .table-borderless td strong,
    .rn-status-details-container .table-borderless td strong,
    .wip-details-container .table-borderless td strong {
        font-size: 0.75rem;
    }
}

/* ------------------------------
   6. COLOR CLASSES RESPONSIVE
   ------------------------------ */
.tna-details-container .text-primary {
    color: #3b82f6 !important;
}

.tna-details-container .text-info {
    color: #06b6d4 !important;
}

.tna-details-container .text-success {
    color: #10b981 !important;
}

/* ------------------------------
   7. CARD HEADER RESPONSIVE
   ------------------------------ */
.tna-details-container .card-header,
.rn-status-details-container .card-header,
.wip-details-container .card-header {
    padding: 1rem 1.25rem;
}

.tna-details-container .card-header h5,
.rn-status-details-container .card-header h5,
.wip-details-container .card-header h5 {
    font-size: 1.125rem;
    margin-bottom: 0;
}

.tna-details-container .card-header i,
.rn-status-details-container .card-header i,
.wip-details-container .card-header i {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {

    .tna-details-container .card-header,
    .rn-status-details-container .card-header,
    .wip-details-container .card-header {
        padding: 0.875rem 1rem;
    }

    .tna-details-container .card-header h5,
    .rn-status-details-container .card-header h5,
    .wip-details-container .card-header h5 {
        font-size: 1rem;
    }

    .tna-details-container .card-header i,
    .rn-status-details-container .card-header i,
    .wip-details-container .card-header i {
        font-size: 0.9rem;
        margin-right: 0.375rem;
    }
}

@media (max-width: 576px) {

    .tna-details-container .card-header,
    .rn-status-details-container .card-header,
    .wip-details-container .card-header {
        padding: 0.75rem 0.875rem;
    }

    .tna-details-container .card-header h5,
    .rn-status-details-container .card-header h5,
    .wip-details-container .card-header h5 {
        font-size: 0.9375rem;
    }

    .tna-details-container .card-header i,
    .rn-status-details-container .card-header i,
    .wip-details-container .card-header i {
        font-size: 0.875rem;
        margin-right: 0.3125rem;
    }
}

/* ------------------------------
   8. PREVENT OVERFLOW
   ------------------------------ */
.tna-details-container .card,
.rn-status-details-container .card,
.wip-details-container .card {
    overflow: hidden;
}

.tna-details-container .card-body,
.rn-status-details-container .card-body,
.wip-details-container .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ------------------------------
   9. TABLE ROW SPACING - KEEP HORIZONTAL
   ------------------------------ */
.tna-details-container .table-borderless tr,
.rn-status-details-container .table-borderless tr,
.wip-details-container .table-borderless tr {
    border-bottom: 1px solid transparent;
}

/* Keep horizontal layout on all screen sizes */
@media (max-width: 576px) {

    .tna-details-container .table-borderless tr,
    .rn-status-details-container .table-borderless tr,
    .wip-details-container .table-borderless tr {
        display: table-row;
    }

    .tna-details-container .table-borderless th,
    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless th,
    .rn-status-details-container .table-borderless td,
    .wip-details-container .table-borderless th,
    .wip-details-container .table-borderless td {
        display: table-cell;
        vertical-align: top;
    }
}

/* ------------------------------
   10. COMPACT LAYOUT - NO EXTRA SPACING
   ------------------------------ */
@media (max-width: 576px) {

    /* Remove extra spacing */
    .tna-details-container .table-borderless,
    .rn-status-details-container .table-borderless,
    .wip-details-container .table-borderless {
        margin-bottom: 0;
    }

    /* Make labels more compact */
    .tna-details-container .table-borderless th,
    .rn-status-details-container .table-borderless th,
    .wip-details-container .table-borderless th {
        font-size: 0.7rem;
        font-weight: 600;
        padding-right: 0.25rem;
    }

    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless td,
    .wip-details-container .table-borderless td {
        font-size: 0.75rem;
        padding-left: 0.25rem;
    }
}

/* ------------------------------
   11. FIX LONG TEXT OVERFLOW
   ------------------------------ */
.tna-details-container .table-borderless td,
.rn-status-details-container .table-borderless td,
.wip-details-container .table-borderless td {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

@media (max-width: 576px) {

    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless td,
    .wip-details-container .table-borderless td {
        max-width: 100%;
    }
}

/* ------------------------------
   12. TOUCH DEVICE OPTIMIZATIONS
   ------------------------------ */
@media (hover: none) and (pointer: coarse) {

    .tna-details-container .table-borderless th,
    .tna-details-container .table-borderless td,
    .rn-status-details-container .table-borderless th,
    .rn-status-details-container .table-borderless td {
        padding: 0.5rem 0.375rem;
    }
}

.tna-details-container h5,
.tna-details-container h6 {
    color: #224D9A;
    font-weight: 600;
}

.table {
    font-size: 12px;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
    font-size: 11px;
    padding: 8px 4px;
}

.table td {
    vertical-align: middle;
    padding: 6px 4px;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
}

.card-header {
    font-weight: 600;
}

/* ------------------------------
   8. RESPONSIVE FIXES
   ------------------------------ */
@media (max-width: 992px) {
    .chart-content>div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: stretch !important;
    }

    .tna-chart-wrapper {
        flex-direction: column !important;
    }

    .tna-legend-box {
        width: 100% !important;
        max-width: 100% !important;
        order: -1 !important;
        margin-bottom: 15px;
    }

    #tnaChartContainer {
        width: 100% !important;
        order: 1 !important;
    }
}

@media (max-width: 768px) {
    #tnaChartContainer {
        height: 400px;
    }

    .rn-status-style-selection .d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }

    #tnaViewMoreBtn {
        width: 100%;
        margin-top: 10px;
    }

    .rn-status-style-tag {
        font-size: 12px;
        padding: 4px 8px;
    }

    .tna-style-color-picker {
        width: 25px !important;
        height: 20px !important;
    }

    .modal-dialog.modal-lg {
        max-width: 95%;
        margin: 10px;
    }
}

@media (max-width: 576px) {
    #tnaChartContainer {
        height: 350px;
    }

    .rn-status-style-tag {
        font-size: 11px;
        padding: 3px 6px;
    }

    .tna-style-color-picker {
        width: 22px !important;
        height: 18px !important;
    }

    .modal-footer .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* ------------------------------
   9. TOUCH DEVICES
   ------------------------------ */
@media (hover: none) and (pointer: coarse) {
    .tna-style-color-picker {
        min-width: 36px;
        min-height: 36px;
    }
}

/* =========================
   SELECT2 MULTIPLE SELECTION FIX
   ========================= */

.select2-container--krajee-bs5 .select2-results__option--highlighted[aria-selected] {
    background-color: #25418a !important;
    color: #fff;
}

.select2-container--krajee-bs5.select2-container--open:not(.select2-container--disabled) .select2-selection,
.select2-container--krajee-bs5:not(.select2-container--disabled) .select2-selection:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem #495f99;
}

/* Fix for multiple select visibility - Support all themes */
.select2-container--krajee .select2-selection--multiple,
.select2-container--default .select2-selection--multiple,
.select2-container .select2-selection--multiple {
    min-height: 38px !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    background-color: #fff !important;
    padding: 2px 8px !important;
}

/* Style for selected items (tags) - Support all themes */
.select2-container--krajee .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container .select2-selection--multiple .select2-selection__choice {
    background-color: #25418a !important;
    border: 1px solid #25418a !important;
    color: #ffffff !important;
    padding: 3px 8px !important;
    margin: 3px 4px 3px 0 !important;
    border-radius: 3px !important;
    font-size: 0.875rem !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.4 !important;
    float: none !important;
}

/* Remove button (X) styling - Support all themes */
.select2-container--krajee .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container .select2-selection--multiple .select2-selection__choice__remove {
    color: #ffffff !important;
    font-weight: bold !important;
    margin-right: 5px !important;
    margin-left: 0 !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    opacity: 0.8 !important;
    border: none !important;
    background: none !important;
    float: none !important;
}

.select2-container--krajee .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container .select2-selection--multiple .select2-selection__choice__remove:hover {
    opacity: 1 !important;
    color: #ffffff !important;
    background: none !important;
}

/* Search input within multiple select */
.select2-container--krajee .select2-selection--multiple .select2-search__field {
    margin-top: 3px !important;
    margin-bottom: 3px !important;
    min-width: 150px !important;
    font-size: 0.875rem;
}

/* Placeholder styling */
.select2-container--krajee .select2-selection--multiple .select2-selection__placeholder {
    color: #6c757d !important;
    font-size: 0.875rem;
    padding: 3px 0;
}

/* Ensure placeholder shows when no items selected - Support all themes */
.select2-container--krajee .select2-selection--multiple .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered,
.select2-container .select2-selection--multiple .select2-selection__rendered {
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: 100% !important;
    list-style: none !important;
    margin: 0 !important;
}

/* Fix clearfix issues */
.select2-container--krajee .select2-selection--multiple .select2-selection__rendered:after,
.select2-container--default .select2-selection--multiple .select2-selection__rendered:after,
.select2-container .select2-selection--multiple .select2-selection__rendered:after {
    content: none !important;
    display: none !important;
}

.select2-container--krajee .select2-selection--multiple .select2-selection__rendered:before,
.select2-container--default .select2-selection--multiple .select2-selection__rendered:before,
.select2-container .select2-selection--multiple .select2-selection__rendered:before {
    content: none !important;
    display: none !important;
}

/* Fix for single select placeholder */
.select2-container--krajee .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
    font-size: 0.875rem;
}

/* Dropdown styling */
.select2-container--krajee .select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 9999 !important;
}

/* Option highlighting */
.select2-container--krajee .select2-results__option {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.select2-container--krajee .select2-results__option--highlighted {
    background-color: #25418a !important;
    color: white !important;
}

.select2-container--krajee .select2-results__option--selected {
    background-color: #e9ecef;
    color: #495057;
}

/* Search field in dropdown */
.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: #25418a;
    box-shadow: 0 0 0 0.2rem rgba(37, 65, 138, 0.25);
}

/* Clear button for multiple select */
.select2-container--krajee .select2-selection--multiple .select2-selection__clear {
    margin-right: 10px;
    margin-top: 5px;
    padding: 1px;
    cursor: pointer;
    font-weight: bold;
    color: #999;
}

.select2-container--krajee .select2-selection--multiple .select2-selection__clear:hover {
    color: #333;
}

/* Focus state */
.select2-container--krajee.select2-container--focus .select2-selection--multiple,
.select2-container--krajee.select2-container--focus .select2-selection--single {
    border-color: #25418a;
    box-shadow: 0 0 0 0.2rem rgba(37, 65, 138, 0.25);
}

/* Disabled state */
.select2-container--krajee .select2-selection--multiple.select2-selection--disabled,
.select2-container--krajee .select2-selection--single.select2-selection--disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading state */
.select2-container--krajee .select2-selection--multiple .select2-selection__loading,
.select2-container--krajee .select2-selection--single .select2-selection__loading {
    color: #6c757d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .select2-container--krajee .select2-selection--multiple .select2-selection__choice {
        font-size: 0.8125rem;
        padding: 2px 6px !important;
        margin: 2px 3px 2px 0 !important;
    }

    .select2-container--krajee .select2-selection--multiple .select2-search__field {
        min-width: 100px !important;
    }
}

@media (max-width: 576px) {
    .select2-container--krajee .select2-selection--multiple .select2-selection__choice {
        font-size: 0.75rem;
        padding: 2px 5px !important;
    }

    .select2-container--krajee .select2-selection--multiple .select2-search__field {
        min-width: 80px !important;
        font-size: 0.8125rem;
    }
}

/* Ensure proper z-index hierarchy */
.select2-container {
    z-index: 1050 !important;
}

.select2-dropdown {
    z-index: 1051 !important;
}

/* Modal context - higher z-index */
.modal .select2-container {
    z-index: 99999 !important;
}

.modal .select2-dropdown {
    z-index: 100000 !important;
}

/* Fix for overflow in filter cards */
.filter-card-body .select2-container {
    width: 100% !important;
}

/* Ensure selected items wrap properly */
.select2-container--krajee .select2-selection--multiple .select2-selection__rendered {
    max-height: none !important;
    overflow: visible !important;
}

/* Custom scrollbar for multiple select when many items */
.select2-container--krajee .select2-selection--multiple {
    max-height: 200px;
    overflow-y: auto;
}

.select2-container--krajee .select2-selection--multiple::-webkit-scrollbar {
    width: 6px;
}

.select2-container--krajee .select2-selection--multiple::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.select2-container--krajee .select2-selection--multiple::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.select2-container--krajee .select2-selection--multiple::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Permission Tree Styling (VERTICAL NESTING) ===== */

.dd {
    max-width: 100%;
}

.dd-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* Each permission row */
.dd-item {
    display: block;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

/* Row content */
.dd-handle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 44px 14px 16px;
    background: #fff;
    cursor: pointer;
}

/* Checkbox */
.permission-checkbox {
    margin-top: 2px;
}

/* Text */
.permission-label {
    font-weight: 500;
    color: #212529;
}

/* Remove drag icon */
.dd-handle::before {
    display: none !important;
}

/* Child indentation - VERTICAL BELOW PARENT */
.dd-list .dd-list {
    padding-left: 0;
    margin-left: 0;
    background: transparent;
}

/* Indent child items */
.dd-list .dd-list .dd-handle {
    padding-left: 48px;
    background: #f8f9fa;
}

/* Further nesting levels */
.dd-list .dd-list .dd-list .dd-handle {
    padding-left: 80px;
    background: #f0f1f2;
}

.dd-list .dd-list .dd-list .dd-list .dd-handle {
    padding-left: 112px;
    background: #e9ecef;
}

/* Expand/Collapse Button */
.dd-item>button {
    position: absolute;
    right: 12px;
    top: 14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
}

/* Style the iconify spans */
.dd-item>button .iconify {
    width: 18px;
    height: 18px;
    color: #495057;
}

/* PLUS - Remove ::before */
.dd-item>button[data-action="expand"]::before {
    display: none;
}

/* MINUS - Remove ::before */
.dd-item>button[data-action="collapse"]::before {
    display: none;
}

/* Hide nested items when collapsed */
.dd-item.dd-collapsed>.dd-list {
    display: none;
}

.list-group-item.active {
    background-color: #4b8940;
    border-color: #4b8940;
    color: #fff;
}

.list-group-item.active,
.list-group-item.active .role-nav,
.list-group-item.active i,
.list-group-item.active a {
    color: #fff !important;
}

/* Mobile */
@media (max-width: 768px) {
    .dd-handle {
        padding: 12px 44px 12px 12px;
    }

    .dd-list .dd-list .dd-handle {
        padding-left: 32px;
    }

    .dd-list .dd-list .dd-list .dd-handle {
        padding-left: 52px;
    }
}

.btn-close {
    --bs-btn-close-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414'/%3e%3c/svg%3e")
}
/* =========================
   DATATABLES PAGINATION FIX
   ========================= */

/* Pagination wrapper */
.dataTables_wrapper .dataTables_paginate {
    padding-top: 1rem;
    text-align: right;
}

/* Pagination container */
.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
    display: inline-flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.375rem;
}

/* Page items */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: 0;
    line-height: 1.25;
    color: #25418a;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: all 0.2s;
}

/* Remove default link styling */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #25418a;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* Active page */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    z-index: 3;
    color: #fff !important;
    background-color: #25418a !important;
    border-color: #25418a !important;
}

/* Disabled state */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #6c757d;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #fff;
    border-color: #dee2e6;
    opacity: 0.5;
}

/* Previous button */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    margin-right: -1px;
}

/* Next button */
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    margin-left: -1px;
}

/* First and Last buttons (if enabled) */
.dataTables_wrapper .dataTables_paginate .paginate_button.first {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.last {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Ellipsis */
.dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 0.5rem 0.75rem;
    color: #6c757d;
}

/* Info text */
.dataTables_wrapper .dataTables_info {
    padding-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Length menu */
.dataTables_wrapper .dataTables_length {
    float: left;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    appearance: none;
    margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_length label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

/* Search/Filter */
.dataTables_wrapper .dataTables_filter {
    float: right;
    text-align: right;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.dataTables_wrapper .dataTables_filter label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    margin-left: 0.5rem;
    width: 200px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: #25418a;
    box-shadow: 0 0 0 0.2rem rgba(37, 65, 138, 0.25);
}

/* Processing indicator */
.dataTables_wrapper .dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    margin-left: -100px;
    margin-top: -26px;
    text-align: center;
    padding: 1em 0;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive wrapper */
.dataTables_wrapper .row {
    margin-right: 0;
    margin-left: 0;
}

.dataTables_wrapper .row > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        max-width: 300px;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        font-size: 0.8125rem;
        padding: 0.375rem 0.625rem;
    }
}

@media (max-width: 576px) {
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Hide page numbers on mobile, show only prev/next */
    .dataTables_wrapper .dataTables_paginate .paginate_button:not(.previous):not(.next):not(.current) {
        display: none;
    }

    /* Keep current page visible */
    .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        display: inline-block;
    }
}

/* Ensure proper spacing in results card */
.results-card-body .dataTables_wrapper {
    padding: 0;
}

/* Fix z-index issues */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    position: relative;
    z-index: 1;
}

.grid-view .custom-gridview .table thead tr th a::before,
.custom-table .table thead tr th a::before {
    content: '';
    position: absolute;
    background: url('../images/sorting-icon.svg') !important;
    background-repeat: no-repeat;
    height: 25px;
    width: 15px;
    top: 0px;
    right: -20px;
}
/* =========================
   DROPDOWN OVERFLOW FIX
   ========================= */

/* Allow dropdowns to overflow the card body */
.results-card-body {
    overflow: visible !important;
}

/* Ensure table container allows overflow */
.table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Make dropdown appear on top with proper z-index */
.dropdown-menu {
    z-index: 1060 !important;
    position: absolute !important;
}

/* Ensure dropdown opens upward when near bottom */
.dropdown.dropup .dropdown-menu {
    top: auto !important;
    bottom: 100% !important;
    margin-bottom: 0.125rem;
}

/* Last few rows should open dropdown upward */
.table tbody tr:nth-last-child(-n+3) .dropdown-menu {
    top: auto !important;
    bottom: 100% !important;
    transform: translateY(-0.25rem);
}

/* Prevent dropdown from being cut off on right side */
.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

/* Ensure proper positioning for action buttons */
.table tbody td .dropdown {
    position: relative;
}

/* Alternative: Force dropup for all action dropdowns */
.table tbody td .dropdown .dropdown-menu {
    position: absolute;
    top: auto;
    bottom: 100%;
    margin-bottom: 0.25rem;
}

/* Mobile fix */
@media (max-width: 768px) {
    .dropdown-menu {
        min-width: 160px;
        max-width: 200px;
    }
    
    .table tbody tr:nth-last-child(-n+5) .dropdown-menu {
        top: auto !important;
        bottom: 100% !important;
    }
}
/*LOADER SART*/
#loader_common {
    position: fixed;
    z-index: 999999;
    height: 2em;
    width: 2em;
    overflow: show;
    margin: auto;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}


#loader_common:before {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
}

/*LOADER END*/

.cursor_pointer {
    cursor: pointer !important;
}
/* Allow datepicker icon to be clickable even when readonly */
.input-group .kv-date-picker.form-control[readonly] {
    background-color: #fff;
    cursor: pointer;
}

.input-group .input-group-text {
    cursor: pointer;
    pointer-events: auto;
}

/* Ensure datepicker dropdown appears above everything */
.datepicker-dropdown {
    z-index: 99999 !important;
    display: block !important;
}

.datepicker {
    z-index: 99999 !important;
}