*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
    
:root {
  --sidebar-width: 260px; --sidebar-collapsed: 72px; --topbar-height: 68px; --bottom-nav-height: 64px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  
  --primary: #4f46e5; --primary-hover: #4338ca;
  --bg-main: #FAFAFA; --bg-sidebar: #FFFFFF; --bg-topbar: rgba(255, 255, 255, 0.85); --bg-card: #FFFFFF; 
  --bg-hover: #F4F4F5; --bg-input: #F4F4F5;
  
  --text-primary: #18181B; --text-secondary: #52525B; --text-muted: #A1A1AA;
  --border-light: #E4E4E7; --border-strong: #D4D4D8;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04); 
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05); 
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.18);
  
  /* Sidebar Ikon Renkleri */
  --icon-navy: #3730A3; --icon-teal: #0F766E; --icon-orange: #C2410C; 
  --icon-purple: #6D28D9; --icon-amber: #B45309; --icon-rose: #BE123C;

  /* Mobil Alt Menü Aktif İkon Rengi */
  --mobile-active-orange: #f95721;
}

html, body { 
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; 
  background: var(--bg-main); 
  color: var(--text-primary); 
  height: 100%; 
  width: 100%;
  overflow: hidden; 
}

#app { display: flex; height: 100%; width: 100vw; overflow: hidden; position: relative; }

/* İKON ORTAK STİLLERİ & GLOBAL EMNİYET FRENİ (Dev olmalarını engeller) */
svg.stroke-icon { 
  fill: none; 
  stroke: currentColor; 
  stroke-width: 1.8; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
  width: 24px; 
  height: 24px; 
  max-width: 100%; 
  flex-shrink: 0; 
}

/* SIDEBAR (DESKTOP MİMARİSİ) */
.sidebar { 
  width: var(--sidebar-width); 
  min-width: var(--sidebar-width); 
  background: var(--bg-sidebar); 
  border-right: 1px solid var(--border-light); 
  display: flex; 
  flex-direction: column; 
  height: 100%; 
  z-index: 1000; 
  flex-shrink: 0; 
  transition: var(--transition); 
  position: relative; 
  box-shadow: var(--shadow-sm); 
}
.sidebar.collapsed { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 20px 14px; overflow: hidden; }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; margin-bottom: 4px; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-primary); overflow: hidden; padding-left: 4px; }
.sidebar-brand .logo-icon { width: 32px; height: 32px; background: var(--text-primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: #ffffff; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.sidebar-brand h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; white-space: nowrap; transition: var(--transition); }
.sidebar-brand h2 span { color: var(--text-muted); font-weight: 500; }

.sidebar-collapse-btn { width: 28px; height: 28px; border-radius: 6px; background: transparent; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.mobile-sidebar-close-btn { display: none; width: 32px; height: 32px; border-radius: var(--radius-sm); background: transparent; border: none; color: var(--text-primary); cursor: pointer; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }

/* İÇ KAYDIRMA ALANI - FLEX MİMARİSİ */
.sidebar-nav-wrapper { 
  flex: 1 1 auto; 
  min-height: 0; 
  overflow-y: auto; 
  overflow-x: hidden; 
  padding-right: 4px; 
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sidebar-nav-wrapper::-webkit-scrollbar { width: 3px; }
.sidebar-nav-wrapper::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.sidebar-nav .nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); padding: 16px 12px 6px; white-space: nowrap; }
.sidebar-nav .nav-item { margin-bottom: 2px; position: relative; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text-secondary); text-decoration: none; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; transition: var(--transition); cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; }

.sidebar-nav .nav-link svg.stroke-icon { width: 18px; height: 18px; flex-shrink: 0; transition: var(--transition); opacity: 0.85; }
.sidebar-nav .nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-nav .nav-link:hover svg.stroke-icon { opacity: 1; transform: scale(1.05); }

.sidebar-nav .nav-link.active { color: var(--primary); background: #EEF2FF; font-weight: 600; }
.sidebar-nav .nav-link.active svg.stroke-icon { opacity: 1; color: var(--primary) !important; }

.sidebar-nav .arrow { margin-left: auto; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); display: flex; align-items: center; }
.sidebar-nav .arrow svg { width: 14px; height: 14px; }
.sidebar-nav .arrow.open { transform: rotate(90deg); }

.sidebar-nav .submenu { max-height: 0; overflow: hidden; transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1); margin-left: 20px; padding-left: 12px; border-left: 1px solid var(--border-light); }
.sidebar-nav .submenu.open { max-height: 400px; padding-top: 4px; padding-bottom: 4px; margin-top: 4px; }
.sidebar-nav .submenu .sub-link { display: flex; align-items: center; padding: 8px 12px; color: var(--text-secondary); text-decoration: none; font-size: 12.5px; font-weight: 500; border-radius: 6px; transition: var(--transition); cursor: pointer; position: relative; }
.sidebar-nav .submenu .sub-link::before { content:''; position: absolute; left: -13px; top: 50%; width: 12px; height: 1px; background: transparent; transition: var(--transition); }
.sidebar-nav .submenu .sub-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-nav .submenu .sub-link.active { color: var(--primary); font-weight: 600; }
.sidebar-nav .submenu .sub-link.active::before { background: var(--primary); }

.sidebar.collapsed .sidebar-brand h2 { opacity: 0; width: 0; display: none; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-nav .nav-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-nav .nav-text, .sidebar.collapsed .sidebar-nav .arrow { display: none; }
.sidebar.collapsed .sidebar-nav .submenu { max-height: 0 !important; padding: 0; border: none; margin: 0; }

/* MAIN CONTENT & TOPBAR */
.main-content { flex: 1; display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--bg-main); position: relative; }
.top-bar { height: var(--topbar-height); padding: 0 32px; background: var(--bg-topbar); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; z-index: 100; flex-shrink: 0; position: relative; }

.top-bar .left { display: flex; align-items: center; gap: 16px; }
.top-bar .left .menu-toggle { display: none; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text-primary); align-items: center; justify-content: center; cursor: pointer; }

.top-bar .right { display: flex; align-items: center; gap: 16px; margin-left: auto; }

/* SEARCH TRIGGER */
.search-trigger { display: flex; align-items: center; gap: 12px; background: var(--bg-input); border: 1px solid transparent; border-radius: var(--radius-md); padding: 0 12px 0 16px; height: 40px; width: 260px; cursor: pointer; transition: var(--transition); color: var(--text-muted); }
.search-trigger:hover { border-color: var(--border-strong); background: var(--bg-card); color: var(--text-primary); }
.search-trigger span.placeholder { flex: 1; font-size: 13px; font-weight: 500; text-align: left; }
.kbd-shortcut { background: var(--bg-card); border: 1px solid var(--border-strong); padding: 3px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; color: var(--text-secondary); pointer-events: none; }

/* KULLANICI MENÜSÜ */
.top-user-menu-wrapper { position: relative; }
.top-user-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.top-user-btn:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-hover); }

.top-user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 200px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px; display: none; flex-direction: column; gap: 2px; z-index: 2000; animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.top-user-dropdown.active { display: flex; }
.top-user-dropdown-header { padding: 10px 12px; margin-bottom: 4px; }
.top-user-dropdown-header .uname { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.top-user-dropdown-header .urole { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.top-user-dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }

.top-user-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); text-decoration: none; font-size: 12.5px; font-weight: 500; transition: var(--transition); cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; }
.top-user-dropdown-item svg { width: 14px; height: 14px; opacity: 0.8; }
.top-user-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.top-user-dropdown-item.logout { color: var(--icon-rose); }
.top-user-dropdown-item.logout:hover { background: #FFF1F2; color: var(--icon-rose); }

.content-area { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; z-index: 10; }
.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.page-wrapper { width: 100%; min-height: 100%; display: flex; flex-direction: column; }

/* COMMAND PALETTE */
.cmd-palette-overlay { position: fixed; inset: 0; background: rgba(24, 24, 27, 0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 9999; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; opacity: 0; transition: opacity 0.2s ease; }
.cmd-palette-overlay.active { display: flex; opacity: 1; }
.cmd-palette { width: 100%; max-width: 600px; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); border: 1px solid var(--border-light); display: flex; flex-direction: column; overflow: hidden; transform: scale(0.98); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.cmd-palette-overlay.active .cmd-palette { transform: scale(1); }

.cmd-header { display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border-light); }
.cmd-header svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }
.cmd-input { flex: 1; height: 64px; border: none; background: transparent; outline: none; font-size: 16px; font-family: inherit; font-weight: 500; color: var(--text-primary); padding: 0 16px; }
.cmd-input::placeholder { color: var(--text-muted); }
.cmd-esc { font-size: 10px; font-weight: 700; color: var(--text-muted); background: var(--bg-input); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border-light); }

.cmd-body { max-height: 380px; overflow-y: auto; padding: 12px; }
.cmd-body::-webkit-scrollbar { width: 4px; }
.cmd-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.cmd-group-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px; }
.cmd-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition); }
.cmd-item:hover, .cmd-item.selected { background: var(--bg-hover); }
.cmd-item-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; box-shadow: var(--shadow-sm); }
.cmd-item-icon svg { width: 16px; height: 16px; }
.cmd-item-content { flex: 1; display: flex; flex-direction: column; }
.cmd-item-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.cmd-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cmd-item-action { font-size: 11px; color: var(--primary); font-weight: 600; opacity: 0; transition: opacity 0.2s; }
.cmd-item:hover .cmd-item-action, .cmd-item.selected .cmd-item-action { opacity: 1; }

/* GLOBAL ANİMASYONLAR */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* MOBİL MİMARİ & SAFARI IOS KORUMALI DÜZENLEMELER */
.mobile-bottom-nav { 
  display: none; 
  position: fixed; 
  bottom: 0; 
  left: 0; 
  width: 100%; 
  height: var(--bottom-nav-height); 
  background: var(--bg-card); 
  border-top: 1px solid var(--border-light); 
  z-index: 2600; 
  padding-bottom: env(safe-area-inset-bottom); 
  justify-content: space-around; 
  align-items: center; 
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06); 
}

.mobile-nav-item { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  gap: 3px; 
  color: var(--text-muted); 
  font-size: 10px; 
  font-weight: 600; 
  flex: 1; 
  height: 100%; 
  background: transparent; 
  border: none; 
  cursor: pointer; 
  transition: color 0.2s ease; 
}
.mobile-nav-item svg { 
  width: 22px; 
  height: 22px; 
  transition: transform 0.2s ease, stroke 0.2s ease, color 0.2s ease;
  color: var(--text-muted);
  stroke: currentColor;
}

.mobile-nav-item.active { color: var(--text-secondary); font-weight: 700; }
.mobile-nav-item.active svg { color: var(--mobile-active-orange) !important; stroke: var(--mobile-active-orange) !important; transform: translateY(-1px) scale(1.08); }

.sidebar-overlay { 
  display: none; 
  position: fixed; 
  inset: 0; 
  background: rgba(15, 23, 42, 0.55); 
  backdrop-filter: blur(3px); 
  -webkit-backdrop-filter: blur(3px);
  z-index: 2900; 
  opacity: 0; 
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
}
.sidebar-overlay.active { display: block; opacity: 1; }

@media (max-width: 768px) {
  .sidebar { 
    position: fixed; 
    top: 0; 
    bottom: 0;
    left: 0; 
    height: 100%;
    height: -webkit-fill-available;
    width: 285px !important; 
    max-width: 85vw !important;
    min-width: unset !important; 
    transform: translateX(-100%); 
    z-index: 3000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15); 
    border-right: none; 
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar.open { transform: translateX(0); }
  
  .sidebar-inner {
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .sidebar-nav-wrapper { 
    flex: 1 1 auto;
    min-height: 0; 
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; 
    padding-bottom: 24px;
  }
  
  .desktop-only { display: none !important; }
  .mobile-sidebar-close-btn { display: flex; }
  .top-bar { padding: 0 16px; height: 60px; }
  .top-bar .left .menu-toggle { display: flex; }
  
  .search-trigger { width: 40px; height: 40px; justify-content: center; padding: 0; background: transparent; border-color: transparent; }
  .search-trigger span.placeholder, .search-trigger .kbd-shortcut { display: none; }
  .search-trigger svg { width: 20px; height: 20px; color: var(--text-primary); }
  
  .content-area { padding-bottom: calc(var(--bottom-nav-height) + 16px); }
  .mobile-bottom-nav { display: flex; }
  
  .cmd-palette-overlay { padding-top: 5vh; padding-left: 16px; padding-right: 16px; }
  .cmd-palette { max-height: 80vh; }
  .cmd-input { font-size: 15px; height: 56px; }
}