/* ==========================================================================
   Views CSS (Dashboard, Pedidos, Cardápio, Entregas, Financeiro, etc.)
   ========================================================================== */

/* ----------------- 1. DASHBOARD ----------------- */
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero-date-badge {
  color: var(--primary-orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.hero-greeting {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.period-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

/* 4 KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

@media (max-width: 1150px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: var(--space-2);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

.kpi-trend-sub {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 2px;
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-box.orange {
  background-color: var(--bg-surface-orange);
  color: var(--primary-orange);
}

.kpi-icon-box.cyan {
  background-color: var(--bg-surface-cyan);
  color: var(--accent-cyan-dark);
}

.kpi-icon-box.purple {
  background-color: var(--bg-surface-purple);
  color: #7c3aed;
}

.kpi-icon-box.green {
  background-color: var(--bg-surface-green);
  color: var(--success);
}

/* Main Dashboard 2-column Grid */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 2fr 1.15fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

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

/* Sales Rhythm Bar Chart */
.sales-chart-card {
  padding: var(--space-6);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
}

.chart-bars-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 220px;
  padding-bottom: 24px;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.chart-bar {
  width: 100%;
  max-width: 32px;
  background-color: #dff6f6;
  border-radius: 4px 4px 0 0;
  transition: background-color var(--trans-fast), height var(--trans-base);
  min-height: 8px;
}

.chart-bar-col:hover .chart-bar,
.chart-bar.active {
  background-color: #b5ece9;
}

.chart-bar-label {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  color: var(--text-muted);
}

.chart-tooltip {
  position: absolute;
  top: -34px;
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-fast);
}

.chart-bar-col:hover .chart-tooltip {
  opacity: 1;
}

/* Orders in Progress Feed */
.live-orders-card {
  padding: var(--space-6);
}

.live-orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.live-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color var(--trans-fast);
}

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

.live-order-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.order-receipt-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-orange);
  color: var(--primary-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.order-item-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.live-order-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.order-item-price {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Secondary Dashboard Grid */
.dashboard-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: var(--space-6);
}

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

.channel-progress-item {
  margin-bottom: var(--space-3);
}

.channel-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.channel-bar-bg {
  height: 8px;
  background-color: var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.channel-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
}

.insight-card {
  background: linear-gradient(135deg, #1e2837 0%, #151d2a 100%);
  color: var(--text-white);
  border: 1px solid #2d3b4f;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.insight-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fb923c;
  margin-bottom: var(--space-3);
}

.insight-text {
  font-size: 14px;
  line-height: 1.45;
  color: #e2e8f0;
  margin-bottom: var(--space-4);
}

/* ----------------- 2. PEDIDOS (KDS KANBAN) ----------------- */
.kanban-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-6);
  align-items: start;
}

.kanban-col {
  background-color: var(--bg-card-muted);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 500px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-light);
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.kanban-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  cursor: pointer;
  transition: border-color var(--trans-fast), transform var(--trans-fast);
}

.kanban-card:hover {
  border-color: var(--primary-orange);
  transform: translateY(-2px);
}

.kanban-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.kanban-customer {
  font-size: 12.5px;
  font-weight: 600;
}

.kanban-items-summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.kanban-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
}

/* ----------------- 3. CARDÁPIO ----------------- */
.menu-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.category-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 4px;
}

.cat-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.cat-tab.active {
  background-color: var(--primary-orange);
  color: var(--text-white);
  border-color: var(--primary-orange);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.menu-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.menu-card-img {
  height: 140px;
  background-color: #f3efe9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 40px;
}

.menu-badge-pause {
  position: absolute;
  top: 10px;
  right: 10px;
}

.menu-card-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.menu-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.menu-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: var(--space-3);
  flex: 1;
}

.menu-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
}

.menu-card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-orange);
}

/* ----------------- 4. CRM & CLIENTES ----------------- */
.data-table-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
}

.data-table th {
  background-color: var(--bg-card-muted);
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background-color: #faf8f5;
}

/* ----------------- 5. ENTREGAS / MOTOBOYS ----------------- */
.couriers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.courier-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.courier-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background-color: var(--accent-cyan);
  color: var(--accent-cyan-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----------------- 6. FINANCEIRO ----------------- */
.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

@media (max-width: 900px) {
  .finance-summary-grid {
    grid-template-columns: 1fr;
  }
}

.payment-method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

/* ----------------- 7. RELATÓRIOS / GRÁFICOS INTERATIVOS ----------------- */
.reports-charts-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.report-chart-card {
  padding: 0 !important;
  overflow: hidden;
}

.report-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  padding: 0 24px 8px;
  flex-wrap: wrap;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.chart-legend-label {
  white-space: nowrap;
}

.chart-canvas-wrapper {
  width: 100%;
  padding: 8px 12px 16px;
  position: relative;
}

.report-chart-canvas {
  display: block;
  width: 100%;
  height: 280px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (max-width: 768px) {
  .report-chart-header {
    flex-direction: column;
  }

  .report-chart-canvas {
    height: 220px;
  }
}
