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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background-color: #e9d7b5;
  padding: 20px;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
}

.nav-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  background: white;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn.active {
  background: #fff5ed;
  font-weight: 600;
}

.nav-btn.active:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* Modal Styles */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.modal-backdrop.active {
  display: block;
}

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.modal.active {
  display: block;
}

/* Dashboard Styles */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff5ed;
  padding: 20px;
  border-radius: 17px;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coffee-icon {
  width: 32px;
  height: 32px;
}

.coffee-cup-emoji {
  font-size: 2rem;
  line-height: 1;
}

.logo-section h1 {
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

.top-controls {
  display: flex;
  gap: 10px;
}

.filter-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: #f9f9f9;
}

.date-select {
  padding: 8px 12px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

/* KPI Cards */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.kpi-card {
  background: #fff5ed;
  padding: 24px;
  border-radius: 17px;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  cursor: pointer;
}

.kpi-card:hover {
  transform: scale(1.05) translateY(-8px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.35);
}

.kpi-label {
  font-size: 1rem;
  color: #666;
  margin-bottom: 12px;
  font-weight: 500;
}

.kpi-value {
  font-size: 3rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.kpi-change {
  font-size: 0.95rem;
  color: #74b76e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-change-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-arrow {
  color: #74b76e;
  font-size: 1.2rem;
}

.trend-icon {
  flex-shrink: 0;
}

/* Top Products Card */
.top-products {
  padding: 20px;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0e6d8;
}

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

.product-number {
  width: 37px;
  height: 37px;
  background: #e9d7b5;
  color: #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.product-detail {
  font-size: 0.8rem;
  color: #999;
  margin: 2px 0 0 0;
}

/* Content Row */
.content-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.card {
  background: #fff5ed;
  padding: 20px;
  border-radius: 17px;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
  transition: all 0.3s ease;
  cursor: pointer;
}

.card:hover {
  transform: scale(1.05) translateY(-8px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.35);
}

.card-label {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.expenses-label {
  font-weight: 500;
}

.card-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.card-change {
  font-size: 0.9rem;
  color: #36aa42;
  margin: 0;
}

.card-change-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Expenses Card */
.expenses-card {
  grid-column: 1;
  grid-row: 1;
}

/* Alerts Card */
.alerts-card {
  grid-column: 2 / 6;
  grid-row: 1;
}

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

.add-product-link {
  font-size: 0.85rem;
  color: #ffa908;
  cursor: pointer;
  font-weight: 600;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.alert-item:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.alert-critical {
  background: #ffe3e3;
}

.alert-warning {
  background: #faeed3;
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 6px 0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #f0e6d8;
  border-radius: 3px;
  overflow: hidden;
  margin: 0;
}

.progress-fill {
  height: 100%;
  background: #ffa908;
  border-radius: 3px;
}

.alert-quantity {
  font-size: 0.85rem;
  color: #666;
  min-width: 60px;
  text-align: right;
}

.alert-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 65px;
  text-align: center;
}

.alert-critical-status {
  background: #ff6b6b;
  color: white;
}

.alert-warning-status {
  background: #ffa908;
  color: white;
}

/* Charts */
.chart-card {
  grid-column: 1 / 4;
  grid-row: 2;
  display: flex;
  flex-direction: column;
}

.payment-card {
  grid-column: 4 / 6;
  grid-row: 2;
  display: flex;
  flex-direction: column;
}

canvas {
  width: 100%;
  height: auto;
  margin-top: 12px;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.payment-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #666;
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.revenue-color {
  background: #1e88e5;
}

.profit-color {
  background: #ffa908;
}

.expense-color {
  background: #ccc;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Inventory Styles */
.inventory-container {
  position: relative;
  background: #fff5ed;
  border-radius: 17px;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
  overflow: hidden;
  width: 95%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.inventory-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #e9d7b5;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #333;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.inventory-close:hover {
  background: #dcc7a0;
  transform: scale(1.1);
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 60px 20px 60px;
  text-align: center;
}

.inventory-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  flex: 1;
  margin: 0;
  text-align: left;
}

.create-order-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.create-order-btn:hover {
  background: #f9f9f9;
}

.inventory-list {
  padding: 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.inventory-item {
  display: grid;
  grid-template-columns: 32px 1fr auto auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.inventory-item:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.item-critical {
  background: #ffe3e3;
}

.item-warning {
  background: #faeed3;
}

.item-monitoring {
  background: #eaf4ea;
}

.item-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.icon-critical,
.icon-warning,
.icon-monitoring {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.item-info {
  flex: 1;
  grid-column: 2;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 6px 0;
}

.item-current {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 6px 0;
}

.item-days-critical,
.item-days-warning,
.item-days-monitoring {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 80px;
  text-align: right;
}

.item-days-critical {
  color: #ff6b6b;
}

.item-days-warning {
  color: #ffa908;
}

.item-days-monitoring {
  color: #36aa42;
}

.item-status-critical,
.item-status-warning,
.item-status-monitoring {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 65px;
  text-align: center;
}

.item-status-critical {
  background: #ff6b6b;
  color: white;
}

.item-status-warning {
  background: #ffa908;
  color: white;
}

.item-status-monitoring {
  background: #36aa42;
  color: white;
}

.action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-critical {
  background: #ffb7b7;
  color: #ff6b6b;
}

.btn-critical:hover {
  background: #ff9999;
  color: #ff5252;
}

.btn-warning {
  background: #fad3a1;
  color: #ffa908;
}

.btn-warning:hover {
  background: #f5c084;
  color: #ff9800;
}

.btn-monitoring {
  background: #abdaa3;
  color: #74b76e;
}

.btn-monitoring:hover {
  background: #95d093;
  color: #2e9c3a;
}

.add-products-section {
  padding: 0 60px 20px 60px;
  display: flex;
  flex-direction: column;
}

.add-products-btn {
  width: 100%;
  padding: 14px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.add-products-btn:hover {
  background: #f9f9f9;
  border-color: #bbb;
}

.plus-icon {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .alerts-card {
    grid-column: 1 / -1;
  }
  
  .chart-card {
    grid-column: 1 / -1;
  }
  
  .payment-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .kpi-row {
    grid-template-columns: 1fr;
  }
  
  .content-row {
    grid-template-columns: 1fr;
  }
  
  .header-section {
    flex-direction: column;
    gap: 12px;
  }
  
  .top-controls {
    width: 100%;
    flex-direction: column;
  }
  
  .inventory-container {
    max-width: 100%;
  }
}
