/* ============================================================
   Personel Takip — SaaS tasarım sistemi
   Logo mavisi (#3B56EB) tabanlı, göz yormayan açık tema.
   Bootstrap 5.3 üzerine katman: mevcut sınıflar çalışmaya
   devam eder, burada yalnızca görünümleri incelir.
   ============================================================ */

:root {
  /* Marka renkleri (logodan) */
  --pt-primary: #3b56eb;
  --pt-primary-hover: #2e45c9;
  --pt-primary-active: #2739a8;
  --pt-primary-soft: #eef1fe;   /* açık mavi zemin (aktif menü, vurgu) */
  --pt-primary-border: #c9d2f9;

  /* Nötr palet (TASARIM.md'deki kesin değerler) */
  --pt-bg: #f7f8fc;             /* sayfa zemini */
  --pt-surface: #ffffff;        /* kart / panel zemini */
  --pt-border: #e5e7eb;
  --pt-border-strong: #d6d9e0;
  --pt-text: #1a1d2b;
  --pt-text-muted: #6b7280;
  --pt-text-faint: #9aa2b1;

  /* Durum renkleri (yumuşatılmış) */
  --pt-success: #188a4f;
  --pt-success-soft: #e8f6ee;
  --pt-danger: #d33a3a;
  --pt-danger-soft: #fdeeee;
  --pt-warning: #b97a10;
  --pt-warning-soft: #fdf4e3;
  --pt-info: #2b6cb0;
  --pt-info-soft: #e9f2fb;

  /* Ölçüler */
  --pt-sidebar-width: 264px;
  --pt-topbar-height: 60px;
  --pt-radius: 12px;            /* TASARIM.md: 12px köşe yuvarlaklığı */
  --pt-radius-lg: 12px;
  --pt-shadow-sm: 0 1px 2px rgba(26, 29, 43, 0.05);
  --pt-shadow: 0 1px 3px rgba(26, 29, 43, 0.06), 0 4px 12px rgba(26, 29, 43, 0.05);
  --pt-shadow-lg: 0 8px 30px rgba(26, 29, 43, 0.12);
  --pt-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Bootstrap köprüleri */
  --bs-body-bg: var(--pt-bg);
  --bs-body-color: var(--pt-text);
  --bs-body-font-family: var(--pt-font);
  --bs-border-color: var(--pt-border);
  --bs-link-color: var(--pt-primary);
  --bs-link-hover-color: var(--pt-primary-hover);
}

/* ------------------------------------------------------------
   Temel
   ------------------------------------------------------------ */

html {
  height: 100%;
}

body {
  background-color: var(--pt-bg);
  color: var(--pt-text);
  font-family: var(--pt-font);
  font-size: 0.9375rem;
  line-height: 1.55;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--pt-text);
}

a {
  color: var(--pt-primary);
  text-decoration: none;
}

a:hover {
  color: var(--pt-primary-hover);
}

/* Sayfa içeriklerindeki başlık ikonları vurgu renginde */
h2 > i.fas, h2 > i.fa, h3 > i.fas, h3 > i.fa {
  color: var(--pt-primary);
  margin-right: 0.35rem;
}

/* ------------------------------------------------------------
   Uygulama iskeleti: sidebar + topbar + içerik
   ------------------------------------------------------------ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0; /* tabloların taşmasını engeller */
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1 1 auto;
  padding: 1.5rem 1.75rem 4.5rem;
}

@media (max-width: 767.98px) {
  .app-content {
    padding: 1rem 1rem 4.5rem;
  }
}

/* İçerideki eski .container'lar tam genişlik kullansın.
   Dikkat: padding sıfırlanmaz — .row'un negatif kenar boşlukları
   container padding'ine yaslanır, sıfırlanırsa yatay taşma olur. */
.app-content .container,
.app-content .container-fluid {
  max-width: 100%;
}

/* ------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------ */

/* Renk ve iç düzen her boyutta geçerli; konumlandırma yalnız masaüstünde.
   Mobilde (<992px) Bootstrap offcanvas-lg konumu tamamen devralır. */
.app-sidebar {
  background: var(--pt-surface);
  border-right: 1px solid var(--pt-border);
  display: flex;
  flex-direction: column;
  --bs-offcanvas-width: var(--pt-sidebar-width);
}

@media (min-width: 992px) {
  .app-sidebar,
  .app-sidebar.offcanvas-lg {
    width: var(--pt-sidebar-width);
    flex: 0 0 var(--pt-sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1030;
    transform: none;
    visibility: visible;
    /* Bootstrap offcanvas-lg ≥992px'te 'transparent !important' uygular;
       sidebar'ın beyaz zemini bunu geri almak zorunda. */
    background-color: var(--pt-surface) !important;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--pt-border);
  color: var(--pt-text);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  min-height: var(--pt-topbar-height);
}

.sidebar-brand:hover {
  color: var(--pt-primary);
}

.sidebar-brand img {
  height: 30px;
  width: auto;
}

.sidebar-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--pt-primary);
  color: #fff;
  font-size: 0.95rem;
}

.sidebar-nav {
  flex: 1 1 auto;
  padding: 0.85rem 0.75rem;
}

.sidebar-heading {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pt-text-faint);
  padding: 1.1rem 0.75rem 0.35rem;
  margin: 0;
}

/* 13 Eyl 2026: menü çok büyüdüğü için ana başlıklar açılır-kapanır oldu.
   Başlık artık gerçek bir <button> (data-bs-toggle="collapse") — tipografisi
   .sidebar-heading'den gelir, burada yalnız düğme varsayılanları sıfırlanır
   ve sol ikon / sağ ok yerleşimi verilir. */
.sidebar-grup-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  /* 15 Eyl 2026 (kullanıcı: "alt menüler üst menüden büyük"): başlık artık
     ana öğe — eski küçük büyük-harfli etiket tipografisi yerine linklerden
     büyük, koyu ve normal harfli; alt linkler daha küçük ve içeriden. */
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--pt-text);
  padding: 0.55rem 0.75rem;
  margin-top: 0.35rem;
}

.sidebar-grup-btn:hover {
  background: var(--pt-bg);
}

/* Sol ikon: nav-link ikonlarıyla AYNI genişlikte (1.15rem) — böylece grup
   başlığı ile altındaki linklerin ikonları aynı eksende durur. */
.sidebar-grup-btn > i {
  width: 1.15rem;
  flex: 0 0 1.15rem;
  text-align: center;
  font-size: 1rem;
  color: var(--pt-text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.sidebar-grup-btn .sidebar-grup-ad {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-grup-btn:hover,
.sidebar-grup-btn:hover > i {
  color: var(--pt-text);
}

/* Klavye odağı görünür olmalı (menü artık düğmelerle geziliyor) */
.sidebar-grup-btn:focus-visible {
  outline: 2px solid var(--pt-primary);
  outline-offset: 2px;
}

/* Sağdaki ok: kapalıyken aşağı bakar, açıkken 180° döner.
   Seçici .sidebar-grup-btn > .sidebar-grup-ok, yukarıdaki > i kuralından
   daha belirgindir — !important gerekmez. */
.sidebar-grup-btn > .sidebar-grup-ok {
  margin-left: auto;
  width: auto;
  flex: 0 0 auto;
  font-size: 0.7rem;
}

/* Grup başlığındaki toplam rozeti (okunmamış sohbet / bekleyen hatırlatıcı)
   yalnız grup KAPALIYKEN görünür; JS inline display verdiği için !important. */
.sidebar-grup-btn > .sidebar-grup-rozet {
  margin-left: auto;
  font-size: 0.66rem;
}
.sidebar-grup-btn > .sidebar-grup-rozet + .sidebar-grup-ok {
  margin-left: 0.35rem;
}
.sidebar-grup-btn[aria-expanded="true"] > .sidebar-grup-rozet {
  display: none !important;
}
.sidebar-grup-btn[aria-expanded="true"] > .sidebar-grup-ok {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-grup-btn > i {
    transition: none;
  }
}

/* Grup gövdesi: linkler başlığın biraz içinden başlar, ikon hizası korunur.
   Seçici .sidebar-nav'ı da içerir: aşağıdaki '.sidebar-nav .nav-link' kuralı
   padding KISAYOLU kullandığı için eşit belirginlikte bir kural geçersiz kalırdı. */
.sidebar-nav .sidebar-grup .nav-link {
  padding: 0.42rem 0.75rem 0.42rem 1.9rem;
  font-size: 0.84rem;
  font-weight: 500;
}

.sidebar-nav .sidebar-grup .nav-link i {
  font-size: 0.85rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.52rem 0.75rem;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--pt-text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-link i {
  width: 1.15rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--pt-text-faint);
  transition: color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
  background: var(--pt-bg);
  color: var(--pt-text);
}

.sidebar-nav .nav-link:hover i {
  color: var(--pt-text-muted);
}

.sidebar-nav .nav-link.active {
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
}

.sidebar-nav .nav-link.active i {
  color: var(--pt-primary);
}

.sidebar-footer {
  border-top: 1px solid var(--pt-border);
  padding: 0.85rem 1rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.25rem;
}

.sidebar-user .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.sidebar-user .user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pt-text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .user-role {
  font-size: 0.75rem;
  color: var(--pt-text-muted);
}

/* ------------------------------------------------------------
   Topbar
   ------------------------------------------------------------ */

.app-topbar {
  height: var(--pt-topbar-height);
  background: var(--pt-surface);
  border-bottom: 1px solid var(--pt-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-toggle {
  border: 1px solid var(--pt-border);
  background: var(--pt-surface);
  color: var(--pt-text-muted);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-toggle:hover {
  background: var(--pt-bg);
  color: var(--pt-text);
}

.topbar-datetime {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--pt-text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.topbar-datetime .badge-week {
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topbar-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pt-text-muted);
  border: none;
  background: transparent;
  font-size: 1rem;
}

.topbar-icon-btn:hover {
  background: var(--pt-bg);
  color: var(--pt-text);
}

/* Üst çubuk metinli düğme ("Dışa aktar"): ikon düğmesiyle aynı yükseklik/renk,
   ince çerçeve; mobilde yalnız ikon (metin d-none d-md-inline) */
.topbar-text-btn {
  height: 38px;
  padding: 0 0.7rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pt-text-muted);
  background: transparent;
  border: 1px solid var(--pt-border);
  white-space: nowrap;
}
.topbar-text-btn:hover,
.topbar-text-btn[aria-expanded="true"] {
  background: var(--pt-bg);
  color: var(--pt-text);
  border-color: var(--pt-border-strong);
}
@media (max-width: 767.98px) {
  .topbar-text-btn { width: 38px; padding: 0; justify-content: center; }
}
.export-menu {
  min-width: 310px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 72px);   /* üst çubuğun altında kalan alan; taşarsa kaydırır */
  overflow-y: auto;
}
.export-menu .dropdown-item {
  padding: 0.3rem 0.65rem;          /* 17 öğe + 4 grup masaüstünde kaydırmasız sığsın */
}
.export-menu-baslik {
  font-weight: 600;
  color: var(--pt-text);
  padding: 0.35rem 0.65rem 0.5rem;
}
.export-menu-grup {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pt-text-faint);
  padding: 0.55rem 0.65rem 0.2rem;
}
/* Dönem seçici (menünün üstü) */
.export-donem { padding: 0 0.65rem 0.6rem; border-bottom: 1px solid var(--pt-border); margin-bottom: 0.25rem; }
.export-donem .export-menu-grup { padding-left: 0; padding-right: 0; }
.export-donem-etiket {
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.35rem;
  color: var(--pt-primary);
  font-weight: 600;
}
.export-onayarlar { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.export-onayar {
  border: 1px solid var(--pt-border);
  background: var(--pt-surface);
  color: var(--pt-text);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.1rem 0.55rem;
}
.export-onayar:hover,
.export-onayar:focus-visible,
.export-onayar.active {
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  border-color: var(--pt-primary-border);
}
.export-donem-ikon { color: var(--pt-text-faint); font-size: 0.75rem; }
.export-rozet {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  white-space: nowrap;
}
.export-menu-not {
  font-size: 0.75rem;
  color: var(--pt-text-muted);
  padding: 0.3rem 0.65rem 0.2rem;
  white-space: normal;
}

/* ------------------------------------------------------------
   Ö13.7 — Gönderim paylaşımı: modal seçenek satırları
   (partials/_gonderim_table.html) ve şoförün girişsiz plan sayfası
   (paylasilan_gonderim.html)
   ------------------------------------------------------------ */
.paylas-secenek {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--pt-border);
}
.paylas-secenek:last-child { border-bottom: 0; }
.paylas-ikon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.paylas-ikon-marka { background: var(--pt-primary-soft); color: var(--pt-primary); }
.paylas-ikon-bilgi { background: var(--pt-info-soft); color: var(--pt-info); }
.paylas-ikon-tehlike { background: var(--pt-danger-soft); color: var(--pt-danger); }
.paylas-ikon-basari { background: var(--pt-success-soft); color: var(--pt-success); }
.paylas-govde { flex: 1 1 0; min-width: 0; }   /* taban 0: dar ekranda ikonun yanında kalır */
.paylas-baslik { font-weight: 600; }
.paylas-aciklama { font-size: 0.8rem; color: var(--pt-text-muted); }
.paylas-eylem {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.15rem;
}
.paylas-kisiler { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.paylas-kisi {
  border: 1px solid var(--pt-border);
  background: var(--pt-surface);
  color: var(--pt-text);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
}
.paylas-kisi:hover,
.paylas-kisi:focus-visible {
  background: var(--pt-primary-soft);
  border-color: var(--pt-primary-border);
  color: var(--pt-primary);
}
@media (max-width: 575.98px) {
  /* ikon + metin aynı satırda kalır, yalnız eylem düğmeleri alta iner */
  .paylas-secenek { flex-wrap: wrap; }
  .paylas-eylem { width: 100%; justify-content: flex-end; padding-top: 0; }
}
/* Şoför sayfası (girişsiz; base.html düzeni yok) */
.paylas-sayfa { background: var(--pt-bg); margin: 0; }
.paylas-kap { max-width: 720px; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; }
.paylas-marka {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--pt-text);
  margin-bottom: 1rem;
}
.paylas-marka img { height: 32px; width: auto; }
.paylas-kisi-satir {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--pt-border);
}
.paylas-kisi-satir:last-child { border-bottom: 0; }

/* Ö13.7 — tablo kolon sıralama (static/js/tablo_sirala.js) */
table[data-sirala] thead th.siralanabilir { cursor: pointer; user-select: none; white-space: nowrap; }
table[data-sirala] thead th.siralanabilir:hover { color: var(--pt-primary); }
table[data-sirala] thead.table-dark th.siralanabilir:hover { color: inherit; opacity: 0.85; }
.sirala-ok { margin-left: 0.3rem; opacity: 0.35; font-size: 0.75em; }
th.sirala-aktif .sirala-ok { opacity: 1; color: var(--pt-primary); }
thead.table-dark th.sirala-aktif .sirala-ok { color: inherit; }

/* Ö13.7 — üst çubuk global arama (static/js/ara.js) */
.topbar-ara { position: relative; flex: 1 1 auto; max-width: 440px; }
.topbar-ara-ikon {
  position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%);
  color: var(--pt-text-faint); font-size: 0.8rem; pointer-events: none;
}
.topbar-ara-girdi {
  width: 100%; height: 36px;
  border: 1px solid var(--pt-border); border-radius: 8px;
  background: var(--pt-bg); color: var(--pt-text);
  padding: 0 2.2rem 0 2rem; font-size: 0.85rem;
}
.topbar-ara-girdi:focus {
  outline: none; background: var(--pt-surface);
  border-color: var(--pt-primary-border); box-shadow: 0 0 0 3px var(--pt-primary-soft);
}
.topbar-ara-girdi::-webkit-search-cancel-button { -webkit-appearance: none; }
.topbar-ara-kisayol {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
  font-size: 0.65rem; color: var(--pt-text-faint);
  border: 1px solid var(--pt-border); border-radius: 4px; padding: 0 0.3rem; background: var(--pt-surface);
}
.topbar-ara-sonuc {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--pt-surface); border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius); box-shadow: var(--pt-shadow-lg);
  padding: 0.35rem; max-height: min(70vh, 520px); overflow-y: auto; z-index: 1050;
}
.topbar-ara-grup {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--pt-text-faint); padding: 0.5rem 0.6rem 0.15rem;
}
.topbar-ara-oge {
  display: flex; flex-direction: column; padding: 0.4rem 0.6rem; border-radius: 7px;
  color: var(--pt-text); text-decoration: none;
}
.topbar-ara-oge:hover, .topbar-ara-oge.aktif { background: var(--pt-bg); color: var(--pt-text); }
.topbar-ara-baslik { font-size: 0.85rem; font-weight: 500; }
.topbar-ara-alt { font-size: 0.74rem; color: var(--pt-text-muted); }
.topbar-ara-tumu {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.3rem; padding: 0.45rem 0.6rem; border-top: 1px solid var(--pt-border);
  font-size: 0.8rem; color: var(--pt-primary); text-decoration: none; border-radius: 0 0 7px 7px;
}
.topbar-ara-tumu:hover, .topbar-ara-tumu.aktif { background: var(--pt-primary-soft); }
.topbar-ara-bos { padding: 0.6rem; font-size: 0.8rem; color: var(--pt-text-muted); }

.topbar-icon-btn .notification-count {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.625rem;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  text-align: center;
}

/* ------------------------------------------------------------
   Kartlar, dropdownlar, modallar
   ------------------------------------------------------------ */

.card {
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-sm);
  background: var(--pt-surface);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--pt-border);
  font-weight: 600;
}

/* --- Eski şablonlardaki renkli kart/modal başlıklarını sadeleştir ---
   Şablonlara dokunmadan (design-only) CSS ile:
   - Dekoratif renkler (primary/info/secondary/dark/light) → düz beyaz başlık
   - Anlamsal renkler (success/warning/danger) → yumuşak tonlu zemin + renkli metin
   Bootstrap bg-* sınıfları !important kullandığı için burada da gerekli. */

.card-header.bg-primary, .modal-header.bg-primary,
.card-header.bg-info, .modal-header.bg-info,
.card-header.bg-secondary, .modal-header.bg-secondary,
.card-header.bg-dark, .modal-header.bg-dark,
.card-header.bg-light, .modal-header.bg-light {
  background-color: transparent !important;
  color: var(--pt-text) !important;
}

.card-header.bg-success, .modal-header.bg-success {
  background-color: var(--pt-success-soft) !important;
  color: var(--pt-success) !important;
}

.card-header.bg-warning, .modal-header.bg-warning {
  background-color: var(--pt-warning-soft) !important;
  color: var(--pt-warning) !important;
}

.card-header.bg-danger, .modal-header.bg-danger {
  background-color: var(--pt-danger-soft) !important;
  color: var(--pt-danger) !important;
}

/* Bu başlıkların içindeki beyaz metin/kapat düğmesi artık koyu zeminde değil */
.card-header[class*="bg-"] .text-white,
.modal-header[class*="bg-"] .text-white,
.card-header[class*="bg-"].text-white,
.modal-header[class*="bg-"].text-white {
  color: inherit !important;
}

.card-header[class*="bg-"] .btn-close-white,
.modal-header[class*="bg-"] .btn-close-white {
  filter: none !important;
}

.dropdown-menu {
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow-lg);
  padding: 0.4rem;
  font-size: 0.875rem;
}

.dropdown-item {
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
  color: var(--pt-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--pt-bg);
  color: var(--pt-text);
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
}

.dropdown-divider {
  border-color: var(--pt-border);
}

.modal-content {
  border: none;
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--pt-border);
}

.modal-footer {
  border-top: 1px solid var(--pt-border);
}

/* ------------------------------------------------------------
   Butonlar
   ------------------------------------------------------------ */

.btn {
  border-radius: 8px;
  font-weight: 500;
}

/* Varsayılan buton boyu — yalnız sm/lg OLMAYANLARA uygulanır.
   (Bu dosya Bootstrap'tan sonra yüklendiği için sınırsız bir .btn
   kuralı btn-sm/btn-lg değişkenlerini ezer; :not ile korunuyor.) */
.btn:not(.btn-sm):not(.btn-lg) {
  --bs-btn-padding-y: 0.45rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-font-size: 0.875rem;
}

/* KALICI KURAL (7 Eyl 2026): düğme metni ASLA satır kırmaz — uzun çevirilerde
   ("Bewerken", "Düzenle") düğme iki satıra çıkıp 49px oluyordu (İngilizce 30px).
   Bootstrap 5 nowrap vermez; burada tüm düğmeler için sabitlenir. */
.btn {
  white-space: nowrap;
}
/* Tablo eylem hücreleri içerik genişliğine oturur, düğme yan yana kalır */
.table td:has(> .btn), .table td:has(> .d-flex > .btn), .table td:has(> form > .btn),
.table td:has(> .btn-group) {
  white-space: nowrap;
  width: 1%;
}

/* KALICI KURAL (7 Eyl 2026): düğme ÜST SINIRI varsayılan boy — btn-lg
   uygulama içinde varsayılana sabitlenir (yalnız giriş/kayıt sayfaları hariç). */
.app-content .btn-lg {
  --bs-btn-padding-y: 0.45rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-font-size: 0.875rem;
  --bs-btn-border-radius: 8px;
}

/* Tablo satırları, kart başlıkları, liste öğeleri ve modal seçenek
   satırlarındaki eylem butonları şablonda btn-sm olmasa bile kompakt görünür. */
.table .btn:not(.btn-lg),
.card-header .btn:not(.btn-lg),
.list-group-item .btn:not(.btn-lg),
.paylas-secenek .btn:not(.btn-lg),
.acilir-baslik .btn:not(.btn-lg) {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.55rem;
  --bs-btn-font-size: 0.8125rem;
}

/* İstisna: bazı şablonlar modalı tablo hücresinin İÇİNE koyar
   (ör. gönderim paylaşım modalı) — diyalog butonları normal boyda kalır. */
.table .modal .btn:not(.btn-sm):not(.btn-lg) {
  --bs-btn-padding-y: 0.45rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-font-size: 0.875rem;
}

.btn:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(59, 86, 235, 0.25);
}

.btn-primary {
  --bs-btn-bg: var(--pt-primary);
  --bs-btn-border-color: var(--pt-primary);
  --bs-btn-hover-bg: var(--pt-primary-hover);
  --bs-btn-hover-border-color: var(--pt-primary-hover);
  --bs-btn-active-bg: var(--pt-primary-active);
  --bs-btn-active-border-color: var(--pt-primary-active);
  --bs-btn-disabled-bg: #97a6f2;
  --bs-btn-disabled-border-color: #97a6f2;
  --bs-btn-focus-shadow-rgb: 59, 86, 235;
}

.btn-outline-primary {
  --bs-btn-color: var(--pt-primary);
  --bs-btn-border-color: var(--pt-primary-border);
  --bs-btn-hover-bg: var(--pt-primary-soft);
  --bs-btn-hover-color: var(--pt-primary);
  --bs-btn-hover-border-color: var(--pt-primary);
  --bs-btn-active-bg: var(--pt-primary);
  --bs-btn-active-border-color: var(--pt-primary);
  --bs-btn-focus-shadow-rgb: 59, 86, 235;
}

.btn-secondary {
  --bs-btn-bg: #eef0f5;
  --bs-btn-border-color: #eef0f5;
  --bs-btn-color: var(--pt-text);
  --bs-btn-hover-bg: #e2e5ee;
  --bs-btn-hover-border-color: #e2e5ee;
  --bs-btn-hover-color: var(--pt-text);
  --bs-btn-active-bg: var(--pt-border-strong);
  --bs-btn-active-border-color: var(--pt-border-strong);
  --bs-btn-active-color: var(--pt-text);
}

.btn-success {
  --bs-btn-bg: var(--pt-success);
  --bs-btn-border-color: var(--pt-success);
  --bs-btn-hover-bg: #137243;
  --bs-btn-hover-border-color: #137243;
  --bs-btn-active-bg: #0f5f38;
  --bs-btn-active-border-color: #0f5f38;
}

.btn-danger {
  --bs-btn-bg: var(--pt-danger);
  --bs-btn-border-color: var(--pt-danger);
  --bs-btn-hover-bg: #b52f2f;
  --bs-btn-hover-border-color: #b52f2f;
  --bs-btn-active-bg: #9c2828;
  --bs-btn-active-border-color: #9c2828;
}

.btn-warning {
  --bs-btn-bg: #f0b433;
  --bs-btn-border-color: #f0b433;
  --bs-btn-hover-bg: #dda427;
  --bs-btn-hover-border-color: #dda427;
}

.btn-info {
  --bs-btn-bg: var(--pt-info);
  --bs-btn-border-color: var(--pt-info);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #245d99;
  --bs-btn-hover-border-color: #245d99;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
}

/* Arama gibi ikincil eylemlerdeki outline butonları sakinleştir */
.btn-outline-success,
.btn-outline-info,
.btn-outline-secondary {
  --bs-btn-color: var(--pt-text-muted);
  --bs-btn-border-color: var(--pt-border-strong);
  --bs-btn-hover-bg: var(--pt-primary);
  --bs-btn-hover-border-color: var(--pt-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--pt-primary-active);
  --bs-btn-active-border-color: var(--pt-primary-active);
  --bs-btn-active-color: #fff;
}

.btn-outline-danger {
  --bs-btn-color: var(--pt-danger);
  --bs-btn-border-color: #f0c4c4;
  --bs-btn-hover-bg: var(--pt-danger);
  --bs-btn-hover-border-color: var(--pt-danger);
}

/* ------------------------------------------------------------
   Formlar
   ------------------------------------------------------------ */

.form-control,
.form-select {
  border-color: var(--pt-border-strong);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  color: var(--pt-text);
}

.form-control::placeholder {
  color: var(--pt-text-faint);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--pt-primary);
  box-shadow: 0 0 0 0.2rem rgba(59, 86, 235, 0.15);
}

.form-label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--pt-text);
  margin-bottom: 0.3rem;
}

.form-check-input:checked {
  background-color: var(--pt-primary);
  border-color: var(--pt-primary);
}

.form-check-input:focus {
  border-color: var(--pt-primary);
  box-shadow: 0 0 0 0.2rem rgba(59, 86, 235, 0.15);
}

.input-group-text {
  background: var(--pt-bg);
  border-color: var(--pt-border-strong);
  color: var(--pt-text-muted);
}

.form-control[disabled],
.form-select[disabled] {
  background-color: var(--pt-bg);
  color: var(--pt-text-muted);
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   Tablolar
   ------------------------------------------------------------ */

.table {
  --bs-table-bg: var(--pt-surface);
  --bs-table-striped-bg: #fafbfd;
  --bs-table-hover-bg: var(--pt-primary-soft);
  border-color: var(--pt-border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  padding: 0.65rem 0.75rem;
}

.table thead th,
.table > thead {
  background: #fafbfd;
  color: var(--pt-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--pt-border);
  white-space: nowrap;
}

/* Eski şablonlardaki koyu/renkli tablo başlıklarını sakinleştir */
.table thead.table-dark,
.table thead.thead-dark,
.table .table-dark th {
  --bs-table-bg: #fafbfd;
  --bs-table-color: var(--pt-text-muted);
  background: #fafbfd;
  color: var(--pt-text-muted);
  border-color: var(--pt-border);
}

.table-responsive {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-sm);
}

.table-responsive > .table {
  margin-bottom: 0;
}

.table-bordered > :not(caption) > * > * {
  border-color: var(--pt-border);
}

/* ------------------------------------------------------------
   Sekmeler (nav-tabs) — modern "pill" görünümü
   ------------------------------------------------------------ */

.nav-tabs {
  border-bottom: 1px solid var(--pt-border);
  gap: 0.25rem;
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--pt-text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
}

.nav-tabs .nav-link:hover {
  color: var(--pt-text);
  background: var(--pt-bg);
  border-bottom-color: transparent;
}

.nav-tabs .nav-link.active {
  color: var(--pt-primary);
  background: transparent;
  border-bottom: 2px solid var(--pt-primary);
  font-weight: 600;
}

.nav-pills .nav-link {
  border-radius: 8px;
  color: var(--pt-text-muted);
  font-weight: 500;
}

.nav-pills .nav-link.active {
  background: var(--pt-primary);
}

/* ------------------------------------------------------------
   Uyarılar, rozetler, sayfalama
   ------------------------------------------------------------ */

.alert {
  border: 1px solid transparent;
  border-radius: var(--pt-radius);
  font-size: 0.9rem;
}

.alert-info {
  background: var(--pt-info-soft);
  border-color: #cfe3f6;
  color: #1e4e7c;
}

.alert-success {
  background: var(--pt-success-soft);
  border-color: #c4e8d3;
  color: #135f39;
}

.alert-danger {
  background: var(--pt-danger-soft);
  border-color: #f5cfcf;
  color: #8f2323;
}

.alert-warning {
  background: var(--pt-warning-soft);
  border-color: #f2e0b8;
  color: #7c5209;
}

.badge {
  font-weight: 600;
  border-radius: 999px;
  padding: 0.3em 0.7em;
}

.badge.bg-primary {
  background-color: var(--pt-primary) !important;
}

.pagination {
  --bs-pagination-color: var(--pt-text-muted);
  --bs-pagination-border-color: var(--pt-border);
  --bs-pagination-hover-color: var(--pt-primary);
  --bs-pagination-hover-bg: var(--pt-primary-soft);
  --bs-pagination-hover-border-color: var(--pt-border);
  --bs-pagination-focus-color: var(--pt-primary);
  --bs-pagination-focus-bg: var(--pt-primary-soft);
  --bs-pagination-active-bg: var(--pt-primary);
  --bs-pagination-active-border-color: var(--pt-primary);
  --bs-pagination-border-radius: 8px;
}

/* ------------------------------------------------------------
   Yükleme katmanı
   ------------------------------------------------------------ */

#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(246, 247, 251, 0.75);
  backdrop-filter: blur(2px);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  z-index: 9999;
}

.pt-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--pt-primary-soft);
  border-top-color: var(--pt-primary);
  border-radius: 50%;
  animation: pt-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .pt-spinner { animation-duration: 2.4s; }
}

.loading-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--pt-text-muted);
}

/* ------------------------------------------------------------
   Bildirim menüsü
   ------------------------------------------------------------ */

.notification-menu {
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
}

.notification-menu .dropdown-item {
  white-space: normal;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------
   Giriş / kayıt ekranları (kimlik doğrulamasız düzen)
   ------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(59, 86, 235, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(59, 86, 235, 0.06), transparent 55%),
    var(--pt-bg);
}

.auth-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
}

.auth-body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  /* 13 Eyl 2026: .auth-body içindeki .w-100 sarmalayıcı blok olduğu için
     kart yalnız login.html'deki d-flex sarmalayıcıyla ortalanıyordu; 2FA
     doğrulama sayfası sola yaslı kalıyordu. Ortalama artık kartın kendisinde. */
  margin-left: auto;
  margin-right: auto;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 16px;
  box-shadow: var(--pt-shadow);
  padding: 2.25rem 2rem;
}

.auth-card .auth-logo {
  display: block;
  margin: 0 auto 1.25rem;
  max-height: 64px;
  width: auto;
}

.auth-card h1,
.auth-card h2 {
  font-size: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ------------------------------------------------------------
   Düzenleme kilidi (edit_personel / edit_house / edit_isyeri)
   Eski base.html'in <head> stilinden taşındı — bu sayfaların
   "Düzenle" butonu + form kilidi mekanizması bu sınıflara bağlı.
   ------------------------------------------------------------ */

.edit-buttons-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
  z-index: 20; /* Butonların overlay'in üzerinde görünmesi için */
}

.edit-form-container {
  position: relative;
}

.form-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 29, 43, 0.04);
  z-index: 10;
  pointer-events: none; /* Overlay altındaki elementlere tıklamaya izin ver */
  display: none;
}

.form-overlay.active {
  display: block;
}

#editButton {
  position: relative;
  z-index: 30;
  cursor: pointer !important;
}

/* ------------------------------------------------------------
   Küçük düzeltmeler
   ------------------------------------------------------------ */

/* Eski şablonlardaki yarı saydam beyaz kartlar tam beyaz olsun */
.app-content .card[style*="rgba(255, 255, 255"] {
  background: var(--pt-surface) !important;
}

hr {
  border-color: var(--pt-border);
  opacity: 1;
}

::selection {
  background: var(--pt-primary-soft);
  color: var(--pt-primary-active);
}

/* İnce kaydırma çubukları (WebKit) */
.app-sidebar::-webkit-scrollbar,
.notification-menu::-webkit-scrollbar {
  width: 6px;
}

.app-sidebar::-webkit-scrollbar-thumb,
.notification-menu::-webkit-scrollbar-thumb {
  background: var(--pt-border-strong);
  border-radius: 999px;
}

/* Odak görünürlüğü (klavye ile gezinme) */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--pt-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ==== Profil sayfası (/profil — sol alttaki kullanıcı kartından açılır) ==== */

/* Sidebar'ın sol altındaki kullanıcı kartı: ofis rollerinde <a> (profil
   sayfasına link), sürücü/personelde <span> (tıklanmaz). İki halde de
   avatar + isim bloğunu yan yana dizer. */
.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0; /* isim uzunsa üç nokta ile kısalabilsin */
  color: inherit;
  text-decoration: none;
  padding: 0.3rem 0.4rem;
  margin: -0.3rem -0.4rem; /* padding hizayı bozmasın diye geri alınır */
  border-radius: 10px;
}

/* Yalnız link halinde: üzerine gelince tıklanabilir olduğu belli olsun */
a.sidebar-user-link:hover {
  background: var(--pt-primary-soft);
}

a.sidebar-user-link:focus-visible {
  outline: 2px solid var(--pt-primary);
  outline-offset: -2px;
}

/* Sidebar alt kartındaki avatar fotoğrafla gösterilirse */
.sidebar-user .user-avatar-foto {
  object-fit: cover;
  background: none;
}

.profil-ozet {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--pt-border);
}

.profil-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

/* Fotoğraf yoksa baş harfli daire (sidebar'daki user-avatar'ın büyüğü) */
.profil-avatar-bas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  font-weight: 600;
  font-size: 1.5rem;
}

.profil-ad {
  font-weight: 600;
  color: var(--pt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rol rozeti — salt-okunur bilgi */
.profil-rol-rozet {
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  border: 1px solid var(--pt-primary-border);
  text-transform: capitalize;
}

.profil-bolum-baslik {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pt-text-muted);
  margin-bottom: 0.5rem;
}

.profil-form .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  color: var(--pt-text-muted);
}

/* ============================================================
   AI Asistan (/ai_chat — templates/ai_chat.html + static/js/ai_chat.js)
   Yalnız --pt-* token'ları; .asistan-* ön eki. Tam yükseklik reçetesi:
   topbar + .app-content dikey padding'i (1.5rem üst, 4.5rem alt) düşülür.
   ============================================================ */

.asistan {
  display: flex;
  height: calc(100vh - var(--pt-topbar-height) - 1.5rem - 4.5rem);
  height: calc(100dvh - var(--pt-topbar-height) - 1.5rem - 4.5rem);
  min-height: 420px;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-sm);
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .asistan {
    height: calc(100vh - var(--pt-topbar-height) - 1rem - 4.5rem);
    height: calc(100dvh - var(--pt-topbar-height) - 1rem - 4.5rem);
  }
}

/* ---- Sol kenar: sohbet listesi (≥992px sütun, altında offcanvas) ---- */
.asistan-kenar {
  display: flex;
  flex-direction: column;
  --bs-offcanvas-width: 272px;
  --bs-offcanvas-bg: var(--pt-surface);
}

@media (min-width: 992px) {
  .asistan-kenar,
  .asistan-kenar.offcanvas-lg {
    width: 272px;
    flex: 0 0 272px;
    height: auto;
    position: static;
    transform: none;
    visibility: visible;
    /* Bootstrap offcanvas-lg ≥992px'te 'transparent !important' uygular */
    background-color: var(--pt-bg) !important;
    border-right: 1px solid var(--pt-border) !important;
  }
}

.asistan-kenar-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.25rem;
}

.asistan-kenar-baslik {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pt-text-muted);
  margin: 0;
}

.asistan-kenar-yeni {
  padding: 0.5rem 1rem 0.75rem;
}

.asistan-kenar-liste {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0 0.6rem 0.75rem;
}

.asistan-kenar-bos {
  margin: 0;
  padding: 0.25rem 1rem 1rem;
  font-size: 0.82rem;
  color: var(--pt-text-faint);
}

.asistan-konusma-satir {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border-radius: 8px;
}

.asistan-konusma-satir:hover {
  background: var(--pt-surface);
}

.asistan-konusma-satir.is-aktif {
  background: var(--pt-primary-soft);
}

.asistan-konusma {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  color: var(--pt-text);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 44px;
}

.asistan-konusma-baslik {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asistan-konusma-zaman {
  font-size: 0.7rem;
  color: var(--pt-text-faint);
}

.asistan-konusma-satir.is-aktif .asistan-konusma {
  color: var(--pt-primary);
  font-weight: 500;
}

.asistan-konusma-sil {
  border: 0;
  background: transparent;
  color: var(--pt-text-faint);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
}

.asistan-konusma-satir:hover .asistan-konusma-sil,
.asistan-konusma-satir.is-aktif .asistan-konusma-sil,
.asistan-konusma-sil:focus-visible {
  opacity: 1;
}

.asistan-konusma-sil:hover {
  color: var(--pt-danger);
  background: var(--pt-danger-soft);
}

@media (hover: none) {
  .asistan-konusma-sil { opacity: 1; }
}

/* Satır içi silme onayı (confirm() yerine) */
.asistan-konusma-onay {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
  width: 100%;
}

/* ---- Sağ sütun ---- */
.asistan-ana {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.asistan-baslik {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--pt-border);
  flex-wrap: wrap;
}

.asistan-ikon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pt-text-muted);
  border: 0;
  background: transparent;
  font-size: 1rem;
  flex: 0 0 auto;
}

.asistan-ikon-btn:hover {
  background: var(--pt-bg);
  color: var(--pt-text);
}

.asistan-baslik-metin {
  min-width: 0;
  flex: 1 1 0; /* basis 0: uzun başlık hamburger'in yanında kalır, alt satıra düşmez */
}

.asistan-h1 {
  font-size: 1rem;
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asistan-baslik-alt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--pt-text-muted);
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.asistan-rol {
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  border: 1px solid var(--pt-primary-border);
  font-size: 0.72rem;
}

.asistan-kapsam {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}

.asistan-durum {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--pt-text-muted);
  white-space: nowrap;
}

.asistan-durum-nokta {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pt-text-faint);
  flex: 0 0 auto;
}

.asistan-durum[data-durum="hazir"] .asistan-durum-nokta { background: var(--pt-success); }
.asistan-durum[data-durum="yok"] .asistan-durum-nokta { background: var(--pt-danger); }
.asistan-durum[data-durum="model_yok"] .asistan-durum-nokta { background: var(--pt-warning); }

.asistan-switch {
  font-size: 0.8rem;
  margin: 0;
  white-space: nowrap;
  min-height: 0;
}

.asistan-switch .form-check-input:checked {
  background-color: var(--pt-primary);
  border-color: var(--pt-primary);
}

.asistan-uyari {
  margin: 0.75rem 1rem 0;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

/* ---- Mesaj akışı ---- */
.asistan-mesajlar {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.asistan-mesaj {
  display: flex;
  gap: 0.65rem;
  max-width: 85%;
}

.asistan-mesaj-kullanici {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.asistan-mesaj-asistan {
  align-self: flex-start;
}

.asistan-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.asistan-avatar-robot {
  background: var(--pt-primary);
  color: var(--pt-surface);
}

.asistan-govde {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.asistan-balon {
  padding: 0.65rem 0.9rem;
  border-radius: 15px 15px 15px 0;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  overflow-wrap: anywhere;
}

.asistan-mesaj-kullanici .asistan-balon {
  background: var(--pt-primary-soft);
  border-color: var(--pt-primary-soft);
  border-radius: 15px 15px 0 15px;
  white-space: pre-wrap;
}

.asistan-zaman {
  font-size: 0.7em;
  color: var(--pt-text-muted);
}

.asistan-mesaj-kullanici .asistan-zaman {
  text-align: right;
}

.asistan-istatistik {
  color: var(--pt-text-faint);
}

.asistan-tur + .asistan-tur {
  margin-top: 0.5rem;
}

/* ---- Düşünme bloğu ---- */
.asistan-dusunme {
  margin: 0 0 0.5rem;
  border: 1px solid var(--pt-border);
  border-radius: 10px;
  background: var(--pt-bg);
  font-size: 0.85em;
  color: var(--pt-text-muted);
  position: relative;
  overflow: hidden;
}

.asistan-dusunme > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.asistan-dusunme > summary::-webkit-details-marker {
  display: none;
}

.asistan-dusunme > summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.7em;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.asistan-dusunme[open] > summary::after {
  transform: rotate(180deg);
}

.asistan-dusunme-sure {
  color: var(--pt-text-faint);
  font-weight: 400;
}

.asistan-dusunme-metin {
  padding: 0 0.65rem 0.55rem;
  white-space: pre-wrap;
  max-height: 260px;
  overflow-y: auto;
  line-height: 1.5;
}

/* Akış sırasında ince kayan gradient çizgi */
.asistan-dusunme.is-akis::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pt-primary), transparent);
  background-size: 200% 100%;
  animation: asistan-kaydir 1.4s linear infinite;
}

@keyframes asistan-kaydir {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* "Düşünmeyi göster" kapalı: yalnız summary çipi kalır */
.asistan-dusunme-gizli .asistan-dusunme-metin {
  display: none;
}

.asistan-dusunme-gizli .asistan-dusunme > summary {
  cursor: default;
}

.asistan-dusunme-gizli .asistan-dusunme > summary::after {
  display: none;
}

/* ---- Araç çipi ---- */
.asistan-araclar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.asistan-araclar:not(:empty) {
  margin-bottom: 0.5rem;
}

.asistan-arac {
  border: 1px solid var(--pt-border);
  border-radius: 999px;
  background: var(--pt-bg);
  font-size: 0.8em;
  color: var(--pt-text);
  align-self: flex-start;
  max-width: 100%;
}

.asistan-arac[open] {
  border-radius: 10px;
}

.asistan-arac > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.asistan-arac > summary::-webkit-details-marker {
  display: none;
}

.asistan-arac-ad {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
}

.asistan-arac-durum {
  color: var(--pt-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.asistan-arac.is-ok .asistan-arac-durum { color: var(--pt-success); }
.asistan-arac.is-hata .asistan-arac-durum { color: var(--pt-danger); }

.asistan-spinner.pt-spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

.asistan-arac-args {
  margin: 0 0.75rem 0.55rem;
}

.asistan-arac-args-etiket {
  font-size: 0.9em;
  color: var(--pt-text-faint);
  margin-bottom: 0.2rem;
}

.asistan-arac-args code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9em;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  color: var(--pt-text);
}

/* ---- Onay kartı ---- */
.asistan-onay {
  background: var(--pt-warning-soft);
  border-left: 3px solid var(--pt-warning);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin: 0.5rem 0;
  font-size: 0.9em;
}

.asistan-onay-baslik {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  color: var(--pt-text);
  flex-wrap: wrap;
}

.asistan-onay-baslik .fa-triangle-exclamation {
  color: var(--pt-warning);
}

.asistan-onay-arac {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  font-size: 0.85em;
  color: var(--pt-text-muted);
}

.asistan-onay-ozet {
  margin-bottom: 0.45rem;
}

.asistan-onay pre {
  margin: 0 0 0.5rem;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85em;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.asistan-onay-eylem {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.asistan-onay-rozet {
  background: var(--pt-surface);
  color: var(--pt-text-muted);
  border: 1px solid var(--pt-border);
}

.asistan-onay.is-uygulandi {
  border-left-color: var(--pt-success);
  background: var(--pt-success-soft);
}

.asistan-onay.is-uygulandi .asistan-onay-rozet {
  color: var(--pt-success);
}

.asistan-onay.is-reddedildi {
  border-left-color: var(--pt-border-strong);
  background: var(--pt-bg);
}

.asistan-onay.is-hata {
  border-left-color: var(--pt-danger);
  background: var(--pt-danger-soft);
}

.asistan-onay.is-hata .asistan-onay-rozet {
  color: var(--pt-danger);
}

/* ---- Markdown içerik ---- */
.asistan-md > :last-child {
  margin-bottom: 0;
}

.asistan-md p {
  margin-bottom: 0.5rem;
}

.asistan-md ul,
.asistan-md ol {
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.asistan-md h1,
.asistan-md h2,
.asistan-md h3,
.asistan-md h4 {
  font-size: 1rem;
  margin: 0.6rem 0 0.3rem;
}

.asistan-md pre {
  background: var(--pt-bg);
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  overflow-x: auto;
  font-size: 0.85em;
  margin-bottom: 0.5rem;
}

.asistan-md code {
  font-size: 0.9em;
  color: var(--pt-primary-active);
  background: var(--pt-bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.asistan-md pre code {
  background: none;
  padding: 0;
  color: var(--pt-text);
}

.asistan-md .table-responsive {
  margin-bottom: 0.5rem;
}

.asistan-md table {
  font-size: 0.85em;
  margin-bottom: 0;
}

.asistan-md blockquote {
  border-left: 3px solid var(--pt-border-strong);
  padding-left: 0.7rem;
  color: var(--pt-text-muted);
  margin: 0 0 0.5rem;
}

.asistan-md hr {
  margin: 0.5rem 0;
}

.asistan-duz {
  white-space: pre-wrap;
}

/* Akış imleci */
.asistan-icerik.is-akis::after {
  content: "\258D";
  color: var(--pt-primary);
  animation: asistan-yanip 1s steps(2, start) infinite;
}

@keyframes asistan-yanip {
  to { visibility: hidden; }
}

.asistan-hata {
  font-size: 0.85em;
  padding: 0.45rem 0.7rem;
  margin: 0.4rem 0 0;
}

/* ---- Karşılama kartı ---- */
.asistan-karsilama {
  margin: auto;
  max-width: 560px;
  text-align: center;
  padding: 1.5rem 1rem;
}

.asistan-karsilama-ikon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.asistan-karsilama-baslik {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.asistan-karsilama-metin {
  color: var(--pt-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.asistan-oneriler {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.asistan-oneri {
  border: 1px solid var(--pt-border-strong);
  background: var(--pt-surface);
  color: var(--pt-text);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  min-height: 38px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.asistan-oneri:hover {
  border-color: var(--pt-primary);
  color: var(--pt-primary);
  background: var(--pt-primary-soft);
}

/* ---- Yazma alanı ---- */
.asistan-yazar {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.75rem 1rem 0.4rem;
  border-top: 1px solid var(--pt-border);
  background: var(--pt-surface);
}

/* textarea.form-control (Bootstrap) min-height'ı özgüllükle ezer → element seçicisi eklendi */
textarea.asistan-metin {
  resize: none;
  min-height: 44px;
  max-height: calc(1.5em * 6 + 1.1rem); /* 1-6 satır */
  line-height: 1.5;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  overflow-y: auto;
}

.asistan-gonder,
.asistan-durdur {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0;
}

.asistan-ipucu {
  margin: 0;
  padding: 0 1rem 0.6rem;
  font-size: 0.72rem;
  color: var(--pt-text-faint);
}

/* ---- İnce kaydırma çubukları ---- */
.asistan-mesajlar::-webkit-scrollbar,
.asistan-kenar-liste::-webkit-scrollbar,
.asistan-dusunme-metin::-webkit-scrollbar {
  width: 6px;
}

.asistan-mesajlar::-webkit-scrollbar-thumb,
.asistan-kenar-liste::-webkit-scrollbar-thumb,
.asistan-dusunme-metin::-webkit-scrollbar-thumb {
  background: var(--pt-border-strong);
  border-radius: 999px;
}

/* ---- Mobil (<992px): kenar offcanvas, sıkı boşluklar ---- */
@media (max-width: 991.98px) {
  .asistan-mesaj { max-width: 100%; }
  .asistan-baslik { padding: 0.55rem 0.75rem; gap: 0.5rem; }
  .asistan-mesajlar { padding: 0.75rem; }
  .asistan-yazar { padding: 0.6rem 0.75rem 0.35rem; }
  .asistan-ipucu { padding: 0 0.75rem 0.5rem; }
  .asistan-kapsam { display: none; }
  .asistan-uyari { margin: 0.6rem 0.75rem 0; }
  .asistan-kenar-ust { padding-top: 1rem; }
}

@media (max-width: 575.98px) {
  /* Anahtar etiketi görsel olarak gizlenir; erişilebilir ad korunur */
  .asistan-switch .form-check-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .asistan-switch { padding-left: 2.5em; }
  .asistan-h1 { font-size: 0.95rem; }
  .asistan-karsilama { padding: 1rem 0.25rem; }
}

/* ---- Hareket azaltma tercihi ---- */
@media (prefers-reduced-motion: reduce) {
  .asistan-dusunme.is-akis::before {
    animation: none;
    background: var(--pt-primary);
  }
  .asistan-icerik.is-akis::after { animation: none; }
  .asistan-mesajlar { scroll-behavior: auto; }
  .asistan-dusunme > summary::after,
  .asistan-oneri { transition: none; }
}

/* Akış başladı ama ilk olay (düşünme/araç/içerik) henüz gelmedi: bekleme noktaları */
.is-akista .asistan-mesaj-asistan:last-child .asistan-balon:not(:has(.asistan-dusunme, .asistan-icerik, .asistan-arac, .asistan-onay, .asistan-hata))::after {
  content: "\2022\2022\2022";
  letter-spacing: 0.15em;
  color: var(--pt-text-faint);
  animation: asistan-yanip 1s steps(2, start) infinite;
}

/* AI Asistan — yanıt içindeki uygulama içi bağlantılar (personel/araç/ev sayfaları) */
.asistan-balon a.asistan-ic-baglanti {
  color: var(--pt-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--pt-primary-border);
  text-underline-offset: 2px;
}
.asistan-balon a.asistan-ic-baglanti:hover {
  color: var(--pt-primary-hover);
  text-decoration-color: currentColor;
}

/* ==========================================================================
   Açılır kart (Ö12) — tıklanır başlık + dönen ok. personel_info'daki şifre
   kartı kalıbının site geneli bileşeni: info sayfalarındaki her bölüm bu
   kalıpla açılıp kapanır (Bootstrap collapse, ek JS gerekmez).
   Kullanım:
     <div class="card mb-3 acilir-kart">
       <button type="button" class="card-header acilir-baslik"
               data-bs-toggle="collapse" data-bs-target="#bolumX"
               aria-expanded="true" aria-controls="bolumX">
         <span><i class="fas fa-... me-2"></i>Başlık</span>
         <i class="fas fa-chevron-down kart-ok" aria-hidden="true"></i>
       </button>
       <div id="bolumX" class="collapse show"><div class="card-body">…</div></div>
     </div>
   Başlık gerçek <button> — klavyeyle (Tab + Enter/Space) açılır kapanır.
   ========================================================================== */
.acilir-kart > .acilir-baslik {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--pt-border);
  cursor: pointer;
  font-weight: 600;
  color: var(--pt-text);
}
.acilir-kart > .acilir-baslik:hover { background: var(--pt-bg); }
.acilir-kart > .acilir-baslik:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--pt-primary-soft);
}
/* Kapalıyken başlığın alt çizgisi kalkar (kart tek parça görünür) */
.acilir-kart > .acilir-baslik[aria-expanded="false"] { border-bottom: 0; }
.acilir-kart .kart-ok {
  color: var(--pt-text-faint);
  transition: transform 0.2s ease;
}
.acilir-kart > .acilir-baslik[aria-expanded="true"] .kart-ok {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .acilir-kart .kart-ok { transition: none; }
}
/* Mevcut renkli kart başlıkları (bg-info/bg-primary'li card-header) açılır
   yapılırken .acilir-baslik yerine yalnız toggle nitelikleri eklenir; bu
   kural imleci ve ok dönüşünü onlara da verir (zemin rengi korunur). */
.acilir-kart > .card-header[data-bs-toggle="collapse"] { cursor: pointer; }
.acilir-kart > .card-header[data-bs-toggle="collapse"] .kart-ok {
  transition: transform 0.2s ease;
}
.acilir-kart > .card-header[data-bs-toggle="collapse"][aria-expanded="true"] .kart-ok {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Bilgi sayfası başlığı (Ö12) — isyeri_info / ev_info / arac_info sayfaları
   personel_info'nun .profil-baslik kalıbının sade genel halini kullanır:
   ikon + ad + rozetler + sağda eylem düğmeleri (Düzenle).
   -------------------------------------------------------------------------- */
.bilgi-baslik {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.bilgi-ikon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex: 0 0 64px;
}
.bilgi-baslik h1 {
  font-size: 1.4rem;
  margin: 0 0 0.35rem;
}
.bilgi-rozetler {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.bilgi-eylemler {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
@media (max-width: 576px) {
  .bilgi-baslik { padding: 1rem; }
  .bilgi-eylemler { margin-left: 0; width: 100%; }
}

/* Yumuşak (soft) durum rozetleri — personel_info'daki yerel tanımın GLOBAL
   kopyası (Ö12): personel_duzenle + yeni panel/info sayfaları da kullanır.
   personel_info.html'deki yerel tanım aynı değerlerle durur (çakışmaz). */
.rozet-yumusak {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28em 0.75em;
  border-radius: 999px;
  border: 1px solid transparent;
}
.rozet-yumusak i { font-size: 0.6rem; }
.rozet-basari {
  background: var(--pt-success-soft);
  color: var(--pt-success);
  border-color: #c4e8d3;
}
.rozet-notr {
  background: var(--pt-bg);
  color: var(--pt-text-muted);
  border-color: var(--pt-border);
}
.rozet-koyu {
  background: var(--pt-text);
  color: #fff;
}
.rozet-marka {
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  border-color: var(--pt-primary-border);
}
.rozet-uyari {
  background: #fff7e0;
  color: #8a6d1a;
  border-color: #f2e2ae;
}
.rozet-tehlike {
  background: #fdecec;
  color: #b02a37;
  border-color: #f5c2c7;
}

/* Sidebar sayaç rozeti (Ö12-ek2) — Hatırlatıcılar linkindeki bekleyen sayısı;
   nav-link flex olduğundan margin-left:auto rozeti sağa yaslar. Vakti gelen
   hatırlatıcı varsa .rozet-yanip bildirim ikonu gibi yanıp söner. */
.sidebar-nav .nav-link .sidebar-rozet {
  margin-left: auto;
  font-size: 0.68rem;
}
.rozet-yanip {
  animation: rozet-yanip-nabiz 2s infinite;
}
@keyframes rozet-yanip-nabiz {
  0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .rozet-yanip { animation: none; }
}

/* Bilgi satırı — info kartlarındaki etiket + değer çifti (dl/dt/dd) */
dl.bilgi-liste { margin: 0; }
.bilgi-satir {
  display: flex;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--pt-border);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.bilgi-satir:last-child { border-bottom: 0; }
.bilgi-satir dt {
  flex: 0 0 200px;
  color: var(--pt-text-faint);
  font-weight: 500;
  margin: 0;
}
.bilgi-satir dd {
  margin: 0;
  flex: 1;
  min-width: 180px;
}
@media (max-width: 576px) {
  .bilgi-satir dt { flex-basis: 100%; }
}

/* ---- Planlama düzeni (Ö13.7 planlama fikirleri, 8 Eyl 2026) ------------
   Satır işlemleri tek hücrede: Düzenle + ikonlar + ⋯ menüsü; menü içindeki
   formlar düğmeyi tam genişlikte tutar. Tatil işareti pillerde küçük ikon. */
.plan-islem .dropdown-menu form { margin: 0; }
.plan-islem .dropdown-item { font-size: 0.875rem; }
#planGunSecici .fa-umbrella-beach { color: #C77700; }
#plan-tatil-uyari { border-left: 3px solid #C77700; }
#onerListe .list-group-item { cursor: pointer; }
#onerListe .list-group-item:hover { background: var(--pt-primary-soft, #EEF1FE); }

/* ============================================================
   İletişim — toplu gönderim sayfaları (Ö14, 12 Eyl 2026)
   /whatsapp + /eposta ortak alıcı seçicisi
   (templates/partials/_alici_secici.html) ve sayfa parçaları.
   Yalnız --pt-* token'ları; önekler .alici-* ve .iletisim-*.
   ============================================================ */

/* ---- Alıcı seçici listesi ---- */
.alici-liste {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  background: var(--pt-bg);
}

/* Satırın tamamı <label>: tıklama kutucuğu işaretler (mobilde de kolay) */
.alici-satir {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--pt-border);
  cursor: pointer;
}
.alici-satir:last-child {
  border-bottom: 0;
}
.alici-satir:hover {
  background: var(--pt-primary-soft);
}
.alici-satir:has(.form-check-input:checked) {
  background: var(--pt-primary-soft);
}
.alici-satir .form-check-input {
  margin: 0;
  flex: 0 0 auto;
}

.alici-foto,
.alici-bas {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
}
.alici-foto {
  object-fit: cover;
}
.alici-bas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  font-size: 0.78rem;
  font-weight: 600;
}

.alici-metin {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.alici-ad {
  font-size: 0.9rem;
  line-height: 1.25;
}
.alici-alt {
  font-size: 0.76rem;
  color: var(--pt-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Mesaj kutusu yardımcıları ---- */
/* Karakter sayacı: sınıra ulaşınca uyarı (WhatsApp 4096; eski SMS kodu
   160'ta kırmızıya dönüyordu) */
.iletisim-sayac {
  font-variant-numeric: tabular-nums;
}
.iletisim-sayac.is-dolu {
  color: var(--pt-danger);
  font-weight: 600;
}

/* E-posta geçmişinde satır altında açılan gövde (|nl2br ile <br>'li) */
.iletisim-govde {
  overflow-wrap: anywhere;
}

/* Mail şablonu önizlemesi (iframe srcdoc) */
.iletisim-onizleme {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
}

@media (max-width: 575.98px) {
  .alici-liste {
    max-height: 260px;
  }
  .iletisim-onizleme {
    height: 60vh;
  }
}

/* ============================================================
   Sohbet (/sohbet — templates/sohbet.html + static/js/sohbet.js)
   Ö14, 12 Eyl 2026. Düzen ai_chat.html'in .asistan-* reçetesinin
   kopyasıdır (ai_chat'e dokunulmadı): tam yükseklikli kart, solda
   272px liste / <992px offcanvas, sağda başlık + akış + yazma alanı.
   Yalnız --pt-* token'ları; .sohbet-* ön eki.
   ============================================================ */

.sohbet {
  display: flex;
  height: calc(100vh - var(--pt-topbar-height) - 1.5rem - 4.5rem);
  height: calc(100dvh - var(--pt-topbar-height) - 1.5rem - 4.5rem);
  min-height: 420px;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-sm);
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .sohbet {
    height: calc(100vh - var(--pt-topbar-height) - 1rem - 4.5rem);
    height: calc(100dvh - var(--pt-topbar-height) - 1rem - 4.5rem);
  }
}

/* ---- Sol kenar: sohbet listesi (≥992px sütun, altında offcanvas) ---- */
.sohbet-kenar {
  display: flex;
  flex-direction: column;
  --bs-offcanvas-width: 272px;
  --bs-offcanvas-bg: var(--pt-surface);
}

@media (min-width: 992px) {
  .sohbet-kenar,
  .sohbet-kenar.offcanvas-lg {
    width: 272px;
    flex: 0 0 272px;
    height: auto;
    position: static;
    transform: none;
    visibility: visible;
    /* Bootstrap offcanvas-lg ≥992px'te 'transparent !important' uygular */
    background-color: var(--pt-bg) !important;
    border-right: 1px solid var(--pt-border) !important;
  }
}

.sohbet-kenar-ust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem 0.35rem;
}

.sohbet-kenar-baslik {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pt-text-muted);
  margin: 0;
  margin-right: auto;
}

/* Liste araması: ikon girdinin içinde durur */
.sohbet-kenar-ara {
  position: relative;
  padding: 0.35rem 1rem 0.6rem;
}

.sohbet-ara-ikon {
  position: absolute;
  left: 1.6rem;
  top: 50%;
  transform: translateY(-60%);
  font-size: 0.78rem;
  color: var(--pt-text-faint);
  pointer-events: none;
}

.sohbet-ara-girdi {
  padding-left: 2rem;
  border-radius: 999px;
}

.sohbet-liste {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0 0.6rem 0.75rem;
}

.sohbet-kenar-bos {
  margin: 0;
  padding: 0.25rem 1rem 1rem;
  font-size: 0.82rem;
  color: var(--pt-text-faint);
}

/* ---- Liste satırı ---- */
.sohbet-kisi {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  color: var(--pt-text);
  min-height: 56px;
}

.sohbet-kisi:hover {
  background: var(--pt-surface);
}

.sohbet-kisi.is-aktif {
  background: var(--pt-primary-soft);
}

.sohbet-kisi-avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
}

.sohbet-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--pt-bg);
  flex: 0 0 auto;
}

/* Çevrimiçi noktası: avatarın sağ altında yeşil daire */
.sohbet-nokta {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pt-success);
  border: 2px solid var(--pt-surface);
}

.sohbet-kisi-orta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sohbet-kisi-ad {
  font-size: 0.88rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sohbet-kisi-alt {
  font-size: 0.76rem;
  color: var(--pt-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sohbet-kisi-alt .fa-paperclip {
  font-size: 0.7rem;
}

.sohbet-kisi-siz {
  color: var(--pt-text-faint);
}

.sohbet-kisi-sag {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.sohbet-kisi-zaman {
  font-size: 0.68rem;
  color: var(--pt-text-faint);
  white-space: nowrap;
}

.sohbet-kisi-sayac {
  font-size: 0.66rem;
}

.sohbet-kisi.is-aktif .sohbet-kisi-ad {
  color: var(--pt-primary);
}

/* "Yeni sohbet" modalındaki aday satırı */
.sohbet-kisi-sonuc {
  margin-top: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
}

.sohbet-kisi-oge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
}

/* ---- Sağ sütun ---- */
.sohbet-ana {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sohbet-baslik {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--pt-border);
}

.sohbet-ikon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pt-text-muted);
  border: 0;
  background: transparent;
  font-size: 1rem;
  flex: 0 0 auto;
}

.sohbet-ikon-btn:hover {
  background: var(--pt-bg);
  color: var(--pt-text);
}

.sohbet-baslik-avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
}

.sohbet-baslik-metin {
  min-width: 0;
  flex: 1 1 0; /* basis 0: uzun ad eylemlerin yanında kalır, alta düşmez */
}

.sohbet-h1 {
  font-size: 1rem;
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sohbet-baslik-alt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--pt-text-muted);
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.sohbet-yaziyor {
  color: var(--pt-primary);
  font-style: italic;
}

.sohbet-baslik-eylem {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

/* Satır içi silme onayı (confirm() yerine) */
.sohbet-onay {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  background: var(--pt-danger-soft);
  border-bottom: 1px solid var(--pt-border);
}

.sohbet-uyari {
  margin: 0.6rem 1rem 0;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

/* ---- Mesaj akışı ---- */
.sohbet-mesajlar {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.sohbet-akis {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sohbet-bos {
  margin: auto;
  max-width: 460px;
  text-align: center;
  padding: 1.5rem 1rem;
}

.sohbet-bos-ikon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--pt-primary-soft);
  color: var(--pt-primary);
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.sohbet-bos-baslik {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.sohbet-bos-metin {
  color: var(--pt-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.sohbet-daha {
  display: flex;
  justify-content: center;
  padding-bottom: 0.6rem;
}

/* Tarih ayracı: Bugün / Dün / gg.aa.yyyy */
.sohbet-gun {
  align-self: center;
  margin: 0.6rem 0 0.3rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--pt-bg);
  border: 1px solid var(--pt-border);
  font-size: 0.7rem;
  color: var(--pt-text-muted);
}

.sohbet-mesaj {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}

.sohbet-mesaj.is-benim {
  align-self: flex-end;
  align-items: flex-end;
}

.sohbet-mesaj.is-karsi {
  align-self: flex-start;
  align-items: flex-start;
}

.sohbet-balon {
  padding: 0.5rem 0.8rem;
  border-radius: 15px 15px 15px 0;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  max-width: 100%;
}

.sohbet-mesaj.is-benim .sohbet-balon {
  background: var(--pt-primary-soft);
  border-color: var(--pt-primary-soft);
  border-radius: 15px 15px 0 15px;
}

.sohbet-metin {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.sohbet-zaman {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  color: var(--pt-text-faint);
  margin-top: 0.1rem;
  padding: 0 0.2rem;
}

.sohbet-tik {
  display: inline-flex;
  align-items: center;
  color: var(--pt-text-faint);
}

.sohbet-tik.is-okundu {
  color: var(--pt-primary);
}

/* Dosya mesajı: satır içi resim ya da indirilebilir kart */
.sohbet-resim {
  max-width: 260px;
  max-height: 260px;
  border-radius: 10px;
  cursor: zoom-in;
  display: block;
}

.sohbet-resim-buyuk {
  max-height: 72vh;
}

.sohbet-dosya {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pt-text);
  text-decoration: none;
  font-size: 0.85rem;
  max-width: 100%;
}

.sohbet-dosya:hover {
  color: var(--pt-primary);
}

.sohbet-dosya-ad {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.sohbet-hata {
  margin: 0.5rem 1rem 0;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

/* ---- Yazma alanı ---- */
.sohbet-yaz {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.7rem 1rem 0.4rem;
  border-top: 1px solid var(--pt-border);
  background: var(--pt-surface);
}

.sohbet-ek {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--pt-border-strong);
  color: var(--pt-text-muted);
  cursor: pointer;
  margin: 0;
}

.sohbet-ek:hover {
  color: var(--pt-primary);
  border-color: var(--pt-primary);
}

.sohbet-ek.is-kapali {
  opacity: 0.5;
  pointer-events: none;
}

.sohbet-ek.is-yukleniyor {
  opacity: 0.6;
  pointer-events: none;
}

/* textarea.form-control (Bootstrap) min-height'ı özgüllükle ezer */
textarea.sohbet-girdi {
  resize: none;
  min-height: 44px;
  max-height: calc(1.5em * 6 + 1.1rem); /* 1-6 satır */
  line-height: 1.5;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  overflow-y: auto;
}

.sohbet-gonder {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0;
}

.sohbet-ipucu {
  margin: 0;
  padding: 0 1rem 0.6rem;
  font-size: 0.72rem;
  color: var(--pt-text-faint);
}

/* ---- İnce kaydırma çubukları ---- */
.sohbet-mesajlar::-webkit-scrollbar,
.sohbet-liste::-webkit-scrollbar,
.sohbet-kisi-sonuc::-webkit-scrollbar {
  width: 6px;
}

.sohbet-mesajlar::-webkit-scrollbar-thumb,
.sohbet-liste::-webkit-scrollbar-thumb,
.sohbet-kisi-sonuc::-webkit-scrollbar-thumb {
  background: var(--pt-border-strong);
  border-radius: 999px;
}

/* ---- Mobil (<992px): kenar offcanvas, sıkı boşluklar ---- */
@media (max-width: 991.98px) {
  .sohbet-mesaj { max-width: 88%; }
  .sohbet-baslik { padding: 0.5rem 0.7rem; gap: 0.45rem; }
  .sohbet-mesajlar { padding: 0.75rem; }
  .sohbet-yaz { padding: 0.6rem 0.7rem 0.35rem; }
  .sohbet-ipucu { padding: 0 0.7rem 0.5rem; }
  .sohbet-uyari,
  .sohbet-hata { margin: 0.5rem 0.7rem 0; }
  .sohbet-onay { padding: 0.5rem 0.7rem; }
  .sohbet-kenar-ust { padding-top: 1rem; }
}

/* 375px: başlık eylemleri yalnız ikon, resim/dosya daralır */
@media (max-width: 575.98px) {
  .sohbet-h1 { font-size: 0.95rem; }
  .sohbet-mesaj { max-width: 94%; }
  .sohbet-resim { max-width: 190px; max-height: 190px; }
  .sohbet-dosya-ad { max-width: 130px; }
  .sohbet-baslik-eylem .btn { padding-left: 0.5rem; padding-right: 0.5rem; }
  .sohbet-bos { padding: 1rem 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sohbet-mesajlar { scroll-behavior: auto; }
}

/* ---- CSV ile toplu içe aktarma önizlemesi (Ö14-ek14, 18 Eyl 2026) ----
   Dar ekranda tablo yatay kayar (table-responsive); Kayıt hücresi kelime
   kelime kırılmasın, Sorunlar sütunu okunacak genişlikte kalsın. */
.ice-kayit { white-space: nowrap; }
.ice-sorunlar { min-width: 16rem; }
