/* ==========================================================================
   Acil Tıp FOAMed Portalı — Modern Klinik & Resüsitasyon Tasarımı
   ========================================================================== */

:root {
  /* Renk Paleti - Modern Clinical Blue & Slate (Light Mode) */
  --em-bg: #f4f7fb;
  --em-surface: #ffffff;
  --em-surface-2: #eef2f8;
  --em-border: #dce4f0;
  --em-border-focus: #93c5fd;
  --em-text: #0f172a;
  --em-text-muted: #475569;
  --em-text-dim: #64748b;

  /* Modern Mavi Odaklı Klinik Vurgu Renkleri */
  --em-blue: #2563eb;
  --em-blue-dark: #1d4ed8;
  --em-blue-soft: #eff6ff;
  --em-blue-glow: rgba(37, 99, 235, 0.16);

  --em-cyan: #0284c7;
  --em-cyan-soft: #e0f2fe;

  --em-purple: #4f46e5;
  --em-purple-soft: #eef2ff;

  --em-green: #0d9488;
  --em-green-soft: #ccfbf1;

  --em-amber: #d97706;
  --em-amber-soft: #fef3c7;

  /* Kritik Uyarı Rengi (Göz yormayan dengeli ton) */
  --em-red: #dc2626;
  --em-red-dark: #b91c1c;
  --em-red-soft: #fef2f2;
  --em-red-glow: rgba(220, 38, 38, 0.12);

  /* Kart & Gölgeler */
  --em-radius-sm: 8px;
  --em-radius: 12px;
  --em-radius-lg: 16px;
  --em-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --em-shadow: 0 2px 12px -2px rgba(30, 58, 138, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --em-shadow-lg: 0 8px 24px -4px rgba(30, 58, 138, 0.1), 0 3px 8px -2px rgba(15, 23, 42, 0.04);

  --em-nav-height: 58px;
  --em-bottom-bar-height: 60px;
}

/* Koyu Mod (Deep Navy / Gece Nöbeti Teması) */
[data-theme="dark"] {
  --em-bg: #0b1120;
  --em-surface: #111827;
  --em-surface-2: #1e293b;
  --em-border: #26334d;
  --em-border-focus: #3b82f6;
  --em-text: #f1f5f9;
  --em-text-muted: #94a3b8;
  --em-text-dim: #64748b;

  --em-blue: #3b82f6;
  --em-blue-dark: #2563eb;
  --em-blue-soft: rgba(59, 130, 246, 0.15);
  --em-cyan-soft: rgba(2, 132, 199, 0.15);
  --em-purple-soft: rgba(79, 70, 229, 0.15);
  --em-green-soft: rgba(13, 148, 136, 0.15);
  --em-amber-soft: rgba(217, 119, 6, 0.15);
  --em-red-soft: rgba(220, 38, 38, 0.15);

  --em-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --em-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.45);
  --em-shadow-lg: 0 12px 30px -6px rgba(0, 0, 0, 0.65);
}

/* Temel Sıfırlamalar */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--em-bg);
  color: var(--em-text);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding-bottom: calc(var(--em-bottom-bar-height) + 16px);
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* Navigasyon Barı */
.em-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--em-nav-height);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  transition: background 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .em-navbar {
  background: rgba(17, 24, 39, 0.92);
}

.em-navbar-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 max(20px, 2.5vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.em-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.em-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--em-blue), var(--em-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 3px 10px var(--em-blue-glow);
  position: relative;
  overflow: hidden;
}

.em-brand-icon::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), transparent);
}

.em-brand-title {
  display: flex;
  flex-direction: column;
}

.em-brand-title span:first-child {
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--em-text), var(--em-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.em-brand-badge {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--em-blue);
}

/* Nav Menü Linkleri (Desktop) */
.em-nav-links {
  display: none;
  align-items: center;
  gap: 6px;
}

@media (min-width: 992px) {
  .em-nav-links {
    display: flex;
  }
}

.em-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--em-radius-sm);
  color: var(--em-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.em-nav-link:hover, .em-nav-link.active {
  color: var(--em-text);
  background: var(--em-surface-2);
}

.em-nav-link.active {
  color: var(--em-blue);
}

/* Arama Butonu (Command+K Tetikleyici) */
.em-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--em-surface-2);
  border: 1px solid var(--em-border);
  border-radius: 30px;
  padding: 8px 16px;
  color: var(--em-text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

@media (max-width: 768px) {
  .em-search-trigger {
    min-width: auto;
    padding: 8px 12px;
  }
  .em-search-trigger .shortcut-hint,
  .em-search-trigger .search-text {
    display: none;
  }
}

.em-search-trigger:hover {
  border-color: var(--em-red);
  color: var(--em-text);
}

.shortcut-hint {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: auto;
}

/* Hızlı Butonlar & Tema Değiştirici */
.em-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.em-btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--em-surface-2);
  border: 1px solid var(--em-border);
  color: var(--em-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.em-btn-icon:hover {
  background: var(--em-border);
}

/* Resüsitasyon Kırmızı Çubuğu (Resuscitation Fast Bar) */
.em-fast-bar {
  background: linear-gradient(90deg, #be123c, #e11d48, #9f1239);
  color: #fff;
  padding: 7px 0;
  font-size: 0.85rem;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.3);
}

.em-fast-bar-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 max(20px, 2.5vw);
  display: flex;
  align-items: center;
  gap: 15px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.em-fast-bar-container::-webkit-scrollbar {
  display: none;
}

.em-fast-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,0.3);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.em-fast-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  transition: all 0.2s ease;
}

.em-fast-btn:hover {
  background: #ffffff;
  color: var(--em-red);
}

/* Ana Sayfa İçerik Konteynırı — Tüm Ekrana Yayılan Akıcı Düzen */
.em-main-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 24px max(20px, 2.5vw) 60px;
}

/* Hero / Karşılama Başlığı */
.em-hero {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 45%, #eff6ff 100%);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius-lg);
  padding: 35px 30px;
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: var(--em-shadow);
}

[data-theme="dark"] .em-hero {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid var(--em-border);
}

.em-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--em-blue-soft);
  color: var(--em-blue);
  margin-bottom: 10px;
}

.em-hero-title {
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.em-hero-subtitle {
  color: var(--em-text-muted);
  font-size: 0.88rem;
  max-width: 720px;
  margin-bottom: 14px;
}

/* Kart Yapıları */
.em-card {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius);
  padding: 18px 20px;
  box-shadow: var(--em-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.em-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--em-shadow-lg);
  border-color: var(--em-border-focus);
}

.em-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.em-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.icon-red { background: var(--em-red-soft); color: var(--em-red); }
.icon-blue { background: var(--em-blue-soft); color: var(--em-blue); }
.icon-cyan { background: var(--em-cyan-soft); color: var(--em-cyan); }
.icon-green { background: var(--em-green-soft); color: var(--em-green); }
.icon-amber { background: var(--em-amber-soft); color: var(--em-amber); }
.icon-purple { background: var(--em-purple-soft); color: var(--em-purple); }

.em-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-red { background: var(--em-red-soft); color: var(--em-red); }
.badge-blue { background: var(--em-blue-soft); color: var(--em-blue); }
.badge-green { background: var(--em-green-soft); color: var(--em-green); }
.badge-amber { background: var(--em-amber-soft); color: var(--em-amber); }
.badge-purple { background: var(--em-purple-soft); color: var(--em-purple); }

/* Grid Düzenleri */
.em-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.em-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.em-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

/* Hesaplayıcı Arayüzü & Butonlar */
.calc-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 7px;
  border: 1px solid var(--em-border);
  background: var(--em-surface);
  border-radius: var(--em-radius-sm);
  color: var(--em-text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.calc-option-btn:hover {
  background: var(--em-surface-2);
  border-color: var(--em-blue);
}

.calc-option-btn.selected {
  background: var(--em-blue-soft);
  border-color: var(--em-blue);
  color: var(--em-blue);
  font-weight: 700;
}

/* Canlı Skor Göstergesi */
.live-score-card {
  position: sticky;
  top: 76px;
  background: var(--em-surface);
  border: 2px solid var(--em-border);
  border-radius: var(--em-radius-lg);
  padding: 20px;
  box-shadow: var(--em-shadow-lg);
  text-align: center;
}

.score-display {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 12px 0 8px;
}

.score-success { color: var(--em-green); }
.score-warning { color: var(--em-amber); }
.score-danger { color: var(--em-red); }

/* Mobil Alt Gezinme Barı (Mobile Bottom Nav) */
.em-bottom-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--em-bottom-bar-height);
  background: var(--em-surface);
  border-top: 1px solid var(--em-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

@media (min-width: 1024px) {
  .em-bottom-bar {
    display: none;
  }
}

.em-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--em-text-muted);
  gap: 2px;
  flex: 1;
  padding: 6px 0;
  transition: all 0.2s ease;
}

.em-bottom-item i {
  font-size: 1.15rem;
}

.em-bottom-item.active, .em-bottom-item:hover {
  color: var(--em-blue);
}

/* Command+K Canlı Arama Modalı */
.em-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 20px 20px;
}

.em-modal-backdrop.open {
  display: flex;
}

.em-search-box {
  width: 100%;
  max-width: 620px;
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  animation: modalFadeIn 0.18s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.em-search-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--em-border);
  gap: 10px;
}

.em-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--em-text);
  font-family: inherit;
}

.em-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.em-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--em-radius-sm);
  color: var(--em-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.em-search-item:hover, .em-search-item.highlighted {
  background: var(--em-surface-2);
}

/* Toast Bildirimi */
.em-toast {
  position: fixed;
  bottom: 75px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  border: 1px solid #1e293b;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.em-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Buton Stilleri (Modern Mavi Vurgulu) */
.em-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--em-radius-sm);
  font-weight: 600;
  font-size: 0.83rem;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
}

.em-btn-primary {
  background: var(--em-blue);
  color: #fff;
  box-shadow: 0 2px 8px var(--em-blue-glow);
}

.em-btn-primary:hover {
  background: var(--em-blue-dark);
  color: #fff;
}

.em-btn-secondary {
  background: var(--em-surface-2);
  color: var(--em-text);
  border: 1px solid var(--em-border);
}

.em-btn-secondary:hover {
  background: var(--em-blue-soft);
  border-color: var(--em-blue);
  color: var(--em-blue);
}

.em-btn-success {
  background: var(--em-green);
  color: #fff;
}

/* Form Elemanları */
.em-form-group {
  margin-bottom: 14px;
}

.em-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--em-text);
}

.em-form-control, .form-control, .form-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--em-radius-sm);
  border: 1px solid var(--em-border);
  background: var(--em-surface);
  color: var(--em-text);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s ease;
}

.em-form-control:focus, .form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--em-blue);
  box-shadow: 0 0 0 3px var(--em-blue-soft);
}

/* Genel Düzen İyileştirmeleri */
html, body { overflow-x: hidden; }
.em-brand, .em-brand-title span, .em-nav-link, .em-actions .em-btn { white-space: nowrap; }
.em-actions { flex-shrink: 0; }

.em-grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.em-grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.em-card h2, .em-card h3, .bento-card h2, .bento-card h3 {
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.em-card h2 a:hover, .em-card h3 a:hover, .bento-card h2 a:hover, .bento-card h3 a:hover {
  color: var(--em-blue);
}
.em-card > p, .bento-card > p { overflow-wrap: anywhere; }
.em-card-header > div { min-width: 0; }

a:focus-visible, button:focus-visible, .em-btn:focus-visible {
  outline: 2px solid var(--em-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.em-footer {
  margin-top: auto;
  padding: 14px max(20px, 2.2vw);
  border-top: 1px solid var(--em-border);
  background: var(--em-surface);
  color: var(--em-text-muted);
  font-size: 0.78rem;
  text-align: center;
}
.em-footer i { color: var(--em-blue); margin-right: 4px; }

/* ==========================================================================
   KLİNİK ÇALIŞMA ALANI (AMBOSS / MDCalc Stili - Gizlenebilir & Kaydırmasız Sidebar)
   ========================================================================== */

.text-danger  { color: var(--em-red) !important; }
.text-primary { color: var(--em-blue) !important; }
.text-info    { color: var(--em-cyan) !important; }
.text-success { color: var(--em-green) !important; }
.text-warning { color: var(--em-amber) !important; }
.text-purple  { color: var(--em-purple) !important; }
.text-muted   { color: var(--em-text-muted) !important; }

/* Başlık Boyutlarını Tüm Sayfalarda Kibar & Kompakt Ölçeğe Sabitleme */
.em-main-container h1 {
  font-size: 1.28rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.28 !important;
}

.em-main-container h2 {
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  line-height: 1.32 !important;
}

.em-main-container h3 {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.em-app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--em-bg);
}

/* Sol Kenar Çubuğu: Kaydırmasız (overflow: hidden) ve Gizlenebilir */
.em-sidebar {
  width: 244px;
  flex-shrink: 0;
  background: var(--em-surface);
  border-right: 1px solid var(--em-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 1030;
  transition: margin-left 0.24s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Masaüstünde Gizleme (Collapsed) Durumu */
@media (min-width: 1024px) {
  body.sidebar-collapsed .em-sidebar {
    margin-left: -244px;
  }
}

/* Mobil ve Tablette Çekmece (Drawer) Olarak Açılıp Kapanma */
@media (max-width: 1023px) {
  .em-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.18);
  }
  body.sidebar-mobile-open .em-sidebar {
    transform: translateX(0);
  }
}

.em-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1025;
  display: none;
}

@media (max-width: 1023px) {
  body.sidebar-mobile-open .em-sidebar-backdrop {
    display: block;
  }
}

.em-sidebar-brand {
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.em-sidebar-section {
  padding: 10px 10px 2px;
}

.em-sidebar-heading {
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--em-text-dim);
  padding: 0 8px;
  margin-bottom: 4px;
}

.em-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.em-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--em-text-muted);
  text-decoration: none;
  transition: all 0.14s ease;
}

.em-sidebar-link-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.em-sidebar-link i {
  font-size: 0.94rem;
  width: 17px;
  text-align: center;
  color: var(--em-text-dim);
  transition: color 0.14s ease;
}

.em-sidebar-link:hover {
  background: var(--em-surface-2);
  color: var(--em-text);
}

.em-sidebar-link:hover i {
  color: var(--em-blue);
}

.em-sidebar-link.active {
  background: var(--em-blue-soft);
  color: var(--em-blue);
  font-weight: 700;
}

.em-sidebar-link.active i {
  color: var(--em-blue);
}

.em-sidebar-count {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--em-surface-2);
  color: var(--em-text-muted);
}

.em-sidebar-link.active .em-sidebar-count {
  background: rgba(37, 99, 235, 0.15);
  color: var(--em-blue);
}

/* Sağ Ana İçerik Sütunu */
.em-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Üst Komuta Barı (Topbar) */
.em-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 56px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--em-border);
  padding: 0 max(18px, 2.2vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

[data-theme="dark"] .em-topbar {
  background: rgba(17, 24, 39, 0.94);
}

.em-topbar-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--em-surface-2);
  border: 1px solid var(--em-border);
  border-radius: 9px;
  padding: 6px 12px;
  color: var(--em-text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.em-topbar-search:hover {
  border-color: var(--em-blue);
  background: var(--em-surface);
  color: var(--em-text);
  box-shadow: 0 2px 8px var(--em-blue-glow);
}

/* 12 Sütunlu Klinik Grid */
.em-bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.bento-col-12 { grid-column: span 12; }
.bento-col-8  { grid-column: span 8; }
.bento-col-7  { grid-column: span 7; }
.bento-col-6  { grid-column: span 6; }
.bento-col-5  { grid-column: span 5; }
.bento-col-4  { grid-column: span 4; }
.bento-col-3  { grid-column: span 3; }

@media (max-width: 1280px) {
  .bento-col-8, .bento-col-7, .bento-col-5 {
    grid-column: span 12;
  }
  .bento-col-4, .bento-col-3 {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .em-bento-grid {
    gap: 12px;
  }
  .bento-col-8, .bento-col-7, .bento-col-6, .bento-col-5, .bento-col-4, .bento-col-3 {
    grid-column: span 12;
  }
}

/* Klinik Kart Stili */
.bento-card, .em-card {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--em-shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="dark"] .bento-card, [data-theme="dark"] .em-card {
  border-color: #26334d;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.bento-card:hover, .em-card:hover {
  border-color: var(--em-border-focus);
  box-shadow: var(--em-shadow);
}

/* Modern Mavi Tonlu İnce Üst Vurgu Çizgileri */
.bento-mesh-hero {
  background: var(--em-surface) !important;
  border-top: 3px solid var(--em-blue);
}

.bento-mesh-amber {
  background: var(--em-surface) !important;
  border-top: 3px solid var(--em-cyan);
}

.bento-mesh-red {
  background: var(--em-surface) !important;
  border-top: 3px solid var(--em-purple);
}

.bento-mesh-blue {
  background: var(--em-surface) !important;
  border-top: 3px solid var(--em-blue);
}

.bento-mesh-green {
  background: var(--em-surface) !important;
  border-top: 3px solid var(--em-green);
}

/* İstatistik ve Alt Bilgi Kutuları */
.bento-stat-box {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.16s ease;
  text-decoration: none;
}

.bento-stat-box:hover {
  border-color: var(--em-blue);
  box-shadow: var(--em-shadow);
}

.bento-stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.bento-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--em-text-muted);
}

/* Sendrom / Hızlı Filtre Butonları (Bento Chips) */
.bento-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 7px;
  background: var(--em-surface-2);
  border: 1px solid var(--em-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--em-text);
  transition: all 0.14s ease;
  cursor: pointer;
  text-decoration: none;
}

.bento-chip:hover, .bento-chip.active {
  border-color: var(--em-blue);
  background: var(--em-blue-soft);
  color: var(--em-blue);
}

/* Görsel Önizleme Çerçevesi (Media Frame) */
.bento-media-frame {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--em-border);
  margin-bottom: 12px;
  cursor: pointer;
  background: #f8fafc;
}

.bento-media-frame img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.22s ease;
}

.bento-media-frame:hover img {
  transform: scale(1.012);
}

.bento-media-zoom-badge, .bento-media-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* SLIDE-OVER (SAĞDAN KAYAR ÖNİZLEME PANELİ) */
.em-slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.em-slideover-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.em-slideover-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 640px;
  background: var(--em-surface);
  border-left: 1px solid var(--em-border);
  box-shadow: -14px 0 42px rgba(15, 23, 42, 0.18);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.em-slideover-backdrop.open .em-slideover-panel {
  transform: translateX(0);
}

.em-slideover-header {
  padding: 14px 20px;
  background: var(--em-surface);
  border-bottom: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.em-slideover-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.em-slideover-footer {
  padding: 12px 20px;
  background: var(--em-surface-2);
  border-top: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}


