:root {
    --sidebar-w: 250px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --brand: #38bdf8;
    --primary: #0ea5e9;
    --bg: #f1f5f9;
    --card-border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: .875rem;
}

.admin-wrap { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.brand-logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--primary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem;
}

.brand-title { font-weight: 700; color: #fff; font-size: 1rem; line-height: 1.1; }
.brand-sub { font-size: .7rem; color: #94a3b8; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .85rem;
    transition: all .15s ease;
}

.sidebar-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary), #0284c7);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14,165,233,.35);
}

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }

.btn-logout {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 9px;
    border-radius: 9px;
    background: rgba(255,255,255,.06);
    color: #cbd5e1;
    text-decoration: none;
    font-size: .84rem;
    transition: all .15s ease;
}
.btn-logout:hover { background: #ef4444; color: #fff; }

/* ---------- Main ---------- */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-title h1 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.topbar-date { font-size: .74rem; color: var(--muted); }

.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--primary));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.user-name { font-weight: 600; font-size: .84rem; line-height: 1.1; }
.user-role { font-size: .7rem; color: var(--muted); }

.content { padding: 24px; flex: 1; }

/* ---------- Kartlar ---------- */
.card {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15,23,42,.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    border-radius: 14px 14px 0 0 !important;
    font-weight: 600;
}

/* Stat kartları */
.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .76rem; color: var(--muted); margin-top: 4px; }

/* Tablolar */
.table { --bs-table-hover-bg: #f8fafc; margin-bottom: 0; }
.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}
.table td { vertical-align: middle; }

/* Rozetler */
.badge { font-weight: 600; font-size: .7rem; padding: .4em .6em; }
.badge-basvuru { background: #eff6ff; color: #1d4ed8; }

/* Butonlar */
.btn { border-radius: 9px; font-size: .82rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #0284c7; border-color: #0284c7; }
.btn-soft { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.btn-soft:hover { background: #dbeafe; color: #1e40af; }
.btn-icon { padding: .25rem .5rem; }

/* Tabler alan türü rozeti */
.badge-tip { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Arama */
.search-box { max-width: 300px; }
.search-box .form-control { border-radius: 9px; }

/* API dokümantasyon */
.api-card { margin-bottom: 18px; }
.api-url {
    font-family: 'Cascadia Code', Consolas, monospace;
    background: #0f172a;
    color: #7dd3fc;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: .78rem;
}
.api-tab-panel { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 16px; font-family: 'Cascadia Code', Consolas, monospace; font-size: .76rem; white-space: pre-wrap; word-break: break-word; }

.arg-table th { width: 28%; }

/* Console */
.console-output {
    min-height: 200px;
    background: #0f172a;
    color: #86efac;
    border-radius: 10px;
    padding: 14px;
    font-family: 'Cascadia Code', Consolas, monospace;
    font-size: .76rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    padding: 16px;
}
.login-card { width: 100%; max-width: 400px; border-radius: 16px; border: 0; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.login-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--primary));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 10px;
}

/* Toast */
.bk-toast {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 2000;
    min-width: 280px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-size: .84rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    animation: slideUp .25s ease;
}
.bk-toast.ok { background: #16a34a; }
.bk-toast.err { background: #dc2626; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { width: 62px; }
    .sidebar-brand div, .sidebar-nav a span, .brand-title, .brand-sub, .sidebar-foot a { display: none; }
    .sidebar-nav a { justify-content: center; }
    .sidebar-brand { justify-content: center; }
    .main { margin-left: 62px; }
}
