/* =========================================================================
   ERBE SIEM Demo — Genel Bakış v2 bileşen ızgarası (widgets.css)
   Ürünün .erbe-wgrid / .erbe-wcell kurallarıyla aynı geometri:
   12 sütun (≥1280 px: s·m·l·xl = 3·4·8·12; 768–1279 px: s,m = 6 · l,xl = 12; mobil: 1 sütun)
   Tüm renkler styles.css tema değişkenlerinden — koyu/açık temada otomatik.
   ========================================================================= */

/* ---------- ızgara ---------- */
.wg-page { min-width: 0; }
.wg-grid { display: grid; grid-auto-flow: row; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
.wg-cell { display: flex; min-width: 0; position: relative; border-radius: var(--radius); outline: 0; }
.wg-cell > .wg-card { width: 100%; }
.wg-h2 { min-height: 620px; }
@media (min-width: 768px) {
  .wg-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .wg-s, .wg-m { grid-column: span 6; }
  .wg-l, .wg-xl { grid-column: span 12; }
}
@media (min-width: 1280px) {
  .wg-s { grid-column: span 3; }
  .wg-m { grid-column: span 4; }
  .wg-l { grid-column: span 8; }
  .wg-xl { grid-column: span 12; }
}
.wg-gridempty { grid-column: 1 / -1; border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 44px 12px; text-align: center; color: var(--muted); font-weight: 500; }

/* ---------- kart kabuğu ---------- */
.wg-card { display: flex; flex-direction: column; min-width: 0; }
.wg-card.wg-open { background: none; border: 0; box-shadow: none; padding: 0; }
.wg-card.wg-p0 { padding: 0; }
.wg-card.wg-p0 > .wg-head { padding: 14px 16px 0; }
.wg-card.wg-p0 > .wg-strip { margin: 12px 12px 0; }
.wg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.wg-t { min-width: 0; }
.wg-t h3 { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-t p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-actions { display: flex; gap: 2px; flex: none; margin-top: -3px; }
.wg-ib { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); border-radius: 7px; display: inline-grid; place-items: center; cursor: pointer; padding: 0; transition: background .16s, color .16s; }
.wg-ib:hover { background: var(--panel-2); color: var(--text); }
.wg-ib:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.wg-ib svg { width: 14px; height: 14px; }
.wg-body { min-height: 0; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wg-body > * { min-width: 0; }
.wg-ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; vertical-align: bottom; }
.wg-empty { padding: 22px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.wg-flash { animation: wgFlash .7s ease; }
@keyframes wgFlash { 0% { box-shadow: 0 0 0 2px var(--primary); } 100% { box-shadow: 0 0 0 0 transparent; } }
.wg-livedot { width: 6px; height: 6px; margin-left: auto; color: var(--good); }
.btn svg, .wg-tab svg { width: 14px; height: 14px; }

/* ---------- düzenleme kipi ---------- */
.wg-edit { outline: 1px dashed var(--border-2); outline-offset: 2px; }
.wg-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.wg-drag { opacity: .45; }
.wg-over { outline: 2px solid var(--primary); outline-offset: 2px; }
.wg-cell[draggable="true"] { cursor: grabbing; }
.wg-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); margin-bottom: 8px; }
.wg-grip { cursor: grab; color: var(--muted); display: inline-grid; place-items: center; width: 22px; height: 26px; touch-action: none; }
.wg-grip:active { cursor: grabbing; }
.wg-grip svg { width: 14px; height: 14px; }
.wg-sel { height: 26px !important; font-size: 11.5px !important; padding: 0 6px !important; }
.wg-hide { margin-left: auto; }
.wg-hide:hover { color: var(--crit); }

/* ---------- sayfa sekmeleri ---------- */
.wg-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.wg-tab { border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font: 600 12.5px var(--font); padding: 6px 12px; border-radius: 9px; cursor: pointer; transition: background .16s, color .16s; }
.wg-tab:hover { background: var(--panel-3); color: var(--text); }
.wg-tab.on { background: var(--primary); color: #fff; border-color: transparent; }
.wg-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---------- düzenleme çubuğu (yapışkan) ---------- */
.wg-editbar { display: none; }
.wg-editbar.on { position: sticky; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px -4px 0; padding: 8px 12px; border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.wg-editbar .wg-counts { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- tam ekran ---------- */
.wg-fs { position: fixed; inset: 0; z-index: 85; background: var(--bg); background-image: var(--bg-grad); padding: 12px 18px 18px; overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; outline: 0; }
.wg-fs > .wg-card { flex: 1; }
.wg-fsbar { display: flex; justify-content: flex-end; }
body.wg-noscroll { overflow: hidden; }

/* ---------- özet sayaçlar / mini istatistik / göstergeler ---------- */
.wg-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 768px) { .wg-stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .wg-stats { grid-template-columns: repeat(8, 1fr); } }
.wg-stats .stat .val { font-size: 24px; }
.wg-stats .stat .lab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-ministats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; }
@media (min-width: 768px) { .wg-ministats { grid-template-columns: repeat(3, 1fr); } }
.wg-ms { min-width: 0; }
.wg-ms .l { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-ms .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-ms .s { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-health { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .wg-health { grid-template-columns: repeat(4, 1fr); } }
.wg-gc { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; }
.wg-gc.wg-db svg.ic { width: 18px; height: 18px; color: var(--muted); }
.wg-dbval { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -.5px; margin-top: 4px; }
.wg-bignum { padding: 12px 0 6px; }
.wg-big { font-size: 38px; font-weight: 800; letter-spacing: -.8px; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ---------- anlık EPS kadranı ---------- */
.wg-eps { display: flex; flex-direction: column; align-items: center; }
.wg-eps svg { width: 100%; max-width: 340px; height: auto; }
.wg-eps-needle { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.wg-eps-raw { margin-top: -4px; }
.wg-eps-pill { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; max-width: 340px; margin-top: 8px; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--panel-2); font-size: 12px; }

/* ---------- saldırı küresi (kartSifir) ---------- */
.wg-globe { flex: 1; min-height: 0; padding: 4px 12px 0; }
.wg-globe-leg { padding: 10px 16px 0; }
.wg-globe-stats { padding: 12px 16px 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .wg-globe-stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- listeler ---------- */
.wg-list { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.wg-li { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 8px; transition: background .15s; }
.wg-li:hover { background: var(--panel-2); }
.wg-li .b { min-width: 0; flex: 1; }
.wg-li .b > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-li .b .s { font-size: 11px; color: var(--muted); }
.wg-scroll { max-height: 470px; overflow-y: auto; }
.wg-feed { flex: 1; min-height: 0; }

/* ---------- donut + lejant ---------- */
.wg-donut { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.wg-donut > svg { flex: none; }
.wg-donut ul { list-style: none; margin: 0; padding: 0; flex: 1 1 150px; min-width: 0; font-size: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.wg-donut li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wg-donut li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.wg-donut li .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-donut li .p { width: 40px; text-align: right; color: var(--muted); }

/* ---------- tablo / kontrol listesi / lisans ---------- */
.wg-table { font-size: 12px; }
.wg-table thead th { padding: 7px 8px; font-size: 10.5px; }
.wg-table tbody td { padding: 6px 8px; }
.wg-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 13px; }
.wg-check li { display: flex; gap: 9px; align-items: center; }
.wg-lic { display: grid; gap: 14px; align-items: center; }
@media (min-width: 768px) { .wg-lic { grid-template-columns: 170px 1fr; } }
.wg-lic .days { border-radius: 12px; padding: 14px; text-align: center; background: var(--panel-2); border: 1px solid var(--border); }
.wg-lic table { font-size: 13px; }
.wg-lic table td { padding: 6px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wg-lic table tr:last-child td { border-bottom: 0; }
.wg-lic table tr:hover { background: transparent; }

/* ---------- "Bileşen ekle" çekmecesi ---------- */
.wg-drawer .drawer-head h3 { font-size: 17px; margin: 0; }
.wg-secs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
/* M13: marka adları (Windows, Fortinet, Active Directory) JS'te <span lang="en"> ile sarılır — TR büyük harf kuralı (i→İ) uygulanmaz */
.wg-lib-grp { margin: 10px 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-2); }
.wg-lib { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wg-lib button { width: 100%; text-align: left; display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 9px 10px 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-family: var(--font); cursor: pointer; transition: background .15s; }
.wg-lib button:hover { background: var(--panel-3); }
.wg-lib button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.wg-lib .n { display: block; font-size: 13px; font-weight: 600; }
.wg-lib .d { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; line-height: 1.45; }
.wg-field { display: grid; gap: 4px; margin-bottom: 10px; font-size: 12px; }
.wg-field label { color: var(--muted); font-weight: 600; }
.wg-field .inp { width: 100%; }
.wg-field textarea.inp { height: auto; min-height: 66px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; resize: vertical; line-height: 1.5; }
.wg-chk { gap: 8px; font-size: 12px; margin: 4px 0 8px; cursor: pointer; }
.wg-chk input { accent-color: var(--primary); }
.wg-form-err:empty { display: none; }
.wg-form-err { margin-top: 4px; }
.drawer .search .s-inp { padding-left: 38px; }
.drawer .search svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--muted-2); }

/* ---------- MITRE ısı haritası (kart içi) ---------- */
.wg-body .heat { padding-bottom: 4px; }

/* ---------- açık tema ince ayar ---------- */
:root[data-theme="light"] .wg-tab.on { color: #fff; }
:root[data-theme="light"] .wg-editbar.on { background: color-mix(in srgb, var(--panel) 94%, transparent); }

/* ---------- küçük ekran ---------- */
@media (max-width: 767px) {
  .wg-h2 { min-height: 0; }
  .wg-strip { gap: 4px; }
  .wg-editbar.on { margin: 12px 0 0; padding: 8px; }
  .wg-editbar .wg-counts { width: 100%; margin-left: 0; }
  .wg-fs { padding: 10px; }
  .wg-t h3 { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .wg-eps-needle { transition: none; }
}

/* ---------- küçük soru penceresi (sayfa adı / onay) — window.prompt yerine ---------- */
.wg-askbox { width: min(440px, 100%); }
.wg-askbox .wg-field { margin-bottom: 0; }
.wg-askbox .wg-field span { color: var(--muted); font-weight: 600; }
