@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/inter-700.woff2') format('woff2');
}

/* ============================================================
   KÖK YYİS – MIDNIGHT BLUE ADMIN
   ============================================================ */
:root {
    --dark: #0A0E27;
    --dark-2: #12173A;
    --dark-3: #1A2050;
    --dark-4: #252C6A;
    --accent: #0044CC;
    --accent-hover: #003399;
    --surface: #FFFFFF;
    --g900: #1F2937;
    --g600: #4B5563;
    --g500: #6B7280;
    --g300: #D1D5DB;
    --g100: #F3F4F6;
    --g50: #F9FAFB;
    --success: #16A34A;
    --warning: #F59E0B;
    --error: #DC2626;
    --info: #0EA5E9;
    --sidebar-w: 260px;
    --sidebar-collapsed: 80px;
    --header-h: 64px;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.12);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.18);
    --content-max: 1440px;
    --bg-page: #F3F4F6;
    --card-bg: #FFFFFF;
    --text: #1F2937;
    --text-muted: #6B7280;
    --border: rgba(31,41,55,.10);
}

[data-theme="dark"] {
    --bg-page: #0A0E27;
    --card-bg: #12173A;
    --surface: #12173A;
    --text: #E5E7EB;
    --text-muted: #9CA3AF;
    --g900: #E5E7EB;
    --g600: #CBD5E1;
    --g500: #9CA3AF;
    --g300: #374151;
    --g100: #1A2050;
    --g50: #1A2050;
    --border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

/* ---------- HEADER ---------- */
.kok-header {
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #0A0E27;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    color: #fff;
}
.kok-brand { display: flex; align-items: center; gap: 10px; min-width: 212px; text-decoration: none; color: #fff; }
.kok-brand .logo {
    width: 36px; height: 36px; border-radius: 8px; background: #0044CC;
    display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.5px;
}
.kok-brand .brand-text { line-height: 1.1; }
.kok-brand .brand-text strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.kok-brand .brand-text span { font-size: 10px; color: #94A3B8; letter-spacing: .08em; text-transform: uppercase; }

.kok-search { position: relative; flex: 1; max-width: 420px; }
.kok-search input {
    width: 100%; height: 38px; border-radius: 8px; border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.06); color: #fff; padding: 0 12px 0 36px; font-size: 13px;
}
.kok-search input::placeholder { color: #94A3B8; }
.kok-search i { position: absolute; left: 12px; top: 11px; color: #94A3B8; }
.kok-search kbd {
    position: absolute; right: 8px; top: 9px; font-size: 10px; background: rgba(255,255,255,.12);
    border-radius: 4px; padding: 2px 5px; color: #CBD5E1;
}
.kok-header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.kok-icon-btn {
    width: 38px; height: 38px; border-radius: 8px; border: 0; background: transparent; color: #CBD5E1;
    display: grid; place-items: center; cursor: pointer; position: relative; font-size: 17px;
    transition: background 150ms ease-out, color 150ms ease-out;
    text-decoration: none;
}
.kok-icon-btn:hover { background: #252C6A; color: #fff; }
.kok-icon-btn .dot {
    position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #DC2626;
    border: 1.5px solid #0A0E27;
}
.kok-user {
    display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 8px;
    background: rgba(255,255,255,.06); color: #fff; border: 0; cursor: pointer; font-size: 13px;
}
.kok-user:hover { background: #252C6A; }
.kok-user .avatar {
    width: 30px; height: 30px; border-radius: 6px; background: #0044CC; display: grid; place-items: center;
    font-size: 12px; font-weight: 600;
}
.kok-user small { display: block; font-size: 10px; color: #94A3B8; line-height: 1; text-align: left; }

/* ---------- LAYOUT ---------- */
.kok-shell { display: flex; min-height: calc(100vh - 64px); }
.kok-sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: #12173A; color: #CBD5E1; overflow-y: auto; position: sticky; top: 64px;
    height: calc(100vh - 64px); padding: 12px 8px 24px; transition: width 180ms ease-out;
    scrollbar-width: thin; scrollbar-color: #252C6A transparent;
}
.kok-sidebar::-webkit-scrollbar { width: 6px; }
.kok-sidebar::-webkit-scrollbar-thumb { background: #252C6A; border-radius: 3px; }
body.sidebar-collapsed .kok-sidebar { width: var(--sidebar-collapsed); flex: 0 0 var(--sidebar-collapsed); }
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .nav-chevron { display: none; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 10px; }

.nav-group { margin-bottom: 6px; }
.nav-group-title {
    font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: #64748B;
    padding: 10px 12px 6px; font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.nav-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    color: #CBD5E1; text-decoration: none; font-size: 13px; font-weight: 400;
    transition: background 150ms ease-out, color 150ms ease-out; margin-bottom: 1px;
}
.nav-link:hover { background: #252C6A; color: #fff; }
.nav-link.active { background: #0044CC; color: #fff; font-weight: 500; }
.nav-link i { font-size: 16px; width: 18px; text-align: center; flex: 0 0 18px; }
.nav-link .nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link .nav-badge {
    margin-left: auto; font-size: 10px; background: #DC2626; color: #fff; border-radius: 6px; padding: 1px 5px;
}
.nav-chevron { margin-left: auto; font-size: 11px; opacity: .6; transition: transform 150ms; }
.nav-link[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }
.nav-sub { padding-left: 8px; }
.nav-sub .nav-link { font-size: 12.5px; padding: 7px 12px 7px 30px; color: #94A3B8; }
.nav-sub .nav-link:hover { color: #fff; }

.kok-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kok-content { padding: 24px; width: 100%; max-width: var(--content-max); margin: 0 auto; flex: 1; }
.kok-footer {
    padding: 12px 24px; font-size: 11px; color: var(--text-muted);
    border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px;
}

/* ---------- PAGE HEADER ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.3px; }
.page-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- CARDS ---------- */
.card-kok {
    background: var(--card-bg); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: transform 200ms ease, box-shadow 200ms ease;
}
.card-kok.hoverable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.card-sub { font-size: 12px; color: var(--text-muted); margin: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.kpi {
    background: var(--card-bg); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--border); text-decoration: none; color: inherit; display: block;
    transition: transform 200ms ease, box-shadow 200ms ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.kpi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kpi-head i { font-size: 16px; color: var(--accent); }
.kpi-head span { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -.5px; }
.kpi-detail { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.kpi-detail b { color: var(--text); font-weight: 600; }

/* ---------- BUTTONS ---------- */
.btn { font-size: 14px; font-weight: 500; border-radius: 8px; padding: 10px 16px; border: 1px solid transparent; }
.btn-sm { font-size: 12px; padding: 6px 10px; border-radius: 6px; }
.btn-primary { background: #0044CC; border-color: #0044CC; color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #003399; border-color: #003399; color: #fff; }
.btn-outline-primary { color: #0044CC; border-color: #0044CC; background: transparent; }
.btn-outline-primary:hover { background: #0044CC; color: #fff; }
.btn-light { background: var(--g100); border-color: var(--border); color: var(--text); }
.btn-light:hover { background: var(--g300); }
.btn-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-success { background: #16A34A; border-color: #16A34A; color: #fff; }
.btn-warning { background: #F59E0B; border-color: #F59E0B; color: #1F2937; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--g100); color: var(--text); }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(0,68,204,.2); outline: 0; }

/* ---------- FORMS ---------- */
.form-label { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.form-label .req { color: #DC2626; margin-left: 2px; }
.form-control, .form-select {
    min-height: 40px; border-radius: 8px; border: 1px solid var(--g300); font-size: 14px;
    padding: 8px 12px; background: var(--card-bg); color: var(--text);
}
textarea.form-control { min-height: 80px; }
.form-control:focus, .form-select:focus {
    border-color: #0044CC; box-shadow: 0 0 0 3px rgba(0,68,204,.2); background: var(--card-bg); color: var(--text);
}
.form-control::placeholder { color: var(--g500); }
.form-control.is-invalid, .form-select.is-invalid { border-color: #DC2626; }
.field-error { font-size: 11.5px; color: #DC2626; margin-top: 4px; display: block; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-check-input:checked { background-color: #0044CC; border-color: #0044CC; }
.form-check-label { font-size: 13px; }

/* ---------- TABLES ---------- */
.table-kok { width: 100%; margin: 0; font-size: 13px; border-collapse: separate; border-spacing: 0; }
.table-kok thead th {
    background: var(--g50); font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border);
    white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table-kok tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-kok tbody tr:hover { background: var(--g100); }
.table-kok tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: 8px; }

/* ---------- BADGES ---------- */
.badge-kok {
    display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500;
    padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.badge-aktif { background: rgba(22,163,74,.12); color: #15803D; }
.badge-taslak { background: rgba(107,114,128,.14); color: #4B5563; }
.badge-onay { background: rgba(245,158,11,.14); color: #B45309; }
.badge-arsiv { background: rgba(31,41,55,.10); color: #374151; }
.badge-iptal { background: rgba(220,38,38,.12); color: #B91C1C; }
.badge-critical { background: rgba(220,38,38,.12); color: #B91C1C; }
.badge-warning { background: rgba(245,158,11,.14); color: #B45309; }
.badge-info { background: rgba(14,165,233,.12); color: #0369A1; }
.badge-ok { background: rgba(22,163,74,.12); color: #15803D; }

/* ---------- ALERTS ---------- */
.alert-row {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 8px;
    background: var(--card-bg); border: 1px solid var(--border); border-left: 3px solid var(--accent);
    margin-bottom: 8px; text-decoration: none; color: inherit;
}
.alert-row:hover { color: inherit; box-shadow: var(--shadow-sm); }
.alert-row.level-Kritik { border-left-color: #DC2626; }
.alert-row.level-Uyarı { border-left-color: #F59E0B; }
.alert-row.level-Bilgi { border-left-color: #0EA5E9; }
.alert-row i { font-size: 18px; margin-top: 1px; }
.alert-row.level-Kritik i { color: #DC2626; }
.alert-row.level-Uyarı i { color: #F59E0B; }
.alert-row.level-Bilgi i { color: #0EA5E9; }
.alert-title { font-weight: 600; font-size: 13px; }
.alert-detail { font-size: 12px; color: var(--text-muted); }

/* ---------- TABS ---------- */
.nav-tabs { border-bottom: 1px solid var(--border); gap: 2px; }
.nav-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--text-muted);
    font-size: 13px; font-weight: 500; padding: 10px 14px; margin: 0;
}
.nav-tabs .nav-link:hover { color: var(--text); background: var(--g100); border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link.active { color: #0044CC; border-bottom-color: #0044CC; background: transparent; }

/* ---------- SECTION ---------- */
.form-section { margin-bottom: 24px; }
.form-section-title {
    font-size: 13px; font-weight: 600; color: #0044CC; text-transform: uppercase;
    letter-spacing: .06em; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 6px;
}

/* ---------- STICKY FOOTER ---------- */
.form-footer {
    position: sticky; bottom: 0; background: var(--card-bg); border-top: 1px solid var(--border);
    padding: 12px 16px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 5;
    margin: 0 -16px -16px; border-radius: 0 0 12px 12px;
}

/* ---------- TOAST ---------- */
.toast-host { position: fixed; top: 76px; right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast-kok {
    background: var(--card-bg); border-radius: 8px; box-shadow: var(--shadow-md); border: 1px solid var(--border);
    border-left: 3px solid #16A34A; padding: 12px 14px; font-size: 13px; animation: toastIn 180ms ease-out;
}
.toast-kok.err { border-left-color: #DC2626; }
.toast-kok.warn { border-left-color: #F59E0B; }
.toast-kok.info { border-left-color: #0EA5E9; }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ---------- MISC ---------- */
.stat-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.stat-line:last-child { border-bottom: 0; }
.stat-line span { color: var(--text-muted); }
.stat-line b { font-weight: 600; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.empty-state i { font-size: 40px; opacity: .35; display: block; margin-bottom: 12px; }
.pagination .page-link { color: var(--text); border-color: var(--border); font-size: 13px; }
.pagination .page-item.active .page-link { background: #0044CC; border-color: #0044CC; color: #fff; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-control, .filter-bar .form-select { height: 38px; min-height: 38px; font-size: 13px; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; }
.diff-old { background: rgba(220,38,38,.08); border-radius: 4px; padding: 6px 8px; color: #B91C1C; }
.diff-new { background: rgba(22,163,74,.08); border-radius: 4px; padding: 6px 8px; color: #15803D; }
.scroll-x { overflow-x: auto; }

/* ---------- LOGIN ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: #0A0E27; padding: 24px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 32px; }
.login-logo { width: 56px; height: 56px; border-radius: 12px; background: #0044CC; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; margin: 0 auto 16px; }

/* ---------- PRINT ---------- */
@media print {
    .kok-header, .kok-sidebar, .kok-footer, .page-actions, .form-footer, .no-print { display: none !important; }
    body { background: #fff; }
    .kok-shell { display: block; }
    .kok-content { padding: 0; max-width: none; }
    .card-kok { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
    .table-kok thead th { background: #eee !important; }
    .table-kok { font-size: 11px; }
    a { text-decoration: none; color: #000; }
    .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 991.98px) {
    .kok-sidebar {
        position: fixed; left: 0; top: 64px; z-index: 1035; transform: translateX(-100%);
        transition: transform 180ms ease-out; box-shadow: var(--shadow-lg);
        width: 280px; flex: 0 0 280px;
    }
    body.drawer-open .kok-sidebar { transform: none; }
    .kok-content { padding: 16px; }
    .page-title { font-size: 22px; }
    .kpi-value { font-size: 24px; }
    .split-2, .split-3 { grid-template-columns: 1fr; }
    .kok-brand { min-width: auto; }
    .kok-brand .brand-text { display: none; }
    .kok-search { max-width: none; }
    .kok-search kbd { display: none; }
}
@media (max-width: 575.98px) {
    .kok-user small, .kok-user .user-name { display: none; }
    .kpi-grid { grid-template-columns: 1fr; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .kok-header-actions { gap: 2px; }
}
