/* ==========================================================================
   Tam ekran Yaşayan Ofis (OfficeView::fullPage, tam-ekran.js)
   3B sahne bütün ekranı kaplar; kabuk sessiz ve yüzer: buzlu cam yüzeyler (yarı saydam beyaz, bulanıklık, ince çizgi,
   yumuşak gölge), bol boşluk, sakin yazı. Gradyan, parıltı ve emoji yok. Renkler tokens.css'ten; kobalt yalnızca
   gönder düğmesi, rozet ve seçili durum içindir. Hareket kısa ve yumuşaktır; azaltılmış harekette durur.
   ofis.css'ten sonra yüklenir: ortak parçaların (taslak kartı, iletişim kutuları, 3B düğmeleri) yalnızca bu sayfadaki
   görünümünü değiştirir.
   ========================================================================== */

.te {
  --te-gut: 16px;                       /* ekran kenarı payı */
  --te-chip: 44px;                      /* üst hapların yüksekliği */
  --te-bar-gap: 16px;                   /* komut çubuğunun alttan uzaklığı */
  --te-bar-h: 56px;                     /* komut alanının tek satır yüksekliği */
  --te-side: 0px;                       /* 3B'de sol / sağ alt düğmelere bırakılan pay */
  --te-safe-b: env(safe-area-inset-bottom, 0px);
  --te-glass: rgb(255 255 255 / .64);
  --te-glass-strong: rgb(255 255 255 / .82);
  --te-hair: rgb(17 17 19 / .08);
  --te-hair-2: rgb(17 17 19 / .12);
  --te-hover: rgb(17 17 19 / .06);
  --te-shadow: 0 1px 1px rgb(17 17 19 / .04), 0 12px 32px -14px rgb(17 17 19 / .24);
  --te-blur: saturate(180%) blur(22px);
  --te-dur: .24s;
  display: block;
}
@media (min-width: 1024px) {
  .te { --te-gut: 20px; --te-bar-gap: 24px; }
}
html.te-3b .te { --te-side: 128px; }


/* --- Sayfa: 3B'de kaydırma yok ------------------------------------------------ */
.te-body { display: block; min-height: 100dvh; background: var(--bg); }
.te-main { display: block; }
html.te-3b, html.te-3b .te-body { height: 100%; overflow: hidden; overscroll-behavior: none; }
/* Betik hazır olana dek geniş ekranda liste görünmez (3B açılacakken liste bir an belirmesin) */
@media (scripting: enabled) and (min-width: 768px) {
  html:not(.te-hazir) .te-listwrap { visibility: hidden; }
}

/* --- Cam yüzey ------------------------------------------------------------------ */
.te-glass {
  background: var(--te-glass);
  -webkit-backdrop-filter: var(--te-blur);
  backdrop-filter: var(--te-blur);
  border: 1px solid var(--te-hair);
  box-shadow: var(--te-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .te-glass, .te-note, .te .of-dialog, .te-menu { background: rgb(255 255 255 / .96) !important; }
}

/* --- Sahne ------------------------------------------------------------------------- */
.te-scene { position: fixed; inset: 0; z-index: 0; background: var(--bg); }
.te .of3d__canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

/* Sakin yükleme göstergesi: ekranın ortasında, önce sayfanınki, sonra sahneninki (aynı yer, aynı metin) */
.te-loading, .te .of3d__loading {
  position: fixed; z-index: 5; left: 50%; top: 50%; right: auto; translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 0;
  background: none; box-shadow: none; color: var(--ink-2); font-size: 14px; letter-spacing: -.005em;
  pointer-events: none; transition: opacity .5s var(--sa-ease);
}
.te-loading__dot, .te .of3d__loading-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none;
  animation: te-breathe 1.6s ease-in-out infinite;
}
@keyframes te-breathe { 50% { opacity: .25; transform: scale(.8); } }

/* Sahne ipucu (sürükle / yakınlaş): üstte ortada, ilk dokunuşta kaybolur */
.te .of3d__hint {
  top: calc(var(--te-gut) + 11px); bottom: auto; padding: 5px 12px; font-size: 12.5px; color: var(--ink-2);
  background: var(--te-glass); -webkit-backdrop-filter: var(--te-blur); backdrop-filter: var(--te-blur); border: 1px solid var(--te-hair);
}
@media (max-width: 1180px) { .te .of3d__hint { display: none; } }

/* Tüm ofis ve yakınlaştırma: komut çubuğunun iki yanında küçük cam düğmeler */
.te .of3d__home, .te .of3d__zoom {
  top: auto; bottom: calc(var(--te-bar-gap) + var(--te-safe-b) + 8px);
  background: var(--te-glass); -webkit-backdrop-filter: var(--te-blur); backdrop-filter: var(--te-blur);
  border: 1px solid var(--te-hair); box-shadow: var(--te-shadow);
}
.te .of3d__home {
  left: var(--te-gut); min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; color: var(--ink);
}
.te .of3d__home:hover { background: var(--te-glass-strong); border-color: var(--te-hair); }
.te .of3d__zoom {
  right: var(--te-gut); display: flex; gap: 0; padding: 0; border-radius: 999px; overflow: hidden;
}
.te .of3d__zoom button {
  width: 44px; min-height: 40px; height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent;
  font-size: 19px; font-weight: 400; color: var(--ink);
}
.te .of3d__zoom button + button { box-shadow: inset 1px 0 0 var(--te-hair-2); }
.te .of3d__zoom button:hover { background: var(--te-hover); border: 0; }

/* --- Üst: marka ve hap grubu ------------------------------------------------------- */
.te-top {
  position: fixed; z-index: 20; top: calc(var(--te-gut) + env(safe-area-inset-top, 0px)); left: var(--te-gut); right: var(--te-gut);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none;
}
.te-top > * { pointer-events: auto; }

.te-brand {
  display: inline-flex; align-items: center; gap: 10px; height: var(--te-chip); padding: 0 18px 0 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -.015em;
  transition: background-color var(--te-dur) var(--sa-ease), transform .16s var(--sa-ease);
}
.te-brand svg { width: 20px; height: 20px; flex: none; }
.te-brand__word { display: inline-flex; align-items: center; gap: 10px; }
.te-brand__word::before { content: ""; width: 1px; height: 16px; background: var(--te-hair-2); }
.te-brand:hover { background: var(--te-glass-strong); }
.te-brand:active { transform: scale(.97); }

.te-pills {
  position: relative; display: flex; align-items: center; gap: 2px; height: var(--te-chip);
  padding: 0 4px 0 16px; border-radius: 999px;
}
.te-credits { margin: 0; padding-right: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.te-menu { display: flex; align-items: center; gap: 2px; }
.te-menu::before { content: ""; width: 1px; height: 18px; margin: 0 6px 0 4px; background: var(--te-hair-2); }
.te-menu form { margin: 0; display: flex; }
.te .te-pill {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink); font-size: 13.5px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .18s var(--sa-ease), transform .16s var(--sa-ease);
}
.te .te-pill:hover { background: var(--te-hover); border: 0; }
.te .te-pill:active { transform: scale(.96); }
.te-pills .lang { padding: 0 4px; }
.te-pills .lang a { min-height: 34px; }
.te-pills .lang a::after { bottom: 7px; }
.te .te-menubtn { display: none; }

/* --- İşler düğmesi ve çekmece ------------------------------------------------------ */
.te .te-jobsbtn {
  position: fixed; z-index: 20; right: var(--te-gut); top: calc(50% - 22px);
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 14px; border-radius: 999px;
  color: var(--ink); font-size: 14px; font-weight: 500;
  transition: opacity var(--te-dur) var(--sa-ease), background-color .18s var(--sa-ease), transform .16s var(--sa-ease);
}
.te .te-jobsbtn:hover { background: var(--te-glass-strong); border-color: var(--te-hair); }
.te .te-jobsbtn svg { width: 18px; height: 18px; flex: none; }
.te-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}
.te--cekmece .te-jobsbtn { opacity: 0; pointer-events: none; }

.te-drawer {
  position: fixed; z-index: 25;
  top: calc(var(--te-gut) + var(--te-chip) + 12px); right: var(--te-gut);
  bottom: calc(var(--te-bar-gap) + var(--te-safe-b) + var(--te-bar-h) + 16px);
  width: min(420px, calc(100vw - 2 * var(--te-gut)));
  display: flex; flex-direction: column; min-height: 0; border-radius: var(--sa-radius-l);
  background: var(--te-glass-strong);
  transform: translateX(calc(100% + var(--te-gut) + 24px)); visibility: hidden;
  transition: transform .34s var(--sa-ease), visibility 0s .34s;
}
.te-drawer.is-open { transform: none; visibility: visible; transition: transform .34s var(--sa-ease); }
.te-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 6px 20px; }
.te-drawer__head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.te .te-iconbtn {
  display: inline-grid; place-items: center; width: 36px; min-height: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2);
}
.te .te-iconbtn:hover { background: var(--te-hover); color: var(--ink); border: 0; }
.te .te-iconbtn svg { width: 18px; height: 18px; }
.te-drawer__body { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 10px 10px; }

/* Sekmeler: bölümlü denetim */
.te .of-tabs {
  position: static; display: flex; gap: 2px; padding: 3px; margin: 6px 6px 10px; border: 0; border-radius: 999px;
  background: rgb(17 17 19 / .06);
}
.te .of-tabs button {
  flex: 1 1 auto; min-width: 0; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.te .of-tabs button:hover { color: var(--ink); border: 0; }
.te .of-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(17 17 19 / .12), 0 0 0 .5px rgb(17 17 19 / .06); }
.te .of-panel { flex: 1; min-height: 0; overflow: auto; padding: 2px 6px 6px; overscroll-behavior: contain; }
.te .of-empty { padding: 28px 6px; text-align: center; font-size: 14px; }
.te .of-live { border-bottom-color: var(--te-hair-2); }
.te .of-draft { background: rgb(255 255 255 / .92); border-color: var(--te-hair-2); border-radius: var(--sa-radius-m); }

/* --- Komut çubuğu ------------------------------------------------------------------- */
.te-bar {
  position: fixed; z-index: 30; left: 50%; bottom: calc(var(--te-bar-gap) + var(--te-safe-b));
  width: min(680px, calc(100vw - 2 * var(--te-gut) - 2 * var(--te-side))); translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0;
}
.te-bar__field {
  width: 100%; display: flex; align-items: flex-end; gap: 10px; min-height: var(--te-bar-h);
  padding: 7px 7px 7px 22px; border-radius: 28px; background: var(--te-glass-strong);
  transition: border-color var(--te-dur) var(--sa-ease), box-shadow var(--te-dur) var(--sa-ease);
}
.te-bar__field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: var(--te-shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.te .te-bar textarea {
  flex: 1; min-width: 0; min-height: 40px; height: 40px; max-height: 150px; padding: 9px 0; margin: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; resize: none; overflow-y: auto;
  font-size: 16px; line-height: 22px; color: var(--ink);
}
.te .te-bar textarea:hover, .te .te-bar textarea:focus { border: 0; background: transparent; box-shadow: none; outline: none; }
.te .te-bar textarea::placeholder { color: color-mix(in srgb, var(--ink-2) 80%, transparent); }
.te .te-bar textarea[readonly] { color: var(--ink-2); }
.te-bar__kbd {
  align-self: center; flex: none; padding: 4px 7px; border-radius: 7px; border: 1px solid var(--te-hair-2);
  font: 500 11.5px/1 var(--sa-font); letter-spacing: .02em; color: var(--muted); white-space: nowrap;
  transition: opacity .18s var(--sa-ease);
}
.te--yazi .te-bar__kbd, .te-bar__field:focus-within .te-bar__kbd { opacity: 0; }
.te .te-send {
  --b-bg: rgb(17 17 19 / .08); --b-ink: var(--ink-2); --b-line: transparent;
  flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%;
  transition: background-color .2s var(--sa-ease), color .2s var(--sa-ease), transform .16s var(--sa-ease);
}
.te .te-send svg { width: 18px; height: 18px; }
.te--yazi .te-send { --b-bg: var(--accent); --b-ink: var(--accent-ink); --b-line: var(--accent); }
.te .te-send:hover { border-color: var(--b-line); background: color-mix(in srgb, var(--b-bg) 88%, var(--ink)); }
.te--yazi .te-send:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.te .te-send:disabled { opacity: 1; }
.te--mesgul .te-send { --b-bg: rgb(17 17 19 / .08); --b-ink: var(--ink-2); --b-line: transparent; }

/* Çubuğun üstündeki kısa not: Genel Müdür okuyor / hata */
.te-note {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%; margin: 0; padding: 8px 15px; border-radius: 999px;
  background: var(--te-glass-strong); -webkit-backdrop-filter: var(--te-blur); backdrop-filter: var(--te-blur);
  border: 1px solid var(--te-hair); box-shadow: var(--te-shadow);
  font-size: 13.5px; line-height: 1.35; color: var(--ink-2);
  animation: te-rise .24s var(--sa-ease) both;
}
.te-note[data-te-durum]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: te-breathe 1.6s ease-in-out infinite; }
.te-note--bad { color: var(--danger); }

/* --- İletişim kutuları: komut çubuğunun üstünde yükselen cam yaprak ----------------- */
.te .of-dialog {
  background: rgb(255 255 255 / .9); -webkit-backdrop-filter: var(--te-blur); backdrop-filter: var(--te-blur);
  border: 1px solid var(--te-hair); border-radius: var(--sa-radius-l);
  box-shadow: 0 1px 1px rgb(17 17 19 / .04), 0 30px 80px -30px rgb(17 17 19 / .4);
}
.te .of-dialog::backdrop { background: rgb(245 245 242 / .28); }
.te .of-dialog[open] { animation: te-rise .26s var(--sa-ease) both; }
@keyframes te-rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }

/* Yönlendirme onayı, eksik alan formu (422), reddetme onayı, Ekibe sor */
.te #of-onay, .te #of-ajan, .te #of-sor {
  position: fixed; top: auto; left: 0; right: 0; margin: 0 auto;
  bottom: calc(var(--te-bar-gap) + var(--te-safe-b) + var(--te-bar-h) + 14px);
  width: min(680px, calc(100vw - 2 * var(--te-gut)));
  max-height: calc(100dvh - var(--te-gut) - var(--te-chip) - 24px - var(--te-bar-gap) - var(--te-safe-b) - var(--te-bar-h) - 14px);
  overflow: auto; overscroll-behavior: contain;
}
.te #of-onay, .te #of-sor { width: min(560px, calc(100vw - 2 * var(--te-gut))); }
.te .of-confirm { gap: 18px; padding: 24px 24px 22px; }
.te .of-confirm p { font-size: 17px; line-height: 1.45; letter-spacing: -.01em; color: var(--ink); }
.te .of-confirm .actions { gap: 8px; }
.te .of-dialog__in { padding: 24px; }
.te .of-dialog__close { width: 36px; min-height: 36px; height: 36px; border-radius: 50%; border: 0; background: rgb(17 17 19 / .06); color: var(--ink-2); font-size: 18px; }
.te .of-dialog__close:hover { background: rgb(17 17 19 / .1); color: var(--ink); border: 0; }

/* Kişi ayrıntısı: solda yüzen yaprak; arka plan karartılmaz */
.te #of-detay {
  position: fixed; top: calc(var(--te-gut) + var(--te-chip) + 12px); left: var(--te-gut); right: auto; bottom: auto; margin: 0;
  width: min(380px, calc(100vw - 2 * var(--te-gut)));
  max-height: calc(100dvh - var(--te-gut) - var(--te-chip) - 12px - var(--te-bar-gap) - var(--te-safe-b) - var(--te-bar-h) - 16px);
  overflow: auto;
}
.te #of-detay::backdrop { background: transparent; }
.te #of-detay[open] { animation-name: te-slide; }
@keyframes te-slide { from { opacity: 0; transform: translateX(-12px); } }
.te .of-detail { gap: 16px; padding: 22px; }
.te .of-detail .of-dialog__head h2 { font-size: 22px; letter-spacing: -.02em; }
.te .of-detail__facts { background: rgb(17 17 19 / .045); }
.te .of-recent { border-top-color: var(--te-hair-2); }

/* --- Bildirim: üstte ortada ---------------------------------------------------------- */
.te .of-toast {
  top: calc(var(--te-gut) + 2px); bottom: auto; z-index: 60; transform: translate(-50%, -150%);
  padding: 11px 18px; font-size: 14px; box-shadow: 0 12px 32px -14px rgb(17 17 19 / .45);
}
.te .of-toast.is-on { transform: translate(-50%, 0); }

/* --- Liste görünümü (dar ekran ya da WebGL yok) -------------------------------------- */
.te-listwrap {
  width: min(100%, 1320px); margin: 0 auto;
  padding: calc(var(--te-gut) + var(--te-chip) + 20px) var(--te-gut) calc(var(--te-bar-gap) + var(--te-safe-b) + var(--te-bar-h) + 40px);
}
.te-listwrap .of-room { box-shadow: 0 1px 0 rgb(17 17 19 / .04), 0 0 0 1px var(--te-hair); }

/* --- Dar ekran ------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .te-brand { padding: 0 16px 0 13px; }
  .te-pills { padding: 0 4px 0 14px; }
  .te-menu::before { display: none; }
  .te .te-menubtn {
    display: inline-grid; place-items: center; width: 36px; min-height: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px;
    background: transparent; color: var(--ink);
  }
  .te .te-menubtn:hover { background: var(--te-hover); border: 0; }
  .te .te-menubtn svg { width: 18px; height: 18px; }
  .te-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 2; display: none; flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 210px; padding: 6px; border-radius: 18px;
    background: rgb(255 255 255 / .9); -webkit-backdrop-filter: var(--te-blur); backdrop-filter: var(--te-blur);
    border: 1px solid var(--te-hair); box-shadow: 0 1px 1px rgb(17 17 19 / .04), 0 24px 48px -20px rgb(17 17 19 / .35);
  }
  .te-menu.is-open { display: flex; animation: te-rise .2s var(--sa-ease) both; }
  .te .te-menu .te-pill { min-height: 44px; padding: 0 14px; font-size: 15px; justify-content: flex-start; }
  .te-menu form { display: block; }
  .te-menu form .te-pill { width: 100%; }
  .te-pills .te-menu .lang { padding: 0 8px; }
  .te-pills .te-menu .lang a { min-height: 44px; min-width: 40px; }

  /* İşler düğmesi: komut çubuğunun sağ üstünde, yalnızca simge ve rozet */
  .te .te-jobsbtn { top: auto; bottom: calc(var(--te-bar-gap) + var(--te-safe-b) + var(--te-bar-h) + 12px); padding: 0 12px; }
  .te-jobsbtn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .te-drawer { top: calc(var(--te-gut) + var(--te-chip) + 12px); }
  .te-bar__kbd { display: none; }

  .te #of-detay {
    top: auto; left: 0; right: 0; margin: 0 auto; bottom: calc(var(--te-bar-gap) + var(--te-safe-b) + var(--te-bar-h) + 14px);
    width: calc(100vw - 2 * var(--te-gut));
  }
  .te #of-detay::backdrop { background: rgb(245 245 242 / .28); }
  .te #of-detay[open] { animation-name: te-rise; }
  .te .of-toast { max-width: calc(100% - 2 * var(--te-gut)); }
}

/* --- Azaltılmış hareket ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .te-drawer, .te-drawer.is-open, .te-brand, .te .te-pill, .te .te-jobsbtn, .te-bar__field, .te .te-send, .te-bar__kbd { transition: none; }
  .te .of-dialog[open], .te-note, .te-menu.is-open { animation: none; }
  .te-loading__dot, .te .of3d__loading-dot, .te-note[data-te-durum]::before { animation: none; }
}

/* --- Herkese açık demo: rozet ve teklif bağlantısı ------------------------------------ */
.te-demo-badge { padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--sa-accent, #2448F0) 14%, transparent); color: var(--sa-accent, #2448F0); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.te .te-pill.te-pill--cta { background: var(--ink); color: #fff; }
.te .te-pill.te-pill--cta:hover { background: color-mix(in srgb, var(--ink) 86%, #fff); }

/* --- Telefonda 3B (en sonda: yukarıdaki genel düğme kurallarını ezer) ------------------- */
/* telefonda komut çubuğu tam genişlik; yakınlaştırma düğmeleri yerine iki parmakla yakınlaştırılır */
@media (max-width: 767px) {
  html.te-3b .te { --te-side: 0px; }
  .te .of3d__zoom { display: none; }
  /* Tüm ofis: çubuk tam genişlik olduğundan İşler düğmesiyle aynı hizada, çubuğun üstünde durur */
  .te .of3d__home { bottom: calc(var(--te-bar-gap) + var(--te-safe-b) + var(--te-bar-h) + 12px); }
}