/* ============================================================
   Tinkon ekip v2 — launcher + login
   Renkler tokens.css'ten gelir; burada yalnızca yerleşim.
   ============================================================ */

/* launcher + yönetim sayfaları: sayfa zemini guide ile aynı (rail/topbar hariç).
   html+body birlikte; --page tanımsız olsa (eski tokens cache) bile fallback ile doğru. */
html, body{ background:var(--page, #F3F7FA); }
[data-theme="dark"] html, [data-theme="dark"] body{ background:var(--page, #0E171D); }

/* ---------- erişilebilirlik ---------- */
/* klavyeyle gezerken görünür focus halkası (fareyle tıklamada çıkmaz) */
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, .card:focus-visible, .rail-item:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
/* hareket azaltma tercihi: animasyon/geçişleri kıs */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}
/* mobilde dokunma hedefi ≥44px (rail nav) */
@media (max-width:860px){
  .rail-item, .rail-subitem{ min-height:44px; }
}

/* ---------- üst bar ---------- */
.topbar{
  position:sticky; top:0; z-index:50;   /* rail (40) + backdrop (35) ÜSTÜNDE: üst bar daima en üstte, rail gölgesi binmesin */
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:0 clamp(16px,4vw,32px);
  height:60px;
  background:var(--topbar); color:var(--topbar-ink);
  padding-top:env(safe-area-inset-top);
  height:calc(60px + env(safe-area-inset-top));
}
.brand{ display:inline-flex; align-items:center; gap:9px; color:var(--topbar-ink); text-decoration:none; }
.brand:hover{ text-decoration:none; }
.brand-mark{ width:26px; height:26px; color:var(--accent); }
.brand-mark.big{ width:38px; height:38px; }
.brand-name{ font-size:20px; letter-spacing:-.01em; color:var(--topbar-ink); font-weight:400; }
.brand-name b{ color:var(--accent); font-weight:700; }

.topbar-right{ display:flex; align-items:center; justify-content:flex-end; gap:6px; min-width:0; flex:1; }
.user{ display:inline-flex; align-items:center; gap:7px; font-size:14px; opacity:.92; }
.user svg{ width:17px; height:17px; }
.icon-btn{
  display:inline-grid; place-items:center; width:36px; height:36px;
  background:transparent; border:0; border-radius:9px; cursor:pointer;
  color:var(--topbar-ink); opacity:.85;
}
.icon-btn:hover{ background:rgba(255,255,255,.12); opacity:1; }
.icon-btn svg{ width:18px; height:18px; }
.logout{
  display:inline-flex; align-items:center; gap:7px;
  color:var(--topbar-ink); opacity:.85; font-size:14px;
  padding:7px 11px; border-radius:9px;
}
.logout:hover{ background:rgba(255,255,255,.12); opacity:1; text-decoration:none; }
.logout svg{ width:17px; height:17px; }

/* ---------- gövde ---------- */
.wrap{ max-width:1080px; margin:0 auto; padding:clamp(20px,4vw,40px) clamp(16px,4vw,32px) 64px; }

.searchbar{
  display:flex; align-items:center; gap:10px;
  background:var(--bg); border:1.5px solid var(--line);
  border-radius:var(--radius); padding:0 16px; height:54px;
  margin-bottom:26px; box-shadow:var(--shadow);
  transition:border-color .15s, box-shadow .15s;
}
.searchbar:focus-within{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-tint); }
.searchbar svg{ width:20px; height:20px; color:var(--ink-soft); flex:none; }
.searchbar input{
  flex:1; border:0; background:transparent; outline:none;
  font-family:var(--font); font-size:16px; color:var(--ink);
}
.searchbar input::placeholder{ color:var(--ink-soft); }

/* ---------- ızgara (kartlar) ---------- */
.grid{
  display:grid; gap:16px;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows:1fr;              /* tüm satırlar en uzun kart yüksekliğinde */
}
/* launcher kategori başlığı (Araçlar / Muhasebe / …). Metin PHP upper_tr ile büyütülür (İ güvenli). */
.grid-cat{ font-size:12px; font-weight:700; letter-spacing:.08em; color:var(--ink-soft); margin:24px 2px 10px; }
.grid-cat:first-child{ margin-top:2px; }
/* sol menü logo ikonu: kart ile AYNI şekil ama RENKSİZ (grayscale) — diğer rail ikonları gibi nötr */
.rail-logo-img{ width:18px; height:18px; object-fit:contain; display:block; filter:grayscale(1) opacity(.55); }
.rail-item.active .rail-logo-img{ filter:grayscale(1) opacity(.9); }
/* Açık tema: beyaz kart + koyu yazı.  Koyu tema: koyu kart + beyaz yazı (referans).
   İkisi de tema değişkenlerinden gelir; renk yalnızca parlayan kenarda + ikonda. */
.card{
  --card-fill:var(--bg);
  position:relative;
  display:flex; flex-direction:column; justify-content:space-between; gap:14px;
  height:100%; min-height:128px; padding:17px 19px;
  border-radius:18px; text-decoration:none; color:var(--ink);
  border:1.5px solid transparent;
  background:
    linear-gradient(var(--card-fill), var(--card-fill)) padding-box,
    linear-gradient(135deg, var(--tc, var(--accent)), color-mix(in srgb, var(--tc, var(--accent)), #fff 38%)) border-box;
  box-shadow:var(--shadow), 0 12px 30px -14px color-mix(in srgb, var(--tc, var(--accent)), transparent 55%);
  transition:transform .16s ease, box-shadow .16s ease;
}
.card:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-lift), 0 16px 42px -12px color-mix(in srgb, var(--tc, var(--accent)), transparent 32%);
  text-decoration:none;
}
.card-top{ display:flex; align-items:flex-start; justify-content:space-between; }
.card-ico{ display:grid; place-items:center; width:32px; height:32px; color:var(--tc, var(--accent)); }
.card-ico svg{ width:30px; height:30px; }
.card-ico img{ width:30px; height:30px; object-fit:contain; display:block; }
/* koyu temada koyu-mürekkepli logo (esnaf) kaybolmasın → arkasına açık zemin çip */
[data-theme="dark"] .card[data-tool="esnafadmin"] .card-ico img{
  background:#fff; border-radius:7px; padding:3px; box-shadow:0 0 0 1px rgba(255,255,255,.6); }
.card-logo{
  display:block; width:30px; height:30px;
  background:currentColor;                 /* .card-ico color = --tc (araç rengi) */
  -webkit-mask:var(--logo) center / contain no-repeat;
  mask:var(--logo) center / contain no-repeat;
}
.card-title{ font-size:20px; font-weight:700; letter-spacing:-.02em; line-height:1.15; color:var(--ink); }
.card-sub{ font-size:14px; font-weight:400; color:var(--ink-soft); margin-top:3px; }

/* pasif / yakında — nötr, parıltısız */
.card.is-soon{
  --card-fill:var(--surface);
  background:var(--surface);
  border:1.5px solid var(--line);
  box-shadow:none; cursor:default; opacity:.8;
}
.card.is-soon .card-ico{ color:var(--ink-soft); }
.card.is-soon:hover{ transform:none; box-shadow:none; }
.soon{
  font-size:11px; font-weight:500; letter-spacing:.02em;
  color:var(--ink-soft); background:var(--bg);
  padding:3px 10px; border-radius:999px; border:1px solid var(--line);
}

/* çok-linkli kart (ör. Kurumsal Bilgiler → TR / DXB) */
.card.has-links{ position:relative; cursor:pointer; }
.card-cover{ position:absolute; inset:0; z-index:1; border-radius:inherit; }  /* boş alana tıkla → ana sayfa */
.card.has-links .card-top, .card.has-links .card-head{ position:relative; z-index:2; pointer-events:none; }
.card-links{ display:flex; gap:8px; flex-shrink:0; position:relative; z-index:3; pointer-events:auto; }
.card-link{
  font-size:12.5px; font-weight:700; letter-spacing:.04em;
  color:var(--tc, var(--accent)); background:transparent;
  border:1.5px solid var(--tc, var(--accent));
  padding:5px 13px; border-radius:9px; text-decoration:none; line-height:1;
  transition:background .15s ease, color .15s ease;
}
.card-link:hover{ background:var(--tc, var(--accent)); color:#fff; text-decoration:none; }
.card-link:active{ transform:translateY(1px); }
@media (max-width:640px){
  .card-links{ gap:10px; }
  .card-link{ font-size:14.5px; padding:8px 17px; border-radius:10px; }
}

/* erişilebilirlik: klavye odak halkaları (token-uyumlu, açık+koyu tema) */
.card:focus-visible,
.card-cover:focus-visible{ outline:2.5px solid var(--accent); outline-offset:3px; }
.card-link:focus-visible{ outline:2.5px solid var(--accent); outline-offset:2px; }
.grid-filter:focus-within{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-tint); }
/* basış geri-bildirimi — yalnız aktif (yakında olmayan) kartlar */
.card:not(.is-soon):active{ transform:translateY(-1px) scale(.992); }
/* hareket azaltma tercihi: kart geçiş/hareketlerini kapat */
@media (prefers-reduced-motion: reduce){
  .card, .card:hover, .card:not(.is-soon):active{ transition:none; transform:none; }
}

/* sade tema düğmesi (public üst bar) */
.theme-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:10px; cursor:pointer;
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
  color:var(--topbar-ink); padding:0;
}
.theme-btn:hover{ background:rgba(255,255,255,.13); }
.theme-btn svg{ width:19px; height:19px; display:block; }
.theme-btn .ic-sun{ display:none; }
.theme-btn[data-theme-now="dark"] .ic-sun{ display:inline-flex; }
.theme-btn[data-theme-now="dark"] .ic-moon{ display:none; }

.empty{ text-align:center; color:var(--ink-soft); padding:48px 0; }

/* ---------- login ---------- */
.login-body{ display:flex; flex-direction:column; justify-content:safe center; align-items:center;
  min-height:100vh; min-height:100dvh; min-height:var(--vvh, 100dvh);
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:24px 0 max(24px, env(safe-area-inset-bottom)); box-sizing:border-box;
  background-color:#070f15;
  background-image:
    radial-gradient(60% 55% at 28% 28%, rgba(160,214,244,.82), transparent 60%),
    radial-gradient(55% 60% at 74% 34%, rgba(36,163,220,.9), transparent 60%),
    radial-gradient(72% 66% at 58% 78%, rgba(14,71,99,.92), transparent 66%),
    radial-gradient(52% 52% at 14% 82%, rgba(36,163,220,.55), transparent 62%),
    linear-gradient(135deg, #04090d, #0e4763, #070f15);
  background-size:200% 200%, 220% 200%, 240% 240%, 210% 220%, 100% 100%;
  animation:aurora 30s ease-in-out infinite; }
@keyframes aurora{
  0%   { background-position:20% 30%, 80% 30%, 50% 80%, 10% 80%, 0 0; }
  33%  { background-position:62% 48%, 38% 62%, 72% 40%, 52% 48%, 0 0; }
  66%  { background-position:34% 70%, 66% 22%, 28% 60%, 82% 28%, 0 0; }
  100% { background-position:20% 30%, 80% 30%, 50% 80%, 10% 80%, 0 0; }
}
/* ince film grain */
.login-body::before{ content:''; position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.07; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.login-wrap{ position:relative; z-index:1; }
@media (prefers-reduced-motion: reduce){ .login-body{ animation:none; } }
/* mobil: hareketli aurora'nın açık-mavi blob'ları "beyaz alan"/"patlama" gibi görünüyordu →
   animasyonu kapat, blob'lu çok-radyalli zemini SADE koyu gradient'le değiştir, yatay taşmayı kilitle */
@media (max-width:560px){
  /* ekip1 gibi: kart ÜSTTEN konumlu (ortalı değil) → klavye açılınca oynamaz, sabit durur */
  .login-body{ animation:none; overflow-x:hidden; justify-content:flex-start;
    background-image:linear-gradient(160deg,#0e4763,#04090d); background-size:cover;
    padding:clamp(48px,13vh,120px) 0 max(16px, env(safe-area-inset-bottom)); }
  .login-wrap{ padding:0 18px; }
  /* kompakt kart (ekip1 ebadı): küçük logo + dar espas */
  .login-card{ padding:22px 20px 20px; }
  .login-brand{ margin-bottom:18px; }
  .login-logo{ height:32px; }
  .login-by-logo{ height:16px; margin:14px auto 0; }
}
.login-wrap{ width:100%; max-width:380px; padding:0 24px; margin:0; flex:none; }
.login-card{
  background:var(--bg); border:1px solid var(--line);
  border-radius:18px; box-shadow:var(--shadow-lift);
  padding:34px 30px 30px; text-align:center;
}
.login-brand{ display:inline-flex; align-items:center; gap:9px; margin-bottom:18px; }
.login-brand .brand-name{ color:var(--ink); font-size:22px; }
.login-title{ margin:0; font-size:30px; font-weight:700; letter-spacing:-.02em; color:var(--accent); }
.login-sub{ margin:4px 0 22px; color:var(--ink-soft); font-size:14px; }
.login-err{
  background:var(--accent-tint); color:var(--err);
  border-radius:10px; padding:10px 12px; font-size:14px; margin-bottom:16px;
}
.login-form{ display:flex; flex-direction:column; gap:14px; text-align:left; }
.fld{ display:flex; flex-direction:column; gap:6px; }
.fld span{ font-size:13px; color:var(--ink-soft); font-weight:500; }
.fld input{
  font-family:var(--font); font-size:16px; color:var(--ink);   /* 16px: iOS odaklanınca otomatik zoom yapmasın (yatay kayma engeli) */
  background:var(--bg); border:1.5px solid var(--line);
  border-radius:10px; padding:11px 13px; outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.fld input:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-tint); }
.remember{ display:flex; align-items:center; gap:8px; font-size:14px; color:var(--ink-soft); cursor:pointer; }
.remember input{ width:16px; height:16px; accent-color:var(--accent); }
.btn-primary{
  margin-top:4px; font-family:var(--font); font-size:15px; font-weight:600;
  color:#fff; background:var(--accent); border:0; border-radius:10px;
  padding:13px; cursor:pointer; transition:background .15s, transform .1s;
}
.btn-primary:hover{ background:var(--accent-dark); }
.btn-primary:active{ transform:translateY(1px); }

/* ---------- mobil ---------- */
@media (max-width:560px){
  .grid{ grid-template-columns:1fr; }
  .user{ display:none; }              /* dar ekranda isim gizli, ikonlar kalır */
  .wrap{ padding-bottom:max(40px, env(safe-area-inset-bottom)); }
}

/* ---------- iOS standalone alt-boşluk fix ---------- */
/* WKWebView viewport bug'ı: html+body arka planını SAYFA zeminine eşitle (tema-duyarlı) */
@media all and (display-mode:standalone){
  html, body{ background:var(--page, #F3F7FA); }
  [data-theme="dark"] html, [data-theme="dark"] body{ background:var(--page, #0E171D); }
  body{ min-height:100vh; min-height:100dvh; }
  /* login zemini her boyutta animasyonlu gradient (üstte tanımlı) */
}

/* ============================================================
   hesap kartı (profil dropdown) + yönetim/profil sayfaları (v2)
   ============================================================ */
.account{ position:relative; }
.avatar{
  display:grid; place-items:center; flex:none;
  width:30px; height:30px; border-radius:50%;
  background:var(--accent); color:#fff; font-size:13px; font-weight:600;
}
.avatar.lg{ width:42px; height:42px; font-size:17px; }
.user-btn{
  display:inline-flex; align-items:center; gap:9px;
  background:transparent; border:0; cursor:pointer;
  color:var(--topbar-ink); font-family:var(--font); font-size:14px;
  padding:6px 8px 6px 6px; border-radius:10px;
}
.user-btn:hover{ background:rgba(255,255,255,.12); }
.user-btn .caret{ width:15px; height:15px; opacity:.8; }
[data-theme="dark"] .user-btn:hover{ background:rgba(255,255,255,.08); }

.acct-card{
  position:absolute; top:calc(100% + 8px); right:0; z-index:40;
  width:260px;
  background:var(--bg); color:var(--ink);
  border:1px solid var(--line); border-radius:14px;
  box-shadow:var(--shadow-lift); padding:8px;
}
.acct-head{ display:flex; align-items:center; gap:11px; padding:10px 10px 12px; }
.acct-id{ min-width:0; }
.acct-name{ font-weight:600; font-size:15px; display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.acct-mail{ font-size:12.5px; color:var(--ink-soft); margin-top:1px; overflow:hidden; text-overflow:ellipsis; }
.tag-admin{
  font-size:10.5px; font-weight:500; letter-spacing:.02em;
  color:var(--accent); background:var(--accent-tint);
  padding:2px 8px; border-radius:999px;
  white-space:nowrap; flex-shrink:0;        /* "Süper Admin" tek satır, çerçeveye sığar */
}

.acct-theme{
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 10px; margin:0 0 6px;
  border-top:1px solid var(--line); border-bottom:1px solid var(--line);
  font-size:13px; color:var(--ink-soft);
}
.seg{ display:inline-flex; background:var(--surface); border-radius:9px; padding:3px; gap:3px; }
.seg-btn{
  display:inline-flex; align-items:center; gap:6px;
  font-family:var(--font); font-size:13px; color:var(--ink-soft);
  background:transparent; border:0; border-radius:7px; padding:5px 11px; cursor:pointer;
}
.seg-btn svg{ width:15px; height:15px; }
.seg-btn.on{ background:var(--bg); color:var(--accent); font-weight:600; box-shadow:0 1px 2px rgba(15,30,39,.10), 0 0 0 1px var(--line); }
/* yalnız-ikon seg (tema seçici: sistem / açık / koyu) */
.seg-ico .seg-btn{ padding:7px 12px; }
.seg-ico .seg-btn svg{ width:17px; height:17px; }
/* aç/kapat switch */
.switch{ position:relative; display:inline-block; width:46px; height:26px; flex:none; cursor:pointer; }
.switch input{ position:absolute; opacity:0; width:0; height:0; }
.switch .sw-tr{ position:absolute; inset:0; background:var(--line); border-radius:999px; transition:background .18s; }
.switch .sw-tr::after{ content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; background:#fff; border-radius:50%; box-shadow:0 1px 3px rgba(8,16,22,.28); transition:transform .18s; }
.switch input:checked + .sw-tr{ background:var(--accent); }
.switch input:checked + .sw-tr::after{ transform:translateX(20px); }
.switch input:disabled + .sw-tr{ opacity:.5; cursor:default; }
.switch input:focus-visible + .sw-tr{ box-shadow:0 0 0 3px var(--accent-tint); }
/* RBAC rol seçim chip'leri (Kullanıcılar formu) */
.fld-lbl{ display:block; font-size:12.5px; font-weight:600; color:var(--ink-soft); margin-bottom:7px; }
.role-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.role-chip{ display:inline-flex; align-items:center; padding:9px 15px; border:1px solid var(--line); border-radius:10px; cursor:pointer; font-size:13.5px; font-weight:600; color:var(--ink-soft); user-select:none; min-height:44px; position:relative; transition:border-color .12s, background .12s; }
.role-chip input{ position:absolute; opacity:0; width:0; height:0; }
.role-chip.on, .role-chip:has(input:checked){ border-color:var(--accent); background:var(--accent-tint); color:var(--accent-dark); }
[data-theme="dark"] .role-chip.on, [data-theme="dark"] .role-chip:has(input:checked){ color:var(--accent); }   /* koyu tint üstünde parlak metin */
.role-chip-admin.on, .role-chip-admin:has(input:checked){ border-color:#DC2626; background:rgba(220,38,38,.12); color:#DC2626; }
[data-theme="dark"] .role-chip-admin.on, [data-theme="dark"] .role-chip-admin:has(input:checked){ border-color:#F87171; color:#FCA5A5; }
.role-chip input:disabled{ cursor:default; }
.role-chip:has(input:disabled){ opacity:.7; cursor:default; }
/* ===== Açılır çoklu seçim (multiselect dropdown) — .role-chips.ms JS ile sarılır ===== */
.ms-wrap{ position:relative; }
.ms-control{ display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:46px;
  padding:9px 14px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--ink);
  font:inherit; font-size:14px; font-weight:500; cursor:pointer; text-align:left; transition:border-color .12s; }
.ms-control:hover, .ms-wrap.open .ms-control{ border-color:var(--accent); }
.ms-summary{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ms-summary.empty{ color:var(--ink-soft); font-weight:400; }
.ms-chev{ flex:none; font-size:11px; color:var(--ink-soft); transition:transform .15s; }
.ms-wrap.open .ms-chev{ transform:rotate(180deg); }
.ms-panel{ position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:60; background:var(--card);
  border:1px solid var(--line); border-radius:12px; box-shadow:0 16px 40px rgba(15,30,39,.18);
  max-height:300px; overflow-y:auto; padding:6px; display:none; }
.ms-wrap.open .ms-panel{ display:block; }
.role-chips.ms{ display:flex; flex-direction:column; gap:1px; flex-wrap:nowrap; }
.role-chips.ms .role-chip{ width:100%; justify-content:flex-start; gap:11px; padding:9px 10px; min-height:42px;
  border:0; border-radius:8px; background:transparent; color:var(--ink); font-weight:500; }
.role-chips.ms .role-chip:hover{ background:var(--surface); }
.role-chips.ms .role-chip.on, .role-chips.ms .role-chip:has(input:checked){ background:transparent; color:var(--ink); border:0; }
.role-chips.ms .role-chip::before{ content:""; flex:none; width:19px; height:19px; border-radius:5px;
  border:1.8px solid var(--line); background:var(--bg); transition:.12s; }
.role-chips.ms .role-chip.on::before, .role-chips.ms .role-chip:has(input:checked)::before{
  border-color:var(--accent); background:var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5L20 6' stroke='white' stroke-width='3.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.role-chips.ms .role-chip-admin.on::before, .role-chips.ms .role-chip-admin:has(input:checked)::before{ background-color:#DC2626; border-color:#DC2626; }
.tr-perms .ms-wrap{ width:240px; max-width:48vw; }
@media(max-width:560px){ .tr-perms .ms-wrap{ width:150px; } }
/* Modül erişimi matrisi */
.tr-list{ display:flex; flex-direction:column; }
.tr-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 2px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.tr-row:last-child{ border-bottom:0; }
.tr-tool{ display:inline-flex; align-items:center; gap:11px; font-weight:600; font-size:14.5px; color:var(--ink); }
/* erişim/düzenleme satırı — masaüstü: araç solda, iki grup sağda yan yana */
.tr-row2{ align-items:flex-start; }
.tr-row2 .tr-tool{ padding-top:6px; }
.tr-perms{ display:flex; flex-wrap:wrap; gap:14px 22px; flex:1; justify-content:flex-end; }
.tr-perm{ display:flex; flex-direction:column; gap:8px; }
.tr-perm-lbl{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--ink-soft); }
/* mobil: araç başlık üstte; her grup AYRI kutu + çipler 4'lü düzenli grid (tek satır) */
@media(max-width:640px){
  .tr-row2{ flex-direction:column; align-items:stretch; gap:12px; padding:16px 0; }
  .tr-row2 .tr-tool{ padding-top:0; font-size:15.5px; }
  .tr-perms{ flex-direction:column; gap:10px; width:100%; }
  .tr-perm{ background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:12px 12px 13px; gap:9px; }
  .tr-perm .role-chips{ display:grid; grid-template-columns:repeat(4,1fr); gap:7px; }
  .tr-perm .role-chip{ justify-content:center; text-align:center; padding:0 4px; min-height:46px; font-size:12.5px; }
}
@media(max-width:360px){ .tr-perm .role-chip{ font-size:11.5px; } }
/* Kullanıcılar — departman filtresi + grup başlıkları */
.dept-filter{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.dept-chip{ font:inherit; font-size:13px; font-weight:600; padding:8px 13px; border-radius:999px; border:1px solid var(--line); background:var(--card); color:var(--ink-soft); cursor:pointer; min-height:40px; display:inline-flex; align-items:center; gap:6px; transition:border-color .12s, background .12s; }
.dept-chip span{ font-size:11.5px; font-weight:700; background:var(--surface); color:var(--ink-soft); border-radius:999px; padding:1px 7px; }
.dept-chip.on{ background:var(--accent-tint); border-color:var(--accent); color:var(--accent-dark); }
[data-theme="dark"] .dept-chip.on{ color:var(--accent); }
.dept-chip.on span{ background:var(--accent); color:#fff; }
.users tr.dept-row td{ padding:16px 12px 7px; font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--ink-soft); background:transparent; }
.users tr.dept-row:first-child td{ padding-top:4px; }
.users tr.dept-row .dept-count{ color:var(--accent); margin-left:5px; }
/* yerinde yardım — "?" ipucu (hover + odak; koyu balon her temada) */
.help-tip{ display:inline-grid; place-items:center; width:16px; height:16px; border-radius:50%; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); font-size:10.5px; font-weight:800; cursor:help; margin-left:6px; vertical-align:1px; position:relative; }
.help-tip:hover, .help-tip:focus{ border-color:var(--accent); color:var(--accent); outline:none; }
.help-tip::after{ content:attr(data-tip); position:absolute; bottom:calc(100% + 9px); left:50%; transform:translateX(-50%); width:240px; max-width:62vw; background:#0F1E27; color:#fff; font-size:12px; font-weight:500; line-height:1.5; letter-spacing:0; text-transform:none; text-align:left; padding:9px 12px; border-radius:10px; box-shadow:0 10px 28px rgba(8,16,22,.34); opacity:0; visibility:hidden; transition:opacity .12s; z-index:80; pointer-events:none; }
.help-tip::before{ content:""; position:absolute; bottom:calc(100% + 4px); left:50%; transform:translateX(-50%); border:5px solid transparent; border-top-color:#0F1E27; opacity:0; visibility:hidden; transition:opacity .12s; }
.help-tip:hover::after, .help-tip:focus::after, .help-tip:hover::before, .help-tip:focus::before{ opacity:1; visibility:visible; }

.acct-menu{ display:flex; flex-direction:column; }
.acct-menu a{
  display:flex; align-items:center; gap:11px;
  padding:10px; border-radius:9px;
  color:var(--ink); font-size:14px; text-decoration:none;
}
.acct-menu a:hover{ background:var(--accent-tint); text-decoration:none; }
.acct-menu a svg{ width:18px; height:18px; color:var(--ink-soft); flex:none; }
.acct-menu a:hover svg{ color:var(--accent); }
.acct-logout{ color:var(--err) !important; }
.acct-logout svg{ color:var(--err) !important; }
.acct-logout:hover{ background:rgba(192,80,77,.10) !important; }

/* ---------- yönetim / profil sayfaları ---------- */
.page{ max-width:760px; margin:0 auto; padding:clamp(20px,4vw,40px) clamp(16px,4vw,32px) 64px; }
.page-head{ display:flex; align-items:center; gap:12px; margin-bottom:22px; }
.back{ display:inline-flex; align-items:center; gap:6px; color:var(--ink-soft); font-size:14px; }
.back svg{ width:17px; height:17px; }
.page-title{ margin:0; font-size:24px; font-weight:700; letter-spacing:-.02em; }

.panel{
  background:var(--bg); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow);
  padding:22px 22px 24px; margin-bottom:20px;
}
.panel h2{ margin:0 0 16px; font-size:16px; font-weight:600; }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:520px){ .form-row{ grid-template-columns:1fr; } }
.with-gen{ display:flex; gap:8px; }
.with-gen input{ flex:1; }
.btn-ghost{
  font-family:var(--font); font-size:14px; color:var(--accent);
  background:var(--accent-tint); border:0; border-radius:10px;
  padding:0 14px; cursor:pointer; white-space:nowrap;
}
.btn-ghost:hover{ background:var(--accent); color:#fff; }
.form-actions{ margin-top:18px; display:flex; gap:10px; align-items:center; }

.banner{ border-radius:11px; padding:12px 14px; font-size:14px; margin-bottom:18px; }
.banner.ok{ background:var(--accent-tint); color:var(--accent-dark); }
[data-theme="dark"] .banner.ok{ color:#CDE8FA; }   /* koyu modda accent-dark yazı accent-tint zemine karışıp görünmez kalıyordu */
.banner.err{ background:rgba(192,80,77,.12); color:var(--err); }
[data-theme="dark"] .banner.err{ color:#f3a6a3; }
.banner code{ font-family:ui-monospace,Menlo,Consolas,monospace; background:rgba(0,0,0,.06); padding:2px 7px; border-radius:6px; }
[data-theme="dark"] .banner code{ background:rgba(255,255,255,.10); }

.users{ width:100%; border-collapse:collapse; font-size:14px; }
.users th{ text-align:left; font-weight:500; color:var(--ink-soft); font-size:12.5px; padding:8px 10px; border-bottom:1px solid var(--line); }
.users td{ padding:11px 10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.users tr:last-child td{ border-bottom:0; }
.u-name{ display:flex; align-items:center; gap:10px; font-weight:500; }
.u-mail{ color:var(--ink-soft); }
.pill{ font-size:11px; padding:2px 8px; border-radius:999px; white-space:nowrap; display:inline-block; }
.pill.admin{ color:var(--accent); background:var(--accent-tint); }
.pill.off{ color:var(--ink-soft); background:var(--surface); }
.u-actions{ display:flex; gap:6px; justify-content:flex-end; }
.u-mail{ overflow-wrap:anywhere; }
/* mobil: 5 kolonlu tablo taşıyordu → satırları kart gibi dikey diz, td'leri data-label ile etiketle */
@media (max-width:600px){
  .users thead{ display:none; }
  .users, .users tbody, .users tr, .users td{ display:block; width:auto; }
  .users tr{ padding:14px 2px; border-bottom:1px solid var(--line); }
  .users tr:last-child{ border-bottom:0; }
  .users td{ padding:4px 0; border:0; }
  .users td[data-label]{ display:flex; align-items:center; gap:10px; }
  .users td[data-label]::before{ content:attr(data-label); flex:none; min-width:62px;
    font-size:12px; font-weight:500; color:var(--ink-soft); }
  .users td:first-child{ margin-bottom:8px; }
  .u-actions{ justify-content:flex-start; flex-wrap:wrap; margin-top:6px; }
}
.act{
  font-family:var(--font); font-size:12.5px; cursor:pointer;
  background:var(--surface); color:var(--ink-soft); border:1px solid var(--line);
  border-radius:8px; padding:5px 10px;
}
.act:hover{ border-color:var(--accent); color:var(--accent); }
.act.danger:hover{ border-color:var(--err); color:var(--err); }
.muted{ color:var(--ink-soft); font-size:13px; }

/* ============================================================
   v3 — foto, geri butonu sadeleştirme, araç çubuğu, açılan form
   ============================================================ */
/* sade geri butonu (etiketsiz, ikon) */
.back-btn{
  display:inline-grid; place-items:center; width:38px; height:38px; flex:none;
  border:1px solid var(--line); border-radius:10px;
  background:var(--bg); color:var(--ink-soft);
}
.back-btn:hover{ border-color:var(--accent); color:var(--accent); text-decoration:none; }
.back-btn svg{ width:20px; height:20px; }

/* avatar görseli */
.avatar.has-img{ background:transparent; overflow:hidden; }
.avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.avatar.xl{ width:64px; height:64px; font-size:24px; }

/* araç çubuğu: arama + yeni kullanıcı */
.toolbar{ display:flex; gap:12px; align-items:stretch; margin-bottom:20px; }
.toolbar .searchbar{ flex:1; margin-bottom:0; }
.toolbar .btn-primary{ display:inline-flex; align-items:center; gap:8px; padding:0 18px; white-space:nowrap; }
.toolbar .plus{ font-size:19px; line-height:1; font-weight:400; }
@media (max-width:520px){
  .toolbar{ flex-direction:column; }
  .toolbar .btn-primary{ padding:13px; justify-content:center; }
}

/* açılan form: foto satırı + dosya butonu */
.photo-row{ display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.photo-ctl{ display:flex; flex-direction:column; gap:6px; }
.filebtn{
  display:inline-block; cursor:pointer; max-width:240px;
  font-size:14px; color:var(--accent); background:var(--accent-tint);
  border-radius:10px; padding:9px 14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.filebtn:hover{ background:var(--accent); color:#fff; }
.filebtn input{ display:none; }
.rm-photo{ display:flex; align-items:center; gap:7px; font-size:13px; color:var(--ink-soft); cursor:pointer; }
.rm-photo input{ width:15px; height:15px; accent-color:var(--err); }

.link-cancel{
  background:transparent; border:0; cursor:pointer; padding:6px 8px;
  color:var(--ink-soft); font-family:var(--font); font-size:14px; text-decoration:none;
}
.link-cancel:hover{ color:var(--ink); text-decoration:underline; }
.nores{ text-align:center; padding:30px 0 6px; }

/* ============================================================
   v4 — kadrajlayıcı (crop) modalı
   ============================================================ */
#cropModal{
  position:fixed; inset:0; z-index:100;
  display:grid; place-items:center;
  background:rgba(8,16,21,.62); padding:20px;
}
#cropModal[hidden]{ display:none; }
.crop-box{
  width:320px; max-width:100%;
  background:var(--bg); border:1px solid var(--line);
  border-radius:18px; box-shadow:var(--shadow-lift); padding:18px;
}
.crop-stage{
  width:280px; height:280px; max-width:100%;
  margin:0 auto; border-radius:50%; overflow:hidden;
  background:var(--surface); position:relative;
  cursor:grab; touch-action:none; user-select:none;
  box-shadow:inset 0 0 0 2px var(--accent-tint);
}
.crop-stage:active{ cursor:grabbing; }
.crop-stage img{ position:absolute; top:0; left:0; max-width:none; pointer-events:none; }
.crop-zoom{ display:flex; align-items:center; gap:10px; margin:16px 4px 4px; color:var(--ink-soft); }
.crop-zoom span{ font-size:18px; width:14px; text-align:center; }
.crop-zoom input[type=range]{ flex:1; accent-color:var(--accent); }
.crop-actions{ display:flex; align-items:center; justify-content:flex-end; gap:8px; margin-top:14px; }

/* ============================================================
   v5 — gerçek logolar, roller, tema seçimi, select
   ============================================================ */
/* topbar yatay logo */
.brand-logo{ height:26px; width:auto; display:block; }

/* login dikey logo (açık/koyu) */
.login-brand{ display:block; margin-bottom:20px; }
.login-logo{ height:44px; width:auto; display:block; margin:0 auto; }
/* login logoları tema-duyarlı: koyu kart → koyu varyant (beyaz yazı), açık kart → açık varyant */
.lg-dark{ display:none !important; }
[data-theme="dark"] .lg-light{ display:none !important; }
[data-theme="dark"] .lg-dark{ display:block !important; }

/* yükleme ekranı (araç iframe'i yüklenene kadar) — ekip2 logosu, yumuşak fade + pulse */
/* loader yalnız İÇERİK alanını kaplar — topbar (üst) ve rail (sol 250px) açıkta kalır, gezinme engellenmez */
.ekip-loader{ display:none; position:fixed; inset:calc(60px + env(safe-area-inset-top)) 0 0 250px; z-index:15;
  place-items:center; background:var(--page, #F3F7FA); transition:opacity .4s ease; }
@media (max-width:860px){ .ekip-loader{ left:0; } }   /* mobilde rail off-canvas → içerik tam genişlik */
.ekip-loader.on{ display:grid; }
.ekip-loader.done{ opacity:0; pointer-events:none; }
.ekip-loader-logo{ height:56px; width:auto; animation:ekipPulse 1.15s ease-in-out infinite; }
[data-theme="dark"] .ekip-loader{ background:var(--page, #0E171D); }
@keyframes ekipPulse{ 0%,100%{ opacity:.4; transform:scale(.97); } 50%{ opacity:1; transform:scale(1.02); } }
@media (prefers-reduced-motion: reduce){ .ekip-loader-logo{ animation:none; } }
/* ===== Ayarlar popup (her sayfada; sekmeli iframe) ===== */
.set-ov{ position:fixed; inset:0; z-index:1200; background:rgba(8,16,22,.5); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); display:flex; align-items:center; justify-content:center; padding:24px; animation:setOvIn .18s ease; }
.set-ov[hidden]{ display:none; }
@keyframes setOvIn{ from{ opacity:0; } to{ opacity:1; } }
.set-modal{ position:relative; background:var(--bg); border:1px solid var(--line); border-radius:18px; width:100%; max-width:1080px; height:min(88vh,900px); display:flex; flex-direction:column; overflow:hidden; box-shadow:0 30px 90px rgba(8,16,22,.5); }
.set-x{ position:absolute; top:14px; right:14px; z-index:3; width:34px; height:34px; border:0; background:var(--surface); color:var(--ink-soft); border-radius:9px; font-size:20px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 1px 3px rgba(8,16,22,.12); }
.set-x:hover{ color:var(--ink); }
.set-frame{ flex:1; width:100%; border:0; background:var(--bg); }
@media (max-width:560px){ .set-ov{ padding:0; } .set-modal{ max-width:none; height:100dvh; border-radius:0; padding-top:env(safe-area-inset-top); } .set-x{ top:calc(14px + env(safe-area-inset-top)); } }
/* alt Tinkon logosu (yazısız) */
.login-by-logo{ height:20px; width:auto; display:block; margin:24px auto 0; opacity:.85; }

/* "Giriş yap" butonu — aynı tema (Tinkon mavisi → koyu) */
.login-form .btn-primary{ background:linear-gradient(120deg,#2bb4ec,#24A3DC,#0E4763); background-size:220% auto;
  box-shadow:0 8px 24px rgba(14,71,99,.38); animation:verShine 8s ease infinite; }
.login-form .btn-primary:hover{ transform:translateY(-1px); filter:brightness(1.05); }
.login-form .btn-primary.loading{ pointer-events:none; opacity:.85; transform:none; }
.login-form .btn-primary.loading .lb-txt{ padding-left:24px; position:relative; }
.login-form .btn-primary.loading .lb-txt::before{ content:""; position:absolute; left:0; top:50%; width:15px; height:15px;
  margin-top:-7.5px; border:2px solid rgba(255,255,255,.45); border-top-color:#fff; border-radius:50%; animation:lbSpin .7s linear infinite; }
@keyframes lbSpin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .login-form .btn-primary{ animation:none; } .login-form .btn-primary.loading .lb-txt::before{ animation:none; } }

/* şifre göster/gizle göz */
.pw-wrap{ position:relative; display:flex; width:100%; }
.pw-wrap input{ flex:1; min-width:0; padding-right:46px; }  /* min-width:0 → Safari'de input intrinsic genişliği taşırıp alanı e-postadan geniş yapmasın */
.pw-eye{ position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:34px; height:34px; display:grid; place-items:center; border:0; background:none;
  color:var(--ink-soft); cursor:pointer; border-radius:8px; }
.pw-eye:hover{ color:var(--accent); }
.pw-eye svg{ width:20px; height:20px; }
.pw-eye .ic-hide{ display:none; }
.pw-eye.on .ic-show{ display:none; }
.pw-eye.on .ic-hide{ display:block; }

/* rol rozetleri */
.pill.role-superadmin{ color:#fff; background:var(--accent); }
.pill.role-admin{ color:var(--accent); background:var(--accent-tint); }
.pill.role-operator{ color:var(--ink-soft); background:var(--surface); }

/* form select (rol) — özel chevron (native yapışık/siyah ok yok), açık+koyu standart */
.fld select{
  font-family:var(--font); font-size:15px; color:var(--ink);
  background-color:var(--bg); border:1.5px solid var(--line);
  border-radius:10px; padding:11px 40px 11px 13px; outline:none; cursor:pointer;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A6B75' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center;
}
[data-theme="dark"] .fld select{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239DB0BB' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.fld select:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-tint); }
.fld select:disabled{ opacity:.55; cursor:default; }
/* tarih girişi: koyu temada takvim ikonu görünür kalsın (her form aracında) */
[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator{ filter:invert(1) brightness(1.5); }

/* profil > görünüm (tema) satırı */
.theme-pick{ display:flex; align-items:center; justify-content:space-between; gap:14px; }

/* ============================================================
   v4 — profil sayfası düzeni
   ============================================================ */
.panel-head{ margin-bottom:18px; }
.panel-head h2{ margin:0 0 3px; font-size:17px; font-weight:600; letter-spacing:-.01em; }
.panel-sub{ margin:0; font-size:13px; color:var(--ink-soft); }

.photo-row{ align-items:flex-start; gap:18px; }
.avatar.xl{ width:76px; height:76px; font-size:26px; box-shadow:0 0 0 4px var(--surface); }
.photo-ctl{ gap:9px; padding-top:3px; }

.filebtn{
  display:inline-flex; align-items:center; gap:7px; width:max-content; max-width:none;
  font-size:14px; font-weight:500; color:var(--ink);
  background:var(--bg); border:1.5px solid var(--line);
  border-radius:10px; padding:9px 15px; cursor:pointer;
  transition:border-color .15s, color .15s, background .15s;
}
.filebtn svg{ width:16px; height:16px; }
.filebtn:hover{ border-color:var(--accent); color:var(--accent); background:var(--accent-tint); }

.theme-pick span{ font-size:14px; font-weight:500; color:var(--ink); }

/* ============================================================
   v5 — üst bar sol grup (logo + sayfa konumu) + araç iframe kabuğu
   ============================================================ */
.topbar-left{ display:flex; align-items:center; gap:12px; flex:none; }
.brand-page{
  display:block; min-width:0; max-width:100%;
  color:var(--topbar-ink); font-size:16px; font-weight:600; letter-spacing:-.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.brand-page-sep{ color:var(--topbar-ink); opacity:.45; font-weight:400; }
/* /ekip ana ekranı: sağda ekip2 logosu (koyu üst bar → beyaz ekip + mavi 2) */
.brand-ekip2{ height:26px; width:auto; display:block; }
@media (max-width:560px){ .brand-ekip2{ height:22px; } }

/* araç sayfaları: üst bar + altında uygulamayı taşıyan iframe */
body.tool-shell{
  height:100vh; margin:0;   /* 100vh = iOS standalone'da TAM ekran (alt safe-area dahil). 100dvh WKWebView'de alt inseti dışlayıp altta siyah bant bırakıyordu — KULLANMA. */
  display:flex; flex-direction:column; overflow:hidden;
  background:var(--page, #F3F7FA);            /* guide ile aynı zemin */
}
[data-theme="dark"] body.tool-shell{ background:var(--page, #0E171D); }
body.tool-shell .topbar{ position:relative; flex:none; }
.tool-frame{ flex:1; width:100%; border:0; display:block; background:var(--bg); }

@media (max-width:560px){
  .brand-page{ font-size:14px; }
}

/* ---------- kullanıcı: araç erişim yetkileri ---------- */
.acc-head{ display:flex; align-items:center; justify-content:space-between; margin:2px 0 9px; }
.acc-all-btn{ font-family:var(--font); font-size:12.5px; font-weight:600; color:var(--accent);
  background:none; border:0; cursor:pointer; padding:3px 4px; }
.acc-all-btn:hover{ text-decoration:underline; }
/* araç erişimi — departmana göre gruplu tek liste; alt-bölümler ilgili aracın altında inline */
.acc-list{ display:flex; flex-direction:column; gap:6px; }
.acc-cat{ font-size:11px; font-weight:700; letter-spacing:.08em; color:var(--ink-soft); padding:14px 2px 2px; }
.acc-cat:first-child{ padding-top:2px; }
.acc-row{ position:relative; display:flex; align-items:center; gap:11px;
  padding:9px 13px; border:1.5px solid var(--line); border-radius:11px;
  background:var(--bg); cursor:pointer; transition:border-color .12s, background .12s; user-select:none; }
.acc-row:hover{ border-color:var(--accent); }
.acc-row input{ position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
.acc-ico{ width:34px; height:34px; border-radius:9px; flex:none; display:grid; place-items:center; background:var(--surface); color:var(--ink-soft); transition:.12s; }
.acc-ico svg{ width:19px; height:19px; }
.acc-name{ flex:1; font-size:13.5px; font-weight:600; color:var(--ink); line-height:1.2; }
.acc-tick{ margin-left:auto; flex:none; width:19px; height:19px; border-radius:50%;
  display:grid; place-items:center; color:#fff; background:var(--line); opacity:.0; transition:.12s; }
.acc-tick svg{ width:12px; height:12px; stroke:#fff; }
.acc-row.on{ border-color:var(--accent); background:var(--accent-tint); }
.acc-row.on .acc-ico{ background:#fff; color:var(--accent); }
.acc-row.on .acc-tick{ background:var(--accent); opacity:1; }

/* inline alt-bölümler: aracın hemen altında, girintili çipler; araç kapalıyken soluk ama görünür */
.acc-subs{ display:flex; flex-wrap:wrap; gap:6px; margin:1px 0 3px 45px; }
.acc-subs[data-off]{ opacity:.4; }
.acc-subs[data-off] .acc-subrow{ pointer-events:none; }
.acc-subrow{ position:relative; display:inline-flex; align-items:center; gap:7px;
  padding:5px 11px; border:1.5px solid var(--line); border-radius:9px;
  background:var(--bg); cursor:pointer; transition:border-color .12s, background .12s; user-select:none; }
.acc-subrow:hover{ border-color:var(--accent); }
.acc-subrow input{ position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
.acc-subtick{ flex:none; width:16px; height:16px; border-radius:50%;
  display:grid; place-items:center; background:var(--line); opacity:.0; transition:.12s; }
.acc-subtick svg{ width:10px; height:10px; stroke:#fff; }
.acc-subname{ font-size:12.5px; font-weight:500; color:var(--ink); line-height:1.2; }
.acc-subrow.on{ border-color:var(--accent); background:var(--accent-tint); }
.acc-subrow.on .acc-subtick{ background:var(--accent); opacity:1; }

/* kullanıcı formunda "Kullanıcılar"a dön butonu */
.form-back{ display:inline-flex; align-items:center; gap:7px; width:auto; height:38px;
  padding:0 14px 0 10px; margin-bottom:16px; font-family:var(--font); font-size:14px; font-weight:600; }
.form-back svg{ width:18px; height:18px; }

/* ====================== sol liste menü (rail) ====================== */
.shell{ display:flex; align-items:flex-start; }
.shell-main{ flex:1 1 auto; min-width:0; }
.rail{ flex:none; width:250px; position:sticky; top:60px; height:calc(100vh - 60px);
  overflow-y:auto; background:var(--bg); border-right:1px solid var(--line); }
.rail-inner{ padding:14px 12px 28px; }
/* "Ana Menü"ye dönüş — hem masaüstü hem mobilde sol menünün üstünde */
.rail-home{ display:flex; align-items:center; gap:11px; margin:0 0 8px; padding:8px 12px;
  border-radius:10px; background:var(--surface); color:var(--ink); font-weight:600;
  font-size:14px; text-decoration:none; }
.rail-home:hover{ background:var(--accent-tint); color:var(--accent); }
.rail-home.active{ background:var(--accent-tint); color:var(--accent); }
.rail-home .rail-ico{ width:30px; height:30px; flex:none; border-radius:8px; display:grid;
  place-items:center; background:var(--bg); }
.rail-home.active .rail-ico{ background:#fff; color:var(--accent); }
.rail-home .rail-ico svg{ width:18px; height:18px; }
.rail-group{ padding:15px 12px 6px; font-size:11px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--ink-soft); }
.rail-nav{ display:flex; flex-direction:column; gap:2px; }
.rail-item{ display:flex; align-items:center; gap:11px; padding:8px 12px; border-radius:10px;
  color:var(--ink); font-size:14px; font-weight:500; text-decoration:none;
  transition:background .12s, color .12s; }
.rail-item:hover{ background:var(--surface); text-decoration:none; }
.rail-item.active{ background:var(--accent-tint); color:var(--accent); font-weight:600; }
.rail-item.rail-soon{ cursor:default; opacity:.55; }
.rail-item.rail-soon:hover{ background:transparent; }
.rail-soonbadge{ margin-left:auto; font-size:10px; font-weight:600; color:var(--ink-soft);
  background:var(--surface); border:1px solid var(--line); border-radius:6px; padding:1px 6px; white-space:nowrap; }
.rail-ico{ width:30px; height:30px; flex:none; border-radius:8px; display:grid; place-items:center;
  background:var(--surface); color:var(--ink-soft); transition:.12s; }
.rail-item.active .rail-ico{ background:#fff; color:var(--accent); }
.rail-ico svg{ width:18px; height:18px; }
.rail-logo{ width:18px; height:18px; display:block; background:currentColor;
  -webkit-mask:var(--logo) center/contain no-repeat; mask:var(--logo) center/contain no-repeat; }
.rail-toggle{ display:none; }
.rail-backdrop{ display:none; }

@media (max-width:860px){
  .rail-toggle{ display:inline-grid; place-items:center; width:40px; height:40px; flex:none;
    margin-right:2px; border:0; background:transparent; color:var(--topbar-ink); cursor:pointer; border-radius:9px; }
  .rail-toggle:hover{ background:rgba(255,255,255,.12); }
  .rail-toggle svg{ width:22px; height:22px; }
  .rail{ position:fixed; top:calc(60px + env(safe-area-inset-top)); left:0; width:84%; max-width:300px;
    height:calc(100dvh - 60px - env(safe-area-inset-top));
    z-index:40; transform:translateX(-100%); transition:transform .22s ease;
    box-shadow:0 18px 40px rgba(0,0,0,.22); }
  body.rail-open .rail{ transform:translateX(0); }
  .rail-backdrop{ position:fixed; inset:calc(60px + env(safe-area-inset-top)) 0 0 0; background:rgba(0,0,0,.4); z-index:35; }
  body.rail-open .rail-backdrop{ display:block; }
  /* sol menü açıkken gövde kaydırmasını KİLİTLE → kaydırınca üst bar yerinden oynamaz / menünün üstüne inmez.
     (tool-shell zaten overflow:hidden; bu asıl launcher'ı etkiler.) rail kendi içinde scroll'lanır. */
  body.rail-open{ overflow:hidden; }
}

/* rail alt: menüyü düzenle */
.rail-foot{ margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.rail-edit{ display:flex; align-items:center; gap:11px; padding:8px 12px; border-radius:10px;
  color:var(--ink-soft); font-size:13.5px; font-weight:500; text-decoration:none; }
.rail-edit:hover{ background:var(--surface); color:var(--accent); text-decoration:none; }
.rail-edit.active{ background:var(--accent-tint); color:var(--accent); }

/* ---------- menü düzenleyici ---------- */
.menu-mode{ width:max-content; }
.mg-groups{ display:flex; flex-direction:column; gap:14px; margin:14px 0 16px; }
.mg-group{ border:1px solid var(--line); border-radius:13px; background:var(--surface); padding:12px; }
.mg-head{ display:flex; align-items:center; gap:8px; margin-bottom:9px; }
.mg-ghandle{ flex:none; cursor:grab; color:var(--ink-soft); display:grid; place-items:center; width:24px; height:24px; }
.mg-ghandle:active{ cursor:grabbing; }
.mg-ghandle svg{ width:18px; height:18px; }
.mg-group.g-dragging{ opacity:.55; box-shadow:0 8px 24px rgba(0,0,0,.14); }
.mg-gname{ flex:1; font-family:var(--font); font-size:14px; font-weight:600; color:var(--ink);
  background:var(--bg); border:1px solid var(--line); border-radius:9px; padding:8px 11px; }
.mg-gname:focus{ outline:none; border-color:var(--accent); }
.mg-del{ flex:none; width:32px; height:32px; border:0; border-radius:8px; background:var(--bg);
  color:var(--ink-soft); font-size:20px; line-height:1; cursor:pointer; }
.mg-del:hover{ color:#e5484d; background:#fdecec; }
.mg-list{ display:flex; flex-direction:column; gap:7px; min-height:44px; border-radius:10px;
  padding:4px; transition:background .12s, box-shadow .12s; }
.mg-list.over{ background:var(--accent-tint); box-shadow:inset 0 0 0 1.5px var(--accent); }
.mg-list:empty::after{ content:'Araçları buraya sürükle'; display:block; text-align:center;
  color:var(--ink-soft); font-size:12.5px; padding:11px 0; }
.mg-chip{ display:flex; align-items:center; gap:10px; padding:9px 11px; border-radius:10px;
  background:var(--bg); border:1px solid var(--line); cursor:grab; user-select:none; }
.mg-chip:active{ cursor:grabbing; }
.mg-chip.dragging{ opacity:.5; }
.mg-grip{ flex:none; color:var(--ink-soft); display:grid; place-items:center; }
.mg-grip svg{ width:18px; height:18px; }
.mg-ico{ flex:none; width:28px; height:28px; border-radius:8px; display:grid; place-items:center;
  background:var(--surface); color:var(--accent); }
.mg-ico svg{ width:17px; height:17px; }
.mg-name{ font-size:14px; font-weight:600; color:var(--ink); }
.menu-mode .seg-btn[aria-pressed="true"]{ background:var(--bg); color:var(--accent); font-weight:600; box-shadow:0 1px 3px rgba(0,0,0,.1); }

/* Ayarlar sayfası — kartlar */
.settings-list{ display:flex; flex-direction:column; gap:12px; margin-top:4px; }
.set-card{ display:flex; align-items:center; gap:14px; padding:15px 18px; border:1px solid var(--line);
  border-radius:14px; background:var(--bg); text-decoration:none; color:inherit; }
.set-link{ transition:border-color .12s, background .12s; }
.set-link:hover{ border-color:var(--accent); background:var(--accent-tint); }
.set-ico{ flex:none; width:42px; height:42px; border-radius:11px; display:grid; place-items:center; background:var(--surface); color:var(--accent); }
.set-ico svg{ width:22px; height:22px; }
.set-body{ flex:1; min-width:0; }
.set-title{ font-size:15px; font-weight:600; color:var(--ink); }
.set-desc{ font-size:13px; color:var(--ink-soft); margin-top:2px; }
.set-arrow{ flex:none; color:var(--ink-soft); display:grid; place-items:center; }
.set-arrow svg{ width:20px; height:20px; }
.set-card .seg{ flex:none; }
/* Ayarlar sekmeleri: iç zemin kartlarını düzleştir, bölümleri çizgiyle ayır (yalnız .st-pane içi) */
.st-pane .settings-list{ gap:0; }
.st-pane .set-card{ border:0; border-radius:0; background:none; padding:18px 2px; }
.st-pane .settings-list .set-card + .set-card{ border-top:1px solid var(--line); }
.st-pane .panel{ border:0; border-radius:0; background:none; box-shadow:none; padding:2px; margin:0; }
.st-pane .panel + .panel{ border-top:1px solid var(--line); margin-top:24px; padding-top:24px; }
@media (max-width:560px){
  .set-card{ flex-wrap:wrap; }
  .set-card .seg{ width:100%; margin-top:4px; }
  .set-card .seg-btn{ flex:1; justify-content:center; }
}

/* düzenlenebilir çip (süper admin · Varsayılan): sıra + başlık/açıklama tek satırda */
.mg-chip-ed{ align-items:center; cursor:default; }
.mg-chip-ed .mg-grip{ cursor:grab; }
.mg-fields{ flex:1; min-width:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.5fr); gap:8px; }
/* mobil: grip+ikon üst satırda kalsın, başlık/açıklama alanları TAM genişlik alta insin (dar kalmasın) */
@media (max-width:560px){
  .mg-chip-ed{ flex-wrap:wrap; row-gap:8px; }
  .mg-chip-ed .mg-ico{ order:0; }
  .mg-fields{ grid-template-columns:1fr; flex-basis:100%; }
}
.mg-fields input{ font-family:var(--font); font-size:16px; color:var(--ink); background:var(--surface);
  border:1.5px solid var(--line); border-radius:9px; padding:7px 10px; outline:none; transition:border-color .15s, box-shadow .15s; }
.mg-fields input:focus{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-tint); background:var(--bg); }
.mg-title{ font-weight:600; }

/* araç kabuklarında rail: yan sütun + iframe kalanı doldurur */
body.tool-shell .shell{ flex:1; min-height:0; }
/* masaüstü: rail sabit yan sütun, iframe kalanı doldurur */
@media (min-width:861px){
  body.tool-shell .shell{ align-items:stretch; }
  body.tool-shell .rail{ position:static; top:auto; height:auto; align-self:stretch; }
  body.tool-shell .tool-frame{ flex:1 1 auto; width:auto; height:auto; min-width:0; }
}
/* mobil: rail ☰ ile açılan çekmece; iframe tam genişlik (rail yer kaplamaz) */
@media (max-width:860px){
  body.tool-shell .shell{ display:block; position:relative; }
  /* iframe shell'i doldurur (absolute inset:0). body 100vh → tam ekran → alt bant yok.
     position:fixed DENEME: iframe replaced-element olduğundan top+bottom ile esnemez, 150px'e çöker (tüm sayfa siyah olur). */
  body.tool-shell .tool-frame{ position:absolute; inset:0; width:100%; height:100%; flex:none; }
  .ekip-loader{ inset:calc(60px + env(safe-area-inset-top)) 0 0 0; }   /* mobilde rail yok → soldaki 250px boşluğu kaldır */
}

/* rail: araca özel bölüm öğeleri (ör. /guide) */
.rail-sec .rail-dot{ width:30px; height:30px; flex:none; display:grid; place-items:center; }
.rail-sec .rail-dot::before{ content:''; width:6px; height:6px; border-radius:50%; background:var(--ink-soft); transition:.12s; }
.rail-sec.active .rail-dot::before{ background:var(--accent); width:7px; height:7px; }

/* ---- rail: filtre kutusu ---- */
.rail-search{ position:relative; margin:2px 6px 12px; }
.rail-search>svg{ position:absolute; left:11px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--ink-soft); pointer-events:none; }
.rail-search input{ width:100%; box-sizing:border-box; font-family:var(--font); font-size:13.5px; color:var(--ink);
  background:var(--surface); border:1px solid transparent; border-radius:10px; padding:9px 11px 9px 34px; }
.rail-search input::placeholder{ color:var(--ink-soft); }
.rail-search input:focus{ outline:none; background:var(--bg); border-color:var(--accent); }

/* ---- rail: akordiyon (Ekip Kılavuzu) ---- */
.rail-accrow{ display:flex; align-items:center; gap:2px; }
.rail-acclink{ flex:1; min-width:0; }
.rail-caret{ flex:none; width:30px; height:34px; border:0; background:transparent; color:var(--ink-soft);
  border-radius:8px; cursor:pointer; display:grid; place-items:center; }
.rail-caret:hover{ background:var(--surface); color:var(--accent); }
.rail-caret svg{ width:16px; height:16px; transition:transform .18s; }
.rail-caret[aria-expanded="true"] svg{ transform:rotate(180deg); }
.rail-sub{ margin:2px 0 4px 15px; padding-left:11px; border-left:1px solid var(--line);
  display:flex; flex-direction:column; gap:1px; }
.rail-subitem{ display:flex; align-items:center; gap:9px; padding:7px 10px; border-radius:9px;
  color:var(--ink-soft); font-size:13px; font-weight:500; text-decoration:none; }
.rail-subitem:hover{ background:var(--surface); color:var(--accent); text-decoration:none; }
.rail-subico{ flex:none; width:22px; height:22px; display:grid; place-items:center; color:var(--ink-soft); }
.rail-subitem:hover .rail-subico{ color:var(--accent); }
.rail-subico svg{ width:16px; height:16px; }

/* ---- rail: iç düzen (menü üstte, kullanıcı kartı altta) ---- */
.rail-inner{ display:flex; flex-direction:column; min-height:100%; box-sizing:border-box; padding:14px 12px max(12px, env(safe-area-inset-bottom)); }
.rail-scroll{ flex:0 1 auto; }
.rail-user{ margin-top:auto; padding-top:12px; border-top:1px solid var(--line); position:relative; }
.rail-user-btn{ width:100%; display:flex; align-items:center; gap:10px; padding:7px 8px; border:0;
  border-radius:11px; background:transparent; cursor:pointer; font-family:var(--font); text-align:left; }
.rail-user-btn:hover{ background:var(--surface); }
.rail-user-name{ flex:1; min-width:0; font-size:14px; font-weight:600; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rail-user-caret{ flex:none; width:16px; height:16px; color:var(--ink-soft); transition:transform .18s; }
.rail-user-btn[aria-expanded="true"] .rail-user-caret{ transform:rotate(180deg); }
.rail-user-menu{ position:absolute; left:0; right:0; bottom:calc(100% + 6px); z-index:30;
  background:var(--bg); border:1px solid var(--line); border-radius:14px; padding:10px;
  box-shadow:0 16px 44px rgba(0,0,0,.18); }
.ru-head{ display:flex; align-items:center; gap:10px; padding:4px 6px 10px; }
.ru-id{ min-width:0; }
.ru-name{ display:flex; align-items:center; gap:7px; font-size:14px; font-weight:600; color:var(--ink); }
.ru-name{ flex-wrap:wrap; }
.ru-name-t{ white-space:normal; overflow:visible; word-break:break-word; }
.ru-mail{ font-size:12px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ru-theme{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 6px; font-size:13px; color:var(--ink-soft); border-top:1px solid var(--line); }
.ru-menu{ display:flex; flex-direction:column; gap:1px; padding-top:6px; margin-top:2px; border-top:1px solid var(--line); }
.ru-menu a{ display:flex; align-items:center; gap:10px; padding:9px 8px; border-radius:9px;
  color:var(--ink); font-size:13.5px; font-weight:500; text-decoration:none; }
.ru-menu a:hover{ background:var(--surface); text-decoration:none; }
.ru-menu a svg{ width:18px; height:18px; color:var(--ink-soft); }
.ru-menu a:hover svg{ color:var(--accent); }
.ru-menu .acct-logout, .ru-menu .acct-logout svg{ color:#e5484d; }
.rail-sub[hidden]{ display:none; }
.rail-subitem.active{ color:var(--accent); font-weight:700; background:none; }
.rail-subitem.active .rail-subico{ color:var(--accent); }

/* ---- mobil: filtre kartların üstünde, rail filtresi gizli ---- */
.grid-filter{ display:none; }
@media (max-width:860px){
  .grid-filter{ display:flex; align-items:center; gap:10px; margin:0 0 16px;
    background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:11px 14px;
    scroll-margin-top:calc(74px + env(safe-area-inset-top)); }
  .grid-filter svg{ width:18px; height:18px; color:var(--ink-soft); flex:none; }
  .grid-filter input{ flex:1; min-width:0; border:0; background:transparent; font-family:var(--font);
    font-size:16px; color:var(--ink); }/* 16px = iOS odakta zoom/kayma engeli */
  .grid-filter input:focus{ outline:none; }
  .grid-filter input::placeholder{ color:var(--ink-soft); }
  .rail-search{ display:none; }
}
