/* ─── Mount Polley Mine — EMIS Module Styles ────────────────────────────── */

/* Site selector in sidebar */
.site-selector-wrap {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.07);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
}
.site-selector-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 5px;
}
#siteSelect {
  width: 100%;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
#siteSelect:focus { border-color: rgba(251,146,60,.7); }
#siteSelect option { background: #102d43; color: #fff; }

/* Site badge in header */
.site-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.site-badge.irving { background: rgba(34,197,94,.15); color: #16a34a; }
.site-badge.mp { background: rgba(251,146,60,.15); color: #d97706; }
.site-badge .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.site-badge.irving .dot { background: #22c55e; }
.site-badge.mp .dot { background: #f59e0b; }

/* ─── Mount Polley page layout ──────────────────────────────────────────── */
.mp-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media(max-width:1100px){ .mp-kpi-strip{ grid-template-columns: repeat(2,1fr); } }
@media(max-width:600px){ .mp-kpi-strip{ grid-template-columns: 1fr; } }

.mp-kpi-strip .card.kpi { text-align: center; padding: 18px 14px; position: relative; overflow: hidden; }
.mp-kpi-strip .card.kpi::before {
  content:'';
  position:absolute;
  top:0;left:0;right:0;
  height:3px;
  background: linear-gradient(90deg,#f59e0b,#fb923c);
  border-radius: 12px 12px 0 0;
}
.mp-kpi-strip .card.kpi .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #607588; margin-bottom: 6px; }
.mp-kpi-strip .card.kpi .val { font-size: 32px; font-weight: 900; color: #0d2336; letter-spacing: -.03em; line-height: 1; margin-bottom: 4px; }
.mp-kpi-strip .card.kpi .trend { font-size: 12px; font-weight: 600; }
.mp-kpi-strip .card.kpi .trend.good { color: #16a34a; }
.mp-kpi-strip .card.kpi .trend.warn { color: #d97706; }
.mp-kpi-strip .card.kpi .trend.alert { color: #dc2626; }

.mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.mp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.mp-grid-wide { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
@media(max-width:1100px){ .mp-grid,.mp-grid-3,.mp-grid-wide{ grid-template-columns: 1fr; } }

.mp-panel {
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  border: 1px solid rgba(15,45,70,.08);
  padding: 18px 20px;
  box-shadow: 0 4px 18px rgba(10,34,57,.07);
}
.mp-panel h3 {
  font-size: 14px;
  font-weight: 800;
  color: #0d2336;
  margin: 0 0 14px;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.mp-panel .chartBox { height: 220px; }
.mp-panel .chartBox.sm { height: 160px; }
.mp-panel .chartBox.tall { height: 280px; }

/* ─── Equipment / Asset Table ───────────────────────────────────────────── */
.mp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mp-table th {
  background: #f0f4f8;
  color: #4a5568;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #dde6ef;
}
.mp-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; color: #2d3748; vertical-align: middle; }
.mp-table tr:last-child td { border-bottom: none; }
.mp-table tr:hover td { background: rgba(251,146,60,.04); }
.mp-table .id-cell { font-family: 'Courier New', monospace; font-size: 11px; color: #78909c; }

/* ─── Status Pills ──────────────────────────────────────────────────────── */
.mp-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.mp-pill.running, .mp-pill.online { background: #dcfce7; color: #15803d; }
.mp-pill.standby { background: #fef9c3; color: #a16207; }
.mp-pill.maintenance, .mp-pill.offline { background: #fee2e2; color: #b91c1c; }
.mp-pill.limited { background: #fef3c7; color: #d97706; }

/* ─── Area summary cards ────────────────────────────────────────────────── */
.mp-area-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media(max-width:1100px){ .mp-area-grid{ grid-template-columns: repeat(2,1fr); } }

.mp-area-card {
  background: rgba(255,255,255,.92);
  border-radius: 12px;
  border: 1px solid rgba(15,45,70,.08);
  padding: 14px 16px;
  box-shadow: 0 3px 12px rgba(10,34,57,.06);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: default;
}
.mp-area-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(10,34,57,.12); }
.mp-area-card .area-pct { font-size: 28px; font-weight: 900; color: #0d2336; letter-spacing: -.03em; }
.mp-area-card .area-name { font-size: 11.5px; font-weight: 700; color: #607588; margin: 3px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.mp-area-card .area-mw { font-size: 13px; font-weight: 600; color: #d97706; }
.mp-area-card .bar-track { height: 4px; background: #e8edf2; border-radius: 2px; margin-top: 8px; }
.mp-area-card .bar-fill { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #f59e0b, #fb923c); transition: width .4s ease; }
.mp-area-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #f59e0b, #fb923c); }

/* Grinding: larger accent */
.mp-area-card.grinding::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.mp-area-card.grinding .bar-fill { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.mp-area-card.pumps::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.mp-area-card.pumps .bar-fill { background: linear-gradient(90deg, #22c55e, #4ade80); }

/* ─── Energy flow / Sankey ─────────────────────────────────────────────── */
.mp-flow { display: flex; gap: 0; align-items: stretch; margin-bottom: 18px; overflow-x: auto; }
.mp-flow-col { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.mp-flow-node {
  flex: 1;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,45,70,.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #0d2336;
  position: relative;
  text-align: center;
}
.mp-flow-arrow { width: 28px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 20px; flex-shrink: 0; }

/* ─── Demand gauge ──────────────────────────────────────────────────────── */
.mp-gauge-wrap { display: flex; flex-direction: column; align-items: center; padding: 14px 0; }
.mp-gauge-val { font-size: 42px; font-weight: 900; color: #0d2336; letter-spacing: -.04em; }
.mp-gauge-unit { font-size: 13px; color: #607588; font-weight: 600; margin-top: -4px; }
.mp-gauge-bar { width: 100%; height: 10px; background: #e8edf2; border-radius: 5px; margin: 12px 0 4px; overflow: hidden; }
.mp-gauge-fill { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #22c55e 0%, #f59e0b 70%, #ef4444 100%); transition: width .6s ease; }
.mp-gauge-limits { display: flex; justify-content: space-between; font-size: 10.5px; color: #607588; font-weight: 600; }

/* ─── Report cards ──────────────────────────────────────────────────────── */
.mp-report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media(max-width:900px){ .mp-report-grid{ grid-template-columns: repeat(2,1fr); } }

.mp-report-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,45,70,.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: default;
}
.mp-report-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(10,34,57,.12); }
.mp-report-card .rc-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #d97706; }
.mp-report-card .rc-title { font-size: 14px; font-weight: 800; color: #0d2336; }
.mp-report-card .rc-desc { font-size: 12px; color: #607588; line-height: 1.5; }
.mp-report-card .rc-freq { font-size: 11px; font-weight: 600; color: #94a3b8; margin-top: auto; }

/* ─── Note/caption text ─────────────────────────────────────────────────── */
.mp-note { font-size: 11.5px; color: #78909c; margin: 8px 0 0; line-height: 1.6; }
.mp-chip { display: inline-block; background: rgba(251,146,60,.12); color: #c2410c; border-radius: 5px; padding: 3px 8px; font-size: 11px; font-weight: 700; margin: 2px 3px 2px 0; }

/* ─── Section header with site badge ────────────────────────────────────── */
.mp-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(245,158,11,.15);
}
.mp-section-header h2 { margin: 0; font-size: 18px; font-weight: 900; color: #0d2336; }

/* ─── Drill-down modal content ──────────────────────────────────────────── */
.dd-header { margin-bottom: 16px; }
.dd-title { font-size: 20px; font-weight: 900; color: #0d2336; margin: 0 0 4px; }
.dd-sub { font-size: 12px; color: #607588; font-weight: 600; }

.dd-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dd-kpi {
  background: #f5fafd;
  border: 1px solid #dde8f0;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.dd-kpi-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #607588; margin-bottom: 4px; }
.dd-kpi-val { font-size: 22px; font-weight: 900; color: #0d2336; letter-spacing: -.02em; line-height: 1.1; }
.dd-kpi-sub { font-size: 10.5px; color: #94a3b8; font-weight: 600; margin-top: 3px; }

.dd-section-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #607588; }
