/* Admin panel (/yonetim) refinements. Stand-alone add-on: every rule is scoped to .adm-shell, which only
   the admin app renders. Loaded after the main stylesheet, so equal-specificity rules here win.

   1. App-shell layout: the window itself never scrolls; the content pane does, and long lists
      (tables, logs, message lists) scroll inside their own box with a pinned header row.
   2. Form fields show their whole value (the compact selects in table cells were clipping their text).
   3. Navigation grouped into labelled categories.
   4. Visual polish: cards, KPI tiles, tables, tabs, scrollbars. */

/* ---------- 1. Layout ---------- */
.adm-shell { height: 100dvh; min-height: 0; overflow: hidden; }
.adm-shell .adm-side { height: 100dvh; }
.adm-shell .adm-main { height: 100dvh; min-height: 0; overflow: hidden; }
.adm-shell .adm-head, .adm-shell .adm-sudobar { flex: none; }
.adm-shell .adm-body {
  flex: 1; min-height: 0; max-width: none; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px max(24px, calc((100% - 1560px) / 2)) 32px;
  scrollbar-gutter: stable;
}
/* The bulk-action bar used to stick below the page header; the pane is the scroller now. */
.adm-shell .adm-bulk { top: 0; }

/* Long lists scroll in place. --adm-list-h leaves room for the header, tabs and filters above. */
.adm-shell { --adm-list-h: max(320px, calc(100dvh - 250px)); }
.adm-shell .adm-table-wrap,
.adm-shell .adm-body .card:has(> table.lx-table) {
  max-height: var(--adm-list-h); overflow: auto; overscroll-behavior: contain;
}
/* A wrapper nested in a card must not add a second, shorter scroll box around the first. */
.adm-shell .adm-body .card:has(> .adm-table-wrap) { max-height: none; overflow: visible; }
.adm-shell .adm-body table.lx-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--panel-2); box-shadow: inset 0 -1px 0 var(--line-2);
}
.adm-shell .adm-feed { max-height: min(560px, var(--adm-list-h)); overscroll-behavior: contain; padding-right: 4px; }
.adm-shell .adm-log { max-height: min(460px, var(--adm-list-h)); overscroll-behavior: contain; }
/* Message / report lists: a stack of cards directly under a section. */
.adm-shell .adm-body section.stack:has(> .adm-alarm ~ .adm-alarm ~ .adm-alarm) {
  max-height: var(--adm-list-h); overflow-y: auto; overscroll-behavior: contain;
  padding: 0 6px 6px 0; flex-wrap: nowrap;
}
.adm-shell .adm-body section.stack:has(> .adm-alarm ~ .adm-alarm ~ .adm-alarm) > :first-child:not(.adm-alarm) {
  position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 2px 0 8px;
}
/* Checklists inside a card (system health and similar). */
.adm-shell .adm-body .card > .stack:has(> .adm-check ~ .adm-check ~ .adm-check ~ .adm-check ~ .adm-check ~ .adm-check) {
  max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; flex-wrap: nowrap;
}

/* ---------- 2. Form fields ---------- */
.adm-shell select.input, .adm-modal select.input {
  height: auto; min-height: 34px; line-height: 1.35; font-size: 13px;
  padding: 6px 30px 6px 10px; text-overflow: ellipsis; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238193a9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.adm-shell select.input option, .adm-modal select.input option { background: #0f1723; color: #dce5f0; }
.adm-shell td select.input { min-width: 170px; }
.adm-shell .input, .adm-modal .input { min-height: 34px; line-height: 1.35; transition: border-color .15s, box-shadow .15s; }
.adm-shell .input:hover, .adm-modal .input:hover { border-color: var(--muted); }
.adm-shell .input:focus-visible, .adm-modal .input:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .18);
}
/* Text areas grow with what is typed, so the whole value is readable without dragging the corner. */
.adm-shell textarea.input, .adm-modal textarea.input { field-sizing: content; min-height: 84px; max-height: 46dvh; line-height: 1.5; }
.adm-shell .adm-code { min-height: 44px; }

/* ---------- 3. Navigation categories ---------- */
/* The menu is a fixed list of 15 entries; `order` regroups it, and the first entry of each group
   carries the group label. */
.adm-shell .adm-nav { gap: 1px; }
.adm-shell .adm-nav button { position: relative; padding: 7px 10px; font-size: 13px; }
.adm-shell .adm-nav button:nth-child(1)  { order: 10; }  /* Genel Bakış */
.adm-shell .adm-nav button:nth-child(3)  { order: 11; }  /* Gözlem Odası */
.adm-shell .adm-nav button:nth-child(4)  { order: 12; }  /* Canlı Oturumlar */
.adm-shell .adm-nav button:nth-child(10) { order: 13; }  /* Olay Akışı */
.adm-shell .adm-nav button:nth-child(5)  { order: 20; }  /* Kullanıcılar */
.adm-shell .adm-nav button:nth-child(7)  { order: 21; }  /* Forum */
.adm-shell .adm-nav button:nth-child(6)  { order: 30; }  /* CTF Görevleri */
.adm-shell .adm-nav button:nth-child(8)  { order: 31; }  /* CTF Bütünlüğü */
.adm-shell .adm-nav button:nth-child(9)  { order: 32; }  /* Lab Analitiği */
.adm-shell .adm-nav button:nth-child(2)  { order: 40; }  /* Güvenlik Merkezi */
.adm-shell .adm-nav button:nth-child(11) { order: 41; }  /* Güvenlik & IP */
.adm-shell .adm-nav button:nth-child(12) { order: 42; }  /* Denetim Kaydı */
.adm-shell .adm-nav button:nth-child(13) { order: 50; }  /* Sistem Sağlığı */
.adm-shell .adm-nav button:nth-child(14) { order: 51; }  /* Site Ayarları & KVKK */
.adm-shell .adm-nav button:nth-child(15) { order: 52; }  /* Hesabım & Güvenlik */
.adm-shell .adm-nav button:nth-child(1),
.adm-shell .adm-nav button:nth-child(5),
.adm-shell .adm-nav button:nth-child(6),
.adm-shell .adm-nav button:nth-child(2),
.adm-shell .adm-nav button:nth-child(13) { margin-top: 26px; }
.adm-shell .adm-nav button:nth-child(1) { margin-top: 18px; }
.adm-shell .adm-nav button:nth-child(1)::before,
.adm-shell .adm-nav button:nth-child(5)::before,
.adm-shell .adm-nav button:nth-child(6)::before,
.adm-shell .adm-nav button:nth-child(2)::before,
.adm-shell .adm-nav button:nth-child(13)::before {
  position: absolute; left: 10px; top: -18px; pointer-events: none;
  font: 700 10px var(--sans); letter-spacing: .12em; color: var(--faint);
}
.adm-shell .adm-nav button:nth-child(1)::before  { content: "İZLEME"; }
.adm-shell .adm-nav button:nth-child(5)::before  { content: "TOPLULUK"; }
.adm-shell .adm-nav button:nth-child(6)::before  { content: "CTF & LAB"; }
.adm-shell .adm-nav button:nth-child(2)::before  { content: "GÜVENLİK"; }
.adm-shell .adm-nav button:nth-child(13)::before { content: "SİSTEM"; }

/* ---------- 4. Polish ---------- */
.adm-shell .adm-side { background: linear-gradient(180deg, #0c131f, var(--bg-2) 40%); gap: 6px; }
.adm-shell .adm-nav button.on { background: linear-gradient(90deg, rgb(var(--accent-rgb) / .18), rgb(var(--accent-rgb) / .04)); }
.adm-shell .adm-head { padding-top: 14px; padding-bottom: 14px; position: static; }
.adm-shell .adm-head h2 { font-size: 18px; letter-spacing: -.01em; }

.adm-shell .adm-body .card { border-color: var(--line); box-shadow: 0 1px 0 #ffffff08 inset, 0 8px 24px #0000002e; }
.adm-shell .adm-kpi { position: relative; overflow: hidden; }
.adm-shell .adm-kpi::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / .7), transparent 70%);
}
.adm-shell .adm-kpi.ok::after { background: linear-gradient(90deg, var(--ok), transparent 70%); }
.adm-shell .adm-kpi.bad::after { background: linear-gradient(90deg, var(--bad), transparent 70%); }
.adm-shell .adm-kpi.warn::after { background: linear-gradient(90deg, var(--warn), transparent 70%); }
.adm-shell .adm-kpi strong { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.adm-shell .adm-body table.lx-table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); white-space: nowrap;
}
.adm-shell .adm-body table.lx-table tbody tr:nth-child(even) td { background: #ffffff05; }
.adm-shell .adm-body table.lx-table tbody tr:hover td { background: var(--panel-2); }
.adm-shell .adm-body table.lx-table td { overflow-wrap: anywhere; }

.adm-shell .adm-body .tabs { gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.adm-shell .adm-body .tabs button { border-radius: 8px 8px 0 0; transition: color .15s, background .15s; }
.adm-shell .adm-body .tabs button:hover { color: var(--text); background: #ffffff08; }
.adm-shell .adm-body .tabs button.on { background: rgb(var(--accent-rgb) / .08); }

.adm-shell .adm-alarm { background: var(--panel); }
.adm-shell .adm-ev { border: 1px solid transparent; }
.adm-shell .adm-ev:hover { border-color: var(--line-2); }

.adm-shell * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.adm-shell ::-webkit-scrollbar { width: 9px; height: 9px; }
.adm-shell ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
.adm-shell ::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
.adm-shell ::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .adm-shell .adm-body { padding: 14px 14px 24px; }
  .adm-shell { --adm-list-h: max(300px, calc(100dvh - 210px)); }
  .adm-shell td select.input { min-width: 140px; }
}

/* ---------- 5. Location map (Konum Haritası) ---------- */
.adm-shell .geo-pin { overflow: visible; }
.adm-shell .s1-pin-lab {
  position: absolute; left: 14px; white-space: nowrap; pointer-events: none;
  font: 700 11px/1.3 var(--sans); color: #fff; padding: 1px 6px; border-radius: 5px;
  background: #070b12d9; border: 1px solid #ffffff2e; box-shadow: 0 2px 6px #0007;
}
.adm-shell .geo-pin.on .s1-pin-lab, .adm-shell .geo-pin:hover .s1-pin-lab { background: var(--accent); color: #031019; border-color: transparent; }
.adm-shell .geo-pin .s1-pin-lab { top: -8px; }
.adm-shell .geo-pop { z-index: 6; min-width: 210px; }
/* clusters: nearby pins merge into one counted bubble (click = zoom in, same spot = list) */
.adm-shell .s1-clu {
  position: absolute; transform: translate(-50%, -50%); z-index: 3; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff;
  font: 800 12px/1 var(--sans); color: #fff; text-shadow: 0 1px 2px #0008;
  background: rgb(var(--accent2-rgb) / .9);
  box-shadow: 0 0 0 6px rgb(var(--accent2-rgb) / .25), 0 2px 8px #0009;
  transition: box-shadow .15s, transform .15s;
}
.adm-shell .s1-clu:hover, .adm-shell .s1-clu.on { z-index: 5; transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 9px rgb(var(--accent2-rgb) / .35), 0 2px 10px #000a; }
.adm-shell .s1-clu.k-hosting { background: #f0a73ae6; box-shadow: 0 0 0 6px #f0a73a40, 0 2px 8px #0009; }
.adm-shell .s1-clu.k-tor { background: #e05353e6; box-shadow: 0 0 0 6px #e0535340, 0 2px 8px #0009; }
.adm-shell .s1-clu-pop { min-width: 240px; max-width: 280px; }
.adm-shell .s1-clu-list { display: grid; gap: 2px; max-height: 210px; overflow-y: auto; margin: 6px 0; padding-right: 4px; }
.adm-shell .s1-clu-row { display: flex; align-items: baseline; gap: 6px; padding: 3px 4px; border-radius: 4px; }
.adm-shell .s1-clu-row:nth-child(odd) { background: #ffffff08; }
.adm-shell .s1-clu-row .mono { margin-left: auto; font-size: 11px; }
.adm-shell .s1-clu-k { font-size: 10px; padding: 0 4px; border-radius: 3px; background: #8a93a633; }
.adm-shell .s1-clu-k.k-tor { background: #e0535344; }
.adm-shell .s1-clu-k.k-hosting { background: #f0a73a44; }
.adm-shell .s1-layer { font-size: 15px; }
.adm-shell .s1-layer.on { border-color: var(--accent); }
.adm-shell .geo-map:fullscreen { border-radius: 0; min-height: 100vh; }
.adm-shell .geo-zoom button { box-shadow: 0 2px 6px #0006; }
/* layer picker (Google-style thumbnails) */
.adm-shell .s1-layers {
  position: absolute; top: 10px; right: 48px; z-index: 7; display: grid; grid-template-columns: repeat(3, 74px); gap: 6px;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 8px 24px #0009;
}
.adm-shell .s1-lay { display: grid; gap: 3px; padding: 3px; border: 2px solid transparent; border-radius: 8px; background: none; color: var(--muted); font: 600 11px var(--sans); cursor: pointer; }
.adm-shell .s1-lay img { width: 64px; height: 48px; object-fit: cover; border-radius: 5px; display: block; }
.adm-shell .s1-lay:hover { color: var(--text); background: #ffffff0d; }
.adm-shell .s1-lay.on { border-color: var(--accent); color: var(--text); }
/* scale bar + zoom/centre readout */
.adm-shell .s1-scale {
  position: absolute; left: 10px; top: 10px; z-index: 5; display: flex; align-items: center; gap: 8px; pointer-events: none;
  padding: 3px 8px; border-radius: 6px; background: #070b12cc; color: #e6edf5; font: 600 11px var(--sans);
}
.adm-shell .s1-scale i { display: block; height: 6px; border: 2px solid #e6edf5; border-top: 0; }
.adm-shell .s1-scale .s1-zl { color: #9fb0c4; font-family: var(--mono, monospace); font-weight: 500; }
@media (max-width: 600px) { .adm-shell .s1-layers { grid-template-columns: repeat(2, 74px); } .adm-shell .s1-scale .s1-zl { display: none; } }
.adm-shell .s1-cities { display: grid; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); max-height: 360px; overflow-y: auto; }
.adm-shell .s1-cities-h { font: 700 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.adm-shell .s1-city { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.adm-shell .s1-city-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); text-align: left; }
.adm-shell .s1-city-users { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- 6. Add-on cards (s1-admin-extra.v1.js) ---------- */
.adm-shell .s1x-card { margin-bottom: 14px; }
.adm-shell .s1x-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.adm-shell .s1x-grid .field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.adm-shell .s1x-status { display: grid; gap: 8px; }
.adm-shell .s1x-winners { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.adm-shell .s1x-winners .badge { margin-left: 8px; }
.adm-shell .s1x-del { display: grid; gap: 8px; max-height: var(--adm-list-h); overflow-y: auto; }
.adm-shell .s1x-del-row { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 8px; background: var(--bg-2); }
.adm-shell .s1x-ev { display: grid; gap: 3px; max-height: 300px; overflow-y: auto; margin-top: 6px; padding: 8px; border-radius: 6px; background: var(--bg); font-size: 12px; }
.adm-shell .s1x-ev-row { display: grid; grid-template-columns: 150px auto 120px 1fr; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.adm-shell .s1x-photo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.adm-shell .s1x-photo-img { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; font-size: 34px;
  background: var(--bg-2) center / cover no-repeat; border: 2px solid var(--line-2); }
.adm-shell .adm-avatar.s1x-has-photo { background-size: cover !important; background-position: center !important; color: transparent !important; }
@media (max-width: 760px) { .adm-shell .s1x-ev-row { grid-template-columns: 1fr; } }

/* Header, right side: notification bell + account menu (s1-admin-extra.v2.js). The account block and the
   "Hesabım & Güvenlik" entry leave the left sidebar; everything else there stays. */
.adm-shell.s1x-topacct .adm-side-foot, .adm-shell .adm-nav button.s1x-hidden { display: none; }
.adm-shell .s1x-top { position: relative; display: flex; align-items: center; gap: 8px; flex: none; }
.adm-shell .s1x-bell, .adm-shell .s1x-me { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--panel); color: var(--text); font: 600 13px var(--sans); cursor: pointer; }
.adm-shell .s1x-bell { position: relative; width: 38px; padding: 0; justify-content: center; font-size: 16px; }
.adm-shell .s1x-bell:hover, .adm-shell .s1x-me:hover, .adm-shell .s1x-top [aria-expanded="true"] { border-color: rgb(var(--accent-rgb) / .6); background: var(--panel-2); }
.adm-shell .s1x-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff;
  font: 700 11px/18px var(--sans); font-style: normal; text-align: center; }
.adm-shell .s1x-dot[hidden] { display: none; }
.adm-shell .s1x-me { padding-left: 4px; }
.adm-shell .s1x-face { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--sans); color: #031019;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)) center / cover no-repeat; }
.adm-shell .s1x-face-lg { width: 46px; height: 46px; font-size: 15px; }
.adm-shell .s1x-me-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-shell .s1x-caret { color: var(--muted); font-size: 11px; }
.adm-shell .s1x-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: min(340px, calc(100vw - 24px)); padding: 8px; display: grid; gap: 4px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); box-shadow: 0 18px 40px #000a; }
.adm-shell .s1x-pop-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.adm-shell .s1x-readall { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit; font: 12px var(--sans); cursor: pointer; white-space: nowrap; }
.adm-shell .s1x-readall:hover { background: #ffffff14; }
.adm-shell .s1x-pop-empty { padding: 14px 8px; }
.adm-shell .s1x-n { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 9px 8px; border: 0; border-left: 3px solid transparent; border-radius: 8px;
  background: none; color: var(--text); font: 13px var(--sans); text-align: left; cursor: pointer; }
.adm-shell .s1x-n:hover, .adm-shell .s1x-mi:hover { background: var(--bg-2); }
.adm-shell .s1x-pop-bell { width: min(440px, calc(100vw - 24px)); }
.adm-shell .s1x-wait { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
.adm-shell .s1x-chip { padding: 5px 10px; border: 1px solid #f5b84b66; border-radius: 99px; background: #f5b84b1a; color: #ffd98a; font: 12.5px var(--sans); cursor: pointer; }
.adm-shell .s1x-chip:hover { background: #f5b84b33; }
.adm-shell .s1x-feed { display: grid; gap: 2px; max-height: min(60vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.adm-shell .s1x-n-t { overflow-wrap: anywhere; }
.adm-shell .s1x-n-at { white-space: nowrap; }
.adm-shell .s1x-n-new { border-left-color: var(--accent); background: rgb(var(--accent-rgb) / .07); }
.adm-shell .s1x-n-mine { border-left-color: var(--warn); }
.adm-shell .s1x-n-ic { font-size: 16px; text-align: center; }
.adm-shell .s1x-me-h { display: flex; align-items: center; gap: 12px; padding: 8px; overflow-wrap: anywhere; }
.adm-shell .s1x-me-info { display: grid; gap: 2px; padding: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.adm-shell .s1x-mi { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 600 13px var(--sans); text-align: left;
  text-decoration: none; cursor: pointer; }
.adm-shell .s1x-mi-out { color: var(--bad); }
@media (max-width: 760px) { .adm-shell .s1x-me-name, .adm-shell .s1x-caret { display: none; } .adm-shell .s1x-me { padding: 0 4px; } }
