:root {
  --primary-color: #2563eb;
  --danger-color: #dc2626;
  --success-color: #16a34a;
  --background-color: #f1f5f9;
  --card-background: #ffffff;
  --text-color: #1e293b;
  --border-radius: 8px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --gold: #c6a87d;
  --cream: #f8f5f0;
  --dark: #1a1a1a;
  --white: #ffffff;
  --text-light: #6b7280;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  -webkit-tap-highlight-color: transparent;
  max-width: 100vw;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
  position: relative;
}

.top-nav {
  background: var(--card-background);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.nav-left h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification {
  position: relative;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger-color);
  color: white;
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}

/* .main-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
} */

.sale-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.info-card {
  background: var(--card-background);
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.modern-input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius);
  outline: none;
  transition: border-color 0.3s;
}

.modern-input:focus {
  border-color: var(--primary-color);
}

.search-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}

.search-box input {
  padding-left: 2.5rem;
}

.totals-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.total-card {
  background: var(--card-background);
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.total-card.highlight {
  background: var(--primary-color);
  color: white;
}

.payment-methods {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.payment-option {
  background: var(--card-background);
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.products-table th,
.products-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.quantity-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.remove-btn {
  padding: 0.5rem;
  border: none;
  background: var(--danger-color);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.cancel-btn {
  padding: 1rem 2rem;
  border: none;
  background: var(--danger-color);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pay-btn {
  padding: 1rem 2rem;
  border: none;
  background: var(--success-color);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .nav-right {
    flex-wrap: wrap;
    justify-content: center;
  }

  .totals-container {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }

  .checkout-container,
  .shipping-address-section,
  .address-card,
  .order-form {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
  }

  .address-actions,
  .action-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Fix for nested content */
  .form-layout {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* Fix for buttons */
  .btn,
  .select-btn,
  .add-address-btn {
    width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Add/Update these styles in your CSS */
/* .nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
  user-select: none;
} */

/* .nav-group-title:hover {
  background: #2d3748;
  color: white;
} */

/* .nav-group-title i:first-child {
  width: 20px;
  text-align: center;
  margin-right: 0.75rem;
} */

/* .arrow {
  font-size: 0.875rem;
  transition: transform 0.3s ease;
} */

/* .sub-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding-left: 2.5rem;
  margin-top: 0.25rem;
  opacity: 1;
  visibility: visible;
} */

.nav-group.active .sub-nav {
  max-height: 500px; /* This will be set dynamically by JavaScript */
}

/* .nav-group-title .arrow {
  transform: rotate(0deg);
} */
/* 
.nav-group.active .nav-group-title .arrow {
  transform: rotate(90deg);
} */

/* Active states */
/* .nav-group.active > .nav-group-title {
  background: #2d3748;
  color: white;
} */

/* .sub-nav a.active {
  background: #2d3748;
  color: white;
} */

/* Smooth transition for sub-nav */
/* .sub-nav {
  padding-left: 2.5rem;
  margin-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
} */

/* .nav-group.active .sub-nav {
  opacity: 1;
  visibility: visible;
} */

/* Update navigation styles */
/* .nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
} */

/* .nav-item {
  margin: 4px 0;
} */

/* .nav-link {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.3s;
  border-radius: 6px;
} */
/* 
.nav-link:hover {
  background: #2d3748;
  color: white;
} */

/* .nav-link i:first-child {
  width: 20px;
  margin-right: 10px;
  font-size: 16px;
} */

.nav-link span {
  flex: 1;
}

/* .has-arrow {
  justify-content: space-between;
} */

.arrow {
  font-size: 12px;
  transition: transform 0.3s;
}

.sub-menu {
  display: none;
  list-style: none;
  padding-left: 45px;
  margin: 5px 0;
}

.sub-menu li {
  margin: 2px 0;
  display: block;
}

.sub-menu a {
  display: block;
  padding: 8px 15px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.3s;
}

.sub-menu a:hover {
  background: #2d3748;
  color: white;
}

/* Active states */
.nav-item.active > .nav-link {
  background: #2d3748;
  color: white;
}

.nav-item.active > .nav-link .arrow {
  transform: rotate(90deg);
}

.nav-item.active > .sub-menu {
  display: block;
}

.sub-menu a.active {
  background: #2d3748;
  color: white;
}

/* Modern stat card styles */

.stat-card {
  .stat-card {
    position: relative;
    padding: 1.25rem;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
  }
  .stat-card glass {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 4fr));
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
      inset 0 0 32px rgba(255, 255, 255, 0.1);
  }

  /* Glassmorphism effect */
  .glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
      inset 0 0 32px rgba(255, 255, 255, 0.1);
  }

  .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15),
      inset 0 0 32px rgba(255, 255, 255, 0.2);
  }

  .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
  }

  .stat-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Gradient backgrounds */
  .blue-gradient {
    background: linear-gradient(135deg, #6366f1, #2563eb);
  }

  .green-gradient {
    background: linear-gradient(135deg, #10b981, #059669);
  }

  .purple-gradient {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  }

  .orange-gradient {
    background: linear-gradient(135deg, #f59e0b, #d97706);
  }

  .red-gradient {
    background: linear-gradient(135deg, #ef4444, #dc2626);
  }

  .stat-icon-wrapper i {
    color: white;
    font-size: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  }

  .stat-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .stat-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(to right, #1e293b, #334155);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .stat-label {
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.25rem;
  }

  .stat-trend {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .stat-trend i {
    font-size: 0.7rem;
  }

  .stat-trend.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
  }

  .stat-trend.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
  }

  .stat-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .stat-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .stat-comparison small {
    color: #64748b;
    font-size: 0.65rem;
  }

  .stat-comparison span {
    font-weight: 600;
    font-size: 0.7rem;
  }

  .progress-bar {
    height: 4px;
    background: rgba(203, 213, 225, 0.3);
    border-radius: 999px;
    overflow: hidden;
  }

  .progress {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
  }

  .progress.blue {
    background: linear-gradient(to right, #6366f1, #2563eb);
  }
  .progress.green {
    background: linear-gradient(to right, #10b981, #059669);
  }
  .progress.purple {
    background: linear-gradient(to right, #8b5cf6, #6d28d9);
  }
  .progress.orange {
    background: linear-gradient(to right, #f59e0b, #d97706);
  }
  .progress.red {
    background: linear-gradient(to right, #ef4444, #dc2626);
  }

  .stat-chart {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 60px;
    opacity: 0.2;
    transition: opacity 0.3s ease;
  }

  .stat-card:hover .stat-chart {
    opacity: 0.6;
  }

  /* Add subtle animation */
  @keyframes pulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.02);
    }
    100% {
      transform: scale(1);
    }
  }

  .stat-card:hover .stat-icon-wrapper {
    animation: pulse 1.5s infinite;
  }

  @media (max-width: 768px) {
    .sales-stats {
      grid-template-columns: 1fr;
    }

    .stat-value {
      font-size: 1.75rem;
    }
  }

  /* Main Dashboard Grid */
  .dashboard-grid {
    display: grid;
    gap: 2rem;
    padding: 1.5rem;
    max-width: 1920px;
    margin: 0 auto;
  }

  /* Sales Stats Grid */

  .stat-card {
    grid-column: span 3; /* Default 3 columns wide */
    min-height: 180px;
    position: relative;
    padding: 1.5rem;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .stat-card.wide {
    grid-column: span 6; /* Wide cards span 6 columns */
  }

  /* Charts Grid */
  .charts-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
  }

  .chart-card {
    grid-column: span 6; /* Default 6 columns wide */
    min-height: 400px;
    padding: 1.5rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .chart-card.wide {
    grid-column: span 12; /* Wide charts span full width */
  }

  /* Responsive Design */
  @media (max-width: 1600px) {
    .stat-card {
      grid-column: span 4; /* 4 columns on large screens */
    }

    .stat-card.wide {
      grid-column: span 8;
    }
  }

  @media (max-width: 1200px) {
    .stat-card {
      grid-column: span 6; /* 6 columns on medium screens */
    }

    .stat-card.wide {
      grid-column: span 12;
    }

    .chart-card {
      grid-column: span 12; /* Full width on medium screens */
    }
  }

  @media (max-width: 768px) {
    .stat-card {
      grid-column: span 12; /* Full width on mobile */
    }

    .sales-stats,
    .charts-grid {
      gap: 1rem;
    }
  }

  /* Glass Effect */
  .glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
      inset 0 0 32px rgba(255, 255, 255, 0.1);
  }

  /* Hover Effects */
  .stat-card:hover,
  .chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15),
      inset 0 0 32px rgba(255, 255, 255, 0.2);
  }

  /* Chart Container */
  .chart-container {
    width: 100%;
    height: calc(100% - 40px); /* Subtract header height */
    position: relative;
  }

  /* Keep your existing styles for stat-content, stat-header, etc. */
  /* ... rest of your existing styles ... */

  /* Additional Grid Enhancements */
  .dashboard-grid {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }

  /* Grid Background */
  .dashboard-grid::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f6f8fc 0%, #f1f5f9 100%);
    z-index: -1;
  }

  /* Grid Lines Effect */
  .dashboard-grid::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    opacity: 0.5;
  }
}

.sales-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

/* Add these styles */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.info-card {
  padding: 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.info-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(203, 213, 225, 0.3);
}

.info-header h3 {
  color: #1e293b;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-header h3 i {
  color: #6366f1;
  font-size: 0.875rem;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
  padding: 0.75rem;
  font-size: 0.813rem;
  color: #475569;
  border-bottom: 1px solid rgba(203, 213, 225, 0.2);
}

.schedule-table th {
  font-weight: 600;
  color: #1e293b;
  text-align: left;
  background: rgba(241, 245, 249, 0.3);
}

.schedule-table tr:hover td {
  background: rgba(241, 245, 249, 0.2);
}

.no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #94a3b8;
  gap: 0.5rem;
}

.no-data i {
  font-size: 1.5rem;
  opacity: 0.5;
}

.no-data p {
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .schedule-table th,
  .schedule-table td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}

/* Zebra striping for table */
.schedule-table tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.1);
}

/* Hover effect for table rows */
.schedule-table tbody tr {
  transition: all 0.2s ease;
}

.schedule-table tbody tr:hover {
  background: rgba(241, 245, 249, 0.2);
}

/* Custom scrollbar for table container */
.schedule-content {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(203, 213, 225, 0.5) transparent;
}

.schedule-content::-webkit-scrollbar {
  width: 6px;
}

.schedule-content::-webkit-scrollbar-track {
  background: transparent;
}

.schedule-content::-webkit-scrollbar-thumb {
  background-color: rgba(203, 213, 225, 0.5);
  border-radius: 3px;
}

/* Add these styles for charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.chart-card {
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.chart-card.wide {
  grid-column: span 2;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(203, 213, 225, 0.3);
}

.chart-header h3 {
  color: #1e293b;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-header h3 i {
  color: #6366f1;
  font-size: 0.875rem;
}

.chart-actions {
  display: flex;
  gap: 0.5rem;
}

.time-filter {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(203, 213, 225, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #475569;
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-filter:hover {
  border-color: #6366f1;
}

.chart-container {
  height: 300px;
  position: relative;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card.wide {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .chart-container {
    height: 250px;
  }
}

/* Add these styles for purchase info cards */
.purchase-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
}

.purchase-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.purchase-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.purchase-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.purchase-icon i {
  color: white;
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.purchase-details {
  flex: 1;
}

.purchase-label {
  display: block;
  color: #64748b;
  font-size: 0.813rem;
  margin-bottom: 0.25rem;
}

.purchase-value {
  color: #1e293b;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.purchase-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-badge.positive {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.stat-badge.negative {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.stat-badge i {
  font-size: 0.75rem;
}

.period {
  color: #94a3b8;
  font-size: 0.75rem;
}

/* Gradient backgrounds */
.blue-gradient {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.green-gradient {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.orange-gradient {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.red-gradient {
  background: linear-gradient(135deg, #f87171, #ef4444);
}

/* Responsive adjustments */
@media (max-width: 1280px) {
  .purchase-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .purchase-info-grid {
    grid-template-columns: 1fr;
  }

  .purchase-card {
    padding: 1rem;
  }

  .purchase-icon {
    width: 40px;
    height: 40px;
  }

  .purchase-value {
    font-size: 1.25rem;
  }
}

/* Add hover animation for icons */
.purchase-card:hover .purchase-icon {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Add orange progress color */
.progress.orange {
  background: linear-gradient(to right, #fbbf24, #f59e0b);
}

/* Add negative comparison style */
.stat-comparison .negative {
  color: #dc2626;
}

/* Mobile-first responsive styles */
@media screen and (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    position: fixed;
    left: -250px;
    transition: 0.3s;
    z-index: 1000;
  }

  .sidebar.collapsed {
    left: 0;
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .main-content.expanded {
    margin-left: 0;
  }

  /* Top Navigation */
  .top-nav {
    padding: 10px;
  }

  .nav-right .search-box {
    display: none;
  }

  /* Dashboard Grid */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 10px;
  }

  .sales-stats {
    grid-template-columns: 1fr;
  }

  .stat-card.wide {
    grid-column: auto;
  }

  /* Charts Grid */
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card.wide {
    grid-column: auto;
  }

  /* Schedule and Sales Summary */
  .schedule-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
  }

  .dashboard-card {
    width: 100%;
    margin-bottom: 16px;
  }

  .card-header {
    flex-direction: column;
    gap: 12px;
  }

  .card-header h3 {
    margin: 0;
    font-size: 18px;
  }

  .btn-add {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  .schedule-table {
    position: relative;
    margin: 0 -10px; /* Negative margin to allow full-width scroll */
    padding: 0 10px;
    width: calc(100% + 20px);
  }

  .schedule-table table {
    min-width: 600px; /* Ensure table can scroll on small screens */
  }

  .schedule-table th {
    position: sticky;
    top: 0;
    background: var(--header-bg, #fff);
    z-index: 1;
    font-size: 14px;
  }

  .schedule-table td {
    font-size: 13px;
    padding: 10px 8px;
  }

  /* Optimize action buttons for touch */
  .action-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 2px;
    border-radius: 8px;
  }

  .action-btn i {
    font-size: 16px;
  }

  /* Status badge optimization */
  .status-badge {
    padding: 4px 8px;
    font-size: 12px;
  }

  /* Sales Summary Card */
  .sales-summary {
    padding: 16px;
  }

  .sales-summary .card-header {
    padding: 0 0 16px 0;
  }

  .no-data {
    padding: 24px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted, #666);
  }
}

/* Tablet styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .sales-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .purchase-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .schedule-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 16px;
  }

  .card-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 14px 12px;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .nav-link:hover,
  .action-btn:hover {
    opacity: 1;
  }

  /* Increase touch targets */
  .nav-link,
  .action-btn,
  .btn-add,
  select.time-filter {
    min-height: 44px;
    padding: 12px;
  }

  /* Add active state for touch */
  .nav-link:active,
  .action-btn:active {
    opacity: 0.7;
  }

  .schedule-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
  }

  .schedule-table tbody tr:active {
    background-color: rgba(0, 0, 0, 0.05);
  }

  .action-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-add,
  .action-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Improve scroll experience */
  .schedule-table::-webkit-scrollbar {
    height: 4px;
  }

  .schedule-table::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .schedule-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
  }
}

/* High DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo,
  .user-avatar {
    image-rendering: -webkit-optimize-contrast;
  }

  .schedule-table {
    border-radius: 12px;
  }

  .status-badge {
    border-radius: 4px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .schedule-table th {
    background: var(--dark-header-bg, #1a1a1a);
  }

  .schedule-table::-webkit-scrollbar-track {
    background: #2d2d2d;
  }

  .schedule-table::-webkit-scrollbar-thumb {
    background: #666;
  }
}

/* Mobile-first Container */
.container {
  width: 100%;
  padding: 8px;
  margin: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* Form Elements - Mobile Optimized */
input,
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 16px; /* Prevents zoom on iOS */
  margin-bottom: 0.5rem;
  max-width: 100%;
  box-sizing: border-box;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px; /* Touch-friendly */
  gap: 0.5rem;
  width: 100%; /* Full width on mobile */
}

/* Card Styles */
.card {
  background: var(--white);
  border-radius: 8px;
  padding: 1rem;
  margin: 0 0 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
}

/* Table Styles - Mobile Friendly */
.table-container {
  width: 100%;
  max-width: 100vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Ensures horizontal scroll on small screens */
  table-layout: fixed;
}

th,
td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap; /* Prevents text wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Form Group */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Grid System - Mobile First */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Responsive Breakpoints */
@media (min-width: 640px) {
  .container {
    padding: 1rem;
  }

  .btn {
    width: auto; /* Reset button width */
  }

  .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .container {
    padding: 1.5rem;
  }

  table {
    min-width: auto; /* Reset table min-width */
  }

  th,
  td {
    white-space: normal; /* Allow text wrapping */
  }

  .grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    padding: 2rem;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-left {
  text-align: left;
}

.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-4 {
  margin-bottom: 1rem;
}

/* Status Badges */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Error States */
.error {
  border-color: var(--danger);
}

.error-message {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Success States */
.success {
  border-color: var(--success);
}

/* Touch Device Optimizations */
@media (hover: none) {
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
  }

  select {
    padding-right: 2rem; /* Space for dropdown arrow */
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1a1a1a;
    --white: #2d2d2d;
    --dark: #ffffff;
    --text-light: #a0aec0;
  }

  .card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none;
  }

  body {
    background: white;
  }

  .card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
}

/* Fix for any horizontal padding/margins */
@media (max-width: 480px) {
  .container,
  .card,
  .form-group,
  .address-card {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Mobile-first container */
.checkout-container {
  width: 100%;
  max-width: 100%;
  padding: 8px;
  margin: 0;
  overflow: hidden;
}

/* Form layout fixes */
.form-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
  margin: 0;
}

/* Card and section fixes */
.shipping-address-section,
.address-card,
.order-form {
  width: 100%;
  max-width: 100%;
  margin: 0 0 1rem 0;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

/* Input group fixes */
.input-group,
.select-group {
  width: 100%;
  max-width: 100%;
}

/* Form control fixes */
input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Size and color section fixes */
.size-section,
.color-section {
  width: 100%;
  padding: 0.5rem;
  margin: 0 0 1rem 0;
}

.size-row,
.color-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.5rem 0;
}

/* Button fixes */
.btn,
.select-btn,
.edit-btn,
.delete-btn,
.add-address-btn {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.75rem;
}

/* Strict mobile styles */
@media screen and (max-width: 912px) {
  /* Galaxy Note 22 Ultra specific fixes */
  .container,
  .checkout-container {
    padding: 8px;
    width: 100%;
    min-width: 0;
  }

  .form-layout > * {
    width: 100%;
    min-width: 0;
  }

  .address-actions {
    flex-direction: column;
    width: 100%;
  }

  .action-buttons {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
  }

  .edit-btn,
  .delete-btn {
    flex: 1;
  }

  /* Fix nested scrolling */
  .size-section,
  .color-section {
    overflow: visible;
    width: 100%;
  }

  /* Prevent text overflow */
  .address-info,
  .name,
  .address {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Fix button groups */
  .btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
}

/* Ultra-wide mobile devices */
@media screen and (min-width: 400px) and (max-width: 912px) {
  .size-row,
  .color-row {
    grid-template-columns: 2fr 1fr auto;
    align-items: center;
  }
}

/* Fix for any horizontal scroll */
@media screen and (max-width: 912px) {
  .order-form,
  .shipping-address-section {
    margin: 0 auto 1rem;
    width: calc(100% - 16px);
  }

  input,
  select,
  textarea {
    font-size: 16px; /* Prevent iOS zoom */
  }
}

/* Prevent overflow on all screen sizes */
@supports (-webkit-touch-callout: none) {
  /* iOS specific fix */
  .container,
  .checkout-container {
    width: 100%;
    padding: 8px;
    overflow: hidden;
  }
}
