  /* Complete Updated CSS - Replace entire style section */

  /* QR Scanner Animations */
  @keyframes pulse {
    0%, 100% { 
      transform: scale(1); 
      opacity: 1; 
    }
    50% { 
      transform: scale(1.2); 
      opacity: 0.7; 
    }
  }

  /* CSS Variables */
  :root {
    --primary-color: #32c800;
    --secondary-color: #2e2e2e;
    --accent-color: #27ae60;
    --success-color: #1e7e34;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --text-color: #e0e0e0;
    --header-color: #ffffff;
    --sidebar-width: 35vh; /* Original responsive width */
    --header-height: 60px;
    --transition-speed: 0.3s;
    --status-pending-color: #e67e22;
    --status-approved-color: #2e7d32;
    --status-open-color: #219653;
    --status-closed-color: #0044cc;
    --status-rejected-color: #e74c3c;
    --sidebar-color: #535353;
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-button: 6px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.2);

  }

  

  /* Base Styles */
  body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: #f0f0f0;
    min-height: 100vh;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-y: auto;
    overflow-x: hidden;
  }

  
  
  /* PROFESSIONAL MOBILE SIDEBAR - REPLACE YOUR SIDEBAR CSS WITH THIS */

  /* ========================================
    PROFESSIONAL MOBILE SIDEBAR DESIGN
    ======================================== */

  /* Main Sidebar Container */
  .sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #f0f0f0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    max-height: 100vh; /* Ensure sidebar never exceeds viewport height */
    transition: left var(--transition-speed);
    z-index: 1300 !important;
    display: flex;
    flex-direction: column;
    padding: 0;
    padding-bottom: 10px; /* Space for bottom green line */
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden; /* Prevent sidebar itself from scrolling */
    border-bottom: 10px solid #32c800; /* Green line at extreme bottom */
  }

  /* Sidebar Top Section - Contains Logo */
  .sidebar-top {
    flex-shrink: 0; /* Logo never shrinks */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 0 0;
    /* Background removed - inherits from .sidebar for seamless look */
    position: relative;
    z-index: 10;
  }

  /* Logo - Fixed at top, compact on small heights */
  .sidebar-top .logo {
    flex-shrink: 0;
    max-height: 80px;
    transition: max-height 0.3s ease;
  }

  /* Navigation Links Container - Scrollable Area */
  #nav-links {
    flex: 1 1 auto !important;
    overflow-y: scroll !important; /* ALWAYS show scrollbar */
    overflow-x: hidden !important;
    min-height: 0 !important;
    padding: 10px 0 !important;
    list-style: none !important;
    margin: 0 !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;

    /* SOLID GREEN SCROLLBAR - Maximum visibility */
    scrollbar-width: thin !important;
    scrollbar-color: #32c800 #1a1a1a !important;
  }

  /* Webkit SOLID scrollbar - Very visible */
  #nav-links::-webkit-scrollbar {
    width: 14px !important;
    height: 14px !important;
  }

  #nav-links::-webkit-scrollbar-track {
    background: #1a1a1a !important;
    border-left: 1px solid #333 !important;
  }

  #nav-links::-webkit-scrollbar-thumb {
    background: #32c800 !important;
    border-radius: 0px !important;
    border: 3px solid #1a1a1a !important;
  }

  #nav-links::-webkit-scrollbar-thumb:hover {
    background: #3de800 !important;
  }


  
/* ========================================
   FORCE iPad Pro to MOBILE VIEW - OVERRIDE ALL
   ======================================== */

/* ========================================
   FORCE iPad Pro to MOBILE VIEW - FULL SCREEN SIDEBAR
   ======================================== */

/* iPad Pro Specific - Force Mobile Layout */
/* ========================================
   FORCE iPad Pro to MOBILE VIEW - WITH MOBILE TABLES
   ======================================== */

@media only screen 
  and (min-width: 1024px) 
  and (max-width: 1024px) 
  and (min-height: 1366px) 
  and (max-height: 1366px) {
  
  /* FORCE sidebar hidden */
  html body .sidebar {
    left: -100vw !important;
    width: 100vw !important;
    position: fixed !important;
    z-index: 1000 !important;
    transition: left 0.3s ease !important;
  }
  
  /* FORCE main content full width */
  html body .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: 60px !important;
    transition: none !important;
  }
  
  /* When sidebar opens */
  html body .sidebar.active {
    left: 0 !important;
  }

  /* ========================================
     MOBILE TABLE STYLES FOR iPad Pro
     ======================================== */
  
  /* Hide desktop tables - show mobile cards */
  #users-table {
    display: none !important;
  }
  
  .table-scroll-container {
    display: none !important;
  }

  /* Show user cards container */
  #user-cards-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    margin-top: 20px !important;
    width: 100% !important;
    max-width: 600px !important;
    margin-left: auto;
    margin-right: auto;
  }

  /* Mobile table column adjustments */
  table {
    font-size: 14px !important;
    min-width: 100% !important;
  }
  
  th, td {
    padding: 8px 4px !important;
    white-space: nowrap !important;
  }

  /* Column widths for status and history tables */
  #status-table th:nth-child(1), #status-table td:nth-child(1),
  #history-table th:nth-child(1), #history-table td:nth-child(1) {
    width: 32% !important;
  }

  #status-table th:nth-child(2), #status-table td:nth-child(2),
  #history-table th:nth-child(2), #history-table td:nth-child(2) {
    width: 8% !important;
    text-align: center !important;
    padding: 8px 2px !important;
  }

  #status-table th:nth-child(3), #status-table td:nth-child(3),
  #history-table th:nth-child(3), #history-table td:nth-child(3) {
    width: 28% !important;
  }

  #status-table th:nth-child(4), #status-table td:nth-child(4),
  #history-table th:nth-child(4), #history-table td:nth-child(4) {
    width: 32% !important;
    text-align: center !important;
  }

  /* Mobile Action Buttons */
  .action-buttons {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }

  .action-buttons button {
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 4px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  /* Dashboard cards mobile layout */
  .dashboard-card {
    flex: 1 1 calc(50% - 10px) !important;
    min-width: 200px !important;
  }

  /* Modal mobile adjustments */
  .modal.show {
    align-items: flex-start !important;
    padding: 20px !important;
    overflow-y: auto !important;
  }
  
  .modal-dialog {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: calc(100% - 40px) !important;
  }
  
  .modal-content {
    color: #333 !important;
    background-color: #fff !important;
    border-radius: 6px !important;
    box-shadow: 0 3px 9px rgba(0,0,0,0.5) !important;
  }
  
  .modal-body {
    padding: 15px !important;
    max-height: calc(100vh - 160px) !important;
    overflow-y: auto !important;
  }

  /* Prevent iOS zoom on inputs */
  input[type="color"],
  input[type="date"],
  input[type="datetime"],
  input[type="datetime-local"],
  input[type="email"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="text"],
  input[type="time"],
  input[type="url"],
  input[type="week"],
  select,
  textarea {
    font-size: 16px !important;
  }
}


/* FULL-SPACE LOGO WITH PERFECT SIZING */
.logo {
  width: calc(var(--sidebar-width) - 30px) !important;
  max-width: 250px !important;
  min-width: 140px !important;
  height: auto !important;
  max-height: 120px !important;
  margin: 25px auto 15px auto !important; /* Reduced bottom margin for separator */
  display: block !important;
  object-fit: contain !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) !important;
  transition: all 0.3s ease !important;
  box-sizing: border-box !important;
}

.logo:hover {
  transform: scale(1.05) !important;
  filter: drop-shadow(0 6px 12px rgba(50, 200, 0, 0.4)) !important;
}



/* RESPONSIVE LOGO SIZING */
@media (max-height: 600px) {
  .logo {
    max-height: 80px !important;
    margin: 20px auto 10px auto !important;
  }
  
  .logo::after {
    margin: 10px auto 0 auto !important;
    height: 4px !important;
  }
}

@media (max-height: 500px) {
  .logo {
    max-height: 60px !important;
    margin: 15px auto 8px auto !important;
  }
  
  .logo::after {
    margin: 8px auto 0 auto !important;
    height: 3px !important;
  }
}

/* MOBILE LOGO SIZING */
@media (max-width: 768px) {
  .logo {
    width: calc(100vw - 60px) !important;
    max-width: 240px !important;
    min-width: 160px !important;
    max-height: 100px !important;
    margin: 20px auto 12px auto !important;
  }
  
  .logo::after {
    width: 70% !important;
    margin: 12px auto 0 auto !important;
  }
}

/* LOW HEIGHT SCREENS - Landscape & Small Devices */
@media (max-height: 600px) {
  /* Compact logo for low height screens */
  .sidebar-top .logo {
    max-height: 50px !important;
    margin: 8px auto !important;
  }

  .logo::after {
    margin: 5px auto 0 auto !important;
    height: 2px !important;
    width: 60% !important;
  }

  /* Compact navigation items */
  #nav-links {
    padding: 5px 0 !important;
  }

  #nav-links li a {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  /* Reduce sidebar top padding */
  .sidebar-top {
    padding: 5px 0 0 0 !important;
  }
}

/* EXTREMELY LOW HEIGHTS - Very compact mode */
@media (max-height: 400px) {
  /* Ultra-compact logo */
  .sidebar-top .logo {
    max-height: 35px !important;
    margin: 5px auto !important;
  }

  .logo::after {
    display: none !important; /* Hide separator line on very small screens */
  }

  /* Ultra-compact navigation */
  #nav-links li a {
    padding: 6px 10px !important;
    font-size: 11px !important;
    gap: 8px !important;
  }

  #nav-links li a i {
    font-size: 12px !important;
  }

  /* Minimal padding */
  .sidebar-top {
    padding: 3px 0 0 0 !important;
  }

  #nav-links {
    padding: 3px 0 !important;
  }
}
  .sidebar ul {
    list-style: none;
    padding: 0;
    width: 100%;
  }

  .sidebar ul li {
    width: 100%;
  }
  /* Individual Navigation Items */
  #nav-links li {
    width: 100%;
    margin-bottom: 4px;
    padding: 0 5px;
  }
  #nav-links li a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    
  }
  #nav-links li a:hover i {
    color: #32c800;
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(50, 200, 0, 0.5));
  }
  
  /* Active State */
  #nav-links li a.active {
    background: linear-gradient(135deg, #32c800 0%, #28b800 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(50, 200, 0, 0.4);
    border-left: 4px solid #ffffff;
    transform: translateX(5px);
  }
  .sidebar ul li a i {
    margin-right: 10px;
    transition: transform 0.3s ease;
  }
  #nav-links li a.active i {
    color: #ffffff;
    transform: scale(1.1);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
  }

  .sidebar ul li a:hover i {
    transform: scale(1.2);
  }
  /* Sidebar Bottom Section - Hidden (user info and logout moved to header) */
  .sidebar-bottom {
    display: none !important; /* Completely hidden - all info moved to header */
  }

  /* User info moved to header - hide from sidebar */
  .sidebar .user-info {
    display: none !important;
  }

  /* Logout section hidden - moved to header */
  #logout-section {
    display: none !important;
  }

  /* =====================================================
    COMPLETE LOGO + HAMBURGER + SEPARATOR FIX
    ===================================================== */

  /* HAMBURGER MENU */

  .hamburger {
    position: fixed !important;
    top: 10px !important;
    left: 15px !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    font-size: 30px !important;
    color: #000 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    z-index: 1200 !important;
    transition: all 0.3s ease !important;
    display: flex !important; /* Visible by default */
    align-items: center !important;
    justify-content: center !important;
  }
  .main-content {
    flex-grow: 1;
    margin-left: 0 !important;
    padding: 15px;
    transition: none !important; /* No animation - stays fixed */
    width: 100% !important;
  }
   /* Main content never shifts - always stays fixed */
  .main-content.shifted {
    margin-left: 0 !important;
    width: 100% !important;
  }
  /* Logout Section */
  #logout-section {
    padding: 0;
    text-align: center;
  }

  #logout-section a {
    color: #f0f0f0;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(200, 35, 51, 0.05) 100%);
    border: 1px solid rgba(220, 53, 69, 0.2);
  }
 #logout-section a:hover {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
  }


  /* Desktop sidebar toggle - REPLACE EXISTING RULE */
  @media (min-width: 769px) {
    .main-content.shifted {
      margin-left: 0 !important;
      width: 100% !important;
      transition: all 0.3s ease !important;
    }
  }

  /* Make sure main-content transitions smoothly */
  .main-content {
    transition: all 0.3s ease !important;
  }
  /* Forms */
  form {
    background-color: #444;
    padding: 25px;
    border-radius: var(--radius-large);
    max-width: 800px;
    margin: 20px auto;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-speed);
    position: relative;
  }

  form:hover {
    box-shadow: var(--shadow-lg);
  }

  form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #f0f0f0;
  }

  form input,
    form select,
    form textarea {
      width: 100%;
      padding: 10px 14px;
      margin-bottom: 10px;
      border: 1px solid #555;
      border-radius: var(--radius-medium);
      box-sizing: border-box;
      font-size: 14px;
      background-color: #333 !important;
      color: #f0f0f0 !important;
      transition: all 0.3s ease;
    }

  form input:focus,
  form select:focus,
  form textarea:focus {
    background-color: #2a2a2a !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important;
    outline: none;
  }
  form button:not(.edit-button):not(.reject-button):not(.approve-button):not(.print-button):not(.close-button):not(.view-button):not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-cancel):not(.btn-confirm):not(.analytics-btn-primary):not(.analytics-btn-secondary):not(.analytics-btn-icon):not(.btn-upload-disabled):not(.btn-upload-enabled):not(.btn-primary-full):not(.btn-secondary-small):not(.analytics-clear-search) {
      background: linear-gradient(145deg, #32c800, #28b800);
      color: #fff;
      padding: 12px 24px;
      border: none;
      border-radius: 8px;
      box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
      transition: all 0.3s ease;
      font-weight: 600;
      font-size: 16px;
      min-width: 120px;
      position: relative;
      overflow: hidden;
  }
  
  

  form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 200, 0, 0.4);
    background: linear-gradient(145deg, #28b800, #32c800);
    filter: brightness(1.1);
  }

  form button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
  }

  /* iPhone-style button variants */
  .iphone-button-primary {
    background: linear-gradient(145deg,#32c800, #28b800) !important;
    color: white !important;
    border-radius: 25px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3) !important;
    border: none !important;
    transition: all 0.3s ease !important;
  }

  .iphone-button-secondary {
    background: linear-gradient(145deg, #34C759, #28A745) !important;
    color: white !important;
    border-radius: 25px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3) !important;
    border: none !important;
    transition: all 0.3s ease !important;
  }

  .iphone-button-camera {
    background: linear-gradient(145deg, #FF9500, #FF6B00) !important;
    color: white !important;
    border-radius: 25px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3) !important;
    border: none !important;
    transition: all 0.3s ease !important;
  }

  .iphone-button-primary:hover,
  .iphone-button-secondary:hover,
  .iphone-button-camera:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.1) !important;
    box-shadow: 0 6px 20px rgba(50, 200, 0, 0.4) !important;
  }

  .iphone-button-secondary:hover {
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.4) !important;
  }

  .iphone-button-camera:hover {
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4) !important;
  }

  .iphone-button-primary:active,
  .iphone-button-secondary:active,
  .iphone-button-camera:active {
    transform: translateY(1px) !important;
    filter: brightness(0.95) !important;
  }

  /* Messages */
  .error {
    color: #ff4c4c;
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
  }

  .success {
    color: #2ecc71;
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
  }

.section {
  display: none;
  opacity: 0;
  /* Remove the transition line that causes fading */
}

.active-section {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Ensure login section is always visible when active */
#login-section.active-section {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

  /* Tables - Original Styling */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
    background-color: #555;
    color: #f0f0f0;
    position: relative;
  }

  /* Force correct colors for modal buttons */
    .modal-footer .btn-primary,
    .btn-primary {
        background: linear-gradient(145deg, #007bff, #0056b3) !important;
        color: white !important;
        border: none !important;
    }

    .modal-footer .btn-secondary,
    .btn-secondary {
        background: linear-gradient(145deg, #6c757d, #545b62) !important;
        color: white !important;
        border: none !important;
    }

    .modal-footer .btn-success,
    .btn-success {
        background: linear-gradient(145deg, #28a745, #1e7e34) !important;
        color: white !important;
        border: none !important;
    }

    /* Login form button - should stay green */
    #login-form button[type="submit"] {
        background: linear-gradient(145deg, #32c800, #28b800) !important;
        color: white !important;
    }

    /* Organization creation button */
    #create-organization-form button[type="submit"] {
        background: linear-gradient(145deg, #28a745, #1e7e34) !important;
        color: white !important;
    }

    /* Visitor/User registration buttons */
    #visitor-form button[type="submit"],
    #user-form button[type="submit"] {
        background: linear-gradient(145deg, #32c800, #28b800) !important;
        color: white !important;
    }

    /* Fix page margins - TARGET SPECIFIC SECTIONS ONLY */
    #data-visualization-section,
    #attendance-scanner-section,
    #download-report-section,
    #gate-pass-section,
    #master-data-section {
      padding-left: 15px !important;
      padding-right: 15px !important;
      box-sizing: border-box !important;
    }

    table,
    th,
    td {
      border: 1px solid #777;
    }

    th,
    td {
      padding: 10px;
      text-align: center;
      vertical-align: middle;
    }

    th {
      background-color: var(--primary-color);
      color: #f0f0f0;
      position: sticky;
      top: 0;
      z-index: 2;
    }

    /* Table zebra striping */
    table tr:nth-child(even) {
      background-color: #3a3a3a;
    }

    table tr:hover {
      background-color: #4a4a4a;
    }

    /* Table scroll container */
    .table-scroll-container {
      overflow-x: auto;
      overflow-y: hidden;
      max-width: 100%;
      white-space: nowrap;
    }

  /* Column widths - ONLY for status and history tables */
  #status-table th:nth-child(1), #status-table td:nth-child(1),
  #history-table th:nth-child(1), #history-table td:nth-child(1) { /* Name */
    width: 32% !important;
  }

  #status-table th:nth-child(2), #status-table td:nth-child(2),
  #history-table th:nth-child(2), #history-table td:nth-child(2) { /* Status */
    width: 8% !important;
    text-align: center !important;
    padding: 8px 2px !important;
  }

  #status-table th:nth-child(3), #status-table td:nth-child(3),
  #history-table th:nth-child(3), #history-table td:nth-child(3) { /* Mobile */
    width: 28% !important;
  }

  #status-table th:nth-child(4), #status-table td:nth-child(4),
  #history-table th:nth-child(4), #history-table td:nth-child(4) { /* Actions */
    width: 32% !important;
    text-align: center !important;
  }

  /* Action Buttons */
  .action-buttons {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }

  .action-buttons button {
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 4px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  /* Status Buttons */
  .status-button {
    min-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
    padding: 10px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    margin: 0 auto !important;
    border: none !important;
    color: white !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Action Button Text Labels - ADD THIS */
  .action-button-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  .action-button-text {
    font-size: 8px !important;
    color: #8E8E93 !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    margin-top: 3px !important;
    max-width: 32px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Status Button Text Labels - ADD THIS */
  .status-button-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    margin: 0 auto !important;
  }

  .status-button-text {
    font-size: 8px !important;
    color: #8E8E93 !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    margin-top: 3px !important;
    max-width: 32px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .status-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-hover) !important;
    filter: brightness(1.1) !important;
  }

  .status-button i {
    margin: 0 !important;
    font-size: 12px !important;
  }

  .status-pending {
    background-color: var(--status-pending-color);
  }

  .status-approved {
    background-color: var(--status-approved-color);
  }

  .status-open {
    background-color: var(--status-open-color);
  }

  .status-closed {
    background-color: var(--status-closed-color);
  }

  .status-rejected {
    background-color: var(--status-rejected-color);
  }

  /* Specific Action Button Colors */
  .approve-button,
  .reject-button,
  .print-button,
  .close-button,
  .view-button,
  .edit-button {
    min-width: 100px;
    padding: 6px 12px;
    border-radius: var(--radius-button);
    cursor: pointer;
    font-size: 14px;
    margin: 2px;
    border: none;
    color: white;
    transition: all 0.3s ease;
  }

  .approve-button {
    background-color: #227605;
  }

  .reject-button {
    background-color: #ff0000; background-color: #ff0000 !important;
  }

  .print-button {
    background-color: #ffd700;
    color: black;
  }

  .close-button {
    background-color: #0000ff;
  }

  .view-button {
    background-color: #ae8d09;
  }

  .edit-button {
     background-color: #0c4f06 !important;
  }

.approve-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(34, 118, 5, 0.4) !important;
    filter: brightness(1.1) !important;
  }

  .reject-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4) !important;
    filter: brightness(1.1) !important;
  }

  .print-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4) !important;
    filter: brightness(1.1) !important;
  }

  .close-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 255, 0.4) !important;
    filter: brightness(1.1) !important;
  }

  .view-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(174, 141, 9, 0.4) !important;
    filter: brightness(1.1) !important;
  }

  .edit-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(12, 79, 6, 0.4) !important;
    filter: brightness(1.1) !important;
  }

  Button hover effects
  button:hover:not(.approve-button):not(.reject-button):not(.print-button):not(.close-button):not(.view-button):not(.edit-button) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 200, 0, 0.3);
    filter: brightness(1.05);
  }
  /* Modal Styles */
  .modal-header {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-bottom: 1px solid #444 !important;
    border-radius: 12px 12px 0 0 !important;  /* ✅ ONLY TOP CORNERS */
  }

  /* Analytics Modal Specific Styling */
  #analyticsDetailModal .modal-header {
    background: var(--primary-color) !important;
    color: white !important;
    padding: 15px 20px !important;
    border-bottom: none !important;
  }

  #analyticsDetailModal .modal-content {
    border-radius: 12px 12px 0 0 !important;
    overflow: hidden !important;
    border: none !important;
  }

  #analyticsDetailModal .modal-body {
    padding: 20px !important;
    background-color: #fff !important;
    border-radius: 0 0 0 !important;
  }

  #analyticsDetailModal .modal-footer {
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
    border-radius: 0 0 12px 12px !important;
  }

  .modal-content {
    color: #333;  /* Solid white background */
  }

  /* Ensure Modal Content Container is Properly Rounded */
  .modal-dialog .modal-content,
  #viewGatePassModal .modal-dialog .modal-content {
    border-radius: 12px !important;
    overflow: hidden !important;
    border: none !important;
  }

  /* Ensure Modal Body has no top border radius */
  .modal-body,
  #analyticsDetailModal.modal-body,
  #viewGatePassModal  .modal-body {
    border-radius: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
  .modal-body {
    padding: 15px;
    background-color: #fff !important;  /* Solid white background */
    border-radius: 12px 12px 0px 0px !important;
  }


  .modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    display: none;
  }

  .modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .modal.fade {
    transition: opacity 0.15s linear;
  }

  .modal.fade:not(.show) {
    opacity: 0;
  }

  .modal.show {
    opacity: 1;
  }

  .modal[aria-hidden="true"] {
    display: none !important;
  }

  .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5) !important;  /* Solid backdrop */
  }

  .modal-backdrop.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
  }

  .modal-backdrop.show {
    opacity: 1 !important;
  }

  .modal:focus {
    outline: none;
  }

  .modal-dialog {
    position: relative !important;
    margin: 20px auto !important;
    max-width: 800px !important;

    pointer-events: none;
   z-index: 1051 !important;
  }

  .modal.show .modal-dialog {
    pointer-events: auto;
  }

  .modal.show {
    overflow: auto;
  }

  /* Better close button styling */
  .modal-footer {
    background-color: #f8f9fa !important;  /* Light background for footer */
    border-top: 1px solid #dee2e6 !important;
    padding: 15px !important;
    text-align: right !important;
  }

  .modal-footer button {
    background: linear-gradient(145deg, #666, #444) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
  }

  .modal-footer button:hover {
    background: linear-gradient(145deg, #777, #555) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4) !important;
  }

  .modal-footer button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
  }

  .modal-footer {
    background-color: #444;
  }
  /* Ensure body doesn't have conflicting styles when modal is open */
  body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
  }

  .modal-title {
    font-size: 20px;
    font-weight: 600;
  }

  .tooltip-inner {
    max-width: 200px;
    text-align: center;
    font-size: 14px;
    background-color: var(--primary-color);
    color: #f0f0f0;
  }

  /* Theme Toggle */
  .theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: background-color var(--transition-speed);
    z-index: 1001;
  }

  .theme-toggle:hover {
    background-color: var(--accent-color);
  }

  /* Dark Theme */
  body.dark-theme {
    background-color: #1a1a1a;
    color: #f0f0f0;
  }

  body.dark-theme .sidebar {
    background-color: #1a1a1a;
  }

  body.dark-theme form {
    background-color: #333;
  }

  body.dark-theme table,
  body.dark-theme th,
  body.dark-theme td {
    border-color: #555;
  }

  body.dark-theme th {
    background-color: var(--primary-color);
  }

  body.dark-theme .status-button {
    color: white;
  }

  /* Login Section */
  #login-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 600px;
    text-align: center;
    box-sizing: border-box;
    height: auto;
    max-height: 100vh;
  }

  #login-form {
    background-color: transparent; /* This line already exists */
    /* And add: */
    box-shadow: none;
    padding: 0;
  }

  label {
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 1rem;
  }

  #login-error {
    margin-bottom: 1rem;
  }

  input {
    padding: 0.75rem;
    margin-bottom: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    width: 100%;
    background-color: #333 !important;
    color: #f0f0f0 !important;
}

  input:focus {
    outline: none;
    border-color: #32c800;
    box-shadow: 0 0 5px rgba(50, 200, 0, 0.5);
  }
  /* Fix Browser Autocomplete White Background */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    input:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 30px #333 inset !important;
        -webkit-text-fill-color: #f0f0f0 !important;
        background-color: #333 !important;
        color: #f0f0f0 !important;
    }

    /* Fix for all browsers */
    input:autofill {
        background-color: #333 !important;
        color: #f0f0f0 !important;
    }

    /* Force dark background on all input states */
    input {
        background-color: #333 !important;
        color: #f0f0f0 !important;
    }

    input:focus {
        background-color: #2a2a2a !important;
        color: #f0f0f0 !important;
    }

  button {
    background-color: #32c800;
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
  }

  .login-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #f0f0f0;
    text-align: center;
  }

  h2 {
    font-size: 24px;
    color: #32c800;
    font-weight: bold;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 10px;
    line-height: 1.5;
  }

  
  .form-group {
    overflow: visible;
  }

  /* Dashboard Cards */
  .dashboard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    margin: 50px 20px 30px 20px; /* top: 50px, right: 20px, bottom: 30px, left: 20px */
  }

  .dashboard-card {
    flex: 1 1 calc(33.333% - 20px);
    min-width: 250px;
    height: 140px;
    padding: 20px;
    border-radius: 12px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  }

  .dashboard-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .dashboard-card p {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
  }

  .bg-blue { background-color: #0078D7; }
  .bg-green { background-color: #107C10; }
  .bg-darkblue { background-color: #0044cc; }
  .bg-orange { background-color: #FF8C00; }
  .bg-purple { background-color: #6B4C9A; }
  .bg-red { background-color: #dc3545; }

  /* Mobile user card layout */
  .user-card {
    background-color: #333;
    color: #fff;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-size: 14px;
  }

  .user-card p {
    margin: 6px 0;
    line-height: 1.4;
  }

  .user-card button {
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
  }

  .user-card button:hover {
    background-color: var(--accent-color);
  }

  /* Mobile Responsive Styles */
  @media (max-width: 768px) {

    /* Sidebar mobile behavior */
   .sidebar {
      position: fixed !important;
      top: 0 !important;
      left: -100vw !important;
      width: 100vw !important;
      height: 100vh !important;
      background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%) !important;
      transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
      z-index: 1300 !important; /* HIGHEST: Sidebar is on top */
      box-shadow: none !important;
      display: flex;
    }

    .sidebar.active {
      left: 0 !important;
    }
    
    .main-content {
      flex-grow: 1;
      /* margin-left: var(--sidebar-width); */
      padding: 20px;
      transition: margin-left var(--transition-speed);
      width: 100%; /* ✅ FIXED: Just use 100% */
    }
        
    /* Logo adjustments */
    .logo {
      width: 150px;
      max-height: 110px;
    }

    Table improvements
    .table-scroll-container {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    
    table {
      font-size: 12px;
      min-width: 100%;
    }
    
    th, td {
      padding: 8px 4px;
      white-space: nowrap;
    }
    
    /* Action buttons mobile */
    .action-buttons {
      flex-direction: row !important;
      gap: 2px;
    }
    
    .action-buttons button {
      min-width: 32px !important;
      width: 32px !important;
      height: 32px !important;
      padding: 4px !important;
      font-size: 14px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      border-radius: 10px !important;
      border: none !important;
      cursor: pointer !important;
      flex-shrink: 0 !important;
    }
      /* FORCE BUTTON COLORS - ADD AT END OF CSS FILE */
      .edit-button,
      .action-buttons .edit-button,
      button.edit-button {
        background-color: #0c4f06 !important;
        color: white !important;
      }

      .reject-button,
      .action-buttons .reject-button,
      button.reject-button {
        background-color: #ff0000 !important;
        color: white !important;
      }
    .status-button {
      width: 28px !important;
      height: 28px !important;
      font-size: 10px !important;
    }
      /* Fix action button containers */
    .action-button-container {
      min-height: auto !important;
      height: auto !important;
    }

    /* Fix action button text */
    .action-button-text {
      font-size: 8px !important;
      line-height: 1 !important;
      margin-top: 3px !important;
    }
    .status-button i {
      font-size: 10px !important;
    }

    /* Column widths on mobile */
    th:nth-child(2), td:nth-child(2) { /* Status */
      width: 6% !important;
      padding: 4px 1px !important;
    }
    
    th:nth-child(1), td:nth-child(1) { /* Name */
      width: 34% !important;
    }
    
    th:nth-child(3), td:nth-child(3) { /* Mobile */
      width: 28% !important;
    }
    
    th:nth-child(4), td:nth-child(4) { /* Actions */
      width: 32% !important;
    }

    /* Hide first column on some tables */
    #status-table th:nth-child(1),
    #status-table td:nth-child(1),
    #history-table th:nth-child(1),
    #history-table td:nth-child(1) {
      display: none;
    }

    /* Users table mobile */
    #users-table {
      display: none;
    }

    #user-cards-container {
      display: block !important;
    }

    /* Modal mobile adjustments */
    .modal.show {
      align-items: flex-start !important;
      padding: 20px;
      overflow-y: auto;
    }
    
    .modal-dialog {
      margin: 0 auto;
      width: 100%;
      max-width: calc(100% - 40px);
    }
    
    .modal-content {
      color: #333;
      background-color: #fff !important;  /* Add solid background */
      border-radius: 6px !important;
      box-shadow: 0 3px 9px rgba(0,0,0,0.5) !important;
    }
    
    .modal-body {
      padding: 15px;
      max-height: calc(100vh - 160px);
      overflow-y: auto;
    }

    /* iOS specific fixes */
    .modal,
    .modal-dialog,
    .modal-content,
    .modal-header,
    .modal-body,
    .modal-footer {
      -webkit-transform: translateZ(0) !important;
      transform: translateZ(0) !important;
      -webkit-backface-visibility: hidden !important;
      backface-visibility: hidden !important;
      pointer-events: auto !important;
      touch-action: manipulation !important;
    }
    
    .modal button,
    .modal a,
    .modal input,
    .modal select {
      pointer-events: auto !important;
      touch-action: manipulation !important;
      -webkit-touch-callout: none !important;
      user-select: none !important;
      -webkit-user-select: none !important;
      cursor: pointer !important;
    }
    
    .modal-dialog {
      transform: none !important;
      -webkit-transform: none !important;
    }

    /* Prevent iOS zoom */
    input[type="color"],
    input[type="date"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="text"],
    input[type="time"],
    input[type="url"],
    input[type="week"],
    select,
    textarea {
      font-size: 16px !important;
    }

    /* Dashboard cards mobile */
    .dashboard-card {
      flex: 1 1 calc(50% - 10px);
      min-width: 200px;
    }
  }

  @media (max-width: 768px) {
    .ios-mail-actions .action-buttons button {
      width: 32px !important;
      height: 32px !important;
      min-height: 32px !important;
      max-height: 32px !important;
    }
  }



  /* Tablet table responsiveness */
  @media (min-width: 768px) and (max-width: 1024px) {
    

    .modal.show {
      padding: 30px;
    }
    
    .modal-dialog {
      max-width: calc(100% - 60px);
    }
    
    .modal-content {
      max-height: calc(100vh - 60px);
    }
    
    .logo {
      width: 200px;
      max-height: 140px;
    }
    .table-scroll-container {
      max-width: 100% !important;
      overflow-x: auto !important;
    }
    #status-table, 
    #history-table {
      width: 100% !important;
      table-layout: auto !important;
      white-space: normal !important;
    }
    #status-table th, 
    #status-table td,
    #history-table th, 
    #history-table td {
      word-break: break-word !important;
      white-space: normal !important;
    }
  }


  /* Large screens */
  @media (min-width: 1200px) {
    .logo {
      width: 230px;
      max-height: 150px;
    }

    .modal.show {
      align-items: center !important;
      justify-content: center !important;
      padding-top: 60px !important;
    }

    .modal-dialog {
      margin: auto;
      max-height: 90vh;
      overflow-y: auto;
    }

    .modal-content {
      max-height: 85vh;
      overflow-y: auto;
    }
  }


  @media (min-width: 769px) {
    body .sidebar {
      left: 0 !important;
      transition: left 0.3s ease !important;
    }
    
    body .sidebar.active {
      left: -35vh !important;  /* This will override the above */
    }
    
    body .main-content.shifted {
      margin-left: 0 !important;
    }
  }

  /* iOS Modal Fix */
  @media only screen 
    and (max-device-width: 1024px) 
    and (orientation: portrait) 
    and (-webkit-min-device-pixel-ratio: 1) {
    
    .modal {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      z-index: 1050 !important;
      width: 100% !important;
      height: 100% !important;
      background: transparent !important;  /* Remove any background */
    }
    
    .modal-dialog {
      position: relative !important;
      margin: 80px auto 20px auto !important;
      transform: none !important;
      -webkit-transform: none !important;
      width: 90% !important;
      max-width: 90% !important;
    }
    
    .modal-content {
      position: relative !important;
      background-color: #fff !important;  /* Solid white background */
      border: 1px solid rgba(0,0,0,.2) !important;
      border-radius: 6px !important;
      box-shadow: 0 3px 9px rgba(0,0,0,.5) !important;
      background-clip: padding-box !important;
    }
    
    .modal-content,
    .modal-header,
    .modal-body,
    .modal-footer,
    .modal-content * {
      -webkit-transform: translateZ(0) !important;
      transform: translateZ(0) !important;
      pointer-events: auto !important;
    }
    
    input, select, textarea {
      font-size: 16px !important;
    }
  }

  /* Additional Mobile Fixes */
  @media (max-width: 1024px) and (orientation: portrait) {
    .modal * {
      -webkit-transform: translateZ(0);
      pointer-events: auto !important;
    }
    
    .modal-content {
      position: relative;
      z-index: 1;
    }
  }


  /* Toastify Desktop - Same Position */
  @media (min-width: 769px) {
    .toastify {
      top: auto !important;
      bottom: 20px !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      width: 350px !important;
      max-width: 350px !important;
      text-align: center !important;
    }
  }
  /* Toastify Mobile */
  @media (max-width: 768px) {
    .toastify {
      top: auto !important;
      bottom: 20px !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      width: 90% !important;
      max-width: 300px;
      text-align: center;
    }
  }

  /* Navigation Links Container */
  /* ❌ REMOVED: This was conflicting with the main #nav-links rule at line 107
     The duplicate rule was preventing proper flexbox stretching and scrolling */

  #nav-links li a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #f0f0f0;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
  }

  #nav-links li a:hover,
  #nav-links li a.active {
    background-color: #393939;
    border-left: 4px solid var(--primary-color);
    color: #fff;
    text-shadow: 0 0 5px rgba(50, 200, 0, 0.5);
  }

  #nav-links li a i {
    margin-right: 10px;
    transition: transform 0.3s ease;
  }

  #nav-links li a:hover i {
    transform: scale(1.2);
  }

  /* Fix table status section font size */
  #status-section table,
  #history-section table {
    font-size: 12px;
  }

  #status-section table th,
  #status-section table td,
  #history-section table th,
  #history-section table td {
    padding: 10px;
  }

  /* Text wrapping for all cells */
  td {
    word-wrap: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.3 !important;
  }

 /* Universal Smooth Transitions */
  button, .btn, [class*="-button"], input, select, textarea, .status-button {
    transition: all 0.3s ease !important;
  }

  /* Universal Active State */
  button:active, .btn:active, [class*="-button"]:active {
    transform: translateY(0) !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .select2-container--default .select2-selection--single {
    background-color: #fff !important;
    border: 1px solid #d1d5db !important;
    border-radius: var(--radius-medium) !important;
    height: 44px !important;
    padding: 0 16px !important;
    font-size: 16px !important;
    line-height: 44px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
  }

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  background-color: #fff !important;
  border: 1px solid #32c800 !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1) !important;
}

/* Fix Selected State - Remove Green Background */
.select2-container--default .select2-selection--single:not(.select2-selection--clearable) {
  background-color: #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered[title] {
  background-color: transparent !important;
}

/* Override any green backgrounds */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--single:active,
.select2-container--default .select2-selection--single.select2-selection--clearable {
  background: #fff !important;
  background-color: #fff !important;
}

.select2-container--default .select2-selection--single.select2-selection--clearable {
  background-color: #fff !important;
}

.select2-container--default .select2-selection--single:focus-within,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #32c800 !important;
  box-shadow: 0 0 0 3px rgba(50, 200, 0, 0.1) !important;
  outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #1f2937 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  line-height: 44px !important;
  font-weight: 500 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #9ca3af !important;
  font-weight: 400 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px !important;
  right: 12px !important;
  width: 20px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #6b7280 transparent transparent transparent !important;
  border-style: solid !important;
  border-width: 6px 5px 0 5px !important;
  height: 0 !important;
  left: 50% !important;
  margin-left: -5px !important;
  margin-top: -3px !important;
  position: absolute !important;
  top: 50% !important;
  width: 0 !important;
}

/* iPhone-Style Dropdown Menu */
.select2-dropdown {
  background-color: #fff !important;
  border: 1px solid #555 !important;
  border-radius: var(--radius-medium) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  margin-top: 4px !important;
}

.select2-container--default .select2-results__option {
  padding: 12px 16px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #1f2937 !important;
  border-bottom: 1px solid #f3f4f6 !important;
}

.select2-container--default .select2-results__option:last-child {
  border-bottom: none !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #32c800 !important;
  color: white !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #f0f9ff !important;
  color: #32c800 !important;
  font-weight: 600 !important;
}

.select2-search--dropdown .select2-search__field {
  background-color: #f9fafb !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 16px !important;
  margin: 8px !important;
  width: calc(100% - 16px) !important;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: #32c800 !important;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1) !important;
  outline: none !important;
}

/* iPhone-Style Container Width */
.select2-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* Remove Select2 Close Button Styling */
.select2-container--default .select2-selection--single .select2-selection__clear {
  color: #6b7280 !important;
  font-size: 18px !important;
  font-weight: bold !important;
  right: 35px !important;
}

  /* Select2 black background*/

  /* Dark Theme Select2 Styling */
.select2-container--default .select2-selection--single {
  background-color: #333 !important;
  border: 1px solid #555 !important;
  border-radius: var(--radius-medium) !important;
  height: 44px !important;
  padding: 0 16px !important;
  font-size: 16px !important;
  line-height: 44px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  background-color: #2a2a2a !important;
  border: 1px solid var(--primary-color) !important;
  box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #f0f0f0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  line-height: 44px !important;
  font-weight: 500 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #b0b0b0 !important;
  font-weight: 400 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #b0b0b0 transparent transparent transparent !important;
  border-style: solid !important;
  border-width: 6px 5px 0 5px !important;
  height: 0 !important;
  left: 50% !important;
  margin-left: -5px !important;
  margin-top: -3px !important;
  position: absolute !important;
  top: 50% !important;
  width: 0 !important;
}

/* Dark Dropdown Menu */
.select2-dropdown {
  background-color: #333 !important;
  border: 1px solid #555 !important;
  border-radius: var(--radius-medium) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
  margin-top: 4px !important;
}

.select2-container--default .select2-results__option {
  padding: 12px 16px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #f0f0f0 !important;
  background-color: #333 !important;
  border-bottom: 1px solid #444 !important;
}

.select2-container--default .select2-results__option:last-child {
  border-bottom: none !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary-color) !important;
  color: white !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #2a2a2a !important;
  color: var(--primary-color) !important;
  font-weight: 600 !important;
}

.select2-search--dropdown .select2-search__field {
  background-color: #2a2a2a !important;
  border: 1px solid #555 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 16px !important;
  margin: 8px !important;
  width: calc(100% - 16px) !important;
  color: #f0f0f0 !important;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important;
  outline: none !important;
}

.select2-search--dropdown .select2-search__field::placeholder {
  color: #b0b0b0 !important;
}


/* Force Dark Theme on Select2 Default State - Higher Specificity */
.select2-container .select2-selection--single {
  background-color: #333 !important;
  background-image: none !important;
  border: 1px solid #555 !important;
  border-radius: 8px !important;
  height: 44px !important;
}

.select2-container--default .select2-selection--single {
  background-color: #333 !important;
  background-image: none !important;
  border: 1px solid #555 !important;
  border-radius: 8px !important;
  height: 44px !important;
  color: #f0f0f0 !important;
}

/* Force text color */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #f0f0f0 !important;
  line-height: 42px !important;
  padding-left: 12px !important;
  padding-right: 30px !important;
}

/* Force placeholder color */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #b0b0b0 !important;
}

/* Force arrow color */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px !important;
  right: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #b0b0b0 transparent transparent transparent !important;
  margin-top: -3px !important;
}

/* Override any white backgrounds */
.select2-selection,
.select2-selection__rendered {
  background-color: #333 !important;
  color: #f0f0f0 !important;
}

/* Focus state */
/* SELECT2 FOCUS - EXACT MATCH with History Search */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  background-color: #2a2a2a !important; /* Same as history search focus */
  border-color: #32c800 !important; /* EXACT same green */
  box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important; /* EXACT same glow */
  outline: none !important;
}
/* ABSOLUTE LAST RESORT - OVERRIDE EVERYTHING */
* [class*="select2"] {
  background-color: #333 !important;
  color: #f0f0f0 !important;
}

.select2-container * {
  background-color: #333 !important;
  color: #f0f0f0 !important;
}

/* TARGET THE SELECT2 CONTAINER BACKGROUND SPECIFICALLY */

.select2-container,
.select2-container--default {
  background-color: transparent !important;
}

.select2-container .select2-selection,
.select2-container .select2-selection--single,
.select2-container--default .select2-selection,
.select2-container--default .select2-selection--single {
  background-color: #333 !important;
  background: #333 !important;
  background-image: none !important;
  border: 1px solid #555 !important; /* Same border as history search */
  border-radius: var(--radius-medium) !important;
  height: 44px !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important; /* Same transition */
  padding: 0 14px !important; /* Same padding */
}
/* Force the selection rendered area */
.select2-container .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__rendered {
  background-color: transparent !important;
  color: #f0f0f0 !important;
  line-height: 42px !important;
  padding-left: 12px !important;
  padding-right: 30px !important;
}

/* Remove any white backgrounds from spans inside */
.select2-container .select2-selection--single .select2-selection__rendered span,
.select2-container--default .select2-selection--single .select2-selection__rendered span {
  background-color: transparent !important;
  color: #f0f0f0 !important;
}

/* Target the actual input area */
.select2-container .select2-dropdown,
.select2-container--default .select2-dropdown {
  background-color: #333 !important;
  border: 1px solid #555 !important;
}


 /* Style Regular Select Elements */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px !important;
  border-radius: var(--radius-medium) !important;
  border: 1px solid #555 !important;
  color: #000 !important;
  font-size: 14px !important;
  padding: 10px 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.3s ease !important;
}

select:focus {
  background-color: #e6f4ea !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(50, 200, 0, 0.2);
  outline: none !important;
}

select option {
  background-color: #fff;
  color: #000;
  padding: 10px;
}

  @media (max-width: 768px) {
    #approvers option {
      font-size: 14px !important;
      padding: 8px 12px !important;
    }
  }

/* Force dropdown to match input field width exactly */
select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background-color: #333 !important; /* ADD THIS */
  color: #f0f0f0 !important; /* ADD THIS */
  border: 1px solid #555 !important; /* ADD THIS */
}

/* Prevent dropdown options from expanding beyond select width */
select option {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  word-wrap: break-word !important;
  background-color: #333 !important; /* ADD THIS */
  color: #f0f0f0 !important; /* ADD THIS */
}

/* Mobile specific constraints */
@media (max-width: 768px) {
  select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  
  select option {
    max-width: 100% !important;
    font-size: 14px !important;
  }
}

/* Ensure form inputs and selects have same width */
form input, form select, form textarea {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background-color: #2a2a2a !important;
}

/* Analytics Header */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px 25px;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-md);
}

.analytics-header h2 {
  color: var(--header-color);
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.analytics-header h2 i {
  margin-right: 10px;
  color: var(--primary-color);
}

.analytics-header-actions {
  display: flex;
  gap: 10px;
}

/* Analytics Buttons */
.analytics-btn-primary, .analytics-btn-secondary {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
@media (max-width: 768px) {
  .analytics-btn-primary, .analytics-btn-secondary {
    font-size: 11px !important;
    padding: 6px 12px !important;
    gap: 4px !important;
  }
  
  .analytics-header-actions {
    gap: 6px !important;
  }
}

@media (max-width: 768px) {
  #analyticsUniversalSearch {
    font-size: 14px !important;
    padding: 10px 10px 10px 35px !important;
  }
  
  .analytics-search-icon {
    left: 12px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 768px) {
  .analytics-card-number {
    font-size: 22px !important; /* ✅ Smaller than desktop 32px */
  }
  
  .analytics-card-header h3 {
    font-size: 12px !important;
  }
  
  .analytics-card-subtitle {
    font-size: 10px !important;
  }
}
.analytics-btn-primary {
  background: linear-gradient(145deg, var(--primary-color), var(--accent-color));
  color: white;
  box-shadow: var(--shadow-sm);
}

.analytics-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  filter: brightness(1.1);
}

.analytics-btn-secondary {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-color) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.analytics-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.analytics-btn-icon {
  position: relative !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  background: rgba(142, 142, 147, 0.12) !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.analytics-btn-icon:hover {
  background: rgba(142, 142, 147, 0.2) !important;
  transform: scale(1.05) !important;
}

.analytics-btn-icon:active {
  transform: scale(0.95) !important;
}

.analytics-btn-icon i {
  font-size: 14px !important;
  color: #8E8E93 !important;
  margin: 0 !important;
}

/* Analytics Search Section */
.analytics-search-section {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: var(--radius-large);
  margin-bottom: 25px;
  /* backdrop-filter: blur(10px); */
  box-shadow: var(--shadow-md);
}

.analytics-search-container {
  position: relative;
  margin-bottom: 15px;
}

.analytics-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.analytics-search-icon {
  position: absolute;
  left: 15px;
  color: #8E8E93;
  z-index: 2;
}

/* Exclude analytics search input from form styling */
#analyticsUniversalSearch {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-color) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--radius-medium) !important;
    width: 100% !important;
    padding: 12px 12px 12px 40px !important;
    font-size: 15px !important;
    transition: all var(--transition-speed) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    backdrop-filter: blur(5px) !important;
}

#analyticsUniversalSearch:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(50, 200, 0, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

#analyticsUniversalSearch::placeholder {
  color: rgba(240, 240, 240, 0.6);
}

.analytics-clear-search {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #8E8E93;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition-speed);
  width: 24px !important;  /* Fixed width */
  height: 24px !important; /* Fixed height */
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important; /* Smaller icon */
  margin: 0 !important;
}

.analytics-clear-search:hover {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger-color);
}

/* Search Suggestions */
.analytics-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #444;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-medium);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  display: none;
}

.analytics-suggestion-item {
  padding: 12px 15px;
  cursor: pointer;
  transition: background-color var(--transition-speed);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-suggestion-item:hover {
  background: rgba(50, 200, 0, 0.1);
  color: var(--primary-color);
}

.analytics-suggestion-item:last-child {
  border-bottom: none;
}

/* Analytics Filter Controls */
.analytics-filter-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 15px;
}

.analytics-filter-group {
  min-width: 140px;
  flex: 1;
  max-width: 200px;
  height: 44px; /* Force container height */
}

.analytics-filter-group select,
.analytics-filter-group button {
  height: 44px !important;
  line-height: normal;
}

.analytics-filter-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.analytics-filter-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(50, 200, 0, 0.2);
}
.analytics-filter-group select option {
  background: var(--secondary-color);
  color: var(--text-color);
}

/* Search Results Info */
.analytics-search-results-info {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(52, 152, 219, 0.2);
  border-radius: var(--radius-medium);
  color: var(--info-color);
  font-weight: 500;
  font-size: 14px;
  display: none;
}

/* Enhanced Dashboard Container */
.analytics-dashboard-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 30px;
}

.analytics-dashboard-card {
  flex: 1 1 calc(33.333% - 20px);
  min-width: 280px;
  height: 160px;
  padding: 20px;
  border-radius: var(--radius-large);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

.analytics-dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.analytics-dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
}

.analytics-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.analytics-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  opacity: 0.9;
}

.analytics-card-trend {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 10px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
}

.analytics-card-content {
  margin-bottom: 15px;
}

.analytics-card-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.analytics-card-subtitle {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 500;
}

.analytics-card-chart {
  height: 40px;
  position: relative;
  opacity: 0.7;
}

.analytics-card-chart canvas {
  max-height: 40px;
  width: 100% !important;
}

/* Enhanced Analytics Section */
.analytics-enhanced-section {
  margin-bottom: 25px;
}

.analytics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.analytics-insight-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-large);
  padding: 20px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed);
  min-height: 200px; /* Ensure minimum height */
  display: flex;
  flex-direction: column;
}

.analytics-insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.analytics-insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-shrink: 0; /* Don't shrink header */
}


.analytics-insight-header h3 {
  color: var(--header-color);
  font-size: 18px !important; /* Larger heading */
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-insight-header h3 i {
  color: var(--primary-color);
}

.analytics-insight-content {
  color: var(--text-color);
  flex: 1; /* Take remaining space */
  display: flex;
  flex-direction: column;
  min-height: 120px; /* Ensure content has space */
}

/* Visitor Journey */
.analytics-journey-timeline {
  max-height: 150px;
  overflow-y: auto;
}

.analytics-journey-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.analytics-journey-item:last-child {
  border-bottom: none;
}

.analytics-journey-time {
  font-size: 11px;
  color: #8E8E93;
  min-width: 60px;
}

.analytics-journey-event {
  flex: 1;
  margin-left: 12px;
}

.analytics-journey-status {
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
}

.analytics-status-in { 
  background: rgba(39, 174, 96, 0.3); 
  color: #2ecc71; 
}

.analytics-status-out { 
  background: rgba(52, 73, 94, 0.3); 
  color: #95a5a6; 
}

.analytics-status-pending { 
  background: rgba(230, 126, 34, 0.3); 
  color: #f39c12; 
}

.analytics-status-approved { 
  background: rgba(52, 152, 219, 0.3); 
  color: #3498db; 
}

/* Time Analysis */
.analytics-time-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.analytics-time-stat {
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-medium);
}

.analytics-stat-label {
  display: block;
  font-size: 10px;
  color: #8E8E93;
  margin-bottom: 4px;
}

.analytics-stat-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--header-color);
}

.analytics-time-chart {
  height: 120px;
}

/* Company Insights */
.analytics-company-list {
  max-height: 150px;
  overflow-y: auto;
}

.analytics-company-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.analytics-company-item:last-child {
  border-bottom: none;
}

.analytics-company-name {
  font-weight: 500;
  color: var(--header-color);
}

.analytics-company-count {
  background: rgba(52, 152, 219, 0.3);
  color: var(--info-color);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

/* Frequency Chart */
.analytics-frequency-chart {
  height: 120px;
}

/* Saved Searches */
.analytics-saved-searches {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-large);
  padding: 20px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}
.analytics-saved-searches-header .analytics-btn-secondary {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: auto !important;        /* ✅ ADD THIS */
  max-width: 150px !important;   /* ✅ ADD THIS */
  flex-shrink: 0 !important;     /* ✅ ADD THIS */
}
.analytics-saved-searches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 15px;
}

.analytics-saved-searches-header h3 {
  color: var(--header-color);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-saved-searches-header h3 i {
  color: var(--primary-color);
}

.analytics-saved-searches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-saved-search-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-color);
}
.analytics-saved-search-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-color);
}

/* ✅ ADD MOBILE FIX */
@media (max-width: 768px) {
  .analytics-saved-search-item {
    font-size: 10px !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    gap: 4px !important;
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  
  .analytics-saved-searches-header h3 {
    font-size: 14px !important;
  }
  
  .analytics-saved-searches-header .analytics-btn-secondary {
    font-size: 11px !important;
    padding: 6px 12px !important;
  }
}
.analytics-saved-search-item:hover {
  background: rgba(50, 200, 0, 0.2);
  color: var(--primary-color);
}

.analytics-saved-search-remove {
  background: none;
  border: none;
  color: #8E8E93;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  font-size: 10px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analytics-saved-search-remove:hover {
  background: var(--danger-color);
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .analytics-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .analytics-header h2 {
    font-size: 20px;
  }
  
  .analytics-dashboard-container {
    flex-direction: column;
  }
  
  .analytics-dashboard-card {
    flex: 1 1 100%;
    min-width: unset;
  }
  
  .analytics-row {
    grid-template-columns: 1fr;
  }
  
  .analytics-filter-controls {
    flex-direction: column;
  }
  
  .analytics-filter-group select {
    width: 100%;
  }
  
  .analytics-search-section {
    padding: 15px;
  }
  
  .analytics-time-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .analytics-saved-searches-header {
    flex-direction: column;
    gap: 10px;
  }
}



/* Analytics Modal Mobile Fixes */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px !important;
    max-width: calc(100% - 20px) !important;
  }
  
  .analytics-journey-detailed > div {
    grid-template-columns: 1fr !important;
  }
  
  .modal-body {
    padding: 15px !important;
    max-height: 80vh !important;
  }
}

/* iPhone Analytics Modal Fixes */
@media only screen and (max-device-width: 1024px) {
  /* Modal positioning for iPhone */
  .modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1050 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .modal-dialog {
    position: relative !important;
    margin: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    min-height: calc(100vh - 20px) !important;
  }
  
  .modal-content {
    position: relative !important;
    background-color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 20px rgba(0,0,0,0.5) !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
  }
  
  .modal-header {
    padding: 20px 15px 15px 15px !important;
    border-radius: 12px 12px 0 0 !important;
  }
  
  .modal-body {
    padding: 15px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 0 0 12px 12px !important;
  }
  
  .modal-footer {
    padding: 15px !important;
    border-radius: 0 0 12px 12px !important;
  }
  
  /* Prevent zoom on input focus */
  input, select, textarea, button {
    font-size: 16px !important;
    -webkit-user-select: none !important;
    user-select: none !important;
  }
  
  /* Better touch targets */
  button {
    min-height: 44px !important;
    min-width: 44px !important;
    -webkit-tap-highlight-color: transparent !important;
  }
}

/* iPhone-specific grid fixes */
@media only screen and (max-width: 768px) {
  /* Single column layout for analytics grids */
  .analytics-modal-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .analytics-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .analytics-daily-grid {
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 5px !important;
  }
  
  /* Smaller text for mobile */
  .analytics-modal-title {
    font-size: 18px !important;
  }
  
  .analytics-modal-text {
    font-size: 14px !important;
  }
  
  .analytics-modal-number {
    font-size: 24px !important;
  }
}

/* Hide All Analytics Scrollbars */
.analytics-insight-content,
.analytics-journey-timeline,
.analytics-company-list,
.modal-body {
  /* Hide scrollbar for Webkit browsers */
  -webkit-scrollbar: none;
  
  /* Hide scrollbar for Firefox */
  scrollbar-width: none;
  
  /* For older browsers */
  -ms-overflow-style: none;
}

/* Webkit scrollbar hiding */
  .analytics-insight-content::-webkit-scrollbar,
  .analytics-journey-timeline::-webkit-scrollbar,
  .analytics-company-list::-webkit-scrollbar,
  .modal-body::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
  }

  .action-buttons button {
    min-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
    padding: 4px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    position: relative !important;
    transition: all 0.3s ease !important;
  }

  /* FORCE Action Button Colors - Add right after the above */
  .action-buttons .edit-button {
    background-color: #0c4f06 !important;
    color: white !important;
  }

  .action-buttons .reject-button {
    background-color: #ff0000 !important;
    color: white !important;
  }

  .action-buttons .approve-button {
    background-color: #227605 !important;
    color: white !important;
  }

  .action-buttons .print-button {
    background-color: #ffd700 !important;
    color: black !important;
  }

  .action-buttons .close-button {
    background-color: #0000ff !important;
    color: white !important;
  }

  .action-buttons .view-button {
    background-color: #ae8d09 !important;
    color: white !important;
  }

/* Keep action button colors */
.approve-button {
  background-color: #227605 !important;
  color: white !important;
}

.reject-button {
  background-color: #ff0000 !important;
  color: white !important;
}

.print-button {
  background-color: #ffd700 !important;
  color: black !important;
}

.close-button {
  background-color: #0000ff !important;
  color: white !important;
}

.view-button {
  background-color: #ae8d09 !important;
  color: white !important;
}

.edit-button {
  background-color: #0c4f06 !important;
  color: white !important;
}



/* Restore action button hover effects */
.action-buttons button:hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.1) !important;
}

.action-buttons button:active {
  transform: translateY(0) !important;
}

/* Make sure Analytics expand buttons stay round (higher specificity) */
.analytics-insight-header .analytics-btn-icon {
  border-radius: 50% !important; /* Keep analytics buttons round */
  background: rgba(142, 142, 147, 0.12) !important;
  width: 32px !important;
  height: 32px !important;
  color: #8E8E93 !important;
}

/* Make entire date/time input clickable */
.datetimepicker-input {
  cursor: pointer !important;
}

#newInTime {
  cursor: pointer !important;
}

/* Mobile Date Picker Fix */
@media (max-width: 768px) {
  /* Fix datetimepicker positioning in modal */
  .bootstrap-datetimepicker-widget {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2000 !important;
    max-width: 300px !important;
    width: 90% !important;
  }
  
  /* Ensure modal doesn't interfere */
  .modal-body {
    position: relative !important;
    overflow: visible !important;
    background-color: #fff !important; /* Solid white background */
  }
  
  /* Fix modal z-index hierarchy */
  .modal {
    z-index: 1500 !important;
  }
  
  .modal-backdrop {
    z-index: 1400 !important;
  }
}

/* iPhone specific fixes */
@media only screen and (max-device-width: 1024px) {
  .bootstrap-datetimepicker-widget {
    position: fixed !important;
    top: 20% !important;
    left: 5% !important;
    right: 5% !important;
    width: 90% !important;
    transform: none !important;
    z-index: 2000 !important;
  }
}
/*---------------------------------------------------*/

/* iOS Mail Style Cards */
.ios-mail-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.ios-mail-card {
  background-color: #555;
  border-radius: 12px 12px 12px 12px; /* Only round TOP corners */
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
  position: relative; /* Required for ::after */
  overflow: hidden; /* Ensures clean edges */
}

.ios-mail-card::after {
  content: attr(data-status);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 15px; /* Increased from 10px for more text */
  background-color: var(--status-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px; /* Slightly smaller for longer text */
  font-weight: 600;
  border-radius: 0 0 12px 12px;
  padding: 0 8px; /* Add padding for long names */
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.ios-mail-card:hover {
  background-color: #4a4a4a;
}

.ios-mail-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  /* These properties enable photo display */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.ios-mail-content {
  flex: 1;
  min-width: 0;
}

.ios-mail-name {
  color: #f0f0f0;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.ios-mail-details {
  color: #b0b0b0;
  font-size: 14px;
  line-height: 1.3;
}

.ios-mail-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}


/*-------------------------------all input and search is with #333 colour----------------------------------*/


.iphone-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 17px;
  color: #f0f0f0; /* White text */
  font-weight: 400;
  padding: 0;
  min-width: 0;
  text-align: center;
}

.iphone-search-input::placeholder {
  color: #b0b0b0; /* Light gray placeholder */
  font-weight: 400;
  text-align: center;
}

form input:not(.ios-visitor-card *):not(.ios-user-card *),
form select:not(.ios-visitor-card *):not(.ios-user-card *),
form textarea:not(.ios-visitor-card *):not(.ios-user-card *) {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 10px;
    border: 1px solid #555;
    border-radius: var(--radius-medium);
    box-sizing: border-box;
    font-size: 14px;
    background-color: #333 !important;
    color: #f0f0f0 !important;
    transition: all 0.3s ease;
  }

  /* Fix text wrapping in visitor/user cards */
  .ios-visitor-card .visitor-detail-row,
  .ios-user-card .user-detail-row {
      word-wrap: break-word !important;
      word-break: break-word !important;
      overflow-wrap: break-word !important;
      white-space: normal !important;
      flex-wrap: wrap !important;
  }

  .visitor-detail-row span:last-child,
  .user-detail-row span:last-child {
      flex: 1 1 auto !important;
      min-width: 0 !important;
      word-wrap: break-word !important;
      white-space: normal !important;
  }

  form input:focus,
  form select:focus,
  form textarea:focus {
    background-color: #2a2a2a !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important;
    outline: none;
  }
  
  /* Universal Input Styling - EXACT MATCH with History Search */
  form input,
  form select,
  form textarea,
  #history-search,
  #master-data-search,
  #status-search,
  .iphone-search-input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 10px;
    border: 1px solid #555;
    border-radius: var(--radius-medium);
    box-sizing: border-box;
    font-size: 14px;
    background-color: #333 !important;
    color: #f0f0f0 !important;
    transition: all 0.3s ease;
  }

    /* EXACT FOCUS STATE - Same as History Search */
    form input:focus,
    form select:focus,
    form textarea:focus,
    #history-search:focus,
    #master-data-search:focus,
    #status-search:focus,
    .iphone-search-input:focus {
      background-color: #2a2a2a !important;
      border-color: #32c800 !important; /* EXACT green color */
      box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important; /* EXACT glow effect */
      outline: none;
    }

    /* Placeholder styling */
    form input::placeholder,
    form textarea::placeholder,
    #history-search::placeholder,
    #master-data-search::placeholder,
    #status-search::placeholder,
    .iphone-search-input::placeholder {
      color: #b0b0b0 !important;
    }
    
/* For Firefox and other browsers */
input[type="date"],
input[type="time"] {
  color-scheme: dark !important;
}   

/* Style ALL Regular Select Elements - Including User Management */
select,
#idType,
#editIdType,
#userRole,
#userDepartment,
form select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: #333 !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b0b0b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 20px !important;
  padding-right: 40px !important;
  border-radius: var(--radius-medium) !important;
  border: 1px solid #555 !important;
  color: #f0f0f0 !important;
  font-size: 14px !important;
  padding: 10px 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.3s ease !important;
}

/* Mobile Override for Regular Selects - ADD THIS */
/* Fix Regular HTML Selects on Mobile */
@media (max-width: 768px) {
  /* Force native mobile appearance for regular selects */
  select:not(.select2-hidden-accessible) {
    -webkit-appearance: menulist !important;
    appearance: menulist !important;
    background-color: #333 !important;
    color: #f0f0f0 !important;
    border: 1px solid #555 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Force mobile browser to handle dropdown properly */
  select:not(.select2-hidden-accessible):focus {
    outline: none !important;
    border-color: #32c800 !important;
  }
  
  /* Style the dropdown options */
  select:not(.select2-hidden-accessible) option {
    background-color: #333 !important;
    color: #f0f0f0 !important;
    padding: 12px !important;
  }
  
  /* Prevent custom styling that breaks mobile */
  select:not(.select2-hidden-accessible) {
    background-image: none !important;
  }
}



/* iOS specific fixes */
@media only screen and (max-device-width: 1024px) {
  select:not(.select2-hidden-accessible) {
    -webkit-appearance: menulist !important;
    appearance: menulist !important;
    font-size: 16px !important; /* Prevents zoom */
  }
}

/* Focus state for ALL regular selects */
select:focus,
#idType:focus,
#editIdType:focus,
#userRole:focus,
#userDepartment:focus,
form select:focus {
  background-color: #2a2a2a !important;
  border-color: #32c800 !important; /* Same green as other inputs */
  box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important; /* Same glow */
  outline: none !important;
}

/* Style ALL dropdown options */
select option,
#idType option,
#editIdType option,
#userRole option,
#userDepartment option {
  background-color: #333 !important;
  color: #f0f0f0 !important;
  padding: 10px !important;
}

/* Mobile specific fixes for User Management dropdowns */
@media (max-width: 768px) {
  #idType option,
  #editIdType option,
  #userRole option,
  #userDepartment option {
    font-size: 14px !important;
    padding: 8px 12px !important;
  }
}

/* Force dropdown to match input field width exactly */
select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Prevent dropdown options from expanding beyond select width */
select option {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  word-wrap: break-word !important;
}   

/* Modal Content Overflow Fix - ADD THIS AT THE END */
.modal-content {
  max-width: 100% !important;
  overflow: hidden !important;
  word-wrap: break-word !important;
}

.modal-body {
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

.modal-body p,
.modal-body div,
.modal-body span {
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
}






@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px auto !important;
    width: calc(100% - 20px) !important;
    max-width: 100% !important;
  }

  .modal-content {
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .modal-body {
    padding: 15px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }

  .modal-footer {
    padding-bottom: env(safe-area-inset-bottom, 10px) !important;
    margin-bottom: 0 !important;
  }
}


@media (min-width: 1025px) {
  .modal-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0 auto !important;
    height: auto !important;
    max-height: 90vh !important;
  }

  .modal-content {
    height: auto !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    border-radius: 12px !important;
    padding: 20px !important;
    box-sizing: border-box !important;
  }

  .modal-body {
    padding: 0 !important;
  }

  .modal-footer {
    margin-top: auto !important;
    padding: 0 !important;
  }

  .modal-body > div,
  .modal-footer > div {
    padding: 20px !important;
  }
}



/* MINIMAL FIX - Just hide table and show cards - ADD THIS CSS ONLY */

/* Hide the desktop table completely */
#users-table {
  display: none !important;
}

.table-scroll-container {
  display: none !important;
}

/* Show user cards container always */
#user-cards-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important; /* Same gap as visitor cards */
  margin-top: 20px !important;
  width: 100% !important;
  max-width: 600px; /* Same max-width constraint */
  margin-left: auto;
  margin-right: auto;
}


/* Fix user card to accommodate bottom bar */
.ios-user-card {
  background-color: #555;
  border-radius: 12px;
  padding: 16px 16px 25px 16px; /* Same as visitor cards */
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  overflow: hidden;
  margin: 15px auto; /* Same margin as visitor cards */
  max-width: 600px; /* Same max-width as visitor cards */
  min-height: 200px; /* Same min-height as visitor cards */
  position: relative;
  width: 100%; /* Ensure full width usage */
}

/* Fix user header layout */
.ios-user-card:hover {
  background-color: #4a4a4a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Fix user content area */
.ios-user-content {
  flex: 1;
  min-width: 0;
  width: 100%; /* Ensure full width */
}

/* Fix user header to match visitor header sizing */
.ios-user-header {
  display: flex;
  align-items: center;
  gap: 15px; /* Same gap as visitor header */
  margin-bottom: 20px; /* Same margin as visitor header */
  width: 100%;
}

/* Fix user details section */
.ios-user-details {
  display: block;
  margin-top: 8px;
  width: 100%;
  gap: 12px; /* Same gap as visitor details */
}

/* Fix user detail rows - text wrapping */
.user-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 0; /* Increase padding */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; /* Force border */
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: #b0b0b0;
  font-size: 12px;
  line-height: 1.4;
}

.user-detail-row:last-child {
  border-bottom: none !important;
  margin-bottom: 0;
}

/* Fix icons and labels */
.user-detail-row i {
  color: var(--primary-color);
  width: 16px;
  font-size: 12px;
  flex-shrink: 0 !important;
  margin-top: 2px; /* Align with text */
}

.user-detail-row strong {
  color: #f0f0f0;
  font-weight: 600;
  min-width: 80px;
  max-width: 80px;
  font-size: 12px;
  flex-shrink: 0 !important;
  line-height: 1.4;
}

/* Fix text content wrapping */
.user-detail-row span:last-child,
.user-detail-row:after {
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

/* Fix user actions - center at bottom */
.ios-user-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;
  margin-bottom: 15px;
  width: 100%; /* Ensure stays inside card */
  padding: 0; /* Remove any padding */
}

/* Fix action buttons */
.ios-user-actions .action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.ios-user-actions .action-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.ios-user-actions .action-buttons button {
  width: 40px;
  height: 40px;
  padding: 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-user-actions .action-button-text {
  font-size: 8px;
  color: #8E8E93;
  font-weight: 500;
  margin-top: 4px;
  text-align: center;
}

/* User avatar */
.ios-user-avatar {
  width: 50px; /* Same as visitor avatar */
  height: 50px; /* Same as visitor avatar */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 18px; /* Same as visitor avatar */
  flex-shrink: 0;
}

.ios-user-name {
  color: #f0f0f0;
  font-weight: 600;
  font-size: 18px; /* Same as visitor name */
  margin: 0;
  line-height: 1.4;
}
/* Bottom colored bar for user cards */
.ios-user-card::after {
  content: attr(data-status);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  background-color: var(--status-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 0 0 12px 12px;
  padding: 0 8px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Role status colors for user cards */
.ios-user-card[data-status*="Admin"] {
  --status-color: #e74c3c;
}

.ios-user-card[data-status*="Security"] {
  --status-color: #ffc107;
}

.ios-user-card[data-status*="Creator"] {
  --status-color: #17a2b8;
}

.ios-user-card[data-status*="Manager"] {
  --status-color: #6f42c1;
}

.ios-user-card[data-status*="Approver"] {
  --status-color: #2e7d32;
}

.ios-user-card[data-status*="User"] {
  --status-color: #28a745;
}

/* Default user status color */
.ios-user-card {
  --status-color: #95a5a6;
}




/* Search states styling */
.user-search-empty {
  text-align: center;
  padding: 40px;
  color: #666;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin: 20px 0;
}

.user-search-empty i {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.user-search-empty h4 {
  color: #999;
  font-weight: 500;
  margin-bottom: 10px;
}

.user-search-empty p {
  color: #999;
  font-size: 14px;
}

/* Enhanced Mobile Responsive for Reports & Bulk Upload */
/* Reports & Bulk Upload Section Styling */
.section-card {
  background-color: #444;
  padding: 25px;
  border-radius: 12px;
  max-width: none;
  /* margin: 0px 0; */
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  width: auto;
  display: block;
  position: relative;
  width: 100% auto;
  max-width: fit-content;
  align-items: center;
}

.section-card:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
}

.card-header i {
  color: var(--primary-color);
  font-size: 18px;
}

.card-header h3 {
  color: #f0f0f0;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  margin-top: 0px;
}

.card-description {
  color: #b0b0b0;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.btn-primary-full {
  width: 100%;
  background: linear-gradient(145deg, #007bff, #0056b3) !important;
  color: white !important;
  cursor: pointer !important;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(50, 200, 0, 0.4);
}

.btn-secondary-small {
  background: linear-gradient(145deg, var(--primary-color), var(--accent-color)) !important;
  color: white !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

.template-section {
  margin-bottom: 20px;
}

.file-upload-section {
  margin-bottom: 15px;
}

.file-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #f0f0f0;
  font-size: 14px;
}

/* File input should not be affected by form styles */
.file-input {
    background-color: #333 !important;
    color: #f0f0f0 !important;
    border: 2px dashed #666 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.file-input:hover {
  border-color: #17a2b8;
  background-color: #2a2a2a;
}

.file-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 5px rgba(50, 200, 0, 0.5);
}

.btn-upload-disabled {
  width: 100%;
  background: linear-gradient(145deg, #666, #555) !important;
  color: #999 !important;
  cursor: not-allowed !important;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-upload-enabled {
  width: 100%;
  background: linear-gradient(145deg, #17a2b8, #138496) !important;
  color: white !important;
  cursor: pointer !important;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-upload-enabled:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.upload-results {
  margin-top: 15px;
  display: none;
}

.upload-results .result-card {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.upload-results .success {
  background: #32c800;
  color: white;
}

.upload-results .warning {
  background: #ffc107;
  color: #212529;
}

.upload-results .error {
  background: #dc3545;
  color: white;
}

/* ✅ MOBILE FIX - FULL SCREEN SIDEBAR */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: calc(var(--header-height) + 15px) !important; /* Space for header */
  }

  .sidebar {
    left: -100vw !important;
    width: 100vw !important;
    height: 100vh !important;
  }

  .sidebar.active {
    left: 0 !important;
  }

  /* Hide user name in header on mobile */
  .header-user-name {
    display: none !important;
  }

  /* Adjust user dropdown for mobile */
  .header-user-dropdown {
    right: -10px !important;
    min-width: calc(100vw - 30px) !important;
    max-width: 320px !important;
  }

  /* Make hamburger always visible on mobile */
  .hamburger {
    display: flex !important;
  }
}

/* DESKTOP - Keep defaults (removed conflicting rules) */

/* Mobile Responsive for Reports & Bulk Upload */
@media (max-width: 768px) {
  #download-report-section {
    padding: 20px 15px !important;
  }
  
  #download-report-section h2 {
    font-size: 20px !important;
    margin-bottom: 25px !important;
  }

  #download-report-section .section-card {
    margin: 15px 0 !important;
    padding: 20px !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 8px !important;
  }
  
  .card-header {
    flex-direction: row !important;
    align-items: center !important;
    margin-bottom: 12px !important;
  }
  
  .card-header h3 {
    font-size: 16px !important;
  }
  
  .card-header i {
    font-size: 16px !important;
  }
  
  .card-description {
    font-size: 13px !important;
    line-height: 1.4 !important;
    margin-bottom: 15px !important;
  }
  
  .btn-primary-full,
  .btn-upload-disabled,
  .btn-upload-enabled {
    font-size: 14px !important;
    padding: 12px 16px !important;
  }
  
  .btn-secondary-small {
    font-size: 13px !important;
    padding: 8px 16px !important;
    width: 100% !important;
    justify-content: center !important;
  }
  
  .file-input {
    font-size: 14px !important;
    padding: 12px !important;
  }
  
  .template-section {
    margin-bottom: 15px !important;
  }
  
  .file-upload-section {
    margin-bottom: 12px !important;
  }
  
  .upload-results {
    margin-top: 12px !important;
  }
  
  .upload-results .result-card {
    padding: 12px !important;
    font-size: 13px !important;
  }
}


/* Analytics Filter Layout */
.analytics-filter-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 15px;
}

.analytics-filter-left {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

/* Calendar Date Picker */
.analytics-calendar-container {
  position: relative;
  z-index: 1000;
}

.analytics-calendar {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  width: 280px;
  font-family: 'Segoe UI', sans-serif;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #32c800;
  color: white;
  border-radius: 8px 8px 0 0;
}

.calendar-nav {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.calendar-nav:hover {
  background: rgba(255,255,255,0.2);
}

.calendar-month-year {
  font-weight: 600;
  font-size: 14px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.calendar-weekdays div {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #f0f0f0;
  padding: 1px;
}

.calendar-day {
  background: white;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.calendar-day:hover {
  background: #e8f5e8;
  color: #32c800;
}

.calendar-day.selected {
  background: #32c800 !important;
  color: white !important;
  font-weight: 600;
}

.calendar-day.in-range {
  background: rgba(50, 200, 0, 0.2) !important;
  color: #32c800 !important;
}

.calendar-day.other-month {
  color: #ccc;
}

.calendar-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

.calendar-btn-clear, .calendar-btn-apply {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.calendar-btn-clear {
  background: #6c757d;
  color: white;
}

.calendar-btn-clear:hover {
  background: #5a6268;
}

.calendar-btn-apply {
  background: #32c800;
  color: white;
}

.calendar-btn-apply:hover {
  background: #28a745;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .analytics-filter-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .analytics-calendar-container {
    align-self: center;
  }
  
  /* Attendance System heading - 50% smaller on mobile */
  #attendance-scanner-section h1 {
    font-size: 1.25rem !important;
  }
}



/* Calendar Button - REPLACE THE EXISTING .analytics-calendar-btn CSS WITH THIS */
.analytics-calendar-btn {
  width: 100%;
  padding: 8px 12px;
  height: 44px; /* Same height as selects */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-medium);
  background: rgba(50, 200, 0, 0.1);
  color: #32c800;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  box-sizing: border-box; /* Important for consistent sizing */
  min-width: 140px; /* Same as other filter groups */
}

.analytics-calendar-btn:hover {
  background: rgba(50, 200, 0, 0.2);
  border-color: #32c800;
}

.analytics-calendar-btn:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(50, 200, 0, 0.2);
}

/* Make sure all filter elements have same height */
.analytics-filter-group select,
.analytics-filter-group .analytics-calendar-btn {
  height: 44px;
  padding: 8px 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}


/* Make download section respond to sidebar toggle */
.main-content.shifted #download-report-section {
  width: 100% !important;
  margin-left: 0 !important;
}

.main-content.shifted #download-report-section > div {
  width: 100% !important;
  margin-left: 0 !important;
}


.download-cards-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px;
  width: 100%;
  margin-right: 50px;
  margin-left: 0px;
}

/* Make download section adjust when sidebar toggles */
.main-content.shifted .download-cards-container {
  width: calc(100% + 300px) !important;
  margin-left: -20px !important;
  transition: all 0.3s ease;
}

.download-cards-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px;
  width: 100%;
  margin-right: 50px;
  margin-left: 0px;
  transition: all 0.3s ease; /* Add smooth transition */
}
/* Fix ONLY the Download & Upload page responsiveness */
#download-report-section {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* When sidebar is hidden, expand download section */
.main-content.shifted #download-report-section {
  width: 100% !important;
}

.main-content.shifted .download-cards-container {
  max-width: none !important;
  width: 100% !important;
}

/* Ensure download cards respond to container changes */
.download-cards-container .section-card {
  max-width: calc(50% - 10px) !important;
}

.main-content.shifted .download-cards-container .section-card {
  max-width: calc(50% - 10px) !important;
}

/* Force download section to respond - Higher specificity */
.main-content.shifted #download-report-section {
  width: 100% !important;
  max-width: none !important;
}

.main-content.shifted #download-report-section .download-cards-container {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.main-content.shifted #download-report-section .section-card {
  max-width: calc(50% - 5px) !important;
}



/* ========================================
   COMPLETE IPHONE MODAL - ALL SCREEN SIZES
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: modalFadeIn 0.3s ease;
}
/* Custom Confirmation Modal - No conflict with Bootstrap or other modals */
.confirm-modal-content {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  width: 340px;
  max-width: 95vw;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-modal-content .modal-header {
  background: #32c800;
  padding: 20px 24px 16px;
  text-align: center;
  border-radius: 14px 14px 0 0;
}

.confirm-modal-content .modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.confirm-modal-content .modal-body {
  background: #fff;
  padding: 20px 24px;
  text-align: center;
}

.confirm-modal-content .modal-body p {
  margin: 0;
  color: #333;
  font-size: 15px;
  line-height: 1.4;
}

.confirm-modal-content .modal-footer {
  background: #fff;
  padding: 0;
  display: flex;
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 14px 14px;
  gap: 0;
}
/* ========================================
   FORCE BUTTON COLORS - OVERRIDE EXISTING CSS
   ======================================== */

.btn-cancel, .btn-confirm {
  flex: 1;
  padding: 16px 20px;
  background: transparent !important; /* ✅ Force transparent background */
  cursor: pointer;
  font-size: 16px !important;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0 !important; /* ✅ Remove any border radius */
}

.btn-cancel {
  border-right: 1px solid #32c800 !important;
  color: #007AFF !important; /* ✅ Force blue color */
  background: #fff !important; /* ✅ Force white background */
  font-weight: 600 !important;
}

.btn-confirm {
  color: #FF3B30 !important; /* ✅ Force red color */
  font-weight: 600 !important;
  background: #fff !important; /* ✅ Force white background */
  border-left: 1px solid #ff0000 !important;
}

.btn-cancel:hover {
  background: rgba(0, 122, 255, 0.1) !important;
  color: #32c800 !important;
    border-right: 1px solid #32c800 !important;
}

.btn-confirm:hover {
  background: rgba(255, 59, 48, 0.1) !important;
  color: #FF3B30 !important;
   border-right: 1px solid #ff0000 !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


.visitor-category-tag {
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 2px;
}



/* Better spaced visitor card layout */
.ios-visitor-card {
  background-color: #555;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  margin: 15px auto;
  max-width: 600px;
  min-height: 200px;
}

.ios-visitor-card:hover {
  background-color: #4a4a4a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Header section: Avatar + Name + Buttons */
.ios-visitor-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  position: relative;
}

.ios-visitor-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.ios-visitor-content {
  flex: 1;
  min-width: 0;
}

.ios-visitor-name {
  color: #f0f0f0;
  font-weight: 600;
  font-size: 18px;
  margin: 0;
}

/* Action buttons positioned top right */
.ios-visitor-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 15px;
}

.ios-visitor-actions .action-buttons {
  display: flex;
  gap: 8px;
}

.ios-visitor-actions .action-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.ios-visitor-actions .action-buttons button {
  width: 32px;
  height: 32px;
  padding: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.ios-visitor-actions .action-button-text {
  font-size: 8px !important;
  color: #8E8E93;
  font-weight: 500;
  margin-top: 2px;
  text-align: center;
}

/* Details section with proper spacing */
.ios-visitor-details {
  display: grid;
  gap: 12px;
  margin-top: 5px;
}

/* Fix missing borders for VISITOR detail rows */
.visitor-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0; /* Increase padding */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; /* Force border */
  color: #b0b0b0;
  font-size: 12px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}


/* Make sure icons don't shrink */
.visitor-detail-row i {
  color: var(--primary-color);
  width: 16px;
  font-size: 12px;
  flex-shrink: 0 !important;
}

/* Make sure labels don't shrink */
.visitor-detail-row strong {
  color: #f0f0f0;
  font-weight: 600;
  min-width: 80px;
  font-size: 12px;
  flex-shrink: 0 !important;
}

.visitor-detail-row:last-child {
  border-bottom: none !important;
  margin-bottom: 0;
}

/* Bottom colored bar for visitor cards (same as user cards) */
.ios-visitor-card::after {
  content: attr(data-visitor-info);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  background-color: var(--visitor-category-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 0 0 12px 12px;
  padding: 0 8px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Visitor category colors */
.ios-visitor-card[data-category*="Customer"] {
  --visitor-category-color: #e74c3c;
}

.ios-visitor-card[data-category*="Client"] {
  --visitor-category-color: #3498db;
}

.ios-visitor-card[data-category*="Vendor"] {
  --visitor-category-color: #f39c12;
}

.ios-visitor-card[data-category*="Partner"] {
  --visitor-category-color: #27ae60;
}

.ios-visitor-card[data-category*="Employee"] {
  --visitor-category-color: #9b59b6;
}

.ios-visitor-card[data-category*="Contractor"] {
  --visitor-category-color: #34495e;
}

.ios-visitor-card[data-category*="Guest"] {
  --visitor-category-color: #16a085;
}

.ios-visitor-card[data-category*="VIP"] {
  --visitor-category-color: #d35400;
}

/* Default category color */
.ios-visitor-card {
  --visitor-category-color: #95a5a6;
}


/* ========================================
   COMPLETE MOBILE FIXES - Keep Sidebar Large
   ======================================== */

/* Main mobile layout fixes */
@media only screen and (max-device-width: 480px) {
  
  /* Clean mobile layout for detail rows */
  .visitor-detail-row,
  .user-detail-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 4px 0 !important;
    width: 100% !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
  }
  
  /* Icon fixed width */
  .visitor-detail-row i,
  .user-detail-row i {
    width: 14px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
    margin-top: 1px !important;
  }

  .ios-visitor-actions .action-button-text {
    font-size: 8px !important;
    color: #8E8E93;
    font-weight: 500;
    margin-top: 2px;
    text-align: center;
  }
  
  
  /* Text content - flexible and wrapping */
  .visitor-detail-row strong,
  .user-detail-row strong {
    font-size: 12px !important;
    line-height: 1.2 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    flex: 1 !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  
  /* Card adjustments */
  .ios-visitor-card,
  .ios-user-card {
    padding: 10px !important;
    margin: 8px 4px !important;
    width: calc(100% - 8px) !important;
    box-sizing: border-box !important;
  }

  /* ========================================
     LOGIN SCREEN MOBILE OPTIMIZATION
     ======================================== */
  
  /* Login container */
  #login-section {
    padding: 15px !important;
    max-width: 100% !important;
  }
  
  /* Login form */
  #login-section form {
    padding: 15px !important;
    margin: 10px auto !important;
    max-width: 300px !important;
    border-radius: 8px !important;
  }
  
  /* Login logo */
  #login-section .logo,
  #login-section img {
    width: 120px !important;
    max-height: 80px !important;
    margin: 10px auto 15px auto !important;
  }
  
  /* Login heading */
  #login-section h2 {
    font-size: 18px !important;
    margin-bottom: 15px !important;
  }
  
  /* Login inputs */
  #login-section input {
    padding: 8px !important;
    font-size: 14px !important;
    margin-bottom: 10px !important;
    border-radius: 4px !important;
  }
  
  /* Login button */
  #login-section button {
    padding: 10px !important;
    font-size: 14px !important;
    border-radius: 4px !important;
    margin-bottom: 8px !important;
  }
  
  /* Login note */
  .login-note {
    font-size: 11px !important;
    margin-top: 8px !important;
    line-height: 1.3 !important;
  }

  /* ========================================
     GENERAL TEXT SIZE REDUCTION (EXCLUDING SIDEBAR)
     ======================================== */
  
  /* Headers - NOT in sidebar */
  .main-content h1 { font-size: 28px !important; }
  .main-content h2 { font-size: 24px !important; }
  .main-content h3 { font-size: 20px !important; }
  .main-content h4 { font-size: 18px !important; }
  .main-content h5 { font-size: 16px !important; }
  .main-content h6 { font-size: 14px !important; }
  
  
  /* Body text - NOT in sidebar */
  .main-content p, 
  .main-content span, 
  .main-content div:not(.sidebar *) {
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
  
  /* Labels and small text - NOT in sidebar */
  .main-content label, 
  .main-content small, 
  .main-content .small-text {
    font-size: 10px !important;
  }
  
  /* Buttons - NOT in sidebar */
  .main-content button {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  
  /* Form inputs - NOT in sidebar */
  .main-content input, 
  .main-content select, 
  .main-content textarea {
    font-size: 14px !important;
    padding: 6px !important;
  }
  
  /* Table text */
  table, th, td {
    font-size: 10px !important;
    padding: 4px 2px !important;
  }
  
  /* Modal text */
  .modal-body {
    font-size: 11px !important;
  }
  
  .modal-title {
    font-size: 16px !important;
  }
  
  /* Dashboard cards */
  .dashboard-card h3 {
    font-size: 12px !important;
  }
  
  .dashboard-card p {
    font-size: 20px !important;
  }
  
  /* Status badges */
  .status-badge,
  .badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }
  
  /* Or explicitly keep sidebar navigation readable */
  .sidebar ul li a {
    font-size: 16px !important; /* Keep larger for touch */
    padding: 12px 15px !important; /* Keep comfortable padding */
  }
  
  /* Keep sidebar logo large */
  .sidebar .logo {
    width: 180px !important; /* Keep original size */
    max-height: 140px !important;
  }
  
  /* Keep sidebar user info readable */
  .sidebar .user-info {
    font-size: 12px !important;
  }
  
  /* Keep sidebar logout button large */
  .sidebar #logout-section a {
    font-size: 16px !important;
    padding: 12px !important;
  }
}

/* Analytics mobile fixes - KEEP THIS SEPARATE */
@media (max-width: 480px) {
  .analytics-insight-card {
    padding: 15px;
  }
  
  .analytics-dashboard-card {
    padding: 15px;
    height: 140px;
  }
  
  .analytics-card-number {
    font-size: 24px;
  }
  
  .analytics-header-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .analytics-btn-primary,
  .analytics-btn-secondary {
    width: 100%;
    justify-content: center;
  }
}



/* ========================================
   ACTION BUTTON TEXT FIX - ADD THIS TO YOUR EXISTING CSS
   ======================================== */

/* Main mobile layout fixes */
@media only screen and (max-device-width: 480px) {
  
  /* ========================================
     ACTION BUTTONS TEXT - MAKE SMALLER
     ======================================== */
  
  /* Target all action button containers and their text */
  .action-buttons,
  .action-buttons *,
  .action-buttons button,
  .action-buttons span,
  .action-buttons div {
    font-size: 8px !important;
    line-height: 1.1 !important;
  }
  
  /* Action button icons should also be smaller */
  .action-buttons i,
  .action-buttons button i {
    font-size: 14px !important;
  }
  
  /* Any text or labels below action buttons */
  .action-text,
  .button-label,
  .action-label {
    font-size: 8px !important;
    line-height: 1.1 !important;
  }
  
  /* If action buttons are in table cells */
  td .action-buttons,
  td .action-buttons * {
    font-size: 7px !important;
  }
  
  /* Any other text that appears below buttons */
  .main-content .action-buttons ~ *,
  .main-content button ~ span,
  .main-content button ~ div {
    font-size: 8px !important;
  }
}

/* ========================================
   SIDEBAR HEIGHT FIX - ADD TO YOUR EXISTING CSS
   ======================================== */

/* Main mobile layout fixes */
@media only screen and (max-device-width: 480px) {
  
  /* ========================================
     SIDEBAR HEIGHT AND SCROLL FIX
     ======================================== */
  
  /* Make sidebar full height and scrollable */
  .sidebar {
    height: 100vh !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Make navigation area flexible so logout stays at bottom */
  /* Make navigation area scrollable - SCROLLBAR ALWAYS VISIBLE */
  #nav-links {
    overflow-y: scroll !important; /* Changed from auto to scroll - ALWAYS show scrollbar */
    max-height: none !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ========================================
   ACTION BUTTON TEXT FIX - ADD THIS TO YOUR EXISTING CSS
   ======================================== */

/* Main mobile layout fixes */
@media only screen and (max-device-width: 480px) {
  
  /* ========================================
     ACTION BUTTONS TEXT - MAKE SMALLER
     ======================================== */
  
  /* Target all action button containers and their text */
  .action-buttons,
  .action-buttons *,
  .action-buttons button,
  .action-buttons span,
  .action-buttons div {
    font-size: 8px !important;
    line-height: 1.1 !important;
  }
  
  /* Action button icons should also be smaller */
  .action-buttons i,
  .action-buttons button i {
    font-size: 14px !important;
  }
  
  /* Any text or labels below action buttons */
  .action-text,
  .button-label,
  .action-label {
    font-size: 8px !important;
    line-height: 1.1 !important;
  }
  
  /* If action buttons are in table cells */
  td .action-buttons,
  td .action-buttons * {
    font-size: 7px !important;
  }
  
  /* Any other text that appears below buttons */
  .main-content .action-buttons ~ *,
  .main-content button ~ span,
  .main-content button ~ div {
    font-size: 8px !important;
  }
}

/* =====================================================
   ORGANIZATION CARDS STYLING (iOS Style)
   ===================================================== */

.ios-org-card {
  background-color: #555;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  margin: 15px auto;
  max-width: 600px;
  min-height: 180px;
}

.ios-org-card:hover {
  background-color: #4a4a4a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ios-org-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  position: relative;
}

.ios-org-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.ios-org-content {
  flex: 1;
  min-width: 0;
}

.ios-org-name {
  color: #f0f0f0;
  font-weight: 600;
  font-size: 18px;
  margin: 0;
  line-height: 1.4;
}

.ios-org-details {
  display: grid;
  gap: 12px;
  margin-top: 5px;
}

.org-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #b0b0b0;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.org-detail-row i {
  color: var(--primary-color);
  width: 18px;
  font-size: 14px;
  flex-shrink: 0 !important;
}

.org-detail-row strong {
  color: #f0f0f0;
  font-weight: 600;
  min-width: 90px;
  font-size: 14px;
  flex-shrink: 0 !important;
}

.org-detail-row:last-child {
  border-bottom: none !important;
  margin-bottom: 0;
}

.ios-org-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;
  margin-bottom: 15px;
}

.ios-org-actions .action-buttons {
  display: flex;
  gap: 8px;
}

.ios-org-actions .action-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.ios-org-actions .action-buttons button {
  width: 40px;
  height: 40px;
  padding: 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-org-actions .action-button-text {
  font-size: 8px;
  color: #8E8E93;
  font-weight: 500;
  margin-top: 4px;
  text-align: center;
}

.ios-org-card::after {
  content: attr(data-status);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  background-color: var(--status-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 0 0 12px 12px;
  padding: 0 8px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Organization Cards Mobile/Tablet Responsive */
@media only screen and (max-width: 768px) {
  .ios-org-card {
    margin: 15px 15px !important;
    max-width: calc(100% - 30px) !important;
  }
  
  .ios-org-actions .action-buttons button {
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
  }
  
  .ios-org-actions .action-button-text {
    font-size: 8px !important;
    margin-top: 3px !important;
  }
  
  .ios-org-actions {
    margin-bottom: 20px !important;
  }
}

/* Organization Form Mobile/Tablet Responsive */
@media only screen and (max-width: 768px) {
  #organization-management-section form {
    margin-left: 15px !important;
    margin-right: 15px !important;
    max-width: calc(100% - 30px) !important;
  }
}

/* Organization Search Mobile/Tablet Responsive */
@media only screen and (max-width: 768px) {
  #organization-search {
    margin-left: 15px !important;
    margin-right: 15px !important;
    max-width: calc(100% - 30px) !important;
  }
}

@media only screen and (min-width: 769px) and (max-width: 1024px) {
  #organization-search {
    margin-left: 15px !important;
    margin-right: 15px !important;
    max-width: calc(100% - 30px) !important;
  }
}
/* =====================================================
   FORCE ALL SECTIONS TO BE FULL SCREEN
   ===================================================== */
   
/* Force ALL sections to be full screen always */
#status-section,
#history-section,
#visitor-registration-section,
#edit-visitor-section,
#login-section,
#download-report-section,
#master-data-section {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}


/* =====================================================
   ADD ONLY THIS CSS TO THE END OF YOUR style.css
   (This ensures the "Forgot Password?" link is visible)
   ===================================================== */

/* Force forgot password link to be visible - SPECIFIC TO LOGIN ONLY */
#login-form .forgot-password-link {
  display: block !important;
  margin-top: 15px !important;
  text-align: center !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#login-form .forgot-password-link a {
  display: inline !important;
  color: #32c800 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  transition: color 0.3s ease !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#login-form .forgot-password-link a:hover {
  color: #28a745 !important;
  text-decoration: underline !important;
}

/* Ensure login form elements are properly spaced */
#login-form button[type="submit"] {
  margin-bottom: 0 !important;
}

/* Make sure the link appears after the login button */
#login-form .forgot-password-link {
  order: 999 !important;
}



/* =====================================================
   STEP 2: KEEP ONLY THESE CLEAN PASSWORD RESET STYLES
   ===================================================== */

/* Password Reset Styles - NO CONFLICTS */
.forgot-password-link {
  margin-top: 15px;
  text-align: center;
}

.forgot-password-link a, 
.back-to-login a {
  color: #32c800;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.forgot-password-link a:hover, 
.back-to-login a:hover {
  color: #28a745;
  text-decoration: underline;
}

.reset-instruction {
  color: #b0b0b0;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.4;
}

.back-to-login {
  margin-top: 15px;
  text-align: center;
}

#reset-otp {
  font-size: 18px;
  letter-spacing: 2px;
  text-align: center;
  font-weight: bold;
}

#reset-otp::placeholder {
  letter-spacing: 1px;
  font-weight: normal;
}

.success-message {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
}

/* Fix Register Visitor Page Text Size on Mobile */
@media only screen and (max-device-width: 480px) {
  /* Override small text for visitor registration section */
  #visitor-registration-section h2 {
    font-size: 24px !important;
  }
  
  #visitor-registration-section label {
    font-size: 14px !important;
  }
  
  #visitor-registration-section input,
  #visitor-registration-section select,
  #visitor-registration-section textarea {
    font-size: 14px !important;
    padding: 12px 14px !important;
  }
}

/* Fix Data Visualization Header Overlap */
#data-visualization-section {
  padding-top: 40px !important;
}

#data-visualization-section h2 {
  margin-top: 20px !important;
}

/* Mobile fix */
@media only screen and (max-device-width: 480px) {
  #data-visualization-section {
    padding-top: 30px !important;
  }
  
  #data-visualization-section h2 {
    margin-top: 15px !important;
  }
}


/* MODERN APP HEADER WITH USER PROFILE */
.app-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--header-height) !important;
  background: linear-gradient(135deg, #32c800, #28b800) !important;
  z-index: 1100 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 0 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* User Profile Container in Header */
.header-user-profile {
  position: relative;
  display: none; /* Hidden by default until login */
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 25px;
  transition: background 0.3s ease;
}

.header-user-profile:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* User Avatar */
.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #32c800;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* User Name Text (Desktop only) */
.header-user-name {
  color: white;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

@media (min-width: 769px) {
  .header-user-name {
    display: block;
  }
}

/* Dropdown Arrow */
.header-user-dropdown-arrow {
  color: white;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.header-user-profile.active .header-user-dropdown-arrow {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.header-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #2c2c2c;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 2000;
  border: 1px solid rgba(50, 200, 0, 0.2);
}

.header-user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown Header */
.user-dropdown-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.user-dropdown-avatar-large {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #32c800, #28b800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 24px;
  color: white;
  margin: 0 auto 12px auto;
  box-shadow: 0 4px 12px rgba(50, 200, 0, 0.3);
}

.user-dropdown-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.user-dropdown-email {
  font-size: 13px;
  color: #b0b0b0;
}

/* Dropdown Info Section */
.user-dropdown-info {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-dropdown-info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
}

.user-dropdown-info-label {
  color: #888;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-dropdown-info-label i {
  color: #32c800;
  width: 16px;
}

.user-dropdown-info-value {
  color: #ffffff;
  font-weight: 500;
}

/* License Expiry Warning */
.user-dropdown-info-value.expiring-soon {
  color: #ffc107;
  animation: pulse 2s infinite;
}

.user-dropdown-info-value.expired {
  color: #dc3545;
}

/* Support Contact Section */
.user-dropdown-support {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(50, 200, 0, 0.05);
}

.user-dropdown-support-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
}

.user-dropdown-support-link {
  color: #32c800;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-dropdown-support-link:hover {
  color: #28b800;
  text-decoration: underline;
}

/* Dropdown Actions */
.user-dropdown-actions {
  padding: 15px 20px;
}

.user-dropdown-logout-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #dc3545, #c82333);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.user-dropdown-logout-btn:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* ...existing code... */

/* Add this at the end of your CSS file */

/* When the login page is active, hide the main header and hamburger menu */
body.login-active .app-header,
body.login-active .hamburger {
  display: none !important;
}

/* ...existing code... */

/* =====================================================
   FIX: VIEW GATE PASS MODAL POSITION (ALL SCREENS)
   ===================================================== */

/* 1. Change vertical alignment for this modal from 'center' to 'start' (top) */
#viewGatePassModal.modal.show {
  align-items: flex-start !important;
}

/* 2. On big screens (iPad and larger), provide a 20px offset from the header */
@media (min-width: 769px) {
  #viewGatePassModal .modal-dialog {
    margin-top: 70px !important; /* ✅ CHANGED: 50px for header + 20px space */
    margin-bottom: 50px !important; /* Provides space at the bottom for scrolling */
  }
}

/* 3. On mobile screens, the offset can be smaller */
@media (max-width: 768px) {
  #viewGatePassModal .modal-dialog {
    margin-top: 15px !important; /* Keeps a small margin on mobile */
  }
}


/* =====================================================
   FIX: VIEW GATE PASS MODAL POSITION (ALL SCREENS)
   ===================================================== */


/* ✅ REMOVE ALL PREVIOUS .iti CSS FIXES AND REPLACE WITH THIS COMPLETE VERSION */

/* Main container for the separated dial code input */
.iti--separate-dial-code {
  width: 100% !important;
  display: flex !important;
  height: 44px !important;
  border: 1px solid #555;
  border-radius: var(--radius-medium);
  background-color: #333;
  transition: all 0.3s ease;
}

/* Style the container on focus */
.iti--separate-dial-code.iti--container:focus-within {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 5px rgba(50, 200, 0, 0.5) !important;
}

/* Style the country code dropdown part */
.iti--separate-dial-code .iti__selected-flag {
  background-color: #444;
  border-radius: var(--radius-medium) 0 0 var(--radius-medium);
}

/* Style the actual phone number input field */
.iti--separate-dial-code input[type="tel"] {
  border: none !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
  height: 42px !important;
  background-color: transparent !important;
  /* ✅ Align text to the right */
  text-align: right !important;
  /* ✅ Add padding on the right for spacing */
  padding-right: 14px !important;
  padding-left: 10px !important; /* Keep a small left padding */
}
/* Remove focus outline from the input, as the container handles it */
.iti--separate-dial-code input[type="tel"]:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* --- Dropdown Dark Theme Fix --- */

/* The dropdown container */
.iti__country-list {
  background-color: #333 !important; /* Dark background */
  border: 1px solid #555 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Each country item in the list */
.iti__country {
  color: #f0f0f0 !important; /* Light text color */
}

/* The dial code next to the country name */
.iti__dial-code {
  color: #b0b0b0 !important; /* Dimmer color for dial code */
}

/* The highlighted country item on hover/selection */
.iti__country.iti__highlight {
  background-color: var(--primary-color) !important; /* Use your theme's green */
  color: #fff !important;
}

/* Ensure dial code is also white on highlight */
.iti__country.iti__highlight .iti__dial-code {
  color: #fff !important;
}



/* =====================================================
   PROFESSIONAL iOS-STYLE CHECK-IN MODAL
   ===================================================== */

.ios-checkin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 10050;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.ios-checkin-modal-card {
  background: #1c1c1e; /* iOS Dark Mode background */
  border-radius: 20px;
  width: calc(100% - 30px);
  max-width: 380px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
  overflow: hidden;
}

.ios-checkin-modal-overlay.visible .ios-checkin-modal-card {
  transform: scale(1);
  opacity: 1;
}

.ios-checkin-modal-header {
  background: linear-gradient(135deg, #2a2a2a, #1c1c1e);
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ios-checkin-modal-header h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ios-checkin-modal-header h3 i {
  color: var(--primary-color);
}

.ios-checkin-modal-body {
  padding: 25px 20px;
  color: #f5f5f7;
}

.ios-checkin-question-group {
  margin-bottom: 25px;
}

.ios-checkin-question-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #a0a0a5;
  margin-bottom: 12px;
}

/* Custom Segmented Control for Radio Buttons */
.ios-segmented-control {
  display: flex;
  background-color: #3a3a3c;
  border-radius: 10px;
  padding: 3px;
  width: 100%;
}

.ios-segmented-control input[type="radio"] {
  display: none;
}

.ios-segmented-control .segment {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  color: #f5f5f7;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

.ios-segmented-control input[type="radio"]:checked + .segment {
  background-color: var(--primary-color);
  color: #1c1c1e;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(50, 200, 0, 0.3);
}

/* Custom Checkbox */
.ios-checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  background: #2c2c2e;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #444;
}
.ios-checkbox-container input[type="checkbox"] {
  display: none;
}
.ios-checkbox-container .checkbox-icon {
  width: 22px;
  height: 22px;
  border: 2px solid #555;
  border-radius: 6px;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.ios-checkbox-container .checkbox-icon i {
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}
.ios-checkbox-container input[type="checkbox"]:checked + .checkbox-icon {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.ios-checkbox-container input[type="checkbox"]:checked + .checkbox-icon i {
  opacity: 1;
  transform: scale(1);
}
.ios-checkbox-container .checkbox-label {
  font-size: 13px;
  color: #d1d1d6;
  line-height: 1.4;
}

.ios-checkin-modal-footer {
  padding: 20px;
  display: flex;
  gap: 10px;
  background: #2c2c2e;
  border-top: 1px solid #444;
}

.ios-checkin-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-checkin-btn.primary {
  background: var(--primary-color);
  color: #1c1c1e;
}
.ios-checkin-btn.primary:disabled {
  background: #3a3a3c;
  color: #8e8e93;
  cursor: not-allowed;
  opacity: 0.7;
}

.ios-checkin-btn.secondary {
  background: #555;
  color: #fff;
}
/* ✅ Enhanced Button States */
.button-state-permission-denied {
  background-color: #6c757d !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.button-state-error {
  animation: pulse-error 2s infinite !important;
  border: 2px solid #ffc107 !important;
}

.button-state-success {
  opacity: 0.8 !important;
  cursor: default !important;
  pointer-events: none !important;
}

.button-state-cancelled {
  opacity: 0.7 !important;
  transform: scale(0.98) !important;
}

@keyframes pulse-error {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.button-state-recovering {
  transition: all 0.5s ease !important;
}



/* iOS-style toggle switch */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 31px;
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 25px;
  width: 25px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .ios-slider {
  background-color: #32c800;
}

input:checked + .ios-slider:before {
  transform: translateX(20px);
}

/* Focus state for accessibility */
input:focus + .ios-slider {
  box-shadow: 0 0 1px #32c800;
}

/* =====================================================
   SIDEBAR SCROLL INDICATOR (Enhanced Visual Hint)
   ===================================================== */

/* Fade gradient at bottom of nav to indicate scrollable content */
#nav-links::after {
  content: '\f078'; /* Font Awesome down arrow icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.98) 0%, rgba(26, 26, 26, 0.8) 50%, transparent 100%);
  pointer-events: none;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  margin-top: -40px;
  z-index: 5;
  color: #32c800;
  font-size: 14px;
  animation: scrollBounce 2s ease-in-out infinite;
  opacity: 0.8;
}

/* Only show scroll indicator when content is scrollable */
#nav-links.has-scroll-indicator::after {
  display: flex;
}

/* Subtle bounce animation for scroll indicator */
@keyframes scrollBounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(4px);
    opacity: 1;
  }
}

/* Hide scroll indicator on very tall screens where scrolling is not needed */
@media (min-height: 800px) {
  #nav-links::after {
    display: none;
  }
}

/* More subtle indicator on mobile */
@media (max-width: 768px) {
  #nav-links::after {
    font-size: 12px;
    height: 35px;
    margin-top: -35px;
  }
}

/* ============================================
   PROFESSIONAL LOGOUT CONFIRMATION MODAL
   ============================================ */

.logout-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 99999;
  animation: fadeIn 0.3s ease;
}

.logout-modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logout-modal {
  background: white;
  border-radius: 15px;
  padding: 0;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.4s ease;
  overflow: hidden;
}

.logout-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.logout-modal-icon {
  font-size: 32px;
  animation: pulse 2s infinite;
}

.logout-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.logout-modal-body {
  padding: 30px;
  text-align: center;
}

.logout-modal-body p {
  font-size: 16px;
  color: #333;
  margin: 0 0 10px 0;
  line-height: 1.6;
}

.logout-modal-body .logout-warning {
  font-size: 14px;
  color: #666;
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #ffc107;
}

.logout-modal-footer {
  padding: 20px 30px 30px 30px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

.logout-modal-btn {
  padding: 12px 35px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

.logout-modal-btn-cancel {
  background: #6c757d;
  color: white;
}

.logout-modal-btn-cancel:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.logout-modal-btn-logout {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

.logout-modal-btn-logout:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.logout-modal-btn:active {
  transform: translateY(0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .logout-modal {
    width: 95%;
    max-width: 350px;
  }

  .logout-modal-header {
    padding: 20px;
  }

  .logout-modal-header h2 {
    font-size: 20px;
  }

  .logout-modal-body {
    padding: 25px 20px;
  }

  .logout-modal-footer {
    flex-direction: column;
    padding: 15px 20px 25px 20px;
  }

  .logout-modal-btn {
    width: 100%;
  }
}

