/* master.php'den ayrıldı */
html, body { 
    background-color: #f6f8fb; 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden !important;
    max-width: 100vw;
    padding-right: 0 !important;
}
body.modal-open {
    padding-right: 0 !important;
    overflow: auto !important;
}

/* STANDART TİPOGRAFİ (TÜM LİSTELEME VE TABLOLAR İÇİN TEKDÜZE FONT STANDARDI) */
.table {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.85rem;
}
.table th {
    font-size: 0.80rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b !important;
}
.table td {
    font-size: 0.85rem !important;
    vertical-align: middle !important;
}
.table .badge {
    font-family: inherit !important;
    font-size: 0.80rem !important;
    font-weight: 600 !important;
}

/* İsim / ünvan: satır kırılabilir, ama harf harf dikey kırılma YOK */
.dg-name-cell {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: none !important;
    line-height: 1.35;
}
.datagrid-container .table td {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}
.datagrid-container .table td .text-nowrap {
    white-space: nowrap !important;
}
/* Dashboard / liste tabloları: dar hücrede harf harf alt alta düşmesin */
.content-body .table td,
.content-body .table th {
    word-break: normal;
    overflow-wrap: break-word;
}
.content-body .table .ks-cell-name {
    min-width: 140px;
    max-width: 280px;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.35;
}

/* %30 DAHA ZARİF VE KOMPAKT TİPOGRAFİ & KUTULAR (GENEL SİSTEM) */
.page-title { font-size: 1.15rem !important; font-weight: 700 !important; }
.page-header { margin-bottom: 1rem !important; }
h1, .h1 { font-size: 1.45rem !important; }
h2, .h2 { font-size: 1.25rem !important; }
h3, .h3 { font-size: 1.10rem !important; }
h4, .h4 { font-size: 0.95rem !important; }
h5, .h5 { font-size: 0.85rem !important; }
.display-4 { font-size: 1.65rem !important; }
.display-5 { font-size: 1.45rem !important; }
.display-6 { font-size: 1.25rem !important; }

/* KOCA KUTULARI DAHA KOMPAKT VE ŞIK YAP */
.card { border-radius: 8px !important; }
.card:not(.card-table) > .card-body { padding: 12px 16px !important; }
.card-header { padding: 8px 16px !important; font-size: 0.85rem !important; }
.btn-group .btn, .btn-sm { font-size: 0.80rem !important; }

/* TABLO SATIRLARINA TIKLANABİLİRLİK İMLECİ VE ZARİF HOVER */
tbody tr:has([data-bs-toggle="dropdown"]),
tbody tr.datagrid-row,
.datagrid-card {
    cursor: pointer !important;
    transition: background-color 0.15s ease-in-out;
}
tbody tr:has([data-bs-toggle="dropdown"]):hover,
tbody tr.datagrid-row:hover {
    background-color: rgba(32, 107, 196, 0.05) !important;
}
.datagrid-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.datagrid-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09) !important;
    border-color: rgba(32, 107, 196, 0.3) !important;
}
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: #182433;
    color: #94a3b8;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

/* Scrollbar Styling for Sidebar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #475569; }

.content-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    overflow-x: hidden !important;
    /* 100vw scrollbar ile taşırır; sidebar payı flex ile alınır */
    width: calc(100% - 260px);
    max-width: none;
}
.content-wrapper.expanded {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
}
@media (max-width: 991.98px) {
    .content-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: none;
    }
}
.content-body { 
    padding: 16px 20px; 
    flex-grow: 1; 
    overflow-x: hidden !important;
}

/* Tüm Ekranlarda Container ve Tablo Taşmasını Engelleyen Kural */
.content-body .container-xl,
.content-body .container-lg,
.content-body .container-md,
.content-body .container-sm,
.content-body .container,
.content-body .container-fluid {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}

/* =========================================================
   FORM / BUTON / KUTU TAŞMA ÖNLEME (TÜM SAYFALAR)
   MVC: görünümler değişmeden layout üzerinden hizalama
   ========================================================= */
.content-body,
.content-body .row > [class*="col-"],
.content-body .card,
.content-body .card-body,
.modal-body,
.modal-content {
    min-width: 0;
    max-width: 100%;
}

/* Form kontrolleri kutunun dışına taşmasın (genişliği zorlamadan) */
.content-body .form-control,
.content-body .form-select,
.content-body textarea.form-control,
.modal .form-control,
.modal .form-select,
.modal textarea.form-control {
    max-width: 100%;
    min-width: 0;
}
.content-body .input-group,
.modal .input-group {
    max-width: 100%;
    flex-wrap: nowrap;
}
.content-body .input-group > .form-control,
.content-body .input-group > .form-select,
.content-body .input-group > .form-floating,
.modal .input-group > .form-control,
.modal .input-group > .form-select {
    min-width: 0;
    flex: 1 1 auto;
}

/* Select2 taşması */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    min-width: 0 !important;
    max-width: 100%;
}

/* Üst aksiyon / başlık şeritleri: sarıl */
.content-body > .d-flex,
.content-body .container-fluid > .d-flex,
.content-body .container > .d-flex,
.content-body .container-xl > .d-flex,
.page-header,
.page-header .col-auto,
.page-header .btn-list {
    flex-wrap: wrap;
    max-width: 100%;
    row-gap: 0.5rem;
}
.content-body .btn,
.modal .btn {
    max-width: 100%;
}

/* btn-group uzun etiketlerde kırılabilsin */
.content-body .btn-group {
    flex-wrap: wrap;
    max-width: 100%;
    row-gap: 0.25rem;
}
.content-body .btn-group > .btn,
.content-body .btn-group > .btn-check + .btn {
    flex: 0 1 auto;
}

/* Modal footer / header hizalı ve taşmasız */
.modal-header,
.modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.modal-footer .btn {
    flex: 0 1 auto;
}
.modal-dialog {
    max-width: min(var(--bs-modal-width, 500px), calc(100vw - 1rem));
    margin-left: auto;
    margin-right: auto;
}
.modal-dialog.modal-lg {
    max-width: min(800px, calc(100vw - 1rem));
}
.modal-dialog.modal-xl {
    max-width: min(1140px, calc(100vw - 1rem));
}
.modal-dialog.modal-sm {
    max-width: min(300px, calc(100vw - 1rem));
}
.modal-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tablolar: dışarı taşmak yerine içeride kaydır */
.content-body .table-responsive,
.content-body .datagrid-container .table-responsive,
.modal .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.content-body .table .form-control,
.content-body .table .form-select,
.content-body .table .input-group,
.content-body .table .select2-container,
.modal .table .form-control,
.modal .table .form-select {
    max-width: 100%;
    min-width: 0 !important;
    width: 100%;
}

/* Badge taşması — satır kırılabilir, harf harf dikey değil */
.content-body .badge {
    max-width: 100%;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

@media (max-width: 767.98px) {
    .content-body {
        padding: 12px 12px !important;
    }
    .content-body .d-flex.flex-nowrap {
        flex-wrap: wrap !important;
    }
    .content-body .btn-group {
        width: 100%;
    }
    .content-body .btn-group > .btn {
        flex: 1 1 auto;
        white-space: normal;
    }
    .content-body .btn.text-nowrap {
        white-space: normal !important;
    }
    .content-body .table td,
    .content-body .table th {
        word-break: normal;
        overflow-wrap: break-word;
    }
    .modal-footer {
        flex-direction: column;
        align-items: stretch !important;
    }
    .modal-footer .btn,
    .modal-footer > div {
        width: 100%;
    }
    .modal-footer > div {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .modal-footer > div .btn {
        flex: 1 1 auto;
    }
    .content-body .input-group {
        flex-wrap: wrap;
    }
    /* Kalem tablolarındaki aşırı min-width'leri yumuşat */
    .content-body .table-responsive > .table th[style*="min-width"],
    .content-body .table-responsive > .table td[style*="min-width"] {
        min-width: 72px !important;
    }
    .content-body .table-responsive > .table th:first-child[style*="min-width"],
    .content-body .table-responsive > .table td:first-child[style*="min-width"] {
        min-width: 140px !important;
    }
    .content-body .table-responsive > .table[style*="min-width"] {
        min-width: 560px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .content-body .table-responsive > .table[style*="min-width"] {
        min-width: 720px !important;
    }
    .content-body .d-flex.flex-nowrap.overflow-x-auto {
        flex-wrap: wrap !important;
    }
}

/* Sidebar Link Styling */
.sidebar-brand {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    text-decoration: none;
    position: sticky;
    top: 0;
    background: #141f2c;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.sidebar-brand .brand-icon-box {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(32, 107, 196, 0.2);
    border: 1px solid rgba(32, 107, 196, 0.4);
    color: #60a5fa;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-right: 12px;
}
.sidebar-brand .brand-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}
.sidebar-brand .brand-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.sidebar-brand .brand-sub {
    color: #94a3b8;
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}
.sidebar-link { color: #cbd5e1; text-decoration: none; padding: 12px 20px; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); transition: 0.2s; }
.sidebar-link:hover, .sidebar-link[aria-expanded="true"] { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-link i { font-size: 1.2rem; margin-right: 15px; width: 24px; text-align: center; }
.sidebar-link .arrow-icon { margin-left: auto; font-size: 0.8rem; transition: transform 0.2s; }
.sidebar-link[aria-expanded="true"] .arrow-icon { transform: rotate(180deg); }
.sidebar-header { padding: 15px 20px 5px; font-size: 11px; text-transform: uppercase; color: #64748b; font-weight: 600; letter-spacing: 0.5px; }

/* Submenu Styling - Kusursuz Hizalanmış ve Tamamı İkonlu Menü */
.submenu, .collapse { background-color: rgba(0,0,0,0.2); }
.collapse .sidebar-link { 
    padding: 7px 16px 7px 32px !important; 
    font-size: 12.5px; 
    border-bottom: none; 
    color: #94a3b8; 
    display: flex;
    align-items: center;
}
.collapse .sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.collapse .sidebar-link i { 
    font-size: 0.95rem !important; 
    width: 18px !important; 
    min-width: 18px !important; 
    margin-right: 10px !important; 
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.collapse .sidebar-link-create { 
    color: #38bdf8 !important; 
    font-weight: 600 !important; 
    background: rgba(56, 189, 248, 0.08) !important; 
    border-radius: 6px; 
    margin: 4px 12px 6px 24px !important; 
    padding: 6px 10px 6px 8px !important; 
    display: flex; 
    align-items: center; 
    font-size: 12.5px; 
    border-bottom: none !important;
}
.collapse .sidebar-link-create:hover { 
    background: rgba(56, 189, 248, 0.2) !important; 
    color: #ffffff !important; 
}
.collapse .sidebar-link-create i { 
    color: #22c55e !important; 
    font-size: 0.95rem !important; 
    width: 18px !important; 
    min-width: 18px !important; 
    margin-right: 10px !important; 
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Top Navbar (Global) */
.top-navbar {
    background: #fff;
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* İç mesaj — sade panel */
#imRoot { --im-w: 380px; --im-h: min(560px, calc(100vh - 88px)); }
#imBackdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.28);
    z-index: 1080;
}
#imBackdrop.show { display: block; }
#imPanel {
    position: fixed; z-index: 1085;
    right: 16px; bottom: 16px;
    width: var(--im-w); height: var(--im-h);
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15,23,42,.14);
    display: none; flex-direction: column; overflow: hidden;
    font-size: 13px; color: #334155;
}
#imPanel.open { display: flex; }
#imPanel header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
#imPanel header .im-title { font-weight: 600; font-size: 13px; color: #0f172a; }
#imPanel header .btn-ghost {
    border: 0; background: transparent; color: #64748b; padding: 4px 6px; border-radius: 8px;
}
#imPanel header .btn-ghost:hover { background: #e2e8f0; color: #0f172a; }
#imBody { display: flex; flex: 1; min-height: 0; }
#imList {
    width: 140px; border-right: 1px solid #f1f5f9; overflow: auto; background: #fcfcfd;
}
#imList button.im-peer {
    display: block; width: 100%; text-align: left; border: 0; background: transparent;
    padding: 10px 10px; border-bottom: 1px solid #f8fafc; cursor: pointer;
}
#imList button.im-peer:hover { background: #f1f5f9; }
#imList button.im-peer.active { background: #eef2ff; }
#imList .im-peer-name { font-weight: 600; font-size: 12px; color: #0f172a; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#imList .im-peer-prev { color: #94a3b8; font-size: 11px; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top: 2px; }
#imChat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#imMessages { flex: 1; overflow: auto; padding: 12px; background: #fff; }
.im-bubble {
    max-width: 88%; padding: 7px 10px; border-radius: 12px; margin-bottom: 8px;
    line-height: 1.35; white-space: pre-wrap; word-break: break-word;
}
.im-bubble.mine { margin-left: auto; background: #0f172a; color: #f8fafc; border-bottom-right-radius: 4px; }
.im-bubble.theirs { margin-right: auto; background: #f1f5f9; color: #1e293b; border-bottom-left-radius: 4px; }
.im-meta { font-size: 10px; opacity: .65; margin-top: 4px; }
#imCompose {
    display: flex; gap: 8px; padding: 10px; border-top: 1px solid #f1f5f9; background: #fff;
}
#imCompose textarea {
    flex: 1; resize: none; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 8px 10px; font-size: 13px; min-height: 40px; max-height: 90px;
}
#imCompose textarea:focus { outline: none; border-color: #94a3b8; }
#imEmpty {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: #94a3b8; padding: 24px; text-align: center; font-size: 12px;
}
#imNewBox { display: none; padding: 10px; border-bottom: 1px solid #f1f5f9; background: #fff; }
#imNewBox.show { display: block; }
#imNewBox select {
    width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 8px; font-size: 12px;
}
.im-unread-dot {
    display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 999px;
    background: #206bc4; color: #fff; font-size: 10px; line-height: 16px; text-align: center; float: right;
}
@media (max-width: 576px) {
    #imPanel {
        inset: 0; right: 0; bottom: 0; width: 100%; height: 100%;
        border-radius: 0; border: 0;
    }
    #imList { width: 112px; }
}

/* TOGGLE STATES */
.sidebar.collapsed { transform: translateX(-100%); }
.content-wrapper.expanded { margin-left: 0 !important; width: 100% !important; max-width: none !important; }

/* ---- Kenar menü: profesyonel görünüm ---- */
.sidebar-menu { padding-bottom: 12px; }
.sidebar-menu .sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px 6px; margin: 0;
    font-size: 10.5px; font-weight: 700; letter-spacing: .9px;
    color: #64748b; text-transform: uppercase;
}
.sidebar-menu .sidebar-header::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.07); }
.sidebar-menu > .sidebar-link {
    position: relative; margin: 1px 10px; padding: 9px 12px;
    border-bottom: none; border-radius: 8px; font-size: 13.5px; font-weight: 500;
}
.sidebar-menu > .sidebar-link > i:first-child { font-size: 1.05rem; margin-right: 12px; width: 20px; color: #7c8aa0; }
.sidebar-menu > .sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-menu > .sidebar-link:hover > i:first-child,
.sidebar-menu > .sidebar-link[aria-expanded="true"] > i:first-child { color: #e2e8f0; }
.sidebar-menu > .sidebar-link[aria-expanded="true"] { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-menu > .sidebar-link.has-active > i:first-child,
.sidebar-menu > .sidebar-link.active > i:first-child { color: #38bdf8; }
.sidebar-menu > .sidebar-link.active { background: rgba(56,189,248,.14); color: #fff; }
.sidebar-menu > .sidebar-link.active::before {
    content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #38bdf8;
}
.sidebar-menu .arrow-icon { opacity: .6; font-size: .72rem !important; width: auto !important; margin-right: 0 !important; }
.sidebar-menu .sl-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Alt menü: sol kılavuz çizgisi ve temiz satırlar */
.sidebar-menu .collapse, .sidebar-menu .collapsing { background: transparent; margin: 0 10px 4px 22px; border-left: 1px solid rgba(255,255,255,.09); }
.sidebar-menu .collapse .sidebar-link {
    position: relative; margin: 1px 0 1px 6px; padding: 6px 10px 6px 12px !important;
    border-radius: 6px; font-size: 12.5px; color: #94a3b8;
}
.sidebar-menu .collapse .sidebar-link i { color: #64748b; }
.sidebar-menu .collapse .sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-menu .collapse .sidebar-link:hover i { color: #cbd5e1; }
.sidebar-menu .collapse .sidebar-link.active { background: rgba(56,189,248,.14); color: #fff; font-weight: 600; }
.sidebar-menu .collapse .sidebar-link.active i { color: #38bdf8; }
.sidebar-menu .collapse .sidebar-link.active::before {
    content: ""; position: absolute; left: -7px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: #38bdf8;
}
.sidebar-menu .collapse .sidebar-link-create { margin: 3px 6px 5px 6px !important; padding: 6px 10px !important; }

/* Menü açılışındaki tüm animasyon ve gecikmeleri tamamen kaldır (Anlık Açılış) */
.sidebar, 
.content-wrapper, 
.sidebar-link, 
.sidebar-link .arrow-icon, 
.collapsing, 
.collapse {
    transition: none !important;
    animation: none !important;
}

/* MOBILE OVERRIDES */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .content-wrapper { margin-left: 0; }
}

.sidebar-overlay { position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.5); z-index: 1030; display: none; }
.sidebar-overlay.show { display: block; }

/* =========================================================
   YAZDIRMA / EVRAK — ortak antetli şablon (fatura-print-a4)
   Logo/firma ayarlardan gelir; iskelet bozulmaz
   ========================================================= */
.ks-print-doc.fatura-print-a4,
.fatura.fatura-print-a4.ks-print-doc {
    font-family: "Helvetica Neue", Helvetica, Arial, Tahoma, sans-serif;
    font-size: 11px;
    line-height: 1.35;
    color: #000;
    max-width: 190mm;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
.fatura-print-a4 .fatura-logo { margin-bottom: 2mm; text-align: center; }
.fatura-print-a4 .fatura-logo img {
    max-height: 12mm;
    width: auto;
    object-fit: contain;
}
.fatura-print-a4 .firma-bilgi {
    text-align: center;
    margin-bottom: 4mm;
    padding: 6px 4px 10px;
    line-height: 1.5;
}
.fatura-print-a4 .firma-bilgi h3 {
    margin: 0 0 8px;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: #000;
    line-height: 1.35;
}
.fatura-print-a4 .firma-bilgi p {
    margin: 0 0 6px;
    padding: 0;
    font-size: 12px;
    color: #000;
    word-wrap: break-word;
}
.fatura-print-a4 .firma-bilgi p:last-child { margin-bottom: 0; }
.fatura-print-a4 .fatura-ust {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6mm;
    margin: 2mm 0 4mm;
    width: 100%;
}
.fatura-print-a4 .fatura-sayin { flex: 1 1 58%; min-width: 0; }
.fatura-print-a4 .fatura-meta { flex: 0 0 36%; max-width: 72mm; }
.fatura-print-a4 .fatura-etiket {
    font-size: 12px;
    font-weight: 700;
    color: #000;
    margin-bottom: 2px;
    text-transform: uppercase;
}
.fatura-print-a4 .fatura-unvan {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    line-height: 1.35;
    margin-bottom: 3px;
    word-break: break-word;
}
.fatura-print-a4 .fatura-satir {
    font-size: 12px;
    color: #000;
    line-height: 1.4;
    margin-bottom: 2px;
    word-break: break-word;
}
.fatura-print-a4 .fatura-vd-tablo,
.fatura-print-a4 .fatura-meta-tablo,
.fatura-print-a4 .fatura-ozet-tablo {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    height: auto !important;
    margin-top: 3mm;
    background: transparent;
}
.fatura-print-a4 .fatura-vd-tablo th,
.fatura-print-a4 .fatura-vd-tablo td,
.fatura-print-a4 .fatura-meta-tablo th,
.fatura-print-a4 .fatura-meta-tablo td {
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 5px 0 !important;
    font-size: 12px;
    color: #000 !important;
    background: transparent !important;
    vertical-align: middle;
    text-align: left;
}
.fatura-print-a4 .fatura-vd-tablo tr:last-child th,
.fatura-print-a4 .fatura-vd-tablo tr:last-child td,
.fatura-print-a4 .fatura-meta-tablo tr:last-child th,
.fatura-print-a4 .fatura-meta-tablo tr:last-child td {
    border-bottom: none !important;
}
.fatura-print-a4 .fatura-vd-tablo th,
.fatura-print-a4 .fatura-meta-tablo th {
    width: 42%;
    font-weight: 700;
    white-space: nowrap;
}
.fatura-print-a4 .fatura-vd-tablo td,
.fatura-print-a4 .fatura-meta-tablo td {
    font-weight: 700;
    word-break: break-word;
}
.fatura-print-a4 .fatura-meta-tablo { margin-top: 0 !important; }
.fatura-print-a4 .orta { margin-top: 2mm; }
.fatura-print-a4 .fatura-kalem-grid {
    width: 100%;
    border: 1px solid #64748b;
    box-sizing: border-box;
    background: #fff;
}
.fatura-print-a4 .fatura-kalem-head,
.fatura-print-a4 .fatura-kalem-row {
    display: grid;
    grid-template-columns: 44% 15% 15% 8% 18%;
    width: 100%;
    box-sizing: border-box;
}
.fatura-print-a4 .fatura-kalem-head > div,
.fatura-print-a4 .fatura-kalem-row > div {
    padding: 7px 8px;
    font-size: 11px;
    border-right: 1px solid #64748b;
    border-bottom: 1px solid #64748b;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    align-items: center;
    color: #000;
}
.fatura-print-a4 .fatura-kalem-head > div:last-child,
.fatura-print-a4 .fatura-kalem-row > div:last-child { border-right: none; }
.fatura-print-a4 .fatura-kalem-row:last-child > div { border-bottom: none; }
.fatura-print-a4 #printItemsBody .fatura-kalem-row:last-child > div { border-bottom: none; }
.fatura-print-a4 .fatura-kalem-head > div {
    background: #e2e8f0;
    font-weight: 700;
}
.fatura-print-a4 .fatura-kalem-grid .text-left { justify-content: flex-start; text-align: left; }
.fatura-print-a4 .fatura-kalem-grid .num {
    justify-content: flex-end;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.fatura-print-a4 .fatura-kalem-grid .qty {
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}
.fatura-print-a4 .fatura-kalem-grid .fatura-stok-hucre {
    line-height: 1.35;
    word-break: break-word;
    white-space: normal;
}
.fatura-print-a4 .fatura-alt {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8mm;
    margin-top: 5mm;
    width: 100%;
}
.fatura-print-a4 .fatura-yazi {
    flex: 1 1 52%;
    min-width: 0;
    font-size: 11px;
    line-height: 1.5;
    padding-top: 4px;
    color: #000;
}
.fatura-print-a4 .fatura-yazi .fatura-aciklama { margin-top: 6px; }
.fatura-print-a4 .fatura-ozet-tablo {
    flex: 0 0 44%;
    max-width: 82mm;
    margin-top: 0 !important;
}
.fatura-print-a4 .fatura-ozet-tablo th,
.fatura-print-a4 .fatura-ozet-tablo td {
    border: 1px solid #64748b !important;
    padding: 6px 8px !important;
    font-size: 11px;
    vertical-align: middle !important;
    color: #000;
}
.fatura-print-a4 .fatura-ozet-tablo th {
    width: 58% !important;
    text-align: right !important;
    background: #f8fafc !important;
    font-weight: 700;
    white-space: nowrap;
}
.fatura-print-a4 .fatura-ozet-tablo td {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    width: 42%;
    background: #fff !important;
}
.fatura-print-a4 .fatura-ozet-tablo tr.ozet-son th,
.fatura-print-a4 .fatura-ozet-tablo tr.ozet-son td {
    font-weight: 700;
    background: #e2e8f0 !important;
    border-top: 2px solid #334155 !important;
}
.fatura-print-a4 .fatura-imza {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 8mm;
    padding-top: 4mm;
}
.fatura-print-a4 .fatura-imza-kutu {
    flex: 1;
    text-align: center;
}
.fatura-print-a4 .fatura-imza-baslik {
    font-size: 11px;
    font-weight: 700;
    color: #000;
}
.fatura-print-a4 .fatura-imza-cizgi {
    height: 36px;
    max-width: 160px;
    margin: 8px auto 0;
    border-bottom: 1px solid #64748b;
}
.corporate-brand-header img {
    height: 36px !important;
    max-width: 120px !important;
}

@media print {
    .top-navbar, .sidebar, #sidebar, .sidebar-overlay, #sidebarOverlay, #imRoot, .modal, footer {
        display: none !important;
    }
    .content-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .content-body {
        padding: 0 !important;
        margin: 0 !important;
    }
    html, body {
        font-size: 10px !important;
        line-height: 1.25 !important;
        color: #000 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .ks-print-doc.fatura-print-a4,
    .fatura.fatura-print-a4.ks-print-doc {
        font-size: 10px !important;
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
    }
    .fatura-print-a4 .fatura-logo img { max-height: 11mm !important; }
    .fatura-print-a4 .fatura-ust,
    .fatura-print-a4 .fatura-alt { display: flex !important; page-break-inside: avoid; }
    .fatura-print-a4 .fatura-kalem-head,
    .fatura-print-a4 .fatura-kalem-row {
        display: grid !important;
        grid-template-columns: 44% 15% 15% 8% 18% !important;
    }
    .corporate-brand-header img { height: 32px !important; }
    @page {
        size: A4;
        margin: 8mm 10mm;
    }
}



/* Ortak "geri/liste" düğmesi (servis sayfaları) */
.sf-back { display:inline-flex; align-items:center; gap:.4rem; height:32px; padding:0 .8rem; border-radius:8px; background:#f1f5f9; color:#334155; font-size:12.5px; font-weight:600; text-decoration:none; border:1px solid #e2e8f0; white-space:nowrap; }
.sf-back:hover { background:#e2e8f0; color:#0f172a; }
