/* ===== KOÇBAĞI TASARIM SİSTEMİ ===== */
:root {
  --primary:     #2D6A4F;
  --primary-dk:  #1B4332;
  --accent:      #52B788;
  --accent-lt:   #B7E4C7;
  --bg:          #F8F9FA;
  --bg-white:    #FFFFFF;
  --text:        #212529;
  --text-muted:  #6C757D;
  --border:      #DEE2E6;
  --danger:      #DC3545;
  --warning:     #FFC107;
  --success:     #198754;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 2px 8px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
  --transition:  .2s ease;
  --sidebar-w:   260px;
}

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

.hidden { display: none !important; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dk); }

img { max-width: 100%; display: block; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

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

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

.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b02a37; }

.btn-sm  { padding: .375rem .875rem; font-size: .8125rem; }
.btn-lg  { padding: .875rem 1.75rem; font-size: 1.0625rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; justify-content: center; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .4rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9375rem;
  background: var(--bg-white);
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(82,183,136,.15); }
.form-control:disabled { background: #f1f3f5; cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: .8125rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .8125rem; color: var(--danger); margin-top: .3rem; }

.form-check { display: flex; align-items: flex-start; gap: .5rem; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-body  { padding: 1.25rem; }
.card-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
}
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* ===== ALERTS ===== */
.alert {
  padding: .875rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef9c3; color: #854d0e; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn .15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  animation: slideUp .2s ease;
}
.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-body   { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  flex-shrink: 0;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.25rem; line-height: 1; padding: .2rem;
}
.modal-close:hover { color: var(--text); }

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(0,0,0,.12);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.spinner-overlay.hidden { display: none; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .8125rem; font-weight: 600; color: var(--text-muted); background: var(--bg); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .5; }
.empty-state p { font-size: .9375rem; }

/* ===== AVATAR ===== */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-lt);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: .875rem;
  flex-shrink: 0;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }

/* ===== SWITCH TOGGLE ===== */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--transition);
  position: relative;
}
.toggle-switch input:checked ~ .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow);
}
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ===== LANDING PAGE ===== */
.landing-hero {
  background: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary) 60%, var(--accent) 100%);
  color: #fff;
  padding: 5rem 1.5rem;
  text-align: center;
}
.landing-hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.landing-hero p  { font-size: 1.125rem; opacity: .9; max-width: 540px; margin: 0 auto 2rem; }

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 3rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.feature-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }

/* ===== AUTH PAGES ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1.5rem;
}
.auth-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.375rem;
}
.auth-logo img { width: 36px; }

/* ===== LAYOUT — PANEL ===== */
.panel-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dk);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.125rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo img { width: 28px; }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  color: rgba(255,255,255,.75);
  font-size: .9375rem;
  transition: var(--transition);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar-nav a.active { font-weight: 600; }
.sidebar-nav .nav-icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 1rem 1.5rem;
  padding-bottom: max(1rem, calc(1rem + env(safe-area-inset-bottom)));
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.sidebar-user-name { font-size: .875rem; font-weight: 500; }
.sidebar-user-role { font-size: .75rem; opacity: .65; }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--bg-white);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title { font-weight: 600; font-size: 1.0625rem; flex: 1; }
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--text);
  font-size: 1.25rem;
}
.page-content { padding: 1.5rem; flex: 1; }

/* ===== BOTTOM NAV (Client mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .625rem .5rem;
  color: var(--text-muted);
  font-size: .6875rem;
  transition: var(--transition);
  flex: 1;
}
.bottom-nav a .nav-icon { font-size: 1.375rem; }
.bottom-nav a.active, .bottom-nav a:hover { color: var(--primary); }

/* ===== STATS WIDGET ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.stat-label { font-size: .8125rem; color: var(--text-muted); margin-bottom: .25rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-sub   { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
  padding: .625rem 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .9375rem;
  color: var(--text-muted);
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== LOADING ===== */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* ===== UTILITY ===== */
.d-flex  { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.w-100 { width: 100%; }
.flex-wrap { flex-wrap: wrap; }
.rounded { border-radius: var(--radius); }
.shadow  { box-shadow: var(--shadow); }

/* ===== ANIMATIONS ===== */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .bottom-nav { display: block; }
  .main-content .page-content { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.625rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
}
