/* daily.css - Styling for ISPAQ Daily PSD/PDF tab */

#panel-daily {
  padding: 16px;
  max-width: 1500px;
  margin: 0 auto;
  color: #1e293b;
}

.daily-header {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.daily-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.daily-title-row h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.daily-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daily-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.daily-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.daily-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.daily-date-input {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.daily-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.daily-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
}

.daily-card .lbl {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.daily-card .val {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.daily-card .sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.daily-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.daily-filters {
  display: flex;
  gap: 6px;
}

.daily-search {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  width: 180px;
}

.daily-report-links {
  display: flex;
  gap: 8px;
}

.daily-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.daily-report-btn:hover {
  background: #dbeafe;
}

/* Comparison Mode Selector in Toolbar */
.daily-comp-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px dashed #e2e8f0;
  margin-top: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}

.daily-comp-mode-row .lbl {
  font-weight: 700;
  color: #475569;
}

/* Progress banner */
.daily-progress-banner {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: none;
}

.daily-progress-banner.active {
  display: block;
}

.daily-progress-title {
  font-size: 13px;
  font-weight: 700;
  color: #854d0e;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.daily-progress-bar-bg {
  height: 10px;
  background: #fef9c3;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #fde047;
}

.daily-progress-bar-fill {
  height: 100%;
  background: #eab308;
  width: 0%;
  transition: width 0.3s ease;
}

/* Stations vertical list */
.daily-stations-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.daily-station-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: border-color 0.15s ease;
}

.daily-station-card:hover {
  border-color: #94a3b8;
}

.daily-station-card.review {
  border-left: 5px solid #ef4444;
}

.daily-station-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.daily-station-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.daily-station-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.daily-station-badge.normal {
  background: #dcfce7;
  color: #15803d;
}

.daily-station-badge.review {
  background: #fee2e2;
  color: #b91c1c;
}

.daily-station-badge.nodata {
  background: #f1f5f9;
  color: #64748b;
}

.daily-channels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.daily-chan-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.daily-chan-cell:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
}

.daily-chan-header {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.daily-chan-thumb-wrap {
  width: 100%;
  aspect-ratio: 1200 / 655;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid #cbd5e1;
}

.daily-chan-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.daily-chan-no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #94a3b8;
}

.daily-chan-metrics {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  font-size: 12px;
  text-align: center;
}

.daily-metric-col {
  flex: 1;
}

.daily-metric-col .m-lbl {
  color: #64748b;
  font-size: 11px;
  margin-bottom: 2px;
}

.daily-metric-col .m-val {
  font-weight: 700;
  color: #0f172a;
}

.daily-metric-col .m-chg {
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}

.daily-metric-col .m-chg.red {
  color: #dc2626;
}

.daily-metric-col .m-chg.blue {
  color: #2563eb;
}

.daily-metric-col .m-chg.gray {
  color: #64748b;
}

.daily-metric-col .m-rel {
  font-size: 10px;
  color: #64748b;
}

/* Detail Modal */
.daily-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.daily-modal {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 1260px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

.daily-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
}

.daily-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.daily-modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
}

.daily-modal-close:hover {
  color: #0f172a;
}

.daily-modal-body {
  padding: 20px;
}

.daily-modal-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.daily-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.daily-side-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
}

.daily-side-box h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #334155;
  text-align: center;
}

.daily-side-box img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.daily-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 13px;
}

.daily-detail-table th, .daily-detail-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  text-align: center;
}

.daily-detail-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
}

/* Period Trend Plot Styles */
.daily-period-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  margin-top: 24px;
}

.daily-period-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.daily-period-stats-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  background: #ffffff;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.daily-period-plot-wrap {
  width: 100%;
  text-align: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  overflow: hidden;
}

.daily-period-plot-img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
