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

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-app: #f8fafc;
  --sidebar-bg: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
}

html.dark {
  --bg-app: #020617;
  --sidebar-bg: #0f172a;
  --card-bg: #0f172a;
  --border-color: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Slide-over Drawer Animations */
.drawer-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-panel.active {
  transform: translateX(0);
}

/* Table Row Active / Hover states */
.table-row-hover {
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.table-row-hover:hover {
  background-color: #f1f5f9;
}

html.dark .table-row-hover:hover {
  background-color: #1e293b;
}

.table-row-selected {
  background-color: #eff6ff !important;
}

html.dark .table-row-selected {
  background-color: #1e3a5f !important;
}

/* Badge Pills */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.15rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  white-space: nowrap;
}

.badge-pill-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
}

/* Sidebar Nav item */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.sidebar-link.active {
  background-color: #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

html.dark .sidebar-link {
  color: #94a3b8;
}

html.dark .sidebar-link:hover {
  background-color: #1e293b;
  color: #f8fafc;
}

html.dark .sidebar-link.active {
  background-color: #1e293b;
  color: #38bdf8;
  font-weight: 600;
}

/* Metric / Stat box */
.stat-box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

html.dark .stat-box {
  background-color: #0f172a;
  border-color: #1e293b;
  color: #f8fafc;
}

html.dark .stat-box:hover {
  border-color: #334155;
}

/* ==========================================================================
   Mobile & Responsive Layout System (Adım 37)
   ========================================================================== */

/* Touch-friendly Scrolling for Tables and Scroll Containers */
.overflow-x-auto,
table,
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Mobile Layout Overrides (< 1024px) */
@media (max-width: 1023px) {
  /* Prevent horizontal viewport blowup */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
  }

  /* Body flows naturally as a block with topbar and bottombar clearance */
  body {
    display: block !important;
    padding-top: 3.5rem !important; /* 56px clearance for Mobile Sticky Topbar */
    padding-bottom: 4.75rem !important; /* 76px clearance for Mobile Bottom App Bar */
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh !important;
  }

  /* Break desktop flex h-screen wrappers so content scrolls naturally */
  .flex.h-screen.overflow-hidden,
  .flex.h-full.overflow-hidden {
    display: block !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
  }

  /* Main content container fills mobile screen cleanly */
  main,
  .main-content {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    flex: none !important;
    display: block !important;
  }

  /* Mobile Padding Optimizations (replaces excessive desktop padding) */
  .p-8 {
    padding: 1rem !important;
  }
  .px-8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .py-5 {
    padding-top: 0.875rem !important;
    padding-bottom: 0.875rem !important;
  }
  .p-6 {
    padding: 1rem !important;
  }

  /* Touch-friendly minimum tap targets */
  button,
  .btn,
  a.btn {
    min-height: 38px;
  }

  /* Tables inside card containers get minimum legible width without squishing text */
  table {
    min-width: 620px;
  }

  /* Slide-over Customer Drawer full width on mobile */
  #customer-drawer-panel {
    max-width: 100vw !important;
    width: 100% !important;
  }
}