:root {
  --bg: #050816;
  --card: #0b1120;
  --card-soft: #020617;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.25);
  --accent-strong: #16a34a;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --radius-xl: 20px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  background: radial-gradient(circle at top left, #0f172a, #020617 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
}

.dashboard {
  width: 100%;
  max-width: 1180px;
  background: linear-gradient(145deg, #020617, #020617ee);
  border-radius: 26px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
  padding: 24px 26px 26px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  backdrop-filter: blur(16px);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 16px;
}

header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

header span.sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 0.78rem;
}

.badge-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.3);
  animation: pulse-dot 1.6s infinite ease-out;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 18px;
}

.card {
  background: radial-gradient(circle at top left, #020617, #020617f2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 18px 20px 20px;
}

.card h2 {
  font-size: 0.92rem;
  text-transform: uppercase;
  color: var(--text-muted);

  margin-bottom: 10px;
}

/* ================= GAUGE ================= */

.gauge-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 12px;
}

.gauge {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
}

.gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  stroke: rgba(15, 23, 42, 0.85);
  stroke-width: 16;
}

.gauge-track {
  stroke: rgba(30, 64, 175, 0.6);
  stroke-width: 16;
  stroke-linecap: round;
  filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.55));
}

.gauge-fill {
  stroke: url(#gaugeGradient);
  stroke-width: 16;
  stroke-linecap: round;
  filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.9));
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.gauge-inner {
  position: absolute;
  width: 64%;
  height: 64%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 15%, #4ade80, #16a34a 55%, #166534);
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.35),
    0 25px 45px rgba(6, 95, 70, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ecfdf5;
}

.gauge-inner-value {
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.gauge-inner-unit {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 2px;
}

.gauge-status {
  margin-top: 6px;
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  color: #bbf7d0;
  border: 1px solid rgba(187, 247, 208, 0.45);
}

.gauge-desc {
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ================= PLANTS ================= */

.plants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.plant-item {
  padding: 10px 12px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #020617, var(--card-soft));
  border: 1px solid rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease,
    transform 0.12s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.plant-item:hover {
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-1px);
}

.plant-item.active {
  background: radial-gradient(circle at top left, var(--accent-soft), #16a34a);
  color: #ecfdf5;
  border-color: rgba(22, 163, 74, 0.9);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.8),
    0 18px 32px rgba(21, 128, 61, 0.6);
}

.plant-item span.name {
  font-weight: 500;
}

.plant-item span.value {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* ================= STATUS ================= */

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.status-pill {
  background: radial-gradient(circle at top left, #020617, #020617f5);
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(30, 64, 175, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
}

.status-pill-label {
  color: var(--text-muted);
}

.status-pill-main {
  font-size: 0.86rem;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 6px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.45);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.45);
}

.status-extra {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.status-extra.center {
  justify-content: space-between;
  margin-bottom: 4px;
}

.status-extra.small {
  font-size: 0.72rem;
}

.status-extra span.value {
  color: var(--accent);
  font-weight: 600;
}

/* Volume bar */

.volume-section {
  margin-top: 6px;
  margin-bottom: 10px;
}

.volume-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  overflow: hidden;
}

.volume-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.8);
  transition: width 0.4s ease;
}

/* Tombol penyiraman */

.water-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.water-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.water-btn.start-btn {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #ecfdf5;
  box-shadow: 0 12px 25px rgba(22, 163, 74, 0.6);
}

.water-btn.stop-btn {
  background: linear-gradient(90deg, #fb7185, #ef4444);
  color: #fef2f2;
  box-shadow: 0 12px 25px rgba(220, 38, 38, 0.6);
}

.water-btn.ghost-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.water-btn:hover {
  transform: translateY(-1px);
}

.water-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* History */

.history-section {
  margin-top: 4px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.history-note {
  font-size: 0.72rem;
}

.history-list {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(30, 64, 175, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.history-item-value {
  font-weight: 600;
}

.history-item-time {
  color: var(--text-muted);
  font-size: 0.74rem;
}

/* Modal */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 50;
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: #020617;
  margin: 15% auto;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  width: 90%;
  max-width: 360px;
  border-radius: 18px;
  color: var(--text);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
  font-size: 0.9rem;
}

.modal-close-btn {
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #ecfdf5;
}

/* ================= SLIDER VOLUME DI BAWAH GAUGE ================= */

.slider-group {
  margin-top: 12px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.slider-label-row span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#volumeSlider {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  outline: none;
  opacity: 0.9;
}

#volumeSlider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f9fafb;
  border: 2px solid #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.28);
  cursor: default;
  margin-top: -5px;
}

#volumeSlider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f9fafb;
  border: 2px solid #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.28);
  cursor: default;
}

#volumeSlider:disabled {
  cursor: default;
}

/* Responsive */

@media (max-width: 880px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .gauge {
    width: 190px;
    height: 190px;
  }
}
/* =========================================================
   LOGIN PAGE (SESUAI TEMA DASHBOARD)
   ========================================================= */

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #0f172a, #020617 55%);
  color: var(--text);
  padding: 24px;
}

/* Card Login */
.login-page form {
  width: 100%;
  max-width: 420px;
  background: radial-gradient(circle at top left, #020617, #020617f2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 26px 26px 28px;
  position: relative;
  backdrop-filter: blur(14px);
  animation: loginFade 0.6s ease;
}

@keyframes loginFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Avatar */
.login-page .imgcontainer {
  display: flex;
  justify-content: center;
  margin-top: -70px;
  margin-bottom: 18px;
}

.login-page .avatar {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  border: 6px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  background: #020617;
}

/* Container form */
.login-page .container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Label */
.login-page label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Input */
.login-page input[type='text'],
.login-page input[type='password'] {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-page input::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.login-page input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

/* Tombol Login */
.login-page button {
  margin-top: 10px;
  padding: 12px;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #ecfdf5;
  box-shadow: 0 12px 25px rgba(22, 163, 74, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.login-page button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.login-page button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Checkbox */
.login-page .container > label {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.login-page input[type='checkbox'] {
  accent-color: var(--accent);
}

/* Responsive Login */
@media (max-width: 480px) {
  .login-page form {
    padding: 20px;
  }

  .login-page .avatar {
    width: 96px;
    height: 96px;
  }
}
