/* PROJE portalı · ortak iskelet + varsayılan belirteçler (gündüz + gece).
   Bu dosya TÜM sayfaların varsayılan görünümüdür; themes/<id>.css (sonra yüklenir, aynı özgüllükte)
   yalnız belirteçleri ve seçicileri EZER, yapıyı yeniden kurmaz. Renk politikası (DESIGN_SYSTEM.md):
   mavi + açık mavi + kırmızı; sarı/yeşil yok. --line her yüzeyde 4.5:1 üstünde tutulur: odak halkası,
   kontrol kenarı ve ince ayırıcılar da okunur kalır (KONTRAST_TESTLERİ ile ölçülür). */
:root {
  color-scheme: light;
  --bg: #eff6ff;
  --bg2: #eff6ff;
  --surface: #ffffff;
  --text: #172554;
  --muted: #475569;
  --line: #5e73a2;          /* --surface üzerinde >= 4.5:1: kenar ve odak halkası kalın görünür */
  --accent: #1e40af;
  --accent-text: #ffffff;
  --side: #0f1e4a;
  --side-text: #e6ecfb;
  --side-muted: #b9c6e4;
  --side-hover: #1a2c64;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 37, 84, .08), 0 8px 24px rgba(23, 37, 84, .08);
  --font-body: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
  --chip-s: 70%; --chip-s2: 65%; --chip-bg: 92%; --chip-fg: 28%;
  --tema-alan: 380px;
}
html[data-mod="gece"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg2: #0b1220;
  --surface: #111a2e;
  --text: #e6edfb;
  --muted: #9aa9c4;
  --line: #7586a6;
  --accent: #7aa2ff;
  --accent-text: #0b1220;
  --side: #080e1c;
  --side-text: #e6edfb;
  --side-muted: #a3b2cf;
  --side-hover: #131d34;
  --danger: #ffb4ab;
  --danger-bg: #3a1a17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --chip-s: 45%; --chip-s2: 85%; --chip-bg: 24%; --chip-fg: 84%;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 64px; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dt, dd { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
/* Odak her temada görünür: 2px halka + 2px uzaklık (klavye kullanıcısı için zorunlu) */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Düğmeler ───────────────────────────────────────────────────────────── */
button, .birincil, .ikincil, .tehlike {
  font: inherit; cursor: pointer; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 14px; background: var(--accent); color: var(--accent-text); font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:disabled { cursor: not-allowed; opacity: .6; }
button.ghost, .ikincil { background: transparent; color: var(--text); border: 1px solid var(--line); }
.tehlike, button.tehlike { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.kucuk { padding: 4px 8px; font-size: 12.5px; font-weight: 600; }

/* ── Üst şerit: "← Portal" + tema seçici (ortak.js doldurur) ────────────── */
.ust-serit {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; min-height: 46px; padding: 6px 16px;
  background: var(--side); color: var(--side-text); border-bottom: 1px solid var(--line);
}
.ust-serit:not(:has(#tema-kur)) { justify-content: space-between; }
.portal-don, .ust-bag {
  color: var(--side-text); text-decoration: none; font-size: 13.5px; font-weight: 650;
  padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid transparent;
}
.portal-don:hover, .ust-bag:hover { background: var(--side-hover); }
.ust-kullanici { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--side-text); }
.ust-serit #tema-kur, .ust-serit #tema-yuva { margin-left: auto; }

/* ── Tema seçici (theme.js çizer; 9 tema × gündüz/gece) ─────────────────── */
.tema-kur { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tema-satir { display: flex; gap: 8px; align-items: stretch; }
.tema-btn, .tema-mod {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.tema-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; font-weight: 600; font-size: 13.5px; }
.tema-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.tema-mod { display: inline-flex; padding: 3px; gap: 2px; }
.tema-mod button {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; font-size: 13px; font-weight: 600;
  background: transparent; color: var(--text); border-radius: calc(var(--radius-sm) - 2px);
}
.tema-mod button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.tema-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 70;
  width: min(400px, calc(100vw - 20px)); max-height: calc(100dvh - 80px); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px;
}
.tema-panel[hidden] { display: none; }
.tema-baslik { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 8px 8px; text-transform: uppercase; letter-spacing: .06em; }
.tema-oge {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px;
  background: transparent; color: var(--text); font-weight: 400; border: 1px solid transparent; border-radius: var(--radius-sm);
}
.tema-oge:hover { background: var(--bg); }
.tema-oge[aria-pressed="true"] { border-color: var(--accent); background: var(--bg); }
.tema-sw {
  display: inline-block; width: 22px; height: 22px; flex: none; border-radius: 6px; position: relative;
  background: var(--sw-bg, var(--bg)); box-shadow: inset 0 0 0 1px var(--line);
}
.tema-sw::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--sw-ac, var(--accent)); }
.tema-oge .tema-sw { width: 34px; height: 34px; border-radius: 8px; }
.tema-oge .tema-sw::after { width: 13px; height: 13px; right: 4px; bottom: 4px; }
.tema-metin { display: flex; flex-direction: column; min-width: 0; }
.tema-oge .tema-ad { font-weight: 650; font-size: 14px; }
.tema-not { font-size: 12.5px; color: var(--muted); }

/* ── Sayfa kabuğu: yan menü + içerik ─────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 46px); min-height: calc(100dvh - 46px); }
.sidebar {
  background: var(--side); color: var(--side-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.sidebar .brand, .topbar .brand { padding: 4px 8px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: var(--radius-sm); flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font: 700 18px/1 var(--font-display);
}
.brand-name { font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 12px; }
#menu { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.menu-group { font-size: 12px; font-weight: 700; color: var(--side-muted); padding: 14px 10px 6px; overflow-wrap: anywhere; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 0;
  border-radius: var(--radius-sm); color: var(--side-text); text-decoration: none;
}
.menu-item:hover { background: var(--side-hover); }
.menu-item[aria-current="page"] { background: var(--side-hover); font-weight: 700; }
.menu-item:focus-visible { outline-color: var(--side-text); }
.menu-ad { min-width: 0; overflow-wrap: anywhere; }
.chip {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; line-height: 1;
  background: hsl(var(--h, 220) var(--chip-s) var(--chip-bg)); color: hsl(var(--h, 220) var(--chip-s2) var(--chip-fg));
}
.sidebar .chip { background: var(--side-hover); color: var(--side-text); }
.cikis { margin: 0; }
.cikis button { width: 100%; color: var(--side-text); border-color: var(--side-muted); }

.content { padding: 26px 32px 56px; min-width: 0; }
.ustbar, .topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-height: 44px; margin-bottom: 6px; }
.ustbar h1, .topbar h1 { font: 700 26px/1.2 var(--font-display); overflow-wrap: anywhere; margin-right: auto; }
.count { color: var(--muted); font-size: 14px; }
.menu-toggle { display: none; }
.lead { color: var(--muted); margin: 6px 0 24px; max-width: 62ch; text-wrap: pretty; }

/* ── Kart menüsü (portal.js) ─────────────────────────────────────────────── */
.cards { display: flex; flex-direction: column; gap: 28px; }
.grup { min-width: 0; scroll-margin-top: 16px; }
.grup-baslik { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.grup-baslik h2 { font: 700 16px/1.3 var(--font-display); overflow-wrap: anywhere; }
.grup-sayi { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.grup-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none;
  transition: transform .15s ease-out, box-shadow .15s ease-out, border-color .15s ease-out;
}
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-head h3 { font: 650 16px/1.3 var(--font-display); overflow-wrap: anywhere; }
.card-icon { font-size: 20px; flex: none; }
.card-desc { color: var(--muted); font-size: 14px; flex: 1; text-wrap: pretty; overflow-wrap: anywhere; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; min-width: 0; }
.card-host { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-go { color: var(--accent); font-weight: 700; flex: none; }
.kart-tur { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.bos { color: var(--muted); padding: 18px 2px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bos a { font-weight: 650; }

/* ── Durum iletisi (kayan yuva) ─────────────────────────────────────────── */
.durum {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: min(460px, calc(100vw - 32px));
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text); border: 1px solid var(--accent); box-shadow: var(--shadow);
}
.durum:empty { display: none; }
.durum.hata { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

/* ── Hatalar: kırmızı, kalıcı, kaybolmaz (aria-live bölgesi) ─────────────── */
.hatalar, #form-hata {
  color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px;
}
.hatalar:empty, #form-hata:empty { display: none; }
.hatalar ul { margin: 0; padding-left: 18px; }

/* ── Giriş sayfası ───────────────────────────────────────────────────────── */
.login-body { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.login-sayfa { width: 100%; display: grid; place-items: center; padding: 40px 16px; }
.login-card {
  width: 100%; max-width: 400px; display: flex; flex-direction: column; padding: 28px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.login-card h1 { font: 700 22px/1.3 var(--font-display); margin: 22px 0 10px; }
.login-card .lead { margin: 0; font-size: 14px; }
.login-card label { display: block; font-size: 13px; color: var(--text); font-weight: 650; margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.login-card button { width: 100%; justify-content: center; margin-top: 22px; }
.login-card .foot { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }
.login-card .hata { color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger); border-radius: var(--radius-sm); font-size: 14px; padding: 0; }
.login-card .hata:not(:empty) { padding: 10px 12px; margin-top: 12px; }

/* ── Menü düzenleyici ────────────────────────────────────────────────────── */
.duzenle-arac { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.duzenle-ipucu { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.duzenle-govde { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.duzenle-liste, #liste { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.onizleme, #onizleme { min-width: 0; }
.onizleme h2 { font: 700 15px/1.3 var(--font-display); margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.onizleme .ozet { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.onizleme-ic, #onizleme-ic { min-width: 0; position: sticky; top: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.grup-kutu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.grup-kutu[data-gizli="true"] { border-style: dashed; }
.grup-kutu-baslik { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 650; }
.grup-kutu-baslik .grup-ad { flex: 1; min-width: 120px; overflow-wrap: anywhere; margin: 0; font: inherit; }
.grup-kutu-baslik button, .oge-satiri button, .duzenle-arac button { padding: 4px 8px; font-size: 12.5px; }
.oge-satiri {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px;
  padding: 8px 10px; margin-top: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-sm);
}
.oge-satiri[data-gizli="true"] { border-style: dashed; }
.oge-satiri .oge-metin { display: flex; flex-direction: column; min-width: 0; }
.oge-satiri .oge-dugme { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.oge-ad, .grup-ad { font-weight: 650; overflow-wrap: anywhere; }
.oge-ek, .oge-url, .onizleme-aciklama, .onizleme-url { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.oge-url, .onizleme-url { font-family: var(--font-mono); }
.suruk-tut { background: transparent; color: var(--text); border: 1px solid var(--line); cursor: grab; }
.suruklenen { opacity: .45; }
.secili { outline: 2px solid var(--accent); outline-offset: 2px; }  /* menu-duzenle.js: seçili grup */
.hedef-ust { box-shadow: 0 -3px 0 var(--accent); }
.hedef-alt { box-shadow: 0 3px 0 var(--accent); }
.onizleme-grup { margin-bottom: 14px; }
.onizleme-grup h3 { font: 700 13px/1.3 var(--font-display); display: flex; gap: 8px; margin-bottom: 6px; }
.onizleme-grup .kart-liste { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.onizleme-kart, .kart-liste > .kart {
  margin: 0; padding: 7px 9px; min-width: 0; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.onizleme-ikon { margin-right: 6px; }
.form-pencere { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; color: var(--text); background: var(--surface); width: min(560px, calc(100vw - 24px)); max-height: 92dvh; overflow-y: auto; }
.form-pencere::backdrop { background: rgba(0, 0, 0, .45); }
.duzenle-form { display: grid; gap: 10px; padding: 18px; }
.duzenle-form h2 { font: 700 18px/1.3 var(--font-display); }
.alan { display: grid; gap: 4px; }
.alan[hidden] { display: none !important; }
.alan label { font-size: 13px; color: var(--text); font-weight: 650; }
.alan.onay { display: flex; align-items: center; gap: 8px; }
.alan input:not([type="checkbox"]), .alan select {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.alan input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
.duzenle-form-dugme { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ── Magento durum kartı ─────────────────────────────────────────────────── */
.magento-sayfa { display: grid; gap: 16px; max-width: 760px; }
.durum-kart { display: grid; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.durum-rozet { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; }
.durum-rozet[data-durum="ayakta"] { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.durum-rozet[data-durum="kapali"] { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.durum-rozet[data-durum="yapilandirilmadi"] { color: var(--muted); background: var(--bg); border: 1px dashed var(--line); }
.durum-ad { font: 700 20px/1.3 var(--font-display); }
.durum-detay { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.durum-detay dt { color: var(--muted); font-size: 13px; }
.durum-detay dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; font-family: var(--font-mono); }
.yenile { width: fit-content; }

/* ── Duyarlı düzen ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  #menu { flex-direction: row; flex-wrap: wrap; }
  .menu-group { display: none; }
  .cikis button { width: auto; }
  .content { padding: 18px 16px 40px; }
  .duzenle-govde { grid-template-columns: minmax(0, 1fr); }
  .onizleme-ic, #onizleme-ic { position: static; }
  .grup-liste { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ust-serit { padding: 6px 8px; gap: 6px; }
  .ust-serit #tema-kur, .ust-serit #tema-yuva { margin-left: 0; width: 100%; }
  .tema-kur { align-items: stretch; }
  .tema-satir { width: 100%; }
  .tema-btn { flex: 1; min-width: 0; }
  .tema-btn .tema-ad { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tema-mod { flex: none; }
  .tema-mod span { display: none; }
  .tema-panel { left: 0; right: auto; width: calc(100vw - 16px); max-height: 64dvh; }
  .content { padding: 16px 12px 36px; }
  .ustbar h1, .topbar h1 { font-size: 21px; }
  .grup-liste { grid-template-columns: minmax(0, 1fr); }
  .login-card { padding: 20px; }
  .durum { left: 8px; right: 8px; bottom: 8px; max-width: none; text-align: center; border-radius: var(--radius-sm); }
  .oge-satiri { grid-template-columns: minmax(0, 1fr); }
  .oge-satiri .oge-dugme { justify-content: flex-start; }
}

/* Hareket duyarlılığı: animasyon/geçiş yok (erişilebilirlik tercihi) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
