/* ===== Uygulama iskeleti: masaüstü kenar çubuğu · tablet ikon çubuğu · telefon alt sekme çubuğu ===== */
.app { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--accent-text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; width: 100%; font-size: 14px; font-weight: 550; color: var(--text-2); border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer; text-align: left; position: relative; }
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav .badge-n { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--danger); border-radius: 9px; }
.nav-sep { height: 1px; margin: 8px 6px; background: var(--border); }
.nav-label { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.sidebar .foot { margin-top: auto; padding-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; flex-shrink: 0; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 17px; }
.topbar .spacer { flex: 1; }
.search-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px; color: var(--text-3); font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; min-width: 190px; }
.search-btn:hover { border-color: var(--accent); }
.search-btn kbd { margin-left: auto; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 24px 48px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { color: var(--text-2); margin-top: 2px; }

.tabbar { display: none; }

/* Tablet: ikon çubuğu */
@media (min-width: 641px) and (max-width: 1023px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 14px 8px; align-items: center; }
  .brand span, .nav a span, .nav button span, .nav-label, .user-chip .who, .nav .badge-n { display: none; }
  .nav a, .nav button { width: 44px; justify-content: center; padding: 0; }
  .brand { padding: 4px 0 14px; }
  .nav a[title]:hover::after { content: attr(title); position: absolute; left: 52px; padding: 4px 10px; background: var(--text); color: var(--bg); border-radius: 6px; font-size: 12px; white-space: nowrap; z-index: 5; }
}

/* Telefon: alt sekme çubuğu */
@media (max-width: 640px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 14px; height: 52px; }
  .search-btn { min-width: 0; width: 34px; padding: 0; justify-content: center; } .search-btn span, .search-btn kbd { display: none; }
  .content { padding: 14px 14px calc(var(--tabbar-h) + 24px); }
  .tabbar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); background: transparent; border: 0; cursor: pointer; position: relative; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { color: var(--accent); }
  .tabbar .i { width: 22px; height: 22px; }
  .more-menu { position: fixed; z-index: 44; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)); padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
  .more-menu a, .more-menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; color: var(--text); font-size: 14px; font-weight: 550; background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
  .more-menu a:hover { background: var(--surface-2); text-decoration: none; }
}
@media (min-width: 1440px) { .content { padding-left: 32px; padding-right: 32px; } }

/* Sayfa geçişi: kısa solma (View Transitions) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .15s; }

/* ===== Yazdırma (haftalık rapor, A4) ===== */
@media print {
  .sidebar, .topbar, .tabbar, .toasts, .no-print, .more-menu { display: none !important; }
  .app { display: block; } .main { min-height: 0; } .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  .card, .banner { box-shadow: none; break-inside: avoid; }
  :root { --bg: #fff; --surface: #fff; --text: #000; --text-2: #333; --text-3: #555; }
  @page { size: A4; margin: 12mm; }
}
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }


/* ===== Hesap menüsü (üst çubuk) ===== */
.user-menu { position: relative; }
.topbar-user { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; color: var(--text); background: none; border: 0; border-radius: 999px; cursor: pointer; }
.topbar-user:hover, .topbar-user[aria-expanded="true"] { background: var(--surface-2); }
.topbar-user .avatar { width: 30px; height: 30px; font-size: 12px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: min(280px, 92vw); padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-head b { display: block; overflow-wrap: anywhere; }
.menu-pop a, .menu-pop button[role="menuitem"] { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 10px; color: var(--text); font-size: 14px; font-weight: 550; background: none; border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; }
.menu-pop a:hover, .menu-pop button[role="menuitem"]:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .danger-item { color: var(--danger); }
.menu-context:not(:has(*)) { display: none; }
.menu-context { padding: 4px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-label { margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.menu-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.avatar-stack { display: inline-flex; } .avatar-stack .avatar { width: 26px; height: 26px; font-size: 11px; border: 2px solid var(--surface); } .avatar-stack .avatar + .avatar { margin-left: -8px; }
/* ===== Canlı bağlantı göstergesi (hesap menüsünde) ===== */
.avatar-wrap { position: relative; display: inline-flex; }
.live-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); background: var(--text-3); }
.live-dot.bagli { background: var(--success); } .live-dot.yedek { background: var(--warning); }
.live-dot.baglaniyor { animation: live-blink 1.2s ease-in-out infinite; }
@keyframes live-blink { 50% { opacity: .35; } }
.menu-avatar { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; font-size: 11px; font-weight: 650; color: var(--text-2); background: var(--surface-2); border-radius: 999px; white-space: nowrap; }
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.live-pill.bagli { color: var(--success); background: var(--success-soft); } .live-pill.bagli .dot { background: var(--success); }
.live-pill.yedek { color: var(--warning); background: var(--warning-soft); } .live-pill.yedek .dot { background: var(--warning); }
@media (prefers-reduced-motion: reduce) { .live-dot.baglaniyor { animation: none; } }

/* ===== Yapay zekâ ayarları: adımlar ve anahtar ===== */
.step-head { display: flex; align-items: center; gap: 12px; }
.step-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent); background: var(--accent-soft); border-radius: 50%; }
.ai-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 12px; }
.pb { padding-bottom: 8px; }
.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-ui { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); transition: background .15s; position: relative; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }