/* =============================================
   EMLAK CRM — Tasarim Sistemi (Faz 1)
   - Tek tip type scale, sayisal spacing, layered shadow
   - Sahibinden'in bilgi-yoğunluk dilini takip eder
   ============================================= */

:root {
  /* === Brand renkleri (tek mavi sistem) === */
  --blue-50:  #EFF4FB;
  --blue-100: #DCE7F5;
  --blue-200: #B8CFEC;
  --blue-300: #7FA8D9;
  --blue-500: #0A4DC6;   /* Marka */
  --blue-600: #0840A8;
  --blue-700: #003079;
  --blue-900: #001F4D;

  --primary:       var(--blue-500);
  --primary-dark:  var(--blue-700);
  --primary-light: var(--blue-50);

  /* === Vurgu (sarı — sahibinden tarzı, paraya yakın) === */
  --yellow-50:  #FFFAE6;
  --yellow-100: #FFF1B8;
  --yellow-500: #FFB400;
  --yellow-700: #B37C00;
  --accent:       var(--yellow-500);
  --accent-light: var(--yellow-50);

  /* === Semantik === */
  --success:       #0E9F6E;
  --success-light: #DEF7EC;
  --warning:       #F59E0B;
  --warning-light: #FEF3C7;
  --danger:        #DC2626;
  --danger-light:  #FEE2E2;
  --info:          #2563EB;
  --info-light:    #DBEAFE;

  /* === Gri sistemi (sahibinden-yakın tonlar) === */
  --gray-50:  #FAFBFC;
  --gray-100: #F1F3F5;
  --gray-200: #E5E8EB;
  --gray-300: #CBD0D5;
  --gray-400: #9AA0A6;
  --gray-500: #6B7177;
  --gray-600: #4D5258;
  --gray-700: #2E3338;
  --gray-800: #1A1D21;
  --gray-900: #0E1014;

  /* === Boşluk skalası (4'er artar) === */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* === Border radius === */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;
  --radius: var(--r-md);  /* legacy alias */

  /* === Shadow (katmanlı derinlik) === */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 8px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 25px 50px rgba(15, 23, 42, 0.15);
  --shadow: var(--shadow-sm);  /* legacy alias */

  /* === Type scale === */
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   16px;
  --fs-xl:   18px;
  --fs-2xl:  22px;
  --fs-3xl:  28px;
  --fs-4xl:  36px;
  --lh-tight: 1.25;
  --lh-base:  1.5;

  /* === Layout === */
  --sidebar-w: 244px;
  --header-h: 60px;
  --transition: all 0.18s ease;

  /* === Tema tokenlari (dark/ocean override eder) === */
  --bg: #F6F8FB;
  --surface: #ffffff;
  --surface-2: var(--gray-50);   /* hafif kontrast üzeyler */
  --text: var(--gray-800);
  --text-muted: var(--gray-500);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);

  /* Focus ring (erişilebilirlik) */
  --ring: 0 0 0 3px rgba(10, 77, 198, 0.18);
}

/* ===== DARK TEMA ===== */
[data-theme="dark"] {
  --primary: #60A5FA;
  --primary-dark: #3B82F6;
  --primary-light: #1E3A8A;
  --accent: #FBBF24;
  --accent-light: #422006;
  --success: #34D399;
  --success-light: #064E3B;
  --warning: #FBBF24;
  --warning-light: #422006;
  --danger: #F87171;
  --danger-light: #450a0a;
  --info: #60A5FA;
  --info-light: #1E3A8A;
  --gray-50: #1F2937;
  --gray-100: #374151;
  --gray-200: #4B5563;
  --gray-300: #6B7280;
  --gray-400: #9CA3AF;
  --gray-500: #D1D5DB;
  --gray-600: #E5E7EB;
  --gray-700: #F3F4F6;
  --gray-800: #F9FAFB;
  --gray-900: #FFFFFF;
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #e5e7eb;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.45);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .sidebar,
[data-theme="dark"] .main-header,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .modal,
[data-theme="dark"] .bottom-nav,
[data-theme="dark"] .ai-sidebar,
[data-theme="dark"] .ai-main,
[data-theme="dark"] .rag-panel,
[data-theme="dark"] .dok-dropzone,
[data-theme="dark"] .dok-breadcrumb,
[data-theme="dark"] .toast-container .toast { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] table th { background: #0f172a; color: #d1d5db; }
[data-theme="dark"] table td { color: var(--text); border-color: var(--border); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #0f172a; color: var(--text); border-color: var(--border);
}
[data-theme="dark"] .btn-outline { background: transparent; color: var(--gray-600); border-color: var(--border); }
[data-theme="dark"] .btn-outline:hover { background: var(--gray-50); }
[data-theme="dark"] .ai-msg-bot .ai-msg-body,
[data-theme="dark"] .rag-msg-bot .rag-msg-body { background: #0f172a; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .dok-card { background: #0f172a; border-color: var(--border); }
[data-theme="dark"] .badge-success { background: rgba(52,211,153,0.15); color: #34D399; }
[data-theme="dark"] .badge-gray { background: rgba(156,163,175,0.15); color: #9CA3AF; }
[data-theme="dark"] .swal2-popup { background: var(--surface) !important; color: var(--text) !important; }
[data-theme="dark"] .swal2-title, [data-theme="dark"] .swal2-html-container { color: var(--text) !important; }

/* ===== OCEAN TEMA ===== */
[data-theme="ocean"] {
  --primary: #13C9CB;
  --primary-dark: #0E9B9D;
  --primary-light: #134E4F;
  --accent: #FFB400;
  --accent-light: #422006;
  --success: #5EEAD4;
  --success-light: #042F2E;
  --warning: #FFB400;
  --warning-light: #422006;
  --danger: #FB7185;
  --danger-light: #450A0A;
  --info: #38BDF8;
  --info-light: #0C4A6E;
  --gray-50: #0F2D52;
  --gray-100: #143461;
  --gray-200: #1E4480;
  --gray-300: #3D6BAA;
  --gray-400: #7AA7D9;
  --gray-500: #B0CEEC;
  --gray-600: #D4E5F5;
  --gray-700: #E8F1FA;
  --gray-800: #F0F7FD;
  --gray-900: #FFFFFF;
  --bg: #0B2545;
  --surface: #133259;
  --text: #E0F2FE;
  --border: #1E4480;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.55);
}
[data-theme="ocean"] body { background: var(--bg); color: var(--text); }
[data-theme="ocean"] .sidebar,
[data-theme="ocean"] .main-header,
[data-theme="ocean"] .card,
[data-theme="ocean"] .stat-card,
[data-theme="ocean"] .modal,
[data-theme="ocean"] .bottom-nav,
[data-theme="ocean"] .ai-sidebar,
[data-theme="ocean"] .ai-main,
[data-theme="ocean"] .rag-panel,
[data-theme="ocean"] .dok-dropzone,
[data-theme="ocean"] .dok-breadcrumb,
[data-theme="ocean"] .toast-container .toast { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="ocean"] table th { background: #0B2545; color: var(--gray-500); }
[data-theme="ocean"] table td { color: var(--text); border-color: var(--border); }
[data-theme="ocean"] input, [data-theme="ocean"] select, [data-theme="ocean"] textarea {
  background: #0B2545; color: var(--text); border-color: var(--border);
}
[data-theme="ocean"] .dok-card { background: #0B2545; border-color: var(--border); }
[data-theme="ocean"] .swal2-popup { background: var(--surface) !important; color: var(--text) !important; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh-base);
  font-size: var(--fs-md);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* iOS'ta alt navbar'in kaydirirken "sayfa ortasina kacmasi" — iki bilinen neden:
   1) body'de overflow-x:hidden. html'de overflow gorunur kalinca body KENDI
      kaydirma kabi olur; iOS Safari bu durumda position:fixed cocuklari momentum
      kaydirmasi sirasinda yanlis konumlandirir. "clip" kaydirma kabi YARATMAZ,
      tasmayi yine keser -> sorun kokunden kalkar.
   2) 100vh, adres cubugu aciksa bile TAM ekrani sayar; cubuk kapanip acilirken
      duzen zipliyor. dvh gercek gorunur yuksekligi izler.
   NOT: Bu davranis yalnizca gercek iOS Safari'de olusur; Chrome headless ile
   yeniden uretilemedi. Asagidakiler bu iki nedenin STANDART cozumudur. */
@supports (overflow: clip) {
  body { overflow-x: clip; }
}
@supports (height: 100dvh) {
  .app-layout { min-height: 100dvh; }
}

/* ===== Tipografi temeli ===== */
h1, h2, h3, h4, h5, h6 {
  color: var(--gray-900);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); font-weight: 700; }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }

p { color: var(--text); }
small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace; font-feature-settings: 'tnum'; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

::selection { background: var(--blue-100); color: var(--blue-900); }

/* Custom scrollbar (sade, sahibinden vari) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--gray-400); background-clip: padding-box; border: 2px solid transparent; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px;
}

/* Oturum kontrolu surerken gosterilen tam ekran splash (login karti flash'ini onler) */
.auth-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.auth-loading .loading-spinner {
  width: 36px;
  height: 36px;
  border-width: 3px;
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
}

.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-card .logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-card .logo .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  margin-bottom: 14px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(10, 77, 198, 0.28);
}
.login-card .logo .brand-mark svg { display: block; }

.login-card .logo h1 {
  font-size: 34px;          /* giris ekraninda marka biraz daha buyuk dursun */
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.8px;
}
.login-card .logo .brand-sub { font-size: 13px; color: var(--gray-600); margin-top: 4px; }

.login-card .logo p {
  color: var(--gray-500);
  font-size: 13.5px;
  margin-top: 6px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group label {
  display: block;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--s-2);
}

.form-group input,
.form-group select,
.form-group textarea,
.input-control {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-md);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.input-control::placeholder { color: var(--gray-400); }

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: var(--border-strong); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.input-control:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.form-group textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.form-group select { cursor: pointer; }

/* ===== PASSWORD TOGGLE & REMEMBER ME ===== */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper input {
  width: 100%;
  padding-right: 44px;
}

.input-icon-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.input-icon-btn:hover {
  color: var(--gray-600);
}

.remember-me {
  margin-bottom: 20px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ===== BUTON SISTEMI ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(10, 77, 198, 0.25);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-accent {
  background: var(--accent);
  color: var(--gray-900);
  font-weight: 600;
}
.btn-accent:hover { background: #E6A300; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #0B8559; }

.btn-outline {
  background: var(--surface);
  color: var(--gray-700);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--border-strong); color: var(--gray-900); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; }

.btn-sm { height: 30px; padding: 0 12px; font-size: var(--fs-base); border-radius: var(--r-sm); }
.btn-lg { height: 44px; padding: 0 24px; font-size: var(--fs-lg); border-radius: var(--r-md); font-weight: 600; }
.btn-icon { height: 36px; width: 36px; padding: 0; }
.btn-sm.btn-icon { height: 30px; width: 30px; }
.btn i[data-lucide], .btn svg.lucide { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm i[data-lucide], .btn-sm svg.lucide { width: 14px; height: 14px; }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--gray-200);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-header .brand-row {
  display: flex; align-items: center; gap: 12px;
}
.sidebar-header .brand-icon {
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(10, 77, 198, 0.2);
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.sidebar-header p {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ===== MARKA: "Emlag" = EMLak + AGent =====
   Kelime iki renge bolunur (Eml | ag) ve hemen altindaki "Emlakk Agent"
   yazisinda AYNI iki renk ayni harflere uygulanir. Boylece kisaltmanin
   nereden geldigi soylenmeden gorunur olur.

   Renkler degisken uzerinden: tema degistiginde (dark/teal) marka da uyar.

   RENK SECIMI: once marka sarisi (--accent #FFB400) denendi, beyaz zeminde
   kontrast 1.9:1 cikti ve 11.5px alt satirda okunmuyordu; koyu amber (#B37C00)
   ise 3.6:1 ile sinirda kalip sonuk/hardal duruyordu. Klasik bordo 10.8:1
   veriyor — hem okunakli hem lacivert-bordo esleşmesi kurumsal duruyor.

   KOYU TEMA: bordo tanimi geregi KOYU bir renktir, koyu zeminde kaybolur.
   Orada ayni sarap ailesinin acik tonu kullanilir (rose-400, 6.1:1). */
:root {
  --wm-1: var(--primary);   /* Eml — marka mavisi */
  --wm-2: #800020;          /* ag  — klasik bordo (Bordeaux) */
}
[data-theme="dark"] {
  --wm-2: #FB7185;          /* koyu zeminde bordo acilir (sarap tonu) */
}

.wordmark { display: block; letter-spacing: -0.4px; }
.wordmark .wm-a { color: var(--wm-1); }
.wordmark .wm-b { color: var(--wm-2); }

/* Alt satir: "Emlak Agent" — kaynak harfler renkli, gerisi soluk */
.brand-sub {
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.brand-sub .wm-a { color: var(--wm-1); }
.brand-sub .wm-b { color: var(--wm-2); }

/* Kenar cubugu olculeri */
.sidebar-header .brand-sub { font-size: 11.5px; color: var(--gray-500); margin-top: 3px; }

.sidebar-nav {
  flex: 1;
  padding: var(--s-3) var(--s-2);
  overflow-y: auto;
}

.nav-section { margin-bottom: var(--s-5); }
.nav-section:last-child { margin-bottom: var(--s-3); }

.nav-section-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  padding: 0 var(--s-3);
  margin-bottom: var(--s-2);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px var(--s-3);
  border-radius: var(--r-md);
  color: var(--gray-600);
  text-decoration: none;
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
  text-decoration: none;
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
}
.nav-item .icon svg { width: 18px; height: 18px; stroke-width: 1.75; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-100);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-details .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details .role {
  font-size: 11px;
  color: var(--gray-400);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  min-width: 0;   /* flex cocugu icerige gore buyuyup sayfayi saga tasimasin (kanban vb. kendi icinde scroll etsin) */
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* ===== Sidebar collapse — ikon-only rail (masaüstü) ===== */
.app-layout.sidebar-collapsed .sidebar { width: 72px; }
.app-layout.sidebar-collapsed .main-content { margin-left: 72px; }
.sidebar { transition: width 0.25s ease, transform 0.3s ease; }

/* Sidebar header: logo (sol) + collapse butonu (sağ) */
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sidebar-collapse-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border: none; background: none; border-radius: 8px;
  color: var(--gray-500); cursor: pointer; transition: background 0.12s, color 0.12s;
}
.sidebar-collapse-btn:hover { background: var(--gray-100); color: var(--gray-800); }
.sidebar-collapse-btn svg { width: 20px; height: 20px; }
@media (max-width: 1024px) { .sidebar-collapse-btn { display: none; } }  /* mobilde hamburger kullan */

/* Rail: yazılar/başlıklar gizli, ikonlar ortalı */
.sidebar-collapsed .nav-section-title { display: none; }
.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  font-size: 0;                     /* metin düğümünü gizle (ikon svg sabit) */
  padding-left: 0; padding-right: 0;
}
.sidebar-collapsed .nav-item.active::before { left: 0; }

/* Rail footer: sadece avatar */
.sidebar-collapsed .sidebar-footer { padding: 12px 0; }
.sidebar-collapsed .user-info { justify-content: center; }
.sidebar-collapsed .user-details,
.sidebar-collapsed .sidebar-footer #logout-btn { display: none; }

/* Rail header: app ikonu ortalı; ÜZERİNE GELİNCE expand (panel-left-open) ikonuna döner */
.sidebar-collapsed .sidebar-header { justify-content: center; padding: 16px 0; position: relative; }
.sidebar-collapsed .brand-text { display: none; }
.sidebar-collapsed .sidebar-header .brand-row { transition: opacity 0.15s; }
.sidebar-collapsed .sidebar-collapse-btn {
  display: none;
  position: absolute; inset: 0; margin: auto;
  width: 42px; height: 42px;
}
.sidebar-collapsed .sidebar-header:hover .brand-row { opacity: 0; pointer-events: none; }
.sidebar-collapsed .sidebar-header:hover .sidebar-collapse-btn { display: inline-flex; }

.main-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s-6);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}

.main-header .page-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.main-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-content {
  padding: 32px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-icon i { width: 22px; height: 22px; }

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.05;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 3px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.red { background: var(--accent-light); color: var(--accent); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.gray { background: var(--gray-100); color: var(--gray-500); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.purple { background: #EDE9FE; color: #7C3AED; }

/* --- Dashboard: bölüm başlığı + "Bugün Yapılacaklar" kokpit kartları --- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 12px; }
.section-head h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.section-head .muted { font-size: 13px; color: var(--gray-500); }

.today-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1000px) { .today-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .today-grid { grid-template-columns: 1fr; } }

.today-card {
  background: var(--surface); border: 1px solid var(--gray-100); border-radius: 12px;
  padding: 16px; display: flex; align-items: center; gap: 13px; cursor: pointer;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.today-card:hover { transform: translateY(-2px); border-color: var(--gray-200); }
.today-card.has { border-left: 3px solid var(--primary); }
.today-card.ok { opacity: .82; }
.today-ico { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.today-ico i { width: 20px; height: 20px; }
.today-ico.red { background: var(--accent-light); color: var(--accent); }
.today-ico.amber { background: var(--warning-light); color: var(--warning); }
.today-ico.blue { background: var(--primary-light); color: var(--primary); }
.today-ico.gray { background: var(--gray-100); color: var(--gray-500); }
.today-main { flex: 1; min-width: 0; }
.today-num { font-size: 24px; font-weight: 800; line-height: 1; color: var(--gray-900); }
.today-lbl { font-size: 13px; color: var(--gray-500); margin-top: 3px; }
.today-go { width: 18px; height: 18px; color: var(--gray-400); flex: 0 0 auto; }
.today-ok { font-size: 12px; color: var(--success); font-weight: 600; flex: 0 0 auto; }

.stat-card-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
.stat-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-light);
}
.stat-card-clickable:active {
  transform: translateY(0);
}

/* ===== AI ASISTAN ===== */
.ai-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 140px);
}
.ai-sidebar {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ai-sidebar-head { padding: 12px; border-bottom: 1px solid var(--gray-100); }
.ai-search { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 13px; }
.ai-conv-list { flex: 1; overflow-y: auto; }
.ai-conv-item {
  position: relative;
  padding: 12px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.1s;
}
.ai-conv-item:hover { background: var(--gray-50); }
.ai-conv-item.active { background: var(--primary-light); }
.ai-conv-title { font-weight: 600; font-size: 13px; color: var(--gray-900); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 22px; }
.ai-conv-meta { font-size: 11px; color: var(--gray-500); }
.ai-conv-del {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--gray-400); padding: 4px;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0;
}
.ai-conv-del i, .ai-conv-del svg { width: 16px; height: 16px; }
.ai-conv-del:hover { background: var(--gray-100); color: var(--danger, #dc2626); }
.ai-empty { padding: 30px 12px; text-align: center; color: var(--gray-400); font-size: 13px; }

.ai-main {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; }
.ai-welcome { padding: 32px; text-align: center; color: var(--gray-500); }
.ai-welcome h2 { color: var(--gray-900); margin-bottom: 8px; }
.ai-examples { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; max-width: 520px; margin-left:auto; margin-right:auto; }
.ai-examples button {
  text-align: left; padding: 10px 14px;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 8px; cursor: pointer; color: var(--gray-700); font-size: 13px;
}
.ai-examples button:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.ai-msg {
  display: flex; flex-direction: column;
  margin-bottom: 18px; max-width: 88%;
  animation: aiMsgIn 0.18s ease-out;
}
@keyframes aiMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-msg-user { margin-left: auto; align-items: flex-end; }
.ai-msg-bot { margin-right: auto; align-items: flex-start; }
.ai-msg-role {
  font-size: 11px; color: var(--gray-400);
  margin-bottom: 6px; font-weight: 600;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.ai-msg-body {
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  width: 100%;
  line-height: 1.55;
}
.ai-msg-user .ai-msg-body {
  background: linear-gradient(135deg, var(--primary), #003079);
  border-color: transparent;
  color: white;
}
.ai-msg-user .ai-msg-text { color: white; }
.ai-msg-text { font-size: 14.5px; color: var(--gray-900); white-space: pre-wrap; word-break: break-word; }
.ai-err .ai-msg-body { background: var(--accent-light); border-color: var(--accent); }

/* ===== Typing indicator (3 zıplayan nokta) ===== */
.ai-typing { display: inline-flex; gap: 6px; padding: 4px 0; }
.ai-typing-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
  animation: aiBlink 1.2s infinite ease-in-out;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes aiBlink {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== Send butonu (ChatGPT benzeri yuvarlak) + spinner ===== */
.ai-send-btn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  align-self: flex-end;
}
.ai-send-btn:hover:not(:disabled) { background: #002f7a; }
.ai-send-btn:active:not(:disabled) { transform: scale(0.94); }
.ai-send-btn:disabled { background: var(--gray-300); cursor: not-allowed; }

.ai-spin {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: aiSpin 0.7s linear infinite;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }

/* ===== SweetAlert2 ortak tema (uygulamanın paletine uyum) ===== */
.swal2-popup { font-family: inherit !important; border-radius: 14px !important; }
.swal2-title { font-size: 18px !important; color: var(--gray-900) !important; }
.swal2-html-container { font-size: 14px !important; color: var(--gray-600) !important; line-height: 1.5 !important; }
.swal2-styled.swal2-confirm,
.swal2-styled.swal2-cancel {
  border-radius: 8px !important;
  padding: 8px 18px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  border: none !important;
}
.swal2-styled.swal2-cancel {
  background: var(--gray-100) !important;
  color: var(--gray-700) !important;
}
.swal2-styled.swal2-cancel:hover { background: var(--gray-200) !important; }
.swal2-actions { gap: 8px !important; }

/* Toast (sağ üst köşe) */
.swal-toast-popup {
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  font-size: 13.5px !important;
}
.swal-toast-popup .swal2-title { font-size: 14px !important; font-weight: 500 !important; }

/* ===== DOKUMANLAR MODULU ===== */
.dok-layout { display: flex; flex-direction: column; gap: 12px; }
.dok-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--gray-100);
  font-size: 14px;
}
.dok-breadcrumb a { color: var(--primary); cursor: pointer; text-decoration: none; padding: 2px 6px; border-radius: 4px; }
.dok-breadcrumb a:hover { background: var(--primary-light); }
.dok-breadcrumb .sep { color: var(--gray-300); }

/* --- Windows Explorer tarzi navigasyon cubugu --- */
.dok-navbar { display: flex; align-items: center; gap: 10px; }
.dok-navbar .dok-breadcrumb { flex: 1; min-width: 0; margin: 0; }
.dok-navbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dok-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px;
  background: var(--surface); color: var(--gray-700);
  border: 1px solid var(--gray-200); border-radius: 9px;
  cursor: pointer; font-size: 13px; font-weight: 500;
}
.dok-nav-btn:hover:not(:disabled) { background: var(--gray-50); border-color: var(--primary); color: var(--primary); }
.dok-nav-btn:disabled { opacity: 0.4; cursor: default; }
.dok-paste-btn { color: var(--primary); border-color: var(--primary); }
.dok-paste-btn.hidden { display: none; }
.dok-search {
  display: flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--gray-200); border-radius: 9px;
  color: var(--gray-400);
}
.dok-search:focus-within { border-color: var(--primary); color: var(--primary); }
.dok-search input {
  border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--gray-900); width: 180px; max-width: 40vw;
}

/* --- Secim bilgi cubugu --- */
.dok-selbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--primary-light); border: 1px solid var(--primary); border-radius: 10px;
}
.dok-selbar.hidden { display: none; }
.dok-sel-count { font-size: 14px; font-weight: 600; color: var(--primary); }
.dok-sel-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--gray-500); }
.btn.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

/* --- Durum cubugu --- */
.dok-statusbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px; font-size: 12.5px; color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
}
.dok-status-sel { color: var(--primary); font-weight: 600; }

/* --- Liste (Ayrintilar) gorunumu basliklari --- */
.dok-list-head {
  display: grid; grid-template-columns: 46px 1fr 110px 190px 32px;
  align-items: center; gap: 12px;
  padding: 6px 12px; margin-bottom: 2px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 12.5px; font-weight: 600; color: var(--gray-500);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.dok-list-head > div { cursor: pointer; user-select: none; }
.dok-list-head > div:hover { color: var(--primary); }
.dok-lh-icon, .dok-lh-more { cursor: default !important; }

.dok-dropzone {
  position: relative;
  min-height: 60vh;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  padding: 18px;
}
.dok-dropzone-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 61, 165, 0.06);
  border: 2px dashed var(--primary);
  border-radius: 12px;
  display: none;
  align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 10;
}
.dok-dropzone-overlay.active { display: flex; }
.dok-overlay-inner { text-align: center; color: var(--primary); }
.dok-overlay-inner div { margin-top: 12px; font-size: 18px; font-weight: 600; }

.dok-content { min-height: 200px; }
.dok-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--gray-400); text-align: center;
}
.dok-empty h3 { margin: 16px 0 4px; color: var(--gray-700); font-size: 16px; }
.dok-empty p { font-size: 13px; }

.dok-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.dok-card {
  position: relative;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  padding: 16px 12px 12px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.dok-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.07); border-color: var(--primary); }
.dok-card-icon { display: flex; justify-content: center; margin-bottom: 12px; }
.dok-card-title {
  font-size: 15px; font-weight: 600; color: var(--gray-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 5px;
}
.dok-sub { font-size: 13px; color: var(--gray-400); }
.dok-more {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px;
  background: transparent; border: none; border-radius: 4px;
  color: var(--gray-400); font-size: 16px; cursor: pointer;
  display: none;
}
.dok-card:hover .dok-more, .dok-row:hover .dok-more { display: block; }
.dok-more:hover { background: var(--gray-100); color: var(--gray-700); }

.dok-list { display: flex; flex-direction: column; }
.dok-row {
  display: grid;
  grid-template-columns: 46px 1fr 110px 190px 32px;
  align-items: center; gap: 12px;
  padding: 13px 12px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  position: relative;
}
.dok-row:hover { background: var(--gray-50); }
.dok-row-icon { display: flex; align-items: center; }
.dok-row-name { font-size: 15px; font-weight: 500; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dok-row-meta { font-size: 14px; color: var(--gray-500); }

/* --- Secim + surukleme gorsel durumlari --- */
.dok-card.selected, .dok-row.selected { background: var(--primary-light); border-color: var(--primary); }
.dok-card.selected { box-shadow: 0 0 0 2px var(--primary) inset; }
.dok-row.selected { box-shadow: inset 2px 0 0 var(--primary); }
.dok-card.dragging, .dok-row.dragging { opacity: 0.45; }
.dok-card.drag-over, .dok-row.drag-over {
  background: var(--primary-light);
  outline: 2px dashed var(--primary); outline-offset: -2px;
}
.dok-card.is-folder.drag-over { transform: scale(1.03); }

.dok-progress {
  margin-top: 16px;
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px solid var(--gray-100);
  padding: 12px;
  max-height: 260px; overflow-y: auto;
}
.dok-progress.hidden { display: none; }
.dok-prog-head { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.dok-prog-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; font-size: 12px; border-radius: 6px; gap: 12px;
}
.dok-prog-row.ok { background: var(--success-light); color: var(--success); }
.dok-prog-row.err { background: var(--accent-light); color: var(--accent); }
.dok-prog-status { font-weight: 500; }

.dok-menu {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  min-width: 180px;
  z-index: 9999;
  animation: dokMenuIn 0.12s ease-out;
}
@keyframes dokMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dok-menu button {
  display: block; width: 100%;
  padding: 8px 12px;
  background: transparent; border: none;
  text-align: left;
  font-size: 13px; color: var(--gray-700); cursor: pointer;
  border-radius: 6px;
}
.dok-menu button:hover { background: var(--gray-50); }
.dok-menu button.danger { color: var(--accent); }
.dok-menu button.danger:hover { background: var(--accent-light); }

/* ===== Split-view shell (yatay: ust=dosyalar, alt=chat) ===== */
.dok-shell {
  display: grid;
  grid-template-rows: 1fr 0;
  gap: 0;
  transition: grid-template-rows 0.2s ease;
  height: calc(100vh - 140px);
}
.dok-shell.chat-open {
  grid-template-rows: minmax(160px, 1fr) minmax(280px, 1fr);
  gap: 12px;
}
.dok-shell .dok-layout { overflow-y: auto; min-height: 0; }
.dok-shell .rag-panel { display: none; min-height: 0; }
.dok-shell.chat-open .rag-panel { display: flex; }

/* ===== Sync info + badge ===== */
.dok-sync-info {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--gray-500);
  padding: 6px 10px;
  background: var(--gray-50);
  border-radius: 6px;
  margin-right: 6px;
}
.dok-sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-300);
}
.dok-sync-dot.ok { background: var(--success); }
.dok-sync-dot.err { background: var(--accent); }
.dok-sync-dot.running { background: var(--warning); animation: aiBlink 1s infinite; }

.dok-sync-badge {
  position: absolute; top: 6px; left: 6px;
  font-size: 10px; padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1;
}
.dok-sync-badge.synced { background: var(--success-light); color: var(--success); }
.dok-sync-badge.pending { background: var(--warning-light); color: var(--warning); }
.dok-sync-badge.failed { background: var(--accent-light); color: var(--accent); }
.dok-sync-badge.skipped { background: var(--gray-100); color: var(--gray-500); }

/* ===== RAG Asistan panel ===== */
.rag-panel {
  background: var(--surface);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.rag-panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.rag-title { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.rag-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.rag-head-actions { display: flex; gap: 4px; }

.rag-messages { flex: 1; overflow-y: auto; padding: 14px; }
.rag-welcome { text-align: center; color: var(--gray-500); padding: 30px 14px; }
.rag-welcome h3 { margin: 12px 0 4px; font-size: 15px; color: var(--gray-700); }
.rag-welcome p { font-size: 12px; margin-bottom: 16px; }
.rag-examples { display: flex; flex-direction: column; gap: 6px; }
.rag-examples button {
  text-align: left; padding: 8px 12px;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 8px; cursor: pointer; color: var(--gray-700); font-size: 12px;
}
.rag-examples button:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.rag-msg { margin-bottom: 12px; max-width: 92%; animation: aiMsgIn 0.18s ease-out; }
.rag-msg-user { margin-left: auto; }
.rag-msg-bot { margin-right: auto; }
.rag-msg-body {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  line-height: 1.5;
}
.rag-msg-user .rag-msg-body {
  background: linear-gradient(135deg, var(--primary), #003079);
  border-color: transparent;
}
.rag-msg-user .rag-msg-text { color: white; }
.rag-msg-text { font-size: 13.5px; color: var(--gray-900); white-space: pre-wrap; word-break: break-word; }
.rag-err .rag-msg-body { background: var(--accent-light); border-color: var(--accent); }

.rag-cites {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-500);
}
.rag-cites-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-500);
  margin-right: 2px;
}
/* Tiklanabilir kaynak rozeti (PDF popup acar) */
.rag-cite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 3px;
  background: var(--info-light);
  color: var(--info);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.rag-cite:hover { border-color: var(--info); background: var(--surface); }
.rag-cite:active { transform: translateY(1px); }
.rag-cite-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--info);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex: 0 0 auto;
}
/* Cevap metni icindeki numarali atif ust-simgesi */
.rag-cite-ref {
  cursor: pointer;
  color: var(--info);
  font-weight: 700;
  font-size: 10px;
  padding: 0 2px;
  vertical-align: super;
  line-height: 0;
}
.rag-cite-ref:hover { text-decoration: underline; }
.rag-msg-user .rag-cite-ref { color: #fff; }

.rag-input {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--gray-100);
  background: var(--surface);
  align-items: flex-end;
}
.rag-input textarea {
  flex: 1; resize: none;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-family: inherit; font-size: 13.5px; line-height: 1.5;
  min-height: 40px; max-height: 140px;
  background: var(--gray-50);
}
.rag-input textarea:focus {
  outline: none; border-color: var(--primary);
  background: var(--surface);
}
.rag-input .ai-send-btn { width: 40px; height: 40px; }

.rag-hist-item {
  padding: 10px 12px;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.rag-hist-item:hover { background: var(--gray-50); }

@media (max-width: 700px) {
  .dok-shell.chat-open {
    grid-template-rows: 50% 50%;
  }
}

/* ============================================
   PWA + MOBIL UYUMLULUK GENISLETMELERI
   (telefondan uygulama gibi kullanim icin)
   ============================================ */

/* iOS safe-area (notch / home indicator) */
@supports (padding: env(safe-area-inset-top)) {
  .main-header { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
  .sidebar { padding-top: env(safe-area-inset-top); }

  /* Telefonda .modal-large / .modal-xl EKRANIN ALTINA sabitlenir (bottom sheet);
     footer butonlari iPhone'un home cubugunun ALTINDA kalip tiklanamiyordu.
     Body degil FOOTER ekrana degen ogedir — dolgu buraya gelmeli. */
  @media (max-width: 768px) {
    .modal.modal-large > .modal-footer,
    .modal.modal-xl > .modal-footer {
      padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
  }
}

/* Mobilde sidebar acikken arkayi karart */
@media (max-width: 1024px) {
  body.sidebar-open::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 49;
    animation: fadeIn 0.2s;
  }
  .sidebar { z-index: 50; }
  @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
}

/* Header actions: kucuk ekrana sigsin, kaydirilabilir olsun */
@media (max-width: 768px) {
  .header-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: calc(100vw - 90px);
  }
  .header-actions::-webkit-scrollbar { display: none; }
  .header-actions .btn { white-space: nowrap; flex-shrink: 0; }

  /* Modal mobil tam ekrana yakin */
  .modal {
    margin: 0;
    border-radius: 14px 14px 0 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 92vh;
    width: 100%;
  }

  /* AI Asistan — sol sohbet listesi gizlensin, sadece chat alani */
  .ai-layout { grid-template-columns: 1fr; height: calc(100vh - 130px); }
  .ai-sidebar { display: none; }

  /* Documents split-view */
  .dok-shell { height: calc(100vh - 130px); }

  /* RAG chat input: mobil daha kompakt */
  .rag-input textarea, .ai-input textarea {
    font-size: 16px;  /* iOS zoom önlemek için 16px+ */
    padding: 10px 14px;
    min-height: 44px;
  }

  /* Form input'lar - iOS zoom önle */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="tel"], input[type="number"],
  input[type="url"], textarea, select {
    font-size: 16px !important;
  }

  /* Buton min height (parmak dokunabilir) */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }

  /* Stat card icon kucult */
  .stats-grid { gap: 8px; }

  /* Toolbar - tek satir, kaydir */
  .toolbar { overflow-x: auto; }

  /* Talep / portfoy filter dropdowns */
  .filter-select { min-width: 130px; font-size: 13px; }

  /* Dokumanlar - mobil grid kucult */
  .dok-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .dok-card { padding: 12px 8px 8px; }
  .dok-card-title { font-size: 12px; }

  /* Dokumanlar - mobil navigasyon cubugu sarilsin */
  .dok-navbar { flex-wrap: wrap; }
  .dok-navbar .dok-breadcrumb { order: 2; flex-basis: 100%; }
  .dok-navbar-right { order: 1; flex: 1; }
  .dok-search { flex: 1; }
  .dok-search input { width: 100%; max-width: none; }
  /* Liste gorunumu: mobilde "Değiştirilme" (4. sutun) gizlenir */
  .dok-list-head { grid-template-columns: 40px 1fr 90px 32px; }
  .dok-list-head > div:nth-child(4) { display: none; }
  .dok-row { grid-template-columns: 40px 1fr 90px 32px; }
  .dok-row > .dok-row-meta:nth-child(4) { display: none; }

  /* AI mesaj */
  .ai-msg { max-width: 95%; }
  .ai-msg-text, .rag-msg-text { font-size: 13.5px; }

  /* Page title kisalt */
  .page-title { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ===== Modal genis varyantlari ===== */
.modal.modal-large { max-width: min(1400px, 96vw); width: 96vw; }
.modal.modal-xl    { max-width: 98vw; width: 98vw; max-height: 96vh; }
.modal.modal-large .modal-body,
.modal.modal-xl .modal-body { display: flex; flex-direction: column; padding: 0; }
.modal.modal-detail { max-width: min(960px, 96vw); width: 96vw; max-height: 92vh; }
.modal.modal-detail .modal-body { padding: var(--s-4) var(--s-5); }

/* ===== Doküman önizleme viewer ===== */
.dok-view-wrap {
  display: flex; flex-direction: column;
  height: min(75vh, 800px);
  background: var(--gray-50);
}
.dok-view-meta {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.dok-view-name {
  font-weight: 600; color: var(--gray-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.dok-view-size { color: var(--gray-500); flex-shrink: 0; }

.dok-view-body {
  flex: 1; overflow: auto;
  background: #2A2A2A;
  display: flex; flex-direction: column;
  min-height: 0;
}
.dok-view-body > .dok-view-image,
.dok-view-body > .dok-view-media,
.dok-view-body > .dok-view-audio,
.dok-view-body > .dok-view-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dok-view-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.dok-view-image img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.dok-view-frame {
  width: 100%; height: 100%;
  border: none;
  background: var(--surface);
}

/* PDF.js viewer */
.dok-pdf-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: #1F2937;
  color: white;
  border-bottom: 1px solid #374151;
  font-size: 13px;
  flex-shrink: 0;
}
.dok-pdf-btn {
  background: #374151;
  border: none;
  color: white;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}
.dok-pdf-btn:hover { background: #4B5563; }
.dok-pdf-zoom { font-variant-numeric: tabular-nums; min-width: 50px; text-align: center; }
.dok-pdf-sep { width: 1px; height: 20px; background: #374151; margin: 0 4px; }
.dok-pdf-pages { color: #9CA3AF; }

.dok-pdf-pages-wrap {
  flex: 1; overflow: auto;
  background: #525659;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  min-height: 0;
}
.dok-pdf-page {
  max-width: 100%;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border-radius: 2px;
}
.dok-view-media {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.dok-view-media video {
  max-width: 100%; max-height: 100%;
  background: black;
  border-radius: 4px;
}
.dok-view-audio {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.dok-view-audio audio { width: 90%; max-width: 600px; }

.dok-view-text {
  width: 100%; height: 100%;
  margin: 0; padding: 16px 20px;
  background: var(--surface);
  color: var(--gray-800);
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.dok-view-empty {
  text-align: center; color: white;
  padding: 60px 20px;
}
.dok-view-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 11px;
  padding: 6px 12px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .dok-view-wrap { height: calc(100vh - 180px); }
  /* Alttan acilma artik TUM modallarda ortak (asagidaki bottom-sheet blogu);
     burada yalnizca bu iki varyantin kendi yuksekligi kaliyor. */
  .modal.modal-xl { height: 92vh; }
}

/* ===== AYARLAR sayfasi ===== */
.settings-section {
  background: var(--surface, white);
  border: 1px solid var(--border, var(--gray-100));
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.settings-h { font-size: 16px; color: var(--gray-900); margin-bottom: 4px; }
.settings-p { font-size: 13px; color: var(--gray-500); margin-bottom: 16px; }

/* <small class="settings-p"> INLINE'dir; kendinden onceki buton/textarea'nin
   YANINDA akiyor ve metin kontrolun etrafini sariyordu (mobilde bariz).
   Yardim metni her zaman kendi satirinda dursun. */
.settings-form small,
.settings-section .form-group small { display: block; margin-bottom: 0; }
.sb-kredi-btn-satir { margin: 8px 0 6px; }

/* KOK NEDEN — .settings-form bir grid; grid cocuklari varsayilan min-width:auto
   ile gelir, yani icerigin max-content genisliginden dar OLAMAZ. Yardim
   metinlerindeki bolunemez <code> parcalari
   ({"reasoning_effort":"low",...} / meta-llama/llama-4-scout-17b-16e-instruct)
   kolonu genisletiyor ve TUM bolum saga kayiyordu (390px ekranda +29px olculdu).
   min-width:0 kolonun daralmasina izin verir, overflow-wrap uzun parcayi kirar. */
.settings-form, .settings-form > *, .settings-form .form-group { min-width: 0; }
.settings-section code,
.settings-section small { overflow-wrap: anywhere; }

@media (max-width: 768px) {
  /* 24px cerceve + ic kutularin 12px'i mobilde alani asiri daraltiyordu */
  .settings-section { padding: 16px; }
  /* Aciklama metinleri iki yana yasli — dar ekranda saga dogru tirtikli
     bitislerden kurtulur. hyphens: kelime kirilimi olmadan yaslama, uzun
     Turkce kelimelerde kelimeler arasi cirkin bosluklar birakirdi. */
  .settings-p, .settings-section small, .settings-section p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  /* Kod parcasi iceren satirlar yaslanmasin: bolunemez token'lar arasi bosluk
     asiri acilir ve metin dagilir. */
  .settings-section small:has(code),
  .settings-p:has(code) { text-align: left; }
  /* Dokunma hedefi: 38px olculdu, parmak icin dar */
  .settings-form input,
  .settings-form select,
  .settings-form .btn { min-height: 42px; }
  /* Kaydet butonlari tam genislik — yan yana sikismasinlar */
  .settings-form > div > .btn { width: 100%; }
  .settings-form > div > .btn + .btn { margin-top: 8px; }
}

.settings-themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.theme-card {
  background: var(--surface, white);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10, 77, 198, 0.12); }

.theme-preview {
  position: relative;
  height: 120px;
  padding: 14px;
  overflow: hidden;
}
.theme-bar { width: 50px; height: 12px; border-radius: 3px; margin-bottom: 10px; }
.theme-dot {
  position: absolute; top: 14px; right: 14px;
  width: 16px; height: 16px; border-radius: 50%;
}
.theme-line {
  height: 8px; background: rgba(128,128,128,0.25);
  border-radius: 3px; margin-top: 8px;
}
.theme-line.short { width: 60%; }

.theme-info { padding: 12px 14px; border-top: 1px solid var(--border, var(--gray-100)); }
.theme-name {
  font-weight: 600; font-size: 14px; color: var(--gray-900);
  display: flex; justify-content: space-between; align-items: center;
}
.theme-check { color: var(--primary); font-weight: 800; }
.theme-desc { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* PWA standalone mode (Add to Home Screen sonrasi) */
@media all and (display-mode: standalone) {
  body { user-select: none; -webkit-user-select: none; }
  /* iOS uzerinde swipe geri olusmasin */
  .main-content { overscroll-behavior: contain; }
}

/* ===== Mesaj aksiyon butonlari (edit, regenerate, copy) ===== */
.ai-msg-actions {
  display: flex; gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.ai-msg:hover .ai-msg-actions { opacity: 1; }
.ai-msg-user .ai-msg-actions { justify-content: flex-end; }
/* RAG (dokuman) chat ayni aksiyon stillerini kullanir */
.rag-msg:hover .ai-msg-actions { opacity: 1; }
.rag-msg-user .ai-msg-actions { justify-content: flex-end; }
/* Dokunmatik cihazlarda hover yok: aksiyonlar hep gorunur */
@media (hover: none) {
  .ai-msg-actions { opacity: 1; }
}
.ai-act {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ai-act:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ===== Inline edit alani ===== */
.ai-edit-area {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--surface);
  color: var(--gray-900);
  resize: vertical;
  min-height: 60px;
}
.ai-msg-user .ai-edit-area {
  background: var(--surface);
  color: var(--gray-900);
}
.ai-edit-actions {
  display: flex; gap: 8px;
  margin-top: 8px; justify-content: flex-end;
}

.ai-sql { margin-top: 8px; font-size: 12px; }
.ai-sql summary { cursor: pointer; color: var(--gray-500); }
.ai-sql pre { background: #1F2937; color: #E5E7EB; padding: 12px; border-radius: 6px; overflow-x: auto; margin-top: 6px; }

.ai-artifact { margin-top: 12px; }
.ai-kpi { display: inline-flex; flex-direction: column; align-items: center;
  padding: 20px 32px; background: var(--surface); border: 2px solid var(--primary); border-radius: 12px; }
.ai-kpi-val { font-size: 36px; font-weight: 800; color: var(--primary); line-height: 1; }
.ai-kpi-lbl { font-size: 12px; color: var(--gray-500); margin-top: 6px; }

.ai-chart-title { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }

.ai-table-wrap { overflow-x: auto; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ai-table th, .ai-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--gray-100); }
.ai-table th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); }
.ai-table-foot { font-size: 12px; color: var(--gray-400); padding: 6px 0; }

.ai-raw { background: var(--gray-50); padding: 10px; border-radius: 6px; font-size: 12px; max-height: 200px; overflow: auto; }

.ai-input {
  display: flex; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--gray-100);
  background: var(--surface);
  align-items: flex-end;
}
.ai-input textarea {
  flex: 1; resize: none;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 22px;
  font-family: inherit; font-size: 14.5px; line-height: 1.5;
  min-height: 44px; max-height: 160px;
  background: var(--gray-50);
  transition: border-color 0.15s, background 0.15s;
}
.ai-input textarea:focus {
  outline: none; border-color: var(--primary);
  background: var(--surface); box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.08);
}
.ai-input textarea:disabled { opacity: 0.7; cursor: not-allowed; }

.ai-rule-row {
  display: grid; grid-template-columns: 130px 1fr 180px; gap: 12px;
  padding: 12px; border-bottom: 1px solid var(--gray-100); align-items: center;
}
.ai-rule-text { font-size: 13px; color: var(--gray-700); }
.ai-rule-actions { display: flex; gap: 6px; justify-content: flex-end; }

@media (max-width: 900px) {
  .ai-layout { grid-template-columns: 1fr; }
  .ai-sidebar { display: none; }
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  margin-bottom: var(--s-5);
  overflow: hidden;
}

.card-header {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  background: var(--surface);
}

.card-header h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.2;
}

.card-body {
  padding: var(--s-5);
}

.card-body.no-padding {
  padding: 0;
}

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrapper table { min-width: 600px; }
/* Ara genislikte (laptop, tablet yatay) ust limit table icin */
@media (min-width: 1025px) and (max-width: 1280px) {
  .table-wrapper { overflow-x: auto; }
  table th, table td { padding: 10px 12px; font-size: 13px; white-space: nowrap; }
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-base);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

table tbody tr { transition: background 0.12s; }
table tbody tr:hover { background: var(--gray-50); }
table tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES (sahibinden tarzı kompakt chip) ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.01em;
}

.badge-success { background: var(--success-light); color: #065F46; }
.badge-danger  { background: var(--danger-light);  color: #991B1B; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-info    { background: var(--info-light);    color: #1E40AF; }
.badge-gray    { background: var(--gray-100);      color: var(--gray-700); }
.badge-accent  { background: var(--accent-light);  color: var(--yellow-700); }
.badge-primary { background: var(--blue-50);       color: var(--blue-700); }

.badge-dot::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
  display: inline-block;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

/* Baslik ve alt bar SABIT, yalnizca govde kayar.
   Onceden .modal'in kendisi kayiyordu: uzun formda govde sonuna inince baslik
   ekrandan cikiyor ve KAPAT (X) butonuna ulasilamiyordu — masaustunde de
   olculdu (X'in Y'si -3287'ye dusuyor). Bu, tum ekran boyutlari icin gecerli. */
.modal { display: flex; flex-direction: column; overflow: hidden; }
.modal > .modal-header, .modal > .modal-footer { flex: 0 0 auto; }
.modal > .modal-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  /* Govde sonuna gelince kaydirma ARKADAKI sayfaya zincirlenmesin (iOS'ta
     modal icinde kaydirinca alttaki liste kayiyordu — "web sitesi" hissi). */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;   /* iOS'ta ivmeli (momentum) kaydirma */
}

/* Modal aciktken arka plan yerinde donar. App._arkaPlanKilitle() ayrica
   body.style.top = -scrollY veriyor; ikisi birlikte iOS'ta da calisir. */
body.modal-acik {
  position: fixed;
  left: 0; right: 0;
  width: 100%;
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gray-500);
  transition: var(--transition);
}

.modal-close:hover { background: var(--gray-200); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-info { background: var(--info); color: white; }
.toast-warning { background: var(--warning); color: white; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 4px;
}
.pagination-info { font-size: 13px; color: var(--gray-500); }
.pagination-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination-size {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--gray-600);
}
.pagination-size select {
  padding: 4px 8px; border: 1px solid var(--gray-200);
  border-radius: 6px; font-size: 13px; background: var(--surface);
}
.pagination-page { font-size: 13px; font-weight: 600; min-width: 56px; text-align: center; }
.pagination .btn[disabled] { opacity: .4; cursor: default; }

/* ===== OTOMASYONLAR / FLOW ===== */
.flow {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 4px;
  margin: 6px 0 4px;
  overflow-x: auto;
}
.flow-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .3s, color .3s, box-shadow .3s, background .3s;
}
.flow-node .flow-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  transition: all .3s;
}
.flow-node.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.flow-node.active .flow-num { background: var(--primary); color: #fff; }
.flow-node.done {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-light);
}
.flow-node.done .flow-num { background: var(--success); color: #fff; }

.flow-edge {
  position: relative;
  width: 38px;
  height: 2px;
  background: var(--gray-200);
  flex-shrink: 0;
  transition: background .3s;
}
.flow-edge .flow-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%);
  opacity: 0;
}
.flow.running .flow-edge { background: var(--primary-light); }
.flow.running .flow-edge .flow-dot { opacity: 1; animation: flowdot 1s linear infinite; }
@keyframes flowdot { from { left: 0; } to { left: 100%; } }

.automation-stats { display: flex; flex-wrap: wrap; gap: 16px; }
.automation-stat { font-size: 13px; color: var(--gray-600); }
.automation-stat-label { color: var(--gray-400); }
.automation-result { margin-top: 10px; min-height: 18px; font-size: 13px; }
.automation-result-ok { color: var(--success); font-weight: 600; }
.automation-result-err { color: var(--danger); font-weight: 600; }

/* ===== KPI ROW (Son 7 Gun) ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.kpi-item {
  text-align: center;
  padding: 8px 6px;
  border-right: 1px solid var(--gray-100);
}
.kpi-item:last-child { border-right: none; }
.kpi-num { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1; }
.kpi-lbl { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } .kpi-item { border-right: none; } }
@media (max-width: 480px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== EMPTY STATE (sade + dengeli) ===== */
.empty-state {
  text-align: center;
  padding: var(--s-12) var(--s-5);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
}

.empty-state .icon {
  width: 64px; height: 64px;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 50%;
  margin-bottom: 16px;
  font-size: 28px;
}
.empty-state .icon svg, .empty-state .icon i { width: 28px; height: 28px; }

.empty-state h4 {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--s-1);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* ===== SEARCH & FILTERS ===== */
/* ===== TOOLBAR (sahibinden filtre/sıralama çubuğu tarzı) ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
  background: var(--surface);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

.search-box {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-md);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input::placeholder { color: var(--gray-400); }

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  display: inline-flex;
}

.filter-select {
  height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-md);
  color: var(--gray-700);
  outline: none;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%236B7177' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>") right 12px center no-repeat;
  cursor: pointer;
  min-width: 140px;
  appearance: none;
  -webkit-appearance: none;
}

.filter-select:hover { border-color: var(--border-strong); }
.filter-select:focus { border-color: var(--primary); box-shadow: var(--ring); }

/* Sayısal filtre (fiyat min/max) — filter-select ile uyumlu */
.filter-num {
  height: 38px;
  width: 92px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-md);
  color: var(--gray-700);
  background: var(--surface);
  outline: none;
}
.filter-num:hover { border-color: var(--border-strong); }
.filter-num:focus { border-color: var(--primary); box-shadow: var(--ring); }

/* Dark/Ocean: select ok ikonunu (acik renk) koru — genel select kurali sifirliyor */
[data-theme="dark"] .filter-select,
[data-theme="ocean"] .filter-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23cbd5e1' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Sonuç sayısı + sıralama satırı (sahibinden tarzı) */
.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
  padding: 0 var(--s-1);
}
.result-count {
  font-size: var(--fs-base); color: var(--text-muted);
}
.result-count strong { color: var(--gray-900); font-weight: 600; }
.result-actions { display: flex; align-items: center; gap: var(--s-2); }
/* Sonuç çubuğundaki sıralama (sahibinden: sağ üstte) */
.result-sort {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.result-sort .filter-select { min-width: 190px; height: 34px; }

/* ===== LOADING ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 60vh;   /* dikeyde sayfanin ortasina yakin dursun */
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== CHARTS ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

/* ===== MOBILE BOTTOM NAV ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--gray-200);
  z-index: 100;
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item .bnav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bottom-nav-item .bnav-icon svg { width: 22px; height: 22px; }

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

/* ===== RESPONSIVE ===== */
/* Header'daki kompakt logo — sadece sidebar gizliyken (mobil/tablet) gosterilir */
.header-logo {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex: 0 0 auto;
}

/* Mobil geri butonu — MASAUSTUNDE HER ZAMAN GIZLI.
   Masaustunde tarayicinin kendi geri butonu var; ekrani kalabaliklastirmayalim.
   Yalnizca ≤1024px'te ve JS "geri gidilecek adim var" dediginde ([hidden]
   kaldirilinca) gorunur. iOS standalone PWA'da tek geri yoludur. */
.header-back { display: none; }
.header-back[hidden] { display: none !important; }

.menu-toggle {
  display: none;                /* masaüstünde gizli; ≤1024 media'da mobil drawer için görünür */
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-700);
  -webkit-tap-highlight-color: transparent;
}

/* Tablet */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  /* Geri butonu mobilde gorunur — ama [hidden] iken degil (yukaridaki !important) */
  .header-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px; height: 40px;      /* dokunma hedefi */
    margin-left: -6px;              /* optik hizalama: ikon govdesi kenara yaklassin */
    color: var(--gray-700);
    -webkit-tap-highlight-color: transparent;
  }
  .header-back i { width: 24px; height: 24px; }

  .header-logo {
    display: block;
  }

  .page-content {
    padding: 24px 20px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Sidebar telefonda OFF-CANVAS DRAWER: "Daha" butonu acar.
     (Eskiden display:none!important idi -> .open calismiyordu, menu acilmiyordu.) */
  .sidebar {
    display: flex;
    width: 84vw;
    max-width: 320px;
    z-index: 110;          /* bottom-nav (z:100) ve overlay ustunde */
  }
  /* transform (-100% / .open->0) 1024px kuralindan gelir; overlay'i bottom-nav ustune al */
  body.sidebar-open::before { z-index: 105; }

  .bottom-nav {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 80px;
  }

  .main-header {
    padding: 0 12px;
    height: 56px;
    gap: 8px;
  }
  /* Mobil header: SOL sadece hamburger (logo+baslik gizli); header-actions
     ortadaki alani alir ve YATAY KAYAR; ZİL en sagda sabit. */
  /* gap:0 — telefonda solda yalnizca hamburger vardi. Geri butonu eklenince
     iki ikon bitisik duruyordu; yalnizca geri GORUNURKEN aralik veriyoruz. */
  .header-left { flex: 0 0 auto; gap: 0; }
  .header-left:has(.header-back:not([hidden])) { gap: 2px; }
  .header-logo { display: none; }
  .main-header .page-title { display: none; }   /* baslik header ALTINA tasindi */

  .main-header .header-right { flex: 1 1 auto; min-width: 0; justify-content: flex-end; gap: 6px; }
  .main-header .header-actions {
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto; flex-wrap: nowrap; gap: 6px;
    max-width: none;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .main-header .header-actions::-webkit-scrollbar { display: none; }
  .main-header .header-actions .btn { padding: 7px 10px; font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
  .main-header .header-actions .btn i { width: 15px; height: 15px; }

  /* Sayfa basligi: header ALTINDA, sayfa uzerinde (okunakli) */
  .mobile-page-title {
    display: block;
    padding: 14px 16px 0;
    font-size: 20px; font-weight: 700; color: var(--gray-900);
    letter-spacing: -0.01em; line-height: 1.2;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
  }

  .page-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    border-radius: 10px;
  }

  .stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 8px;
  }

  .stat-card .stat-value {
    font-size: 22px;
  }

  .stat-card .stat-label {
    font-size: 11px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Mobil toolbar: dikey yigin YERINE 2 sutunlu grid (yer tasarrufu).
     Arama tam genislik; filtre/select'ler ikili; view-toggle altta ortalanir. */
  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
  }
  .toolbar > .search-box {
    grid-column: 1 / -1;
    flex: none;
    min-width: 0;
    max-width: none;
  }
  .toolbar > .filter-select,
  .toolbar > .filter-num {
    min-width: 0;
    width: 100%;
    height: 40px;          /* dokunma hedefi buyusun */
  }
  .toolbar > .view-toggle {
    grid-column: 1 / -1;
    justify-content: center;
  }
  /* Toolbar icindeki tam-satir isteyen ogeler (buton grubu vb.) */
  .toolbar > .toolbar-full { grid-column: 1 / -1; }

  /* Sonuc cubugu: mobilde sar, siralama alt satira gecsin (tasma olmasin) */
  .result-bar { flex-wrap: wrap; gap: 8px; row-gap: 6px; }
  .result-sort { width: 100%; justify-content: space-between; }
  .result-sort .filter-select { min-width: 0; flex: 1; max-width: 100%; }

  /* View-toggle butonlari dokunma dostu */
  .view-toggle-btn { padding: 8px 14px; }
  .view-toggle-btn i { width: 18px; height: 18px; }

  /* Modal footer: mobilde butonlar sarsin ( or. video: Paylas/Kopyala/Indir/Kapat 2x2) */
  .modal-footer { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
  .modal-footer .btn { flex: 1 1 auto; min-width: calc(50% - 4px); justify-content: center; }

  .card {
    border-radius: 10px;
    margin-bottom: 16px;
  }

  .card-header {
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

  table th, table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .modal {
    max-width: 100%;
    margin: 12px;
    border-radius: 14px;
    max-height: calc(100vh - 24px);
  }

  .login-card {
    padding: 32px 24px;
    border-radius: 14px;
  }

  .btn { padding: 10px 16px; }
  .btn-lg { padding: 14px 24px; }
}

/* Small Mobile */
@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
  }

  .stat-card .stat-header { margin-bottom: 0; }
}

/* ===== MOBILE CARDS ===== */
.mobile-only { display: none; }
.desktop-only { display: block; }

.mobile-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-card:active {
  transform: scale(0.98);
}

.mobile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-50);
}

/* Basliktaki metin sutunu DARALABILMELI; yoksa uzun firma adi kutuyu iterek
   logoyu ve durum rozetini hizadan cikariyordu (olculdu: 3 satira yayiliyor). */
.mobile-card-header > * { min-width: 0; }
.mobile-card-header > *:first-child,
.mobile-card-header > *:last-child { flex: none; }

.mobile-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-800);
  /* En fazla 2 satir; devami "…" olur. Tek satira sikistirmak uzun firma
     adlarinda ayirt ediciligi yok ediyordu. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.mobile-card-sub {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
  /* URL/alan adi TEK satir — uzun alt alan adlari karti bozuyordu */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-card-sub a { display: block; overflow: hidden; text-overflow: ellipsis; }
.mobile-card-etiket { margin-top: 4px; }

/* ===== Ayarlar: Push bildirimleri ===== */
.push-engel {
  display: flex; gap: 9px; align-items: flex-start;
  background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.32);
  border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.55;
  color: var(--gray-700); max-width: 620px;
}
.push-engel i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
[data-theme="dark"] .push-engel { color: var(--gray-300); }

.push-ust {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px; background: var(--surface); max-width: 620px;
}
.push-durum { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--gray-500); }
.push-durum.acik { color: #067a55; }
[data-theme="dark"] .push-durum.acik { color: #6ee7b7; }
.push-durum i { width: 17px; height: 17px; }
.push-alt { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

.push-turler { display: grid; gap: 2px; margin-top: 10px; max-width: 620px; }
.push-tur {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 9px 11px; border-radius: 9px;
}
.push-tur:hover { background: var(--bg); }
.push-tur input { margin-top: 2px; flex: none; width: 17px; height: 17px; }
.push-tur input:disabled { cursor: default; }
.push-tur input:disabled + span { opacity: 0.5; }
.push-tur span { display: flex; flex-direction: column; min-width: 0; }
.push-tur b { font-size: 13.5px; font-weight: 600; }
.push-tur small { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

/* Kontroller (2 select + buton) ~540px yer kapliyor; 620px kutuda sol metne
   ~50px kaliyordu ve metin tek kelimelik sutuna cokuyordu (sag taraf 'flex:none'
   ile kucultulemez, sol taraf ise kucultulebilir olduğu icin tum baski ona
   biniyordu). Cozum: kutuyu genislet + satir sarmasina izin ver + sol tarafa
   makul bir taban genislik ver. */
.push-test {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px 14px;
  margin-top: 12px; padding: 12px 15px; max-width: 760px;
  border: 1px dashed var(--border); border-radius: 12px;
}
.push-test-sol { flex: 1 1 260px; min-width: 0; }
.push-test-sol b { display: block; font-size: 13.5px; }
.push-test-sol small { font-size: 12px; color: var(--gray-500); }
.push-test-sag { display: flex; gap: 8px; align-items: center; flex: 0 1 auto; flex-wrap: wrap; }
/* Select'ler dar alanda tasmasin: kendi icerigine gore kuculebilsinler. */
.push-test-sag .filter-select { min-width: 0; max-width: 220px; }
.push-sonuc { margin-top: 8px; font-size: 13px; max-width: 620px; }
.push-ok { color: #067a55; }
.push-hata { color: var(--danger, #dc2626); }
[data-theme="dark"] .push-ok { color: #6ee7b7; }

@media (max-width: 768px) {
  .push-ust, .push-test { flex-direction: column; align-items: stretch; }
  .push-test-sag { flex-direction: column; align-items: stretch; }
  .push-ust .btn { width: 100%; justify-content: center; }
}

/* ===== Ayarlar: Google Cloud bakiyesi ===== */
.butce-kutu {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
  max-width: 520px;
}
.butce-yukl, .butce-hata { font-size: 13px; color: var(--gray-500); }
.butce-hata { color: var(--danger, #dc2626); }
.butce-bekle { font-size: 13px; color: var(--gray-600); line-height: 1.55; }
.butce-ust { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.butce-kalan-lbl { font-size: 12px; color: var(--gray-500); }
.butce-kalan { font-size: 26px; font-weight: 800; line-height: 1.2; margin-top: 2px; }
.butce-kalan.iyi    { color: #067a55; }
.butce-kalan.uyari  { color: #a45c04; }
.butce-kalan.kritik { color: #b91c1c; }
[data-theme="dark"] .butce-kalan.iyi    { color: #6ee7b7; }
[data-theme="dark"] .butce-kalan.uyari  { color: #fcd34d; }
[data-theme="dark"] .butce-kalan.kritik { color: #fca5a5; }
.butce-sag { text-align: right; font-size: 12.5px; color: var(--gray-600); line-height: 1.7; }
.butce-bar {
  height: 8px; border-radius: 999px; margin: 12px 0 6px;
  background: var(--bg); overflow: hidden;
}
.butce-bar i { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.butce-bar i.iyi    { background: #10b981; }
.butce-bar i.uyari  { background: #f59e0b; }
.butce-bar i.kritik { background: #ef4444; }
.butce-alt { font-size: 11.5px; color: var(--gray-500); }
/* "Google 0 bildiriyor" aciklamasi — sessizce yanlis okunan bir durumu anlatir. */
.butce-uyari {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 12px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.55; color: var(--gray-700, #374151);
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
}
.butce-uyari i { flex: none; width: 17px; height: 17px; color: #b45309; margin-top: 1px; }
[data-theme="dark"] .butce-uyari { color: var(--gray-300, #d1d5db); }
@media (max-width: 768px) {
  .butce-ust { flex-direction: column; gap: 6px; }
  .butce-sag { text-align: left; }
}

/* Google Maps fiyat etiketi — Leaflet'teki .map-price-pin ile ayni gorunum */
.gmap-fiyat-etiket {
  background: var(--primary, #0A4DC6);
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  white-space: nowrap;
}
/* InfoWindow icerigi dar ekranda tasmasin */
.gm-style-iw-d { overflow: auto !important; }

.mobile-card-body {
  padding: 10px 16px;
}

.mobile-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--gray-700);
}

.mobile-card-label {
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  /* "SON HATA" gibi iki kelimelik etiketler alt alta boluniyordu (olculdu) */
  white-space: nowrap;
  flex: none;
}
/* Deger sutunu daralsin, uzun metin 2 satirda kesilsin — etiketi ezmesin */
.mobile-card-row > span:last-child {
  min-width: 0;
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.mobile-card-actions {
  display: flex;
  flex-wrap: wrap;          /* 4 buton 360px'e sigmiyordu -> alt satira insin */
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-50);
}
.mobile-card-actions .btn { min-width: 0; }

/* Tablet ve mobilde kartlar gosterilsin (tablo gizli) — sutun tasmasini onler */
@media (max-width: 1024px) {
  .mobile-only { display: block; }
  .desktop-only { display: none !important; }
}

/* ===== MISC ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.hidden { display: none !important; }

/* ============================================================
   FAZ 6 — SKELETON LOADER + MIKRO ETKILESIM
   ============================================================ */
@keyframes skeleton-pulse {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
  display: block;
  background: linear-gradient(90deg,
    var(--bg) 0%,
    var(--border) 50%,
    var(--bg) 100%);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  border-radius: var(--r-sm);
  animation: skeleton-pulse 1.2s ease-in-out infinite;
  height: 16px;
  width: 100%;
}
.skeleton-card {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  margin-bottom: var(--s-2);
}
.skeleton-card .skeleton-img {
  width: 132px; height: 100px;
  border-radius: var(--r-sm);
}
.skeleton-card .skeleton-body {
  display: flex; flex-direction: column; gap: 8px;
}
.skeleton-card .skeleton-line-1 { width: 70%; height: 18px; }
.skeleton-card .skeleton-line-2 { width: 50%; height: 12px; }
.skeleton-card .skeleton-line-3 { width: 35%; height: 12px; }
.skeleton-card .skeleton-price { width: 120px; height: 24px; }
@media (max-width: 640px) {
  .skeleton-card { grid-template-columns: 96px 1fr; }
  .skeleton-card .skeleton-img { width: 96px; height: 96px; }
}

/* Fade-in entrance */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fade-in 220ms ease-out both;
}

/* Sayfa giriş — page-content içine her render */
#page-content > * {
  animation: fade-in 220ms ease-out both;
}

/* Stagger gecikmeli liste kartları */
.list-card:nth-child(1) { animation-delay: 0ms; }
.list-card:nth-child(2) { animation-delay: 30ms; }
.list-card:nth-child(3) { animation-delay: 60ms; }
.list-card:nth-child(4) { animation-delay: 90ms; }
.list-card:nth-child(5) { animation-delay: 120ms; }

/* Buton tıklama efekti */
.btn:not(:disabled):active { transform: translateY(1px); }

/* Card hover yumuşatma */
.card { transition: box-shadow 160ms ease, transform 160ms ease; }
.card.hover-lift:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Form fokus hafif glow */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  animation: focus-glow 380ms ease-out;
}
@keyframes focus-glow {
  0%   { box-shadow: 0 0 0 0 rgba(10,77,198,0.25); }
  100% { box-shadow: 0 0 0 3px rgba(10,77,198,0.15); }
}

/* ===== Arama Detay — WhatsApp tarzı konuşma dökümü ===== */
.call-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: #e9edef;
  background-image: radial-gradient(rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 18px 18px;
  border-radius: 12px;
  max-height: 52vh;
  overflow-y: auto;
}
.chat-row { display: flex; flex-direction: column; max-width: 100%; }
.chat-row.assistant { align-items: flex-end; }
.chat-row.customer { align-items: flex-start; }
.chat-bubble {
  max-width: 80%;
  padding: 7px 11px 6px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.10);
}
.chat-row.assistant .chat-bubble { background: #d9fdd3; border-bottom-right-radius: 4px; }
.chat-row.customer  .chat-bubble { background: var(--surface); border-bottom-left-radius: 4px; }
.chat-sender { font-size: 11px; font-weight: 700; margin: 0 6px 2px; opacity: 0.85; }
.chat-row.assistant .chat-sender { color: #1f7a55; }
.chat-row.customer  .chat-sender { color: var(--blue-600, #003DA5); }
.chat-empty { text-align: center; color: var(--gray-500); padding: 24px; font-size: 14px; }

/* Konusma dokumu renk gostergesi — ornekler BALONLARLA ayni renkleri kullanir,
   boylece tema degisince gosterge de dogru kalir. */
.chat-legend { display: flex; gap: 10px; font-size: 11px; color: var(--gray-500); }
.chat-legend span { display: inline-flex; align-items: center; gap: 4px; }
.chat-legend-ornek {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}
.chat-legend-ornek.assistant { background: #d9fdd3; }
.chat-legend-ornek.customer  { background: var(--surface); }
[data-theme="dark"] .chat-legend-ornek.assistant { background: #005c4b; }
[data-theme="dark"] .chat-legend-ornek.customer  { background: #202c33; }
.chat-row.note { align-items: center; }
.chat-note {
  max-width: 92%;
  background: #fff7d6;
  color: #5b5320;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
[data-theme="dark"] .chat-note { background: #1d2b27; color: #cdd7cf; }

/* AI cevabindaki portfoy listesi: cok uzunsa cevabi tasirmasin */
.ai-artifact .ai-listings { max-height: 60vh; overflow-y: auto; padding-right: 2px; }
.ai-artifact .ai-listings .list-card { margin-bottom: 8px; }

[data-theme="dark"] .call-chat { background: #0b141a; background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px); }
[data-theme="dark"] .chat-row.assistant .chat-bubble { background: #005c4b; color: #e9edef; }
[data-theme="dark"] .chat-row.customer  .chat-bubble { background: #202c33; color: #e9edef; }
[data-theme="dark"] .chat-row.assistant .chat-sender { color: #7fd1b0; }
[data-theme="dark"] .chat-row.customer  .chat-sender { color: #7aa7ff; }

/* ===== FSBO — WhatsApp AI temasi (salt okuma) ===== */
/* Balonlar .call-chat/.chat-* ile ORTAK; burada yalnizca WhatsApp'a ozgu
   eklentiler var (saat + tik, baslik seridi, durum kutusu, kart rozeti). */
.wa-chat { max-height: 46vh; }
.wa-meta {
  float: right; margin: 6px 0 -2px 10px;
  font-size: 10.5px; color: var(--gray-500); white-space: nowrap;
}
.wa-tik { margin-left: 4px; letter-spacing: -1px; }
.wa-tik-okundu { color: #53bdeb; }
[data-theme="dark"] .wa-meta { color: rgba(233,237,239,0.55); }

/* Gun ayraci — WhatsApp'taki ortada duran "Bugün / Dün" seridi */
.wa-gun { display: flex; justify-content: center; margin: 4px 0 2px; }
.wa-gun span {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 4px 11px; border-radius: 8px;
  background: rgba(255,255,255,0.92); color: #54656f;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
[data-theme="dark"] .wa-gun span { background: #182229; color: #8696a0; }

/* minmax(0,1fr): grid kolonu varsayilan olarak en genis cocugun max-content
   genisligine gore acilir; balonlar 360px ekranda kolonu 509px'e cikariyor ve
   modal YATAY KAYIYORDU (olculdu). minmax(0,…) kolonun daralmasina izin verir. */
.wa-modal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.wa-modal > * { min-width: 0; }
.chat-bubble, .chat-note, .wa-durum-ozet { overflow-wrap: anywhere; }

/* ===== Mobil: gercek WhatsApp gibi tam ekran sohbet =====
   modal-xl telefonda zaten alttan acilan bir sayfa (bottom sheet). Burada
   sohbeti KALAN TUM YUKSEKLIGE yayiyoruz: baslik/durum sabit, yalnizca balonlar
   kayar. Masaustunde hicbir sey degismez. */
@media (max-width: 768px) {
  .modal.modal-xl { height: 92vh; max-height: 92vh; }
  .modal.modal-xl .modal-body { flex: 1 1 auto; min-height: 0; }

  .wa-modal {
    height: 100%;
    gap: 8px;
    padding: 10px 10px 0;
    /* baslik · durum · SOHBET(esner) · not */
    grid-template-rows: auto auto 1fr auto;
  }
  .wa-chat {
    max-height: none;          /* masaustundeki 46vh siniri burada engel */
    min-height: 0;             /* grid satirinin daralabilmesi icin sart */
    height: 100%;
    padding: 12px 10px;
  }
  /* Dar ekranda balon %80'de gereginden fazla daraliyor */
  .chat-bubble { max-width: 88%; }
  .wa-head, .wa-durum-kutu { padding: 9px 11px; }
  .wa-not { margin: 0 -10px; border-radius: 0; }

  /* Alttan acilan modal (bottom sheet) ic duzeni: .modal blok kutuydu ve
     overflow-y:auto ile TUM icerik kayiyordu -> footer gorunur alanin altinda
     kaliyor, "Kapat" butonuna ulasmak icin sohbetin sonuna kadar kaydirmak
     gerekiyordu (olculdu: buton alt kenari 1088px, ekran 844px).
     Sutun flex: baslik ve footer SABIT, yalnizca govde kayar — WhatsApp gibi. */
  /* Mobilde baslik cubugu 20/24px dolguyla cok yer kapliyordu */
  .modal.modal-xl > .modal-header { padding: 12px 16px; }
  .modal.modal-xl > .modal-header h3 { font-size: 15px; }
}

/* ===== Modal + iOS guvenli alan =====
   .modal-overlay dolgusu SABIT 20px'ti; iPhone centigini (47px) hesaba katmiyordu.
   Olculdu: duz modalda X butonu Y=32'de kaliyor -> centik bolgesinde, dokunma
   sistem tarafindan yutuluyor ve KAPATILAMIYOR. Ayni sekilde alt kenarda footer
   home cubugunun altina giriyordu.
   max(): guvenli alan yoksa (Android/masaustu) eski 20px korunur. */
@supports (padding: max(0px, env(safe-area-inset-top))) {
  .modal-overlay {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}
/* ===== Mobilde TUM modallar alttan acilan sayfa (bottom sheet) =====
   Ortalanmis modalin yuksekligini guvenli alana gore hesaplamak kirilgandi:
   overlay dolgusu, .modal'in margin:12px'i ve flex ortalamanin tasma davranisi
   birbirini eziyor, X butonu centige giriyordu (olculdu). Alttan sabitlemek bu
   matematigi tamamen kaldirir: sayfa ASAGIDAN baslar, ust siniri max-height ile
   guvenli alanin altinda kalir. iOS/Android'in yerel davranisi da budur.
   modal-large / modal-xl zaten boyleydi; artik hepsi ayni. */
@media (max-width: 768px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal,
  .modal.modal-large, .modal.modal-xl, .modal.modal-detail {
    margin: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    /* dvh: iOS Safari'de adres cubugu acilip kapanirken 100vh SABIT kalir ve
       sayfa tasardi; dvh gercek gorunur yuksekligi izler. */
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - 10px);
  }
  /* Alt kenar home cubugunun ustunde kalsin — TUM modallar icin */
  .modal > .modal-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .modal:not(:has(> .modal-footer)) > .modal-body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
@supports (height: 100dvh) {
  @media (max-width: 768px) {
    .modal { max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 10px); }
  }
}

/* Mobil header, ≤768px kuralinda "padding: 0 12px" ile safe-area dolgusunu
   EZIYORDU (kaynak sirasi 1436'daki @supports blogunun onunde). iPhone'da
   standalone PWA'da durum cubugu icerigin USTUNE binince header centigin
   altinda kaliyordu. Burada geri aliyoruz — kaynakta sonra geldigi icin kazanir. */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    .main-header {
      padding-top: env(safe-area-inset-top);
      height: calc(56px + env(safe-area-inset-top));
    }
  }
}
.wa-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
}
.wa-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; background: #25d366;
}
.wa-avatar i { width: 20px; height: 20px; }
.wa-head-ad { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-head-sub { font-size: 12px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-kaynak {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  background: rgba(37,211,102,0.12); color: #128c4a;
}
.wa-kaynak i { width: 13px; height: 13px; }
[data-theme="dark"] .wa-kaynak { color: #7fd1b0; }

.wa-durum-kutu { border-radius: 12px; padding: 10px 13px; border: 1px solid transparent; }
.wa-durum-ust { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.wa-durum-ust i { width: 17px; height: 17px; }
.wa-durum-ozet { font-size: 13px; line-height: 1.5; margin-top: 5px; opacity: 0.9; }
.wa-durum-tarih { font-size: 11px; margin-top: 5px; opacity: 0.7; }
.wa-skor {
  margin-left: auto; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,0.07);
}
[data-theme="dark"] .wa-skor { background: rgba(255,255,255,0.12); }

/* Durum renkleri — hem kutu hem kart rozeti ayni siniflari kullanir */
.wa-st-ok    { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.35); color: #067a55; }
.wa-st-akis  { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.35); color: #1d4ed8; }
.wa-st-bekle { background: rgba(245,158,11,0.13); border-color: rgba(245,158,11,0.35); color: #a45c04; }
.wa-st-red   { background: rgba(239,68,68,0.11);  border-color: rgba(239,68,68,0.32);  color: #b91c1c; }
.wa-st-gri   { background: var(--bg); border-color: var(--border); color: var(--gray-600); }
[data-theme="dark"] .wa-st-ok    { color: #6ee7b7; }
[data-theme="dark"] .wa-st-akis  { color: #93c5fd; }
[data-theme="dark"] .wa-st-bekle { color: #fcd34d; }
[data-theme="dark"] .wa-st-red   { color: #fca5a5; }
[data-theme="dark"] .wa-st-gri   { color: var(--gray-300); }

.wa-not {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px; line-height: 1.5; color: var(--gray-600);
  background: var(--bg);
  border-radius: 10px; padding: 9px 11px;
}
.wa-not i { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* Ilan kartindaki durum rozeti */
.wa-rozet {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  margin-top: 7px; padding: 4px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent;
}
.wa-rozet i { width: 14px; height: 14px; flex: none; }
.wa-rozet:hover { filter: brightness(0.97); }
.wa-rozet .wa-skor { padding: 1px 6px; font-size: 10.5px; }

.fsbo-wa-txt { color: #128c4a; }
[data-theme="dark"] .fsbo-wa-txt { color: #7fd1b0; }

/* Takip kartindaki dort durum kirilimi — tiklanabilir mini rozetler */
.fsbo-arama-wa { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.wa-mini {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.wa-mini i { width: 12px; height: 12px; flex: none; }
.wa-mini:hover { filter: brightness(0.95); }

/* Ilan panelindeki WhatsApp filtre sekmeleri, tarama filtrelerinden ayrilsin */
.fsbo-filtre-btn.fsbo-filtre-wa { border-left: 2px solid rgba(37,211,102,0.45); }
.fsbo-filtre-btn:disabled { opacity: 0.4; cursor: default; }

/* Telefon input dogrulama */
.input-invalid { border-color: #EF4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.15) !important; }
.phone-hint { display: none; margin-top: 4px; font-size: 12px; color: #EF4444; }

/* Rapor: En iyi danisman/sube KPI kartlari (ortalanmis) */
/* Ust KPI izgarasiyla ayni 4 kolon; kartlar 1 kolon saga (2.-3. kolon) */
.rapor-kpis-best { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rapor-kpis-best .rapor-kpi { text-align: center; }
.rapor-kpis-best .rapor-kpi:first-child { grid-column: 2; }
.rapor-kpis-best .rapor-kpi.best .rapor-kpi-lbl { justify-content: center; }
@media (max-width: 1100px) {
  .rapor-kpis-best { grid-template-columns: repeat(2, 1fr); }
  .rapor-kpis-best .rapor-kpi:first-child { grid-column: auto; }
}
@media (max-width: 560px) { .rapor-kpis-best { grid-template-columns: 1fr; } }
.rapor-kpi.best { border: 1px solid rgba(22,163,74,0.25); background: linear-gradient(180deg, rgba(22,163,74,0.06), transparent); }
.rapor-kpi.best .rapor-kpi-lbl { display: flex; align-items: center; gap: 6px; color: #16a34a; font-weight: 700; }
.rapor-kpi.best .rapor-kpi-lbl i { width: 15px; height: 15px; }
[data-theme="dark"] .rapor-kpi.best { border-color: rgba(22,163,74,0.4); background: rgba(22,163,74,0.08); }

/* Firma logosu kutusu (Firmalar listesi) */
.firm-logo { border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--gray-200, #e2e8f0); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.firm-logo img { width: 100%; height: 100%; object-fit: contain; }
.firm-logo.ph { background: linear-gradient(135deg, #0A4DC6, #00255e); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px; }
[data-theme="dark"] .firm-logo { background: #0f172a; border-color: #374151; }

/* Grid kolon siralama + filtreleme */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--blue-600, #0A4DC6); }
.sort-ind { font-size: 11px; opacity: 0.8; }
.col-filter-row th { padding: 4px 6px; background: var(--gray-50, #f8fafc); }
.col-filter { width: 100%; box-sizing: border-box; padding: 4px 6px; font-size: 12px; border: 1px solid var(--gray-200, #e2e8f0); border-radius: 6px; background: var(--surface); }
[data-theme="dark"] .col-filter-row th { background: #0f172a; }
[data-theme="dark"] .col-filter { background: #1f2937; border-color: #374151; color: #e5e7eb; }

/* Portfoy detay popup — sahibinden tarzi bolumler */
.detail-section { margin-top: 20px; }
.detail-section h4 { margin: 0 0 10px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--gray-200, #e2e8f0); padding-bottom: 6px; }
.detail-facts-wide { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px 24px; }
@media (max-width: 640px) { .detail-facts-wide { grid-template-columns: 1fr; } }
.detail-facts-wide .detail-fact { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--gray-100, #f1f5f9); }
.spec-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-chip { background: var(--gray-100, #f1f5f9); border: 1px solid var(--gray-200, #e2e8f0); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--text, #334155); }
[data-theme="dark"] .detail-section h4 { border-color: #374151; }
[data-theme="dark"] .detail-facts-wide .detail-fact { border-color: #1f2937; }
[data-theme="dark"] .spec-chip { background: #1f2937; border-color: #374151; color: #cbd5e1; }
/* Fiyat/m² vurgu chip'i — sade mavi tonu (fiyat metrigi one ciksin, abartisiz). */
.spec-chip-accent { background: var(--blue-50, #eff4ff); border-color: var(--blue-200, #c7d7fe); color: var(--blue-700, #1d4ed8); }
.spec-chip-accent b { color: inherit; }
[data-theme="dark"] .spec-chip-accent, [data-theme="ocean"] .spec-chip-accent { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.4); color: #93c5fd; }

/* Badge dot pulse */
.badge-dot.pulse::before {
  animation: dot-pulse 1.6s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: .5; }
}

/* ============================================================
   FAZ 5 — PORTFOY DETAY (modal içi sahibinden tarzı layout)
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: var(--s-5);
}
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-gallery {
  background: var(--bg);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
}
.detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-gallery .empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.detail-gallery .empty i { width: 64px; height: 64px; opacity: .3; }

.detail-side { display: flex; flex-direction: column; gap: var(--s-3); }
.detail-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}
.detail-price {
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--blue-700);
}
[data-theme="dark"] .detail-price,
[data-theme="ocean"] .detail-price { color: var(--blue-500); }
.detail-loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.detail-loc i { width: 14px; height: 14px; }

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2) var(--s-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
}
.detail-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-sm);
}
.detail-fact-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.detail-fact-value {
  color: var(--text);
  font-weight: 600;
}

/* ============================================================
   FAZ 4 — VIEW TOGGLE (Kart / Tablo)
   ============================================================ */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--border); }
.view-toggle-btn i { width: 16px; height: 16px; }
.view-toggle-btn:hover { background: var(--bg); color: var(--text); }
.view-toggle-btn.active {
  background: var(--blue-50);
  color: var(--blue-700);
}
[data-theme="dark"] .view-toggle-btn.active,
[data-theme="ocean"] .view-toggle-btn.active {
  background: rgba(10,77,198,0.18);
  color: var(--text);
}

/* ============================================================
   FAZ 3 — SAHIBINDEN TARZI LISTE KARTI
   Sol resim + orta info (başlık + meta + konum) + sağ fiyat/badge
   ============================================================ */
.list-cards { display: flex; flex-direction: column; gap: var(--s-2); }
.list-card {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  position: relative;
}
.list-card:hover {
  border-color: var(--blue-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.list-card:hover .list-card-actions { opacity: 1; transform: translateY(0); }

.list-card-img {
  width: 132px;
  height: 100px;
  border-radius: var(--r-sm);
  background: var(--bg);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.list-card-img.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.list-card-img.empty i { width: 32px; height: 32px; opacity: 0.4; }
.list-card-img-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  letter-spacing: 0.3px;
}

.list-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  gap: var(--s-1);
}
.list-card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
.list-card-title:hover { color: var(--blue-500); }
.list-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.list-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.list-card-meta i { width: 14px; height: 14px; }
.list-card-loc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.list-card-loc i { width: 14px; height: 14px; }

.list-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-2);
  min-width: 140px;
}
.list-card-price {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--blue-700);
  white-space: nowrap;
}
[data-theme="dark"] .list-card-price,
[data-theme="ocean"] .list-card-price { color: var(--blue-500); }
/* Fiyat/m² — fiyatin hemen altinda, sade gri (danismanin karsilastirma metrigi). */
.list-card-m2 { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; margin-top: -2px; }
/* "Yeni" rozeti — Sahibinden tarzi kucuk vurgu (marka sarisi), gorselin sag ustunde. */
.list-card-yeni {
  position: absolute; top: 6px; right: 6px;
  background: var(--accent, #FFB400); color: #1a1a1a;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-xs);
  letter-spacing: 0.2px;
}
.list-card-date {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.list-card-actions {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 120ms ease;
}
.list-card-actions .btn { padding: 4px 8px; font-size: var(--fs-xs); }

@media (max-width: 640px) {
  .list-card {
    grid-template-columns: 96px 1fr;
    grid-template-areas: "img body" "img right";
    gap: var(--s-3);
  }
  .list-card-img { width: 96px; height: 96px; grid-area: img; }
  .list-card-body { grid-area: body; }
  .list-card-right { grid-area: right; flex-direction: row; align-items: center; justify-content: space-between; min-width: 0; }
  .list-card-actions { position: static; opacity: 1; transform: none; }
}

/* ===== Anket puan rozeti (Arama Takibi) — puana gore dikkat cekici renk ===== */
.puan-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  min-width: 40px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  letter-spacing: .2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.20);
}
.puan-badge small { font-size: 9px; font-weight: 700; opacity: .85; }
.puan-great { background: linear-gradient(135deg, #10B981, #047857); }   /* 9-10: mukemmel */
.puan-good  { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }   /* 7-8: iyi */
.puan-mid   { background: linear-gradient(135deg, #F59E0B, #B45309); }   /* 5-6: orta */
.puan-low   { background: linear-gradient(135deg, #EF4444, #B91C1C); }   /* 0-4: dusuk */
.puan-low   { animation: puan-alert 1.8s ease-in-out infinite; }         /* dusuk puan dikkat ceksin */
@keyframes puan-alert {
  0%, 100% { box-shadow: 0 2px 8px rgba(239,68,68,.35); }
  50%      { box-shadow: 0 0 0 4px rgba(239,68,68,.18); }
}
.puan-empty {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 4px 10px; border-radius: 999px;
  background: var(--gray-100, #f1f5f9); color: var(--gray-400, #9ca3af);
  font-weight: 600; font-size: 13px;
}
[data-theme="dark"] .puan-empty { background: #1f2937; color: #6b7280; }

/* ===== Musteri statusu: 5 yildiz (Musteri listesi) ===== */
.star-rate { display: inline-flex; gap: 1px; white-space: nowrap; }
.star-rate .star {
  cursor: pointer;
  color: var(--gray-300, #d1d5db);
  font-size: 16px;
  line-height: 1;
  transition: color .12s, transform .12s;
}
.star-rate .star:hover { transform: scale(1.18); }
.star-rate .star.on { color: #f5a623; }        /* dolu yildiz: kehribar */
.star-rate-lg { gap: 4px; }
.star-rate-lg .star { font-size: 26px; }
[data-theme="dark"] .star-rate .star { color: #374151; }
[data-theme="dark"] .star-rate .star.on { color: #f5a623; }

/* Yildizi yuksek (4-5) musteriler: sicak temas onceligi vurgusu */
tr.row-vip { background: rgba(245, 166, 35, .06); }
tr.row-vip td:first-child { box-shadow: inset 3px 0 0 #f5a623; }
[data-theme="dark"] tr.row-vip { background: rgba(245, 166, 35, .08); }

/* ============================================================
   GOREV YONETIMI — Kanban board
   ============================================================ */
.kanban-board {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;   /* dar durumda ortala */
  overflow-x: auto;
  padding: 4px 2px 16px;
  scroll-snap-type: x proximity;
}
/* Masaustu/laptop: 4 kolon sayfayi TAM doldur (yatay kaydirma yok).
   Yuksek ozgulluk (.kanban-board .kanban-col) -> alttaki sabit-genislik kuralini yener. */
@media (min-width: 900px) {
  .kanban-board { overflow-x: visible; }
  .kanban-board .kanban-col { flex: 1 1 0; min-width: 0; }   /* esit buyur, tum genisligi kullan */
}
.kanban-col {
  flex: 0 0 340px;          /* dar ekranda daha genis 'peek' (300 -> 340) */
  background: var(--surface-2, #f7f9fc);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  transition: background .15s, box-shadow .15s, outline .15s;
}
.kanban-col.drag-over {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  background: var(--primary-light);
}
.kanban-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.kc-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.kanban-col-title { font-weight: 700; font-size: 14px; color: var(--text); }
.kanban-count {
  color: #fff; font-weight: 700; font-size: 11px;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}
.kanban-add {
  margin-left: auto; border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s;
}
.kanban-add:hover { background: var(--gray-100); color: var(--primary); }
.kanban-add i { width: 16px; height: 16px; }
.kanban-col-body {
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  min-height: 60px; max-height: calc(100vh - 260px); overflow-y: auto;
}
.kanban-empty {
  text-align: center; color: var(--text-muted); font-size: 13px;
  padding: 18px 8px; border: 1px dashed var(--border); border-radius: 10px;
}

/* Kart */
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: box-shadow .14s, transform .14s, border-color .14s;
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .5; }
.kanban-card.is-done .kc-title { text-decoration: line-through; color: var(--text-muted); }
.kc-top { display: flex; align-items: flex-start; gap: 8px; }
.kc-title { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; flex: 1; word-break: break-word; }
.kc-desc {
  font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kc-prio {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; text-transform: uppercase;
}
.prio-acil   { background: var(--danger-light);  color: var(--danger); }
.prio-yuksek { background: var(--warning-light); color: #B45309; }
.prio-normal { background: var(--primary-light); color: var(--primary-dark); }
.prio-dusuk  { background: var(--gray-100);      color: var(--text-muted); }
[data-theme="dark"] .prio-yuksek { color: var(--warning); }

.kc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.kc-assignee { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.kc-assignee-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.kc-assignee-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.kc-assignee-sube { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.kc-assignee-sube i { width: 10px; height: 10px; flex: 0 0 auto; }
.kc-unassigned { color: var(--text-muted); font-size: 12px; }
.kc-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  color: #fff; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.kc-avatar-empty { background: var(--gray-200); color: var(--text-muted); }
.kc-avatar-empty i { width: 13px; height: 13px; }
.kc-due {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); background: var(--gray-100); padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.kc-due i { width: 12px; height: 12px; }
.kc-due.overdue { background: var(--danger-light); color: var(--danger); }

@media (max-width: 768px) {
  .kanban-col { flex: 0 0 86vw; }
  .kanban-col-body { max-height: none; }
}

/* ============================================================
   BILDIRIM ZILI (header sag ust)
   ============================================================ */
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.header-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.notif-bell { position: relative; flex: none; }
/* Zil HTML'de header-actions'tan SONRA -> her yerde (mobil+web) EN SAGDA. */
.mobile-page-title { display: none; }

/* Kullanicilar tablosu — satir yukseklikleri esit; e-posta tek satir (ellipsis). */
.users-table td { vertical-align: middle; }
.users-table td:first-child div { min-width: 0; }
.users-table td:first-child small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-btn {
  position: relative; border: 1px solid var(--border); background: var(--surface);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s;
}
.notif-btn:hover { background: var(--gray-100); border-color: var(--border-strong); }
.notif-btn i { width: 19px; height: 19px; }
.notif-btn.has-unread { color: var(--primary); }
.notif-btn.has-unread i { animation: bell-swing 1.4s ease .2s 2; transform-origin: top center; }
@keyframes bell-swing {
  0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); }
  40% { transform: rotate(-10deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); }
}
.notif-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; display: none; align-items: center; justify-content: center;
  border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.notif-dropdown {
  position: absolute; top: 46px; right: 0; width: 340px; max-width: 90vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .14s, transform .14s, visibility .14s;
}
.notif-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text);
}
.notif-mark {
  border: none; background: transparent; color: var(--primary); font-size: 12px;
  font-weight: 600; cursor: pointer; padding: 2px 4px;
}
.notif-mark:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer; position: relative; transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: var(--primary-light); filter: brightness(.98); }
.notif-ic {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  background: var(--primary-light); color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.notif-ic i { width: 16px; height: 16px; }
.notif-body { min-width: 0; flex: 1; }
.notif-title { font-weight: 600; font-size: 13px; color: var(--text); }
.notif-msg { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.notif-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; }
.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 16px; color: var(--text-muted); font-size: 13px;
}
.notif-empty i { width: 26px; height: 26px; opacity: .6; }
@media (max-width: 768px) {
  .notif-dropdown { position: fixed; top: 58px; right: 8px; left: 8px; width: auto; max-width: none; }
}

/* ============================================================
   SANAL DRONE VIDEO modulu
   ============================================================ */
.sv-info {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--primary-light); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.5;
}
.sv-info i { width: 18px; height: 18px; flex: 0 0 auto; color: var(--primary); margin-top: 1px; }
.sv-info code, .sv-hint code { background: var(--gray-100); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.sv-hint {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--warning-light); color: #92400e; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
[data-theme="dark"] .sv-hint { color: var(--warning); }
.sv-hint i { width: 16px; height: 16px; flex: 0 0 auto; }

.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: stretch; }

/* ===== Sanal Drone video oynatici (modal) ===== */
.sv-player {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  max-height: 74vh;
}
.sv-player video {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  width: auto; height: auto;
  background: #000;
}
.sv-player-btn {
  position: absolute; z-index: 6;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(2px);
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.sv-player-btn:hover { background: rgba(0,0,0,.78); }
.sv-player-btn i { width: 20px; height: 20px; }
.sv-player-close { top: 10px; right: 10px; }
.sv-player-fs    { top: 10px; left: 10px; }
/* "Sesi Aç" overlay — sesli autoplay engellenirse ortada belirir, tek dokunusla ses */
.sv-unmute {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; z-index: 5;
  padding: 10px 18px; border: none; border-radius: 999px; cursor: pointer;
  background: rgba(10,77,198,.92); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35); animation: svPulse 1.6s ease-in-out infinite;
}
.sv-unmute:hover { background: rgba(10,77,198,1); }
.sv-unmute i { width: 18px; height: 18px; }
@keyframes svPulse { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.06); } }
/* Tam ekran: container tum ekrani kaplar, X ve FS butonu ustte gorunur kalir */
.sv-player:fullscreen,
.sv-player:-webkit-full-screen {
  width: 100vw; height: 100vh; max-height: none; border-radius: 0;
}
.sv-player:fullscreen video,
.sv-player:-webkit-full-screen video {
  max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; object-fit: contain;
}
.sv-player:fullscreen .sv-player-btn { width: 46px; height: 46px; }

/* Mobil: video tam genislik, butonlar dokunma dostu */
@media (max-width: 768px) {
  .sv-player { max-height: 62vh; border-radius: 10px; }
  .sv-player video { max-height: 62vh; }
  .sv-player-btn { width: 42px; height: 42px; }
  .sv-player-close { top: 8px; right: 8px; }
  .sv-player-fs { top: 8px; left: 8px; }
}
/* Kartlar esit yukseklik + butonlar en altta HIZALI (icerik farkli olsa da). */
.sv-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.sv-card .card-body { display: flex; flex-direction: column; flex: 1; }
.sv-card .card-body > .flex.gap-2 { margin-top: auto; }
.sv-thumb {
  position: relative; aspect-ratio: 16/10; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sv-thumb.ready { cursor: pointer; }
.sv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sv-thumb-empty { color: var(--text-muted); }
.sv-thumb-empty i { width: 34px; height: 34px; }
.sv-status { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; }
.sv-status i { width: 12px; height: 12px; }
.sv-play-badge {
  position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(10,77,198,.9); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.sv-play-badge i { width: 24px; height: 24px; margin-left: 2px; }
/* Baslik SABIT 2 satir (kisa/uzun fark etmeksizin ayni yukseklik -> kartlar hizali). */
.sv-title {
  font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.3; min-height: 2.6em;
}
.sv-firma {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
  color: var(--primary); margin-bottom: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%;
}
.sv-firma i { width: 12px; height: 12px; flex: 0 0 auto; }
.sv-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); }
.sv-meta span { display: inline-flex; align-items: center; gap: 5px; }
.sv-meta i { width: 12px; height: 12px; }
.sv-err { font-size: 12px; color: var(--danger); margin-top: 8px; }
.sv-wait { font-size: 12px; color: var(--text-muted); align-self: center; flex: 1; }
.sv-progress { height: 6px; border-radius: 999px; background: var(--gray-100); overflow: hidden; margin-top: 8px; }
.sv-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 999px; transition: width .5s ease; }
.sv-progress-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--primary-dark); margin-top: 5px; font-weight: 600; }
.sv-progress-label i { width: 13px; height: 13px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Format (en-boy orani) secici */
.sv-ratio-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.sv-ratio-list { display: flex; flex-direction: column; gap: 10px; }
.sv-ratio {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; width: 100%;
  transition: border-color .12s, background .12s;
}
.sv-ratio:hover { border-color: var(--primary); background: var(--primary-light); }
.sv-ratio-box {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  background: var(--gray-100); color: var(--primary); border: 2px solid var(--border-strong); border-radius: 4px;
}
.sv-ratio-box.r-16-9 { width: 44px; height: 26px; }
.sv-ratio-box.r-9-16 { width: 26px; height: 44px; }
.sv-ratio-box.r-1-1  { width: 34px; height: 34px; }
.sv-ratio-box i { width: 15px; height: 15px; }
.sv-ratio-txt { flex: 1; display: flex; flex-direction: column; }
.sv-ratio-txt b { font-size: 14px; color: var(--text); }
.sv-ratio-txt small { font-size: 12px; color: var(--text-muted); }
.sv-ratio-tag { font-size: 12px; font-weight: 700; color: var(--primary-dark); background: var(--primary-light); padding: 3px 9px; border-radius: 6px; }
.sv-ap { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 4px; }
.sv-ap-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.sv-ap-label i { width: 15px; height: 15px; color: var(--primary); }
.sv-ap-label small { font-weight: 400; color: var(--text-muted); }
.sv-ap-row { display: flex; align-items: center; gap: 8px; }
.sv-ap-row input { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; }
.sv-ap-row span { color: var(--text-muted); font-weight: 700; }
/* Ada/parsel otomatik doldurma durumu (konumdan bulundu / bulunamadi / celiski) */
.sv-ap-durum { margin-top: 7px; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.sv-ap-durum:empty { display: none; }
.sv-ap-uyari { color: #b45309; }
[data-theme="dark"] .sv-ap-uyari { color: #fbbf24; }
.sv-ap-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.sv-ap-note i { width: 14px; height: 14px; color: var(--primary); }
.sv-qual { display: flex; gap: 8px; }
.sv-qual-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; transition: all .12s; }
.sv-qual-btn small { font-size: 10px; font-weight: 500; color: var(--text-muted); }
.sv-qual-btn:hover { border-color: var(--primary); }
.sv-qual-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sv-qual-btn.active small { color: rgba(255,255,255,.85); }
.sv-motor { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; margin-bottom: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.sv-motor input { margin-top: 3px; width: 16px; height: 16px; flex: 0 0 auto; cursor: pointer; }
.sv-motor span { display: flex; flex-direction: column; }
.sv-motor b { font-size: 13.5px; color: var(--text); }
.sv-motor small { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* Ilan secici (modal) */
.sv-pick-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.sv-pick-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: background .1s, border-color .1s;
}
.sv-pick-item:hover { background: var(--gray-50); border-color: var(--primary); }
.sv-pick-thumb {
  width: 46px; height: 46px; border-radius: 8px; flex: 0 0 auto; overflow: hidden;
  background: var(--gray-100); display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.sv-pick-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sv-pick-body { min-width: 0; flex: 1; }
.sv-pick-title { font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-pick-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-pick-item > i { width: 16px; height: 16px; color: var(--text-muted); flex: 0 0 auto; }
.sv-pick-empty { text-align: center; color: var(--text-muted); padding: 24px; font-size: 13px; }

/* ===== Yönetici Raporu (Arama Takibi popup) ===== */
.rapor-loading { text-align: center; padding: 48px 16px; color: var(--gray-500); }
.rapor-loading p { margin-top: 14px; font-size: 14px; }
.rapor { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; overflow-y: auto; }
.rapor-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.rapor-period-toggle { display: inline-flex; background: var(--gray-100, #f1f5f9); border-radius: 10px; padding: 3px; gap: 2px; }
.rapor-tab { border: none; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--gray-600, #475569); cursor: pointer; transition: all .15s; }
.rapor-tab.active { background: var(--surface); color: var(--primary, #003DA5); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
[data-theme="dark"] .rapor-tab.active { background: #0b3a86; color: #fff; }
.rapor-meta { font-size: 12px; color: var(--gray-500); }

.rapor-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rapor-kpi { background: var(--surface, #fff); border: 1px solid var(--gray-200, #e5e7eb); border-radius: 12px; padding: 16px; text-align: center; }
.rapor-kpi-val { font-size: 28px; font-weight: 800; color: var(--primary, #003DA5); line-height: 1.1; }
.rapor-kpi-lbl { font-size: 12px; color: var(--gray-500); margin-top: 4px; font-weight: 600; }
.rapor-kpi-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* Durum cipleri: En İyi kartlariyla ayni hizada (2. kolondan baslar) */
.rapor-durum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rapor-durum-inner { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 1100px) {
  .rapor-durum { grid-template-columns: 1fr; }
  .rapor-durum-inner { grid-column: auto; }
}
.rapor-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--gray-50,#f9fafb); border: 1px solid var(--gray-200,#e5e7eb); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
[data-theme="dark"] .rapor-chip { background: #1f2937; border-color: #374151; }

.rapor-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rapor-score { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface,#fff); border: 1px solid var(--gray-200,#e5e7eb); border-radius: 10px; padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--gray-600); }

.rapor-ai { border-radius: 14px; padding: 18px; color: #fff; background: linear-gradient(135deg, #003DA5, #1D4ED8 60%, #6D28D9); box-shadow: 0 6px 20px rgba(29,78,216,.28); }
.rapor-ai-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.rapor-ai-tag { margin-left: auto; font-size: 10px; font-weight: 700; background: rgba(255,255,255,.22); padding: 3px 9px; border-radius: 999px; }
.rapor-ai-ozet { margin: 10px 0 14px; font-size: 14px; line-height: 1.55; opacity: .97; }
.rapor-ai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rapor-hl { background: rgba(255,255,255,.12); border-radius: 10px; padding: 12px; backdrop-filter: blur(2px); }
.rapor-hl-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.rapor-hl ul { margin: 0; padding-left: 16px; }
.rapor-hl li { font-size: 12.5px; line-height: 1.5; margin-bottom: 5px; }
.rapor-hl.olumlu .rapor-hl-h { color: #6ef0b8; }
.rapor-hl.olumsuz .rapor-hl-h { color: #ffb3b3; }
.rapor-hl.oneri .rapor-hl-h { color: #ffe08a; }
.rapor-empty { font-size: 12px; opacity: .7; }

.rapor-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rapor-panel { background: var(--surface,#fff); border: 1px solid var(--gray-200,#e5e7eb); border-radius: 12px; padding: 14px; }
.rapor-panel-h { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; color: var(--gray-700,#374151); margin-bottom: 10px; }
.rapor-panel-h.good { color: #059669; }
.rapor-panel-h.bad { color: #dc2626; }
.rapor-rank { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--gray-100,#f1f5f9); }
.rapor-rank:last-child { border-bottom: none; }
.rapor-rank-no { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--gray-400); }
.rapor-rank-no.good { background: linear-gradient(135deg,#10B981,#059669); }
.rapor-rank-no.bad { background: linear-gradient(135deg,#EF4444,#B91C1C); }
.rapor-rank-body { min-width: 0; flex: 1; }
.rapor-rank-main { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.rapor-rank-sub { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

.rapor-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rapor-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--gray-500); padding: 6px 8px; border-bottom: 1px solid var(--gray-200,#e5e7eb); }
.rapor-table td { padding: 8px; border-bottom: 1px dashed var(--gray-100,#f1f5f9); }

.rapor-gb { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 240px; overflow-y: auto; }
.rapor-gb-item { background: var(--gray-50,#f9fafb); border-left: 3px solid var(--primary,#003DA5); border-radius: 8px; padding: 10px 12px; }
[data-theme="dark"] .rapor-gb-item { background: #1f2937; }
.rapor-gb-q { font-size: 11px; color: var(--gray-500); margin-bottom: 3px; }
.rapor-gb-a { font-size: 13px; font-style: italic; line-height: 1.45; }
.rapor-gb-m { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; font-weight: 600; }

@media (max-width: 760px) {
  .rapor-kpis, .rapor-durum { grid-template-columns: repeat(2, 1fr); }
  .rapor-scores, .rapor-ai-grid, .rapor-grid2, .rapor-gb { grid-template-columns: 1fr; }
}

/* ===== PORTFOY HARITA — Sahibinden tarzi fiyat pin'i ===== */
.map-price-pin span {
  position: relative;
  display: inline-block;
  background: var(--primary, #0A4DC6);
  color: #fff;
  padding: 3px 9px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.35);
  transform: translate(-50%, -100%);
  cursor: pointer;
}
.map-price-pin span::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -5px; margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--primary, #0A4DC6);
}
/* Leaflet popup ic butonu tasmasin */
.leaflet-popup-content { margin: 10px 12px; }

/* ===== Abonelik & Paketler (Billing) ===== */
.bill-wrap { max-width: 1200px; margin: 0 auto; }
.bill-head { margin-bottom: 18px; }
.bill-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.bill-sub { color: var(--gray-500); font-size: 14px; margin: 0; }

.bill-controls {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--gray-100); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.bill-seats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bill-ctl-lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.bill-ctl-lbl i { width: 16px; height: 16px; }
.bill-stepper { display: inline-flex; align-items: center; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 8px; overflow: hidden; }
.bill-stepper button { width: 34px; height: 36px; border: none; background: var(--gray-100); font-size: 18px; cursor: pointer; color: var(--gray-600, #4b5563); }
.bill-stepper button:hover { background: var(--gray-200, #e5e7eb); }
.bill-stepper input { width: 58px; height: 36px; border: none; text-align: center; font-size: 15px; font-weight: 600; -moz-appearance: textfield; }
.bill-stepper input::-webkit-outer-spin-button, .bill-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bill-bracket { font-size: 12px; color: var(--gray-500); background: var(--gray-100); padding: 4px 10px; border-radius: 999px; }

.bill-durs { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.bill-dur {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 14px; border: 1.5px solid var(--gray-200, #e5e7eb); border-radius: 10px;
  background: var(--surface); cursor: pointer; transition: all .15s;
}
.bill-dur:hover { border-color: var(--accent); }
.bill-dur.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.bill-dur-ad { font-weight: 700; font-size: 14px; }
.bill-dur-not { font-size: 11px; color: var(--gray-500); }

.bill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .bill-grid { grid-template-columns: repeat(2, 1fr); } .bill-controls { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .bill-grid { grid-template-columns: 1fr; } }

.bill-card {
  position: relative; background: var(--surface); border: 1.5px solid var(--gray-100);
  border-radius: 14px; padding: 20px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; border-top: 4px solid var(--tier, var(--blue-500));
}
.bill-card.featured { box-shadow: 0 8px 28px rgba(10,77,198,.16); border-color: color-mix(in srgb, var(--tier) 40%, transparent); }
.bill-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bill-card-ikon { width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.bill-card-ikon i { width: 22px; height: 22px; }
.bill-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff; background: var(--tier, var(--blue-500)); }
.bill-card-ad { font-size: 20px; font-weight: 800; }
.bill-card-hedef { font-size: 12.5px; color: var(--gray-500); margin-bottom: 6px; }

.bill-price { display: flex; align-items: baseline; gap: 6px; }
.bill-price-val { font-size: 28px; font-weight: 800; color: var(--tier, var(--blue-500)); }
.bill-price-unit { font-size: 12px; color: var(--gray-500); }
.bill-ind { display: inline-block; font-size: 11px; font-weight: 700; color: #16a34a; background: #16a34a1a; padding: 2px 8px; border-radius: 999px; margin-top: 6px; }
.bill-price-tot { font-size: 12.5px; color: var(--gray-600, #4b5563); margin: 8px 0 2px; }
.bill-price-donem { display: block; color: var(--gray-500); font-size: 11.5px; }
/* min-height: en uzun limit (Diamond ~3 satir) — tum kartlarda fiyat kutusu ayni dikey hizada */
.bill-limit { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--gray-500); margin: 4px 0 8px; min-height: 50px; }
.bill-limit i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.bill-select { width: 100%; justify-content: center; margin-top: 16px; }

/* Firma bazli paketler — kontrol seridi + firma-ici limit listesi */
.bill-controls-firma { justify-content: center; gap: 24px; }
.bill-firma-note { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--tier, var(--blue-500)); background: var(--gray-100); padding: 8px 16px; border-radius: 999px; }
.bill-firma-note i { width: 18px; height: 18px; }
.bill-limit-list { list-style: none; margin: 8px 0 10px; padding: 10px 12px; background: var(--gray-100); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 116px; }
.bill-limit-li { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--gray-600, #4b5563); font-weight: 500; }
.bill-limit-li i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: var(--tier, var(--blue-500)); }

.bill-feats { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.bill-feat { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; }
.bill-feat i, .bill-feat svg { width: 16px; height: 16px; flex-shrink: 0; display: block; margin-top: 2px; }
.bill-feat > span { flex: 1; min-width: 0; }
.bill-feat.yes i { color: #16a34a; }
.bill-feat.partial i { color: #d97706; }
.bill-feat.no { color: var(--gray-400); }
.bill-feat.no i { color: var(--gray-300, #d1d5db); }
.bill-feat-new { font-size: 9.5px; font-weight: 700; color: var(--tier, var(--blue-500)); background: color-mix(in srgb, var(--tier) 14%, transparent); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }

.bill-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 22px; padding: 14px 16px; background: var(--gray-100); border-radius: 12px;
  font-size: 12.5px; color: var(--gray-600, #4b5563);
}
.bill-foot i { width: 16px; height: 16px; flex-shrink: 0; }
.bill-foot-note { color: var(--gray-500); }

.bill-modal-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.bill-modal-total { border-bottom: none; font-size: 16px; padding-top: 12px; }
.bill-modal-note { margin-top: 14px; font-size: 12.5px; color: var(--gray-500); }

/* ===== n8n Otomasyon Senaryolari (Billing) ===== */
.n8n-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 820px) { .n8n-grid { grid-template-columns: 1fr; } }
.n8n-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--gray-100); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.n8n-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--blue-500);
}
.n8n-ico i { width: 19px; height: 19px; }
.n8n-ad { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.n8n-desc { font-size: 12.5px; color: var(--gray-500); margin-top: 3px; line-height: 1.4; }
.n8n-tier { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; }
.n8n-tier-gold { background: #eab308; }
.n8n-tier-platinum { background: #0A4DC6; }
.n8n-tier-diamond { background: #7c3aed; }

/* ===== Billing: belirgin toplam fiyat kutusu ===== */
.bill-total-box {
  margin: 2px 0 12px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--tier, #0A4DC6) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier, #0A4DC6) 22%, transparent);
  text-align: center;
}
.bill-total-lbl { font-size: 12.5px; color: var(--gray-500); margin-bottom: 2px; }
.bill-total-main {
  font-size: 30px; font-weight: 800; line-height: 1.1;
  color: var(--tier, #0A4DC6); letter-spacing: -.5px;
}
.bill-total-main span { font-size: 15px; font-weight: 600; color: var(--gray-500); }
.bill-total-donem { font-size: 13px; color: var(--gray-600, #4b5563); margin-top: 3px; }
.bill-total-donem strong { color: var(--gray-800, #1f2937); }

.bill-min { font-style: normal; font-size: 11px; font-weight: 500; color: var(--gray-400); }

/* Firmalar - platform logosu (favicon), tum platformlar ayni olcekte */
.platform-logo {
  width: 22px; height: 22px; object-fit: contain;
  border-radius: 5px; vertical-align: middle;
  background: #fff; padding: 1px;
  box-shadow: 0 0 0 1px var(--gray-100);
}

.platform-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; min-width: 118px; }
.platform-cell .platform-logo { flex-shrink: 0; }
.platform-name { font-size: 13px; font-weight: 500; color: var(--gray-700, #374151); white-space: nowrap; }

/* ===== Global loading (ev ikonu + donen halka) ===== */
.global-loading {
  position: fixed; inset: 0; z-index: 5000; display: none;
  align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.28); backdrop-filter: blur(2px);
  animation: glFade .15s ease-out;
}
.global-loading.show { display: flex; }
.gl-box {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: var(--surface, #fff); padding: 24px 34px; border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}
.gl-spin { position: relative; width: 74px; height: 74px; display: flex; align-items: center; justify-content: center; }
.gl-spin::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--gray-100, #eef2f7);
  border-top-color: var(--accent, #FFD23F);
  border-right-color: var(--blue-500, #0A4DC6);
  animation: glSpin .8s linear infinite;
}
.gl-house { width: 34px; height: 34px; color: var(--blue-500, #0A4DC6); animation: glPulse 1.15s ease-in-out infinite; }
.gl-text { font-size: 14px; font-weight: 600; color: var(--gray-600, #475569); letter-spacing: .2px; }
/* Inline/sayfa yuklemesi icin kutusuz "loading home" (page-loading icinde ortalanir) */
.gl-inline { display: flex; flex-direction: column; align-items: center; gap: 12px; }
@keyframes glSpin { to { transform: rotate(360deg); } }
@keyframes glPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.14); opacity: .65; } }
@keyframes glFade { from { opacity: 0; } to { opacity: 1; } }

/* ===== Firma Paleti — eşit boyutlu grid (web 5 sütun, responsive) ===== */
.firma-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 1400px) { .firma-palette-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1120px) { .firma-palette-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .firma-palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .firma-palette-grid { grid-template-columns: 1fr; } }
.firma-chip {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); user-select: none;
}
.firma-chip .fc-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firma-chip .fc-tag { flex: none; }

/* =========================================================================
   YARDIM MASASI (Help Desk)
   ========================================================================= */
.hd-new-inline { display: none; }   /* masaustunde header-actions'taki buton yeter */

.hd-filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--s-3); }
.hd-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
}
.hd-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.hd-filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.hd-filter-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(0,0,0,.08); color: inherit;
}
.hd-filter-btn.active .hd-filter-count { background: rgba(255,255,255,.25); }

.hd-card { transition: border-color .12s, box-shadow .12s; }
.hd-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,.06); }

.hd-kat-ico {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
}
.hd-kat-ico i { width: 20px; height: 20px; }
.hd-kat-hata  { background: var(--danger-light, #fee2e2); color: var(--danger, #dc2626); }
.hd-kat-oneri { background: var(--blue-50); color: var(--blue-700); }
.hd-kat-soru  { background: #ede9fe; color: #7c3aed; }
.hd-kat-diger { background: var(--bg); color: var(--text-muted); }

/* Form: iki sutunlu satir */
.hd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.hd-form-row .form-group { margin-bottom: 0; }

/* Ekran goruntusu dropzone */
.hd-drop {
  border: 2px dashed var(--border); border-radius: var(--r-md);
  background: var(--bg); cursor: pointer; transition: border-color .12s, background .12s;
  overflow: hidden;
}
.hd-drop:hover, .hd-drop.dragover { border-color: var(--primary); background: var(--primary-light); }
.hd-drop-empty {
  padding: 22px 16px; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.hd-drop-empty i { width: 26px; height: 26px; }
.hd-drop-empty div { font-size: var(--fs-sm); }
.hd-drop-empty small { font-size: var(--fs-xs); opacity: .8; }
.hd-drop-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #000; }
.hd-drop-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; font-size: var(--fs-xs); color: var(--text-muted);
}

/* Detay */
.hd-detail { display: flex; flex-direction: column; gap: var(--s-4); }
.hd-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-detail-info { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); }
.hd-detail-info > div { display: inline-flex; align-items: center; gap: 5px; }
.hd-detail-info i { width: 13px; height: 13px; }
.hd-detail-block { }
.hd-detail-label {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); margin-bottom: 6px; display: inline-flex; align-items: center; gap: 6px;
}
.hd-detail-label i { width: 14px; height: 14px; }
.hd-detail-text { font-size: var(--fs-md); color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.hd-answer { background: var(--primary-light); border: 1px solid var(--primary); border-radius: var(--r-md); padding: 12px 14px; }
.hd-admin-panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; }
.hd-detail-shot { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: #000; }
.hd-detail-shot img { display: block; width: 100%; max-height: 420px; object-fit: contain; cursor: zoom-in; }
.hd-shot-loading { padding: 30px; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); background: var(--bg); }
.hd-del-btn { color: var(--danger, #dc2626); }
.hd-del-btn:hover { border-color: var(--danger, #dc2626); }

@media (max-width: 640px) {
  .hd-new-inline { display: inline-flex; }   /* mobilde header sikisik -> kart ici buton */
  .hd-form-row { grid-template-columns: 1fr; gap: 0; }
  .hd-form-row .form-group { margin-bottom: var(--s-3); }
}

/* AI Asistan — cevabi ureten saglayici etiketi (Asistan (groq)) */
.ai-prov {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-muted);
  opacity: .85;
  letter-spacing: .01em;
}

/* Satislar — tutar gizle/goster switch (bankacilik tarzi) */
#sales-mask-btn { gap: 6px; }
#sales-mask-btn[aria-pressed="true"] {
  border-color: var(--warning, #F59E0B);
  color: var(--warning, #F59E0B);
  background: var(--warning-light, rgba(245,158,11,.10));
}
#sales-mask-btn[aria-pressed="false"] {
  border-color: var(--success, #10B981);
  color: var(--success, #10B981);
  background: var(--success-light, rgba(16,185,129,.10));
}
@media (max-width: 640px) { #sales-mask-btn .sales-mask-lbl { display: none; } }

/* =========================================================================
   FSBO — "Sahibinden" (mulk sahibinden) ilan takibi
   ========================================================================= */
.fsbo-info { margin-bottom: var(--s-4); }
.fsbo-info .card-body { display: flex; align-items: center; gap: var(--s-3); }
.fsbo-info-ico {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--blue-50); color: var(--blue-700);
  display: inline-flex; align-items: center; justify-content: center;
}
.fsbo-info-t { font-size: var(--fs-sm); color: var(--text); }
.fsbo-info-s { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

.fsbo-grid { display: grid; grid-template-columns: 320px 1fr; gap: var(--s-4); align-items: start; }
.fsbo-col-title {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
  margin: 0 0 var(--s-2) 2px; display: flex; align-items: center; gap: 6px;
}
.fsbo-count {
  background: var(--bg-muted, rgba(0,0,0,.06)); color: var(--text-muted);
  border-radius: 999px; padding: 1px 7px; font-size: 11px;
}

/* --- Kayitli takipler (sol kolon) --- */
.fsbo-arama { margin-bottom: var(--s-2); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fsbo-arama:hover { border-color: var(--primary, #2563eb); }
.fsbo-arama.active { border-color: var(--primary, #2563eb); box-shadow: 0 0 0 1px var(--primary, #2563eb) inset; }
.fsbo-arama .card-body { padding: var(--s-3); }
.fsbo-arama-ad { font-weight: 600; font-size: var(--fs-sm); color: var(--text); line-height: 1.35; }
.fsbo-arama-meta {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  margin-top: 6px; font-size: var(--fs-xs); color: var(--text-muted);
}
.fsbo-arama-hata {
  margin-top: 6px; font-size: var(--fs-xs); color: var(--danger, #dc2626);
  background: var(--danger-light, rgba(220,38,38,.08));
  border-radius: 6px; padding: 5px 7px; line-height: 1.35;
}
.fsbo-arama-actions { display: flex; gap: 6px; margin-top: var(--s-2); }
.fsbo-arama-actions .btn { flex-shrink: 0; }
.fsbo-arama-actions .btn-primary { flex: 1; }
.fsbo-del:hover { color: var(--danger, #dc2626); }

.fsbo-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.fsbo-dot-idle { background: var(--text-muted); opacity: .5; }
.fsbo-dot-ok   { background: var(--success, #16a34a); }
.fsbo-dot-warn { background: var(--warning, #d97706); }
.fsbo-dot-err  { background: var(--danger, #dc2626); }
.fsbo-dot-run  { background: var(--primary, #2563eb); animation: fsbo-pulse 1.1s ease-in-out infinite; }
@keyframes fsbo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* --- Ilan paneli (sag kolon) --- */
.fsbo-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-3); margin-bottom: var(--s-3);
}
.fsbo-panel-ad { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.fsbo-panel-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; }
.fsbo-yeni-txt { color: var(--success, #16a34a); }

.fsbo-filtrebar {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-3); margin-bottom: var(--s-3);
  background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: var(--radius, 10px);
}
.fsbo-durum-grup { display: flex; gap: 4px; flex-wrap: wrap; }
.fsbo-filtre-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
}
.fsbo-filtre-btn:hover { border-color: var(--primary, #2563eb); color: var(--text); }
.fsbo-filtre-btn.active {
  background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff;
}
.fsbo-filtre-count { font-size: 10px; opacity: .75; }
.fsbo-filtre-alanlar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fsbo-ara { position: relative; flex: 1; min-width: 170px; height: 34px; display: flex; align-items: center; }
.fsbo-ara i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.fsbo-ara input { width: 100%; height: 34px; box-sizing: border-box; padding-left: 30px; margin: 0; }
.fsbo-num { width: 92px; }
.fsbo-num-sm { width: 84px; }
.fsbo-sel { min-width: 110px; }
.fsbo-filtre-alanlar input, .fsbo-filtre-alanlar select {
  height: 34px; box-sizing: border-box;   /* input & select AYNI yukseklik -> satir hizali */
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px;
  font-size: var(--fs-xs); background: var(--input-bg, #fff); color: var(--text);
}
.fsbo-filtre-alanlar .btn { height: 34px; box-sizing: border-box; }  /* Temizle butonu da ayni yukseklik */

/* --- Ilan kartlari --- */
.fsbo-kartlar { display: flex; flex-direction: column; gap: var(--s-2); }
.fsbo-kart {
  display: flex; align-items: stretch; gap: var(--s-3);
  background: var(--card-bg, #fff); border: 1px solid var(--border);
  border-radius: var(--radius, 10px); overflow: hidden; transition: box-shadow .15s;
}
.fsbo-kart:hover { box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.08)); }
.fsbo-kart.pasif { opacity: .55; }
.fsbo-kart-img { position: relative; width: 132px; min-height: 118px; flex-shrink: 0; background: var(--bg-muted, #f1f5f9); }
.fsbo-kart-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fsbo-img-yok {
  width: 100%; height: 100%; min-height: 96px;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); opacity: .45;
}
.fsbo-badge-yeni {
  position: absolute; top: 6px; left: 6px;
  background: var(--success, #16a34a); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 4px;
}
.fsbo-badge-pasif {
  position: absolute; top: 6px; left: 6px;
  background: var(--text-muted); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 4px;
}
.fsbo-kart-govde { flex: 1; min-width: 0; padding: var(--s-3) 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.fsbo-kart-baslik {
  font-weight: 600; font-size: var(--fs-sm); color: var(--text); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.fsbo-kart-fiyat { font-size: var(--fs-md); font-weight: 700; color: var(--primary, #2563eb); }
.fsbo-kart-ozet { display: flex; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); }
.fsbo-kart-ozet span { display: inline-flex; align-items: center; gap: 4px; }
.fsbo-kart-ozet i { width: 13px; height: 13px; }
.fsbo-kart-alt { display: flex; gap: var(--s-3); align-items: center; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.fsbo-ilanno { cursor: pointer; font-variant-numeric: tabular-nums; }
.fsbo-ilanno:hover { color: var(--primary, #2563eb); text-decoration: underline; }
.fsbo-kart-aksiyon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: var(--s-3); flex-shrink: 0; border-left: 1px solid var(--border);
}
.fsbo-tel-not { font-size: 10px; color: var(--text-muted); text-align: center; }

/* --- Yeni takip formu --- */
.fsbo-form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.fsbo-form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-3); }
.fsbo-hint { font-weight: 400; color: var(--text-muted); font-size: var(--fs-xs); }
.fsbo-url-box {
  background: var(--bg-muted, #f8fafc); border: 1px solid var(--border);
  border-radius: 8px; padding: var(--s-3); margin-top: var(--s-2);
}
.fsbo-url-label {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-bottom: 6px;
}
.fsbo-url-label i { width: 14px; height: 14px; }
.fsbo-url {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--fs-xs); color: var(--text); word-break: break-all; line-height: 1.5;
}
.fsbo-url.err { color: var(--danger, #dc2626); }
.fsbo-url-note { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 7px; line-height: 1.45; }
.fsbo-empty-sm { padding: var(--s-5) var(--s-3); }

/* --- Mobil --- */
.fsbo-new-inline { flex-shrink: 0; }
@media (max-width: 900px) {
  .fsbo-grid { grid-template-columns: 1fr; }
  .fsbo-form-row, .fsbo-form-row3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .fsbo-new-inline { display: none; }
  .fsbo-kart { flex-direction: column; }
  .fsbo-kart-img { width: 100%; height: 150px; }
  .fsbo-kart-govde { padding: var(--s-3); }
  .fsbo-kart-aksiyon { border-left: none; border-top: 1px solid var(--border); flex-direction: row; gap: var(--s-3); }
  .fsbo-ara { min-width: 100%; }
}

/* ScrapingBee key kredi durumu (Ayarlar > Tarama Yontemi) */
.sb-kredi { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.sb-kredi-yukl { font-size: var(--fs-xs); color: var(--text-muted); }
.sb-kredi-row {
  display: grid; grid-template-columns: minmax(115px, auto) minmax(60px, 1fr) minmax(300px, auto);
  align-items: center; gap: 10px;
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px;
  font-size: var(--fs-xs); background: var(--bg-muted, #f8fafc);
}
.sb-kredi-key { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); }
.sb-kredi-bar {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--border); display: block; min-width: 60px;
}
.sb-kredi-bar i { display: block; height: 100%; border-radius: 999px; background: var(--success, #16a34a); }
.sb-kredi-txt { color: var(--text-muted); text-align: right; white-space: nowrap; }
.sb-kredi-row.az   { border-color: var(--warning, #d97706); }
.sb-kredi-row.az   .sb-kredi-bar i { background: var(--warning, #d97706); }
.sb-kredi-row.az   .sb-kredi-txt b { color: var(--warning, #d97706); }
.sb-kredi-row.bitti { border-color: var(--danger, #dc2626); opacity: .8; }
.sb-kredi-row.bitti .sb-kredi-bar i { background: var(--danger, #dc2626); }
.sb-kredi-row.bitti .sb-kredi-txt b { color: var(--danger, #dc2626); }
.sb-kredi-row.err  { border-color: var(--danger, #dc2626); }
.sb-kredi-hata { font-size: var(--fs-xs); color: var(--danger, #dc2626); }
@media (max-width: 640px) {
  .sb-kredi-row { grid-template-columns: 1fr; gap: 5px; }
  .sb-kredi-txt { text-align: left; }
}

/* =========================================================================
   KOMISYON RAPORU — sekmeler + AYIN YILDIZLARI (leaderboard/podyum)
   Sosyal medyada ekran goruntusu alinabilecek gorsel bir liderlik tablosu.
   ========================================================================= */
.kr-tabs {
  display: flex; gap: 4px; padding: 12px 20px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.kr-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: none; background: transparent; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.kr-tab i { width: 15px; height: 15px; }
.kr-tab:hover { color: var(--text); }
.kr-tab.active { color: var(--primary, #0A4DC6); border-bottom-color: var(--primary, #0A4DC6); }

/* --- Leaderboard govdesi --- */
.lb-wrap {
  padding: 20px 22px 24px;
  background: linear-gradient(180deg, rgba(10,77,198,.05), transparent 220px);
}
.lb-head { text-align: center; margin-bottom: 18px; }
.lb-head-ust {
  font-size: 20px; font-weight: 900; letter-spacing: .12em; color: var(--primary, #0A4DC6);
}
.lb-head-donem { font-size: 13px; color: var(--text-muted); margin-top: 2px; text-transform: capitalize; }

.lb-blok { margin-bottom: 26px; }
.lb-baslik {
  display: flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px dashed var(--border, #e5e7eb);
}
.lb-baslik i { width: 17px; height: 17px; color: var(--primary, #0A4DC6); }
.lb-baslik small { font-weight: 500; font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* --- Podyum: 2. | 1. | 3.  (1. ortada, daha yuksek) --- */
.lb-podium {
  display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end;
}
.lb-p { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.lb-p.lb-bos { visibility: hidden; }
.lb-madalya { font-size: 22px; line-height: 1; }
.lb-1 .lb-madalya { font-size: 30px; }
.lb-av { position: relative; }
.lb-av-yok { width: 64px; height: 64px; border-radius: 50%; background: var(--bg-muted, #f1f5f9); }
.lb-ad {
  font-weight: 700; font-size: 13px; color: var(--text); line-height: 1.25;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-1 .lb-ad { font-size: 14.5px; }
.lb-deger { font-size: 13px; font-weight: 800; color: var(--primary, #0A4DC6); }
.lb-1 .lb-deger { font-size: 15px; }

/* Kaide yukseklikleri: 1. en yuksek */
.lb-kaide {
  width: 100%; border-radius: 10px 10px 0 0; margin-top: 4px;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 6px;
  font-weight: 900; color: #fff; font-size: 15px;
}
.lb-1 .lb-kaide { height: 64px; background: linear-gradient(180deg, #f5c518, #e0a800); }
.lb-2 .lb-kaide { height: 46px; background: linear-gradient(180deg, #c9ced6, #a8b0bb); }
.lb-3 .lb-kaide { height: 34px; background: linear-gradient(180deg, #d9a066, #bf8248); }

/* Altin/gumus/bronz halka */
.lb-1 .user-avatar { box-shadow: 0 0 0 3px #f5c518, 0 6px 16px rgba(0,0,0,.18) !important; }
.lb-2 .user-avatar { box-shadow: 0 0 0 3px #c9ced6, 0 4px 12px rgba(0,0,0,.12) !important; }
.lb-3 .user-avatar { box-shadow: 0 0 0 3px #d9a066, 0 4px 12px rgba(0,0,0,.12) !important; }

/* --- 4. ve sonrasi --- */
.lb-kalan { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.lb-kalan-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 8px; background: var(--bg-muted, #f8fafc); font-size: 13px;
}
.lb-kalan-sira {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border, #e5e7eb); color: var(--text-muted); font-size: 11px; font-weight: 700;
}
.lb-kalan-ad { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lb-kalan-deger { font-weight: 700; color: var(--text); }

.lb-alt {
  text-align: center; font-size: 11.5px; color: var(--text-muted);
  border-top: 1px solid var(--border, #e5e7eb); padding-top: 12px;
}

@media (max-width: 560px) {
  .lb-podium { gap: 6px; }
  .lb-ad { font-size: 11.5px; }
  .lb-1 .lb-ad { font-size: 12.5px; }
  .lb-deger { font-size: 11.5px; }
  .lb-1 .lb-deger { font-size: 13px; }
  .lb-head-ust { font-size: 17px; }
}


/* =========================================================================
   COKLU SECIM (talep: oda tipi + mahalle)
   NORMAL select + secildikce rozet. Onceki ozel checkbox paneli form alanina
   sikisip mahalle adlarini kirpiyordu ("19 ...", "Ak..."); native acilir liste
   OS seviyesinde cizildigi icin bu sorun tamamen ortadan kalkar.
   Tema degiskenleri kullanilir; sabit renk YOK (koyu/ocean temada da dogru).
   ========================================================================= */
.ms { display: flex; flex-direction: column; gap: 6px; }

/* Secili degerler */
.ms-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
  background: var(--primary); color: #fff;
  border-radius: var(--r-pill); padding: 3px 4px 3px 10px;
  font-size: 12px; font-weight: 600; line-height: 1.35;
}
.ms-chip > button {
  border: none; background: none; cursor: pointer; color: inherit;
  font-size: 15px; line-height: 1; padding: 0 3px; opacity: .75; border-radius: 50%;
}
.ms-chip > button:hover { opacity: 1; background: rgba(255,255,255,.22); }

.ms-temizle {
  border: none; background: none; cursor: pointer; padding: 2px 4px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); border-radius: var(--r-sm);
}
.ms-temizle:hover { color: var(--danger); text-decoration: underline; }

/* Acilir liste diger form select'leriyle ayni gorunur (.form-group select zaten
   width/height/kenar veriyor). Secenek kalmayinca soluklasir. */
.ms-sec[disabled] { opacity: .65; cursor: default; }
