/* PikoTV DAB/DAB+ Headend: ürün ailesi görsel dili
   Palet: lacivert (#0A2540) + turuncu (#E25C26)
   Aksiyon renkleri: yeşil=zararsız, mavi=kaynak, kırmızı=yıkıcı, sarı=güncelleme
   Açık/koyu tema (data-theme) + RTL (dir=rtl) destekli. */

:root {
  --navy: #0A2540; --navy-2: #10314f;
  --orange: #E25C26; --orange-2: #f0703a;
  --bg: #eef1f6; --panel: #f7f9fc; --card: #ffffff;
  --line: #dae0ea; --text: #1f2a37; --muted: #6b7683;
  --green: #2e9e44; --blue: #1f6fd0; --red: #d23b2f; --yellow: #d99a06;
  /* M46: --yellow METİN rengi olarak beyaz kartta 2.45:1 kalıyordu (AA
     başarısız); metin için koyulaştırılmış ayrı token (≈5.4:1). Zemin
     olarak kullanılan --yellow değişmedi. */
  --yellow-text: #8a6500;
  --shadow: 0 1px 3px rgba(16,49,79,.08), 0 4px 16px rgba(16,49,79,.06);
  --radius: 10px;
}
:root[data-theme="dark"] {
  --navy: #0b1524; --navy-2: #0f1e30;
  --bg: #0c1420; --panel: #111c2b; --card: #162334;
  --line: #26374d; --text: #e5edf7; --muted: #93a2b5;
  --green: #35b552; --blue: #4c93e6; --red: #e5564a; --yellow: #e6ab1f;
  --yellow-text: #e6ab1f; /* koyu zeminde sarı metin zaten okunur */
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }        /* yazar kuralları ezmesin */
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); }
button { font-family: inherit; }

/* ---- header ---- */
header { display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: #fff; padding: 8px 16px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 20; }
.brand-logo { height: 30px; width: 30px; border-radius: 7px; }
.brand { color: var(--orange); font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.brand-sub { font-size: 13.5px; opacity: .9; }
.spacer { flex: 1; }
.hdr-right { font-size: 12.5px; opacity: .85; }
.hdr-user { font-size: 12.5px; background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 12px; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.conn-dot.ok { background: #37d067; box-shadow: 0 0 7px #37d067aa; }
.conn-dot.bad { background: var(--red); }
.lang-select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px; padding: 4px 6px; font-size: 12.5px; }
.lang-select option { color: #000; }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 5px 10px; margin: 0; }
.btn.ghost:hover { background: rgba(255,255,255,.14); }
.btn.ghost.icon { padding: 5px 9px; font-size: 15px; line-height: 1; }

/* ---- login ---- */
#login-screen { position: fixed; inset: 0; z-index: 50; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #163b5e, var(--navy) 60%); }
.login-card { background: var(--card); border-radius: 16px; padding: 34px 38px;
  width: min(390px, 92vw); text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.login-logo { width: 78px; height: 78px; border-radius: 18px; }
.login-brand { margin-top: 8px; }
.login-brand .brand { font-size: 24px; }
.login-card h1 { margin: 4px 0 22px; font-size: 17px; color: var(--muted); font-weight: 600; }
.login-card input { display: block; width: 100%; margin-bottom: 12px; padding: 11px 12px;
  font-size: 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--text); }
.login-card .btn { width: 100%; margin: 4px 0 8px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 6px 0 0; }
.login-card code { font-size: 11px; }
.login-lang { margin-top: 14px; }
.login-lang .lang-select { background: var(--panel); color: var(--text); border-color: var(--line); }
.login-lang .lang-select option { color: var(--text); background: var(--panel); }

/* ---- layout ---- */
.layout { display: flex; min-height: calc(100vh - 47px); }
/* Menü uzun sayfalarda ekranda kalır (sticky); kaydırırken kaybolmasın.
   Header 47px yüksekliğinde; menü onun altına yapışır ve gerekirse kendi
   içinde kayar (saha geri bildirimi). */
#menu { width: 210px; background: var(--navy-2); padding: 10px 0; flex-shrink: 0;
  position: sticky; top: 47px; align-self: flex-start;
  max-height: calc(100vh - 47px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; min-height: calc(100vh - 47px); }
/* M35: menü altında sürüm + günlük yapı damgası */
.menu-version { margin-top: auto; padding: 14px 18px 6px; color: #8ea0b6;
  font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: .2px;
  border-top: 1px solid rgba(255,255,255,.07); }
#menu::-webkit-scrollbar { width: 8px; }
#menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.menu-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: start;
  background: none; border: 0; color: #c3cede; padding: 11px 18px; font-size: 14px;
  cursor: pointer; border-inline-start: 3px solid transparent; }
.menu-item .mi { width: 18px; text-align: center; opacity: .8; font-size: 14px; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-item.active { color: #fff; border-inline-start-color: var(--orange);
  background: rgba(226,92,38,.14); font-weight: 600; }
main { flex: 1; padding: 20px 26px; max-width: 1180px; min-width: 0; }
h2 { margin: 2px 0 16px; color: var(--text); font-size: 22px; }
.sub-h { margin: 26px 0 6px; color: var(--text); font-size: 15px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.lg { color: var(--green); font-weight: 700; } .lb { color: var(--blue); font-weight: 700; }
.lr { color: var(--red); font-weight: 700; } .ly { color: var(--yellow-text); font-weight: 700; }

/* ---- dashboard özeti ---- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow); }
/* Plan uyarı satırı: artık bildirim çanının İÇİNDE yaşıyor (Faz UI).
   Panel'deki .plan-warns sarmalayıcısı kaldırıldı; .plan-warn kuralı
   çan panelinde yeniden kullanılıyor. */
.plan-warn { background: color-mix(in srgb, var(--orange) 12%, var(--card));
  border: 1px solid var(--orange); border-radius: var(--radius);
  padding: 9px 13px; font-size: 13.5px;
  /* Rengi AÇIKÇA veriyoruz, miras almıyoruz. Bu kural hem panelde hem
     bildirim çanının içinde kullanılıyor; çan header'ın altında yaşadığı
     için miras yoluyla beyaz metin kapıyordu. Açık zeminli bir kutunun
     metin rengi, taşındığı yere bağlı OLMAMALI. */
  color: var(--text); }

/* ---- bildirim merkezi (başlık, sağ üst) ---- */
.bell-wrap { position: relative; display: inline-flex; }
.bell-btn { position: relative; font-size: 15px; }
/* Rozet MANTIKSAL kenara tutturulur (inset-inline-end): RTL'de
   kendiliğinden diğer köşeye geçer, ayrı kural gerekmez. */
.bell-badge { position: absolute; top: -4px; inset-inline-end: -4px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--orange); color: #111; font-size: 11px; font-weight: 700;
  line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--navy-2); }
.bell-badge.crit { background: var(--red); color: #fff; }
.bell-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
  width: min(420px, calc(100vw - 32px)); max-height: 65vh; overflow-y: auto;
  /* TANIMSIZ DEĞİŞKEN KUSURU: burada `var(--fg)` yazıyordu ama projede
     böyle bir token YOK; metin tokenı `--text`. Geçersiz bildirim
     düşüyor ve panel, ATASI olan header'ın `color:#fff` değerini miras
     alıyordu. AÇIK TEMADA sonuç: açık pembe zeminde beyaz metin, yani
     uyarılar OKUNAMIYORDU. Koyu temada tesadüfen doğru göründüğü için
     gözden kaçmıştı. */
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; text-align: start; }
.bell-sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin-top: 2px; }
.bell-empty { color: var(--muted); font-size: 13px; padding: 12px 4px; text-align: center; }
.bell-item { border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.bell-item.crit { border-color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, var(--card)); }
.bell-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bell-meta { font-size: 11.5px; color: var(--muted); }
.tile.attn { border-color: var(--orange); }
.tile-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tile-v { font-size: 17px; margin-top: 5px; }
.tile-v .hint { font-size: 12px; }
.tile-v .ok { color: var(--green); } .tile-v .warn { color: var(--orange); }
.tile-v .alarm-on { color: var(--red); }
.bar { height: 7px; background: color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 5px; overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--orange));
  border-radius: 5px; transition: width .3s; }
.bar-fill.over { background: var(--red); }

/* ---- M19: canlı izleme ölçer ---- */
.mon-row { display: grid; grid-template-columns: minmax(140px,1.2fr) minmax(120px,2fr) auto;
  gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mon-row:last-child { border-bottom: 0; }
.mon-name b { display: block; }
.meter { position: relative; height: 16px; background: color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 5px; transition: width .35s;
  background: var(--green); }
.meter-fill.ok { background: var(--green); }
.meter-fill.low { background: var(--blue); }
.meter-fill.hot { background: var(--red); }
/* Ölçer değeri: bar dolunca (yeşil/kırmızı zemin) koyu metin okunmuyordu.
   Metni bara yaymak yerine kendi "çip" zeminine alıyoruz; dolu/boş, açık/koyu
   tema, yeşil/mavi/kırmızı fark etmeksizin okunur (saha geri bildirimi). */
.meter-val { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.4;
  color: var(--text); background: color-mix(in srgb, var(--card) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  padding: 0 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.row-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- M38: SRT akış metrikleri tablosu ---- */
.srt-row { display: grid; gap: 10px; align-items: center; padding: 7px 0;
  grid-template-columns: minmax(150px, 2fr) repeat(6, minmax(72px, 1fr));
  border-bottom: 1px solid var(--line); font-size: 13px; }
.srt-row:last-child { border-bottom: 0; }
.srt-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); border-bottom: 1px solid var(--line); }
.srt-row .num { text-align: end; font-variant-numeric: tabular-nums; }
.srt-row .num.ok { color: var(--green); font-weight: 600; }
.srt-row .num.warn { color: var(--orange); font-weight: 600; }
.srt-row .num.bad { color: var(--red); font-weight: 600; }

/* ---- M34: ham export araç çubuğu (süre + çıkış biçimi) ---- */
.mon-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--line) 35%, transparent); }
.mon-tools label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.mon-tools .exp-dur { width: 72px; }
.mon-tools input, .mon-tools select { padding: 3px 6px; font-size: 13px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; }

/* ---- M20: servis satır-içi (accordion) düzenleme paneli ---- */
tr[data-svc].editing > td { background: color-mix(in srgb, var(--blue) 12%, transparent); }
tr.svc-accordion > td { padding: 0; background: color-mix(in srgb, var(--line) 25%, transparent); }
.acc-body { margin: 0; border: 0; border-radius: 0; box-shadow: none;
  border-inline-start: 3px solid var(--blue); animation: accIn .18s ease; }
.acc-head { font-size: 14px; margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); }
@keyframes accIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---- M21: ensemble-başına kırılım (çoklu-mux) ---- */
.ens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; margin-bottom: 18px; }
.ens-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); border-inline-start: 3px solid var(--blue); }
.ens-card.over { border-inline-start-color: var(--red); }
.ens-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ens-head b { font-size: 15px; }
.ens-head .tag.alarm { background: var(--red); color: #fff; margin-inline-start: auto; }
.ens-cu { margin-top: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ens-cu .warn { color: var(--red); font-weight: 600; }
.ens-meta { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.ens-meta .ok { color: var(--green); } .ens-meta .warn { color: var(--orange); }
.node-groups { display: flex; flex-direction: column; gap: 6px; }
.node-group-head { font-size: 13px; margin: 12px 0 2px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 6px; }
.node-group-head b { letter-spacing: -.01em; }

/* ---- kartlar ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.node-card .node-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.node-card .node-head h3 { margin: 0; }
.card .meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.info-card { margin-bottom: 14px; font-size: 13.5px; line-height: 1.6; }

/* ---- LED ---- */
.led { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.led-up { background: #37d067; box-shadow: 0 0 6px #37d067cc; }
.led-warn { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.led-down { background: var(--red); box-shadow: 0 0 6px var(--red); }
.led-muted { background: var(--muted); }

/* ---- rozetler ---- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11.5px; font-weight: 700; color: #fff; }
.badge.up { background: var(--green); } .badge.down { background: var(--red); }
/* M46: sarı zeminde beyaz metin 2.45:1; .btn.yellow emsaliyle siyah metin */
.badge.stopped { background: var(--muted); } .badge.starting { background: var(--yellow); color: #111; }
.tag { display: inline-block; background: var(--orange); color: #fff; font-size: 10px;
  font-weight: 800; padding: 1px 7px; border-radius: 9px; margin-inline-start: 6px; vertical-align: 1px; }
.evtag { font-family: Consolas, monospace; font-size: 12px; background: color-mix(in srgb, var(--blue) 15%, transparent);
  color: var(--blue); padding: 1px 8px; border-radius: 6px; }

/* ---- tablolar ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th { background: var(--navy); color: #fff; text-align: start; padding: 9px 12px; font-size: 12.5px; white-space: nowrap; }
td { padding: 9px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 60%, transparent); }
.mono { font-family: Consolas, monospace; font-size: 12px; white-space: nowrap; }

/* ---- butonlar ---- */
/* M46: taban .btn'e AÇIK zemin verildi. Öncesinde background yoktu →
   renk sınıfı unutulan her düğme UA buttonface (≈beyaz) üstünde beyaz
   metinle GÖRÜNMEZ oluyordu (saha bulgusu: Loglar/Kopyala). */
.btn { border: 0; border-radius: 7px; background: var(--navy-2); color: #fff;
  padding: 7px 13px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; margin-inline-end: 6px; transition: filter .12s, transform .05s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.btn.green { background: var(--green); } .btn.blue { background: var(--blue); }
.btn.red { background: var(--red); }
/* sarı zeminde beyaz metin okunmuyordu → siyah metin (saha geri bildirimi) */
.btn.yellow { background: var(--yellow); color: #111; }
/* M34: indirme (export) düğmeleri: dinleme düğmelerinden görsel olarak ayrık
   ama SÖNÜK DEĞİL: sade .btn açık temada gri-üstüne-gri kalıp "pasif" görünüyordu. */
.btn.slate { background: var(--navy-2); color: #fff; }
.btn.primary { background: var(--orange); } .btn.big { font-size: 16px; padding: 12px 24px; }

.toolbar { margin: 12px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cu-badge { margin-inline-start: 6px; padding: 5px 12px; border-radius: 12px;
  background: var(--navy-2); color: #fff; font-size: 12.5px; font-weight: 700; }
.cu-badge.over { background: var(--red); }

/* ---- taslak çubuğu ---- */
#draft-bar { background: color-mix(in srgb, var(--yellow) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, var(--line));
  border-inline-start: 5px solid var(--yellow); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.draft-actions { margin-inline-start: auto; }
#draft-issues, #cfg-issues { width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; font-size: 12px; white-space: pre-wrap; margin-top: 8px; }

/* ---- ASA ---- */
.alarm-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.alarm-state { font-size: 22px; font-weight: 800; text-align: center; padding: 16px;
  border-radius: var(--radius); margin-bottom: 14px; color: #fff; }
.alarm-state.idle { background: var(--green); }
.alarm-state.active { background: var(--red); animation: pulse .8s infinite; }
@keyframes pulse { 50% { opacity: .72; } }

/* ---- profil editör ---- */
#cfg-editor { width: 100%; height: 420px; font-family: Consolas, monospace; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  background: var(--card); color: var(--text); }

/* ---- modal + form ---- */
.modal { position: fixed; inset: 0; background: rgba(6,18,32,.6); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--card); color: var(--text); width: min(760px, 95vw);
  max-height: 88vh; border-radius: 12px; padding: 18px 20px; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.modal-box h3 { color: var(--text); margin: 0 0 12px; }
.modal-box pre { font-size: 12px; white-space: pre-wrap; background: var(--panel);
  padding: 10px; border-radius: 8px; max-height: 60vh; overflow: auto; }
.form-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 9px; margin: 0 0 10px; padding: 10px 12px; }
legend { font-size: 12.5px; font-weight: 700; color: var(--orange); padding: 0 6px; }
label.frm { display: block; margin-bottom: 10px; font-size: 12.5px; }
label.frm > span { display: block; font-weight: 600; margin-bottom: 3px; color: var(--muted); }
label.frm input, label.frm select { width: 100%; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13px; background: var(--panel); color: var(--text); }
label.frm small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.frm-chk { display: block; font-size: 12.5px; margin: 8px 0; cursor: pointer; }
.form-actions { text-align: end; margin-top: 12px; }
.form-error { color: var(--red); font-size: 13px; margin: 8px 0 0; }
fieldset.net-fs { margin-top: 8px; background: color-mix(in srgb, var(--blue) 6%, transparent); }
fieldset.net-fs legend { color: var(--blue); }

/* tooltip (i) */
.tip { display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; font-size: 10.5px; font-weight: 700;
  background: var(--blue); color: #fff; cursor: help; vertical-align: 1px;
  font-style: normal; user-select: none; }
.tip:hover, .tip:focus { background: var(--orange); outline: none; }

/* ayarlar kartları */
.settings-card { margin-bottom: 16px; }
.settings-card h3 { color: var(--orange); font-size: 16px; margin: 0 0 4px; }
.settings-card .form-cols { margin-top: 10px; }
.settings-card #tls-form { margin-top: 10px; max-width: 520px; }
.warn-note { color: var(--yellow-text); font-weight: 600; margin-top: 8px; }
#settings-issues { background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; font-size: 12px; white-space: pre-wrap; }

/* düğüm amaç cümlesi */
.purpose { font-style: italic; opacity: .9; }
.node-card .purpose { margin-top: 4px; }

/* TLS sertifika durum kartı */
#tls-status-card { margin-bottom: 12px; }
.tls-status { border-radius: 8px; padding: 10px 14px; border-inline-start: 5px solid var(--green);
  background: color-mix(in srgb, var(--green) 8%, var(--card)); }
.tls-status.warn { border-inline-start-color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 10%, var(--card)); }
.tls-status.crit { border-inline-start-color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, var(--card)); }
.tls-status .big { font-size: 18px; }
.tls-status.crit .big { color: var(--red); }
.tls-row { font-size: 14px; }
.tls-meta { margin-top: 4px; }
.tls-badge { padding: 8px 12px; border-radius: 8px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); }
.tls-badge.warn { border-color: var(--yellow); }

/* çoklu-mux seçici */
.mux-selector { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--orange) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--orange) 30%, var(--line));
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 14px; }
.mux-selector select { padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13px; background: var(--panel); color: var(--text);
  font-weight: 600; }
.mux-selector .btn { margin: 0; }

/* olaylar: tür çipleri + düğüm logu */
.chips { display: inline-flex; gap: 6px; margin-inline-end: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 14px; padding: 5px 14px; font-size: 12.5px; cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.kindtag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 8px; color: #fff; }
.kindtag.user { background: var(--blue); }
.kindtag.system { background: var(--muted); }
.nodelog { background: #101820; color: #cde3c8; border-radius: var(--radius);
  padding: 12px; font-size: 12px; white-space: pre-wrap; max-height: 420px;
  overflow: auto; direction: ltr; text-align: left; }

/* kullanım kılavuzu */
.manual-layout { display: flex; gap: 18px; align-items: flex-start; }
.manual-toc { position: sticky; top: 60px; width: 230px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 0; box-shadow: var(--shadow); max-height: calc(100vh - 80px); overflow-y: auto; }
.toc-item { display: block; width: 100%; text-align: start; background: none; border: 0;
  color: var(--text); padding: 8px 14px; font-size: 12.5px; cursor: pointer;
  border-inline-start: 3px solid transparent; }
.toc-item:hover { background: color-mix(in srgb, var(--orange) 10%, transparent);
  border-inline-start-color: var(--orange); }
.manual-body { flex: 1; min-width: 0; }
.manual-sec { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px;
  box-shadow: var(--shadow); scroll-margin-top: 60px; }
.manual-sec h3 { margin: 0 0 10px; color: var(--orange); font-size: 16px; }
.manual-html { font-size: 13.5px; line-height: 1.65; }
.manual-html p { margin: 8px 0; }
.manual-html ul, .manual-html ol { margin: 8px 0; padding-inline-start: 22px; }
.manual-html li { margin: 5px 0; }
/* Kılavuz görselleri ve karşılaştırma tabloları (manual.js <figure>/<table class="mtab">). */
.manual-html figure.mfig { margin: 12px 0 14px; }
.manual-html figure.mfig img { display: block; max-width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.manual-html figure.mfig figcaption { font-size: 12px; color: var(--muted); margin-top: 5px; }
.manual-html table.mtab { margin: 8px 0; font-size: 12.5px; }
.manual-html table.mtab th { white-space: normal; padding: 6px 8px; }
.manual-html table.mtab td { padding: 6px 8px; font-size: 12.5px; vertical-align: top; }
.manual-html code { background: var(--panel); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; font-size: 12px; direction: ltr;
  unicode-bidi: embed; display: inline-block; }
@media (max-width: 900px) {
  .manual-layout { flex-direction: column; }
  .manual-toc { position: static; width: 100%; max-height: none; }
}

/* ---- toast ---- */
#toast { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 90; }
.toast-item { background: var(--navy); color: #fff; padding: 10px 16px;
  border-inline-start: 4px solid var(--orange); border-radius: 8px; margin-top: 8px;
  font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.3); max-width: 340px; }

/* ---- RTL ince ayar ---- */
[dir="rtl"] .menu-item { text-align: right; }
[dir="rtl"] .mono, [dir="rtl"] .evtag, [dir="rtl"] #cfg-editor { direction: ltr; text-align: left; }

/* ---- responsive ---- */
@media (max-width: 720px) {
  #menu { width: 56px; } .menu-item span:not(.mi) { display: none; }
  main { padding: 14px; }
}

/* M36: SRT ileri parametreleri: katlanır bölüm */
.srt-adv { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 60%, transparent); }
.srt-adv > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px;
  font-weight: 600; color: var(--muted); user-select: none; }
.srt-adv[open] > summary { border-bottom: 1px solid var(--line); color: var(--text); }
.srt-adv .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 4px 14px; padding: 10px 12px; }

/* M37: canlı log görüntüleyici */
.log-modal { width: min(1100px, 94vw); }
.log-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; }
.log-filter { flex: 1 1 220px; padding: 6px 9px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); }
.log-bar label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.logbox { max-height: 60vh; overflow: auto; background: #0d1a26; color: #cfe3f5;
  padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; margin: 0 0 10px; }
:root[data-theme="dark"] .logbox { background: #080f17; }

/* M30: PAD format örneği + dosya yükleme satırı */
.pad-fmt { margin: 8px 0 6px; padding: 8px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  border: 1px dashed var(--line); font-size: 12px; }
.pad-fmt b { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.pad-fmt pre { margin: 0; white-space: pre-wrap; font-size: 11.5px; line-height: 1.5; }
.pad-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.pad-upload input[type=file] { font-size: 12px; max-width: 260px; }
/* Ensemble servisi girişi: keşfet düğmesi + servis listesi tek satırda */
.ens-disc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.ens-disc select { flex: 1 1 200px; min-width: 0; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13px; background: var(--panel); color: var(--text); }

/* ---------- M43: Media Gateway ---------- */
.gw-card { margin-bottom: 14px; }
.gw-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gw-head .gw-acts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
[dir="rtl"] .gw-head .gw-acts { margin-left: 0; margin-right: auto; }
.gw-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.gw-ok { background: var(--green); }
.gw-warn { background: var(--yellow); }
.gw-bad { background: var(--red); }
.gw-idle { background: var(--muted, #888); opacity: .55; }
.gw-badge {
  font-size: 11px; letter-spacing: .3px; padding: 1px 6px; border-radius: 9px;
  /* M46: --panel2 hiç tanımlanmamıştı; fallback her zaman devredeydi */
  border: 1px solid var(--line); background: var(--panel);
}
.gw-badge.ok { border-color: var(--green); color: var(--green); }
.gw-badge.warn { border-color: var(--yellow); color: var(--yellow-text); }
.gw-badge.bad { border-color: var(--red); color: var(--red); }
.gw-badge.muted { opacity: .6; }
.gw-io { margin: 8px 0; }
.gw-io-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.gw-io-l { font-weight: 600; min-width: 70px; }
.gw-leg { display: inline-flex; align-items: center; gap: 6px; }
.gw-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
table.gw-dests { width: 100%; }
table.gw-dests td, table.gw-dests th { padding: 4px 8px; }
table.gw-dests .num { text-align: right; font-variant-numeric: tabular-nums; }
tr.gw-leg-row td { border-top: none; opacity: .92; }
.gw-mon { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.gw-edit { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.gw-edit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.gw-edit-row > label { min-width: 170px; }
/* M49: tam düzenleme paneli: uç (endpoint) grupları ve hedef/servis kartları */
.gw-edit-h { margin: 14px 0 6px; font-size: 13.5px; color: var(--text);
  border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.gw-ep { margin: 4px 0 8px; padding-inline-start: 12px;
  border-inline-start: 3px solid var(--line); }
.gw-ep-card { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 60%, transparent); }
.gw-edit input[type="text"], .gw-edit input:not([type]), .gw-edit select {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); color: var(--text); font-size: 13px; min-width: 180px; }
.gw-edit .num-in { min-width: 90px; }
.gw-valid { margin: 6px 0 10px; }
.gw-valid p { margin: 3px 0; font-size: 12.5px; }
.gw-fed { margin: 6px 0 0; padding-left: 18px; }
[dir="rtl"] .gw-fed { padding-left: 0; padding-right: 18px; }
.num-in { width: 84px; text-align: right; }
.ev-filters { gap: 6px; flex-wrap: wrap; font-size: 13px; }
.ev-filters label { opacity: .75; }
.btn-link { background: none; border: none; color: var(--blue); cursor: pointer; text-decoration: underline; }
.kindtag.gateway { border-color: var(--blue); }
.kindtag.alarm { border-color: var(--red); }

/* M50: satır içinde küçük onay kutusu (demux bacağı aç/kapa gibi, bir
   satırın sonunda yer alan üç-durumlu olmayan anahtarlar için). */
.inline-chk { display: inline-flex; align-items: center; gap: 4px;
  font-size: .85rem; color: var(--muted); white-space: nowrap; }
.inline-chk input { margin: 0; }

/* M58: anons ses kütüphanesi + çalma listesi düzenleyici */
.lib-audio { display: block; margin-top: 6px; max-width: 260px; }
.pl-list { display: flex; flex-direction: column; gap: 4px; }
.pl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-row .pl-n { min-width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-row .btn { padding: 2px 8px; }
.pl-add { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.pl-add select { flex: 1 1 auto; min-width: 0; }
.dow { display: flex; gap: 10px; flex-wrap: wrap; }

/* M60-F: rapor teslimat mesajı.
   Tarayıcı denemesinde ÖLÇÜLEN kusur: reddedilen bir kayıt ile başarılı
   bir kayıt EKRANDA AYNI görünüyordu (ikisi de gri .hint). Operatör
   "SMTP yapılandırılmadan teslimat açılamaz" uyarısını onay sanabilirdi.
   Renk her iki temada da tanımlı token'lardan gelir. */
#rep-sch-msg { min-height: 18px; font-weight: 600; }
#rep-sch-msg.err { color: var(--red); }
#rep-sch-msg.ok  { color: var(--green); }
