/* SunGrid İzleme */
:root {
  --brand: #F39200;
  --brand-ink: #B86E00;
  --sun: #FFD500;
  --ink: #2C2C2C;

  --bg: #F4F3F0;
  --surface: #FFFFFF;
  --surface-2: #F9F8F6;
  --line: #E5E2DC;
  --text: #22211F;
  --muted: #6F6B64;

  --ok: #1D9A57;   --ok-bg: #E6F5EC;
  --fault: #D63A3A; --fault-bg: #FCEBEB;
  --off: #6B7280;  --off-bg: #EEF0F3;
  --warn: #B86E00; --warn-bg: #FDF1DC;
  --info-bg: #E9F1FB; --info: #2C5E9E;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 25, 15, .05), 0 4px 14px rgba(30, 25, 15, .04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151413; --surface: #1E1D1B; --surface-2: #252421; --line: #34322E;
    --text: #ECEAE6; --muted: #A29D94;
    --ok: #3CC07A; --ok-bg: #16301F; --fault: #F06A6A; --fault-bg: #3A1D1D;
    --off: #9CA3AF; --off-bg: #2A2C30; --warn: #F0A63A; --warn-bg: #3A2B12;
    --info-bg: #1B2838; --info: #8DB6EA; --brand-ink: #F5A733;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 2px; letter-spacing: -.2px; }
h2 { font-size: 15px; margin: 0 0 12px; }
h2 small { font-weight: 400; font-size: 13px; }
p { margin: 0 0 10px; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* Üst çubuk */
.topbar {
  background: var(--ink); color: #fff; display: flex; align-items: center; gap: 28px;
  padding: 0 24px; min-height: 58px; border-bottom: 3px solid var(--brand);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 16.5px; white-space: nowrap; }
.brand b { color: var(--brand); }
.topbar nav { display: flex; gap: 2px; flex: 1; }
.topbar nav a, .userbox a { text-decoration: none; color: #CDC8C0; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.topbar nav a:hover, .userbox a:hover { color: #fff; background: rgba(255,255,255,.07); }
.topbar nav a.active, .userbox a.active { color: #fff; background: rgba(243,146,0,.22); }
.userbox { display: flex; align-items: center; gap: 6px; }
.userbox form { margin: 0; }
.linkbtn { background: none; color: #CDC8C0; border: 1px solid #4A4743; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.linkbtn:hover { color: #fff; border-color: #6A6661; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 24px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.head-side { display: flex; align-items: center; gap: 10px; }
.crumbs { margin: 0 0 6px; font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

/* Kartlar */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card.pad { padding: 18px 20px; }
.card.narrow { max-width: 640px; }

/* Göstergeler */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi strong { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.5px; line-height: 1.25; margin: 2px 0; }
.kpi strong small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi em { display: block; font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: transparent; }
.kpi.is-fault::before { background: var(--fault); }
.kpi.is-fault strong { color: var(--fault); }
.kpi.is-warn::before { background: var(--warn); }
.kpi.is-warn strong { color: var(--warn); }
.kpi.is-ok::before { background: var(--ok); }

/* Panel düzeni */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.mapcard { position: sticky; top: 16px; overflow: hidden; }
#map { height: 560px; background: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.legend i.ok { background: var(--ok); } .legend i.warn { background: var(--warn); }
.legend i.fault { background: var(--fault); } .legend i.off { background: var(--off); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .grid2 { margin-top: 16px; }
.chart { position: relative; height: 260px; }

/* Araç çubuğu */
.toolbar { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1; min-width: 180px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; font: inherit; color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg button b { font-weight: 600; margin-left: 3px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Tablolar */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
th small { font-weight: 400; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
th.sorted::after { content: " ↓"; } th.sorted.asc::after { content: " ↑"; }
td.name a { font-weight: 600; text-decoration: none; }
td.name a:hover { color: var(--brand-ink); text-decoration: underline; }
td.name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
table.plants tbody tr { cursor: pointer; }
table.plants tbody tr:hover td { background: var(--surface-2); }
tr.inactive td { opacity: .55; }
.empty { color: var(--muted); padding: 24px 14px; text-align: center; margin: 0; }

/* Durum rozetleri */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge small { font-weight: 500; opacity: .8; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.fault { color: var(--fault); background: var(--fault-bg); }
.badge.off { color: var(--off); background: var(--off-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); margin: 1px 4px 1px 0; }
.tag.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }

/* Verim çubuğu */
.ybar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.ybar s { display: block; width: 64px; height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.ybar span { display: block; height: 100%; background: var(--ok); min-width: 2px; }
.ybar span.warn { background: var(--warn); }
.ybar span.odd { background: var(--off); }
.ybar b { font-weight: 500; min-width: 36px; }

/* Uyarılar */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; }
.alert.error { background: var(--fault-bg); color: var(--fault); }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: var(--info-bg); color: var(--info); }

/* Formlar */
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
label input, label select { display: block; width: 100%; margin-top: 5px; }
input:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 9px; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--brand); color: #1F1400; }
.btn.primary:hover { background: #E08700; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; margin-top: 4px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-form .end { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
form.inline { display: inline; margin: 0; }
table.settings input:not([type=checkbox]) { width: 120px; padding: 6px 8px; }
table.settings td.warns { min-width: 220px; }
td.actions { white-space: nowrap; text-align: right; }
td.actions details { display: inline-block; position: relative; }
td.actions summary { list-style: none; }
td.actions summary::-webkit-details-marker { display: none; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); width: 220px; }

/* Bilgi listesi */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.events { list-style: none; padding: 0; margin: 0; }
.events li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.events li:last-child { border-bottom: 0; }
.events time { color: var(--muted); font-size: 12.5px; min-width: 76px; }
.events .arrow { color: var(--muted); }

/* Giriş */
.auth { min-height: calc(100vh - 70px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); border-top: 4px solid var(--brand); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand strong { display: block; font-size: 19px; }
.auth-brand strong b { color: var(--brand); }
.auth-brand span { color: var(--muted); font-size: 13px; }

/* Leaflet açılır pencere */
.leaflet-popup-content { font: 13px/1.45 system-ui, sans-serif; margin: 10px 14px; }
.leaflet-popup-content a.pname { font-weight: 600; color: #2C2C2C; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .mapcard { position: static; order: -1; }
  #map { height: 320px; }
  .hide-md { display: none; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px 6px; }
  .topbar nav { order: 3; flex: 0 0 100%; overflow-x: auto; margin: 0 -6px; }
  .userbox { margin-left: auto; }
  .userbox a { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .wrap { padding: 16px 14px 40px; }
  .grid2, .grid-form { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi strong { font-size: 22px; }
  .kpi em { white-space: normal; }
  .seg { width: 100%; overflow-x: auto; }
  .seg button { flex: 1; }
  td, th { padding: 9px 8px; }
  .ybar s { display: none; }
}

/* SunGrid logosu */
.brand-logo { display: block; height: 38px; width: auto; }
.auth-brand { flex-direction: column; align-items: flex-start; gap: 4px; }
.auth-logo { display: block; width: 220px; max-width: 100%; height: auto; }
.auth-brand span { padding-left: 2px; }

/* ================================================================
   v3 — Yan menülü düzen, Canlı İzleme, Alarmlar
   ================================================================ */
:root[data-theme="dark"] {
  --bg: #151413; --surface: #1E1D1B; --surface-2: #252421; --line: #34322E;
  --text: #ECEAE6; --muted: #A29D94;
  --ok: #3CC07A; --ok-bg: #16301F; --fault: #F06A6A; --fault-bg: #3A1D1D;
  --off: #9CA3AF; --off-bg: #2A2C30; --warn: #F0A63A; --warn-bg: #3A2B12;
  --info-bg: #1B2838; --info: #8DB6EA; --brand-ink: #F5A733;
  --shadow: none;
}
:root { --navy: #131433; --navy-2: #1C1E45; --side-w: 236px; --link: #2F6FD0; }
:root[data-theme="dark"] { --link: #7FB0F5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --link: #7FB0F5; } }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kabuk */
body.has-shell { display: block; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--navy); color: #C9CBE0; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04); transition: width .2s ease, transform .2s ease;
}
.side-brand { display: flex; align-items: center; height: 64px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-brand img { height: 40px; width: auto; display: block; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.side-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7D80A6; padding: 14px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: #C9CBE0; white-space: nowrap; position: relative; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(243,146,0,.16); color: #fff; }
.side-nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side-nav a.active .ico { color: var(--brand); }
.side-nav .count { margin-left: auto; background: var(--fault); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side-foot { padding: 12px 18px; font-size: 11.5px; color: #6E7196; border-top: 1px solid rgba(255,255,255,.07); }
.side-scrim { position: fixed; inset: 0; background: rgba(10,10,25,.45); z-index: 35; }

.main { margin-left: var(--side-w); min-height: 100vh; transition: margin-left .2s ease; }
body.side-mini .side { width: 64px; }
body.side-mini .side-brand { padding: 0 12px; }
body.side-mini .side-brand img { content: url("sungrid-ikon.svg"); height: 36px; }
body.side-mini .side-group, body.side-mini .side-nav span, body.side-mini .side-foot { display: none; }
body.side-mini .side-nav a { justify-content: center; padding: 10px 0; }
body.side-mini .side-nav .count { position: absolute; top: 2px; right: 4px; padding: 0 5px; font-size: 10px; }
body.side-mini .main { margin-left: 64px; }

/* Üst çubuk (yan menülü düzende) */
.has-shell .topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 0 20px; background: var(--surface); color: var(--text);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.iconbtn { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn .ico { width: 21px; height: 21px; }
.alarmbtn b { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--fault); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; }
.top-logo { display: none; }
.top-logo img { height: 34px; display: block; }
.crumbbar { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbbar a { color: var(--muted); text-decoration: none; }
.crumbbar a:hover { color: var(--text); }
.crumbbar b { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #2F6FD0; color: #fff; font-weight: 600; font-size: 14px; display: grid; place-items: center; user-select: none; }
.usermenu[open] .avatar { box-shadow: 0 0 0 3px rgba(47,111,208,.25); }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); width: 236px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; z-index: 50; }
.menu-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head strong { display: block; font-size: 14px; }
.menu-head span { color: var(--muted); font-size: 12px; }
.usermenu .menu a, .usermenu .menu form button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.usermenu .menu a:hover, .usermenu .menu form button:hover { background: var(--surface-2); }
.usermenu .menu form { margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 6px 6px; }
.theme-pick button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.theme-pick button.on { border-color: var(--brand); color: var(--text); background: var(--surface-2); }

.has-shell .wrap { max-width: none; padding: 20px 24px 48px; }

/* Ortak parçalar */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ico { color: var(--muted); }
.pill { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; text-align: center; }
.badge.info { color: var(--info); background: var(--info-bg); }
.inline-select { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--muted); }
.inline-select select { padding: 6px 8px; }
.kpis-tight { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.table-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }
small.block { display: block; }
.segbtn { border: 0; background: none; color: var(--muted); padding: 5px 11px; border-radius: 7px; text-decoration: none; white-space: nowrap; }
.segbtn b { font-weight: 600; margin-left: 3px; }
.segbtn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.filters select { max-width: 260px; }

/* Canlı İzleme tablosu */
table.monitor th, table.monitor td { padding: 9px 10px; }
table.monitor th { text-transform: none; }
table.monitor tbody tr { cursor: pointer; }
table.monitor tbody tr:hover td { background: var(--surface-2); }
table.monitor td.name a { color: var(--link); font-weight: 600; }
table.monitor td.ell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.monitor td.num.link { color: var(--link); }
table.monitor td.bad { color: var(--fault); font-weight: 600; }
.c-st { width: 34px; text-align: center; }
.c-act { width: 1%; white-space: nowrap; }
.sicon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; }
.sicon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.sicon.ok { background: var(--ok); } .sicon.fault { background: var(--fault); }
.sicon.warn { background: var(--warn); } .sicon.off { background: var(--off); }
.acts { display: inline-flex; gap: 2px; }
.acts a { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--link); }
.acts a:hover { background: var(--info-bg); }
.acts a .ico { width: 17px; height: 17px; }
.acts a.has { color: var(--fault); }
.acts a b { position: absolute; top: 0; right: 0; font-size: 10px; background: var(--fault); color: #fff; border-radius: 8px; padding: 0 4px; line-height: 14px; }

/* Alarm akışı */
.alarm-feed { list-style: none; margin: 0; padding: 4px 0; max-height: 520px; overflow-y: auto; }
.alarm-feed li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.alarm-feed li:last-child { border-bottom: 0; }
.alarm-feed .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); }
.alarm-feed .lv-fault .dot { background: var(--fault); box-shadow: 0 0 0 3px var(--fault-bg); }
.alarm-feed .lv-warn .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.alarm-feed .lv-info .dot { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.alarm-feed strong { display: block; font-weight: 600; }
.alarm-feed strong .tag { margin-left: 6px; font-weight: 500; }
.alarm-feed span { color: var(--muted); font-size: 12.5px; }
.alarm-feed span a { color: var(--link); text-decoration: none; }
.alarm-feed time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.alarm-feed li.cleared { opacity: .6; }
table.alarms td { vertical-align: top; }
table.alarms tr.cleared td { opacity: .7; }
td.aname summary { cursor: pointer; list-style: none; }
td.aname summary::-webkit-details-marker { display: none; }
td.aname summary small { display: block; color: var(--muted); font-size: 12px; }
td.aname details[open] summary { margin-bottom: 6px; }
td.aname details p { font-size: 12.5px; color: var(--muted); max-width: 640px; margin: 0 0 6px; }

/* Ayarlar tablosu genişlikleri */
table.settings input.w-s { width: 96px; }
table.settings input.w-m { width: 170px; }
table.settings input.w-l { width: 200px; }

@media (max-width: 1400px) { .hide-xl { display: none; } }
@media (max-width: 1200px) { .hide-lg { display: none; } }

/* Dar ekran: yan menü üstten açılır */
@media (max-width: 1000px) {
  .side { transform: translateX(-100%); width: var(--side-w) !important; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.side-open .side { transform: none; }
  body.side-mini .side-group, body.side-mini .side-nav span, body.side-mini .side-foot { display: revert; }
  body.side-mini .side-nav a { justify-content: flex-start; padding: 9px 10px; }
  body.side-mini .side-brand img { content: normal; height: 40px; }
  .main, body.side-mini .main { margin-left: 0; }
  .top-logo { display: block; }
  .crumbbar { display: none; }
  .has-shell .topbar { padding: 0 10px; }
}

/* Telefon: Canlı İzleme satırları kart olur (etiket : değer) */
@media (max-width: 760px) {
  .has-shell .wrap { padding: 14px 12px 40px; }
  .has-shell .topbar { justify-content: space-between; }
  .top-logo { position: absolute; left: 50%; transform: translateX(-50%); }
  table.monitor thead { display: none; }
  table.monitor, table.monitor tbody { display: block; }
  table.monitor tbody tr { display: block; margin: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
  table.monitor tbody tr:hover td { background: none; }
  table.monitor td { display: flex !important; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: right; max-width: none !important; white-space: normal !important; }
  table.monitor td::before { content: attr(data-label); color: var(--text); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; text-align: left; flex: none; }
  table.monitor td.c-st { width: auto; }
  table.monitor td.c-act { border-bottom: 0; justify-content: flex-start; width: auto; }
  table.monitor td.c-act::before { display: none; }
  table.monitor td.hide-lg, table.monitor td.hide-xl { display: flex !important; }
  .table-foot { font-size: 11.5px; }
  .alarm-feed li { padding: 10px 12px; }
}
.has-shell .mapcard { top: 76px; }

/* düzeltme: eski üst çubuk kurallarını yan menülü düzende etkisizleştir */
.has-shell .topbar { flex-wrap: nowrap; gap: 12px; }
@media (max-width: 1000px) { .has-shell .topbar .crumbbar { display: none; } }
@media (max-width: 760px) { .has-shell .topbar { padding: 0 8px; min-height: 56px; } }

/* ================================================================
   v5 — İnvertörler, invertör detayı, raporlar
   ================================================================ */
td.name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { color: var(--link); text-decoration: underline; }
table.devlist td .tag { margin-left: 4px; text-decoration: none; }
table.kv th { background: none; color: var(--muted); font-weight: 500; }
table.kv tbody th { text-align: left; white-space: nowrap; }
table.strings td, table.plain-table td { padding: 8px 12px; }
table.plain-table tr.current td { background: var(--info-bg); }
td.num.bad, table.plain-table td.bad { color: var(--fault); font-weight: 600; }
.sbar { display: block; width: 160px; max-width: 100%; height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.sbar span { display: block; height: 100%; background: var(--ok); }
.sbar span.weak { background: var(--warn); }
.sbar span.dead { background: var(--fault); min-width: 3px; }
.sbar span.off { background: var(--off); }
.crumbs a + a { margin-left: 0; }

.pager { display: inline-flex; align-items: center; gap: 6px; }
.pager input[type=month] { padding: 6px 8px; }
#rq { margin-left: auto; min-width: 180px; }
.chart-sm { height: 200px; padding: 12px 16px 0; }
table.report { font-size: 12.5px; }
table.report th, table.report td { padding: 7px 8px; white-space: nowrap; }
table.report .sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 190px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--line); }
table.report thead .sticky, table.report tfoot .sticky { background: var(--surface-2); z-index: 2; }
table.report td.nil { color: var(--line); }
table.report .tot { font-weight: 700; background: var(--surface-2); }
table.report tfoot th { border-top: 2px solid var(--line); color: var(--text); font-weight: 700; }
table.report tbody tr:hover td { background: var(--surface-2); }
table.report td.name a { color: var(--link); font-weight: 600; text-decoration: none; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  #rq { margin-left: 0; width: 100%; }
  table.report .sticky { min-width: 140px; max-width: 160px; }
  table.devlist td .tag { display: inline-block; margin-top: 4px; }
}

/* ================================================================
   v6 — Firma logoları
   ================================================================ */
.pname { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.pname a { overflow: hidden; text-overflow: ellipsis; }
img.clogo { height: 24px; width: auto; max-width: 64px; object-fit: contain; flex: none; border-radius: 4px; background: #fff; padding: 1px 2px; box-shadow: 0 0 0 1px var(--line); }
img.clogo-lg { height: 44px; width: auto; max-width: 140px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px 6px; box-shadow: 0 0 0 1px var(--line); vertical-align: middle; margin-right: 12px; }
.title-row { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.company { padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.company h2 { margin: 0; }
.company-head { display: flex; gap: 12px; align-items: center; }
.company-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.logo-box { width: 96px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.logo-box img { max-width: 88px; max-height: 48px; object-fit: contain; }
.logo-box span { font-weight: 700; color: #6F6B64; font-size: 18px; }
input.cname { font-weight: 600; font-size: 15px; width: 100%; }
.company label { margin-bottom: 0; }
label.file input[type=file] { display: block; margin-top: 6px; width: 100%; font-size: 12.5px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; padding: 3px 0; }
.plantpick summary { cursor: pointer; font-weight: 500; font-size: 13px; color: var(--link); }
.picklist { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 6px; background: var(--surface-2); }
.company-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.btn.danger { color: var(--fault); }
.company.add { border-style: dashed; }
@media (max-width: 760px) {
  table.monitor td .pname { justify-content: flex-end; }
}

/* ================================================================
   v7 — Ana Sayfa, Kontrol Paneli, Hava Durumu / UV
   ================================================================ */
.eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.page-head .head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- Kutucuklar --- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.tile { --tone: var(--brand); position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--tone); box-shadow: var(--shadow); min-width: 0; }
.tile > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tile .tl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tile strong { font-size: 26px; line-height: 1.1; font-weight: 750; color: var(--text); white-space: nowrap; }
.tile strong small { font-size: 13px; font-weight: 600; color: var(--muted); }
.tile em { font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.tile-ico .ico { width: 22px; height: 22px; }
.tone-green { --tone: #2BA58C; }
.tone-blue { --tone: #3B8FE8; }
.tone-red { --tone: var(--fault); }
.tone-brand { --tone: var(--brand); }
.tone-low { --tone: #3FA34D; }
.tone-mid { --tone: #E8B100; }
.tone-high { --tone: #F07C1A; }
.tone-vhigh { --tone: #D63A3A; }
.tone-ext { --tone: #8E44AD; }

/* --- Ana sayfa ızgarası --- */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.home-grid > .card { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.hmap { height: 340px; margin: 0 16px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.chart { position: relative; height: 300px; }
.chart.tall { height: 340px; }
.chart.pad-x { padding: 4px 16px 0; }
.card-stamp { font-size: 11.5px; padding: 8px 16px 12px; margin-top: auto; }

/* --- Hava durumu --- */
.wicon { vertical-align: middle; flex: none; }
.wx { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.wx b { font-weight: 600; font-size: 13px; }
.wx-uv { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.uv { display: inline-block; min-width: 30px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; color: #fff; line-height: 1.5; white-space: nowrap; }
.uv small { font-weight: 600; font-size: 11px; opacity: .95; }
.uv-low { background: #3FA34D; }
.uv-mid { background: #E8B100; color: #2A2300; }
.uv-high { background: #F07C1A; }
.uv-vhigh { background: #D63A3A; }
.uv-ext { background: #8E44AD; }
.wx-table td, .wx-table th { white-space: nowrap; }
.wx-table td.name { white-space: normal; }
.daylen { display: inline-flex; flex-direction: column; gap: 2px; font-size: 12px; white-space: nowrap; }
.daylen > span { display: inline-flex; align-items: center; gap: 4px; }
.daylen .ico { width: 15px; height: 15px; color: #E8A100; }

/* --- Filtre çubuğu --- */
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filterbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0; }
.filterbar input[type=search] { min-width: 220px; }
.filterbar select, .filterbar input[type=search] { height: 36px; max-width: 220px; }
.colpick { position: relative; margin-left: auto; }
.colpick summary { list-style: none; border: 1px solid var(--line); }
.colpick summary::-webkit-details-marker { display: none; }
.colpick .menu { position: absolute; right: 0; top: calc(100% + 6px); width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 8px 12px; z-index: 60; }
.colpick .menu label.check { color: var(--text); font-size: 13px; flex-direction: row; }

/* --- Liste / Harita anahtarı --- */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line); transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
#dmap { height: 620px; max-height: 75vh; z-index: 0; }

/* --- Kontrol paneli tablosu --- */
table.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dash-table th { font-size: 11.5px; line-height: 1.25; vertical-align: bottom; white-space: nowrap; }
table.dash-table td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
table.dash-table tbody tr { cursor: pointer; }
table.dash-table tbody tr:hover { background: var(--surface-2); }
table.dash-table td.name { min-width: 180px; max-width: 280px; font-weight: 600; }
.ell2 { max-width: 160px; font-size: 12.5px; display: table-cell; overflow: hidden; line-height: 1.3; }
.dash-table.hide-site .col-site, .dash-table.hide-investor .col-investor, .dash-table.hide-operator .col-operator,
.dash-table.hide-acdc .col-acdc, .dash-table.hide-weather .col-weather, .dash-table.hide-pr .col-pr,
.dash-table.hide-daylen .col-daylen, .dash-table.hide-use .col-use { display: none; }
td.stack span { display: block; line-height: 1.35; }
td.stack span + span { color: var(--muted); font-size: 12px; }
.gauge { display: block; margin: 0 auto; }
.spark { display: block; margin: 0 auto; overflow: visible; }
.ptype { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); flex: none; }
.ptype .ico { width: 16px; height: 16px; }
.pr { display: inline-block; min-width: 34px; padding: 1px 6px; border-radius: 6px; font-weight: 700; text-align: center; }
.pr.good { background: color-mix(in srgb, #2BA58C 16%, transparent); color: #1F8A73; }
.pr.mid { background: color-mix(in srgb, #E8B100 20%, transparent); color: #9A7400; }
.pr.bad { background: color-mix(in srgb, var(--fault) 16%, transparent); color: var(--fault); }
.invpair { display: inline-flex; gap: 4px; text-decoration: none; }
.invpair span { min-width: 24px; padding: 1px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; text-align: center; color: #fff; }
.invpair .ok { background: #2BA58C; }
.invpair .bad { background: var(--fault); }
td.bad { color: var(--fault); font-weight: 600; }
td.link { color: var(--link); }
.acts-cell { white-space: nowrap; }
.acts .muted-ico { color: var(--muted); opacity: .45; }

@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tile strong { font-size: 22px; }
  .hmap { height: 280px; margin: 0 12px; }
  .chart, .chart.tall { height: 280px; }
  .filterbar label { flex: 1 1 140px; }
  .filterbar input[type=search], .filterbar select { min-width: 0; max-width: none; width: 100%; }
  .colpick { margin-left: 0; }
  .hide-sm { display: none; }
}

/* ================================================================
   v8 — Depolamalı santraller (pil)
   ================================================================ */
.dash-table.hide-bat .col-bat { display: none; }
.bat { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; }
.bat-bar { position: relative; width: 46px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; padding: 1px; color: var(--muted); }
.bat-bar::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2.5px; height: 5px; border-radius: 0 1px 1px 0; background: currentColor; }
.bat-bar i { display: block; height: 100%; border-radius: 1px; background: #2BA58C; }
.bat.mid .bat-bar i { background: #E8B100; }
.bat.lo .bat-bar i { background: var(--fault); }
.bat b { font-size: 12.5px; font-weight: 700; line-height: 1.1; }
.bat small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ptype.bat-type { color: #2BA58C; background: color-mix(in srgb, #2BA58C 14%, transparent); }
.bat-card { margin-bottom: 16px; }
.bat-card .card-head { flex-wrap: wrap; gap: 6px 12px; }
.bat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.bat-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface); }
.bat-item:hover { background: var(--surface-2); }
.bat-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; display: flex; flex-direction: column; gap: 2px; }
.bat-name small, .bat-day small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.bat-day { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; white-space: nowrap; }
.bat-day b { font-size: 15px; }

.eflow { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; overflow: visible; }
.eflow.compact { max-width: 300px; }
.eflow .ef-line { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.eflow .ef-line.on { stroke-dasharray: 2 9; stroke-width: 3.4; animation: ef-move 0.9s linear infinite; }
.eflow .ef-inv rect { fill: var(--surface, #fff); stroke: var(--muted); stroke-width: 1.5; }
.eflow .ef-inv path { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.eflow .ef-name { font-size: 12.5px; font-weight: 700; fill: var(--text); }
.eflow .ef-val { font-size: 12px; fill: var(--muted); }
@keyframes ef-move { to { stroke-dashoffset: -22; } }
@media (prefers-reduced-motion: reduce) { .eflow .ef-line.on { animation: none; stroke-dasharray: none; } }
.bat-item.flow { flex-direction: column; align-items: stretch; gap: 6px; }
.bat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bat-grid:has(.flow) { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.flow-card { margin-bottom: 16px; }
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 20px; align-items: center; }
.flow-main h2 { margin-bottom: 2px; }
.flow-stats { display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line); padding-left: 20px; }
.flow-stats h3 { margin: 0 0 4px; font-size: 14px; }
.flow-stats > div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.flow-stats b { margin-left: auto; color: var(--text); font-size: 14px; }
.flow-stats b small { font-weight: 500; color: var(--muted); }
.flow-stats .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.pv { background: #F39200; } .dot.home { background: #7C6CF2; } .dot.bat { background: #2BA58C; } .dot.grid { background: #3B8FE8; }
.flow-stats .soc-row { margin-top: 6px; justify-content: center; }
@media (max-width: 760px) {
  .flow-wrap { grid-template-columns: minmax(0, 1fr); }
  .flow-stats { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
}
.flow-stats .dot.bat { display: inline-block; min-width: 0; }

.bat-hist { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.bat-hist h3 { margin: 0 0 8px; font-size: 14px; }
.bat-hist .chart { height: 260px; }
.bat-hist-data .facts { font-size: 13px; }
.str-table input { padding: 5px 7px; font-size: 13px; }
.str-table .w-xs { width: 56px; } .str-table .w-sm { width: 72px; } .str-table .w-md { width: 120px; } .str-table .w-lg { width: 170px; }
.str-table input.num { text-align: right; }
.str-table tr.inactive input { opacity: .55; }
.str-table tr.inactive:focus-within input { opacity: 1; }
.str-table td { vertical-align: middle; white-space: nowrap; }
.str-table input[readonly] { background: transparent; border-color: transparent; }
.bulk-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.bulk-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0; }
.bulk-row input { width: 130px; } .bulk-row input#b-wp, .bulk-row input#b-panels, .bulk-row input#b-par { width: 80px; }
.bulk { margin-bottom: 16px; }
.str-dev { scroll-margin-top: 80px; }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -6px 18px rgba(0,0,0,.06); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.sbar span.lowv { background: var(--warn); }
@media (max-width: 760px) { .bat-hist { grid-template-columns: minmax(0, 1fr); } }

/* v11 — İş emirleri ve rota */
.prio { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.prio-urgent { background: color-mix(in srgb, var(--fault) 16%, transparent); color: var(--fault); }
.prio-high { background: color-mix(in srgb, #F07C1A 18%, transparent); color: #C25E0C; }
.prio-normal { background: color-mix(in srgb, #3B8FE8 15%, transparent); color: #2C6FB8; }
.prio-low { background: var(--surface-2); color: var(--muted); }
.tech-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.wo-table tbody tr, .wo-sug tbody tr { cursor: pointer; }
.wo-table tbody tr:hover, .wo-sug tbody tr:hover { background: var(--surface-2); }
.wo-sug td small.block, .block { display: block; }
.wo-new { margin-bottom: 16px; }
.wo-new summary { cursor: pointer; list-style: none; }
.wo-new summary::-webkit-details-marker { display: none; }
.wo-new summary h2 { display: inline; }
.wo-new summary h2::after { content: " +"; color: var(--muted); }
.wo-new[open] summary h2::after { content: ""; }
.wo-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.wo-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0; }
.wo-form .span2 { grid-column: span 2; } .wo-form .span4 { grid-column: 1 / -1; }
.wo-form textarea { resize: vertical; font: inherit; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: flex-end; }
.wo-map { height: 280px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin-top: 12px; z-index: 0; }
.wo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.note-form { display: flex; gap: 8px; margin: 8px 0 14px; } .note-form input { flex: 1; }
.wo-log { list-style: none; margin: 0; padding: 0; }
.wo-log li { display: grid; grid-template-columns: 120px 140px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.wo-log time { color: var(--muted); }
.wo-link { font-size: 11.5px; font-weight: 600; margin-left: 6px; white-space: nowrap; }
.geo-search { display: flex; gap: 8px; } .geo-search input { flex: 1; }
.geo-res { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; } .geo-res li { padding: 3px 0; }
.tech-table input:not([type=checkbox]):not([type=color]) { width: 100%; min-width: 120px; }
.tech-table input[type=color] { width: 36px; height: 28px; padding: 0; border: 0; background: none; }
.route-wrap { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.route-side { margin: 0; }
.route-map-card { margin: 0; position: sticky; top: 70px; overflow: hidden; }
.route-map { height: calc(100vh - 140px); min-height: 420px; z-index: 0; }
.route-sum { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; padding: 0 16px 10px; font-size: 14px; }
.route-sum b { font-size: 20px; }
.route-list, .route-pool { list-style: none; margin: 0; padding: 0 12px; }
.route-list li, .route-pool li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.route-list .rtxt, .route-pool .rtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.rtxt a { font-weight: 600; } .rtxt small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rnum { flex: none; width: 24px; height: 24px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.rleg { white-space: nowrap; }
.rbtns { display: flex; gap: 2px; } .rbtns button, .radd { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; color: var(--muted); font-size: 11px; }
.radd { font-size: 16px; font-weight: 700; color: var(--brand); }
.rbtns button:hover, .radd:hover { background: var(--surface-2); color: var(--text); }
.route-save { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.card-head.sub { border-top: 1px solid var(--line); margin-top: 6px; }
.rpin span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
@media (max-width: 980px) {
  .route-wrap { grid-template-columns: minmax(0, 1fr); }
  .route-map-card { position: static; } .route-map { height: 360px; min-height: 0; }
  .wo-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wo-log li { grid-template-columns: 1fr; gap: 2px; }
}

/* v12 alarm tespitleri */
.alarm-sub{font-size:14px;font-weight:600;margin:0;padding:14px 16px 6px;display:flex;align-items:center;gap:8px;color:var(--muted,#667)}
.alarm-sub .pill{font-size:12px}
.src-tag{display:inline-block;font-size:11px;font-weight:600;padding:1px 6px;border-radius:6px;background:var(--line,#e6e8ec);color:var(--muted,#667)}
.src-tag.panel{background:#e8f1fd;color:#2563c9}
.st-open{color:#d63a3a;font-weight:600;margin-top:3px}
.st-closed{color:#2ba58c;font-weight:600;margin-top:3px}

/* v13 santral erişimi */
.acc-user{border-top:1px solid var(--line);padding:10px 0}
.acc-user>summary{cursor:pointer;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.acc-form{margin-top:10px;display:flex;flex-direction:column;gap:10px}
.acc-scope{display:flex;gap:18px;flex-wrap:wrap}
.acc-scope label,.acc-wo{display:flex;gap:6px;align-items:center;cursor:pointer}
.acc-pick{display:flex;flex-direction:column;gap:8px}
.acc-pick[hidden]{display:none}
.acc-pick h4{margin:6px 0 0;font-size:13px}
.acc-q{max-width:320px}
.acc-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:4px 14px;max-height:260px;overflow:auto;border:1px solid var(--line);border-radius:8px;padding:8px 10px}
.acc-list label{display:flex;gap:6px;align-items:center;font-size:13px;cursor:pointer;min-width:0}
.acc-list label[hidden]{display:none}
.acc-list small{margin-left:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acc-scope label,.acc-wo,.acc-list label{flex-direction:row!important;white-space:nowrap;font-weight:500}
.acc-scope input,.acc-wo input,.acc-list input{width:auto;margin:0}

/* v14 OSB yükleme + birimler */
.osb-map{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px 16px;align-items:end;margin-top:8px}
.osb-map label{display:flex;flex-direction:column;gap:4px;font-size:13px;font-weight:600}
.osb-map label small{font-weight:400}
.osb-map .chk{flex-direction:row;align-items:center;gap:8px;font-weight:500;grid-column:1/-1}
.osb-map .chk input{width:auto}
.osb-map .form-actions{grid-column:1/-1}
.osb-preview td,.osb-preview th{white-space:nowrap;font-size:12px}
.osb-preview tr.hdr td{font-weight:700;background:var(--surface-2,rgba(0,0,0,.04))}
.osb-h{font-size:15px;margin:18px 0 8px}
small.u{font-size:.74em;font-weight:500;color:var(--muted);margin-left:2px;letter-spacing:0}


/* Giriş ekranı (v18) */
main.wrap:has(> .lp) { max-width: none; padding: 0; margin: 0; }
.lp { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--bg); }
.lp-hero { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 48px 56px;
  background: radial-gradient(900px 520px at 85% 110%, rgba(243,146,0,.28), transparent 60%), radial-gradient(700px 420px at -10% -10%, rgba(255,213,0,.10), transparent 60%), #131433; }
.lp-hero::after { content: ""; position: absolute; right: -140px; top: -140px; width: 420px; height: 420px; border-radius: 50%; border: 18px solid rgba(255,213,0,.07); }
.lp-hero-in { position: relative; z-index: 1; width: 100%; max-width: 560px; margin: 0 auto; }
.lp-logo { display: block; width: 210px; max-width: 70%; height: auto; margin-bottom: 36px; }
.lp-hero h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.4px; margin: 0 0 8px; color: #fff; }
.lp-lead { color: #B9BBD6; font-size: 15.5px; margin: 0 0 28px; }
.lp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lp-stat { position: relative; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 14px 16px 12px; min-height: 92px; }
.lp-stat-l { display: block; font-size: 11px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: #9EA1C4; margin-bottom: 4px; }
.lp-stat b { display: block; font-size: 26px; line-height: 1.15; font-weight: 700; color: #fff; }
.lp-stat small { display: block; font-size: 11.5px; font-style: italic; color: #9EA1C4; }
.lp-ico { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 34px; height: 34px; }
.lp-ico svg { width: 30px; height: 30px; }
.lp-stat.t-green .lp-ico { color: #3CC07A; }
.lp-stat.t-blue .lp-ico { color: #6EA8FF; }
.lp-stat.t-orange .lp-ico { color: #F39200; }
.lp-stat.t-yellow .lp-ico { color: #FFD500; }
.lp-live { margin: 16px 0 0; font-size: 12.5px; color: #9EA1C4; display: flex; align-items: center; gap: 8px; }
.lp-live i { width: 8px; height: 8px; border-radius: 50%; background: #3CC07A; box-shadow: 0 0 0 0 rgba(60,192,122,.6); animation: lpPulse 2s infinite; }
@keyframes lpPulse { 0% { box-shadow: 0 0 0 0 rgba(60,192,122,.55); } 70% { box-shadow: 0 0 0 8px rgba(60,192,122,0); } 100% { box-shadow: 0 0 0 0 rgba(60,192,122,0); } }
@media (prefers-reduced-motion: reduce) { .lp-live i { animation: none; } }
.lp-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.lp-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px 30px 26px; box-shadow: 0 10px 40px rgba(20,20,51,.08); }
.lp-card h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.2px; }
.lp-sub { margin: 0 0 20px; }
.lp-card label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 14px; }
.lp-card input:not([type=hidden]) { display: block; width: 100%; margin-top: 6px; height: 46px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.lp-pass { position: relative; display: block; }
.lp-pass input { padding-right: 76px !important; }
.lp-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 3px; border: 0; background: transparent; color: var(--muted); font: 600 12.5px system-ui, sans-serif; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.lp-eye:hover { color: var(--text); background: var(--surface-2); }
.lp-row { display: flex; justify-content: flex-end; margin: -4px 0 16px; font-size: 13px; }
.lp-row.center { justify-content: center; margin: 16px 0 0; }
.lp-row a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.lp-row a:hover { text-decoration: underline; }
.lp-btn { height: 48px; font-size: 15px; font-weight: 700; border-radius: 10px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.lp-note { margin: 16px 0 0; }
.lp-foot { margin: 22px 0 0; font-size: 12px; color: var(--muted); }
.pw-req ul { margin: 6px 0 8px; padding-left: 18px; }
.pw-req li { margin: 4px 0; }
.pw-req form.inline { display: inline; }
.u-email { display: flex; gap: 6px; align-items: center; }
.u-email input { width: 190px; height: 32px; font-size: 13px; }
@media (max-width: 900px) {
  .lp { grid-template-columns: 1fr; }
  .lp-hero { padding: 28px 20px 24px; }
  .lp-logo { width: 160px; margin-bottom: 18px; }
  .lp-hero h1 { font-size: 22px; }
  .lp-lead { font-size: 14px; margin-bottom: 18px; }
  .lp-stats { gap: 10px; }
  .lp-stat { min-height: 80px; padding: 12px 14px 10px; }
  .lp-stat b { font-size: 22px; }
  .lp-ico svg { width: 24px; height: 24px; }
  .lp-side { justify-content: flex-start; padding: 22px 16px 28px; }
  .lp-card { padding: 24px 20px 20px; box-shadow: none; }
}


/* v20: giriş tanıtımı, yasal sayfalar, iletişim, Modbus */
.lp-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lp-feats li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 14px 16px; }
.lp-fi { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(243,146,0,.16); color: #F7A833; }
.lp-fi svg { width: 22px; height: 22px; }
.lp-feats b { display: block; color: #fff; font-size: 14.5px; }
.lp-feats small { display: block; color: #A9ABC8; font-size: 13px; }
.lp-welcome { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); text-align: center; }
.lp-welcome a, .lp-foot a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.lp-welcome a:hover, .lp-foot a:hover { text-decoration: underline; }
.lp-foot { text-align: center; line-height: 1.8; }
@media (max-width: 900px) {
  .lp-feats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lp-feats li { flex-direction: column; gap: 8px; padding: 12px; }
  .lp-feats small { font-size: 12px; }
}
.legal { max-width: 820px; margin: 0 auto; padding: 8px 0 24px; }
.legal-logo img { display: block; width: 180px; height: auto; margin: 18px auto 22px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.legal-tabs a { text-decoration: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.legal-tabs a[aria-current] { color: var(--text); border-color: var(--brand); font-weight: 600; }
.legal-doc h1 { margin-bottom: 4px; }
.legal-doc h2 { margin: 20px 0 6px; font-size: 15px; }
.legal-doc p { line-height: 1.65; }
.legal-doc .full { grid-column: 1 / -1; }
.legal-doc textarea { width: 100%; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.fb-item { padding: 12px 16px; border-top: 1px solid var(--line); }
.fb-item.done { opacity: .55; }
.fb-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 4px; }
.fb-head form { margin-left: auto; }
.fb-item p { margin: 0; white-space: normal; }
.mb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mb-test { margin: 0 16px 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.mb-test ul { margin: 6px 0 0; padding-left: 18px; }
.mb-test li.bad { color: var(--fault); }
.mb-test li.good { color: var(--ok); }
.mb-err { display: block; max-width: 260px; white-space: normal; }
.mb-table td { vertical-align: middle; }
.mb-plant { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; grid-column: 1 / -1; }
.mb-plant legend { font-weight: 600; padding: 0 6px; }
.mb-plant .radio { display: inline-flex; gap: 6px; align-items: center; margin-right: 16px; font-weight: 500; }
.mb-new, .mb-old { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.mb-new[hidden], .mb-old[hidden] { display: none !important; }

@media (max-width: 600px) { .lp-feats { display: none; } .lp-hero { padding: 22px 20px 20px; } .lp-lead { margin: 0; } .lp-logo { margin-bottom: 14px; } }

/* v22: özellik başlığı renkli, açıklama aynı satırda devam eder */
.lp-ft { display: block; line-height: 1.5; }
.lp-feats .lp-ft b { display: inline; color: #F7A833; font-size: 15px; margin-right: 4px; }
.lp-feats .lp-ft small { display: inline; color: #C9CBE2; font-size: 14px; }
.lp-feats li { align-items: center; }

/* v23: saha kodu */
.pcode { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 18px; vertical-align: 1px; }
.pcode-lg { color: var(--muted); font-weight: 600; margin-right: 2px; }
input.w-xs { width: 74px; }
