/* SitePanel — sade, yormayan tema (Bootstrap 5.3 üzerine hafif katman) */

:root {
  --sp-primary: #2563eb;
  --sp-primary-dark: #1e40af;
  --sp-bg: #f4f6f9;
  --sp-sidebar-bg: #1f2937;
  --sp-sidebar-text: #cbd5e1;
  --sp-sidebar-active: #111827;
  --sp-border: #e5e9f0;
}

body {
  background: var(--sp-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1f2933;
}

a { color: var(--sp-primary); }

.btn-primary {
  background: var(--sp-primary);
  border-color: var(--sp-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--sp-primary-dark);
  border-color: var(--sp-primary-dark);
}

.card {
  border: 1px solid var(--sp-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--sp-border);
  font-weight: 600;
}

/* ---------- Public (auth) sayfaları ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 640px; }
.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}
.auth-brand .logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sp-primary-dark);
  text-decoration: none;
}
.auth-brand .tagline { color: #64748b; font-size: .9rem; }

/* ---------- Panel yerleşimi (admin / app / root) ---------- */
.sp-layout { display: flex; min-height: 100vh; }

.sp-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sp-sidebar-bg);
  color: var(--sp-sidebar-text);
  display: flex;
  flex-direction: column;
}
.sp-sidebar .brand {
  padding: 18px 20px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sp-sidebar .brand small { display:block; font-weight: 400; font-size: .72rem; color: #94a3b8; margin-top: 2px; }
.sp-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sp-nav .nav-label {
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #718096;
  padding: 12px 10px 4px;
}
.sp-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--sp-sidebar-text);
  text-decoration: none;
  font-size: .93rem;
  margin-bottom: 2px;
}
.sp-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sp-nav a.active { background: var(--sp-primary); color: #fff; }
.sp-nav a .bi { font-size: 1.05rem; width: 20px; text-align: center; }

.sp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sp-topbar {
  background: #fff;
  border-bottom: 1px solid var(--sp-border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sp-topbar .page-title { font-size: 1.05rem; font-weight: 600; margin: 0; }

.sp-content { padding: 24px; max-width: 1400px; width: 100%; }

.impersonation-bar {
  background: #b45309;
  color: #fff;
  padding: 6px 24px;
  font-size: .88rem;
}
.impersonation-bar a { color: #fde68a; }

/* Tablolar */
.table { --bs-table-hover-bg: #f8fafc; }
.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  border-bottom-width: 1px;
}
.table td { vertical-align: middle; }

.stat-card .value { font-size: 1.7rem; font-weight: 700; }
.stat-card .label { color: #64748b; font-size: .85rem; }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-debt { color: #b91c1c; font-weight: 600; }
.text-credit { color: #15803d; font-weight: 600; }

/* Mobil */
@media (max-width: 992px) {
  .sp-sidebar { position: fixed; z-index: 1040; height: 100vh; left: -240px; transition: left .2s; }
  .sp-sidebar.open { left: 0; }
  .sp-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
  .sp-backdrop.show { display: block; }
}

/* ---------- Buton kontrast iyileştirmesi (soluk gri butonlar) ---------- */
.btn-light {
  background: #eef2f7;
  border: 1px solid #cbd5e1;
  color: #1e293b;
}
.btn-light:hover, .btn-light:focus {
  background: #dbe4ef;
  border-color: #94a3b8;
  color: #0f172a;
}
.btn-outline-secondary {
  color: #475569;
  border-color: #94a3b8;
}
.btn-outline-secondary:hover {
  background: #475569;
  border-color: #475569;
}

/* ---------- Kart cilası: başlık/gövde/altbilgi ayrımı, sakin vurgular ---------- */
.card-header {
  background: #f8fafc;
  padding-top: .65rem;
  padding-bottom: .65rem;
  border-radius: 10px 10px 0 0 !important;
}
.card-header .bi { color: var(--sp-primary); }
.card-footer {
  background: #f8fafc;
  border-top: 1px solid var(--sp-border);
}
.stat-card { transition: transform .15s ease, box-shadow .15s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 24, 40, .10); }
.stat-card > .bi {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: #eff6ff;
  margin-bottom: 6px;
}
.stat-card > .bi.text-success { background: #ecfdf5; }
.stat-card > .bi.text-info    { background: #ecfeff; }
.stat-card > .bi.text-warning { background: #fffbeb; }
.stat-card > .bi.text-danger  { background: #fef2f2; }

/* Onay modalı */
.sp-confirm-icon {
  width: 56px; height: 56px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #eff6ff; color: var(--sp-primary);
  font-size: 1.6rem;
}

/* Avatarlar (yorumlar, talepler) */
.sp-avatar, .sp-avatar-ph {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
}
.sp-avatar { object-fit: cover; }
.sp-avatar-ph {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: #fff; letter-spacing: .02em;
}
.sp-avatar.sm, .sp-avatar-ph.sm { width: 26px; height: 26px; font-size: .62rem; }

/* Marka rozeti */
.sp-sidebar .brand { display: flex; align-items: center; gap: 10px; }
.sp-sidebar .brand .brand-mark { width: 28px; height: 28px; border-radius: 7px; }
.auth-brand .logo { display: inline-flex; align-items: center; gap: 10px; }
.auth-brand .logo img { height: 42px; border-radius: 10px; }

/* Silinmiş yorum izi */
.sp-comment-deleted { color: #94a3b8; font-style: italic; }

/* ---------- Yazdırma: yalnızca sayfa içeriği (rapor) basılır ---------- */
@media print {
  .sp-sidebar, .sp-topbar, .impersonation-bar, .sp-backdrop,
  .btn, button, form, .alert, .nav-tabs { display: none !important; }
  .sp-content { padding: 0 !important; max-width: 100% !important; }
  .sp-layout { display: block; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
}
