/* ==========================================================================
   MODULE 2: TV EXECUTIVE MONITOR STYLES (LIGHT THEME)
   Matches Image 6 (Spreading Target vs Actual & Table) 
   and Image 7 (Cutting Analytics KPIs, Charts & Machine Utilization)
   ========================================================================== */

.tv-dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Mode Switcher Nav Pills */
.tv-mode-pills-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #ffffff;
  padding: 0.45rem 0.65rem;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  max-width: fit-content;
  margin: 0 auto 0.5rem auto;
}

.tv-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.65rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tv-mode-pill:hover {
  color: #4f46e5;
  background: #f8fafc;
}

.tv-mode-pill.active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

/* Common Light Card */
.tv-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 1.5rem;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.tv-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   TAB 1: SPREADING ANALYTICS STYLES (MATCHES IMAGE 6)
   ========================================================================== */
.chart-container-box {
  position: relative;
  width: 100%;
  height: 280px;
  margin-bottom: 0.5rem;
}

/* Hourly Table Styles */
.hourly-speed-table-container {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.hourly-speed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: center;
  white-space: nowrap;
}

.hourly-speed-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  padding: 0.65rem 0.45rem;
  border-bottom: 1.5px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
}

.hourly-speed-table td {
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  color: #1e293b;
  font-weight: 600;
}

.hourly-speed-table tr:hover {
  background: #f8fafc;
}

/* Cell Badges */
.cell-badge-green {
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  display: inline-block;
  line-height: 1.2;
}

.cell-badge-red {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  display: inline-block;
  line-height: 1.2;
}

.cell-badge-pink {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  display: inline-block;
}

.machine-eff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: center;
  white-space: nowrap;
}

.machine-eff-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  padding: 0.65rem 0.45rem;
  border-bottom: 1.5px solid #e2e8f0;
}

.machine-eff-table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-weight: 600;
}

.eff-pill-green {
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
}

.eff-pill-gray {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
}

.eff-pill-red {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
}

.cell-badge-target-green {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(22, 101, 52, 0.1);
}

.cell-badge-target-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(185, 28, 28, 0.1);
}

.badge-grand-total {
  background: #4f46e5;
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ==========================================================================
   TV Screen Fit Mode (Optimized for 16:9 1080p TV Displays)
   ========================================================================== */
body.tv-fit-screen {
  padding: 0.65rem 1.25rem !important;
  overflow-y: hidden;
}

body.tv-fit-screen .app-header {
  margin-bottom: 0.5rem !important;
  padding: 0.55rem 1.25rem !important;
}

body.tv-fit-screen .tv-mode-pills-bar {
  margin-bottom: 0.5rem !important;
  padding: 0.25rem 0.5rem !important;
}

body.tv-fit-screen .tv-card {
  padding: 0.75rem 1.15rem !important;
  margin-bottom: 0.5rem !important;
}

body.tv-fit-screen .tv-card-title {
  margin-bottom: 0.5rem !important;
  font-size: 0.9rem !important;
}

body.tv-fit-screen .chart-container-box {
  height: 190px !important;
  margin-bottom: 0.25rem !important;
}

body.tv-fit-screen .hourly-speed-table th {
  padding: 0.3rem 0.25rem !important;
  font-size: 0.72rem !important;
}

body.tv-fit-screen .hourly-speed-table td {
  padding: 0.2rem 0.2rem !important;
  font-size: 0.75rem !important;
}

body.tv-fit-screen .cutting-kpi-bar-5 {
  margin-bottom: 0.65rem !important;
  gap: 0.65rem !important;
}

body.tv-fit-screen .kpi-color-card {
  padding: 0.65rem 0.95rem !important;
}

body.tv-fit-screen main {
  max-width: 98% !important;
  margin: 0 auto !important;
}

body.tv-fit-screen .kpi-color-val {
  font-size: 1.5rem !important;
}

/* ==========================================================================
   TAB 2: CUTTING ANALYTICS STYLES (MATCHES IMAGE 7)
   ========================================================================== */
.cutting-kpi-bar-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 960px) {
  .cutting-kpi-bar-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-color-card {
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.kpi-color-card.blue { background: #2563eb; }
.kpi-color-card.green { background: #059669; }
.kpi-color-card.orange { background: #d97706; }
.kpi-color-card.red { background: #dc2626; }
.kpi-color-card.purple { background: #7c3aed; }

.kpi-color-label {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.kpi-color-val {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
}

/* Dual Charts Grid */
.cutting-dual-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .cutting-dual-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Machine Utilization Table */
.machine-eff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: center;
}

.machine-eff-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  padding: 0.75rem 0.65rem;
  border-bottom: 1.5px solid #e2e8f0;
}

.machine-eff-table td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-weight: 600;
}

.machine-eff-table tr:hover {
  background: #f8fafc;
}

.eff-pill-green {
  color: #059669;
  font-weight: 800;
}

.eff-pill-gray {
  color: #64748b;
  font-weight: 700;
}
