/* CORTEX — kabuk (docs/06 §4)
 *
 * Sidebar, üst bar, sayfa gövdesi ve misafir düzeni. Bileşenler burada
 * tanımlanmaz: kabuk sayfanın çerçevesidir, içindekiler components.css'tedir.
 */

html, body { min-height: 100%; }

body.cortex-body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-main);
    font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

a { text-decoration: none; }

.cortex-shell { display: flex; min-height: 100vh; }

.cortex-sidebar {
    width: 248px; flex-shrink: 0;
    background: linear-gradient(var(--sidebar-bg), var(--sidebar-bg-2));
    color: #fff; display: flex; flex-direction: column;
    /* Sidebar viewport'a sabitlenir; aksi hâlde flex kardeşi olan
       .cortex-content kadar uzardı ve uzun sayfalarda saat/çıkış
       alt bölümü ekran dışına düşerdi (docs/06 §4). */
    position: sticky; top: 0; height: 100vh;
}
.cortex-sidebar-header { padding: 1.1rem 1rem; border-bottom: 1px solid var(--sidebar-border); }
.cortex-brand { color: #fff; font-weight: 700; font-size: 1.25rem; letter-spacing: .06em; }
.cortex-nav { flex: 1; overflow-y: auto; }
.cortex-nav-section {
    font-size: .68rem; letter-spacing: .12em; color: rgba(255,255,255,.55);
    padding: .9rem 1rem .35rem;
}
.cortex-nav-link {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem 1rem; color: rgba(255,255,255,.88); font-size: .9rem;
}
.cortex-nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.cortex-nav-link.active { background: var(--brand-primary); color: #fff; font-weight: 600; }
.cortex-nav-link .badge { margin-left: auto; }

.cortex-sidebar-footer { border-top: 1px solid var(--sidebar-border); padding: .85rem; }
.cortex-sidebar-clock { text-align: center; margin-bottom: .6rem; }
.cortex-sidebar-clock-time { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cortex-sidebar-clock-date { font-size: .78rem; color: rgba(255,255,255,.65); }
.cortex-logout-link { color: rgba(255,255,255,.9); width: 100%; text-align: left; }
.cortex-logout-link:hover { color: #fff; background: rgba(255,255,255,.1); }

.cortex-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cortex-topbar {
    background: #fff; border-bottom: 1px solid var(--card-border);
    min-height: 60px; gap: .75rem;
}
.cortex-main { padding: 1.5rem; flex: 1; }

/* --- Platform bölümü: yanlışlıkla platform işlemi yapılmasını önler --- */
.cortex-platform-bar {
    background: #10203f; color: #fff; font-size: .78rem;
    letter-spacing: .08em; padding: .35rem 1.5rem;
}
.cortex-impersonation-bar {
    background: var(--warning-soft); border-bottom: 1px solid #f0d089;
    font-size: .85rem; padding: .5rem 1.5rem;
}

/* --- Misafir düzeni --- */
.cortex-guest-topbar { background: #fff; border-bottom: 1px solid var(--card-border); min-height: 60px; }
.cortex-guest-main {
    min-height: calc(100vh - 106px); display: flex;
    align-items: center; justify-content: center; padding: 2.25rem 1rem 3rem;
}
.cortex-guest-footer {
    background: #fff; border-top: 1px solid var(--card-border);
    min-height: 46px; font-size: .8rem; color: var(--muted); padding: 0 1.5rem;
}

@media (max-width: 991.98px) {
    .cortex-sidebar {
        position: fixed; top: 0; left: -248px; height: 100vh; z-index: 1040; transition: left .2s ease;
    }
    body.sidebar-open .cortex-sidebar { left: 0; }
    .cortex-sidebar-backdrop { display: none; }
    body.sidebar-open .cortex-sidebar-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1030;
    }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
