* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  min-height: 100vh;
}

nav {
  background: #4CAF50;
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background 0.3s;
}

nav a:hover,
nav a.active {
  background: rgba(255,255,255,0.2);
}

nav a:first-child {
  margin-left: 0;
}

.logo {
  font-size: 1.2em;
  font-weight: bold;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: #4CAF50;
  color: white;
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}

.card img {
  max-width: 100%;
  border-radius: 5px;
  height: 200px;
  object-fit: cover;
}

.btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 15px;
  background: #4CAF50;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 1em;
}

.btn-danger {
  background: #f44336;
}

.btn-warning {
  background: #ff9800;
}

.btn-secondary {
  background: #2196F3;
}

.btn-sm {
  padding: 5px 10px;
  margin: 2px;
  font-size: 0.9em;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

footer {
  text-align: center;
  padding: 10px;
  background: #333;
  color: white;
  margin-top: 20px;
}

form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.image-preview {
  margin-top: 10px;
  max-width: 150px;
  max-height: 150px;
  border-radius: 5px;
  border: 1px solid #ddd;
  display: none;
}

.table-container {
  overflow-x: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-top: 20px;
}

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

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: #4CAF50;
  color: white;
  font-weight: bold;
}

tr:hover {
  background: #f9f9f9;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-card h3 {
  color: #666;
  font-size: 0.9em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 2em;
  font-weight: bold;
  color: #4CAF50;
}

.chart-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.chart-container h2 {
  margin-bottom: 15px;
  color: #333;
}

.simple-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  padding: 10px 0;
  border-bottom: 2px solid #ddd;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 80px;
}

.bar {
  width: 100%;
  background: #4CAF50;
  border-radius: 5px 5px 0 0;
  transition: height 0.3s;
  min-height: 4px;
}

.bar-label {
  margin-top: 5px;
  font-size: 0.8em;
  text-align: center;
  color: #666;
  word-break: break-word;
}

.section-title {
  margin: 30px 0 15px 0;
  color: #333;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 5px;
}

.hidden {
  display: none !important;
}

.cart-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.cart-items {
  list-style: none;
  margin-bottom: 15px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: bold;
}

.cart-item-price {
  color: #666;
  font-size: 0.9em;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
}

.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: bold;
}

.cart-remove {
  background: none;
  border: none;
  color: #f44336;
  cursor: pointer;
  font-size: 1.2em;
  margin-left: 10px;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cart-total {
  font-size: 1.3em;
  font-weight: bold;
  color: #4CAF50;
}

.cart-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.home-link {
  display: inline-block;
  margin-bottom: 15px;
  color: #4CAF50;
  text-decoration: none;
  font-weight: bold;
}

.home-link:hover {
  text-decoration: underline;
}

.search-bar {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
}

.image-preview-input {
  margin-top: 8px;
  max-width: 180px;
  max-height: 180px;
  border-radius: 5px;
  border: 1px solid #ddd;
  display: none;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-dibayar {
  background: #cce5ff;
  color: #004085;
}

.status-dikirim {
  background: #d4edda;
  color: #155724;
}

.status-selesai {
  background: #d1ecf1;
  color: #0c5460;
}

.status-batal {
  background: #f8d7da;
  color: #721c24;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 320px;
}

.toast-success {
  background: #4CAF50;
}

.toast-error {
  background: #f44336;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.empty-state h3 {
  margin-bottom: 10px;
  color: #333;
}

.reset-section {
  text-align: right;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#category-filter {
  max-width: 300px;
  margin-bottom: 20px;
}

.cart-customer-form {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

.cart-customer-form .form-group {
  margin-bottom: 10px;
}

.cart-customer-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 0.9em;
}

.cart-customer-form input,
.cart-customer-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
}

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

  nav {
    flex-direction: column;
    gap: 10px;
  }

  nav a {
    margin-left: 0;
  }

  .cart-summary {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .cart-actions {
    justify-content: center;
  }

  table {
    font-size: 0.9em;
  }

  th, td {
    padding: 8px;
  }

  .toast-container {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .toast {
    max-width: 100%;
  }
}
