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

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-app: #f5f7fa;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --surface-soft: #f7f9fb;
  --border-color: #e3e9f0;
  --text-primary: #1e2d3d;
  --text-secondary: #5d6f82;
  --text-muted: #8a99a8;
  --primary: #0082bd;
  --primary-hover: #006da0;
  --nil-cyan: #009fe3;
  --nil-navy: #0b4f78;
  --accent-green: #1f8a5b;
  --accent-amber: #d98218;
  --accent-rose: #d63649;
}

html.dark,
html[data-theme="dark"] {
  --bg-app: #101822;
  --sidebar-bg: #141f2b;
  --card-bg: #172230;
  --surface-soft: #131e2a;
  --border-color: #273647;
  --text-primary: #e2ecf5;
  --text-secondary: #98adbf;
  --text-muted: #6e8397;
  --primary: #38bdf8;
  --primary-hover: #009fe3;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-feature-settings: "tnum" 1;
  -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.14s ease, border-color 0.14s ease;
}

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

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

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

html.dark .table-row-selected {
  background-color: #183249 !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.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #5d6f82;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.sidebar-link:hover {
  background-color: #f2f7fb;
  color: #0b4f78;
}

.sidebar-link.active {
  background-color: #eaf5fc;
  color: #006da0;
  font-weight: 600;
}

html.dark .sidebar-link {
  color: #98adbf;
}

html.dark .sidebar-link:hover {
  background-color: #1b2a38;
  color: #dff0fa;
}

html.dark .sidebar-link.active {
  background-color: #173047;
  color: #7dd3fc;
  font-weight: 600;
}

/* Metric / Stat box */
.stat-box {
  background-color: #ffffff;
  border: 1px solid #e3e9f0;
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.stat-box:hover {
  border-color: #b7daf0;
  box-shadow: 0 2px 10px rgba(0, 130, 189, 0.06);
}

html.dark .stat-box {
  background-color: #172230;
  border-color: #273647;
  color: #e2ecf5;
}

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

/* ==========================================================================
   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;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* 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;
  }

  /* Prevent double top gap when body already adds 3.5rem clearance */
  main.pt-14 {
    padding-top: 0 !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;
  }
}