/* ==========================================================================
   CSS TASARIM SİSTEMİ & DEĞİŞKENLER
   ========================================================================== */

:root {
  /* Varsayılan Tema (İndigo) Değişkenleri */
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-rgb: 99, 102, 241;
  --color-primary-light: #eef2ff;
  
  --color-bg-app: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-sidebar: #0f172a;
  
  --color-text-main: #1e293b;
  --color-text-muted: #64748b;
  --color-text-white: #ffffff;
  
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  
  /* Durum Renkleri */
  --color-success: #10b981;
  --color-success-light: #ecfdf5;
  --color-success-text: #065f46;
  
  --color-warning: #f59e0b;
  --color-warning-light: #fffbeb;
  --color-warning-text: #92400e;
  
  --color-danger: #ef4444;
  --color-danger-light: #fef2f2;
  --color-danger-text: #991b1b;
  
  --sidebar-width: 260px;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --box-shadow-card: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --box-shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tema Varyasyonları */
.theme-emerald {
  --color-primary: #10b981;
  --color-primary-hover: #059669;
  --color-primary-rgb: 16, 185, 129;
  --color-primary-light: #ecfdf5;
}

.theme-blue {
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-rgb: 59, 130, 246;
  --color-primary-light: #eff6ff;
}

.theme-rose {
  --color-primary: #f43f5e;
  --color-primary-hover: #e11d48;
  --color-primary-rgb: 244, 63, 94;
  --color-primary-light: #fff1f2;
}

/* ==========================================================================
   TEMEL SIFIRLAMALAR VE MOBİL-DOSTU UYUMLULUK
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--color-bg-app);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--color-text-main);
}

/* ==========================================================================
   GİRİŞ / ROL SEÇİM PANELİ (LOGIN)
   ========================================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, rgba(248, 250, 252, 1) 90%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.login-overlay.active {
  opacity: 1;
  visibility: visible;
}

.login-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px);
  width: 100%;
  max-width: 900px;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.logo-container {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
  box-shadow: 0 10px 20px -5px rgba(var(--color-primary-rgb), 0.4);
}

.main-logo-svg {
  width: 36px;
  height: 36px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
}

.login-body h3 {
  text-align: center;
  font-size: 16px;
  color: var(--color-text-main);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.role-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 30px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.role-card:hover {
  transform: translateY(-8px);
  border-color: var(--color-primary);
  box-shadow: var(--box-shadow-hover);
}

.role-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  transition: var(--transition-smooth);
}

.admin-icon { background: #eff6ff; color: #3b82f6; }
.doctor-icon { background: #ecfdf5; color: #10b981; }
.patient-icon { background: #faf5ff; color: #a855f7; }

.role-card:hover .role-icon {
  transform: scale(1.1);
}

.role-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
  font-weight: 700;
}

.role-card p {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   UYGULAMA PANELİ ANA DÜZENİ (SIDEBAR & MAIN CONTENT)
   ========================================================================== */

.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Yan Menü (Sidebar) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition-smooth);
  z-index: 1000;
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
}

.brand-icon {
  color: var(--color-primary);
  width: 32px;
  height: 32px;
}

.sidebar-brand h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-brand span {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.current-user-card {
  margin: 20px;
  padding: 16px;
  background: #1e293b;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(var(--color-primary-rgb), 0.15);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info h4 {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.user-info span {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 20px;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: var(--color-primary);
  color: #fff;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid #1e293b;
}

.btn-logout {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed #334155;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Ana İçerik Alanı (Main) */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 30px;
  background: var(--color-bg-app);
}

/* Masaüstü Üst Bar (Header) */
.desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.header-search-wrapper {
  position: relative;
  width: 320px;
}

.header-search-wrapper input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-bg-card);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}

.header-search-wrapper input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hospital-name-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.hospital-name-badge i {
  width: 14px;
  height: 14px;
}

.btn-profile-shortcut {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobil header ve alt gezinti (Varsayılan gizli, mobilde aktif) */
.app-header-mobile, .mobile-bottom-nav, .sidebar-overlay {
  display: none;
}

/* ==========================================================================
   SEKME İÇERİKLERİ VE TASARIM ÖGELERİ (DASHBOARD)
   ========================================================================== */

.tab-content-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: white;
  padding: 30px;
  border-radius: var(--border-radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.welcome-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.banner-text h1 {
  color: white;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.banner-text p {
  color: #c7d2fe;
  font-size: 13px;
  max-width: 500px;
  line-height: 1.5;
}

.banner-illus {
  font-size: 60px;
  color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
}

.banner-illus i {
  width: 70px;
  height: 70px;
  stroke-width: 1.2;
}

/* Stats (İstatistik Kartları) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--box-shadow-card);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.purple { background: #eef2ff; color: #6366f1; }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.blue { background: #eff6ff; color: #3b82f6; }

.stat-icon i {
  width: 24px;
  height: 24px;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
}

/* Dashboard Çiftli Kolon Yerleşimi */
.dashboard-double-row {
  display: flex;
  gap: 24px;
}

.flex-2 { flex: 2; }
.flex-1 { flex: 1; }

.dashboard-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
}

.box-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.recent-item:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.recent-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.recent-item:hover .recent-item-icon {
  background: white;
  color: var(--color-primary);
}

.recent-item-info {
  flex: 1;
}

.recent-item-info h5 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.recent-item-info p {
  font-size: 11px;
  color: var(--color-text-muted);
}

.recent-item-date {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

.empty-state i {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  stroke-width: 1.5;
}

.empty-state p {
  font-size: 13px;
}

/* ==========================================================================
   ŞABLON KARTLARI VE LİSTESİ (RIZA BELGELERİ)
   ========================================================================== */

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title-bar h1 {
  font-size: 22px;
  font-weight: 800;
}

.section-title-bar p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.filter-bar {
  display: flex;
  gap: 16px;
}

.filter-search {
  flex: 1;
  position: relative;
}

.filter-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-card);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}

.filter-search input:focus {
  border-color: var(--color-primary);
}

.filter-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

.filter-select-wrapper {
  position: relative;
  width: 200px;
}

.filter-select-wrapper select {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-card);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.filter-select-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.form-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: var(--box-shadow-card);
}

.form-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-primary);
  box-shadow: var(--box-shadow-hover);
}

/* Şablon kategorisine göre kart üstünde renkli ince çizgi */
.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
}

.form-card.cat-anestezi::before { background: #6366f1; }
.form-card.cat-goz::before { background: #10b981; }
.form-card.cat-estetik::before { background: #f43f5e; }
.form-card.cat-diger::before { background: #f59e0b; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-code-badge {
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
}

.card-action-menu {
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.form-card h4 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  flex: 1;
  color: var(--color-text-main);
  /* 3 satır sınırı */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.card-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-date i {
  width: 12px;
  height: 12px;
}

.btn-card-action {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-card:hover .btn-card-action {
  text-decoration: underline;
}

/* ==========================================================================
   TABLO GÖRÜNÜMÜ (ARŞİV)
   ========================================================================== */

.table-container {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--box-shadow-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 16px 24px;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  background: #f8fafc;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.td-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: white;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon-action:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-icon-action.danger:hover {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-icon-action i {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   ORTAK BUTONLAR VE FORMLAR
   ========================================================================== */

.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(var(--color-primary-rgb), 0.25);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--color-border-hover);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-main);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  background: white;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--color-primary);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==========================================================================
   AYARLAR SAYFASI
   ========================================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.settings-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-card h3 {
  font-size: 16px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 6px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.theme-option:hover {
  background: #f8fafc;
}

.theme-option.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   DİNAMİK FORM MODALİ (SPLIT SCREEN DOLDURMA & ÖNİZLEME)
   ========================================================================== */

.form-viewer-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(16px);
  z-index: 1500;
  display: none;
  animation: modalFadeIn 0.35s ease-out;
}

.form-viewer-modal.active {
  display: block;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content-wrapper {
  width: 100vw;
  height: 100vh;
  background: var(--color-bg-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header-bar {
  height: 70px;
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-icon {
  width: 38px;
  height: 38px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.modal-header-left h2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.modal-header-left span {
  font-size: 11px;
  color: var(--color-text-muted);
}

.modal-header-actions {
  display: flex;
  gap: 10px;
}

.btn-modal-action {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-modal-action.primary {
  background: var(--color-primary);
  color: white;
  border: none;
}

.btn-modal-action.primary:hover {
  background: var(--color-primary-hover);
}

.btn-modal-action.secondary {
  background: white;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}

.btn-modal-action.secondary:hover {
  background: #f8fafc;
}

.btn-modal-action.danger {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fee2e2;
  width: 40px;
  padding: 0;
  justify-content: center;
}

.btn-modal-action.danger:hover {
  background: #ef4444;
  color: white;
}

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

/* Sol Taraf: İnteraktif Doldurma Formu */
.modal-sidebar-form {
  width: 420px;
  background: white;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
}

.sidebar-form-section {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-form-section h3 {
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 700;
  border-bottom: 2px solid var(--color-primary-light);
  padding-bottom: 6px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Özel Checkbox stili */
.custom-checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-main);
  cursor: pointer;
  position: relative;
  user-select: none;
}

.custom-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  width: 18px;
  height: 18px;
  background-color: #f1f5f9;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.custom-checkbox-container:hover input ~ .checkmark {
  background-color: #e2e8f0;
}

.custom-checkbox-container input:checked ~ .checkmark {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.checkmark::after {
  content: "";
  display: none;
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.help-text {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* İmza Pedi Tetikleme Butonları */
.signature-trigger-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.btn-sig-trigger {
  padding: 12px;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--border-radius-md);
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
}

.btn-sig-trigger:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-sig-trigger i {
  color: var(--color-primary);
  width: 20px;
  height: 20px;
}

.btn-sig-trigger div {
  display: flex;
  flex-direction: column;
}

.btn-sig-trigger span {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-main);
}

.sig-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
  width: fit-content;
}

.sig-status-badge.pending {
  background: var(--color-warning-light);
  color: var(--color-warning-text);
}

.sig-status-badge.signed {
  background: var(--color-success-light);
  color: var(--color-success-text);
}

/* Sağ Taraf: Canlı Iframe Önizleme */
.modal-preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #e2e8f0;
  position: relative;
}

.preview-header-bar {
  height: 40px;
  background: #0f172a;
  color: #94a3b8;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.preview-mode-indicator {
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-mode-indicator i {
  width: 12px;
  height: 12px;
}

#formPreviewIframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

/* Admin Tehlikeli Buton */
.btn-danger-outline {
  background: white;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  padding: 10px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.btn-danger-outline:hover {
  background: var(--color-danger-light);
}

/* ==========================================================================
   İMZA MODALİ (DIJITAL IMZA EKRANI)
   ========================================================================== */

.sig-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.sig-overlay.active {
  display: flex;
}

.sig-popup {
  background: white;
  width: 580px;
  max-width: 100%;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: sigSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sigSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sig-popup-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  color: white;
}

.sig-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sig-header-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sig-header-icon i {
  width: 20px;
  height: 20px;
  stroke: white;
}

.sig-header-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: white;
}

.sig-header-text span {
  font-size: 11px;
  color: #64748b;
}

.sig-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sig-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
  padding: 0 16px;
}

.sig-tab {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.sig-tab i {
  width: 14px;
  height: 14px;
}

.sig-tab.active {
  color: var(--color-primary);
}

.sig-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 10px;
  right: 10px;
  height: 2.5px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

.sig-popup-body {
  padding: 20px 24px;
  background: #f8fafc;
}

.sig-tab-content {
  display: none;
}

.sig-tab-content.active {
  display: block;
}

/* Çizim Pedi */
#sigPadWrap {
  position: relative;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  width: 100%;
  cursor: crosshair;
  background: white;
  overflow: hidden;
}

#appSigPad {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
}

.sig-guide-line {
  position: absolute;
  bottom: 40px;
  left: 30px;
  right: 30px;
  border-bottom: 1.5px dashed #cbd5e1;
  pointer-events: none;
}

.sig-guide-label {
  position: absolute;
  bottom: 44px;
  left: 30px;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  pointer-events: none;
}

.sig-pen-colors {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  gap: 6px;
}

.sig-pen-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition-smooth);
}

.sig-pen-color.active {
  border-color: white;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.sig-canvas-toolbar {
  position: absolute;
  top: 10px;
  right: 12px;
}

.sig-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: white;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sig-tool-btn.danger:hover {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.sig-tool-btn i {
  width: 14px;
  height: 14px;
}

/* Yazı Pedi */
.sig-type-area {
  border: 2px solid var(--color-border);
  border-radius: 12px;
  background: white;
  padding: 16px;
}

.sig-type-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 26px;
  text-align: center;
  padding: 15px 0;
  color: var(--color-text-main);
  background: transparent;
  font-family: 'Brush Script MT', cursive;
}

.sig-font-options {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.sig-font-btn {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.sig-font-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Yükleme Pedi */
.sig-upload-area {
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  background: white;
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sig-upload-area:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.sig-upload-area i {
  width: 36px;
  height: 36px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.sig-upload-preview {
  display: none;
  margin-top: 10px;
}

.sig-upload-preview img {
  max-height: 60px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px;
}

.sig-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

.sig-footer-info {
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sig-footer-info i {
  width: 12px;
  height: 12px;
}

.sig-footer-actions {
  display: flex;
  gap: 8px;
}

.btn-iptal-sig {
  background: white;
  border: 1px solid var(--color-border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-imza-kaydet {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   YENİ ŞABLON MODALİ (ADMIN)
   ========================================================================== */

.new-template-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1800;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.new-template-modal.active {
  display: flex;
}

.new-template-card {
  background: white;
  width: 480px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: sigSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.new-template-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-text-muted);
}

.new-template-body {
  padding: 20px;
}

.new-template-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   ROL KONTROLLERİ VE GÖSTERİMLERİ
   ========================================================================== */

/* Yönetici harici rollerde gizlenecek alanlar */
body.role-doctor .admin-only,
body.role-patient .admin-only {
  display: none !important;
}

/* Hasta modunda bazı alanları kısıtla */
body.role-patient .sidebar-form-section:nth-child(1) input,
body.role-patient .sidebar-form-section:nth-child(2) input,
body.role-patient .sidebar-form-section:nth-child(2) textarea {
  pointer-events: none;
  background: #f8fafc;
}

/* ==========================================================================
   MEDYA SORGULARI (DUYARLI TASARIM BREAKPOINTS)
   ========================================================================== */

/* Tablet Görünümü (Max: 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }
  
  .role-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-double-row {
    flex-direction: column;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  /* Form Doldurma Modali tablet uyumu */
  .modal-body-container {
        flex-direction: column;
  }
  
  .modal-sidebar-form {
    width: 100%;
        height: 55%;
    border-right: none;
    border-top: 1px solid var(--color-border);
  }
  
  .modal-preview-panel {
        height: 45%;
  }
}

/* Mobil Görünümü (Max: 768px) */
@media (max-width: 768px) {
  body {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  /* Mobil Header */
  .app-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0f172a;
    color: white;
    padding: 0 16px;
    z-index: 1100;
  }
  
  .menu-toggle-btn, .user-profile-badge-mobile {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
  }
  
  .menu-toggle-btn i, .user-profile-badge-mobile i {
    width: 24px;
    height: 24px;
  }
  
  .mobile-app-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
  }

  /* Mobil Alt Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-top: 1px solid var(--color-border);
    z-index: 1100;
    justify-content: space-around;
  }
  
  .bottom-nav-item {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    cursor: pointer;
  }
  
  .bottom-nav-item i {
    width: 20px;
    height: 20px;
  }
  
  .bottom-nav-item.active {
    color: var(--color-primary);
  }

  /* Mobil Yan Menü Değişikliği (Katlanır Çekmece) */
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 1200;
    height: 100%;
  }
  
  .sidebar.active {
    left: 0;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1150;
    backdrop-filter: blur(4px);
  }
  
  .sidebar-overlay.active {
    display: block;
  }

  /* Ana İçerik Kaydırma */
  .main-content {
    padding: 16px;
    overflow-x: hidden;
  }
  
  .desktop-header {
    display: none;
  }

  /* Role Grid mobilde tek sütun */
  .role-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .login-card {
    padding: 24px 16px;
    border-radius: 16px;
  }
  
  .welcome-banner {
    padding: 20px;
  }
  
  .banner-illus {
    display: none;
  }

  .filter-bar {
    flex-direction: column;
  }
  
  .filter-select-wrapper {
    width: 100%;
  }

  .section-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .section-title-bar button {
    width: 100%;
    justify-content: center;
  }

  /* Form önizleme split ekran mobil ayarları */
  .modal-body-container {
        flex-direction: column;
  }
  
  .modal-sidebar-form {
    height: 60%;
    padding: 16px;
  }
  
  .modal-preview-panel {
    height: 40%;
  }
  
  .modal-header-left h2 {
    font-size: 13px;
  }
  
  .modal-header-bar {
    padding: 0 12px;
    height: 60px;
  }
  
  .btn-modal-action .btn-text {
    display: none;
  }
  
  .btn-modal-action {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .sig-popup {
    border-radius: 12px;
  }
  
  .sig-popup-header {
    padding: 14px 16px;
  }
  
  .sig-popup-body {
    padding: 16px;
  }
  
  #appSigPad {
    height: 150px;
  }
  
  .table-container {
    border-radius: 8px;
    overflow-x: auto;
  }
  
  .data-table th, .data-table td {
    padding: 12px;
  }
  
  .theme-picker {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PRINT / PDF ÇIKTI OPTİMİZASYONU
   ========================================================================== */

@media print {
  body {
    background: white;
    color: black;
  }
  
  .sidebar, 
  .mobile-bottom-nav, 
  .app-header-mobile, 
  .desktop-header, 
  .modal-header-bar,
  .modal-sidebar-form,
  .preview-header-bar {
    display: none !important;
  }
  
  .app-container {
    height: auto;
    overflow: visible;
  }
  
  .main-content {
    display: none !important;
  }
  
  .form-viewer-modal {
    position: relative;
    inset: auto;
    background: transparent;
    backdrop-filter: none;
    z-index: auto;
    display: block !important;
  }
  
  .modal-content-wrapper {
    height: auto;
    overflow: visible;
  }
  
  .modal-body-container {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  
  .modal-preview-panel {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    background: white;
  }
  
  #formPreviewIframe {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
  }
}


/* ==========================================================================
   GİRİŞ ADIM 2 (PIN & KULLANICI DOĞRULAMA)
   ========================================================================== */

.login-step2 {
  animation: fadeIn 0.3s ease-in-out;
}

.step2-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 6px 0;
  transition: var(--transition-smooth);
}

.step2-back-btn:hover {
  opacity: 0.7;
}

.step2-back-btn i {
  width: 16px;
  height: 16px;
}

.login-step2 h3 {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--color-text-main);
}

.step2-login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 20px;
  padding: 14px 20px;
  font-size: 15px;
}

.field-error {
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  animation: fadeIn 0.2s ease-in-out;
}

/* ==========================================================================
   ROL YÖNETİMİ AYARLARI
   ========================================================================== */

.role-management-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-card);
}

.role-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.role-setting-card {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-smooth);
}

.role-setting-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.08);
}

.role-setting-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-setting-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.role-setting-icon i {
  width: 20px;
  height: 20px;
}

.role-setting-info {
  flex: 1;
  min-width: 0;
}

.role-setting-info h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.role-setting-info p {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.label-hint {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 11px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 24px;
  transition: var(--transition-smooth);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition-smooth);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Doktor Listesi */
.doctor-list-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.doctor-list-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.doctor-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.doctor-add-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}

.doctor-add-row input:focus {
  border-color: var(--color-primary);
}

.doctor-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doctor-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

.doctor-list-item:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.doctor-list-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doctor-list-item-info i {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
}

.doctor-list-item-info span {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
}

.doctor-list-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 20px;
  font-size: 13px;
  font-style: italic;
}

/* Responsive: Rol ayarları */
@media (max-width: 1024px) {
  .role-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .role-management-section {
    padding: 16px;
  }

  .doctor-add-row {
    flex-direction: column;
  }

  .doctor-add-row .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   HASTA ARAMA DROPDOWN
   ========================================================================== */

.patient-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
}

.patient-search-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid #f1f5f9;
  transition: var(--transition-smooth);
}

.patient-search-item:hover {
  background: var(--color-primary-light);
}

.patient-search-item strong {
  font-size: 13px;
}

.patient-search-item span {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   FORM DURUM BADGE
   ========================================================================== */

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.status-badge.status-signed {
  background: var(--color-success-light);
  color: var(--color-success-text);
}

.status-badge.status-expired {
  background: var(--color-danger-light);
  color: var(--color-danger-text);
}

.status-badge.status-pending {
  background: var(--color-warning-light);
  color: var(--color-warning-text);
}

.stat-icon.amber {
  background: #fffbeb;
  color: #f59e0b;
}

/* ==========================================================================
   KONTROL LİSTESİ
   ========================================================================== */

.checklists-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checklist-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: var(--box-shadow-card);
  transition: var(--transition-smooth);
}

.checklist-card.completed {
  border-color: var(--color-success);
  background: #f0fdf4;
}

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

.checklist-card-header h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.checklist-card-header p {
  font-size: 12px;
  color: var(--color-text-muted);
}

.checklist-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

.checklist-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-bottom: 14px;
  overflow: hidden;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.checklist-card.completed .checklist-progress-fill {
  background: var(--color-success);
}

.checklist-forms-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.checklist-form-row.signed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.checklist-form-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.checklist-form-row-left i {
  width: 16px;
  height: 16px;
}

.checklist-form-row.signed .checklist-form-row-left i {
  color: var(--color-success);
}

.checklist-form-row.pending .checklist-form-row-left i {
  color: var(--color-text-muted);
}

.checklist-form-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--color-text-main);
}

.checklist-form-item i {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
}

.checklist-forms-preview {
  max-height: 200px;
  overflow-y: auto;
}

/* ==========================================================================
   PAYLAŞIM MODALİ
   ========================================================================== */

.share-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.share-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.share-option-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-option-icon i {
  width: 20px;
  height: 20px;
}

.share-option h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.share-option p {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   HEKİM KAŞE
   ========================================================================== */

.stamp-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-success-light);
  color: var(--color-success-text);
  margin-left: 8px;
}

.doctor-item-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.surgery-form-checkboxes {
  max-height: 250px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: #f8fafc;
}

/* Kontrol listesi role visibility */
body.role-patient #nav-checklists,
body.role-patient #nav-activitylog {
  display: none !important;
}

/* ==========================================================================
   AKTİVİTE LOGLARI
   ========================================================================== */

.activity-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-log-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
}

.activity-log-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--box-shadow-card);
}

.activity-log-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-log-icon i {
  width: 18px;
  height: 18px;
}

.activity-log-info {
  flex: 1;
  min-width: 0;
}

.activity-log-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 2px;
}

.activity-log-detail {
  font-size: 11px;
  color: var(--color-text-muted);
}

.activity-log-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.activity-log-user {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.activity-log-time {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   FAVORİ YILDIZI
   ========================================================================== */

.btn-fav {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-fav:hover {
  color: #f59e0b;
  background: #fffbeb;
}

.btn-fav.active {
  color: #f59e0b;
}

.btn-fav.active:hover {
  color: #d97706;
}

.btn-fav i {
  width: 16px;
  height: 16px;
}

.btn-fav.active i {
  fill: #f59e0b;
}

/* ==========================================================================
   İMZA DENETİM BİLGİSİ (AUDIT)
   ========================================================================== */

.audit-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.audit-row:last-child {
  border-bottom: none;
}

.audit-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.audit-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-main);
}

.audit-separator {
  height: 1px;
  background: var(--color-border);
  margin: 6px 0;
}

.audit-value.audit-ok {
  color: var(--color-success);
}

.audit-value.audit-no {
  color: var(--color-danger);
}

.audit-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  padding: 4px 0;
  letter-spacing: 0.5px;
}

/* Audit Popup - Yatay Layout */
.audit-popup {
  background: white;
  width: 720px;
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: sigSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.audit-popup-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  color: white;
}

.audit-popup-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
}

.audit-popup-header span {
  font-size: 11px;
  color: #94a3b8;
}

.audit-popup-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.audit-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.audit-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.audit-column {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  background: #f8fafc;
}

.audit-footer-ts {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
}

@media (max-width: 600px) {
  .audit-popup {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .audit-top-row {
    grid-template-columns: 1fr;
  }
  .audit-columns {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CANLI İMZA İSTATİSTİKLERİ
   ========================================================================== */

.sig-live-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  background: #0f172a;
  border-radius: 8px;
}

.sig-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sig-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: #10b981;
  font-family: 'Outfit', monospace;
  line-height: 1;
}

.sig-stat-label {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

@media (max-width: 480px) {
  .sig-live-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Dar ekranlarda type="date" gibi girdilerin zorunlu min-genişliği yüzünden
     2 sütunlu form alanları taşıyordu (yatay kaydırma); tek sütuna indiriyoruz. */
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .activity-log-item {
    flex-direction: column;
    gap: 8px;
  }
  .activity-log-meta {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
}

/* ==========================================================================
   FORM BUILDER (ŞABLON OLUŞTURUCU)
   ========================================================================== */

.form-builder-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(16px);
  z-index: 1500;
  display: none;
  animation: modalFadeIn 0.35s ease-out;
}

.form-builder-modal.active {
  display: block;
}

.fb-wrapper {
  width: 100vw;
  height: 100vh;
  background: var(--color-bg-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fb-header {
  height: 70px;
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.fb-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fb-header-left h2 {
  font-size: 16px;
  font-weight: 700;
}

.fb-header-left span {
  font-size: 11px;
  color: var(--color-text-muted);
}

.fb-header-actions {
  display: flex;
  gap: 10px;
}

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

.fb-sidebar {
  width: 420px;
  background: white;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.fb-meta-section,
.fb-palette-section,
.fb-blocks-section {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.fb-meta-section h3,
.fb-palette-section h3,
.fb-blocks-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-meta-section h3 i,
.fb-palette-section h3 i,
.fb-blocks-section h3 i {
  width: 16px;
  height: 16px;
}

.fb-palette-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fb-palette-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1.5px dashed var(--color-border);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.fb-palette-btn i {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
}

.fb-palette-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.fb-block-count {
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

.fb-block-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-empty-blocks {
  text-align: center;
  padding: 30px 10px;
  color: var(--color-text-muted);
}

.fb-empty-blocks i {
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
  stroke-width: 1.5;
}

.fb-empty-blocks p {
  font-size: 12px;
}

.fb-block-item {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.fb-block-item:hover {
  border-color: var(--color-primary);
}

.fb-block-item.editing {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

.fb-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  background: #f8fafc;
  gap: 8px;
}

.fb-block-header:hover {
  background: #f1f5f9;
}

.fb-block-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.fb-block-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fb-block-header-left i {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.fb-block-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fb-block-title-wrap strong {
  font-size: 12px;
  font-weight: 700;
}

.fb-block-title-wrap small {
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-block-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.fb-block-actions button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.fb-block-actions button:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.fb-block-actions button.danger:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.fb-block-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.fb-block-actions button i {
  width: 14px;
  height: 14px;
}

.fb-block-editor {
  padding: 14px;
  background: white;
  border-top: 1px solid var(--color-border);
  animation: fadeIn 0.2s ease-in-out;
}

.fb-block-editor .form-group {
  margin-bottom: 12px;
}

.fb-block-editor textarea {
  font-family: inherit;
  resize: vertical;
}

.fb-add-field-row,
.fb-onay-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fb-add-field-row input,
.fb-onay-item-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  outline: none;
}

.fb-add-field-row .btn-primary {
  padding: 8px 12px;
  font-size: 11px;
  white-space: nowrap;
}

.fb-onay-item-row {
  margin-bottom: 6px;
}

.fb-remove-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fb-remove-btn:hover {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.fb-remove-btn i {
  width: 14px;
  height: 14px;
}

.fb-preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #e2e8f0;
}

.fb-preview-container {
  flex: 1;
  overflow-y: auto;
  background: white;
}

.fb-preview-container iframe {
  display: block;
}

.fb-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 40px;
}

.fb-preview-empty i {
  width: 50px;
  height: 50px;
  stroke-width: 1.2;
  margin-bottom: 16px;
}

.fb-preview-empty h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--color-text-main);
}

.fb-preview-empty p {
  font-size: 13px;
  max-width: 300px;
}

/* Özel Şablon Kart Rozeti */
.card-custom-badge {
  padding: 3px 8px;
  border-radius: var(--border-radius-sm);
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.card-custom-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 4px;
}

.form-card.custom-template:hover .card-custom-actions {
  display: flex;
}

.card-custom-actions button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.9);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-custom-actions button:hover {
  background: white;
  color: var(--color-primary);
}

.card-custom-actions button.danger:hover {
  color: var(--color-danger);
}

.card-custom-actions button i {
  width: 14px;
  height: 14px;
}

/* Form Builder Mobil */
@media (max-width: 768px) {
  .fb-sidebar {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 2;
  }

  .fb-preview-panel {
    display: none;
  }

  .fb-palette-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .fb-header {
    height: 60px;
    padding: 0 12px;
  }

  .fb-header-left h2 {
    font-size: 13px;
  }

  .fb-header-actions .btn-text {
    display: none;
  }

  .fb-header-actions .btn-modal-action {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  .fb-sidebar {
    width: 360px;
  }
}

/* ==========================================================================
   MOBİL GÖRÜNÜM: FORM DOLDURMA VE ÖNİZLEME SEKME YAPISI
   ========================================================================== */
@media (max-width: 768px) {
  .modal-body-container {
    flex-direction: column !important;
    height: calc(100vh - 60px) !important;
    position: relative;
  }

  .modal-sidebar-form {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    border-right: none;
    padding: 16px;
    position: absolute;
    inset: 0;
    z-index: 2;
    background: white;
    overflow-y: auto;
  }

  .modal-preview-panel {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .modal-sidebar-form.mobile-hidden {
    display: none !important;
  }

  .modal-preview-panel.mobile-hidden {
    display: none !important;
  }

  .mobile-tab-switcher {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 5;
    background: white;
    border-bottom: 1px solid var(--color-border);
    padding: 0;
  }

  .mobile-tab-switcher button {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-smooth);
  }

  .mobile-tab-switcher button.active {
    background: white;
    color: var(--color-primary);
    box-shadow: inset 0 -2px 0 var(--color-primary);
  }
}

.mobile-tab-switcher {
  display: none;
}

/* ==========================================================================
   GELİŞMİŞ FİLTRE BARI
   ========================================================================== */

.filter-bar-advanced {
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-date-group {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.filter-date-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.filter-date-group input[type="date"] {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-card);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
  color: var(--color-text-main);
  min-width: 150px;
}

.filter-date-group input[type="date"]:focus {
  border-color: var(--color-primary);
}

.filter-date-group > i {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.btn-filter-clear {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-card);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.btn-filter-clear:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-danger-light);
}

.btn-filter-clear i {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .filter-bar-advanced {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-date-group {
    width: 100%;
  }

  .filter-date-group input[type="date"] {
    flex: 1;
  }
}

/* ==========================================================================
   DASHBOARD GRAFİKLERİ
   ========================================================================== */

.chart-container {
  position: relative;
  height: 260px;
  padding: 8px;
}

.chart-container-sm {
  height: 240px;
}

/* ==========================================================================
   QR KOD PAYLAŞIM ALANI
   ========================================================================== */

.qr-code-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.qr-code-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.qr-code-header > i {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.qr-code-header h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.qr-code-header p {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.qr-code-body {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.qr-code-display {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qr-code-display canvas,
.qr-code-display img {
  max-width: 100%;
  max-height: 100%;
}

.qr-code-info {
  flex: 1;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.qr-code-info strong {
  color: var(--color-text-main);
  font-weight: 600;
}

.qr-code-actions {
  display: flex;
  gap: 8px;
}

.qr-code-actions .btn-primary i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   TOPLU İŞLEM BARI (BATCH ACTIONS)
   ========================================================================== */

.batch-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--color-primary-light), #fff);
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  margin-bottom: 12px;
  animation: fadeIn 0.25s ease-out;
}

.batch-action-bar.hidden {
  display: none;
}

.batch-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

.batch-info span {
  font-size: 18px;
  margin-right: 4px;
}

.batch-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-batch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: white;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.btn-batch:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-batch i {
  width: 14px;
  height: 14px;
}

.btn-batch-danger:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-danger-light);
}

.data-table th input[type="checkbox"],
.data-table td input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .batch-action-bar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .batch-buttons {
    justify-content: stretch;
  }

  .btn-batch {
    flex: 1;
    justify-content: center;
  }

  .qr-code-body {
    flex-direction: column;
    text-align: center;
  }
}