/* KitchenOS Demand Forecasting Dashboard - Dark Theme */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #0D0F12;
  --bg-secondary: #161A1F;
  --bg-tertiary: #1E2328;
  --text-primary: #F2F4F7;
  --text-secondary: #9BA3AF;
  --text-muted: #5C6370;
  --brand-burgerlab: #FF6B35;
  --brand-wokfire: #22D3EE;
  --brand-saladcraft: #4ADE80;
  --accent-primary: #818CF8;
  --status-live: #EF4444;
  --border-color: #2A2F36;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Layout */
.dashboard {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

/* Left Rail - Order Feed */
.order-feed {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.feed-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--status-live);
  font-weight: 500;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--status-live);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.order-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card {
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  padding: 14px;
  border-left: 4px solid var(--brand-burgerlab);
  animation: slideIn 0.3s ease-out;
  position: relative;
}

.order-card.burgerlab { border-left-color: var(--brand-burgerlab); }
.order-card.wokfire { border-left-color: var(--brand-wokfire); }
.order-card.saladcraft { border-left-color: var(--brand-saladcraft); }

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.order-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.order-brand {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.1);
}

.order-brand.burgerlab { color: var(--brand-burgerlab); }
.order-brand.wokfire { color: var(--brand-wokfire); }
.order-brand.saladcraft { color: var(--brand-saladcraft); }

.order-items {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.order-item {
  margin-bottom: 2px;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-time {
  font-size: 11px;
  color: var(--text-muted);
}

.order-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
}

.order-status.pending {
  background-color: rgba(251, 191, 36, 0.15);
  color: #FBBF24;
}

.order-status.preparing {
  background-color: rgba(129, 140, 248, 0.15);
  color: var(--accent-primary);
}

.order-status.completed {
  background-color: rgba(74, 222, 128, 0.15);
  color: var(--brand-saladcraft);
}

/* Main Content Area */
.main-content {
  padding: 24px 32px;
  overflow-y: auto;
  height: 100vh;
}

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

.dashboard-title {
  font-size: 28px;
  font-weight: 700;
}

.dashboard-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.current-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  padding: 8px 16px;
  border-radius: 8px;
}

/* Metrics Strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid var(--border-color);
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-value.accent { color: var(--accent-primary); }
.metric-value.success { color: var(--brand-saladcraft); }
.metric-value.warning { color: #FBBF24; }

.metric-change {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.metric-change.up { color: var(--brand-saladcraft); }
.metric-change.down { color: var(--status-live); }

/* Forecast Section */
.section {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

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

.section-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: rgba(129, 140, 248, 0.2);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Forecast Chart */
.forecast-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  padding: 10px 0;
}

.forecast-bar {
  flex: 1;
  min-width: 0;
  background: linear-gradient(to top, rgba(129, 140, 248, 0.3), rgba(129, 140, 248, 0.6));
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.forecast-bar:hover {
  background: linear-gradient(to top, rgba(129, 140, 248, 0.5), rgba(129, 140, 248, 0.8));
}

.forecast-bar.current {
  background: linear-gradient(to top, var(--accent-primary), #A5B4FC);
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
}

.forecast-bar.peak {
  background: linear-gradient(to top, #FBBF24, #FCD34D);
}

.forecast-bar::after {
  content: attr(data-hour);
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.forecast-bar::before {
  content: attr(data-value);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  opacity: 0;
  transition: opacity 0.2s;
}

.forecast-bar:hover::before {
  opacity: 1;
}

.chart-legend {
  display: flex;
  gap: 24px;
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

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

.legend-dot.current { background-color: var(--accent-primary); }
.legend-dot.peak { background-color: #FBBF24; }
.legend-dot.normal { background-color: rgba(129, 140, 248, 0.5); }

/* Bottom Grid */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Prep Schedule */
.prep-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prep-card {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  gap: 14px;
}

.prep-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 55px;
}

.prep-brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prep-brand-dot.burgerlab { background-color: var(--brand-burgerlab); }
.prep-brand-dot.wokfire { background-color: var(--brand-wokfire); }
.prep-brand-dot.saladcraft { background-color: var(--brand-saladcraft); }

.prep-info {
  flex: 1;
}

.prep-task {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.prep-duration {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.prep-priority {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
}

.prep-priority.high {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--status-live);
}

.prep-priority.medium {
  background-color: rgba(251, 191, 36, 0.15);
  color: #FBBF24;
}

.prep-priority.low {
  background-color: rgba(74, 222, 128, 0.15);
  color: var(--brand-saladcraft);
}

/* Capacity Gauge */
.capacity-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.capacity-percentage {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 600;
}

.capacity-label {
  font-size: 13px;
  color: var(--text-muted);
}

.capacity-bar-container {
  height: 40px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
}

.capacity-segment {
  height: 100%;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
  min-width: 0;
}

.capacity-segment.burgerlab { background-color: var(--brand-burgerlab); }
.capacity-segment.wokfire { background-color: var(--brand-wokfire); }
.capacity-segment.saladcraft { background-color: var(--brand-saladcraft); }

.capacity-legend {
  display: flex;
  justify-content: space-between;
}

.capacity-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.capacity-brand-info {
  display: flex;
  flex-direction: column;
}

.capacity-brand-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.capacity-brand-orders {
  font-size: 12px;
  color: var(--text-muted);
}

.capacity-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.capacity-brand-icon.burgerlab { background-color: rgba(255, 107, 53, 0.2); }
.capacity-brand-icon.wokfire { background-color: rgba(34, 211, 238, 0.2); }
.capacity-brand-icon.saladcraft { background-color: rgba(74, 222, 128, 0.2); }

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

  .order-feed {
    display: none;
  }

  .order-feed.mobile-visible {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

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

  .mobile-nav {
    display: flex;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 16px;
  }

  .metrics-strip {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 28px;
  }

  .forecast-chart {
    height: 120px;
  }

  .chart-legend {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 12px 20px;
  z-index: 50;
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  list-style: none;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--accent-primary);
}

.mobile-nav-icon {
  font-size: 20px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
