/*  1. GLOBAL VARIABLES & THEME CONFIG  */
:root {
    /* --- Brand Colors --- */
    --primary-color: #4361ee; 
    --primary-hover: #3a56d4;
    --secondary-color: #6c757d;
    
    /* --- Backgrounds --- */
    --body-bg: #f5f7fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;

    /* --- Dimensions --- */
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --border-radius-base: 10px; 
    --box-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.02);
    --box-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.05);
    
    /* --- Typography --- */
    --font-primary: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--body-bg);
    font-family: var(--font-primary);
    color: #333;
    font-size: 0.925rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.daterangepicker {
        z-index: 9999 !important;
        font-family: inherit;
    }


.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.5rem 1.2rem;
    font-weight: 500;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.form-control, 
.form-select {
    min-height: 45px; /* Standardized height */
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #ced4da;
    background-color: #fff;
}

/* Floating labels adjustment for height */
.form-floating > .form-control,
.form-floating > .form-select {
    height: 50px;
    min-height: 50px;
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* Focus State - Clean, no shadow, just border color */
.form-control:focus, 
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: none !important; 
    outline: none;
}

/* Readonly & Disabled States */
input[readonly], 
input:disabled, 
.form-control:disabled, 
.form-select:disabled {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
    opacity: 1;
}

.card {
    border: none;
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-md);
    background-color: var(--card-bg);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem;
    font-weight: 600;
}

.table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    vertical-align: middle;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.small-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

/* LAYOUT COMPONENTS */

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    border-right: 1px solid #e2e8f0;
    transition: transform 0.3s ease;

    display: flex;
    flex-direction: column;
}

.sidebar .flex-grow-1 {
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-submenu {
    overflow: hidden;
}

.sidebar .flex-grow-1::-webkit-scrollbar {
    width: 6px;
}

.sidebar .flex-grow-1::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Main Content Wrapper */
.dashboard-main-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    padding-bottom: 70px;
    display: flex;
    flex-direction: column;
}

.footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1030;
}

.admin-footer {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(6px);
  border-top: 1px solid #e5e7eb;
  z-index: 1030;
}

.footer-inner {
  padding: 10px 18px;
  font-size: 15px;
}

/* Company text */
.footer-company {
  color: #6b7280;
  font-size: 14px;
}

/* Label */
.footer-label {
  color: #6b7280;
  font-size: 14px;
}

/* User name */
.footer-user-name {
  font-weight: 600;
  font-size: 16px;
  color: #111827;
}

/* Role badge */
.footer-role-badge {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 500;
}

/* Top Navbar */
.top-navbar {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

/* Sidebar Menu Links */
.sidebar-menu .nav-link {
    color: #64748b;
    padding: 12px 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.sidebar-menu .nav-link:hover, 
.sidebar-menu .nav-link.active {
    background-color: rgba(67, 97, 238, 0.08);
    color: var(--primary-color);
}

.sidebar-menu .nav-link i {
    font-size: 1.2rem;
}


@media (max-width: 1199px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 10000;
    }
    
    .sidebar.show-sidebar {
        transform: translateX(0);
    }

    .dashboard-main-wrapper {
        margin-left: 0;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

.action-box .dropdown-toggle::after {
    display: none;
}

.object-fit-cover {
    object-fit: cover;
}

.w-32-px { width: 32px !important; }
.h-32-px { height: 32px !important; }
.w-40-px { width: 40px !important; }
.h-40-px { height: 40px !important; }


/* =====================================================
   SELECT2 STYLING
   ===================================================== */

.select2-container {
    width: 100% !important;
    display: block;
    font-family: var(--font-primary);
}

/* -------------------------------
   Selection Container
   ------------------------------- */

.select2-container--bootstrap-5
.select2-selection {
    height: 50px;
    min-height: 50px;
    padding: 0 42px 0 14px; /* space for arrow */
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #ced4da;
    background-color: #fff;
    display: flex;
    align-items: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Make selection positioning context */
.select2-container--bootstrap-5
.select2-selection--single {
    position: relative;
}

/* -------------------------------
   Rendered Text
   ------------------------------- */

.select2-container--bootstrap-5
.select2-selection__rendered {
    padding-left: 0 !important;
    line-height: 1.5;
    color: #333;
}

.select2-container--bootstrap-5
.select2-selection__placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* -------------------------------
   Arrow (RIGHT ALIGNED)
   ------------------------------- */

.select2-container--bootstrap-5
.select2-selection--single
.select2-selection__arrow {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    pointer-events: none;
}

.select2-container--bootstrap-5
.select2-selection--single
.select2-selection__arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6c757d;
    border-bottom: 2px solid #6c757d;
    transform: translate(-50%, -60%) rotate(45deg);
    transition: transform 0.2s ease;
}

/* Rotate arrow when open */
.select2-container--open
.select2-selection--single
.select2-selection__arrow::after {
    transform: translate(-50%, -40%) rotate(-135deg);
}

/* -------------------------------
   Hover & Focus States
   ------------------------------- */

.select2-container--bootstrap-5
.select2-selection:hover {
    border-color: #cbd5e1;
}

.select2-container--bootstrap-5.select2-container--focus
.select2-selection,
.select2-container--bootstrap-5.select2-container--open
.select2-selection {
    border-color: var(--primary-color);
    box-shadow: none;
}

/* -------------------------------
   Disabled State
   ------------------------------- */

.select2-container--bootstrap-5.select2-container--disabled
.select2-selection {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* -------------------------------
   Dropdown Panel
   ------------------------------- */

.select2-dropdown {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
}

/* -------------------------------
   Search Field
   ------------------------------- */

.select2-search__field {
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 6px 10px;
    font-size: 0.85rem;
}

.select2-search__field:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* -------------------------------
   Dropdown Options
   ------------------------------- */

.select2-results__option {
    padding: 10px 14px;
    font-size: 0.875rem;
    color: #475569;
    transition: background-color 0.15s ease;
}

.select2-results__option--highlighted {
    background-color: rgba(67, 97, 238, 0.08);
    color: var(--primary-color);
}

.select2-results__option--selected {
    background-color: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
}


/*   BREADCRUMB STYLING   */

.breadcrumb {
    --bs-breadcrumb-divider: ">"; 
    --bs-breadcrumb-divider-color: #cbd5e1;
    
    font-size: 0.85rem;
    font-weight: 500;
}

.breadcrumb.bg-white {
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.breadcrumb-item a {
    color: #64748b;
    transition: color 0.2s ease, transform 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a i {
    font-size: 1.1em;
    position: relative;
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    font-family: inherit;
    font-size: 1.5em;
    line-height: 1;
    vertical-align: middle;
}

/* =========================================
   9. BADGES (Soft/Pastel Style)
   ========================================= */

/* Base Badge Style - Pill Shape */
.badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px; /* Pill shape */
    white-space: nowrap;
    line-height: 1;
}

.badge-soft .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.7;
}

/* Color Variants */
.badge-soft-primary { background-color: #dbeafe; color: #1e40af; }
.badge-soft-success { background-color: #ecfdf5; color: #065f46; } /* Approved/Active */
.badge-soft-danger  { background-color: #fee2e2; color: #991b1b; } /* Rejected/Inactive */
.badge-soft-warning { background-color: #fef9c3; color: #92400e; } /* Pending */
.badge-soft-info    { background-color: #e0f2fe; color: #0369a1; }
.badge-soft-secondary { background-color: #f3f4f6; color: #4b5563; } /* Not Audited */

/* =========================================
   10. TOOLTIPS & POPOVERS
   ========================================= */

/* --- Tooltips --- */
/* Usage: <button class="tooltip-danger" data-bs-toggle="tooltip" ...> */
.tooltip-primary { --bs-tooltip-bg: var(--primary-color); --bs-tooltip-color: #fff; }
.tooltip-success { --bs-tooltip-bg: #198754; --bs-tooltip-color: #fff; }
.tooltip-danger  { --bs-tooltip-bg: #dc3545; --bs-tooltip-color: #fff; }
.tooltip-info    { --bs-tooltip-bg: #0dcaf0; --bs-tooltip-color: #fff; }
.tooltip-warning { --bs-tooltip-bg: #ffc107; --bs-tooltip-color: #000; }

/* --- Popovers --- */
.popover-header {
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Colored Headers for Popovers */
.popover-success .popover-header { background-color: #d1e7dd; color: #0f5132; }
.popover-danger .popover-header  { background-color: #f8d7da; color: #842029; }
.popover-warning .popover-header { background-color: #fff3cd; color: #664d03; }
.popover-info .popover-header    { background-color: #cff4fc; color: #055160; }


/* =========================================
   11. PAGINATION
   ========================================= */
.pagination {
    gap: 4px;
    align-items: center;
}

.pagination .page-item .page-link {
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: var(--primary-color);

    padding: 3px 6px;
    font-size: 0.85rem;
    min-width: 25px;

    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #fff;
}

.pagination .page-item .page-link:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    pointer-events: none;
}
/* The container for index # and action button */
.action-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-width: 60px;
}

/* The Index Number */
.action-box .index-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 18px;
}


/* =========================================
   13. OUTLINED FLOATING LABELS (Cut Border Style)
   ========================================= */

/* 1. Reset Input Padding 
   Standard Bootstrap floating inputs have huge top padding. 
   We remove it so the text is vertically centered. */
.form-floating > .form-control,
.form-floating > .form-select {
    height: 50px;
    min-height: 50px;
    padding: 0.75rem 0.75rem; /* Standard padding */
    line-height: 1.5;
}

/* 2. Style the Label (Default State) */
.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: 100%;
    padding: 0.5rem;
    pointer-events: none;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out;
    color: #6c757d; /* Gray text */
}

/* 3. Active State (Focused or Has Value) 
   This moves the label UP to the border and adds the white background. */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: 1;
    /* Move up (-50%) and scale down */
    transform: scale(0.85) translateY(-0.8rem) translateX(0.6rem); 
    
    /* The Magic: White background cuts the border */
    background-color: #fff; 
    
    height: auto;
    padding: 0 6px; /* Space around text so border doesn't touch it */
    z-index: 2;
}

/* 4. Focus Color */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-select:focus ~ label {
    color: var(--primary-color); /* Turn label blue on focus */
}

/* Match input-group with floating form controls */
.input-group .form-control {
    height: 50px;
    min-height: 50px;
    padding: 0.75rem 0.75rem;
    line-height: 1.5;
}

/* Match the icon container height */
.input-group-text {
    height: 50px;
    display: flex;
    align-items: center;
}

.input-group-text i {
    color: #6c757d;
}

/* =========================================
   14. CUSTOM TABLE FOOTER SELECTOR
   ========================================= */

.select-sm-custom {
    appearance: none; /* Remove default browser arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    
    background-color: #fff;
    /* Custom Chevron SVG Arrow */
    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='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px 8px; /* Size of the arrow */
    
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    
    /* Compact Padding: Top/Bottom | Right (space for arrow) | Left */
    padding: 0.25rem 2rem 0.25rem 0.75rem; 
    
    font-size: 0.8125rem; /* Small text (approx 13px) */
    font-weight: 500;
    line-height: 1.5;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: auto;
}

.select-sm-custom:hover {
    background-color: #f8f9fa;
    border-color: #cbd5e1;
}

.select-sm-custom:focus {
    border-color: var(--primary-color);
    outline: 0;
    /* Very subtle shadow instead of the big Bootstrap glow */
    box-shadow: 0 0 0 2px rgba(var(--primary-color), 0.1); 
}

/* ===================================================
   CHECKBOX STYLING || Devansh Rai 25/11/2025 ||
   =================================================== */

.form-check-lg .form-check-input {
    width: 1.3rem;
    height: 1.3rem;
    cursor: pointer;
    border: 2px solid #6c757d;
}

.form-check-lg .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}


/* ===================================================
   IMAGE INPUT STYLING || Devansh Rai 26/11/2025 ||
   =================================================== */


.image-upload-wrapper .upload-box {
  width: 100%;
  padding: 40px 20px;
  border: 2px dashed #bfc3d0;
  border-radius: 8px;
  cursor: pointer;
  color: #6c757d;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: 0.25s;
}

.image-upload-wrapper .upload-box:hover {
  background: #f5f7fa;
  border-color: #6c8cff;
}

.img-preview {
  max-width: 180px;
  max-height: 180px;
  border-radius: 6px;
  border: 1px solid #ccc;
  object-fit: cover;
}

.error-box {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 8px;
    color: #842029;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
.error-box .error-heading {
    font-weight: 600;
    margin-bottom: 4px;
    color: #842029;
    }
.error-box ul {
    list-style-type: disc;
    margin-left: 18px;
    margin-bottom: 0;
    padding-left: 0;
    }
.error-box li {
    margin-bottom: 3px;
    line-height: 1.4;
    }


/* --- Sidebar Styles || Devansh 26/11/2025 || --- */
.sidebar-menu__item {
    list-style: none;
    margin-bottom: 4px;
}

.sidebar-menu__link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #555;
    /* Default Text Color */
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    cursor: pointer;
}

.sidebar-menu__link:hover {
    background-color: #f3f4f6;
    color: #2563eb;
    /* Primary Blue */
}

/* Active Parent State */
.sidebar-menu__item.active>.sidebar-menu__link {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sidebar-menu__link .icon {
    font-size: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.sidebar-menu__link .text {
    flex-grow: 1;
}

/* Dropdown Arrow */
.sidebar-menu__link .arrow-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

/* Rotate arrow when open */
.sidebar-menu__item.open>.sidebar-menu__link .arrow-icon {
    transform: rotate(180deg);
}

/* Submenu Styling */
.sidebar-submenu {
    display: none;
    /* Hidden by default */
    list-style: none;
    padding-left: 0;
    margin-top: 4px;
    background-color: #fff;
}

.sidebar-submenu__item {
    margin-bottom: 2px;
}

.sidebar-submenu__link {
    display: block;
    padding: 8px 16px 8px 48px;
    /* Indented */
    color: #6b7280;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-radius: 6px;
    position: relative;
}

.sidebar-submenu__link:hover {
    color: #2563eb;
    background-color: #f9fafb;
}

/* Active Submenu Link */
.sidebar-submenu__item.active .sidebar-submenu__link {
    color: #2563eb;
    font-weight: 600;
    background-color: transparent;
}