/* ============================================================
   bordrocum — SaaS Kabuğu (App Shell)
   Yalnızca sunucu tarafında .has-shell ile sarılan sayfalarda etkilidir.
   İçerik/SEO/HTML'e dokunmaz; sadece görsel kabuk (sidebar + layout).
   ============================================================ */
:root {
    --as-w: 264px;
    --as-bg: #f6f7fb;
    --as-surface: #ffffff;
    --as-border: #e9ebf3;
    --as-text: #0f172a;
    --as-text-2: #5b6478;
    --as-text-3: #98a1b6;
    --as-indigo: #6366f1;
    --as-indigo-soft: #eef0ff;
    --as-grad: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    --as-shadow: 0 24px 60px -34px rgba(30, 27, 75, .35);
}

/* --- Gövde: kabuk açık --- */
body.has-shell {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--as-bg) !important;
}

/* Eski üst menü kabukta gizli (linkler sidebar'da) */
body.has-shell .v2-nav {
    display: none !important;
}

/* --- Sidebar --- */
.as-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--as-w);
    background: var(--as-surface);
    border-right: 1px solid var(--as-border);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 16px;
    z-index: 60;
}

.as-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px 16px;
    font-family: 'Sora', 'Inter', system-ui, sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -.02em;
    color: var(--as-text);
}

.as-brand:hover {
    text-decoration: none;
}

.as-brand .ic {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--as-grad);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .7);
}

.as-brand b {
    background: var(--as-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.as-label {
    padding: 16px 12px 7px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--as-text-3);
}

.as-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.as-nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 13px;
    border-radius: 11px;
    color: var(--as-text-2);
    font-weight: 600;
    font-size: .94rem;
    text-decoration: none;
    transition: background .14s, color .14s;
}

.as-nav a .ic {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--as-text-3);
    flex: none;
}

.as-nav a:hover {
    background: #f2f3f9;
    color: var(--as-text);
    text-decoration: none;
}

.as-nav a:hover .ic {
    color: var(--as-text-2);
}

.as-nav a.active {
    background: var(--as-indigo-soft);
    color: var(--as-indigo);
}

.as-nav a.active .ic {
    color: var(--as-indigo);
}

.as-nav a.cta {
    margin-top: 7px;
    background: var(--as-grad);
    color: #fff;
    box-shadow: 0 12px 26px -12px rgba(99, 102, 241, .8);
}

.as-nav a.cta .ic {
    color: #fff;
}

.as-nav a.cta:hover {
    filter: brightness(1.05);
    color: #fff;
}

.as-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--as-border);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.as-foot a {
    color: var(--as-text-3);
    font-size: .8rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 8px;
    text-decoration: none;
}

.as-foot a:hover {
    color: var(--as-text-2);
    background: #f2f3f9;
    text-decoration: none;
}

.as-foot a.active {
    color: var(--as-indigo);
    background: var(--as-indigo-soft);
    font-weight: 600;
}

.as-foot .as-copy {
    padding: 9px 12px 2px;
    font-size: .72rem;
    color: var(--as-text-3);
}

/* --- Ana çalışma alanı --- */
body.has-shell .app-main {
    margin-left: var(--as-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Mobil üst bar (yalnızca mobilde) --- */
.as-topbar {
    display: none;
}

.as-backdrop {
    display: none;
}

/* --- Mobil --- */
@media (max-width: 980px) {
    .as-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 0 0 80px -10px rgba(2, 6, 23, .5);
    }

    body.has-shell.as-open .as-sidebar {
        transform: none;
    }

    body.has-shell .app-main {
        margin-left: 0;
    }

    .as-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 50;
        background: var(--as-surface);
        border-bottom: 1px solid var(--as-border);
        padding: 10px 14px;
    }

    /* id ile yüksek özgüllük: v2'nin "body.v2-page button {grad !important}" kuralını ezer */
    #asBurger {
        background: none !important;
        border: 0 !important;
        box-shadow: none !important;
        font-size: 1.35rem !important;
        line-height: 1;
        color: var(--as-text) !important;
        cursor: pointer;
        padding: 6px 9px !important;
        border-radius: 9px !important;
        transform: none !important;
    }

    #asBurger:hover {
        background: #f2f3f9 !important;
        transform: none !important;
        filter: none !important;
    }

    .as-tb-brand {
        display: flex;
        align-items: center;
        gap: 9px;
        font-family: 'Sora', 'Inter', system-ui, sans-serif;
        font-weight: 800;
        color: var(--as-text);
    }

    .as-tb-brand .ic {
        width: 28px;
        height: 28px;
        border-radius: 9px;
        display: grid;
        place-items: center;
        background: var(--as-grad);
        color: #fff;
        font-size: .85rem;
    }

    .as-tb-brand b {
        background: var(--as-grad);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    body.has-shell.as-open .as-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 55;
    }
}

/* --- Yazdırma / PDF: kabuğu tamamen gizle, içeriği tam genişliğe al --- */
/* Shell sunucuda enjekte edildiği için sayfaların kendi @media print'i bunları bilmez;
   sidebar/topbar yazdırmada görünmesin ve app-main'in sol boşluğu sıfırlansın (içerik sağa kaymasın). */
@media print {

    .as-sidebar,
    .as-topbar,
    .as-backdrop {
        display: none !important;
    }

    body.has-shell .app-main {
        margin-left: 0 !important;
    }

    body.has-shell {
        background: #fff !important;
    }
}
