/* =========================================================================
   ERBE SIEM Demo — SOL MENÜ v2 + üst bar + komut paleti stilleri
   styles.css'ten SONRA yüklenir; .sidebar / .nav-item / .topbar kurallarını genişletir.
   ========================================================================= */
[hidden] { display: none !important; }

/* ---------- rail genişliği ---------- */
html[data-rail="1"] { --sidebar-w: 68px; }
@media (max-width: 900px) { html[data-rail="1"] { --sidebar-w: 0px; } }
.app { transition: grid-template-columns .2s ease; }

/* ---------- kenar çubuğu iskeleti ---------- */
.sidebar { gap: 0; padding: 10px 10px 8px; }
.sidebar.rail { padding: 10px 8px 8px; }
.sb-head { padding: 2px 2px 8px; }
.sb-search { position: relative; }
.sb-search input {
  width: 100%; height: 34px; padding: 0 30px 0 32px; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font: 13px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
.sb-search input::placeholder { color: var(--muted-2); }
.sb-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #4493f833; }
.sb-search input::-webkit-search-cancel-button, .sb-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.sb-search .s-ic { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.sb-search .s-x { position: absolute; right: 5px; top: 6px; width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.sb-search .s-x:hover { background: var(--panel-2); color: var(--text); }
.sb-search .s-x svg { width: 13px; height: 13px; }
.sb-railsearch { width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.sb-railsearch:hover { color: var(--text); background: var(--panel-3); }
.sb-railsearch svg { width: 17px; height: 17px; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 2px 6px; scrollbar-width: thin; }
.nav-sec { display: flex; align-items: center; gap: 6px; padding: 8px 8px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted-2); }
.nav-sec svg { width: 11px; height: 11px; }
.nav-hr { height: 1px; background: var(--border); margin: 6px 8px 4px; }

/* gruplar */
.ng { padding-top: 4px; }
.ng-h {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: 0; background: transparent; border-radius: 8px;
  color: var(--muted-2); font: 700 10px/1.4 var(--font); letter-spacing: 1.2px; text-transform: uppercase; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.ng-h:hover { background: var(--panel-2); color: var(--muted); }
.ng-h .chev { width: 12px; height: 12px; flex: none; transition: transform .18s; }
.ng-h .chev.open { transform: rotate(90deg); }
.ng-h .ng-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ng-h .ng-cnt { font-weight: 500; font-variant-numeric: tabular-nums; }
.ng-h .badge-n { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; background: #4493f833; color: var(--primary); }
.collapsible { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.collapsible[data-open="true"] { grid-template-rows: 1fr; }
.collapsible > div { overflow: hidden; min-height: 0; }
.ng-list { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px; }

/* öğe satırı (styles.css'teki .nav-item üzerine) */
.nav-item { padding: 0; gap: 0; }
.nav-item .ni-link { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; padding: 8px 10px; color: inherit; border-radius: 10px; }
.nav-item .ni-link svg { width: 18px; height: 18px; flex: none; }
.ni-lab { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim { color: var(--muted-2); }
.nav-item .badge-n, .nav-item .badge-soft { margin-left: 0; margin-right: 4px; flex: none; }
.nav-item.active .badge-n.on-active { background: #ffffff33; color: #fff; }
:root[data-theme="light"] .nav-item.active .badge-n.on-active { background: var(--crit); }
.ni-star {
  width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted-2); border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; opacity: 0; flex: none; margin-right: 2px; transition: opacity .12s, background .12s;
}
.ni-star svg { width: 12px; height: 12px; }
.ni-star.on { opacity: 1; color: var(--primary); }
.ni-star.on svg { fill: currentColor; }
.nav-item:hover .ni-star, .ni-star:focus-visible, .ns-wrap:hover .ni-star { opacity: 1; }
.nav-item.active .ni-star { color: #fff; }
:root[data-theme="light"] .nav-item.active .ni-star { color: var(--primary-2); }
.ni-star:hover { background: #ffffff1f; }
.ni-chev { width: 22px; height: 24px; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 6px; display: grid; place-items: center; flex: none; margin-right: 4px; }
.ni-chev:hover { background: #ffffff1f; }
.ni-chev svg { width: 13px; height: 13px; transition: transform .18s; }
.ni-chev.open svg { transform: rotate(90deg); }
.ni-sublist { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px; }
.ns-wrap { display: flex; align-items: center; }
.nav-sub {
  flex: 1; min-width: 0; margin-left: 25px; padding: 5px 0 5px 12px; border-left: 1px solid var(--border-2);
  font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .12s;
}
.nav-sub:hover { color: var(--text); }
.nav-sub.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
:root[data-theme="light"] .nav-sub.active { color: #1d4ed8; border-left-color: #1d4ed8; }
.ni-star.sm { width: 20px; height: 20px; }
.ni-star.sm svg { width: 11px; height: 11px; }
.nav-item.recent { padding: 6px 10px; font-size: 12.5px; gap: 10px; }
.nav-item.recent svg { width: 15px; height: 15px; flex: none; }
.nav-item.recent .ni-lab { flex: 1; }
.nav-item.is-sub .ni-link { font-size: 12.5px; }
.pin-list, .recent-list { display: flex; flex-direction: column; gap: 1px; }
.pin-row { border-radius: 10px; }
.pin-row.dragging { opacity: .45; }
.locked-chip { flex: none; margin-right: 4px; padding: 2px 5px; border-radius: 5px; background: #4493f826; color: var(--primary); font-size: 9px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.nav-empty { padding: 24px 10px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.6; }
.nav-empty span { color: var(--muted-2); }
.nav-results { display: flex; flex-direction: column; gap: 1px; }
.nav-result { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px; color: var(--muted); }
.nav-result:hover, .nav-result.on { background: var(--panel-2); color: var(--text); }
.nr-body { min-width: 0; flex: 1; }
.nr-l { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.nr-p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted-2); }
mark.hl { background: #4493f847; color: inherit; border-radius: 3px; padding: 0 1px; }
.lock-ic { width: 14px; height: 14px; color: var(--primary); flex: none; }
.ret-ic { width: 12px; height: 12px; color: var(--muted-2); flex: none; }

/* alt bilgi */
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 10px 4px 2px; border-top: 1px solid var(--border); }
.sb-wizard {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: 600 12.5px var(--font); cursor: pointer;
}
.sb-wizard:hover { background: var(--panel-3); border-color: var(--border-2); }
.sb-wizard svg { width: 15px; height: 15px; color: var(--primary); }
.sb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted-2); padding: 0 2px; }
.sb-row.meta { position: relative; flex-wrap: wrap; row-gap: 3px; }
.sb-health { display: inline-flex; align-items: center; gap: 6px; color: var(--good); }
.sb-lic { color: var(--muted); font-weight: 600; border-radius: 6px; padding: 1px 4px; margin-left: -4px; }
.sb-lic:hover { color: var(--text); background: var(--panel-2); }
.sb-health .dot { width: 7px; height: 7px; }
.sb-more { margin-left: auto; width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted-2); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.sb-more:hover { background: var(--panel-2); color: var(--text); }
.sb-more svg { width: 14px; height: 14px; }
.sb-prefs { position: absolute; right: 0; bottom: 26px; z-index: 5; width: 210px; padding: 5px; border-radius: 11px; background: var(--panel); border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.sb-prefs button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; background: transparent; color: var(--text); font: 12px var(--font); border-radius: 8px; cursor: pointer; text-align: left; }
.sb-prefs button:hover { background: var(--panel-2); }
.sb-prefs svg { width: 13px; height: 13px; color: var(--primary); flex: none; }
.sb-prefs svg.ghost { opacity: 0; }
.sb-collapse { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: transparent; color: var(--muted-2); font: 500 11.5px var(--font); cursor: pointer; border-radius: 8px; }
.sb-collapse:hover { color: var(--text); background: var(--panel-2); }
.sb-collapse svg { width: 16px; height: 16px; }

/* segment (Basit | Gelişmiş · TR | EN) */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; color: var(--muted); font: 600 11px var(--font); padding: 4px 8px; border-radius: 6px; cursor: pointer; transition: background .12s, color .12s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--primary); color: #fff; }
.seg.lang button { min-width: 30px; letter-spacing: .3px; }

/* ---------- rail (daraltılmış) ---------- */
.sidebar.rail .sb-wizard span, .sidebar.rail .sb-collapse span { display: none; }
.sidebar.rail .sb-wizard, .sidebar.rail .sb-collapse { justify-content: center; padding: 6px 0; }
.sidebar.rail .sidebar-foot { padding: 8px 0 2px; }
.sidebar.rail .nav { padding: 0; }
.rail-g { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.rail-g + .rail-g { border-top: 1px solid var(--border); }
.rail-item { position: relative; display: grid; place-items: center; height: 40px; border-radius: 10px; color: var(--muted); transition: background .15s, color .15s; }
.rail-item:hover { background: var(--panel-2); color: var(--text); }
.rail-item.active { background: linear-gradient(90deg, #4493f833, #4493f814); color: #fff; }
:root[data-theme="light"] .rail-item.active { color: var(--primary-2); }
.rail-item svg { width: 18px; height: 18px; }
.rail-badge { position: absolute; top: 3px; right: 4px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 8px; background: var(--crit); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.rail-flyout { position: fixed; left: 74px; z-index: 55; width: 228px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 20px 50px #00000055; display: none; }
.rail-flyout.show { display: block; animation: fade .15s; }
.rf-title { padding: 4px 8px 6px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted-2); }
.rf-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.rf-item:hover { background: var(--panel-2); color: var(--text); }
.rf-item.active { background: var(--primary); color: #fff; }
.rf-item svg { width: 16px; height: 16px; flex: none; }
.rf-item span:not(.badge-n):not(.badge-soft) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-item .badge-n, .rf-item .badge-soft { font-size: 10px; padding: 1px 6px; border-radius: 20px; font-weight: 700; }
.rf-item .badge-n { background: var(--crit); color: #fff; }
.rf-item .badge-soft { background: var(--panel-3); color: var(--muted); }

/* ---------- üst bar ---------- */
.topbar { gap: 12px; padding: 0 18px 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { height: 22px; width: auto; display: none; }
:root:not([data-theme="light"]) .logo-dark { display: block; }
:root[data-theme="light"] .logo-light { display: block; }
.brand-txt { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.brand-txt b { font-size: 13.5px; font-weight: 800; letter-spacing: .3px; }
.brand-txt .ver { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #4493f822; color: var(--primary); font-family: var(--mono); }
.tb-sep { width: 1px; height: 24px; background: var(--border-2); flex: none; }
.tb-title { flex: 1 1 auto; min-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-right { gap: 7px; flex: 0 1 auto; min-width: 0; }
.tb-search { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font: 500 12px var(--font); cursor: pointer; flex: 0 1 auto; min-width: 40px; overflow: hidden; }
.tb-search:hover { color: var(--text); border-color: var(--border-2); }
.tb-search svg { width: 15px; height: 15px; }
.tb-search .kbd { color: var(--muted-2); }
.chip.live { white-space: nowrap; }

/* ---------- komut paleti ---------- */
.pal-bg { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: #00000080; backdrop-filter: blur(2px); animation: fade .15s; }
.pal { width: 100%; max-width: 600px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: 0 30px 80px #00000088; overflow: hidden; animation: palIn .18s cubic-bezier(.2,.8,.3,1); }
@keyframes palIn { from { transform: translateY(-8px) scale(.98); opacity: 0; } }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.pal-head > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pal-head input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: 14px var(--font); padding: 4px 0; }
.pal-head input::placeholder { color: var(--muted-2); }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-sec { padding: 8px 10px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted-2); }
.pal-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.pal-row.on { background: #4493f826; color: var(--text); }
.pal-row .act-ic { width: 15px; height: 15px; color: var(--primary); flex: none; }
.pal-row .act-ic.dim, .pal-row > svg.dim { color: var(--muted-2); width: 14px; height: 14px; flex: none; }
.pal-row .nr-l { font-size: 13.5px; }
.pal-tag { font-size: 10px; color: var(--muted-2); flex: none; }
.pal-empty { padding: 32px 12px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.6; }
.pal-foot { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--muted-2); }
.pal-foot em { font-style: normal; }
.pal-foot .pf-r { margin-left: auto; }
body.pal-open { overflow: hidden; }

/* ---------- mobil çekmece ---------- */
.sb-backdrop { position: fixed; inset: 0; z-index: 59; background: #00000088; backdrop-filter: blur(2px); animation: fade .2s; }
@media (max-width: 1420px) { .tb-search span, .tb-search .kbd { display: none; } .tb-search { padding: 0 9px; } }
@media (max-width: 1320px) { .chip.live { display: none; } }
@media (max-width: 1040px) { .seg.mode { display: none; } }
@media (max-width: 900px) {
  .sidebar, .sidebar.rail { width: 284px; max-width: 88vw; padding: 10px 10px 8px; }
  .brand-txt, .tb-sep { display: none; }
  .tb-title { min-width: 0; }
  .tb-search { width: 36px; padding: 0; justify-content: center; }
  .rail-flyout { display: none !important; }
}
@media (max-width: 640px) { #modeSeg { display: none; } }
@media (max-width: 480px) { #langSeg { display: none; } }
@media (max-width: 420px) { .brand-logo { height: 18px; } .demo-badge { padding: 0 8px; } }

/* odak görünürlüğü */
.sidebar :focus-visible, .topbar :focus-visible, .pal :focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
