/* ============================================================
   Balkay Lisans — Panel stilleri
   Tek dosya, dış bağımlılık yok (CSP: script-src 'self').
   ============================================================ */

:root {
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --muted:     #64748b;
  --sidebar:   #0f172a;
  --sidebar-2: #1e293b;
  --accent:    #0284c7;
  --accent-2:  #38bdf8;
  --ok:        #059669;
  --ok-bg:     #ecfdf5;
  --warn:      #d97706;
  --warn-bg:   #fffbeb;
  --danger:    #dc2626;
  --danger-bg: #fef2f2;
  --info-bg:   #eff6ff;
  --radius:    .5rem;
  --shadow:    0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Yerleşim ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: var(--sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-2);
}
.sidebar__brand strong { color: #fff; font-size: 1rem; display: block; letter-spacing: -.01em; }
.sidebar__brand span   { color: #64748b; font-size: .75rem; }

.sidebar__nav { padding: .75rem 0; flex: 1; overflow-y: auto; }
.sidebar__group {
  padding: .875rem 1.25rem .375rem;
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #475569;
  font-weight: 600;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem 1.25rem;
  color: #cbd5e1;
  font-size: .875rem;
  border-left: 3px solid transparent;
}
.sidebar__link:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.sidebar__link.is-active {
  background: var(--sidebar-2);
  color: #fff;
  border-left-color: var(--accent-2);
  font-weight: 500;
}
.sidebar__badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .6875rem;
  font-weight: 600;
  padding: .0625rem .375rem;
  border-radius: 999px;
}

.sidebar__foot {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--sidebar-2);
  font-size: .75rem;
  color: #64748b;
}
.sidebar__foot form { margin: .5rem 0 0; }

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

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar h1 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.topbar__actions { display: flex; gap: .5rem; align-items: center; }

.content { padding: 1.5rem; flex: 1; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.card__head {
  padding: .875rem 1.125rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.card__head h2 { margin: 0; font-size: .9375rem; font-weight: 600; }
.card__head .hint { font-size: .75rem; color: var(--muted); font-weight: 400; }
.card__body { padding: 1.125rem; }
.card__body--flush { padding: 0; }

/* ---------- İstatistik kutuları ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow);
}
.stat__label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin-top: .25rem; }
.stat__note  { font-size: .75rem; color: var(--muted); margin-top: .125rem; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th {
  text-align: left;
  padding: .625rem 1.125rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td { padding: .625rem 1.125rem; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #f8fafc; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  padding: 1.75rem 1.125rem;
  text-align: center;
  color: var(--muted);
  font-size: .875rem;
}

/* ---------- Rozetler ---------- */
.badge {
  display: inline-block;
  padding: .125rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge--ok     { background: var(--ok-bg);     color: var(--ok); }
.badge--warn   { background: var(--warn-bg);   color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--muted  { background: #f1f5f9;          color: var(--muted); }
.badge--info   { background: var(--info-bg);   color: var(--accent); }

/* ---------- Bildirimler ---------- */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
  font-size: .875rem;
}
.alert--success { background: var(--ok-bg);     border-color: #a7f3d0; color: #065f46; }
.alert--error   { background: var(--danger-bg); border-color: #fecaca; color: #991b1b; }
.alert--warning { background: var(--warn-bg);   border-color: #fde68a; color: #92400e; }
.alert--info    { background: var(--info-bg);   border-color: #bfdbfe; color: #1e40af; }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem .875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.25;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #0369a1; border-color: #0369a1; }
.btn--danger  { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #b91c1c; }
.btn--sm { padding: .3125rem .625rem; font-size: .8125rem; }
.btn--link { border: 0; background: none; color: var(--accent); padding: 0; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Formlar ---------- */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  margin-bottom: .3125rem;
}
.field .help { font-size: .75rem; color: var(--muted); margin-top: .3125rem; }
.input, select.input, textarea.input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  font-size: .875rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.input:focus {
  outline: 2px solid rgba(2,132,199,.25);
  outline-offset: 0;
  border-color: var(--accent);
}
textarea.input { min-height: 5rem; resize: vertical; }

/* ---------- Giriş ekranı ---------- */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  padding: 1.5rem;
}
.auth__box {
  width: 100%;
  max-width: 22rem;
  background: var(--surface);
  border-radius: .75rem;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(2,6,23,.35);
}
.auth__brand { text-align: center; margin-bottom: 1.5rem; }
.auth__brand strong { display: block; font-size: 1.125rem; letter-spacing: -.01em; }
.auth__brand span { font-size: .8125rem; color: var(--muted); }
.auth__foot { text-align: center; margin-top: 1.25rem; font-size: .75rem; color: var(--muted); }

/* ---------- Yardımcılar ---------- */
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .8125rem; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.row > * { flex: 1 1 340px; min-width: 0; }
.mb-0 { margin-bottom: 0; }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .sidebar__nav { display: flex; flex-wrap: wrap; padding: .5rem; }
  .sidebar__group { display: none; }
  .sidebar__link { border-left: 0; border-radius: var(--radius); padding: .4375rem .75rem; }
  .content { padding: 1rem; }
}
