/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #374151;
  background-color: #f9fafb;
}

/* Utility Classes */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #ea580c;
  color: white;
}

.btn-primary:hover {
  background-color: #c2410c;
}

.btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

.btn-blue {
  background-color: #2563eb;
  color: white;
}

.btn-blue:hover {
  background-color: #1d4ed8;
}

.btn-green {
  background-color: #16a34a;
  color: white;
}

.btn-green:hover {
  background-color: #15803d;
}

.btn-red {
  background-color: #dc2626;
  color: white;
}

.btn-red:hover {
  background-color: #b91c1c;
}

.btn-purple {
  background-color: #9333ea;
  color: white;
}

.btn-purple:hover {
  background-color: #7c3aed;
}

/* Navigation */
.navbar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #111827;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.25rem;
}

.navbar-brand:hover {
  color: #ea580c;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #6b7280;
  text-decoration: none;
  margin-left: 1rem;
}

.back-btn:hover {
  color: #ea580c;
}

/* Main Content */
.main-content {
  min-height: calc(100vh - 4rem);
  padding: 2rem 0;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.875rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 0.5rem;
}

.page-description {
  color: #6b7280;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
}

.dashboard-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #fed7aa;
  transform: translateY(-2px);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.card-description {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Tables */
.table-container {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.table-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.table-actions {
  display: flex;
  gap: 0.75rem;
}

.table-wrapper {
  overflow-x: auto;
}

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

th {
  background-color: #f9fafb;
  padding: 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 1rem 0.75rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.875rem;
}

tr:hover {
  background-color: #f9fafb;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.status-live {
  background-color: #dcfce7;
  color: #166534;
}

.status-block {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-active {
  background-color: #dcfce7;
  color: #166534;
}

.status-planning {
  background-color: #fef3c7;
  color: #92400e;
}

.status-completed {
  background-color: #f3f4f6;
  color: #374151;
}

/* Forms */
.form-container {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.form-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-row .form-label {
  width: 8rem;
  margin-bottom: 0;
}

.form-row .form-input {
  flex: 1;
}

.form-unit {
  font-size: 0.875rem;
  color: #6b7280;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-actions .btn {
  flex: 1;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Stats Cards */
.stats-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.stats-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.stats-value {
  font-size: 1.875rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.stats-description {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Daily Sales Visualization */
.daily-sales {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
}

.daily-sales-item {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  font-size: 0.75rem;
  text-align: center;
  line-height: 1rem;
  border-radius: 0.125rem;
  color: white;
  font-weight: 500;
}

.daily-sales-positive {
  background-color: #16a34a;
}

.daily-sales-zero {
  background-color: #dc2626;
}

/* Tooltip */
.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #111827;
  color: white;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #111827;
}

.tooltip-container:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* Action Buttons */
.action-btn {
  padding: 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.action-btn:hover {
  background-color: #f3f4f6;
}

.action-btn-blue {
  color: #2563eb;
}

.action-btn-blue:hover {
  color: #1d4ed8;
}

.action-btn-green {
  color: #16a34a;
}

.action-btn-green:hover {
  color: #15803d;
}

.action-btn-gray {
  color: #6b7280;
}

.action-btn-gray:hover {
  color: #4b5563;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .navbar-content {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .table-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-row .form-label {
    width: auto;
    margin-bottom: 0.5rem;
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Icons (using Unicode symbols as fallback) */
.icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
}

.icon-home::before { content: '🏠'; }
.icon-chart::before { content: '📊'; }
.icon-file::before { content: '📄'; }
.icon-trend::before { content: '📈'; }
.icon-package::before { content: '📦'; }
.icon-target::before { content: '🎯'; }
.icon-download::before { content: '⬇️'; }
.icon-filter::before { content: '🔍'; }
.icon-eye::before { content: '👁️'; }
.icon-edit::before { content: '✏️'; }
.icon-info::before { content: 'ℹ️'; }
.icon-settings::before { content: '⚙️'; }
.icon-back::before { content: '←'; }