/* ============================================
   CSS Variables for Dynamic Skin Colors
   ============================================ */

   :root {
    /* Default colors (skin-blue) */
    --skin-primary: #0ea5e9;
    --skin-primary-dark: #0284c7;
    --skin-primary-light: #38bdf8;
    --skin-secondary: #11203f;
    --skin-dark: #0b1220;
    --skin-gradient: linear-gradient(47deg, #0b1220 0%, #11203f 40%, #0ea5e9 140%);
    --skin-sidebar-gradient: linear-gradient(180deg, #0b1220 0%, #11203f 60%, #0ea5e9 140%);
    --skin-sidebar-bg: #09648f;
    --skin-menu-hover: #11203f;
    --skin-menu-active: linear-gradient(47deg, #11203f 0%, #0ea5e9 100%);
  }
  
  /* ============================================
       Header & Navbar Styling
       ============================================ */
  
  .main-header {
    background: var(--skin-gradient) !important;
  }
  
  .modern-layout .main-header .navbar {
    background: var(--skin-gradient) !important;
    background-image: none !important;
  }
  
  .modern-layout .main-header .logo {
    background: var(--skin-dark) !important;
    color: #fff !important;
  }
  
  .modern-layout .main-header .logo:hover {
    background: var(--skin-dark) !important;
  }
  
  /* ============================================
       Sidebar Styling
       ============================================ */
  
  .main-sidebar {
    background: var(--skin-sidebar-bg) !important;
  }
  
  .sidebar {
    background: var(--skin-sidebar-bg) !important;
  }
  
  .main-sidebar .sidebar {
    background: var(--skin-sidebar-gradient) !important;
  }
  
  /* ============================================
       Sidebar Menu Items
       ============================================ */
  
  .sidebar .sidebar-menu>li>a {
    color: #f0f0f0 !important;
    transition: all 0.2s ease-in-out;
  }
  
  .sidebar .sidebar-menu>li>a:hover {
    background: var(--skin-menu-hover) !important;
    color: #fff !important;
  }
  
  .sidebar .sidebar-menu>li.active>a {
    background: var(--skin-menu-active) !important;
    color: #fff !important;
    font-weight: 600;
  }
  
  /* ============================================
       Submenu Styling
       ============================================ */
  
  .sidebar .treeview-menu {
    background: linear-gradient(47deg, var(--skin-dark) 0%, var(--skin-secondary) 100%) !important;
    border-left: 3px solid var(--skin-primary) !important;
  }
  
  .sidebar .treeview-menu>li>a {
    color: #e0e0e0 !important;
    padding-left: 25px;
  }
  
  .sidebar .treeview-menu>li>a:hover,
  .sidebar .treeview-menu>li.active>a {
    background: var(--skin-menu-hover) !important;
    color: #fff !important;
  }
  
  /* ============================================
       Sidebar Toggle Button
       ============================================ */
  
  .sidebar-toggle {
    color: #fff !important;
  }
  
  .sidebar-toggle:hover {
    background: var(--skin-sidebar-bg) !important;
    color: #fff !important;
  }
  
  /* ============================================
       Menu Headers & Labels
       ============================================ */
  
  .sidebar-menu>li.header {
    color: #fff !important;
    background: linear-gradient(47deg, var(--skin-dark) 0%, var(--skin-secondary) 100%) !important;
  }
  
  .sidebar-menu li>a:hover::after,
  .sidebar-menu li.active>a::after {
    background: var(--skin-primary) !important;
    color: #fff !important;
    border-radius: 4px;
  }
  
  .sidebar-menu li a[title]::after {
    background: var(--skin-primary) !important;
    color: #fff !important;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
  }
  
  /* ============================================
       Sidebar Styling
       ============================================ */
  
       .main-sidebar {
        background: var(--skin-sidebar-gradient) !important;
        min-height: 100vh !important;
      }
      
      .sidebar {
        background: transparent !important;
        min-height: 100vh !important;
      }
      
      .main-sidebar .sidebar {
        background: transparent !important;
      }
  
  /* ============================================
       Treeview Parent Menu Hover
       ============================================ */
  
  .sidebar .treeview:hover>a,
  .sidebar .treeview.menu-open>a,
  .sidebar .treeview.active>a {
    background: var(--skin-menu-hover) !important;
    color: #fff !important;
  }
  
  /* ============================================
       Login & User Header
       ============================================ */
  
  .login-box-header {
    background: var(--skin-gradient) !important;
    color: #fff;
  }
  
  .modern-layout .main-header li.user-header {
    background: var(--skin-secondary) !important;
    color: #fff;
  }
  
  .user-panel>.image>img {
    background-color: #fff;
  }
  
  /* ============================================
       Form Controls
       ============================================ */
  
  .form-control:focus {
    border-color: var(--skin-primary) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  }
  
  .btn-default {
    background: var(--skin-secondary) !important;
    color: #fff;
    border-color: var(--skin-dark) !important;
  }
  
  label {
    font-size: 14px;
    font-weight: 600;
    color: var(--skin-secondary);
  }
  
  /* ============================================
       Scrollbar Styling
       ============================================ */
  
  .content-wrapper::-webkit-scrollbar-thumb {
    background: var(--skin-sidebar-bg);
    border-radius: 4px;
  }
  
  .content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--skin-primary-dark);
  }
  
  /* ============================================
       Other Existing Styles (Unchanged)
       ============================================ */
  
  /* Typography Imports */
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
  
  .modern-layout {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-feature-settings: 'liga' 1, 'kern' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
  }
  
  /* Form Variables */
  :root {
    --form-border-color: #e2e8f0;
    --form-focus-color: #0ea5e9;
    --form-bg-color: #ffffff;
    --form-placeholder-color: #a0aec0;
    --form-label-color: #2d3748;
    --form-focus-shadow: rgba(14, 165, 233, 0.1);
    --form-transition: all 0.3s ease;
    --form-border-width: 2px;
    --form-border-radius: 6px;
  }
  
  .input-group-addon {
    border-radius: 10px 0 0 10px !important;
  }
  
  .form-control {
    border: var(--form-border-width) solid var(--form-border-color);
    border-radius: 10px 10px 10px 10px;
    background: var(--form-bg-color);
    transition: var(--form-transition);
    font-size: 14px;
    line-height: 2;
    width: 100%;
    display: block;
    height: 38px;
  }
  
  .form-control:hover:not(:focus) {
    border-color: #cbd5e0;
  }
  
  .form-control::placeholder {
    color: var(--form-placeholder-color);
    opacity: 1;
    font-style: italic;
  }
  
  .form-control:disabled {
    background-color: #f7fafc;
    color: #3c434b;
    cursor: not-allowed;
    opacity: 0.6;
  }
  
  .select2-container .select2-selection--single,
  .select2-container .select2-selection--multiple {
    border-radius: 0 10px 10px 0;
  }
  
  .inputelement {
    padding-bottom: 8px;
  }
  
  .company-name {
    padding-top: 15px !important;
    width: 150px;
    overflow: hidden;
  }
  
  .company-name .truncate-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Fixed Header & Sidebar */
  .main-header {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 1030 !important;
  }
  
  .content-wrapper,
  .main-content {
    padding-top: 50px !important;
  }
  
  .main-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 1020 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  
  html {
    scroll-behavior: smooth;
  }
  
  .content-wrapper::-webkit-scrollbar {
    width: 8px;
  }
  
  .content-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
  }
  
  .main-sidebar::-webkit-scrollbar {
    width: 6px;
  }
  
  .main-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .main-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }
  
  .main-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
  }
  
  .content-wrapper {
    min-height: 100vh !important;
    overflow-x: hidden;
    overflow-y: auto;
  }
  
  /* Sidebar Search Icon */
  .sidebar-search-icon {
    display: none;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .sidebar-collapse .sidebar-search-icon {
    display: block !important;
  }
  
  .sidebar-search-icon i {
    color: #b8c7ce;
    font-size: 16px;
  }
  
  .sidebar-collapse .sidebar-search-icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }
  
  .sidebar-collapse .sidebar-search-icon:hover i {
    color: #fff;
  }
  
  .sidebar-collapse .sidebar-form {
    display: none !important;
  }
  
  .sidebar-collapse .user-panel {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .sidebar-mini:not(.sidebar-collapse) .sidebar-search-icon {
    display: none !important;
  }
  
  @media (max-width: 1024px) {
    .skin-blue .main-header .navbar .dropdown-menu li a {
      color: #000000;
    }
  }
  
  /* ============================================
     Mobile View Header Fix
     ============================================ */
  
  /* Adjust content wrapper padding for mobile */
  @media (max-width: 768px) {
  
    .content-wrapper,
    .main-content {
      padding-top: 100px !important;
      /* Increased from 50px */
    }
  
    /* Ensure page header is visible below fixed header */
    .content-wrapper>.content-header,
    .content-header {
      padding: 15px;
      position: relative;
      z-index: 1;
    }
  
    /* Adjust main header height if needed */
    .main-header {
      min-height: 50px;
    }
  
    /* Ensure navbar doesn't overflow */
    .main-header .navbar {
      min-height: 50px;
    }
  }
  
  /* For very small screens (phones in portrait) */
  @media (max-width: 480px) {
  
    .content-wrapper,
    .main-content {
      padding-top: 110px !important;
    }
  }
  
  /* Fix for sidebar toggle in mobile */
  @media (max-width: 768px) {
  
    .sidebar-mini.sidebar-collapse .content-wrapper,
    .sidebar-mini.sidebar-collapse .main-content {
      margin-left: 0 !important;
    }
  }