:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --secondary: #1e293b;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #334155;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  
  --success: #10b981;
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --warning: #f59e0b;
  --muted: #94a3b8;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  
  --transition: all 0.2s ease-in-out;
}

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

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

/* Utilities */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1rem; border-radius: var(--radius-md); font-weight: 600;
  font-size: 0.875rem; cursor: pointer; border: 1px solid transparent; transition: var(--transition);
  font-family: inherit;
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

.btn-outline-warning { 
  background-color: transparent; 
  color: var(--warning); 
  border-color: var(--warning); 
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn-outline-warning:hover { background-color: #fef3c7; }

.btn-danger { background-color: transparent; color: var(--danger); padding: 0.5rem; border-radius: var(--radius-md); }
.btn-danger:hover { background-color: var(--danger-bg); }

.input-group { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.input-label { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.input-field {
  padding: 0.625rem 0.75rem; border-radius: var(--radius-md); border: 1px solid var(--border);
  background-color: var(--surface); font-family: inherit; font-size: 0.875rem;
  color: var(--text-primary); transition: var(--transition); min-height: 42px;
}
.input-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.input-field { resize: vertical; min-height: 80px; }

/* Components */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 2rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-weight: 600; color: var(--secondary); }
.card-body { padding: 1.5rem; }

.page-header { margin-bottom: 2rem; }
.page-title { font-size: 1.25rem; font-weight: 700; color: var(--secondary); margin-bottom: 0.25rem; }
.page-desc { color: var(--text-secondary); font-size: 0.875rem; }

/* Status Toggle Buttons */
.status-group { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.status-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-secondary);
  font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.status-btn:hover { border-color: var(--muted); }
.status-btn.active.tamamlandi { background: var(--success); color: white; border-color: var(--success); }
.status-btn.active.gelmedi { background: var(--danger); color: white; border-color: var(--danger); }
.status-btn.active.iptal { background: var(--muted); color: white; border-color: var(--muted); }
.status-btn.active.ertelendi { background: var(--warning); color: white; border-color: var(--warning); }

/* Counter Control */
.counter-wrapper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; width: max-content; }
.counter-btn {
  background: var(--surface); border: none; padding: 0.625rem 1rem; color: var(--primary);
  font-weight: 700; cursor: pointer; transition: background 0.2s; font-size: 1.125rem; display: flex; align-items: center; justify-content: center;
}
.counter-btn:hover { background: var(--background); }
.counter-input {
  width: 50px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  padding: 0.625rem 0; font-size: 0.875rem; font-weight: 600; font-family: inherit; color: var(--text-primary);
  -moz-appearance: textfield;
}
.counter-input::-webkit-outer-spin-button, .counter-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Table and Badges */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { text-align: left; padding: 1rem 1.5rem; color: var(--text-secondary); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--background); border-bottom: 1px solid var(--border); }
.data-table td { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-primary); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--primary-light); }

.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.025em; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--border); color: var(--text-secondary); }
.badge-warning { background: #fef3c7; color: var(--warning); }

/* Layout Definitions */
.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background-color: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.75rem; font-weight: 700; color: var(--secondary); font-size: 1.125rem; }
.nav-links { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex-grow: 1; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 0.875rem; transition: var(--transition); cursor: pointer; }
.nav-link:hover { background-color: var(--background); color: var(--primary); }
.nav-link.active { background-color: var(--primary-light); color: var(--primary); }
.sidebar-footer { padding: 1.5rem; border-top: 1px solid var(--border); }
.logout-btn { background: none; border: none; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.875rem; font-weight: 600; width: 100%; text-align: left; transition: var(--transition); font-family: inherit; }
.logout-btn:hover { color: var(--danger); }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top-header { background-color: var(--surface); height: 60px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; flex-shrink: 0; }
.content-wrapper { padding: 2rem; flex: 1; overflow-y: auto; max-width: 1200px; margin: 0 auto; width: 100%; }

/* Auth Layout */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--background); padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); padding: 2.5rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); border: 1px solid var(--border); }

/* Utility Classes */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-secondary); }

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .status-group { grid-template-columns: 1fr 1fr; }
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .top-header { display: none; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade { animation: fadeIn 0.2s ease-out forwards; }
