:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #10B981;
  --accent: #F59E0B;
  --danger: #EF4444;
  --background: #F3F4F6;
  --surface: #FFFFFF;
  --text-main: #111827;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--primary-hover);
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--secondary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 6px rgba(79, 70, 229, 0.4);
}
.btn-success {
  background-color: var(--secondary);
  color: white;
}
.btn-success:hover {
  background-color: #059669;
}
.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: var(--background);
  border-color: var(--text-muted);
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid rgba(229, 231, 235, 0.5);
  transition: box-shadow 0.3s ease;
}
.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Layout */
.app-header {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.main-content {
  padding: 2rem 0;
  min-height: calc(100vh - 140px);
}

/* Mobile Bottom Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--surface);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
  z-index: 100;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  flex: 1;
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}
.mobile-nav-item svg {
  margin-bottom: 2px;
}
.mobile-nav-item.active {
  color: var(--primary);
}

/* Auth Layout */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, var(--background) 0%, #e0e7ff 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 2.5rem;
  text-align: center;
}

/* Grid & List */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}
.stat-card.success { border-left-color: var(--secondary); }
.stat-card h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.stat-card .value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Lists */
.data-list {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s;
}
.list-item:last-child {
  border-bottom: none;
}
.list-item:hover {
  background-color: #f9fafb;
}
.list-item-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.list-item-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
}
.badge-nakit { background-color: #DEF7EC; color: #03543F; }
.badge-banka { background-color: #E1EFFE; color: #1E429F; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s ease;
  padding: 2rem;
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}
.close-modal:hover { color: var(--text-main); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header {
    position: static;
  }
  .app-header .nav-links { 
    display: none; /* Hide top nav on mobile */
  }
  .mobile-nav {
    display: block; /* Show bottom nav on mobile */
  }
  .main-content {
    /* Ekle padding so content isn't hidden under the nav */
    padding-bottom: 80px; 
  }
  .stat-grid { grid-template-columns: 1fr; }
  .list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .list-item .badge { align-self: flex-start; }

  /* Native App UI overriding */
  body {
    background-color: var(--surface);
  }
  .container {
    padding: 0; /* Remove container padding */
  }
  .mb-4.flex.flex-col, .stat-grid, .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    border: none;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .card:hover { box-shadow: none; }
  .list-item { padding: 1rem; }
  
  /* Make stats cards app-like */
  .stat-card {
    border-left: none !important;
    border-top: 4px solid var(--primary);
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px; /* Restore slight inner radius */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 0.5rem;
  }
  .stat-card.success { border-top-color: var(--secondary); }
  form.ajax-form {
    padding-bottom: 10px;
  }
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--surface);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.toast-success { border-left-color: var(--secondary); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.show { transform: translateX(0); }
