/* Ortak görünüm: yönetim paneli ve müşteri ekranı (SELECT-ERP tasarım sistemi).
   Renk/tema belirteçleri, temel yazı ve ortak bileşenler burada; ekrana özel düzen yonetim.css ve musteri.css'te. */
:root {
  --bg: #f3f6f6; --surface: #ffffff; --surface-2: #eef3f2; --surface-3: #e4ebea;
  --line: #e0e7e6; --line-strong: #cbd6d5;
  --fg: #13201f; --fg-2: #3b4a49; --muted: #687877;
  --accent: #0e7c74; --accent-strong: #0a625c; --accent-soft: #e2f2ef; --accent-fg: #ffffff;
  --ok: #1d8a57; --ok-soft: #e3f4ea; --warn: #a8690f; --warn-soft: #fbf0dc;
  --bad: #c0392f; --bad-soft: #fbe6e4; --info: #2f6fb3; --info-soft: #e5eefa;
  --shadow-1: 0 1px 2px rgb(19 32 31 / .05), 0 1px 1px rgb(19 32 31 / .03);
  --shadow-2: 0 8px 24px -8px rgb(19 32 31 / .14), 0 2px 6px rgb(19 32 31 / .05);
  --shadow-3: 0 24px 60px -16px rgb(19 32 31 / .28);
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --sidebar-w: 248px; --topbar-h: 64px; --bottomnav-h: 64px;
  color-scheme: light;
}
:root[data-accent="lacivert"] { --accent: #1f4f8f; --accent-strong: #173d70; --accent-soft: #e5edf8; }
:root[data-accent="mor"]      { --accent: #5b55e0; --accent-strong: #4741c2; --accent-soft: #ecebfc; }
:root[data-accent="yesil"]    { --accent: #2f8a3b; --accent-strong: #236c2d; --accent-soft: #e4f3e5; }
:root[data-accent="turuncu"]  { --accent: #c2570c; --accent-strong: #9a4409; --accent-soft: #fcecdf; }
:root[data-accent="grafit"]   { --accent: #334155; --accent-strong: #1e293b; --accent-soft: #e8ecf1; }

/* Koyu tema: sistem koyuysa (kullanıcı "Aydınlık" seçmediyse) ya da "Koyu" seçildiyse */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1414; --surface: #141c1c; --surface-2: #1a2424; --surface-3: #212d2d;
    --line: #243131; --line-strong: #314141; --fg: #e5eeed; --fg-2: #c2cfce; --muted: #8fa1a0;
    --accent: #3bb5a9; --accent-strong: #5fcbc0; --accent-soft: #15302d; --accent-fg: #06201d;
    --ok: #4cc28a; --ok-soft: #13301f; --warn: #e2a64a; --warn-soft: #33270f;
    --bad: #ef7469; --bad-soft: #3a1a17; --info: #74a9e6; --info-soft: #142538;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3); --shadow-2: 0 10px 28px -10px rgb(0 0 0 / .6); --shadow-3: 0 28px 70px -16px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-accent="lacivert"] { --accent: #7eaaea; --accent-strong: #a3c3f1; --accent-soft: #172741; --accent-fg: #0b1a2e; }
  :root:not([data-theme="light"])[data-accent="mor"]      { --accent: #9a95f6; --accent-strong: #b9b5fa; --accent-soft: #24223f; --accent-fg: #15133a; }
  :root:not([data-theme="light"])[data-accent="yesil"]    { --accent: #5fc06c; --accent-strong: #86d390; --accent-soft: #15301a; --accent-fg: #082010; }
  :root:not([data-theme="light"])[data-accent="turuncu"]  { --accent: #f08a45; --accent-strong: #f5a873; --accent-soft: #3a2212; --accent-fg: #2a1204; }
  :root:not([data-theme="light"])[data-accent="grafit"]   { --accent: #a9b6c8; --accent-strong: #c8d2df; --accent-soft: #232b36; --accent-fg: #111821; }
}
:root[data-theme="dark"] {
  --bg: #0d1414; --surface: #141c1c; --surface-2: #1a2424; --surface-3: #212d2d;
  --line: #243131; --line-strong: #314141; --fg: #e5eeed; --fg-2: #c2cfce; --muted: #8fa1a0;
  --accent: #3bb5a9; --accent-strong: #5fcbc0; --accent-soft: #15302d; --accent-fg: #06201d;
  --ok: #4cc28a; --ok-soft: #13301f; --warn: #e2a64a; --warn-soft: #33270f;
  --bad: #ef7469; --bad-soft: #3a1a17; --info: #74a9e6; --info-soft: #142538;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .3); --shadow-2: 0 10px 28px -10px rgb(0 0 0 / .6); --shadow-3: 0 28px 70px -16px rgb(0 0 0 / .7);
  color-scheme: dark;
}
:root[data-theme="dark"][data-accent="lacivert"] { --accent: #7eaaea; --accent-strong: #a3c3f1; --accent-soft: #172741; --accent-fg: #0b1a2e; }
:root[data-theme="dark"][data-accent="mor"]      { --accent: #9a95f6; --accent-strong: #b9b5fa; --accent-soft: #24223f; --accent-fg: #15133a; }
:root[data-theme="dark"][data-accent="yesil"]    { --accent: #5fc06c; --accent-strong: #86d390; --accent-soft: #15301a; --accent-fg: #082010; }
:root[data-theme="dark"][data-accent="turuncu"]  { --accent: #f08a45; --accent-strong: #f5a873; --accent-soft: #3a2212; --accent-fg: #2a1204; }
:root[data-theme="dark"][data-accent="grafit"]   { --accent: #a9b6c8; --accent-strong: #c8d2df; --accent-soft: #232b36; --accent-fg: #111821; }

/* Eski adlar → yeni belirteçler (style.css ve şablonlardaki satır içi stiller için) */
:root, :root[data-theme] {
  --card: var(--surface); --ink: var(--fg); --brand: var(--accent); --brand2: var(--accent-strong);
  --okbg: var(--ok-soft); --warnbg: var(--warn-soft); --badbg: var(--bad-soft);
  --blue: var(--info); --bluebg: var(--info-soft); --grey: var(--surface-2);
}

/* ---------- Temel ---------- */
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: .9375rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
b, strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 4px 0 22px; gap: 10px; }
h1 .btn { margin-left: auto; letter-spacing: 0; }
h2 { font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em; margin: 32px 0 12px; }
h3 { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.crumb { font-weight: 600; margin-bottom: 2px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
code { background: var(--surface-2); color: var(--fg-2); }
td, .stat b, .big, .r { font-variant-numeric: tabular-nums; }

/* ---------- Bileşenler ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 20px; }
.cards { gap: 16px; margin-bottom: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cols, .conns { gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.stat span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat b { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; }
.stat i { font-size: .875rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.stat small { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.stat::after { content: ""; position: absolute; right: 16px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .5; }
dl { grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: .875rem; }
dt { color: var(--muted); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg);
  font-weight: 700; font-size: .8125rem; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 6px 16px -8px var(--accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { min-height: 32px; padding: 0 12px; border-radius: 9px; font-size: .75rem; }

input, select, textarea {
  min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg);
  padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 8px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { font-size: .8125rem; font-weight: 600; color: var(--fg-2); gap: 6px; }
label small { font-weight: 500; color: var(--muted); }
label.check { font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--fg-2); vertical-align: middle;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none; }
.badge.ok, .s-Available { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .s-Preparing, .s-Finishing, .s-SuspendedEV, .s-SuspendedEVSE, .s-Reserved { background: var(--warn-soft); color: var(--warn); }
.badge.bad, .s-Faulted { background: var(--bad-soft); color: var(--bad); }
.s-Charging { background: var(--info-soft); color: var(--info); }
.s-Unavailable, .s-Unknown { background: var(--surface-2); color: var(--muted); }
.dot { width: 9px; height: 9px; background: var(--line-strong); vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.flash { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; font-weight: 600; font-size: .875rem; background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.flash a { color: inherit; }

/* Tablolar */
.tw { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
table { font-size: .8125rem; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); background: none; white-space: nowrap; }
td a { font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
.tw tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tw tr:has(th):hover td { background: none; }
.empty { padding: 40px 20px; }
.empty p { color: var(--muted); margin: 0 0 14px; }

details .pop { border-radius: 16px; box-shadow: var(--shadow-2); }
.map { border-radius: var(--r-lg); border-color: var(--line); box-shadow: var(--shadow-1); }
.leaflet-popup-content { font-family: var(--font); }
#chart .line { stroke: var(--accent); } #chart .area { fill: var(--accent); }

