:root {
  --bg: #06080d;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f5f7fb;
  --muted: rgba(245, 247, 251, 0.58);
  --green: #34f5a6;
  --green-soft: rgba(52, 245, 166, 0.18);
  --blue: #8fb8ff;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(67, 105, 255, 0.22), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(52, 245, 166, 0.13), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  max-width: 1480px;
  margin: auto;
  padding: 32px;
}

h1, h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 { font-size: clamp(2rem, 4vw, 4rem); }
h2 { font-size: 1.35rem; }

.eyebrow, .card-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted, .message { color: var(--muted); }

.login-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}

.login-card { width: min(480px, 100%); }

.glass-card, .card {
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.045)), rgba(255,255,255,0.035);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(28px);
  padding: 22px;
  margin-bottom: 18px;
}

.topbar, .section-header, .battery-row, .metric-row, .hero-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar { margin-bottom: 22px; }
.topbar-actions, .hero-actions { display: flex; align-items: center; gap: 10px; }

.add-menu { position: relative; display: inline-block; }
.add-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(3,7,18,0.88);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  border-radius: 12px;
  padding: 8px;
  z-index: 60;
  min-width: 160px;
}
.add-menu-dropdown button { display: block; width: 100%; text-align: left; padding: 8px 10px; margin: 4px 0; border-radius: 10px; }
.add-menu-dropdown button:hover { background: rgba(255,255,255,0.03); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  backdrop-filter: blur(24px);
  white-space: nowrap;
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.status-pill.charging {
  color: var(--green);
  border-color: rgba(52,245,166,0.35);
  background: var(--green-soft);
}

.status-pill.charging span { background: var(--green); box-shadow: 0 0 18px var(--green); }
.status-pill.disconnected { color: var(--red); }
.status-pill.disconnected span { background: var(--red); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.main-stack {
  display: grid;
  gap: 14px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-plain {
  margin-top: -12px;
}

.hero-background-glow {
  position: absolute;
  inset: auto 12% 0;
  height: 300px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(143,184,255,0.3), transparent 70%);
  filter: blur(20px);
}

.car-stage {
  position: relative;
  height: 410px;
}

.vehicle-model {
  position: absolute;
  left: 50%;
  bottom: 48px;
  width: min(640px, 78%);
  height: 220px;
  transform: translateX(-50%);
  transition: filter 0.25s ease;
}

.vehicle-model.is-charging { filter: drop-shadow(0 0 18px rgba(52,245,166,0.18)); }

.car-roof {
  position: absolute;
  left: 22%;
  top: 18px;
  width: 56%;
  height: 95px;
  border-radius: 70px 70px 20px 20px;
  background: linear-gradient(180deg, #2c3446, #121722);
  transform: perspective(520px) rotateX(18deg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
}

.car-glass {
  position: absolute;
  top: 42px;
  height: 52px;
  background: linear-gradient(180deg, #11192a, #070a10);
  border: 1px solid rgba(255,255,255,0.09);
  opacity: 0.92;
}

.car-glass-left { left: 28%; width: 18%; transform: skewX(-20deg); border-radius: 28px 8px 8px 8px; }
.car-glass-main { right: 28%; width: 28%; transform: skewX(18deg); border-radius: 8px 32px 10px 8px; }

.car-body {
  position: absolute;
  inset: 86px 0 36px;
  border-radius: 72px 94px 48px 48px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 35%), linear-gradient(135deg, #252d3c, #090b10 72%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 28px 70px rgba(0,0,0,0.52);
}

.headlight {
  position: absolute;
  top: 42%;
  width: 78px;
  height: 7px;
  border-radius: 999px;
  background: #dce8ff;
  box-shadow: 0 0 28px rgba(220,232,255,0.9);
}

.headlight.left { left: 34px; }
.headlight.right { right: 34px; }

.charge-port {
  position: absolute;
  right: 112px;
  top: 34px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(245,247,251,0.58);
  border-radius: 50%;
}

.wheel {
  position: absolute;
  bottom: 8px;
  width: 78px;
  height: 78px;
  border: 14px solid #080a0f;
  border-radius: 50%;
  background: #202735;
  box-shadow: inset 0 0 0 6px #596170;
}

.wheel-left { left: 15%; }
.wheel-right { right: 15%; }

.car-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  filter: blur(14px);
}

.charger-unit {
  position: absolute;
  right: 7%;
  bottom: 90px;
  z-index: 3;
  text-align: center;
  transition: opacity 0.2s ease;
}

.charger-unit.disconnected { opacity: 0.55; }

.charger-body {
  width: 64px;
  height: 116px;
  padding: 17px 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent), #161b25;
}

.charger-body span {
  display: block;
  height: 7px;
  margin-bottom: 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
}

.charger-light {
  width: 9px;
  height: 9px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--muted);
}

.charger-unit.charging .charger-light { background: var(--green); box-shadow: 0 0 20px var(--green); }
.charger-unit p { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; }

.charge-cable {
  position: absolute;
  inset: 85px 0 0;
  z-index: 2;
  pointer-events: none;
  opacity: 1;
}

.charge-cable.hidden { opacity: 0; }
.charge-cable path { fill: none; stroke: rgba(245,247,251,0.42); stroke-width: 8; stroke-linecap: round; }

.charge-cable.is-charging path {
  stroke: var(--green);
  stroke-dasharray: 18 18;
  animation: cablePulse 1.4s linear infinite;
  filter: drop-shadow(0 0 11px rgba(52,245,166,0.85));
}

@keyframes cablePulse {
  from { stroke-dashoffset: 36; opacity: 0.55; }
  50% { opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 0.55; }
}

.hero-info {
  position: relative;
  z-index: 5;
  padding: 0 12px 2px;
}

.clean-hero-info {
  max-width: 720px;
  align-items: flex-end;
}

.clean-hero-info h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
.clean-hero-info .muted { max-width: 680px; margin-bottom: 0; }

.side-panel {
  display: grid;
  gap: 16px;
}

.battery-row strong, .metric-row strong {
  font-size: 2.2rem;
  letter-spacing: -0.06em;
}

/* Make current price less dominant */
#currentPrice {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(245,247,251,0.9);
  margin-right: 6px;
}

.battery-row span, .metric-row span { color: var(--muted); }

.battery-track {
  height: 9px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
}

.battery-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #a9ffd7);
  box-shadow: 0 0 24px rgba(52,245,166,0.45);
}

.charger-name {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 600;
}

button, input, select {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 16px;
  font: inherit;
}

input, select { background: rgba(3,7,18,0.72); color: white; }
button { background: rgba(245,247,251,0.92); color: #05070b; font-weight: 700; cursor: pointer; }

.primary-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  margin-top: 0;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  width: auto;
}

.primary-button { background: rgba(245,247,251,0.92); color: #05070b; font-weight: 700; }
.ghost-button { border: 1px solid var(--line); background: rgba(255,255,255,0.06); }
.compact { padding: 9px 13px; font-size: 0.9rem; }

.chart-card {
  min-height: 278px;
}

.plan-after-car {
  margin-top: -8px;
}

.compact-header h2 {
  font-size: 1.15rem;
}

.legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  margin: 14px 0 12px;
}

.legend b {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-right: 6px;
}

.planned-dot { background: var(--green); }
.actual-dot { background: #8fb8ff; }

.charging-graph {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 180px;
  overflow-x: auto;
  padding: 12px 8px 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(transparent 0%, rgba(255,255,255,0.01) 1px);
}

.slot {
  min-width: 18px;
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  position: relative;
}

.slot-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 999px 999px 0 0;
  background: rgba(245,247,251,0.22);
}

.slot-bar.planned {
  background: linear-gradient(180deg, var(--green), rgba(52,245,166,0.18));
}

.slot-bar.actual { background: linear-gradient(180deg, #8fb8ff, rgba(143,184,255,0.18)); }

.slot-label {
  position: absolute;
  bottom: -26px;
  font-size: 10px;
  color: rgba(245,247,251,0.5);
  transform: rotate(-45deg);
  transform-origin: top left;
  white-space: nowrap;
}

/* Charging plan x-axis labels: small, centered and truncated so they don't cover graph */
.slot small,
.slot .slot-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(245,247,251,0.55);
  white-space: nowrap;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

@media (min-width: 900px) {
  .slot:hover .slot-bar { transform: translateY(-3px); transition: transform .18s ease; }
}

.slot-now {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

.rules-card {
  min-height: auto;
}

.rules-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.rule-item, .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.045);
}

.rule-item strong { display: block; margin-bottom: 4px; }
.rule-item p { margin: 0; color: var(--muted); }

.rule-toggle {
  min-width: 48px;
  width: 48px;
  height: 28px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}

.rule-toggle span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.74);
  transition: transform 0.2s ease;
}

.rule-toggle.on { background: var(--green-soft); }
.rule-toggle.on span { transform: translateX(20px); background: var(--green); box-shadow: 0 0 14px rgba(52,245,166,0.72); }

.settings-panel { margin-top: 34px; }
.settings-header { margin-bottom: 16px; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.rule-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.inline-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.inline-divider::before, .inline-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.setup-card h2 { margin-bottom: 10px; }
.setup-card button + .inline-divider, .setup-card .message + .item, .setup-card button + .item { margin-top: 18px; }

label { display: block; margin-top: 10px; color: var(--muted); }
label input[type="checkbox"] { width: auto; margin-right: 8px; }
.empty-state { margin-bottom: 22px; }

@media (max-width: 980px) {
  .app { padding: 18px; }
  .dashboard-grid, .grid, .rule-form-grid { grid-template-columns: 1fr; }
  .topbar, .hero-info { align-items: flex-start; flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; }
  .hero-card { min-height: 430px; }
  .car-stage { height: 305px; }
  .vehicle-model { width: 94%; bottom: 35px; }
  .charger-unit { right: 2%; bottom: 70px; transform: scale(0.82); }
}
