/* ==========================================================================
   MEDİKSAAS - KURUMSAL MEDİKAL ERP & SAAS PLATFORMU
   Tasarım Felsefesi: Premium Enterprise Slate, Ciddi Medikal & Finans Standartı
   Mor/Neon/Oyun gradyanları içermez; temiz, keskin ve kurumsaldır.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a; /* Slate 900 */
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1e293b;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary: #1d4ed8; /* Kurumsal Güvenilir Mavi */
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  
  --success: #059669; /* Zümrüt */
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #d97706; /* Amber */
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #dc2626; /* Kırmızı */
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  
  --info: #0284c7;
  --info-light: #f0f9ff;
  
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* Sayısal ve Kod Alanları İçin Monospace */
.font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   SIDEBAR (Sol Kurumsal Menü)
   ========================================================================== */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  border-right: 1px solid #1e293b;
}

.sidebar-header {
  padding: 20px 20px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mobil Menü Kapatma Butonu (Sidebar İçi) */
.mobile-sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.mobile-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobil Menü Arka Plan Perdesi (Backdrop) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  border: 1px solid #3b82f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #ffffff;
}

.logo-text h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.logo-text span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Tenant Seçici Rozeti */
.tenant-badge {
  margin: 16px 16px 8px 16px;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
}

.tenant-badge-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 2px;
}

.tenant-badge-name {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-badge-vkn {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.nav-links {
  list-style: none;
  padding: 12px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-category {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 12px 12px 6px 12px;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-link:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.nav-link.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0b1120;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
}

/* ==========================================================================
   MAIN CONTENT & HEADER
   ========================================================================== */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  width: calc(100% - 260px);
  max-width: calc(100vw - 260px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-header {
  min-height: 60px;
  height: auto;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
}

/* Mobil Menü Açma Butonu (Hamburger) */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.hamburger-btn:active {
  background: #e2e8f0;
}

.page-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.top-status-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill.success {
  background-color: var(--success-light);
  color: var(--success);
  border-color: var(--success-border);
}

.status-pill.info {
  background-color: var(--info-light);
  color: var(--info);
  border-color: #bae6fd;
}

.content-body {
  padding: 16px 20px;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* Fatura Merkezi Özel 2 Kolonlu Makine Düzeni */
.invoice-center-layout {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}

.invoice-center-left {
  width: 430px;
  min-width: 430px;
  max-width: 430px;
  position: sticky;
  top: 16px;
}

.invoice-center-right {
  min-width: 0;
  width: 100%;
}

@media (max-width: 1200px) {
  .invoice-center-layout {
    grid-template-columns: 370px minmax(0, 1fr);
  }
  .invoice-center-left {
    width: 370px;
    min-width: 370px;
    max-width: 370px;
  }
}

@media (max-width: 1024px) {
  .invoice-center-layout {
    grid-template-columns: 1fr !important;
  }
  .invoice-center-left {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    position: static !important;
  }
}

/* ÜTS Kurumsal Yeşil / Kırmızı Durum Kutuları */
.uts-status-box-green {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.uts-status-box-red {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.uts-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
}

.uts-dot-red {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
  flex-shrink: 0;
}

.segmented-control {
  display: grid;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  gap: 3px;
}

.segmented-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.segmented-btn:hover {
  color: #0f172a;
}

.segmented-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-body {
  padding: 20px;
}

/* KPI Kartları */
.stat-card {
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   TABLES (Kurumsal Tablo Standardı)
   ========================================================================== */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

table.enterprise-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

table.enterprise-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.enterprise-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

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

/* Rozetler (Badges) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-success {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background-color: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background-color: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-auto {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-primary {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-purple {
  background-color: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-teal {
  background-color: #f0fdf4;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-incoming {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-outgoing {
  background-color: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   BUTTONS & FORMS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #ffffff;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

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

/* Toast Bildirimleri */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  min-width: 320px;
  animation: slideIn 0.2s ease;
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESMİ GİB & İŞNET E-FATURA / E-ARŞİV / E-İRSALİYE ŞABLONU
   ========================================================================== */
.gib-invoice-sheet {
  background: #ffffff;
  border: 1.5px solid #1e293b;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
  font-size: 11px;
  line-height: 1.4;
}

.gib-header-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.3fr;
  gap: 12px;
  border-bottom: 1.5px solid #1e293b;
  padding-bottom: 14px;
  margin-bottom: 12px;
  align-items: start;
}

.gib-supplier-box h4 {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.gib-center-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gib-official-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #dc2626;
  border-radius: 3px;
  padding: 2px 6px;
  background: #fff1f2;
  margin-bottom: 4px;
}

.gib-doc-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #0f172a;
  margin: 2px 0;
}

.gib-doc-meta-box {
  border: 1px solid #1e293b;
  border-radius: 3px;
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 10.5px;
  line-height: 1.5;
}

.gib-receiver-box {
  border: 1px solid #1e293b;
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #ffffff;
}

.gib-receiver-box .box-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.gib-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #1e293b;
  font-size: 10.5px;
  margin-bottom: 12px;
}

.gib-table thead tr {
  background: #0f172a;
  color: #ffffff;
}

.gib-table th {
  padding: 6px 8px;
  font-weight: 600;
  border: 1px solid #334155;
  text-align: left;
}

.gib-table td {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  vertical-align: middle;
}

.gib-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.gib-table-btn-del {
  background: none;
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: 3px;
  cursor: pointer;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: bold;
}
.gib-table-btn-del:hover {
  background: #ef4444;
  color: #fff;
}

.gib-totals-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
  margin-top: 8px;
  align-items: start;
}

.gib-notes-box {
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 8px 10px;
  background: #f8fafc;
  font-size: 10px;
  line-height: 1.4;
}

.gib-totals-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #1e293b;
  font-size: 11px;
}

.gib-totals-table td {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
}

.gib-totals-table tr.total-row {
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
}

.gib-totals-table tr.total-row td {
  border-color: #0f172a;
}

/* ==========================================================================
   MOBİL VE TABLET DUYARLILIK SİSTEMİ (RESPONSIVE OVERHAUL)
   Breakpoints:
   - <= 1200px: Küçük Masaüstü & Büyük Tabletler
   - <= 1024px: Tablet & iPad (Off-canvas Çekmece Menü, 1 Kolon Düzen)
   - <= 768px:  Akıllı Telefonlar (Form Alanları, Kart Başlıkları, Tablo Kaydırma)
   - <= 480px:  Küçük Telefonlar (Kompakt Metinler, Tek Kolon Grid)
   ========================================================================== */

/* 1. Ekran <= 1200px */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* 2. Ekran <= 1024px: Çekmece Menü ve Tablet Düzeni */
@media (max-width: 1024px) {
  /* Sol Menü: Off-canvas Çekmece */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  /* Menü Açıkken */
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.45);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-backdrop {
    display: block;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sidebar-close {
    display: inline-flex;
  }

  .hamburger-btn {
    display: inline-flex;
  }

  /* Ana İçerik Sol Boşluğunu Sıfırla */
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .content-body {
    padding: 24px 20px;
  }

  /* İki Kolonlu Izgaraları Tek Kolona Çökert */
  .grid-2,
  .kamu-sale-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* 3. Ekran <= 768px: Akıllı Telefonlar */
@media (max-width: 768px) {
  .top-header {
    height: auto !important;
    min-height: 56px;
    padding: 10px 14px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .page-title-area {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-title {
    font-size: 15px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-status-pills {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 6px !important;
    scrollbar-width: none;
  }

  .top-status-pills::-webkit-scrollbar {
    display: none;
  }

  .top-status-pills .status-pill {
    font-size: 10px !important;
    padding: 3px 8px !important;
    flex-shrink: 0 !important;
  }

  .top-status-pills .btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
    flex-shrink: 0 !important;
  }

  .content-body {
    padding: 14px 12px !important;
  }

  /* Kart Başlıkları ve Filtre Elemanları: Dikey Yığılma */
  .card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }

  .card-header > div {
    width: 100% !important;
  }

  .card-header input.form-control,
  .card-header select.form-control {
    width: 100% !important;
    max-width: 100% !important;
  }

  .card-header .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .card-header > div:last-child:not(:first-child) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .card-header > div:last-child:not(:first-child) .btn {
    flex: 1 1 auto;
  }

  .card-body {
    padding: 16px 14px !important;
  }

  /* Stat / KPI Kartları */
  .stat-card {
    padding: 14px 16px !important;
  }

  .stat-value {
    font-size: 20px !important;
  }

  /* Form Grupları ve Gridler: Tek Kolon (Resmi Fatura Şablonu Hariç) */
  div[style*="grid-template-columns"]:not(.gib-invoice-sheet *):not(.gib-invoice-sheet) {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .doc-type-buttons {
    flex-direction: column !important;
    width: 100% !important;
  }

  .doc-type-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Gelen Faturalar Kart Üst Başlığı */
  .incoming-card-top {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .incoming-card-top > div:last-child {
    text-align: left !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    width: 100%;
  }

  .incoming-card-top > div:last-child .btn {
    margin-top: 0 !important;
  }

  /* Resmi GİB Fatura Önizlemesi: Mobilde Bozulmadan Yatay Kaydırma */
  #invoiceSheetContainer {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px !important;
    max-width: 100% !important;
    background: #f1f5f9;
    border-radius: 6px;
  }

  .gib-invoice-sheet {
    min-width: 600px !important;
  }

  /* Tablolar: Yatay Kaydırma & Minimum Genişlik */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    margin-bottom: 8px;
  }

  table.enterprise-table {
    min-width: 560px !important;
  }

  table.enterprise-table th,
  table.enterprise-table td {
    padding: 9px 12px !important;
    font-size: 12px !important;
  }

  /* Form Girdileri */
  .form-control {
    font-size: 14px !important;
    min-height: 40px;
  }

  /* Modallar */
  .modal-overlay {
    padding: 10px !important;
    align-items: flex-end !important;
  }

  .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    border-radius: 12px 12px 0 0 !important;
    margin: 0 !important;
  }

  .modal-header {
    padding: 14px 16px !important;
  }

  .modal-body {
    padding: 16px 14px !important;
    max-height: calc(92vh - 130px) !important;
    overflow-y: auto !important;
  }

  .modal-footer {
    padding: 12px 16px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Bildirim Toastları */
  .toast-container {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    max-width: calc(100vw - 24px) !important;
  }

  .toast {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 12px !important;
    padding: 10px 14px !important;
  }
}

/* 4. Ekran <= 480px: Küçük Telefonlar */
@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .top-header {
    padding: 8px 10px !important;
  }

  .content-body {
    padding: 10px 8px !important;
  }

  .card-body {
    padding: 12px 10px !important;
  }

  .btn {
    padding: 7px 12px !important;
    font-size: 12px !important;
  }

  .tenant-badge {
    margin: 10px 10px 4px 10px !important;
    padding: 8px 10px !important;
  }
}

