:root {
  --main-bg-color: #f8f9fa;
  --primary-text-color: #007d50;
  --secondary-text-color: #6c757d;
  --sidebar-bg-color: #ffffff;
  --primary-bg-color: #007d50;
  --chart-primary: rgba(0, 125, 80, 0.8);
  --chart-secondary: rgba(0, 125, 80, 0.3);
  --chart-accent1: rgba(54, 162, 235, 0.8);
  --chart-accent2: rgba(255, 206, 86, 0.8);
  --shadow-light: 0 2px 10px rgba(0,0,0,0.08);
}

#wrapper {
  overflow-x: hidden;
  background-color: var(--main-bg-color);
}

#sidebar-wrapper {
  min-height: 100vh;
  margin-left: -15rem;
  transition: margin 0.25s ease-out;
}

#sidebar-wrapper .sidebar-heading {
  padding: 0.875rem 1.25rem;
  font-size: 1.2rem;
  color: var(--primary-text-color);
}

#sidebar-wrapper .list-group {
  width: 15rem;
}

#page-content-wrapper {
  min-width: 100vw;
}

#wrapper.toggled #sidebar-wrapper {
  margin-left: 0;
}

#menu-toggle {
  cursor: pointer;
}

.list-group-item {
  border: none;
  padding: 20px 30px;
  color: var(--secondary-text-color);
}

.list-group-item.active {
  background-color: transparent;
  color: var(--primary-text-color);
  font-weight: bold;
  border-right: 5px solid var(--primary-text-color);
}

.primary-text {
  color: var(--primary-text-color);
}

.second-text {
  color: var(--secondary-text-color);
}

.primary-bg {
    background-color: var(--primary-bg-color) !important;
    border-color: var(--primary-bg-color) !important;
}

.rounded-full {
  border-radius: 50%;
}

/* Enhanced Dashboard Cards */
.dashboard-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  box-shadow: var(--shadow-light);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.dashboard-stat {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-text-color);
}

.dashboard-label {
  font-size: 0.95rem;
  color: var(--secondary-text-color);
  font-weight: 500;
}

.chart-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
  border: 1px solid #f0f0f0;
}

.chart-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-text-color);
  margin: 0;
}

/* Table Improvements */
.table-modern {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.table-modern thead th {
  background: var(--primary-bg-color);
  color: white;
  border: none;
  font-weight: 600;
  padding: 1rem;
}

.table-modern tbody td {
  padding: 0.875rem 1rem;
  border-color: #f8f9fa;
}

.table-modern tbody tr:hover {
  background-color: rgba(0, 125, 80, 0.02);
}

/* Status badges */
.status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-delivered {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.status-transit {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.status-pending {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  #sidebar-wrapper {
    margin-left: -15rem;
    position: fixed;
    z-index: 999;
    height: 100vh;
    transition: margin 0.25s ease-out;
  }
  
  #wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
  }
  
  #page-content-wrapper {
    width: 100%;
    position: relative;
  }
  
  .dashboard-stat {
    font-size: 1.8rem;
  }
  
  .chart-container {
    margin-bottom: 1rem;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .row.g-4 > .col-md-3 {
    margin-bottom: 1rem;
  }
  
  .navbar {
    padding: 1rem;
  }
  
  .container-fluid {
    padding: 0 1rem;
  }
}

@media (max-width: 576px) {
  .dashboard-card {
    padding: 1rem !important;
  }
  
  .dashboard-stat {
    font-size: 1.5rem;
  }
  
  .dashboard-label {
    font-size: 0.8rem;
  }
  
  .chart-title {
    font-size: 1rem;
  }
  
  .fs-2 {
    font-size: 1.5rem !important;
  }
  
  .table-modern thead th,
  .table-modern tbody td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .status-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
  
  .btn {
    font-size: 0.875rem;
  }
  
  .modal-dialog {
    margin: 0.5rem;
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  #sidebar-wrapper {
    width: 12rem;
  }
  
  #sidebar-wrapper .list-group {
    width: 12rem;
  }
  
  .sidebar-heading {
    font-size: 0.9rem !important;
  }
  
  .list-group-item {
    padding: 15px 20px;
    font-size: 0.875rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --main-bg-color: #1a1a1a;
    --sidebar-bg-color: #2d2d2d;
    --shadow-light: 0 2px 10px rgba(255,255,255,0.05);
  }
  
  .bg-white {
    background-color: #2d2d2d !important;
    color: #ffffff;
  }
  
  .chart-container {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .table-modern {
    color: #ffffff;
  }
  
  .table-modern tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

@media (min-width: 769px) {
  #sidebar-wrapper {
    margin-left: 0;
    position: relative;
    z-index: auto;
  }

  #page-content-wrapper {
    min-width: 0;
    width: 100%;
  }

  #wrapper.toggled #sidebar-wrapper {
    margin-left: -15rem;
  }
}

/* Print styles for Invoice */
@media print {
  body * {
    visibility: hidden;
  }
  #invoice-preview-content, #invoice-preview-content * {
    visibility: visible;
  }
  #invoice-preview-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .modal-footer {
      display: none;
  }
}
