/* ═══════════════════════════════════════════════════
 * Green Office — Greenhouse Gas (GHG)
 * pages/greenhouse-gas/view.css
 * Ported from intranet2 dashboard/V2/pages/greenhouse-gas/view.css
 * (the .ghg-scope-note rules were dropped — that notice block was removed from view.php)
 * ═══════════════════════════════════════════════════ */

.page-header {
  background: linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)), url(../../img/bg02.png) center center no-repeat;
  background-size: cover;
}

#ghg-page { font-family: Sarabun, sans-serif; color: #1a2a4a; }

/* ─────────────── Header ─────────────── */
.ghg-header {
  position: relative;
  border-radius: 16px;
  padding: 22px 28px;
  margin-top: 14px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(0,60,113,.35);
}
.ghg-header-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(circle at 88% 85%, rgba(0,133,173,.35), transparent 50%),
    linear-gradient(135deg, #003C71 0%, #0066b2 55%, #0085AD 100%);
}
.ghg-header-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .25;
}
.ghg-header-content {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.ghg-title {
  color: #fff !important;
  margin: 0; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
  font-family: Kanit, Sarabun, sans-serif;
}
.ghg-title i { font-size: 22px; color: #B6F5C1; }
.ghg-subtitle {
  margin-top: 4px; font-size: 14px; opacity: .92;
  font-family: Sarabun, sans-serif;
}
.ghg-meta { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.ghg-meta-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 30px;
  font-size: 11.5px;
  backdrop-filter: blur(4px);
}
.ghg-header-actions { display: flex; gap: 8px; }
.ghg-btn-ref {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff !important; text-decoration: none;
  border-radius: 8px; font-size: 12.5px; font-weight: 600;
  transition: all .2s;
}
.ghg-btn-ref:hover { background: rgba(255,255,255,.25); transform: translateY(-1px); }

/* ─────────────── Filter bar ─────────────── */
.ghg-filter-bar {
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 12px 18px;
  margin-top: 14px;
  box-shadow: 0 2px 8px -2px rgba(0,60,113,.08);
}
.ghg-lbl {
  font-size: 12px; font-weight: 600; color: #334155;
  margin-bottom: 0;
}

/* ─────────────── KPI Grid ─────────────── */
.ghg-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.ghg-kpi-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid #e6edf5;
  box-shadow: 0 2px 8px -2px rgba(0,60,113,.08);
  transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.ghg-kpi-card::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
}
.ghg-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -4px rgba(0,60,113,.18); }
.ghg-kpi-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.ghg-kpi-body { flex: 1; min-width: 0; }
.ghg-kpi-label {
  font-size: 11.5px; color: #64748b; font-weight: 600;
  line-height: 1.3;
}
.ghg-kpi-val {
  font-size: 22px; font-weight: 700; color: #1a2a4a;
  line-height: 1.2; margin-top: 2px;
  font-family: Kanit, Sarabun, sans-serif;
}
.ghg-kpi-unit {
  font-size: 11px; color: #64748b; margin-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

/* KPI color variants */
.ghg-k-primary::before { background: linear-gradient(#003C71, #0085AD); }
.ghg-k-primary .ghg-kpi-icon { background: linear-gradient(135deg, #003C71, #0085AD); }
.ghg-k-scope1::before { background: linear-gradient(#dc2626, #f97316); }
.ghg-k-scope1 .ghg-kpi-icon { background: linear-gradient(135deg, #dc2626, #f97316); }
.ghg-k-scope2::before { background: linear-gradient(#f59e0b, #facc15); }
.ghg-k-scope2 .ghg-kpi-icon { background: linear-gradient(135deg, #f59e0b, #facc15); }
.ghg-k-scope3::before { background: linear-gradient(#10b981, #34d399); }
.ghg-k-scope3 .ghg-kpi-icon { background: linear-gradient(135deg, #10b981, #34d399); }
.ghg-k-capita::before { background: linear-gradient(#6366f1, #8b5cf6); }
.ghg-k-capita .ghg-kpi-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ghg-k-area::before { background: linear-gradient(#0085AD, #59CBE8); }
.ghg-k-area .ghg-kpi-icon { background: linear-gradient(135deg, #0085AD, #59CBE8); }

/* ─────────────── Tabs ─────────────── */
.ghg-tabs {
  display: flex; gap: 4px; margin-top: 20px;
  background: #f1f5f9;
  padding: 6px; border-radius: 12px;
  overflow-x: auto;
}
.ghg-tab {
  flex: 1; min-width: 140px;
  padding: 10px 16px;
  background: transparent; border: 0;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: #64748b;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
  transition: all .2s;
  font-family: Sarabun, sans-serif;
  white-space: nowrap;
}
.ghg-tab:hover { color: #003C71; background: rgba(255,255,255,.6); }
.ghg-tab.active {
  background: linear-gradient(135deg, #003C71, #0085AD);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(0,60,113,.3);
}
.ghg-tab-pane { display: none; }
.ghg-tab-pane.active { display: block; }

/* ─────────────── Cards ─────────────── */
.ghg-card {
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  box-shadow: 0 2px 8px -2px rgba(0,60,113,.08);
  overflow: hidden;
}
.ghg-card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
  font-size: 14px;
}
.ghg-card-hd strong { color: #1a2a4a; font-weight: 600; }

/* ─────────────── Chart type toggle ─────────────── */
.ghg-ct-btn {
  width: 30px; height: 28px;
  border: 1px solid #e2e8f0;
  background: #fff; color: #64748b;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.ghg-ct-btn:hover { border-color: #0085AD; color: #0085AD; }
.ghg-ct-btn.active {
  background: #003C71; border-color: #003C71; color: #fff;
}

/* ─────────────── Fullscreen button (per card) ─────────────── */
.ghg-btn-fs {
  width: 30px; height: 28px;
  border: 1px solid #e2e8f0;
  background: #fff; color: #64748b;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.ghg-btn-fs:hover {
  border-color: #003C71; color: #003C71;
  background: #f0f7ff;
}

/* ─────────────── Fullscreen Overlay ─────────────── */
#ghg-fs-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 99998;
  background: rgba(15, 23, 42, .78);
  backdrop-filter: blur(6px);
  flex-direction: column;
  animation: ghgFsFadeIn .2s ease-out;
}
#ghg-fs-overlay.active { display: flex; }
@keyframes ghgFsFadeIn { from { opacity: 0; } to { opacity: 1; } }

#ghg-fs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(135deg, #003C71, #0085AD);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  flex-shrink: 0;
}
#ghg-fs-title {
  font-size: 16px; font-weight: 600;
  font-family: Kanit, Sarabun, sans-serif;
}
.ghg-fs-controls { display: flex; gap: 8px; align-items: center; }
.ghg-btn-fs-ctrl {
  padding: 7px 14px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: Sarabun, sans-serif;
}
.ghg-btn-fs-ctrl:hover { background: rgba(255,255,255,.25); transform: translateY(-1px); }

#ghg-fs-body {
  flex: 1;
  padding: 20px 28px;
  background: #fff;
  overflow: auto;
}
#ghg-fs-chart-el {
  width: 100%; height: 100%;
  min-height: calc(100vh - 120px);
}

/* ─────────────── Notes ─────────────── */
.ghg-note {
  padding: 8px 18px 12px;
  font-size: 11px; color: #94a3b8;
  font-family: Sarabun, sans-serif;
  border-top: 1px solid #f8fafc;
}

/* ─────────────── Tables ─────────────── */
.ghg-tbl {
  font-size: 13px;
  font-family: Sarabun, sans-serif;
}
.ghg-tbl thead tr {
  background: linear-gradient(135deg, #003C71, #0066b2);
}
.ghg-tbl thead th {
  color: #fff; font-weight: 600;
  padding: 10px 14px;
  border: 0;
  font-size: 12.5px;
}
.ghg-tbl tbody td {
  padding: 10px 14px;
  border-top: 1px solid #f1f5f9;
  vertical-align: middle;
}
.ghg-tbl tbody tr:hover { background: #f8fafc; }

/* scope badges inside table */
.ghg-scope-badge {
  display: inline-block;
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  color: #fff;
}
.ghg-scope-1 { background: linear-gradient(135deg, #dc2626, #f97316); }
.ghg-scope-2 { background: linear-gradient(135deg, #f59e0b, #facc15); color: #1a2a4a; }
.ghg-scope-3 { background: linear-gradient(135deg, #10b981, #34d399); }

/* status colors */
.ghg-s-danger { color: #dc2626; font-weight: 600; }
.ghg-s-warn   { color: #f97316; font-weight: 600; }
.ghg-s-norm   { color: #64748b; font-weight: 500; }
.ghg-s-ok     { color: #10b981; font-weight: 600; }

/* ─────────────── Responsive ─────────────── */
@media (max-width: 768px) {
  .ghg-header { padding: 18px 20px; }
  .ghg-title { font-size: 22px; }
  .ghg-subtitle { font-size: 13px; }
  .ghg-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ghg-kpi-val { font-size: 19px; }
  .ghg-tab { font-size: 12px; min-width: 100px; padding: 8px 10px; }
}
@media (max-width: 480px) {
  .ghg-kpi-grid { grid-template-columns: 1fr; }
}
