:root[data-theme="dark"] {
  --bg-0: #050507;
  --bg-1: #0A0A0F;
  --surface: rgba(19, 19, 28, 0.85);
  --surface-solid: #13131C;
  --elevated: rgba(28, 28, 42, 0.85);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --primary: #D4FF00;
  --primary-glow: rgba(212, 255, 0, 0.35);
  --primary-glow-soft: rgba(212, 255, 0, 0.12);
  --secondary: #FF2E92;
  --secondary-glow: rgba(255, 46, 146, 0.30);
  --tertiary: #00E5FF;
  --st-available: #84CC16;
  --st-charging: #D4FF00;
  --st-preparing: #FB923C;
  --st-finishing: #FF2E92;
  --st-error: #FF3B5C;
  --st-available-bg: rgba(132, 204, 22, 0.12);
  --st-charging-bg: rgba(212, 255, 0, 0.14);
  --st-preparing-bg: rgba(251, 146, 60, 0.14);
  --st-finishing-bg: rgba(255, 46, 146, 0.14);
  --st-error-bg: rgba(255, 59, 92, 0.14);
  --text-hi: #FFFFFF;
  --text-md: #B4B4C4;
  --text-lo: #71717A;
  --text-xlo: #4B4B5A;
  --frame-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
:root[data-theme="light"] {
  --bg-0: #E2E8F0;
  --bg-1: #F8FAFC;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #FFFFFF;
  --elevated: rgba(241, 245, 249, 0.85);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --primary: #65A30D;
  --primary-glow: rgba(132, 204, 22, 0.30);
  --primary-glow-soft: rgba(132, 204, 22, 0.12);
  --secondary: #DB2777;
  --secondary-glow: rgba(219, 39, 119, 0.25);
  --tertiary: #0EA5E9;
  --st-available: #16A34A;
  --st-charging: #65A30D;
  --st-preparing: #EA580C;
  --st-finishing: #BE185D;
  --st-error: #DC2626;
  --st-available-bg: rgba(22, 163, 74, 0.10);
  --st-charging-bg: rgba(101, 163, 13, 0.10);
  --st-preparing-bg: rgba(234, 88, 12, 0.10);
  --st-finishing-bg: rgba(190, 24, 93, 0.10);
  --st-error-bg: rgba(220, 38, 38, 0.10);
  --text-hi: #0F172A;
  --text-md: #475569;
  --text-lo: #94A3B8;
  --text-xlo: #CBD5E1;
  --frame-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.25), 0 0 1px rgba(15, 23, 42, 0.05) inset;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text-hi);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

/* Ambient blobs */
body::before, body::after {
  content: ""; position: fixed; pointer-events: none; border-radius: 50%;
  filter: blur(80px); opacity: 0.55; z-index: 0;
  animation: drift 14s ease-in-out infinite alternate;
}
body::before { width: 380px; height: 380px; background: var(--primary); top: -120px; left: -120px; }
body::after { width: 420px; height: 420px; background: var(--secondary); bottom: -160px; right: -160px; animation-delay: -6s; animation-duration: 18s; }
:root[data-theme="light"] body::before, :root[data-theme="light"] body::after { opacity: 0.30; }
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(40px,-30px) scale(1.1); } }

/* Phone frame */
.phone {
  position: relative; z-index: 1; max-width: 430px; width: 100%;
  margin: 32px auto; background: var(--bg-1); border-radius: 36px;
  padding: 14px 14px 24px; box-shadow: var(--frame-shadow);
  border: 1px solid var(--border-strong); min-height: calc(100vh - 64px); overflow: hidden;
}
.phone::before {
  content: ""; position: absolute; top: 18px; left: 50%;
  transform: translateX(-50%); width: 88px; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); z-index: 5;
}
:root[data-theme="light"] .phone::before { background: rgba(15, 23, 42, 0.10); }
@media (max-width: 480px) {
  .phone { margin: 0; border-radius: 0; max-width: 100%; min-height: 100vh; padding: 14px 12px 24px; border: none; box-shadow: none; }
}

/* PIN screen */
.pin-screen {
  min-height: calc(100vh - 80px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px;
}
.pin-screen .brand-bolt-big {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--tertiary));
  color: #0A0A0F; display: grid; place-items: center;
  font-size: 26px; font-weight: 900;
  box-shadow: 0 0 24px var(--primary-glow);
}
.pin-screen h1 {
  font-size: 22px; letter-spacing: -0.02em; font-weight: 800;
  background: linear-gradient(135deg, var(--text-hi), var(--text-md));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pin-screen input {
  width: 220px; height: 56px;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: 14px; color: var(--text-hi); font-size: 28px;
  text-align: center; letter-spacing: 0.4em;
  font-family: 'JetBrains Mono', monospace;
}
.pin-screen input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.pin-screen .primary-btn {
  background: var(--primary); color: #0A0A0F; border: none;
  border-radius: 12px; padding: 12px 28px; font-weight: 700; cursor: pointer;
  box-shadow: 0 0 18px var(--primary-glow); font-size: 14px;
}
.pin-screen .error { color: var(--st-error); font-size: 13px; font-weight: 600; min-height: 20px; }

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 32px 8px 12px; margin-bottom: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-bolt {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--tertiary));
  color: #0A0A0F; display: grid; place-items: center;
  font-size: 18px; font-weight: 900;
  box-shadow: 0 0 18px var(--primary-glow), 0 8px 18px -6px rgba(0,0,0,0.4);
}
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-title {
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-hi), var(--text-md));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.header-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-md); cursor: pointer; display: grid; place-items: center;
  font-size: 14px; transition: all 0.18s ease; backdrop-filter: blur(10px);
}
.icon-btn:hover { color: var(--text-hi); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn.refresh:hover { color: var(--primary); box-shadow: 0 0 14px var(--primary-glow-soft); }

/* Hero */
.hero { padding: 16px 12px 20px; margin: 8px 0 18px; position: relative; }
.hero-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hero-stat { display: flex; flex-direction: column; gap: 2px; }
.hero-num {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 56px; line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--primary), var(--tertiary) 80%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px var(--primary-glow-soft));
}
.hero-num.small {
  font-size: 36px;
  background: linear-gradient(135deg, var(--text-hi), var(--text-md));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: none;
}
.hero-label { font-size: 11px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase; color: var(--text-lo); }
.hero-divider { font-size: 32px; color: var(--text-xlo); font-weight: 200; align-self: center; }
.hero-side { text-align: right; }
.hero-bar { margin-top: 14px; height: 7px; border-radius: 999px; background: var(--elevated); border: 1px solid var(--border); overflow: hidden; position: relative; }
.hero-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--st-available), var(--primary), var(--tertiary));
  box-shadow: 0 0 20px var(--primary-glow), 0 0 6px var(--primary-glow);
  position: relative; transition: width 0.4s ease;
}
.hero-bar-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.hero-meta { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-lo); }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-md); backdrop-filter: blur(8px);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--st-available);
  box-shadow: 0 0 8px var(--st-available), 0 0 14px var(--st-available);
  animation: livepulse 1.8s ease-in-out infinite;
}
@keyframes livepulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.85); } }
.hero-pct { font-size: 13px; color: var(--text-md); }
.hero-pct strong { color: var(--primary); font-weight: 700; }

/* Filter bar */
.filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 6px 0 14px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-md); font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(10px);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.005em;
}
.filter-chip:hover { color: var(--text-hi); border-color: var(--border-strong); }
.filter-chip.active {
  background: var(--primary); color: #0A0A0F;
  border-color: var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
}
.filter-chip[data-filter="error"].active {
  background: var(--st-error); border-color: var(--st-error);
  box-shadow: 0 0 14px rgba(255, 59, 92, 0.40); color: #FFFFFF;
}
.filter-chip .chip-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 11px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--elevated); color: var(--text-md); line-height: 1;
}
.filter-chip.active .chip-count {
  background: rgba(0,0,0,0.20); color: inherit;
}

/* Block */
.block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; margin-bottom: 12px; overflow: hidden;
  backdrop-filter: blur(14px); transition: all 0.25s ease;
}
.block.priority {
  border-color: rgba(212, 255, 0, 0.18);
  box-shadow: 0 0 0 1px var(--primary-glow-soft) inset, 0 8px 24px -10px rgba(0,0,0,0.3);
}
.block-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.block-title {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-hi);
}
.block-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 999px; background: var(--text-xlo);
}
.block.priority .block-title::before {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  box-shadow: 0 0 8px var(--primary-glow);
}
.priority-bell {
  font-size: 11px; color: var(--primary); font-weight: 600;
  margin-left: 4px; text-shadow: 0 0 10px var(--primary-glow);
}
.block-summary { display: flex; align-items: center; gap: 8px; }
.summary-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-md); font-weight: 600; }
.summary-badge {
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.summary-badge.full { background: var(--st-error-bg); color: var(--st-error); }
.summary-badge.mixed { background: var(--st-preparing-bg); color: var(--st-preparing); }
.summary-badge.free { background: var(--st-available-bg); color: var(--st-available); }
.summary-badge.error { background: var(--st-error-bg); color: var(--st-error); }

/* Station */
.stations { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.station {
  display: grid; grid-template-columns: 4px 36px 1fr auto; gap: 12px;
  align-items: center; padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease; position: relative;
}
.station:last-child { border-bottom: none; }
.station:hover { background: var(--elevated); }
.station-strip { width: 4px; height: 100%; min-height: 48px; align-self: stretch; }
.station[data-status="available"] .station-strip { background: var(--st-available); box-shadow: 0 0 10px var(--st-available); }
.station[data-status="charging"] .station-strip  { background: var(--st-charging);  box-shadow: 0 0 10px var(--st-charging); }
.station[data-status="preparing"] .station-strip { background: var(--st-preparing); box-shadow: 0 0 10px var(--st-preparing); }
.station[data-status="finishing"] .station-strip { background: var(--st-finishing); box-shadow: 0 0 10px var(--st-finishing); }
.station[data-status="error"] .station-strip     { background: var(--st-error);     box-shadow: 0 0 10px var(--st-error); }
.station-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
  border: 1px solid transparent;
}
.station[data-status="available"] .station-icon { background: var(--st-available-bg); color: var(--st-available); border-color: rgba(132, 204, 22, 0.20); }
.station[data-status="charging"] .station-icon  { background: var(--st-charging-bg);  color: var(--st-charging);  border-color: rgba(212, 255, 0, 0.30); box-shadow: 0 0 14px rgba(212, 255, 0, 0.30); animation: chargepulse 1.6s ease-in-out infinite; }
@keyframes chargepulse { 0%,100% { box-shadow: 0 0 14px rgba(212,255,0,0.30); } 50% { box-shadow: 0 0 20px rgba(212,255,0,0.55); } }
.station[data-status="preparing"] .station-icon { background: var(--st-preparing-bg); color: var(--st-preparing); border-color: rgba(251, 146, 60, 0.25); }
.station[data-status="finishing"] .station-icon { background: var(--st-finishing-bg); color: var(--st-finishing); border-color: rgba(255, 46, 146, 0.25); }
.station[data-status="error"] .station-icon     { background: var(--st-error-bg);     color: var(--st-error);     border-color: rgba(255, 59, 92, 0.25); }
.station-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.station-name { font-weight: 600; font-size: 14px; color: var(--text-hi); letter-spacing: -0.005em; }
.station-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-lo); }
.meta-tag {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 9px; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 4px;
  background: var(--elevated); border: 1px solid var(--border);
  color: var(--text-md); line-height: 1;
}
.station-status { font-size: 12px; font-weight: 600; padding-right: 14px; text-align: right; white-space: nowrap; letter-spacing: -0.005em; }
.station[data-status="available"] .station-status { color: var(--st-available); }
.station[data-status="charging"] .station-status  { color: var(--st-charging); }
.station[data-status="preparing"] .station-status { color: var(--st-preparing); }
.station[data-status="finishing"] .station-status { color: var(--st-finishing); }
.station[data-status="error"] .station-status     { color: var(--st-error); }

/* Empty state */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 16px 0;
  backdrop-filter: blur(14px);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.7; }
.empty-msg { color: var(--text-md); font-size: 14px; line-height: 1.5; max-width: 280px; margin: 0 auto; }

/* Footer */
.footer {
  margin-top: 18px; padding: 14px 16px; text-align: center;
  font-size: 10px; color: var(--text-xlo); letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 600;
}

/* Doluluk grafiği (Faz 2b) */
.chart-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 4px 4px;
  margin: 8px 0; backdrop-filter: blur(10px);
}
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-axis-label { fill: var(--text-lo); font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.chart-line { stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px currentColor); }
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 12px 8px; font-size: 11px; color: var(--text-md);
  font-weight: 600;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch {
  display: inline-block; width: 14px; height: 4px; border-radius: 2px;
  box-shadow: 0 0 8px currentColor;
}

/* Notifications geçmişi */
.notify-filters {
  display: flex; gap: 12px; padding: 12px 4px; flex-wrap: wrap;
}
.notify-filters .filter-row {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 140px;
}
.notify-filters label { color: var(--text-md); font-size: 12px; font-weight: 600; }
.notify-filters select {
  flex: 1; background: var(--elevated); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 10px; color: var(--text-hi);
  font-size: 13px; cursor: pointer;
}
.notify-filters select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.notify-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.notify-loading { color: var(--text-lo); text-align: center; padding: 20px; font-size: 13px; }
.notify-row {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 12px;
  align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  backdrop-filter: blur(10px);
}
.notify-row[data-block="ED"], .notify-row[data-block="C"], .notify-row[data-block="A"] {
  border-left: 3px solid var(--primary);
}
.notify-icon { font-size: 18px; opacity: 0.9; }
.notify-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.notify-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.notify-block {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--primary);
  padding: 2px 8px; border-radius: 4px;
  background: var(--primary-glow-soft);
}
.notify-station { font-size: 14px; font-weight: 600; color: var(--text-hi); }
.notify-meta { font-size: 11px; color: var(--text-lo); display: flex; align-items: center; gap: 4px; }
.notify-time { font-size: 11px; color: var(--text-lo); white-space: nowrap; font-weight: 500; }

/* Settings */
.settings-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; margin-bottom: 12px; padding: 16px;
  backdrop-filter: blur(14px);
}
.settings-block h3 {
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-md); margin-bottom: 12px; font-weight: 700;
}
.field-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.field-row label { color: var(--text-md); font-size: 13px; font-weight: 500; }
.field-row input[type="password"], .field-row select {
  background: var(--elevated); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 8px 12px; color: var(--text-hi);
  font-family: 'JetBrains Mono', monospace; min-width: 130px; text-align: center;
  font-size: 14px;
}
.field-row input:focus, .field-row select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; cursor: pointer; color: var(--text-hi); font-size: 14px;
}
.check-row input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary);
}
.settings-hint { font-size: 11px; color: var(--text-lo); margin-top: 6px; }
.settings-actions { margin-top: 18px; text-align: center; padding-bottom: 12px; }
.primary-btn {
  background: var(--primary); color: #0A0A0F; border: none;
  border-radius: 12px; padding: 12px 28px; font-weight: 700; cursor: pointer;
  box-shadow: 0 0 18px var(--primary-glow); font-size: 14px;
}
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.settings-status { margin-top: 12px; font-size: 13px; min-height: 18px; font-weight: 600; }
.settings-status.ok { color: var(--st-available); }
.settings-status.err { color: var(--st-error); }
