/* ==============================================================
   roxcrm — Layout (teknorox-aligned)
   App shell, topbar, sidebar, FAB — dark-first operational
   ============================================================== */

/* ───────────────────────── App Shell ───────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

/* Drawer/modal açıkken ana içerik scroll'unu kilitle — backdrop-filter blur'un
   her scroll frame'inde yeniden sample alması kaynaklı flicker'ı engeller.
   Drawer'ın kendi iç scroll'u etkilenmez çünkü drawer .ntd-root içinde kendi
   overflow-y: auto konteynerine sahip. */
body.rox-scroll-locked .app-content {
  overflow: hidden;
}

.content-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: var(--s-6) clamp(16px, 3.5vw, 56px) var(--s-9);
}
@media (min-width: 1600px) {
  .content-inner { max-width: 1640px; }
}
@media (min-width: 1920px) {
  .content-inner { max-width: min(1800px, 92vw); }
}

/* ───────────────────────── Topbar (glassmorphic) ───────────────────────── */
.topbar {
  height: 60px;
  background: rgba(11, 17, 32, 0.75);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: 0 var(--s-5);
  flex-shrink: 0;
  position: relative;
  z-index: 60;
}
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.78);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background var(--t-fast);
}
.masthead:hover { background: var(--surface-2); }

.mast-mark {
  width: 34px; height: 34px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.05em;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(153, 213, 26, 0.25);
}
.mast-mark::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
}

.mast-wordmark {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.mast-wordmark .brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.018em;
  line-height: 1;
}
.mast-wordmark .brand em {
  font-style: normal;
  color: var(--brand);
}
.mast-wordmark .tag {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 3px;
  font-weight: 600;
}

/* Workspace + Project selector — split pill */
.ws-selector {
  display: inline-flex;
  align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  height: 42px;
  position: relative;
  transition: border-color var(--t-fast);
}
.ws-selector .ws-pill:first-child { border-top-left-radius: var(--r-md); border-bottom-left-radius: var(--r-md); }
.ws-selector .ws-pill:last-child { border-top-right-radius: var(--r-md); border-bottom-right-radius: var(--r-md); }
.ws-selector:hover { border-color: var(--border-2); }
.ws-selector:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

.ws-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  transition: background var(--t-fast);
  background: transparent;
  border: none;
  height: 100%;
}
.ws-pill:hover { background: var(--surface-3); }

.ws-dot {
  width: 8px; height: 8px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--brand-wash);
  flex-shrink: 0;
}

.ws-stack {
  display: flex; flex-direction: column;
  gap: 2px;
  text-align: left;
  min-width: 0;
}
.ws-mini {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-4);
  line-height: 1;
}
.ws-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.ws-pill .chev { color: var(--ink-4); flex-shrink: 0; }
.ws-pill:hover .chev { color: var(--ink-2); }

/* Workspace / Proje seçici dropdown */
.ws-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-3); z-index: 200; padding: 6px; }
.ws-menu[hidden] { display: none !important; }
.ws-menu-head { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); padding: 8px 10px 6px; }
.ws-menu-body { max-height: 400px; overflow-y: auto; padding: 2px; }
.ws-menu-empty { padding: 20px; text-align: center; color: var(--ink-4); font-size: 12.5px; }
.ws-menu-ws + .ws-menu-ws { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.ws-menu-ws-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px 4px; }
.ws-menu-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 6px var(--brand); }
.ws-menu-ws-name { font-size: 11.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.ws-menu-projects { display: flex; flex-direction: column; gap: 2px; padding-left: 4px; }
.ws-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: transparent; border: none; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; width: 100%; }
.ws-menu-item:hover { background: var(--surface-2); color: var(--ink); }
.ws-menu-item.active { background: var(--brand-wash); color: var(--brand); font-weight: 600; }
.ws-menu-item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-menu-item-badge { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 6px; background: var(--surface-2); border-radius: var(--r-pill); color: var(--ink-4); }
.ws-menu-foot { display: block; padding: 10px 12px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-3); text-decoration: none; font-weight: 500; }
.ws-menu-foot:hover { background: var(--surface-2); color: var(--ink); }

.ws-divider {
  width: 1px;
  background: var(--border);
  margin: 6px 0;
  align-self: stretch;
  flex-shrink: 0;
}

/* Search */
.topbar-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
}
.topbar-search:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
}
.topbar-search .s-ico { color: var(--ink-4); flex-shrink: 0; }
.topbar-search .s-hint { flex: 1; font-size: 13px; color: var(--ink-4); font-weight: 400; }
.topbar-search kbd {
  font-family: var(--f-kbd);
  font-size: 10px;
  color: var(--ink-3);
  padding: 2px 6px;
  background: var(--bg-2);
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Icon buttons */
.icon-btn[hidden] { display: none !important; }

/* FAB unread count badge */
.fab { position: relative; }
.fab-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: #ef4444; color: #fff;
  font-size: 10.5px; font-weight: 700;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg), 0 2px 6px rgba(0,0,0,.25);
  pointer-events: none;
}

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  background: transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  border-radius: var(--r-md);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.icon-btn.has-dot::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--brand);
  border: 2px solid var(--bg-2);
}
/* Bell bildirim dropdown (R7.9) */
.bell-wrap { position: relative; }
.bell-count {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 14px;
  padding: 0 4px;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: var(--f-mono, monospace);
  font-size: 9px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  box-shadow: 0 0 0 2px var(--bg);
}
.bell-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3, 0 10px 30px rgba(0,0,0,.35));
  z-index: 200;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.bell-dropdown[hidden] { display: none !important; }
.bell-count[hidden]    { display: none !important; }

/* SweetAlert2 drawer'ların üstünde görünsün (R11 drawer 9999) */
.swal2-container { z-index: 100000 !important; }
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.bell-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.bell-read-all {
  background: transparent; border: 0; cursor: pointer;
  color: var(--brand); font-size: 11.5px; font-weight: 600;
  padding: 4px 8px; border-radius: var(--r-sm);
}
.bell-read-all:hover { background: var(--brand-wash); }
.bell-body {
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
}
.bell-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .12s ease;
}
.bell-item:hover { background: var(--surface-2); }
.bell-item.unread { background: color-mix(in srgb, var(--brand) 6%, transparent); border-left: 3px solid var(--brand); padding-left: 11px; }
.bell-item-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.bell-item-body  { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; max-height: 32px; overflow: hidden; }
.bell-item-time  { font-size: 10.5px; color: var(--ink-5); margin-top: 4px; }
.bell-empty { padding: 28px 14px; text-align: center; color: var(--ink-5); font-size: 12.5px; }
.bell-foot {
  display: block;
  padding: 10px;
  text-align: center;
  font-size: 12px; font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  border-top: 1px solid var(--border);
}
.bell-foot:hover { background: var(--surface-2); }

/* Görev #2 — mobil bildirim paneli viewport dışına taşıyordu.
   Mobilde absolute (parent referans) yerine fixed konumlandır:
   sol/sağ kenara 8px boşluk, üst bar altına sabitle. Tam ekran genişliği,
   içerik kesilmez, panel header dahil okunur kalır. */
@media (max-width: 640px) {
  .bell-dropdown {
    position: fixed;
    top: 60px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 80px);
  }
  .bell-body { max-height: calc(100vh - 220px); }
}

.icon-btn .count {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 17px;
  height: 14px;
  padding: 0 4px;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 2px var(--bg-2);
}

/* User chip — larger, matches workspace selector */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  height: 42px;
}
.user-chip:hover { background: var(--surface-3); border-color: var(--border-2); }
.user-chip .user-chev { color: var(--ink-4); flex-shrink: 0; margin-left: 2px; }
.user-chip:hover .user-chev { color: var(--ink-2); }
.user-monogram {
  width: 32px; height: 32px;
  background: #3d6bd4;
  color: #fff;
  font-family: var(--f-sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  /* overflow: hidden KALDIRILDI — badge ::after kesilmesin.
     img kendi border-radius'ı ile yuvarlak görünür, parent overflow'una gerek yok. */
}
.user-monogram img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
  border-radius: 50%;
}
.user-monogram::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 9px; height: 9px;
  background: var(--success);
  border: 2px solid var(--bg-2);
  border-radius: 50%;
  z-index: 1;
}

.user-chip .user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.user-chip .user-role {
  font-family: var(--f-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-4);
  margin-top: 2px;
  font-weight: 600;
}

/* ───────────────────────── Sidebar ───────────────────────── */
.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--t-md);
}
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .label,
.sidebar.collapsed .count,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sh-label,
.sidebar.collapsed .sh-title,
.sidebar.collapsed .sh-meta,
.sidebar.collapsed .st-text { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-head { padding: var(--s-4) var(--s-3); align-items: center; }

.sidebar-head {
  padding: var(--s-5) var(--s-4) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-bottom: 1px solid var(--border);
}
.sidebar-head .sh-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 700;
}
.sidebar-head .sh-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.sidebar-head .sh-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: -0.01em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.sidebar-nav {
  flex: 1;
  padding: var(--s-3) var(--s-3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-family: var(--f-sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  padding: 0 var(--s-3) 8px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .12s;
}
.nav-section-label::after {
  content: '';
  width: 8px; height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform .15s;
  opacity: 0.6;
}
.nav-section-label:hover { color: var(--ink-2); }
.nav-section-label:hover::after { opacity: 1; }
.nav-section.collapsed > .nav-item { display: none; }
.nav-section.collapsed > .nav-section-label::after {
  transform: rotate(-45deg);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: all var(--t-fast);
  border-radius: var(--r-sm);
  letter-spacing: -0.005em;
}
.nav-item svg {
  width: 15px; height: 15px;
  color: currentColor;
  flex-shrink: 0;
  stroke-width: 1.8;
}
.nav-item:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-item.active {
  color: var(--brand);
  background: var(--brand-wash);
  font-weight: 600;
}
/* Yakında gelecek modüller — tıklanabilir görünse de aktif olmaz (href=#). Opasite düşük, pill rozetli. */
.nav-item.is-upcoming,
.mobile-nav-item.is-upcoming { opacity: 0.55; cursor: not-allowed; }
.nav-item.is-upcoming:hover,
.mobile-nav-item.is-upcoming:hover { background: transparent; color: var(--ink-4); }
.upcoming-pill {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-5);
  text-transform: uppercase;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  box-shadow: 0 0 12px var(--brand);
}

.nav-item .label { flex: 1; }

.nav-item .count {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.nav-item.has-badge .count {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 1px 6px;
  border-radius: var(--r-pill);
  font-size: 9.5px;
  font-weight: 700;
}
.nav-item.active .count { color: var(--brand); }
/* Active + badge birlikte olunca brand-on-brand erimesin — rozet surface arka plana döner */
.nav-item.active.has-badge .count { background: var(--surface); color: var(--brand); }

/* Sidebar foot — collapse toggle */
.sidebar-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-toggle {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  cursor: pointer;
}
.sidebar-toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}
.sidebar-toggle svg { width: 15px; height: 15px; stroke-width: 1.8; flex-shrink: 0; transition: transform var(--t-md); }
.sidebar.collapsed .sidebar-toggle { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .st-text { display: none; }
.st-text { flex: 1; text-align: left; }
.st-kbd {
  margin-left: auto;
  font-family: var(--f-kbd);
  font-size: 10px;
  color: var(--ink-4);
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  letter-spacing: -0.02em;
}

/* ───────────────────────── Page Header ───────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-4);
  font-weight: 700;
}
.page-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--brand-wash);
}
.page-eyebrow .sep { color: var(--ink-5); }

.page-title {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.028em;
}
.page-lede {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 6px;
  max-width: 640px;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

/* ───────────────────────── FAB ───────────────────────── */
.fab-stack {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  padding: 48px 7px;
  border-radius: var(--r-pill);
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(3px) saturate(0.8);
  -webkit-backdrop-filter: blur(3px) saturate(0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20);
}
[data-theme="light"] .fab-stack {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(15, 23, 42, 0.04);
}

.fab {
  width: 44px;
  height: 44px;
  background: transparent;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-md) var(--ease-spring);
  position: relative;
  border-radius: 50%;
}
.fab:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.fab svg { width: 19px; height: 19px; stroke-width: 1.7; }

/* FAB tooltip — butonun SOLUNDA konumlanır, glass-uyumlu, palet uyumlu */
.fab[data-tooltip] { position: relative; }
.fab[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(15, 23, 42, 0.92);
  color: #f1f5f9;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s var(--ease-out, ease), transform .18s var(--ease-spring, ease);
  z-index: 90;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.fab[data-tooltip]::before {
  content: '';
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  border: 6px solid transparent;
  border-left-color: rgba(15, 23, 42, 0.92);
  opacity: 0;
  transition: opacity .15s ease, transform .18s var(--ease-spring, ease);
  pointer-events: none;
  z-index: 90;
}
.fab[data-tooltip]:hover::after,
.fab[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.fab[data-tooltip]:hover::before,
.fab[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
/* Açık tema — tooltip yine koyu ama ton biraz farklı (genel paletten) */
[data-theme="light"] .fab[data-tooltip]::after {
  background: rgba(30, 41, 59, 0.95);
  color: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}
[data-theme="light"] .fab[data-tooltip]::before { border-left-color: rgba(30, 41, 59, 0.95); }

.fab-brand {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 0 20px rgba(153, 213, 26, 0.3);
}
.fab-brand:hover {
  background: var(--brand-2);
  color: var(--brand-ink);
  transform: scale(1.08);
  box-shadow: 0 0 28px rgba(153, 213, 26, 0.5);
}

/*
  Ghost-style branded FABs — arka plan transparan, ayrım sadece ikon renginden.
  Hover'da o rengin soft tint'i arka plana gelir. Sakin, modern, renk çakışması yok.
*/
.fab-ai      { background: transparent; color: #a78bfa; }           /* AI: indigo */
.fab-ai:hover{ background: rgba(167, 139, 250, 0.14); color: #8b5cf6; transform: scale(1.08); }

.fab-wa      { background: transparent; color: #25d366; }           /* Mesajlar: WA yeşili */
.fab-wa:hover{ background: rgba(37, 211, 102, 0.14); color: #1fb855; transform: scale(1.08); }

.fab-ig      { background: transparent; color: #dc2743; }           /* Instagram */
.fab-ig:hover{ background: rgba(220, 39, 67, 0.14); transform: scale(1.08); }

.fab-notes   { background: transparent; color: #f59e0b; }           /* Notlar: amber */
.fab-notes:hover{ background: rgba(245, 158, 11, 0.14); color: #d97706; transform: scale(1.08); }

.fab-roxchat { background: transparent; color: #3d6bd4; }           /* Takım sohbeti: mavi */
.fab-roxchat:hover{ background: rgba(61, 107, 212, 0.14); color: #2e5abf; transform: scale(1.08); }

.fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 14px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  border: 2px solid var(--bg);
}
.fab-badge[hidden] { display: none !important; }

/* ───────────────────────── Mobile (<1024px) ───────────────────────── */
@media (max-width: 1023px) {
  .sidebar { display: none; }

  /* Compact topbar */
  .topbar {
    padding: 0 12px;
    height: 56px;
    gap: 8px;
  }
  .topbar-left { gap: 6px; flex-shrink: 1; min-width: 0; }
  .topbar-center { display: none; }
  /* Mobile: topbar-right'ı viewport sağ kenarına pinle.
     margin-left:auto solda kalan tüm boşluğu kapatır → ikon grubu sağa hizalı,
     bell-dropdown / user-menu pozisyonlama referansları sabit kalır. */
  .topbar-right {
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
    padding-right: 4px;
  }

  .masthead { padding: 4px 6px 4px 4px; flex-shrink: 0; }
  .masthead .mast-wordmark { display: none; }

  /* Compact workspace + project selector — kompakt inline gösterim */
  .ws-selector { height: 36px; flex-shrink: 1; min-width: 0; max-width: none; }
  .ws-divider { display: block; height: 18px; }
  .ws-selector .ws-pill { padding: 0 8px; gap: 6px; flex-shrink: 1; min-width: 0; }
  .ws-selector .ws-pill:last-child .chev { display: none; }
  .ws-stack { min-width: 0; }
  .ws-stack .ws-mini { display: none; }
  .ws-stack .ws-name { font-size: 12px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Icon-only user chip */
  .icon-btn { width: 34px; height: 34px; }
  .user-chip {
    height: 36px; width: 36px;
    padding: 3px;
    border-radius: 50%;
    justify-content: center;
  }
  .user-chip > div:not(.user-monogram),
  .user-chip .user-chev { display: none; }
  .user-chip .user-monogram { width: 30px; height: 30px; }

  /* FAB stack → mobile: hidden by default, "Araçlar" tıklanınca açılır */
  .fab-stack {
    top: auto;
    bottom: 76px;
    right: 12px;
    left: 12px;
    transform: translateY(150%);
    flex-direction: row;
    justify-content: space-around;
    padding: 10px;
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--sh-3);
    border: 1px solid var(--border-2);
    display: flex;
    transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 220ms;
    opacity: 0;
    pointer-events: none;
    z-index: 90;
  }
  .fab-stack.show-mobile {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .fab-stack::before { display: none; }
  .fab { width: 44px; height: 44px; }
  .mobile-nav-tools.active {
    background: var(--brand-wash);
    color: var(--brand);
  }
  .mobile-nav-tools.active svg { color: var(--brand); }

  /* Content */
  .content-inner { padding: 16px 14px 140px; max-width: none; }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-title { font-size: 24px; }
  .page-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .page-actions .btn { flex: 1 1 auto; }

  .mobile-nav {
    display: flex !important;
    visibility: visible !important;
    /* PWA/iOS dokunmatik kaydırma için artırılmış yükseklik (kullanıcı kararı). */
    height: calc(80px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 70;
    width: 100%;
  }
  /* Make room for the fixed mobile nav so content isn't hidden */
  .app-content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav-scroll {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  .mobile-nav-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .mobile-nav-item {
    flex-shrink: 0; /* KRİTİK: yatay scroll için item'lar daralmamalı */
    min-width: 78px; /* daha geniş hit-area, kaydırma kolaylığı */
    height: 76px;    /* mobil-nav 80px → item 76px (üst-alt 2px boşluk) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    color: var(--ink-4);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
  }
  .mobile-nav-item svg { width: 22px; height: 22px; stroke-width: 1.7; }
  .mobile-nav-item.active { color: var(--brand); }
  /* Mobile nav count badge — sağ üstte küçük nokta-rozet */
  .mobile-nav-item .mobile-nav-count {
    position: absolute;
    top: 8px; right: 10px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: var(--brand);
    color: var(--brand-ink);
    border-radius: var(--r-pill);
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  /* `display: flex` spesifite ile browser default `[hidden] { display:none }`'ı
     ezer → JS `el.hidden=true` set etse bile boş yeşil dot olarak görünüyordu
     (sidebar'da doğru gizleniyor, mobile'da yanlış görünüyordu — tutarsızlık). */
  .mobile-nav-item .mobile-nav-count[hidden] { display: none !important; }
  .mobile-nav-item.active::after {
    content: "";
    position: absolute;
    top: 0; left: 14px; right: 14px;
    height: 2px;
    background: var(--brand);
    box-shadow: 0 2px 12px var(--brand);
  }
  .mobile-nav-tools {
    width: 64px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }
  .mobile-nav-tools svg { width: 22px; height: 22px; }

  /* R11.6 — Genel Arama FAB'ı yalnız mobilde Araçlar bottom-sheet içinde gösterilir */
  .fab-mobile-only { display: flex !important; }
}
/* Desktop'ta mobile-only FAB hiç görünmez */
@media (min-width: 1024px) {
  .fab-mobile-only { display: none !important; }
  .mobile-nav { display: none !important; }
}

/* ───────────────────────── App Footer (V1 paritesi) ─────────────────────────
   Lisans + version bilgisi. `.content-inner` altına konumlanır; sayfa içeriğiyle
   birlikte scroll olur. Version linki tıklanınca changelog modal açılır.
   =========================================================================== */
.app-footer {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px clamp(16px, 3.5vw, 56px) 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
}
@media (min-width: 1600px) { .app-footer { max-width: 1640px; } }
@media (min-width: 1920px) { .app-footer { max-width: min(1800px, 92vw); } }

.app-footer .foot-left,
.app-footer .foot-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-footer .foot-year { color: var(--ink-4); font-weight: 500; }
.app-footer .foot-product {
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--t-fast);
}
.app-footer .foot-product:hover { color: var(--brand); }
.app-footer .foot-license {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-wash);
  color: var(--brand);
  border: 1px solid var(--brand-ring);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.app-footer .foot-version {
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--r-md);
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.app-footer .foot-version:hover {
  color: var(--brand);
  border-color: var(--brand-ring);
  background: var(--brand-wash);
}
.app-footer .foot-version svg { width: 13px; height: 13px; stroke-width: 1.8; }

@media (max-width: 640px) {
  .app-footer {
    /* Row düzenini koru — flex-wrap ile sığmayanlar doğal sarar.
       Mobil-nav boşluğu zaten .content-inner'ın padding-bottom: 140px'inde. */
    padding: 15px 5px;
    font-size: 11.5px;
    gap: 10px;
    align-items: center;
  }
  .app-footer .foot-left { flex: 1 1 auto; min-width: 0; gap: 6px; }
  .app-footer .foot-product {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .app-footer .foot-right { flex-shrink: 0; }
  .app-footer .foot-version {
    padding: 4px 10px;
    font-size: 11px;
  }
  .app-footer .foot-version svg { width: 12px; height: 12px; }
}

@media (max-width: 380px) {
  /* Çok dar ekranlarda ürün metni kısaltılır; version butonu küçük badge'e döner */
  .app-footer .foot-product {
    font-size: 11px;
  }
  .app-footer .foot-license { display: none; } /* lisans chip gizlenir — yer açmak için */
}

/* ───────────────────────── Changelog Modal (V1 paritesi) ───────────────────── */
.rox-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1060;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}
.rox-modal-backdrop[data-open="true"] {
  display: flex;
  opacity: 1;
}
.rox-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  max-width: 620px;
  width: 100%;
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-2);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
.rox-modal-backdrop[data-open="true"] .rox-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.rox-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rox-modal-head h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.rox-modal-head h2 .cl-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--brand-wash);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-ring);
}
.rox-modal-head .rox-modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  color: var(--ink-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: transparent;
  border: 1px solid transparent;
}
.rox-modal-head .rox-modal-close:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}
.rox-modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.rox-modal-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.rox-modal-foot .btn-close-modal {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
}
.rox-modal-foot .btn-close-modal:hover {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--border-hover);
}

/* Changelog content inside modal */
.changelog-entry { margin-bottom: 24px; }
.changelog-entry:last-child { margin-bottom: 0; }
.changelog-entry + .changelog-entry {
  border-top: 1px dashed var(--border);
  padding-top: 20px;
}
.changelog-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.changelog-meta .cl-ver {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand);
  background: var(--brand-wash);
  border: 1px solid var(--brand-ring);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
}
.changelog-meta .cl-date {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
}
.changelog-entry ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.changelog-entry li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.changelog-entry li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
  margin-top: 7px;
  flex-shrink: 0;
}
.changelog-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--ink-4);
  font-size: 13px;
}
.changelog-error {
  padding: 14px 16px;
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: var(--r-md);
  color: #f87171;
  font-size: 13px;
}

/* ── Görev #1 — Click Guard görsel state ──
   data-rox-guard veya rox.guard.lock() ile kilitlenen butonlar görsel olarak feedback verir. */
.rox-busy {
  opacity: 0.7;
  cursor: wait !important;
  pointer-events: none;
}
.rox-busy-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rox-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes rox-spin {
  to { transform: rotate(360deg); }
}
