/* ═══════════════════════════════════════════════════════════
   Oil Pressure Monitor — Shared Stylesheet
   ═══════════════════════════════════════════════════════════ */

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

:root {
  /* ── Palet monokromatik + 1 aksen ────────── */
  --bg:           #f1f1ec;
  --surface:      #ffffff;
  --surface-2:    #f7f7f4;
  --ink:          #0e0e0c;
  --ink-soft:     #2a2a26;
  --ink-sub:      #6b6b65;
  --ink-muted:    #a8a8a0;
  --ink-faint:    #d4d4ce;

  /* Aksen tunggal — lime/sage */
  --accent:       #b8d65c;
  --accent-soft:  #d4e890;
  --accent-dark:  #6b8a23;
  --accent-deep:  #3e5414;

  /* Status colors */
  --warn:         #e87060;
  --warn-soft:    #fde4e0;

  /* Radius generous */
  --r-xl:  32px;
  --r-lg:  24px;
  --r-md:  18px;
  --r-sm:  12px;
  --r-pill: 999px;

  /* Soft shadows */
  --shadow-soft:  0 1px 2px rgba(0,0,0,.02), 0 8px 32px rgba(0,0,0,.04);
  --shadow-float: 0 2px 4px rgba(0,0,0,.02), 0 16px 48px rgba(0,0,0,.06);
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(14,14,12,.07) 1.2px, transparent 1.8px);
  background-size: 22px 22px;
  background-position: 0 0;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 400;
  min-height: 100dvh;
  padding: 0 0 120px;
  max-width: 430px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════
   TOP BAR
═══════════════════════════════════════════════ */
.topbar {
  background: var(--ink);
  margin: 18px 20px 0;
  border-radius: var(--r-pill);
  padding: 11px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.06);
  position: sticky;
  top: 12px;
  z-index: 1100;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .76rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: .005em;
}
.topbar-brand-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,214,92,.25);
  animation: blink 2.5s ease-in-out infinite;
}
.topbar-clock {
  font-size: .72rem;
  font-weight: 500;
  color: #8a8a85;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ═══════════════════════════════════════════════
   HEADER  — dashboard
═══════════════════════════════════════════════ */
.header {
  padding: 28px 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  flex-shrink: 0;
  width: 52px; height: 52px;
  background: var(--ink);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo svg { width: 24px; height: 24px; fill: var(--accent); }

.pipeline-info { flex: 1; min-width: 0; }
.pipeline-info h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: .72rem;
  color: var(--ink-sub);
  font-weight: 400;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-chip svg { stroke: var(--ink-muted); }
.meta-dot {
  width: 3px; height: 3px;
  background: var(--ink-muted);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Connection ball */
.conn-dot-wrap {
  flex-shrink: 0;
  position: relative;
}
.conn-ball {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background .4s, box-shadow .4s;
}
.conn-ball.on {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(184,214,92,.18);
  animation: ballPulse 2.5s ease-in-out infinite;
}
.conn-ball.off { background: var(--warn); }
@keyframes ballPulse {
  0%,100% { box-shadow: 0 0 0 5px rgba(184,214,92,.18); }
  50%      { box-shadow: 0 0 0 9px rgba(184,214,92,.05); }
}
.conn-ball-label { display: none; }

/* ═══════════════════════════════════════════════
   STATS
═══════════════════════════════════════════════ */
.stats-row { padding: 28px 20px 0; }
.stat-chip {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-soft);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 1.8; }
.stat-body { flex: 1; }
.stat-label {
  font-size: .65rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════
   EVENT STRIP
═══════════════════════════════════════════════ */
.event-strip {
  margin: 12px 20px 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-soft);
}
.event-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-strip-body { flex: 1; min-width: 0; }
.event-strip-label {
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 3px;
}
.event-strip-label.running   { color: var(--accent-dark); }
.event-strip-label.scheduled { color: var(--ink-sub); }
.event-strip-name {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════
   SECTION LABEL
═══════════════════════════════════════════════ */
.section-label {
  padding: 32px 24px 14px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
}

/* ═══════════════════════════════════════════════
   NODE GRID & CARD
═══════════════════════════════════════════════ */
.node-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 20px;
}
.node-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  position: relative;
}
.node-card:active {
  transform: scale(.985);
  box-shadow: var(--shadow-float);
}
.node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.node-name-badge {
  font-size: .68rem;
  font-weight: 600;
  color: var(--ink-sub);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-arrow {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.node-card.online .node-arrow { background: var(--accent); }
.node-arrow svg {
  width: 12px; height: 12px;
  stroke: #fff;
  stroke-width: 2.4;
}
.node-card.online .node-arrow svg { stroke: var(--ink); }

.psi-box {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 24px 8px 18px;
  text-align: center;
  transition: background .3s;
}
.node-card.online .psi-box {
  background: linear-gradient(160deg, #f5fae5 0%, #e9f3c8 100%);
}
.psi-number {
  font-size: 3.1rem;
  font-weight: 700;
  line-height: .95;
  color: var(--ink-muted);
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.node-card.online .psi-number { color: var(--accent-deep); }
.psi-unit {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .15em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-top: 6px;
}
.node-card.online .psi-unit { color: var(--accent-dark); }

.node-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.lamp {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}
.node-card.online .lamp {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,214,92,.2);
  animation: lampBlink 2.5s ease-in-out infinite;
}
.node-card.offline .lamp { background: var(--warn); }
@keyframes lampBlink {
  0%,100% { box-shadow: 0 0 0 3px rgba(184,214,92,.2); }
  50%      { box-shadow: 0 0 0 6px rgba(184,214,92,.05); }
}
.node-status-text {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.node-card.online  .node-status-text { color: var(--accent-dark); }
.node-card.offline .node-status-text { color: var(--warn); }

.node-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .6rem;
  color: var(--ink-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.node-meta-sep {
  width: 2px; height: 2px;
  background: var(--ink-faint);
  border-radius: 50%;
  flex-shrink: 0;
}
.battery {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.battery svg {
  width: 12px; height: 12px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}
.battery.good { color: var(--accent-dark); }
.battery.low  { color: var(--warn); }

.temp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-sub);
}
.temp svg {
  width: 11px; height: 11px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}
.temp.hot { color: var(--warn); }

/* ═══════════════════════════════════════════════
   SKELETON
═══════════════════════════════════════════════ */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, #ececea 25%, #f5f5f3 50%, #ececea 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.node-card-sk {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-soft);
}
.sk-badge { height: 14px; width: 60%; border-radius: 8px; }
.sk-box   { height: 118px; width: 100%; border-radius: var(--r-md); }
.sk-stat  { height: 12px; width: 50%; border-radius: 6px; margin: 0 auto; }

/* ═══════════════════════════════════════════════
   MAP CARD
═══════════════════════════════════════════════ */
.map-card {
  margin: 0 20px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 10px;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
#pipelineMap {
  width: 100%;
  height: 100%;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.map-controls {
  position: absolute;
  top: 18px; right: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 500;
  align-items: flex-end;
}
.map-select, .map-btn {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.map-select {
  font-size: .7rem;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230e0e0c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: rgba(255,255,255,.95);
  max-width: 160px;
}
.map-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 1rem;
  padding: 0;
}
.map-btn:active { transform: scale(.92); }
.map-btn[disabled] { pointer-events: none; }
.map-btn[data-busy] {
  opacity: .55;
  cursor: progress;
}
.map-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; }

.map-theme-group {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-radius: var(--r-pill);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  padding: 4px;
  gap: 2px;
}
.map-theme-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.map-theme-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 1.8;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.map-theme-btn.active {
  background: var(--ink);
  color: #ffffff;
}
.map-theme-btn:active { transform: scale(.9); }

.map-dot {
  display: block;
  border-radius: 50%;
  position: relative;
}
.map-dot.sensor {
  width: 14px; height: 14px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.map-dot.sensor.online {
  background: #22c55e;
  border-color: #ecfdf5;
  animation: mapPulse 1.8s ease-in-out infinite;
}
.map-dot.sensor.offline {
  background: var(--warn);
  animation: mapPulseRed 2s ease-in-out infinite;
}
.map-dot.empty {
  width: 6px; height: 6px;
  background: #fbbf24;
  border: 1px solid #fff;
  opacity: .85;
}
@keyframes mapPulse {
  0%,100% {
    box-shadow: 0 0 8px rgba(34,197,94,.75), 0 0 0 1px rgba(0,0,0,.1), 0 0 0 4px rgba(34,197,94,.45);
  }
  50% {
    box-shadow: 0 0 16px rgba(74,222,128,.6), 0 0 0 1px rgba(0,0,0,.1), 0 0 0 12px rgba(34,197,94,.06);
  }
}
@keyframes mapPulseRed {
  0%,100% { box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 0 0 3px rgba(232,112,96,.4); }
  50%      { box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 0 0 9px rgba(232,112,96,.05); }
}

.leaflet-tooltip {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: .65rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  white-space: nowrap;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before { display: none; }
.leaflet-tooltip.tooltip-offline { color: var(--warn); }
.leaflet-tooltip.tooltip-km      { color: var(--ink-sub); font-weight: 500; }

/* ═══════════════════════════════════════════════
   LOG ACTIVITY
═══════════════════════════════════════════════ */
.log-card {
  margin: 0 20px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 8px 0;
  max-height: 360px;
  overflow-y: auto;
}
.log-empty {
  text-align: center;
  padding: 36px 24px;
  color: var(--ink-muted);
  font-size: .8rem;
}
.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid #f0f0eb;
}
.log-entry:last-child { border-bottom: none; }
.log-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  background: var(--surface-2);
}
.log-icon.info    { background: #eaf3ff; color: #2563eb; }
.log-icon.warning { background: #fef5e0; color: #b45309; }
.log-icon.error   { background: #fde4e0; color: var(--warn); }
.log-body { flex: 1; min-width: 0; }
.log-message {
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}
.log-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: .62rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.log-type-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-sub);
  font-weight: 600;
  letter-spacing: .01em;
}

/* ═══════════════════════════════════════════════
   NODE DETAIL PAGE
═══════════════════════════════════════════════ */
/* Halaman detail: tidak ada bottom navbar → kurangi padding bawah */
body.page-detail { padding-bottom: 32px; }

/* ═══════════════════════════════════════════════
   MAP FULLSCREEN PAGE
═══════════════════════════════════════════════ */
body.page-map {
  padding: 0;
  overflow: hidden;       /* tidak ada scroll, map mengisi penuh */
}
.map-fullscreen-card {
  position: fixed;
  top: 78px;                              /* tepat di bawah topbar sticky */
  bottom: 96px;                           /* tepat di atas bottom navbar */
  left: 16px;
  right: 16px;
  max-width: 398px;
  margin: 0 auto;                          /* center kalau viewport > max-width */
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  overflow: hidden;
}

/* Sticky page header (back btn + title + conn ball) */
.detail-topbar {
  position: sticky;
  top: 70px;                /* tepat di bawah topbar yang sticky di 12px */
  z-index: 1050;            /* di bawah topbar (1100) tapi di atas konten */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin: 24px 0 0;
  background: rgba(241, 241, 236, 0.82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(14, 14, 12, .05);
}

.detail-page { padding: 20px 20px 0; }

/* deprecated — dipertahankan jaga-jaga kalau ada page lain pakai */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.detail-back {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.detail-back:active { transform: scale(.92); }
.detail-back svg {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 2.2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.detail-header-text { flex: 1; min-width: 0; }
.detail-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.015em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-subtitle {
  font-size: .72rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 4px;
  font-size: .72rem;
  color: var(--ink-sub);
  font-weight: 500;
}
.detail-status .lamp {
  width: 9px; height: 9px;
  flex-shrink: 0;
}
.detail-status.online .lamp {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,214,92,.2);
  animation: lampBlink 2.5s ease-in-out infinite;
}
.detail-status.offline .lamp { background: var(--warn); }
.detail-status.online  .detail-status-text { color: var(--accent-dark); font-weight: 700; }
.detail-status.offline .detail-status-text { color: var(--warn);        font-weight: 700; }

.detail-cards {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 12px;
}
.detail-psi-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 200px;
  background-image: linear-gradient(160deg, #ffffff 0%, var(--surface-2) 100%);
  transition: background-image .3s;
}
.detail-status.online ~ .detail-cards .detail-psi-card {
  background-image: linear-gradient(160deg, #f5fae5 0%, #e9f3c8 100%);
}
.detail-card-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
}
.detail-status.online ~ .detail-cards .detail-card-label { color: var(--accent-dark); }
.detail-psi-number {
  font-size: 3.6rem;
  font-weight: 800;
  line-height: .92;
  color: var(--ink-muted);
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.detail-status.online ~ .detail-cards .detail-psi-number { color: var(--accent-deep); }
.detail-psi-unit {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-top: 8px;
}
.detail-status.online ~ .detail-cards .detail-psi-unit { color: var(--accent-dark); }

.detail-side-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-mini-card {
  flex: 1;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-mini-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-sub);
}
.detail-mini-icon svg {
  width: 16px; height: 16px;
  stroke: currentColor; stroke-width: 1.8;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.detail-mini-text { min-width: 0; flex: 1; }
.detail-mini-label {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1;
  margin-bottom: 4px;
}
.detail-mini-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ─── Chart card (di halaman detail node) ─── */
.chart-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 16px 14px 12px;
  margin-top: 16px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chart-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.chart-range-btns {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 999px;
}
.chart-range-btns button {
  font-size: .62rem;
  font-weight: 700;
  padding: 5px 9px;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: var(--ink-sub);
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.chart-range-btns button.active {
  background: var(--ink);
  color: #fff;
}
.chart-dl-btns {
  display: flex;
  gap: 4px;
}
.chart-dl-btn {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 5px 10px;
  border: 1.5px solid var(--ink-faint);
  background: var(--surface);
  color: var(--ink-sub);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: border-color .15s, color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.chart-dl-btn::before {
  content: '';
  width: 11px; height: 11px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>") center/contain no-repeat;
}
.chart-dl-btn:hover { border-color: var(--accent-dark); color: var(--accent-deep); }
.chart-dl-btn:active { transform: scale(.95); }
.chart-canvas {
  width: 100%;
  height: 280px;
}
.chart-meta {
  font-size: .58rem;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 6px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.chart-empty {
  text-align: center;
  padding: 60px 16px;
  color: var(--ink-muted);
  font-size: .8rem;
}

/* ─── Sticky Action Bar — gaya navbar pill melayang ─── */
.detail-actionbar {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-radius: 36px;
  box-shadow:
    0 10px 32px rgba(0,0,0,.12),
    0 2px 6px rgba(0,0,0,.06),
    inset 0 0 0 1px rgba(255,255,255,.5);
}
.action-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-sub);
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  transition: transform .15s;
}
.action-btn:active { transform: scale(.92); }
.action-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.action-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s ease, color .25s ease;
}
.action-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.action-label {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;
  color: var(--ink-sub);
  transition: color .2s;
}

/* Export — selalu aktif (ikon gelap) */
.action-btn--export .action-icon {
  background: var(--ink);
  color: #fff;
}
.action-btn--export svg { stroke-width: 2; }
.action-btn--export .action-label { color: var(--ink); font-weight: 700; }

/* Maps — aktif hanya bila koordinat tersedia */
.action-btn--maps:not(:disabled) .action-icon {
  background: var(--ink);
  color: #fff;
}
.action-btn--maps:not(:disabled) svg { stroke-width: 2; }
.action-btn--maps:not(:disabled) .action-label { color: var(--ink); font-weight: 700; }

/* Beri ruang bawah agar konten tidak tertutup action bar */
.detail-page { padding-bottom: 96px; }

/* ─── Modal / bottom sheet ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 12, .45);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-overlay[hidden] { display: none; }

.modal-sheet {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 22px 28px;
  animation: slideUp .25s ease-out;
  max-height: 90dvh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--ink-faint);
  border-radius: 2px;
  margin: -8px auto 16px;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.modal-sub {
  font-size: .72rem;
  color: var(--ink-muted);
  margin-bottom: 20px;
}

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-sub);
  margin-bottom: 6px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-input, .form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--ink-faint);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--ink);
}
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230e0e0c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.estimate-hint {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: .72rem;
  color: var(--ink-sub);
  margin: 12px 0 4px;
  line-height: 1.4;
}
.estimate-hint.warn {
  background: rgba(232,112,96,.1);
  color: var(--warn);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.btn-primary, .btn-secondary {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .01em;
  transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active, .btn-secondary:active { transform: scale(.97); }
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--ink-sub);
}

/* ═══════════════════════════════════════════════
   BOTTOM NAVBAR
═══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-radius: 36px;
  box-shadow:
    0 10px 32px rgba(0,0,0,.12),
    0 2px 6px rgba(0,0,0,.06),
    inset 0 0 0 1px rgba(255,255,255,.5);
}
.nav-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--ink-sub);
  border-radius: 18px;
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
  min-width: 56px;
  text-decoration: none;
}
.nav-btn:active { transform: scale(.92); }
.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s ease, color .25s ease;
}
.nav-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-label {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;
  color: var(--ink-sub);
  transition: color .2s, font-weight .2s;
}
.nav-btn.active .nav-icon {
  background: var(--ink);
  color: #ffffff;
}
.nav-btn.active svg { stroke-width: 2; }
.nav-btn.active .nav-label {
  color: var(--ink);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   ADMIN PAGE — Node Management
═══════════════════════════════════════════════ */
.admin-header {
  padding: 24px 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admin-title-block { flex: 1; min-width: 0; }
.admin-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.admin-subtitle {
  font-size: .68rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 3px;
}
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: .7rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  cursor: pointer;
  letter-spacing: .01em;
  transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-add:active { transform: scale(.96); }
.btn-add svg {
  width: 13px; height: 13px;
  stroke: currentColor; stroke-width: 2.4;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

.admin-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-node-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity .25s;
}
.admin-node-card.inactive { opacity: .55; }
.admin-node-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
}
.admin-status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,214,92,.2);
}
.admin-status-dot.offline { background: var(--warn); }

.admin-node-info { flex: 1; min-width: 0; }
.admin-node-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-node-id {
  font-size: .65rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.admin-node-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: .62rem;
  color: var(--ink-sub);
  font-weight: 500;
}
.admin-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 999px;
}
.admin-meta-chip svg {
  width: 10px; height: 10px;
  stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

.admin-node-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid #f0f0eb;
}
.btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--ink-faint);
  background: var(--surface);
  color: var(--ink-sub);
  font-family: inherit;
  font-size: .68rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  cursor: pointer;
  letter-spacing: .01em;
  transition: border-color .15s, color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn-edit:hover { border-color: var(--ink-sub); color: var(--ink); }
.btn-edit:active { transform: scale(.96); }
.btn-edit svg {
  width: 12px; height: 12px;
  stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* Toggle switch — iOS style */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ink-faint);
  border-radius: 22px;
  cursor: pointer;
  transition: background .25s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}
.toggle-switch input:disabled + .toggle-slider {
  cursor: progress;
  opacity: .6;
}

.admin-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-muted);
  font-size: .82rem;
}

/* ─── Admin Tabs ─── */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 999px;
  margin: 0 20px 14px;
}
.admin-tabs button {
  flex: 1;
  font-family: inherit;
  font-size: .68rem;
  font-weight: 700;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: var(--ink-sub);
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.admin-tabs button.active {
  background: var(--ink);
  color: #fff;
}
.admin-tabs button:active { transform: scale(.96); }

/* ─── Event filter pills (sub-toolbar) ─── */
.event-filter-pills {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.event-filter-pills::-webkit-scrollbar { display: none; }
.event-filter-pills button {
  flex-shrink: 0;
  font-family: inherit;
  font-size: .65rem;
  font-weight: 600;
  padding: 6px 12px;
  border: 1.5px solid var(--ink-faint);
  background: var(--surface);
  color: var(--ink-sub);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.event-filter-pills button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ─── Status badge ─── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-badge.scheduled { background: #eaf3ff; color: #2563eb; }
.status-badge.running   { background: #dcfce7; color: var(--accent-dark); }
.status-badge.completed { background: var(--surface-2); color: var(--ink-sub); }
.status-badge.cancelled { background: var(--warn-soft); color: var(--warn); }
.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ─── Event card extras ─── */
.admin-event-emoji {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--warn-soft);
  background: var(--surface);
  color: var(--warn);
  font-family: inherit;
  font-size: .68rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  cursor: pointer;
  letter-spacing: .01em;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-danger:hover {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.btn-danger:active { transform: scale(.96); }
.btn-danger svg {
  width: 12px; height: 12px;
  stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── Skip list ─── */
.skip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  max-height: 200px;
  overflow-y: auto;
}
.skip-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: .72rem;
}
.skip-list-item-info { flex: 1; min-width: 0; }
.skip-list-item-date {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.skip-list-item-reason {
  font-size: .65rem;
  color: var(--ink-muted);
  margin-top: 2px;
}
.skip-list-item button {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--warn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.skip-list-item button:hover { background: var(--warn-soft); }
.skip-list-item button svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.skip-list-empty {
  text-align: center;
  padding: 18px;
  color: var(--ink-muted);
  font-size: .72rem;
  font-style: italic;
}

/* ═══════════════════════════════════════════════
   ACTIVITY PAGE — Timeline Log
═══════════════════════════════════════════════ */

/* ── Kalender ── */
.cal-wrap {
  margin: 16px;
  padding: 18px 18px 14px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-month-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.cal-nav-btn {
  width: 32px; height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.cal-nav-btn:active { transform: scale(.9); }
.cal-nav-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2.2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-header {
  text-align: center;
  font-size: .6rem;
  font-weight: 700;
  color: var(--ink-sub);
  letter-spacing: .03em;
  padding-bottom: 4px;
  text-transform: uppercase;
}
.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0;
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.cal-cell:empty { cursor: default; }
.cal-cell.other-month .cal-cell-num {
  opacity: .3;
}
.cal-cell-num {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.cal-cell.today .cal-cell-num {
  border: 2px solid var(--accent);
  color: var(--ink);
}
.cal-cell.selected .cal-cell-num {
  background: var(--ink);
  color: #fff;
  border: none;
}
.cal-cell.today.selected .cal-cell-num {
  background: var(--ink);
  color: #fff;
  border: none;
}
.cal-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .2s;
}
.cal-cell.has-log .cal-dot { opacity: 1; }
.cal-cell.selected .cal-dot { background: #fff; opacity: 0; }

/* ── Divider tanggal ── */
.act-date-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 0;
}
.act-date-strip-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--ink-sub);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.act-date-strip-line {
  flex: 1;
  height: 1px;
  background: var(--ink-faint);
}

/* ── Timeline ── */
.timeline-wrap {
  padding: 0 20px 110px;
  position: relative;
}
/* Garis vertikal */
.timeline-wrap::before {
  content: '';
  position: absolute;
  left: 56px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--ink-faint) 40px, var(--ink-faint) calc(100% - 40px), transparent);
}
.tl-entry {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 6px 0;
  position: relative;
}
.tl-time {
  width: 36px;
  flex-shrink: 0;
  text-align: right;
  font-size: .62rem;
  font-weight: 600;
  color: var(--ink-sub);
  line-height: 28px;
  letter-spacing: -.01em;
}
/* Dot pada garis */
.tl-dot-col {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--ink-faint);
  transition: background .2s;
  position: relative;
  z-index: 1;
}
.tl-entry.level-info    .tl-dot { background: var(--accent); }
.tl-entry.level-warning .tl-dot { background: #f59e0b; }
.tl-entry.level-error   .tl-dot { background: var(--warn); }

/* Card log */
.tl-card {
  flex: 1;
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  min-width: 0;
}
.tl-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}
.tl-type-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tl-type-icon svg {
  width: 12px; height: 12px;
  stroke: currentColor; stroke-width: 2.2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
/* Icon warna per level */
.tl-entry.level-info    .tl-type-icon { background: rgba(184,214,92,.2);  color: #4a6010; }
.tl-entry.level-warning .tl-type-icon { background: rgba(245,158,11,.15); color: #b45309; }
.tl-entry.level-error   .tl-type-icon { background: rgba(232,112,96,.15); color: #c0392b; }

.tl-type-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-sub);
}
.tl-message {
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
.tl-meta {
  margin-top: 4px;
  font-size: .62rem;
  color: var(--ink-sub);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tl-meta-chip {
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Hour separator */
.tl-hour-sep {
  display: flex;
  align-items: center;
  padding: 12px 0 4px;
}
.tl-hour-label {
  width: 36px;
  flex-shrink: 0;
  text-align: right;
  font-size: .6rem;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: .02em;
}
.tl-hour-line {
  flex: 1;
  margin-left: 36px;
  height: 1px;
  background: var(--ink-faint);
  opacity: .5;
}

/* Empty state */
.act-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--ink-muted);
  text-align: center;
}
.act-empty svg {
  width: 40px; height: 40px;
  stroke: var(--ink-faint); stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  opacity: .6;
}
.act-empty-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-sub);
}
.act-empty-sub {
  font-size: .75rem;
  color: var(--ink-muted);
}

/* ═══════════════════════════════════════════════════
   Analisis Kebocoran — leak detection cards
   ═══════════════════════════════════════════════════ */
.leak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 0 16px;
}
.leak-card-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--ink-muted);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  margin: 0 16px;
  font-size: .82rem;
}
.leak-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--ink-faint);
  transition: box-shadow .25s, background .25s, border-color .2s;
}
.leak-card.leak-state-normal    { border-left-color: var(--accent-dark); }
.leak-card.leak-state-warning   { border-left-color: #d9a441; background: linear-gradient(0deg, #fffaf0, var(--surface)); }
.leak-card.leak-state-leak      { border-left-color: var(--warn); background: linear-gradient(0deg, var(--warn-soft), var(--surface)); animation: leak-pulse 2s infinite; }
.leak-card.leak-state-recovered { border-left-color: #5b8def; background: linear-gradient(0deg, #eef3fd, var(--surface)); }
@keyframes leak-pulse {
  0%,100% { box-shadow: var(--shadow-soft); }
  50%     { box-shadow: var(--shadow-soft), 0 0 0 3px rgba(232,112,96,.18); }
}

.leak-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.leak-card-title {
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: -.01em;
  color: var(--ink);
}
.leak-badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  text-transform: uppercase;
}
.leak-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.leak-op-chip {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  text-transform: capitalize;
  white-space: nowrap;
}
.leak-fault-chip {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  white-space: nowrap;
  border: 1px solid #fde68a;
}
.leak-card.has-fault {
  border-left-color: #d97706 !important;
  background: repeating-linear-gradient(
    45deg, #fffbeb, #fffbeb 8px, #fff 8px, #fff 16px
  );
}

.leak-badge.leak-state-normal    { background:#dcfce7; color:#15803d; }
.leak-badge.leak-state-warning   { background:#fef3c7; color:#92400e; }
.leak-badge.leak-state-leak      { background:#fecaca; color:#991b1b; }
.leak-badge.leak-state-recovered { background:#dbeafe; color:#1e40af; }

.leak-score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.leak-score-val {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.leak-score-lbl {
  font-size: .72rem;
  color: var(--ink-muted);
}

.leak-bar {
  height: 7px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.leak-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark) 0%, #d9a441 55%, var(--warn) 100%);
  transition: width .4s ease;
}

.leak-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: .78rem;
}
.leak-meta > div {
  display: flex;
  flex-direction: column;
}
.leak-meta span {
  color: var(--ink-muted);
  font-size: .68rem;
}
.leak-meta b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.leak-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid #f0f0eb;
}
.leak-feat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.leak-feat span {
  font-size: .6rem;
  color: var(--ink-muted);
  letter-spacing: .02em;
}
.leak-feat b {
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ── Event history list ─────────────────────────── */
.leak-events-card {
  margin: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leak-event-row {
  background: var(--surface);
  border-left: 4px solid var(--ink-faint);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leak-event-row.leak-state-leak      { border-left-color: var(--warn); }
.leak-event-row.leak-state-recovered { border-left-color: #5b8def; }
.leak-event-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.leak-event-node {
  font-weight: 700;
  font-size: .88rem;
  color: var(--ink);
}
.leak-event-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  font-size: .75rem;
}
.leak-event-meta > div {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  padding: 7px 9px;
  border-radius: var(--r-sm);
}
.leak-event-meta span {
  color: var(--ink-muted);
  font-size: .62rem;
}
.leak-event-meta b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
}

/* Action buttons di tiap row event — selaras dengan .btn-edit di admin */
.leak-event-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #f0f0eb;
}
.leak-evt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--ink-faint);
  background: var(--surface);
  color: var(--ink-sub);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.leak-evt-btn:active:not(:disabled) { transform: scale(.96); }
.leak-evt-btn:disabled { opacity: .45; cursor: not-allowed; }
.leak-evt-resolve:hover:not(:disabled) { border-color: var(--accent-dark); color: var(--accent-deep); }
.leak-evt-monitor:hover:not(:disabled) { border-color: #5b8def; color: #2456b8; }
.leak-evt-delete {
  color: var(--warn);
  border-color: var(--warn-soft);
}
.leak-evt-delete:hover:not(:disabled) {
  border-color: var(--warn);
  background: var(--warn-soft);
}

/* Status event tambahan: belum dicek (kuning), dipantau (biru), selesai (abu/hijau) */
.leak-event-row.leak-state-unverified { border-left-color: #f59e0b; }
.leak-event-row.leak-state-monitoring { border-left-color: #3b82f6; }
.leak-event-row.leak-state-resolved   { border-left-color: #94a3b8; }

.leak-badge.leak-state-unverified { background:#fef3c7; color:#92400e; }
.leak-badge.leak-state-monitoring { background:#dbeafe; color:#1e40af; }
.leak-badge.leak-state-resolved   { background:#e2e8f0; color:#475569; }

/* Highlight halus untuk yang butuh perhatian operator */
.leak-event-row.leak-state-unverified {
  background: linear-gradient(0deg, #fffbeb, #fff);
}


/* ── Live duration sub-title under node id ──────── */
.leak-card-dur {
  font-size: .68rem;
  font-weight: 400;
  color: var(--ink-muted, #64748b);
  margin-top: 2px;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

/* ── Sparkline strip ────────────────────────────── */
.leak-spark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.leak-spark {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.leak-spark-lbl {
  font-size: .6rem;
  color: var(--ink-muted);
  letter-spacing: .02em;
}
.leak-spark canvas {
  width: 100%;
  height: 36px;
  display: block;
}

/* ── Toggle / expand button ─────────────────────── */
.leak-card-toggle {
  margin-top: 2px;
  padding: 8px 14px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink-sub);
  background: var(--surface);
  border: 1.5px solid var(--ink-faint);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: border-color .15s, color .15s, transform .12s;
}
.leak-card-toggle:hover { border-color: var(--ink-sub); color: var(--ink); }
.leak-card-toggle:active { transform: scale(.97); }
.leak-card.is-expanded .leak-card-toggle {
  background: var(--surface-2);
  color: var(--ink);
}
.leak-card.is-expanded {
  box-shadow: var(--shadow-float);
}

/* ── Event filter dropdown ──────────────────────── */
.leak-events-filter {
  display: flex;
  margin-bottom: 4px;
}
.leak-filter-select {
  width: auto;
  min-width: 180px;
  padding: 9px 38px 9px 14px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink);
  background-color: var(--surface);
  border: 1.5px solid var(--ink-faint);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: border-color .15s;
}
.leak-filter-select:hover { border-color: var(--ink-sub); }
.leak-filter-select:focus { outline: none; border-color: var(--accent-dark); }

/* ── Grafik multi-node legend chips ─────────────── */
.grafik-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 6px;
}
.grafik-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: .76rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e6e8eb);
  color: var(--ink, #0f172a);
  cursor: pointer;
  transition: all .18s ease;
  letter-spacing: .005em;
}
.grafik-chip small {
  font-size: .65rem;
  color: var(--ink-muted, #94a3b8);
  font-weight: 500;
  padding-left: 2px;
}
.grafik-chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,0,0,.05);
  transition: box-shadow .2s;
}
.grafik-chip:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15,23,42,.06);
}
.grafik-chip:hover .grafik-chip-dot {
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.grafik-chip.is-off {
  opacity: .35;
  background: transparent;
  border-style: dashed;
}
.grafik-chip.is-off .grafik-chip-dot { filter: grayscale(1); opacity: .5; }
.grafik-chip.is-off:hover { opacity: .55; }

/* ── Stylish chart card overrides untuk halaman grafik ─── */
body:has(#grafikLegend) .chart-card {
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.04);
  border: 1px solid #eef0f2;
  margin: 16px;
  overflow: hidden;
  padding: 4px 0 12px;
}
body:has(#grafikLegend) .chart-header {
  padding: 14px 18px 6px;
}
body:has(#grafikLegend) .chart-title {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #0f172a;
}
body:has(#grafikLegend) .chart-range-btns button {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
body:has(#grafikLegend) .chart-range-btns button:hover {
  color: #0f172a;
  background: #f1f5f9;
}
body:has(#grafikLegend) .chart-range-btns button.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
body:has(#grafikLegend) .chart-meta {
  padding: 4px 18px 8px;
  font-size: .7rem;
  color: #94a3b8;
  letter-spacing: .02em;
}

/* ═══════════════════════════════════════════════
   DESKTOP RESPONSIVE — pelebaran progresif
   Mobile (<768px) tidak terpengaruh sama sekali.
═══════════════════════════════════════════════ */
@media (min-width: 768px) {
  body                  { max-width: 720px; }
  .modal-sheet          { max-width: 560px; }
  .map-fullscreen-card  { max-width: 688px; }
}

@media (min-width: 1200px) {
  body                  { max-width: 960px; }
  .modal-sheet          { max-width: 640px; }
  .map-fullscreen-card  { max-width: 928px; }
}

@media (min-width: 1600px) {
  body                  { max-width: 1120px; }
  .map-fullscreen-card  { max-width: 1088px; }
}
