  /* SIDEBAR WITH PROPER TOGGLE FUNCTIONALITY AND DARK MODE SUPPORT */
@media (min-width: 1024px) {
  /* Hide sidebar toggle button on desktop - always keep sidebar expanded */
  .demo1 .kt-sidebar .kt-sidebar-header .kt-btn {
    display: none !important;
  }

  /* Logo styling */
  .demo1 .kt-sidebar .kt-sidebar-header .default-logo {
    height: 22px;
    width: auto;
  }

  /* Menu arrow styling */
  .demo1 .kt-menu-arrow {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 20px;
    flex-shrink: 0;
    margin-left: 4px;
    margin-right: -10px;
  }

  /* Menu heading styling */
  .demo1 .kt-menu-heading {
    padding-top: 9px;
    padding-bottom: 1px;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
  }

  /* Accordion menu functionality */
  .demo1 .kt-menu-accordion {
    display: none;
    gap: 1px;
    padding-left: 10px;
    position: relative;
    margin-bottom: 4px;
  }

  .demo1 .kt-menu-accordion:before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    border-left: 1px solid hsl(var(--border));
  }

  .demo1 .kt-menu-item-show .kt-menu-accordion {
    display: flex;
    flex-direction: column;
  }

  /* Menu bullet styling */
  .demo1 .kt-menu-bullet {
    display: flex;
    width: 6px;
    margin-left: -3px;
    position: relative;
    justify-content: flex-start;
  }

  .demo1 .kt-menu-bullet:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translateY(-50%);
    background-color: hsl(var(--muted-foreground));
    transition: background-color 0.2s ease;
  }

  .demo1 .kt-menu-item-active .kt-menu-bullet:before {
    background-color: hsl(var(--primary));
  }

  .demo1 .kt-menu-link:hover .kt-menu-bullet:before {
    background-color: hsl(var(--primary));
  }

  /* Accordion menu item styling */
  .demo1 .kt-menu-accordion .kt-menu-link {
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 12px;
    font-weight: 400;
  }

  .demo1 .kt-menu-accordion .kt-menu-title {
    font-size: 12px;
    font-weight: 400;
  }
  /* Force sidebar to be visible by default - override all theme styles including .hidden */
  .demo1 .kt-sidebar,
  .demo1 .kt-sidebar.hidden {
    width: 280px !important;
    min-width: 280px !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    transform: none !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
  }

  /* Light mode styling */
  .demo1:not(.dark) .kt-sidebar {
    background-color: #f8f9fa !important;
    border-right: 2px solid #007bff !important;
  }

  /* Dark mode styling */
  .demo1.dark .kt-sidebar {
    background-color: #13161f !important;
    border-right: 1px solid #2e3648 !important;
  }

  /* Force wrapper to start after sidebar - no margin needed since sidebar is fixed */
  .demo1 .kt-wrapper {
    margin-left: 0 !important;
    padding-left: 280px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: padding-left 0.3s ease !important;
  }

  /* COLLAPSED STATE - Only applies on smaller screens (< 1024px) */

  /* Adjust main content top margin for fixed header */
  .demo1.kt-header-fixed .kt-wrapper {
    padding-top: 70px !important; /* Account for header height */
  }

  /* Ensure main content area adjusts properly */
  .demo1 main {
    margin-top: 0 !important;
  }








}

/* Login form container - override width constraints */
.login-form-container {
  max-width: 500px !important;
  width: auto !important;
}

/* Override media query for login form specifically */
@media (min-width: 1024px) {
  .login-form-container.kt-card {
    width: auto !important;
    max-width: 500px !important;
    margin-bottom: 15px !important;
  }
}

/* Desktop wrapper margin */
/* Global wrapper transition */
.kt-wrapper {
  transition: margin-left 0.3s ease !important;
}

/* Desktop content styles (1024px and above) */
@media (min-width: 1024px) {
  /* Remove max-width constraints and use full available space */
  .kt-container-fixed {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    padding: 0 20px !important;
  }
  
  /* Add proper spacing for desktop */
  .kt-container-fixed > div {
    padding: 0 !important;
  }
  
  /* Header spacing */
  .flex.flex-wrap.items-center.lg\:items-end.justify-between.gap-5.pb-7\.5 {
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
  }
  
  /* Card spacing */
  .kt-card {
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 15px !important;
  }
  
  /* Card header spacing */
  .kt-card-header {
    padding: 15px 20px !important;
    margin-bottom: 0 !important;
  }
  
  /* Card content spacing */
  .kt-card-content {
    padding: 0 20px 20px 20px !important;
  }
  
  /* Table spacing */
  .kt-table {
    width: 100% !important;
    max-width: none !important;
    margin-top: 8px !important;
  }
  
  /* Table header spacing */
  .kt-table thead th {
    padding: 12px 10px !important;
  }
  
  /* Table body spacing */
  .kt-table tbody td {
    padding: 10px !important;
  }
  
  /* Header content should use full width */
  .kt-header .kt-container-fixed {
    width: 100% !important;
    max-width: none !important;
    padding: 0 20px !important;
  }
}

/* Tablet sidebar styles (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .kt-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed !important;
    z-index: 1000 !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
  }
  
  .kt-sidebar.kt-drawer-on {
    transform: translateX(0);
  }
  
  .kt-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .kt-container-fixed {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 0 15px !important;
  }
  
  /* Add proper spacing for tablet */
  .kt-container-fixed > div {
    padding: 8px 0 !important;
  }
  
  /* Header spacing */
  .flex.flex-wrap.items-center.lg\:items-end.justify-between.gap-5.pb-7\.5 {
    margin-bottom: 15px !important;
    padding-bottom: 15px !important;
  }
  
  /* Card spacing */
  .kt-card {
    margin-bottom: 12px !important;
  }
  
  /* Card header spacing */
  .kt-card-header {
    padding: 12px 15px !important;
  }
  
  /* Card content spacing */
  .kt-card-content {
    padding: 0 15px 15px 15px !important;
  }
  
  /* Table spacing */
  .kt-table {
    margin-top: 6px !important;
  }
  
  /* Table header spacing */
  .kt-table thead th {
    padding: 10px 8px !important;
  }
  
  /* Table body spacing */
  .kt-table tbody td {
    padding: 8px !important;
  }
  
  /* Remove sidebar space reservation on tablet */
  .flex.grow {
    margin-left: 0 !important;
  }
  
  /* Fix main content area */
  main.grow {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Override any fixed margins */
  [style*="margin-left: 250px"] {
    margin-left: 0 !important;
  }
}

/* Mobile sidebar styles (below 768px) */
@media (max-width: 767px) {
  .kt-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed !important;
    z-index: 1000 !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
  }
  
  .kt-sidebar.kt-drawer-on {
    transform: translateX(0);
  }
  
  .kt-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .kt-container-fixed {
    width: 100% !important;
    margin-left: 0 !important;
  }
  
  /* Remove sidebar space reservation on mobile */
  .flex.grow {
    margin-left: 0 !important;
  }
  
  /* Fix main content area */
  main.grow {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Override any fixed margins */
  [style*="margin-left: 250px"] {
    margin-left: 0 !important;
  }
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
  /* Table responsive fixes */
  .kt-table {
    font-size: 12px !important;
    min-width: 100% !important;
  }
  
  .kt-table th,
  .kt-table td {
    padding: 8px 4px !important;
    white-space: nowrap;
  }
  
  /* Hide less important columns on mobile */
  .kt-table th:nth-child(3),
  .kt-table td:nth-child(3),
  .kt-table th:nth-child(4),
  .kt-table td:nth-child(4) {
    display: none;
  }
  

  
  /* Group action buttons horizontally on mobile */
  .flex.items-center.justify-end.gap-2 {
    flex-direction: row !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  
  /* Ensure action buttons stay in a row */
  .kt-table td:last-child .flex {
    flex-direction: row !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  
  /* Reduce action button size on mobile */
  .kt-btn-sm {
    padding: 4px !important;
    font-size: 10px !important;
  }
  
  .kt-btn-sm i {
    font-size: 12px !important;
  }
  
  /* Ensure action buttons stay horizontal even on very small screens */
  @media (max-width: 480px) {
    .flex.items-center.justify-end.gap-2 {
      flex-direction: row !important;
      gap: 2px !important;
      flex-wrap: nowrap !important;
    }
    
    .kt-table th:last-child,
    .kt-table td:last-child {
      min-width: 80px !important;
    }
    

  }
  
  /* Additional responsive improvements */
  @media (max-width: 768px) {
    /* Reduce table font size further on mobile */
    .kt-table {
      font-size: 11px !important;
    }
    
    /* Reduce padding on mobile */
    .kt-table th,
    .kt-table td {
      padding: 6px 3px !important;
    }
    
    /* Ensure table container takes full width */
    .kt-card-content {
      padding: 0 !important;
    }
    

  }
  
  @media (max-width: 576px) {
    /* Even smaller font and padding for very small screens */
    .kt-table {
      font-size: 10px !important;
    }
    
    .kt-table th,
    .kt-table td {
      padding: 4px 2px !important;
    }
    

    
    /* Make action buttons smaller */
    .kt-btn-sm {
      padding: 2px !important;
      font-size: 8px !important;
    }
    
    .kt-btn-sm i {
      font-size: 10px !important;
    }
  }
  
  /* Modal responsive fixes */
  #customerModal > div,
  #invoiceModal > div,
  #userModal > div {
    margin: 10px !important;
    max-width: calc(100% - 20px) !important;
    max-height: calc(100vh - 20px) !important;
  }
  
  #customerModal > div > div,
  #invoiceModal > div > div,
  #userModal > div > div {
    padding: 15px !important;
  }
  
  /* Form grid responsive */
  #customerModal form > div,
  #invoiceModal form > div,
  #userModal form > div {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  /* Invoice items responsive */
  #invoiceItems > div {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  
  /* Button responsive */
  .kt-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
  
  /* Action buttons responsive */
  .flex.items-center.justify-end.gap-2 {
    gap: 4px !important;
  }
  
  .kt-btn-sm {
    padding: 4px 6px !important;
    font-size: 10px !important;
  }
  
  /* Stats cards responsive */
  .grid.grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  
  /* Chart responsive */
  .kt-card-content canvas {
    max-height: 200px !important;
  }
  
  /* Header responsive */
  .kt-container-fixed {
    padding: 10px !important;
  }
  
  .flex.flex-wrap.items-center.lg\:items-end.justify-between.gap-5.pb-7\.5 {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px !important;
  }
  
  /* Container responsive */
  .kt-container-fixed > div {
    padding: 10px !important;
  }
  
  /* Invoice table specific fixes */
  #invoicesTable {
    width: 100% !important;
  }
  
  #invoicesTable th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    padding: 12px 8px !important;
    border-bottom: 2px solid #dee2e6 !important;
  }
  
  #invoicesTable td {
    padding: 12px 8px !important;
    border-bottom: 1px solid #dee2e6 !important;
    vertical-align: middle !important;
  }
  
  #invoicesTable tbody tr:hover {
    background-color: #f8f9fa !important;
  }
  
  /* Dark theme invoice table */
  .dark #invoicesTable th {
    background-color: #404040 !important;
    color: #ffffff !important;
    border-bottom-color: #555555 !important;
  }
  
  .dark #invoicesTable td {
    border-bottom-color: #404040 !important;
    color: #ffffff !important;
  }
  
  .dark #invoicesTable tbody tr:hover {
    background-color: #404040 !important;
  }
  
  /* Badge styling */
  .kt-badge {
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }
  
  .kt-badge-success {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
  }
  
  .kt-badge-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
  }
  
  .dark .kt-badge-success {
    background-color: #065f46 !important;
    color: #d1fae5 !important;
  }
  
  .dark .kt-badge-warning {
    background-color: #92400e !important;
    color: #fef3c7 !important;
  }
}

/* SIDEBAR COLLAPSE FUNCTIONALITY - Only on smaller screens */
@media (max-width: 1023px) {
  /* COLLAPSED STATE - Thin line visible on mobile/tablet */
  .demo1.kt-sidebar-collapse .kt-sidebar,
  .demo1.kt-sidebar-collapse .kt-sidebar.hidden {
    width: 4px !important;
    min-width: 4px !important;
    overflow: hidden !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    transform: none !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
    transition: width 0.3s ease !important;
  }

  /* Light mode collapsed styling */
  .demo1:not(.dark).kt-sidebar-collapse .kt-sidebar {
    background-color: #f8f9fa !important;
    border-right: 2px solid #007bff !important;
  }

  /* Dark mode collapsed styling */
  .demo1.dark.kt-sidebar-collapse .kt-sidebar {
    background-color: #13161f !important;
    border-right: 1px solid #2e3648 !important;
  }

  /* Hover behavior on smaller screens */
  .demo1.kt-sidebar-collapse .kt-sidebar:hover:not(.animating),
  .demo1.kt-sidebar-collapse .kt-sidebar.hidden:hover:not(.animating) {
    width: 280px !important;
    min-width: 280px !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    transform: none !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
    transition: width 0.3s ease !important;
  }

  /* Light mode hover on smaller screens */
  .demo1:not(.dark).kt-sidebar-collapse .kt-sidebar:hover:not(.animating) {
    background-color: rgba(248, 249, 250, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
  }

  /* Dark mode hover on smaller screens */
  .demo1.dark.kt-sidebar-collapse .kt-sidebar:hover:not(.animating) {
    background-color: rgba(19, 22, 31, 0.97) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
  }

  /* Adjust wrapper padding when hovering over collapsed sidebar */
  .demo1.kt-sidebar-collapse .kt-sidebar:hover ~ .kt-wrapper {
    padding-left: 280px !important;
    width: 100% !important;
  }

  /* Adjust header when hovering over collapsed sidebar */
  .demo1.kt-sidebar-collapse .kt-sidebar:hover ~ .kt-header {
    left: 280px !important;
    transition: left 0.3s ease !important;
  }
}

/* Remove sidebar spacing on tablet and mobile */
@media (max-width: 1023px) {
  /* Reset any desktop-specific sidebar styles on smaller screens - override .hidden */
  .demo1 .kt-sidebar,
  .demo1 .kt-sidebar.hidden,
  .demo1.kt-sidebar-collapse .kt-sidebar,
  .demo1.kt-sidebar-collapse .kt-sidebar.hidden,
  .demo1:not(.kt-sidebar-collapse) .kt-sidebar,
  .demo1:not(.kt-sidebar-collapse) .kt-sidebar.hidden {
    width: auto !important;
    min-width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: none !important; /* Mobile: hide by default, controlled by drawer */
  }

  /* Show sidebar on mobile when drawer is active */
  .demo1 .kt-sidebar.kt-drawer-on,
  .demo1 .kt-sidebar.hidden.kt-drawer-on {
    display: flex !important;
  }

  .kt-wrapper {
    margin-left: 0 !important;
  }

  .flex.grow {
    margin-left: 0 !important;
  }

  main.grow {
    margin-left: 0 !important;
  }
}

/* Dark mode styles */
.dark {
  color-scheme: dark;
}

.dark body {
  background-color: #1a1a1a;
  color: #ffffff;
}

.dark .kt-sidebar {
  background-color: #2d2d2d;
  border-color: #404040;
}

.dark .kt-header {
  background-color: #2d2d2d;
  border-color: #404040;
}

.dark .kt-menu-link {
  color: #e5e5e5;
}

.dark .kt-menu-link:hover {
  background-color: #404040;
}

.dark .kt-menu-item-active .kt-menu-link {
  background-color: #404040;
  color: #ffffff;
}

/* Force dark theme on all elements */
body {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

.kt-card {
  background-color: #2d2d2d !important;
  border-color: #404040 !important;
}

.kt-input {
  background-color: #404040 !important;
  border-color: #555555 !important;
  color: #ffffff !important;
}

.kt-input::placeholder {
  color: #aaaaaa !important;
}

.kt-btn {
  color: #ffffff !important;
}

.kt-btn-primary {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

.kt-btn-outline {
  border-color: #555555 !important;
  color: #ffffff !important;
}

.kt-form-label {
  color: #e5e5e5 !important;
}

.kt-link {
  color: #3b82f6 !important;
}

.text-mono {
  color: #e5e5e5 !important;
}

.text-secondary-foreground {
  color: #aaaaaa !important;
}

/* Modal dark theme fixes */
.kt-modal {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

.kt-modal-content {
  background-color: #2d2d2d !important;
  border-color: #404040 !important;
  color: #ffffff !important;
}

.kt-modal-header {
  background-color: #2d2d2d !important;
  border-bottom-color: #404040 !important;
}

.kt-modal-title {
  color: #ffffff !important;
}

.kt-modal-body {
  background-color: #2d2d2d !important;
  color: #ffffff !important;
}

.kt-modal-footer {
  background-color: #2d2d2d !important;
  border-top-color: #404040 !important;
}

.kt-modal-close {
  color: #ffffff !important;
}

.kt-modal-close:hover {
  background-color: #404040 !important;
}

/* Customer and Invoice Modal Dark Theme Fixes */
#customerModal > div,
#invoiceModal > div,
#userModal > div {
  background-color: #2d2d2d !important;
  color: #ffffff !important;
  border: 1px solid #404040 !important;
}

#customerModal h2,
#invoiceModal h2,
#userModal h2 {
  color: #ffffff !important;
}

#customerModal label,
#invoiceModal label,
#userModal label {
  color: #e5e5e5 !important;
}

#customerModal input,
#customerModal textarea,
#customerModal select,
#invoiceModal input,
#invoiceModal textarea,
#invoiceModal select,
#userModal input,
#userModal textarea,
#userModal select {
  background-color: #404040 !important;
  border-color: #555555 !important;
  color: #ffffff !important;
}

#customerModal input:focus,
#customerModal textarea:focus,
#customerModal select:focus,
#invoiceModal input:focus,
#invoiceModal textarea:focus,
#invoiceModal select:focus,
#userModal input:focus,
#userModal textarea:focus,
#userModal select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

#customerModal input::placeholder,
#customerModal textarea::placeholder,
#invoiceModal input::placeholder,
#invoiceModal textarea::placeholder,
#userModal input::placeholder,
#userModal textarea::placeholder {
  color: #aaaaaa !important;
}

#customerModal button[data-kt-modal-dismiss],
#invoiceModal button[data-kt-modal-dismiss],
#userModal button[data-kt-modal-dismiss] {
  color: #ffffff !important;
}

#customerModal button[data-kt-modal-dismiss]:hover,
#invoiceModal button[data-kt-modal-dismiss]:hover,
#userModal button[data-kt-modal-dismiss]:hover {
  background-color: #404040 !important;
}

/* Modal border fixes */
#customerModal > div > div,
#invoiceModal > div > div,
#userModal > div > div {
  border-color: #404040 !important;
}

/* Additional modal text fixes */
#customerModal *,
#invoiceModal *,
#userModal * {
  color: inherit !important;
}

#customerModal span,
#invoiceModal span,
#userModal span {
  color: #e5e5e5 !important;
}

#customerModal .text-muted,
#invoiceModal .text-muted,
#userModal .text-muted {
  color: #9ca3af !important;
}

/* Button styling in modals */
#customerModal button[type="submit"],
#invoiceModal button[type="submit"],
#userModal button[type="submit"] {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
}

#customerModal button[type="submit"]:hover,
#invoiceModal button[type="submit"]:hover,
#userModal button[type="submit"]:hover {
  background-color: #2563eb !important;
}

#customerModal button[data-kt-modal-dismiss]:not([type="submit"]),
#invoiceModal button[data-kt-modal-dismiss]:not([type="submit"]),
#userModal button[data-kt-modal-dismiss]:not([type="submit"]) {
  background-color: #6b7280 !important;
  color: #ffffff !important;
}

#customerModal button[data-kt-modal-dismiss]:not([type="submit"]):hover,
#invoiceModal button[data-kt-modal-dismiss]:not([type="submit"]):hover,
#userModal button[data-kt-modal-dismiss]:not([type="submit"]):hover {
  background-color: #4b5563 !important;
}

/* Dropdown dark theme fixes */
.kt-dropdown-menu {
  background-color: #2d2d2d !important;
  border-color: #404040 !important;
}

.kt-dropdown-menu-link {
  color: #ffffff !important;
}

.kt-dropdown-menu-link:hover {
  background-color: #404040 !important;
}

.kt-dropdown-menu-separator {
  background-color: #404040 !important;
}

/* Table dark theme fixes */
.kt-table {
  background-color: #2d2d2d !important;
  color: #ffffff !important;
  border-collapse: collapse !important;
}

.kt-table th {
  background-color: #404040 !important;
  color: #ffffff !important;
  border-color: #555555 !important;
  padding: 12px 8px !important;
  text-align: left !important;
  font-weight: 600 !important;
}

.kt-table td {
  border-color: #404040 !important;
  color: #ffffff !important;
  padding: 12px 8px !important;
  vertical-align: middle !important;
}

.kt-table tbody tr:hover {
  background-color: #404040 !important;
}

.kt-table tbody tr {
  border-bottom: 1px solid #404040 !important;
}

/* Force dark theme for all tables */
.kt-table,
.kt-table th,
.kt-table td,
.kt-table tbody tr {
  background-color: #2d2d2d !important;
  color: #ffffff !important;
  border-color: #404040 !important;
}

.kt-table th {
  background-color: #404040 !important;
  color: #ffffff !important;
  border-bottom-color: #555555 !important;
}

.kt-table tbody tr:hover {
  background-color: #404040 !important;
}

/* Text color fixes for table content */
.kt-table .text-dark {
  color: #ffffff !important;
}

.kt-table .text-muted {
  color: #9ca3af !important;
}

.kt-table .text-secondary-foreground {
  color: #9ca3af !important;
}

.kt-table .fw-bold {
  color: #ffffff !important;
}

.kt-table .fw-semibold {
  color: #e5e5e5 !important;
} 

/* Metronic demo1: Responsive horizontal scroll for tables */
.kt-scrollable-x-auto {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  position: relative;
}
.kt-scrollable-x-auto::-webkit-scrollbar {
  width: 0.35rem;
  height: 0.35rem;
}
.kt-scrollable-x-auto::-webkit-scrollbar-track {
  background-color: transparent;
}
.kt-scrollable-x-auto::-webkit-scrollbar-thumb {
  border-radius: 1.25rem;
}
.kt-scrollable-x-auto::-webkit-scrollbar-corner {
  background-color: transparent;
}
/* Scrollbar color on hover and with CSS variable */
.kt-scrollable-x-auto,
.kt-scrollable-x-auto:hover {
  scrollbar-color: var(--scrollbar-thumb-color, var(--color-input)) transparent;
}
.kt-scrollable-x-auto::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb-color, var(--color-input));
}
.kt-scrollable-x-auto::-webkit-scrollbar-corner {
  background-color: transparent;
}
@media (max-width: 1200px) {
  .kt-scrollable-x-auto {
    overflow-x: auto;
  }
}
@supports (-webkit-hyphens: none) {
  .kt-scrollable-x-auto {
    overflow-x: auto;
  }
} 

/* Activity badge color overrides for better readability */
.kt-badge-success {
  background-color: #10b981 !important;
  color: #ffffff !important;
}

.kt-badge-info {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
}

.kt-badge-danger {
  background-color: #ef4444 !important;
  color: #ffffff !important;
}

.kt-badge-warning {
  background-color: #f59e0b !important;
  color: #ffffff !important;
}

.kt-badge-primary {
  background-color: #8b5cf6 !important;
  color: #ffffff !important;
}

.kt-badge-secondary {
  background-color: #6b7280 !important;
  color: #ffffff !important;
}

/* Dark mode badge colors */
.dark .kt-badge-success {
  background-color: #059669 !important;
  color: #d1fae5 !important;
}

.dark .kt-badge-info {
  background-color: #2563eb !important;
  color: #dbeafe !important;
}

.dark .kt-badge-danger {
  background-color: #dc2626 !important;
  color: #fee2e2 !important;
}

.dark .kt-badge-warning {
  background-color: #d97706 !important;
  color: #fed7aa !important;
}

.dark .kt-badge-primary {
  background-color: #7c3aed !important;
  color: #e9d5ff !important;
}

.dark .kt-badge-secondary {
  background-color: #4b5563 !important;
  color: #e5e7eb !important;
}

/* Hosting package tier badges */
.kt-badge-package-bronze {
  background-color: #b45309 !important;
  color: #fff7ed !important;
  border: 1px solid #92400e !important;
}

.kt-badge-package-silver {
  background-color: #64748b !important;
  color: #f8fafc !important;
  border: 1px solid #475569 !important;
}

.kt-badge-package-gold {
  background-color: #ca8a04 !important;
  color: #fefce8 !important;
  border: 1px solid #a16207 !important;
}

.kt-badge-package-platinum {
  background-color: #4f46e5 !important;
  color: #eef2ff !important;
  border: 1px solid #4338ca !important;
}

.kt-badge-package-beta {
  background-color: #db2777 !important;
  color: #fdf2f8 !important;
  border: 1px solid #be185d !important;
}

.kt-badge-package-default {
  background-color: #374151 !important;
  color: #f3f4f6 !important;
  border: 1px solid #4b5563 !important;
}

.kt-badge-package-teal {
  background-color: #0d9488 !important;
  color: #f0fdfa !important;
  border: 1px solid #0f766e !important;
}

.kt-badge-package-cyan {
  background-color: #0891b2 !important;
  color: #ecfeff !important;
  border: 1px solid #0e7490 !important;
}

.kt-badge-package-rose {
  background-color: #e11d48 !important;
  color: #fff1f2 !important;
  border: 1px solid #be123c !important;
}

.kt-badge-package-lime {
  background-color: #65a30d !important;
  color: #f7fee7 !important;
  border: 1px solid #4d7c0f !important;
}

.dark .kt-badge-package-bronze { background-color: #92400e !important; color: #ffedd5 !important; }
.dark .kt-badge-package-silver { background-color: #475569 !important; color: #f1f5f9 !important; }
.dark .kt-badge-package-gold { background-color: #a16207 !important; color: #fef9c3 !important; }
.dark .kt-badge-package-platinum { background-color: #4338ca !important; color: #e0e7ff !important; }
.dark .kt-badge-package-beta { background-color: #be185d !important; color: #fce7f3 !important; }
.dark .kt-badge-package-default { background-color: #1f2937 !important; color: #e5e7eb !important; }
.dark .kt-badge-package-teal { background-color: #0f766e !important; color: #ccfbf1 !important; }
.dark .kt-badge-package-cyan { background-color: #0e7490 !important; color: #cffafe !important; }
.dark .kt-badge-package-rose { background-color: #be123c !important; color: #ffe4e6 !important; }
.dark .kt-badge-package-lime { background-color: #4d7c0f !important; color: #ecfccb !important; }

/* Activity text color overrides */
.kt-table .text-dark {
  color: #1f2937 !important;
}

.kt-table .text-muted {
  color: #6b7280 !important;
}

.dark .kt-table .text-dark {
  color: #f9fafb !important;
}

.dark .kt-table .text-muted {
  color: #9ca3af !important;
}

/* Activity background color overrides */
.kt-table tbody tr {
  background-color: #ffffff !important;
}

.dark .kt-table tbody tr {
  background-color: #1f2937 !important;
}

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

.dark .kt-table tbody tr:hover {
  background-color: #374151 !important;
}

/* Invoice totals display styles */
.invoice-totals-card {
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background-color: hsl(var(--card));
}

.dark .invoice-totals-card {
  background-color: hsl(var(--card));
  border-color: hsl(var(--border));
}

.invoice-totals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

.invoice-totals-title {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.invoice-totals-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  background-color: hsl(var(--input));
  color: hsl(var(--foreground));
  font-weight: 600;
}

.dark .invoice-totals-input {
  background-color: hsl(var(--input));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.invoice-totals-input[readonly] {
  background-color: hsl(var(--muted));
  cursor: not-allowed;
}

.dark .invoice-totals-input[readonly] {
  background-color: hsl(var(--muted));
}

.invoice-totals-total {
  color: hsl(var(--primary));
}

.invoice-totals-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* Mobile responsive for invoice totals */
@media (max-width: 768px) {
  .invoice-totals-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .invoice-totals-card {
    padding: 15px;
    margin-bottom: 15px;
  }
}

/* Invoice form styles */
.invoice-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.invoice-form-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.invoice-form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  background-color: hsl(var(--input));
  color: hsl(var(--foreground));
}

.dark .invoice-form-input {
  background-color: hsl(var(--input));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.invoice-form-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.invoice-form-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Override KTUI select to match invoice-form-input styling */
.kt-select.invoice-form-input {
  padding: 12px 16px !important;
  height: 48px !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 4px !important;
  background-color: #404040 !important;
  color: hsl(var(--foreground)) !important;
  box-shadow: none !important;
  transition: none !important;
  display: flex !important;
  align-items: center !important;
}

.kt-select.invoice-form-input:focus-visible {
  outline: none !important;
  border-color: hsl(var(--ring)) !important;
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2) !important;
}

.dark .kt-select.invoice-form-input {
  background-color: #404040 !important;
  border-color: hsl(var(--border)) !important;
  color: hsl(var(--foreground)) !important;
}

/* Style KTUI search input to match */
.kt-select-search {
  padding: 12px 16px !important;
  height: 44px !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 4px !important;
  background-color: #404040 !important;
  color: hsl(var(--foreground)) !important;
}

.kt-select-search:focus {
  outline: none !important;
  border-color: hsl(var(--ring)) !important;
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2) !important;
  background-color: #404040 !important;
}

/* Style KTUI arrow icon */
.kt-select-arrow {
  color: hsl(var(--foreground)) !important;
  opacity: 0.7 !important;
}

/* Ensure wrapper has proper background */
.kt-select-wrapper {
  background-color: #404040 !important;
  border-radius: 4px !important;
  padding: 0px;
  border-color: #555555 !important;
}

 .kt-select-wrapper .kt-select {
  height: 42px;
  border: none !important;
 }

/* Style KTUI dropdown options to match */
.kt-select-dropdown {
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 4px !important;
  background-color: #404040 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  z-index: 9999 !important;
}

.kt-select-option {
  color: hsl(var(--foreground)) !important;
  padding: 12px 16px !important;
  background-color: transparent !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
}

.kt-select-option:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.kt-select-option.selected {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: hsl(var(--foreground)) !important;
}

/* Style the display element (selected value) */
.kt-select-display {
  background-color: transparent !important;
  color: hsl(var(--foreground)) !important;
  flex: 1 !important;
}

/* Style placeholder text */
.kt-select-placeholder {
  color: hsl(var(--muted-foreground)) !important;
  opacity: 0.7 !important;
}

/* Ensure no transparency in any KTUI select elements */
.kt-select *,
.kt-select-dropdown *,
.kt-select-wrapper * {
  background-color: inherit !important;
}

.invoice-form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.invoice-form-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.invoice-form-checkbox input {
  margin-right: 8px;
}

/* Mobile responsive for invoice form */
@media (max-width: 768px) {
  .invoice-form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .invoice-form-section {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* Invoice items section */
.invoice-items-section {
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.dark .invoice-items-section {
  border-color: hsl(var(--border));
}

.invoice-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.invoice-items-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.invoice-items-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 15px;
  margin-bottom: 10px;
  align-items: end;
}

.invoice-item-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.invoice-item-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  font-size: 0.875rem;
  background-color: hsl(var(--input));
  color: hsl(var(--foreground));
}

.dark .invoice-item-input {
  background-color: hsl(var(--input));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.invoice-item-input[readonly] {
  background-color: hsl(var(--muted));
  cursor: not-allowed;
}

.dark .invoice-item-input[readonly] {
  background-color: hsl(var(--muted));
}

.invoice-add-item-btn {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.invoice-add-item-btn:hover {
  background: hsl(var(--primary) / 0.9);
}

.invoice-remove-item-btn {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

/* Mobile responsive for invoice items */
@media (max-width: 768px) {
  .invoice-items-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .invoice-items-section {
    padding: 15px;
    margin-bottom: 15px;
  }

  .invoice-items-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
} 