:root {
  --bg1: #f9c7da; /* untuk latar website */
  --bgBody2: #f6b9d4; /* warna kedua gradient website */
  --card: #ffeaf3; /* untuk latar fitur/panel */
  --card2: #fff3f8; /* untuk latar fitur/panel */
  --ink: #7b1237;
  --muted: #a93a63;
  --accent: #ec4b93;
  --accent2: #ff75b2;
  --border: rgba(236, 75, 147, 0.25);
  --shadow: 0 18px 60px rgba(123, 18, 55, 0.16);
  --radius: 22px;
  --radius2: 16px;
  --ring: rgba(236, 75, 147, 0.25);
  --patternOpacity: 0.18;
  --containerMax: 1020px;
  --bgBody2: #f6b9d4; /* otomatis di-set dari bg1 lewat JS */
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;

  background: radial-gradient(
      1200px 700px at 20% 20%,
      rgba(255, 255, 255, 0.35),
      transparent 60%
    ),
    radial-gradient(
      1000px 700px at 80% 10%,
      rgba(255, 255, 255, 0.25),
      transparent 60%
    ),
    linear-gradient(135deg, var(--bg1), var(--bgBody2));
}

/* pattern overlay */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
      circle at 14px 14px,
      rgba(255, 255, 255, 0.55) 2px,
      transparent 2.5px
    ),
    radial-gradient(
      circle at 0 0,
      rgba(255, 255, 255, 0.25) 1px,
      transparent 2px
    ),
    radial-gradient(
      900px 550px at 35% 85%,
      rgba(255, 255, 255, 0.25),
      transparent 70%
    );
  background-size: 42px 42px, 26px 26px, auto;
  opacity: var(--patternOpacity);
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(var(--containerMax), 92vw);
  margin: 38px auto 26px;
}

.panel {
  background: linear-gradient(180deg, var(--card) 0%, var(--card2) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  backdrop-filter: blur(6px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 10px 6px;
  border-bottom: 1px solid rgba(236, 75, 147, 0.18);
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.18s ease;
  user-select: none;
}
.tab:hover {
  background: rgba(236, 75, 147, 0.1);
}
.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 22px rgba(236, 75, 147, 0.22);
}

.content {
  padding: 18px 8px 6px;
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .decor {
    display: none;
  }
}

.title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink);
  margin: 4px 0 14px;
}
.subtitle {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  margin: 6px 0 14px;
  text-align: center;
}

.card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(236, 75, 147, 0.16);
  border-radius: var(--radius2);
  padding: 14px;
}

.row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
label {
  font-weight: 800;
  color: var(--ink);
}
.hint {
  font-size: 12px;
  color: rgba(123, 18, 55, 0.75);
  line-height: 1.35;
}

input,
select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(236, 75, 147, 0.2);
  background: rgba(255, 255, 255, 0.55);
  outline: none;
  font-size: 14px;
  color: var(--ink);
}
input::placeholder {
  color: rgba(123, 18, 55, 0.45);
}
input:focus,
select:focus {
  border-color: rgba(236, 75, 147, 0.5);
  box-shadow: 0 0 0 4px rgba(236, 75, 147, 0.12);
}

/* === RANGE STYLE (FULL COLOR) === */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  background: var(--range-bg, #ddd); /* akan di-set via JS */
  outline: none;
  border: 1px solid rgba(236, 75, 147, 0.25);
}

/* track */
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: transparent;
}
input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: transparent;
}

/* thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  margin-top: -5px; /* align thumb to track */
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.sliderLine {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.sliderLine input[type="range"] {
  flex: 1;
}
.pill {
  min-width: 64px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(236, 75, 147, 0.1);
  border: 1px solid rgba(236, 75, 147, 0.2);
  font-weight: 900;
  color: var(--ink);
}

.btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: var(--accent);
  color: white;
  font-weight: 900;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(236, 75, 147, 0.2);
  transition: 0.16s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0px);
  opacity: 0.92;
}

.resultWrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.resultTitle {
  font-weight: 1000;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 6px;
}
.resultValue {
  font-size: 40px;
  font-weight: 1000;
  color: var(--ink);
  line-height: 1.05;
  margin: 2px 0 4px;
}
.smallValue {
  font-size: 13px;
  color: rgba(123, 18, 55, 0.75);
  font-weight: 700;
}

.donut {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--ring) 0);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(236, 75, 147, 0.16);
}
.donut span {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(236, 75, 147, 0.12);
  display: grid;
  place-items: center;
  font-weight: 1000;
  color: var(--ink);
}

.divider {
  height: 1px;
  width: 100%;
  background: rgba(236, 75, 147, 0.18);
  margin: 10px 0 12px;
}

.footer {
  text-align: center;
  font-size: 12px;
  color: rgba(123, 18, 55, 0.75);
  padding: 12px 0 22px;
}

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(236, 75, 147, 0.22);
  background: rgba(255, 255, 255, 0.55);
}

.settingsBtn {
  border: 1px solid rgba(236, 75, 147, 0.2);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 14, 0.38);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 18px;
}
.modal.show {
  display: flex;
}
.modalCard {
  width: min(640px, 96vw);
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid rgba(236, 75, 147, 0.22);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px;
}
.modalTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modalTop h3 {
  margin: 0;
  font-weight: 1000;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.closeBtn {
  border: 0;
  background: rgba(236, 75, 147, 0.12);
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 1000;
  cursor: pointer;
}

/* calendar */
.calHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.calTitle {
  font-weight: 1000;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  flex: 1;
}
.iconBtn {
  width: 44px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(236, 75, 147, 0.2);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-weight: 1000;
  color: var(--ink);
}
.calGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.dow {
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  color: rgba(123, 18, 55, 0.75);
  padding: 6px 0;
}
.day {
  padding: 12px 0;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(236, 75, 147, 0.1);
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: 0.12s ease;
}
.day:hover {
  background: rgba(236, 75, 147, 0.1);
}
.day.muted {
  opacity: 0.35;
  cursor: default;
}
.day.selected {
  background: var(--accent);
  color: #fff;
  border-color: rgba(236, 75, 147, 0.3);
  box-shadow: 0 10px 18px rgba(236, 75, 147, 0.18);
  font-weight: 1000;
}
