/* =====================================================
   MONITORING pH — PT MUARA ALAM SEJAHTERA
   Desain baru: light theme, navbar atas, tipografi besar
   ===================================================== */

:root {
  --red: #E31E24;
  --red-dark: #B5151A;
  --orange: #FF7A1A;
  --ink: #1A1A1A;
  --gray: #5C5C5C;
  --gray-light: #8A8A8A;
  --bg: #FBF7F5;
  --card: #FFFFFF;
  --line: #ECE6E3;
  --aman: #16A34A;
  --waspada: #F59E0B;
  --bahaya: #DC2626;
  --shadow: 0 10px 40px rgba(20,20,20,0.06);
  --shadow-lg: 0 20px 60px rgba(20,20,20,0.12);
  --radius: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', 'Segoe UI', Roboto, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===================== NAVBAR ===================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.navbar .brand img { height: 48px; }
.navbar .brand-text h1 {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
}
.navbar .brand-text p {
  font-size: 13.5px;
  color: var(--gray-light);
  font-weight: 500;
}

.navbar nav {
  display: flex;
  gap: 6px;
}
.navbar nav a {
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--gray);
  transition: all .2s;
}
.navbar nav a:hover { background: #FBEAEA; color: var(--red); }
.navbar nav a.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(227,30,36,0.35);
}

.navbar .status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--aman);
  background: #EAFBF0;
  padding: 8px 16px;
  border-radius: 30px;
}
.navbar .status-chip .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--aman);
  animation: blink 1.5s infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50% { opacity: .35; }
}

.navbar-toggle { display: none; }

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(15,15,15,0.92) 25%, rgba(15,15,15,0.55) 65%, rgba(227,30,36,0.35) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 0 48px;
  color: #fff;
}
.hero-inner .eyebrow {
  display: inline-block;
  background: var(--red);
  padding: 7px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 22px;
}
.hero-inner h2 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 18px;
}
.hero-inner h2 span { color: var(--orange); }
.hero-inner p {
  font-size: 17.5px;
  color: #e8e8e8;
  max-width: 560px;
}

/* ===================== LAYOUT ===================== */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 40px 80px;
}

.page-head { margin-bottom: 40px; }
.page-head .eyebrow {
  color: var(--red);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.page-head h1 {
  font-size: 38px;
  font-weight: 800;
  margin-top: 10px;
}
.page-head p {
  color: var(--gray);
  font-size: 17px;
  margin-top: 10px;
  max-width: 680px;
}

/* ===================== GRID ===================== */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: 1.1fr 1.5fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1000px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===================== CARD ===================== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  border: 1px solid var(--line);
}
.card-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

/* ===================== PH HERO CARD ===================== */
.ph-card {
  background: linear-gradient(155deg, #1A1A1A 0%, #2A1010 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ph-card::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(227,30,36,0.35), transparent 70%);
  top: -120px; right: -100px;
}
.ph-card .card-label { color: #d8d8d8; }
.ph-ring {
  position: relative;
  width: 230px;
  height: 230px;
  margin: 10px auto 20px;
}
.ph-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ph-ring .bg-ring { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 14; }
.ph-ring .fg-ring { fill: none; stroke: var(--orange); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ph-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ph-ring-center .num { font-size: 58px; font-weight: 800; line-height: 1; }
.ph-ring-center .unit { font-size: 15px; color: #ccc; font-weight: 600; margin-top: 4px; }

.status-tag {
  display: inline-block;
  padding: 9px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  margin-top: 6px;
}
.status-tag.ASAM, .status-tag.BAHAYA { background: var(--bahaya); }
.status-tag.NETRAL, .status-tag.AMAN { background: var(--aman); }
.status-tag.BASA, .status-tag.WASPADA { background: var(--waspada); }

.ph-card .updated {
  margin-top: 22px;
  font-size: 13.5px;
  color: #bdbdbd;
}

/* ===================== STAT CARDS ===================== */
.stat-card { text-align: center; }
.stat-card .icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  background: #FBEAEA;
}
.stat-card .value { font-size: 34px; font-weight: 800; }
.stat-card .label { font-size: 14.5px; color: var(--gray); margin-top: 6px; font-weight: 600; }

/* ===================== CHART CARD ===================== */
.chart-card canvas { max-height: 340px; }

/* ===================== TABLE ===================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { padding: 16px 14px; text-align: left; white-space: nowrap; }
th {
  color: var(--gray-light);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--line);
  font-weight: 700;
}
td { border-bottom: 1px solid var(--line); font-weight: 500; }
tr:hover td { background: #FBF7F5; }
.pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: inline-block;
}
.pill.Asam { background: var(--bahaya); }
.pill.Netral { background: var(--aman); }
.pill.Basa { background: var(--waspada); }

.link-more {
  font-weight: 700;
  color: var(--red);
  font-size: 15px;
}

/* ===================== INFO LIST ===================== */
.info-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-row .icon-box {
  min-width: 52px; height: 52px;
  border-radius: 14px;
  background: #FBEAEA;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.info-row .txt b { font-size: 17px; display: block; margin-bottom: 3px; }
.info-row .txt span { font-size: 15px; color: var(--gray); }

/* ===================== PROSE / CONTENT PAGES ===================== */
.prose h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 30px 0 14px;
}
.prose h2:first-child { margin-top: 0; }
.prose p {
  font-size: 16.5px;
  color: var(--gray);
  margin-bottom: 14px;
}
.prose ul { margin: 10px 0 14px 0; }
.prose ul li {
  font-size: 16.5px;
  color: var(--gray);
  padding-left: 26px;
  position: relative;
  margin-bottom: 10px;
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.spec-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.spec-item b { font-size: 16.5px; display: block; }
.spec-item span { font-size: 14.5px; color: var(--gray-light); }

/* ===================== BADGE THRESHOLD ===================== */
.threshold-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.threshold-item {
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  color: #fff;
}
.threshold-item.asam { background: var(--bahaya); }
.threshold-item.netral { background: var(--aman); }
.threshold-item.basa { background: var(--waspada); }
.threshold-item .t-val { font-size: 22px; font-weight: 800; }
.threshold-item .t-label { font-size: 13px; opacity: 0.9; margin-top: 4px; }

/* ===================== FOOTER ===================== */
footer {
  text-align: center;
  padding: 34px;
  color: var(--gray-light);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .navbar { flex-wrap: wrap; gap: 14px; padding: 16px 20px; }
  .navbar nav { order: 3; width: 100%; overflow-x: auto; }
  .hero-inner { padding: 0 24px; }
  .hero-inner h2 { font-size: 32px; }
  .wrap { padding: 36px 20px 60px; }
  .spec-grid, .threshold-grid { grid-template-columns: 1fr; }
}
