:root {
    --sidebar-bg: #0f172a;
    --sidebar-text: #e5e7eb;
    --sidebar-active-bg: rgba(255, 255, 255, 0.12);
}

body {
    background: #f3f4f6;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.app-sidebar {
    width: 245px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 18px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 20;
}

.app-sidebar-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.app-sidebar .nav-link {
    color: var(--sidebar-text);
    border-radius: 10px;
}

.app-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.app-sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-sidebar-backdrop {
    display: none;
}

.login-logo {
    width: min(100%, 220px);
    height: auto;
    max-height: 84px;
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.3);
    }

    .app-shell.sidebar-open .app-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 15;
    }

    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

@media (max-width: 575.98px) {
    .login-logo {
        width: min(100%, 170px);
        max-height: 64px;
    }
}

/* Teklif kalemleri: mobilde hücreler çok daralmasın */
#kalemTable {
    min-width: 980px;
}

#saleTable,
#invoiceTable {
    min-width: 980px;
}

#kalemTable .form-control,
#kalemTable .form-select,
#saleTable .form-control,
#saleTable .form-select,
#invoiceTable .form-control,
#invoiceTable .form-select {
    min-width: 88px;
}

