:root {
  /* Tema renkleri */
  --bg: #f3f4f6;
  --bg-soft: #e5e7eb;
  --sidebar-bg: #020617;
  --card-bg: #ffffff;
  --border-subtle: #e5e7eb;

  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-on-dark: #e5e7eb;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.24);
  --shadow-card: 0 10px 25px rgba(15, 23, 42, 0.08);

  --sidebar-width: 260px;

  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease-out;
}

/* Genel reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;   /* YATAY SCROLL KAPALI */
}


/* Dashboard body (açık tema) */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e5f0ff 0, #f3f4f6 45%, #ffffff 100%);
  color: var(--text-main);
}

/* Login ekranı arka planı (özel koyu) */
body.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 45%, #000 100%);
}

/* Layout (sidebar + main) */
.layout {
  min-height: 100vh;
  display: flex;
}
/* ===============================
   SIDEBAR — AÇIK (LIGHT) TEMA
   =============================== */
/* ===============================
   SIDEBAR — KURUMSAL (LIGHT) TEMA
   =============================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #ffffff;
  color: #0f172a;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(15, 23, 42, 0.04);
  border-right: 1px solid #e5e7eb;
}

/* Logo ve üst alan */
.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

/* Kullanıcı kutusu – sade, kurumsal */
.sidebar__user {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #0f172a;
  margin-bottom: 18px;
}

.sidebar__user-name {
  font-weight: 600;
  font-size: 14px;
}

.sidebar__user-role {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* Menü */
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

/* Menü linkleri */
.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  color: #111827;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
  font-weight: 500;
}

/* Sol yan çizgi için pseudo eleman (aktif için kullanılacak) */
.sidebar__link::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: height 0.16s ease;
}

/* Hover – hafif gri + accent rengi */
.sidebar__link:hover {
  background: #f3f4f6;
  color: #1d4ed8;
}

/* AKTİF (SEÇİLİ) MENÜ – kurumsal, sade */
.sidebar__link--active {
  background: #eff6ff;
  color: #1d4ed8 !important;
  font-weight: 600;
}

/* Aktifken sol çizgi görünür */
.sidebar__link--active::before {
  height: 70%;
}

/* Çıkış butonu – daha sade */
.sidebar__footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.sidebar__logout-btn {
  display: block;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #991b1b;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid #fecaca;
  transition: background 0.16s ease, color 0.16s ease, transform 0.1s ease;
}

.sidebar__logout-btn:hover {
  background: #fee2e2;
  transform: translateY(-1px);
}

/* Kapatma butonu – varsayılan masaüstünde gizli */
.sidebar__close-btn {
  display: none;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: #6b7280;
}

/* Mobil görünüm */
@media (max-width: 900px) {
  .sidebar {
    left: -100%;
    transition: left 0.2s ease;
    z-index: 40;
    max-width: 82%;
  }

  .sidebar--open {
    left: 0;
  }

  .sidebar__close-btn {
    display: inline-flex;
  }
}


/* Ana alan */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  margin-left: var(--sidebar-width);
  padding: 0 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.96),
    rgba(239, 246, 255, 0.98)
  );
  backdrop-filter: blur(18px);
  color: var(--text-main);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar__menu-btn {
  display: none;
  margin-right: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--text-main);
  cursor: pointer;
}

.topbar__title {
  font-size: 16px;
  font-weight: 600;
}

.topbar__subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar__user {
  margin-left: auto;
  text-align: right;
}

.topbar__user-name {
  display: block;
  font-size: 14px;
}

.topbar__user-role {
  font-size: 12px;
  color: var(--text-muted);
}

/* İçerik alanı */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 20px;
  min-height: 100vh;
  background: linear-gradient(
    180deg,
    #f9fafb 0,
    #f3f4f6 40%,
    #e5e7eb 100%
  );
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeInUp 0.35s ease-out;
}

/* Kart yapısı */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med),
    background var(--transition-med);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(37, 99, 235, 0.35);
  background: #ffffff;
}

.card h1,
.card h2 {
  margin-top: 0;
}

/* Flash mesajları */
.flash-container {
  position: fixed;
  top: 16px;
  left: var(--sidebar-width);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  margin-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e5e7eb;
}

.flash--success {
  background: #dcfce7;
  color: #166534;
}

.flash--error {
  background: #fee2e2;
  color: #b91c1c;
}

.flash--info {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Login ekranı */
.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.login-card {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 22px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-soft);
  color: var(--text-on-dark);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.login-card__header h1 {
  margin: 0;
  font-size: 20px;
}

.login-card__header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.login-card__flash {
  margin-top: 12px;
}

/* Formlar */
.login-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.form-group label {
  color: #0c3483;
}

.form-group input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 9px 12px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  outline: none;
}

.form-group input::placeholder {
  color: #9ca3af;
}

.form-group input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.7);
}

/* Butonlar */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.btn--primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.7);
}

.btn--full {
  width: 100%;
}

.btn-mini {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
}

/* === DASHBOARD ÖZEL STİLLERİ === */

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Üst istatistik kartları */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Bu grid üstündeki ilk 4 kartın renkleri farklı olsun */
.stat-card {
  border-radius: var(--radius-md);
  padding: 12px 14px 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med),
    background var(--transition-med);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.15);
}

/* 1. kart: mavi */
.stat-grid .stat-card:nth-child(1) {
  background: linear-gradient(145deg, #eff6ff, #ffffff);
  border-color: rgba(37, 99, 235, 0.4);
}

/* 2. kart: mor */
.stat-grid .stat-card:nth-child(2) {
  background: linear-gradient(145deg, #f5f3ff, #ffffff);
  border-color: rgba(124, 58, 237, 0.4);
}

/* 3. kart: kırmızı */
.stat-grid .stat-card:nth-child(3) {
  background: linear-gradient(145deg, #fef2f2, #ffffff);
  border-color: rgba(220, 38, 38, 0.4);
}

/* 4. kart: yeşil */
.stat-grid .stat-card:nth-child(4) {
  background: linear-gradient(145deg, #ecfdf5, #ffffff);
  border-color: rgba(22, 163, 74, 0.4);
}

/* 5. kart: mavi-soft */
.stat-grid .stat-card:nth-child(5) {
  background: linear-gradient(145deg, #e0f2fe, #ffffff);
  border-color: rgba(14, 165, 233, 0.4);
}

/* 6. kart: sarı */
.stat-grid .stat-card:nth-child(6) {
  background: linear-gradient(145deg, #fef9c3, #ffffff);
  border-color: rgba(217, 119, 6, 0.4);
}

.stat-card__label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.stat-card__value {
  margin-top: 0;
  font-size: 22px;
  font-weight: 700;
}

.stat-card__hint {
  margin-top: 4px;
  font-size: 11px;
  color: #4b5563;
}

/* Alt dashboard kartları */
.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr);
  gap: 14px;
}

.dashboard-card h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.dash-list {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.dash-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Tablo sarmalayıcı ve tablo stili */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash-table th,
.dash-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  text-align: left;
}

.dash-table thead {
  background: #f9fafb;
}

/* Tag / etiket görünümleri */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.tag--success {
  background: #dcfce7;
  color: #166534;
}

.tag--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.tag--warning {
  background: #fef3c7;
  color: #92400e;
}

/* Dashboard form layout */
.dash-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

textarea {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.02);
  font-size: 14px;
}

/* Daire sayfası: yeni daire kartını küçült + formu animasyonlu yap */
.card--compact {
  max-width: 520px;
}

/* Kart başlığını yan yana hizala */
.card-header-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Açılır/kapanır form */
.collapsible-form {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Açık durum */
.collapsible-form.is-open {
  max-height: 900px;
  opacity: 1;
  transform: translateY(0);
}

/* =============== ANİMASYONLAR =============== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Responsive - tablet ve altı */
@media (max-width: 900px) {
  .layout {
    position: relative;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    left: -100%;
    top: 0;
    bottom: 0;
    transition: left 0.2s ease;
    max-width: 82%;
  }

  .sidebar--open {
    left: 0;
  }

  .sidebar__close-btn {
    display: inline-flex;
  }

  .topbar__menu-btn {
    display: inline-flex;
  }

  .topbar {
    margin-left: 0;
  }

  .content {
    margin-left: 0;
    padding: 14px;
  }

  .flash-container {
    left: 0;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-lower {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Daha küçük ekranlar için login kartı */
@media (max-width: 480px) {
  .login-card {
    border-radius: 18px;
    padding: 18px 14px 14px;
  }

  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .dash-form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Logo + yazı grubu */
.sidebar__logo-wrapper{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}

/* Site adı kurumsal başlık */
.sidebar__brand-title{
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size:13px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#0f172a;
  text-align:center;
}

/* Alt açıklama */
.sidebar__brand-subtitle{
  font-size:11px;
  color:#6b7280;
  text-align:center;
}
@media (max-width: 900px) {
  .content {
    margin-left: 0;
    padding: 12px 10px 18px;
    width: 100%;
    max-width: 100vw;
  }

  .topbar {
    margin-left: 0;
    padding: 0 12px;
  }
}
/* ==========================
   TOPBAR - MOBİLDE YAZI SIĞDIRMA
   ========================== */

/* Topbar'ın tek satıra sıkışmasını engelle */
.topbar{
  flex-wrap: wrap;            /* ✅ alta geçebilsin */
  height: auto;               /* ✅ 70px sabit yüksekliği kır */
  min-height: 64px;
  gap: 10px;
}

/* Başlık bloğu genişlesin, taşmasın */
.topbar__title{
  line-height: 1.15;
  word-break: break-word;
}
.topbar__subtitle{
  line-height: 1.15;
}

/* Sağ blok taşmasın, gerekiyorsa alt satıra insin */
.topbar__user{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;            /* ✅ dil + kullanıcı alt satıra düşebilir */
  text-align: right;
}

/* Uzun isimler kısalsın (… ile) */
.topbar__user-name,
.topbar__user-role{
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dil butonu da taşmasın */
.lang-btn{
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobilde: sağ blok alta insin ve yazılar net küçülsün */
@media (max-width: 520px){
  .topbar{
    padding: 10px 12px;
  }

  /* Menü butonu + başlık aynı satır, sağ blok ikinci satıra */
  .topbar__user{
    width: 100%;
    justify-content: flex-start; /* ✅ alta inince sola */
    text-align: left;
    gap: 8px;
  }

  .topbar__title{
    font-size: 14px;
    font-weight: 700;
  }
  .topbar__subtitle{
    font-size: 11px;
  }

  .topbar__user-name{
    font-size: 12px;
    font-weight: 600;
    max-width: 80vw;
  }
  .topbar__user-role{
    font-size: 11px;
    max-width: 80vw;
  }

  .lang-btn{
    font-size: 11px;
    padding: 6px 8px;
    max-width: 80vw;
  }
}
/* ✅ Tüm sayfalarda içerik alanı çocukları tam genişlikte kalsın */
.content{
  align-items: stretch;      /* önemli: flex child'ları ortalamayı engeller */
}

/* ✅ "wrap" kullanan sayfalarda ortalamayı kır */
.content .wrap{
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
}
