/* ══════════════════════════════════════════════
   Green Office — Waste Management dashboard CSS
   pages/waste-management/view.css

   NOTE (deviation from the source): the intranet2 V2 source page's own view.css was
   completely empty (0 bytes) — its .wst-* classes get their styling from that other
   project's environment, not from anything this port could copy. This file is written
   fresh, matching the class names view.php/view.js already use, in the same visual
   language as this Green Office dashboard's sibling pages (see pages/electricity's
   .elec-* stylesheet on the source side for the design system this follows).
   ══════════════════════════════════════════════ */

.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;
}

#wst-page { font-family: Sarabun, sans-serif; }

/* Header */
.wst-header {
    position: relative;
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 20px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,60,113,.22);
}
.wst-header-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg,#003C71 0%,#0055a5 55%,#10b981 100%);
    z-index: 0;
}
.wst-header-content {
    position: relative; z-index: 1;
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
.wst-title {
    font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 4px;
    display: flex; align-items: center; gap: 10px;
}
.wst-subtitle { font-size: 13px; color: rgba(255,255,255,.85); }
.wst-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wst-meta-badge {
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
    color: #fff; font-size: 11px; padding: 4px 10px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 6px;
}
.wst-header-actions { flex-shrink: 0; }
.wst-btn-ref {
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35);
    color: #fff; font-size: 12px; padding: 7px 16px; border-radius: 8px;
    cursor: pointer; transition: background .2s; white-space: nowrap;
}
.wst-btn-ref:hover { background: rgba(255,255,255,.28); color: #fff; }

/* Filter bar */
.wst-filter-bar {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 14px 18px; margin-bottom: 18px;
}
.wst-lbl { font-size: 12px; color: #475569; margin: 0; }

/* KPI grid */
.wst-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px; margin-bottom: 6px;
}
.wst-kpi-card {
    border-radius: 12px; padding: 16px 16px;
    display: flex; align-items: flex-start; gap: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transition: transform .18s, box-shadow .18s;
    position: relative; overflow: hidden;
}
.wst-kpi-card::after {
    content: ''; position: absolute; top: -18px; right: -18px;
    width: 75px; height: 75px; border-radius: 50%; background: rgba(255,255,255,.1);
}
.wst-kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.13); }
.wst-k-primary   { background: linear-gradient(135deg,#003C71,#1a63b5); color: #fff; }
.wst-k-general   { background: linear-gradient(135deg,#334155,#64748b); color: #fff; }
.wst-k-organic   { background: linear-gradient(135deg,#15803d,#22c55e); color: #fff; }
.wst-k-recycle   { background: linear-gradient(135deg,#0369a1,#0085AD); color: #fff; }
.wst-k-hazard    { background: linear-gradient(135deg,#b91c1c,#dc2626); color: #fff; }
.wst-k-infect    { background: linear-gradient(135deg,#6b21a8,#9333ea); color: #fff; }
.wst-k-diversion { background: linear-gradient(135deg,#b45309,#f59e0b); color: #fff; }
.wst-kpi-icon {
    width: 42px; height: 42px; flex-shrink: 0; background: rgba(255,255,255,.2);
    border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.wst-kpi-body { flex: 1; min-width: 0; }
.wst-kpi-label {
    font-size: 11px; opacity: .88; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wst-kpi-val { font-size: 21px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
.wst-kpi-unit { font-size: 11px; opacity: .82; margin-top: 3px; }

/* Tabs */
.wst-tabs {
    display: flex; gap: 6px; flex-wrap: wrap;
    border-bottom: 2px solid #e2e8f0; margin-bottom: 0;
}
.wst-tab {
    padding: 9px 18px; font-size: 13px; font-weight: 600;
    border: none; background: #f1f5f9; color: #64748b;
    border-radius: 8px 8px 0 0; cursor: pointer; transition: all .18s;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    display: inline-flex; align-items: center; gap: 6px;
}
.wst-tab:hover { background: #e2e8f0; color: #003C71; }
.wst-tab.active {
    background: #fff; color: #003C71; border-bottom: 2px solid #003C71;
    box-shadow: 0 -2px 8px rgba(0,60,113,.08);
}
.wst-tab-pane.active { display: block; }

/* Cards */
.wst-card {
    background: #fff; border-radius: 12px; border: 1px solid #e5eaf0;
    box-shadow: 0 2px 10px rgba(0,0,0,.05); overflow: hidden;
}
.wst-card-hd {
    padding: 14px 18px 10px; border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; font-size: 13px;
}
.wst-note { padding: 6px 18px 10px; font-size: 11px; color: #64748b; min-height: 22px; }

/* Chart-type toggle + fullscreen buttons */
.wst-ct-btn, .wst-btn-fs {
    width: 30px; height: 30px; padding: 0; border: 1px solid #e2e8f0;
    background: #f8fafc; color: #94a3b8; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; transition: all .15s; cursor: pointer;
}
.wst-ct-btn.active, .wst-ct-btn:hover, .wst-btn-fs:hover {
    background: #003C71; color: #fff; border-color: #003C71;
}

/* Tables */
.wst-tbl { font-size: 12px; }
.wst-tbl thead th {
    background: #f1f5f9; color: #334155; font-weight: 600;
    border-bottom: 2px solid #e2e8f0; font-size: 12px; white-space: nowrap; padding: 10px 12px;
}
.wst-tbl tbody tr:hover { background: #f8fafc; }
.wst-tbl tbody td { padding: 9px 12px; vertical-align: middle; border-color: #f1f5f9; }

/* Type badges (raw-data table) */
.wst-type-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600; color: #fff;
}
.wst-t-general { background: #64748b; }
.wst-t-hazard  { background: #dc2626; }
.wst-t-infect  { background: #9333ea; }
.wst-t-recycle { background: #0085AD; }
.wst-t-organic { background: #10b981; }

/* Leaflet popup rows */
.wst-popup-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; font-size: 12px; padding: 2px 0;
}
.wst-popup-total { border-top: 1px solid #e2e8f0; margin-top: 4px; padding-top: 4px; }

/* Fullscreen overlay */
#wst-fs-overlay {
    display: none; position: fixed; inset: 0; z-index: 99999;
    background: #fff; flex-direction: column;
}
#wst-fs-overlay.active { display: flex; }
#wst-fs-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding: 10px 20px;
    background: linear-gradient(135deg, #003C71, #1a5fa8); color: #fff;
    flex-shrink: 0; min-height: 52px;
}
#wst-fs-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; }
.wst-fs-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wst-btn-fs-ctrl {
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35);
    color: #fff; border-radius: 7px; padding: 5px 13px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background .15s;
    display: flex; align-items: center; gap: 5px; height: 30px;
}
.wst-btn-fs-ctrl:hover { background: rgba(255,255,255,.28); }
#wst-fs-body { flex: 1; overflow: hidden; padding: 12px; display: flex; }
#wst-fs-chart-el { flex: 1; min-height: 0; }

/* Map */
#wst-map { background: #f1f5f9; }
.apexcharts-heatmap-rect + text { font-size: 9px !important; }

/* Responsive */
@media (max-width: 768px) {
    .wst-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .wst-kpi-val  { font-size: 18px; }
    .wst-header   { padding: 16px 16px; }
    .wst-header-content { flex-direction: column; }
}
@media (max-width: 480px) {
    .wst-kpi-grid { grid-template-columns: 1fr 1fr; }
}
