:root {
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --accent: #f59e0b;
    --content-bg: #eef2f7;
    --sidebar-w: 258px;
    --card-radius: 16px;
    font-size: 14px;
}

body {
    background: var(--content-bg);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    margin: 0;
}

/* ===== Butonlar (indigo tema) ===== */
.btn-primary {
    --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5;
    --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
}
.btn { border-radius: 9px; font-weight: 500; }
.btn-sm { border-radius: 7px; }

/* ===== Uygulama iskeleti ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: fixed; top: 0; bottom: 0; left: 0;
    background: linear-gradient(185deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    display: flex; flex-direction: column;
    z-index: 1045;
    transition: transform .25s ease;
    box-shadow: 2px 0 18px rgba(0,0,0,.18);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 20px 16px;
    color: #fff; font-weight: 700; font-size: 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo {
    width: 38px; height: 38px; border-radius: 11px; object-fit: cover;
    box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.sidebar-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
    color: #64748b; padding: 14px 12px 6px; font-weight: 600; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px; margin-bottom: 3px;
    color: #cbd5e1; text-decoration: none; border-radius: 10px;
    font-weight: 500; font-size: .92rem; transition: all .15s;
}
.sidebar-nav a .ico { font-size: 1.05rem; width: 22px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(79,70,229,.9), rgba(99,102,241,.75));
    color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.sidebar-user {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 14px; display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.sidebar-user .uname { color: #fff; font-size: .85rem; font-weight: 600;
    max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .urole { color: #94a3b8; font-size: .72rem; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column;
    transition: margin-left .25s ease; }

.topbar {
    height: 62px; background: #fff; position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 12px; padding: 0 16px;
    box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.topbar-logo { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.topbar .page-title { font-weight: 600; font-size: 1.1rem; margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hamburger { display: grid; place-items: center; width: 40px; height: 40px;
    border: none; background: #f1f5f9; border-radius: 9px; font-size: 1.25rem;
    cursor: pointer; color: #334155; flex-shrink: 0; }
.hamburger:hover { background: #e2e8f0; }

.content { padding: 22px; flex: 1; }

/* Sidebar backdrop (mobil) */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1040;
}

/* Masaüstünde menüyü aç/kapat (collapsed) */
@media (min-width: 992px) {
    .layout.collapsed .sidebar { transform: translateX(-100%); }
    .layout.collapsed .main { margin-left: 0; }
}

/* Mobil: menü üstte kayan panel */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .sidebar-backdrop.show { display: block; }
}

/* Tom Select (aranabilir combo) — küçük (sm) filtre alanlarıyla aynı boyut */
.ts-wrapper.form-select-sm .ts-control {
    min-height: 27px; padding: 1px 26px 1px 8px; font-size: .875rem; line-height: 1.6;
}
.ts-wrapper.form-select-sm .ts-control > input { font-size: .875rem; margin: 0; }
.ts-wrapper.single.form-select-sm .ts-control:after { margin-top: -3px; }  /* ok konumu */
.ts-dropdown { font-size: .875rem; }
/* Mobil/tablet: aranabilir combo diğer inputlarla aynı yükseklikte (44px) ve iOS zoom'u önlemek için 16px */
@media (max-width: 991.98px) {
    .ts-wrapper.form-select-sm .ts-control { min-height: 44px; padding: 8px 30px 8px 12px; font-size: 16px; line-height: 1.4; display: flex; align-items: center; flex-wrap: wrap; }
    .ts-wrapper.form-select-sm .ts-control > input { font-size: 16px; }
}

/* ---- İnce, indigo tonlu kaydırma çubuğu (scrollbar) ---- */
* { scrollbar-width: thin; scrollbar-color: #a5b4fc transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,.45); border-radius: 8px;
    border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,.75); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Koyu menüde daha parlak indigo kaydırma çubuğu */
.sidebar, .sidebar-nav { scrollbar-color: #818cf8 transparent; }
.sidebar ::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(129,140,248,.55); background-clip: content-box; }
.sidebar ::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(129,140,248,.85); background-clip: content-box; }

/* Yakıt girişi: otomatik gelen "Önceki KM" (bir önceki kaydın son km'si) mavi arka plan */
.yk-oto { background: #eef6ff; }

/* Canlı İzleme: bekleyen (Plan_) satırlar açık mavi zemin */
#grid tr.satir-bekliyor > td { background: #eff6ff; }

/* Canlı İzleme özet kutuları: 3'ü de eşit/sabit yükseklik, içeride kayar (kutu aşağı büyümez) */
.ozet-scroll { height: 300px; overflow-y: auto; overflow-x: hidden; }
.ozet-scroll table { margin-bottom: 0; }
@media (max-width: 767px) { .ozet-scroll { height: 200px; } }

/* Sabit (sticky) filtre alanı — sadece masaüstünde (mobilde normal kayar) */
.filter-sticky { margin-bottom: 6px; }
@media (min-width: 992px) {
    .filter-sticky {
        position: sticky; top: 62px; z-index: 1015;
        background: var(--content-bg); padding: 8px 0;
    }
}

/* ===== Kartlar ===== */
.card {
    border: none; border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
}
.card-header {
    background: #fff; border-bottom: 1px solid #eef2f7;
    font-weight: 600; border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}

/* ===== İstatistik kutucukları ===== */
.stat-tile {
    background: #fff; border-radius: var(--card-radius); padding: 18px 20px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.stat-tile .stat-ico {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    font-size: 1.5rem; color: #fff; flex-shrink: 0;
}
.stat-tile .stat-val { font-size: 1.5rem; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; min-width: 0; }
.stat-tile > div:last-child { min-width: 0; }
.stat-tile .stat-lbl { color: #64748b; font-size: .82rem; }
.ico-indigo { background: linear-gradient(135deg,#4f46e5,#6366f1); }
.ico-amber  { background: linear-gradient(135deg,#f59e0b,#fb923c); }
.ico-green  { background: linear-gradient(135deg,#10b981,#34d399); }
.ico-rose   { background: linear-gradient(135deg,#f43f5e,#fb7185); }

/* ===== Tablolar ===== */
.table > thead.table-dark th { background: #1e293b; border-color: #1e293b; font-weight: 600; }
.table { --bs-table-hover-bg: #f8fafc; }

/* Canlı izleme satır renkleri (Bootstrap hücre arka planını ezmek için td'ye) */
#grid tbody tr.satir-normal > td { background-color: #fff3a0 !important; }
#grid tbody tr.satir-iade   > td { background-color: #ff9a9a !important; }
#grid tbody tr:hover > td { filter: brightness(.96); }
#grid th, #grid td { white-space: nowrap; }

/* Mobil + tablet (iPad landscape dahil): tabloyu kart yapısına çevir (yatay kaydırma olmasın) */
@media (max-width: 1199.98px) {
    #grid, #grid tbody, #grid tfoot { display: block; width: 100%; }
    #grid thead { display: none; }
    #grid tr { display: block; margin-bottom: 12px; border-radius: 12px; padding: 8px 12px;
        border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(15,23,42,.10); }
    #grid tbody tr.satir-normal { background: #fff7cc; }
    #grid tbody tr.satir-iade   { background: #ffdcdc; }
    #grid tbody tr.satir-normal > td,
    #grid tbody tr.satir-iade   > td { background: transparent !important; }
    #grid td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
        border: none; padding: 3px 0; text-align: right; white-space: normal; }
    #grid td::before { content: attr(data-label); font-weight: 600; color: #475569; text-align: left; }
    #grid td[data-label="Sıra"] { font-weight: 700; font-size: 1rem;
        border-bottom: 1px solid rgba(0,0,0,.10); margin-bottom: 5px; padding-bottom: 6px; }
    #grid tfoot tr { background: #e9ecef; }
    #grid .tf-label, #grid .tf-empty { display: none; }
    .table-responsive { overflow-x: visible; }
}

/* Geniş grafikler mobilde okunur kalsın diye yatay kaydırılabilir kap */
@media (max-width: 767.98px) {
    .chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .chart-scroll > svg { min-width: 640px; }
}

/* Genel amaçlı responsive tablo: mobil+tablette kart yapısına döner (.rtable) */
@media (max-width: 991.98px) {
    table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
    table.rtable thead { display: none; }
    table.rtable tr { border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 10px;
        padding: 8px 12px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
    table.rtable td { display: flex; justify-content: space-between; align-items: center; gap: 12px;
        border: none; padding: 5px 0; text-align: right; white-space: normal; }
    table.rtable td::before { content: attr(data-label); font-weight: 600; color: #475569; text-align: left; }
    table.rtable td.rtable-title { font-weight: 700; font-size: 1rem;
        border-bottom: 1px solid rgba(0,0,0,.08); margin-bottom: 4px; padding-bottom: 6px; }
    table.rtable td.rtable-actions { justify-content: flex-end; padding-top: 8px; }
    table.rtable td.rtable-title::before, table.rtable td.rtable-actions::before { content: ''; }
}

/* ===== CSS bar chart ===== */
.barchart { display: flex; flex-direction: column; gap: 9px; }
.barrow { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; }
.barlabel { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bartrack { background: #eef2f7; border-radius: 6px; height: 20px; overflow: hidden; }
.barfill { height: 100%; background: linear-gradient(90deg,#4f46e5,#818cf8); border-radius: 6px; }
.barval { font-size: .8rem; font-weight: 600; white-space: nowrap; }

/* iOS: font 16px'ten küçük input'a odaklanınca sayfayı zoom'lar ve geri almaz.
   Mobil/tablette form alanlarını 16px yapıp bu otomatik zoom'u engelliyoruz.
   Ayrıca dokunma alanlarını (buton/input) büyütüp tıklamayı kolaylaştırıyoruz (~44px). */
@media (max-width: 991.98px) {
    input, select, textarea,
    .form-control, .form-control-sm, .form-select, .form-select-sm {
        font-size: 16px !important;
    }
    .form-control, .form-control-sm, .form-select, .form-select-sm { min-height: 44px; }
    .btn, .btn-sm { min-height: 44px; padding-top: 9px; padding-bottom: 9px; font-size: 15px; }
    .btn-group .btn { min-height: 44px; }
    .hamburger { width: 44px; height: 44px; font-size: 1.4rem; }
    .form-check-input { width: 1.3em; height: 1.3em; margin-top: .12em; }
    .form-switch .form-check-input { width: 2.5em; }
    .form-check-label { padding-left: 4px; line-height: 1.5em; }
    /* Kart içi işlem butonları rahat dursun */
    table.rtable td.rtable-actions .btn { margin-bottom: 4px; }
}

/* Yukarı çık butonu */
.to-top {
    position: fixed; bottom: 18px; right: 16px; z-index: 1500;
    width: 46px; height: 46px; border-radius: 50%; border: none;
    background: #4f46e5; color: #fff; font-size: 1.35rem; line-height: 1;
    box-shadow: 0 4px 14px rgba(79,70,229,.45); cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .2s, visibility .2s, transform .2s;
}
.to-top.show { opacity: .92; visibility: visible; transform: none; }
.to-top:hover { opacity: 1; }
@media (min-width: 992px) { .to-top { bottom: 24px; right: 24px; } }

/* Global yükleme göstergesi (spinner) */
.app-loader {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(238, 242, 247, 0.6);
    display: none; align-items: center; justify-content: center;
}
.app-loader.show { display: flex; }
.app-loader .spinner {
    width: 54px; height: 54px; border-radius: 50%;
    border: 5px solid #cbd5e1; border-top-color: #4f46e5;
    animation: appspin .8s linear infinite;
}
.app-loader .sp-text { position: absolute; margin-top: 90px; color: #475569; font-size: .85rem; font-weight: 500; }
@keyframes appspin { to { transform: rotate(360deg); } }

/* Grafik açıklama (legend) */
.chart-legend { display: flex; flex-direction: column; gap: 5px; }
.chart-legend .leg { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.chart-legend .dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.chart-legend .lg-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend .lg-val { font-weight: 600; white-space: nowrap; }

/* ===== Giriş / auth ekranı ===== */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: linear-gradient(135deg,#4f46e5 0%, #7c3aed 50%, #0f172a 100%);
}
.auth-card {
    width: 100%; max-width: 410px; background: #fff; border-radius: 20px;
    box-shadow: 0 20px 55px rgba(15,23,42,.35); padding: 34px 30px; border-top: 5px solid var(--accent);
}
.auth-logo {
    width: 68px; height: 68px; border-radius: 18px; margin: 0 auto 14px; display: block; object-fit: cover;
    box-shadow: 0 8px 20px rgba(79,70,229,.45);
}
.pw-toggle { cursor: pointer; }
.form-control, .form-select { border-radius: 9px; }

@media (max-width: 576px) {
    :root { font-size: 13px; }
    .barrow { grid-template-columns: 92px 1fr auto; }
    .content { padding: 16px; }
}

/* ===== SweetAlert tarzı toast bildirimleri ===== */
.app-toast-wrap{position:fixed;top:1rem;right:1rem;z-index:1090;display:flex;flex-direction:column;gap:.5rem;max-width:min(92vw,380px);pointer-events:none}
.app-toast{position:relative;display:flex;align-items:center;gap:.65rem;background:#fff;color:#1f2937;border-radius:.7rem;box-shadow:0 10px 30px rgba(0,0,0,.18);padding:.75rem .95rem;overflow:hidden;opacity:0;transform:translateX(24px);transition:opacity .25s ease,transform .25s ease;border:1px solid rgba(0,0,0,.06);pointer-events:auto}
.app-toast.show{opacity:1;transform:none}
.app-toast.hide{opacity:0;transform:translateX(24px)}
.app-toast-ico{flex:0 0 auto;width:1.7rem;height:1.7rem;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700;font-size:1rem;line-height:1}
.app-toast-msg{flex:1;font-size:.9rem;line-height:1.3;word-break:break-word}
.app-toast-x{border:0;background:none;color:#9ca3af;font-size:1.15rem;line-height:1;cursor:pointer;padding:0 .15rem;align-self:flex-start}
.app-toast-x:hover{color:#4b5563}
.app-toast-bar{position:absolute;left:0;bottom:0;height:3px;width:100%}
.app-toast-success .app-toast-ico,.app-toast-success .app-toast-bar{background:#16a34a}
.app-toast-error   .app-toast-ico,.app-toast-error   .app-toast-bar{background:#dc2626}
.app-toast-warning .app-toast-ico,.app-toast-warning .app-toast-bar{background:#d97706}
.app-toast-info    .app-toast-ico,.app-toast-info    .app-toast-bar{background:#2563eb}
@media (max-width:576px){ .app-toast-wrap{left:.6rem;right:.6rem;top:.6rem;max-width:none} }
@media (prefers-color-scheme:dark){ .app-toast{background:#1f2937;color:#e5e7eb;border-color:rgba(255,255,255,.08)} .app-toast-x{color:#9ca3af} }

/* ============================================================
   MODERN MOBİL GÖRÜNÜM (≤991px)
   Yumuşak gölgeli/yuvarlak kartlar, modern liste kartları,
   net tipografi, boş kutuların kalkması.
   ============================================================ */
.cari-form input { max-width: 160px; }   /* masaüstünde dar */

@media (max-width: 991.98px) {
    .content { padding: 14px !important; }

    /* Kartlar: sert kenar yerine yumuşak gölge + yuvarlak */
    .card { border: none !important; border-radius: 18px;
        box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 22px rgba(16,24,40,.07); }
    .card > .card-header { background: transparent; border-bottom: 1px solid #eef1f6;
        font-weight: 700; color: #0f172a; padding: .8rem 1rem; }
    .card > .card-body { padding: 1rem; }
    .filter-sticky .card > .card-body { padding: .85rem; }

    /* rtable → modern liste kartı (etiket soluk, değer koyu/kalın) */
    table.rtable tr { border: none; border-radius: 16px; margin-bottom: 12px;
        padding: 4px 16px 10px; background: #fff;
        box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 20px rgba(16,24,40,.07); }
    table.rtable td { padding: 10px 0; border-bottom: 1px solid #f2f4f8;
        font-size: .95rem; font-weight: 600; color: #0f172a; }
    table.rtable td:last-child { border-bottom: none; }
    table.rtable td::before { color: #64748b; font-weight: 500; font-size: .84rem; }
    table.rtable td.rtable-title { border-bottom: 2px solid #eef2f7; margin-bottom: 2px;
        font-size: 1.1rem; font-weight: 800; color: #4f46e5; padding: 12px 0 10px; }
    table.rtable td.rtable-actions { gap: 8px; padding-top: 12px; }

    /* Boş özet/kaydırma kutuları: koca boş beyaz alan olmasın */
    .ozet-scroll { height: auto; max-height: 240px; }

    /* Satır içi form hücresi (ör. Araç Kayıt cari kod): dikey, tam genişlik */
    table.rtable td.rtable-form { flex-direction: column; align-items: stretch; gap: .5rem; text-align: left; }
    table.rtable td.rtable-form::before { margin-bottom: 2px; }
    .cari-form { width: 100%; gap: .5rem !important; }
    .cari-form input { max-width: none; flex: 1 1 100%; }
    .cari-form button { width: 100%; }
}

/* Boş liste/özet placeholder (her ekranda) */
.bos-placeholder { padding: 22px 12px; text-align: center; color: #94a3b8; font-size: .9rem; }

/* ============================================================
   NATIVE ALT GEZİNME ÇUBUĞU (mobil) + APP HİSSİ
   ============================================================ */
.bottom-nav { display: none; }
@media (max-width: 991.98px) {
    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
        background: rgba(255,255,255,.97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
        border-top: 1px solid #eceff4; box-shadow: 0 -6px 24px rgba(16,24,40,.08);
        padding: 6px 4px calc(4px + env(safe-area-inset-bottom));
    }
    .bottom-nav .bn-item {
        flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
        border: none; background: none; color: #94a3b8; font-size: .66rem; font-weight: 600;
        text-decoration: none; padding: 5px 2px; border-radius: 12px; cursor: pointer;
    }
    .bottom-nav .bn-item svg { width: 23px; height: 23px; stroke: currentColor; }
    .bottom-nav .bn-item span { line-height: 1; }
    .bottom-nav .bn-item.active { color: #4f46e5; }
    .bottom-nav .bn-item:active { background: #eef2ff; }

    /* içerik alt bar'ın altında kalmasın */
    .content { padding-bottom: 84px !important; }
    .to-top { bottom: 90px !important; }
    /* mobilde üst hamburger gizli — gezinme alt bardan (native app düzeni) */
    .hamburger { display: none !important; }
    .topbar { gap: 10px; }

    /* Dashboard KPI tile'ları dikey/kompakt (app kartı hissi) */
    .stat-tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px; height: 100%; }
    .stat-tile .stat-ico { width: 44px; height: 44px; border-radius: 13px; font-size: 1.3rem; }
    .stat-tile .stat-val { font-size: 1.4rem; }
    .stat-tile .stat-lbl { font-size: .76rem; }
}

/* Alt bar: aktif sekmeye pill arka plan (Material tarzı) + sabit üst header (mobil) */
@media (max-width: 991.98px) {
    .bottom-nav .bn-item svg { padding: 4px 15px; border-radius: 999px; box-sizing: content-box;
        transition: background .15s ease, color .15s ease; }
    .bottom-nav .bn-item.active svg { background: #e0e7ff; }
    .bottom-nav .bn-item.active { color: #4f46e5; }
    .topbar { position: sticky; top: 0; z-index: 1020; }
}

/* ============================================================
   MOBİL FİLTRE FORMLARI: alanlar 2'li, ana buton TAM GENİŞLİK
   ============================================================ */
.w-100-mobile { }
@media (max-width: 767.98px) {
    .w-100-mobile { width: 100% !important; }

    /* Filtre kartı: başlık + form alt alta */
    .filter-sticky .card-body { flex-direction: column; align-items: stretch !important; gap: .6rem !important; }
    .filter-sticky .card-body > div.d-flex { flex-direction: column; align-items: stretch !important; gap: .6rem !important; }
    .filter-sticky .ms-auto { width: 100%; margin-left: 0 !important; }
    .filter-sticky form { width: 100%; margin: 0 !important; }

    /* d-flex tipi filtre formları (Panel/Analiz/Malzeme): alanlar sarmalı, buton tam satır */
    .filter-sticky form.d-flex { flex-wrap: wrap; align-items: stretch !important; gap: .5rem !important; }
    .filter-sticky form.d-flex > div { flex: 1 1 45%; min-width: 0; }
    .filter-sticky form.d-flex > button,
    .filter-sticky form.d-flex > .btn { flex: 1 1 100%; width: 100%; margin-top: 2px; }
}

/* Card-header içindeki filtre formları da (ör. Yakıt üst filtre) mobilde düzgün sarsın */
@media (max-width: 767.98px) {
    .card > .card-header { flex-wrap: wrap; }
    .card > .card-header form.d-flex { width: 100%; flex-wrap: wrap; margin: 0 !important; gap: .5rem !important; }
    .card > .card-header form.d-flex > div { flex: 1 1 45%; min-width: 0; }
    .card > .card-header form.d-flex > div select,
    .card > .card-header form.d-flex > div input { width: 100% !important; }
    .card > .card-header form.d-flex > button,
    .card > .card-header form.d-flex > .btn { flex: 1 1 100%; width: 100%; }
}

/* Canlı İzleme aksiyon satırı: Sorgula/Temizle mobilde tam, durum yazısı hizası */
.canli-actions .canli-status { margin-left: auto; text-align: right; }
@media (max-width: 767.98px) {
    .canli-actions .canli-btns { width: 100%; }
    .canli-actions .canli-status { width: 100%; margin-left: 0; text-align: left; margin-top: 2px; }
}

/* Canlı İzleme aksiyon satırı MalzemeTuketim kuralından etkilenmesin: yatay sarmalı kalsın */
@media (max-width: 767.98px) {
    .filter-sticky .card-body > div.canli-actions { flex-direction: row !important; align-items: center !important; }
    .canli-actions #interval { width: auto !important; flex: 0 0 auto; }
}

/* ===== Canlı izleme › Kantar ===== */
#kGrid th, #kGrid td { white-space: nowrap; }
#kGrid tbody tr { cursor: pointer; }
#kGrid tbody tr.k-bekliyor > td { background-color: #eff6ff; }
#kGrid tbody tr.k-hatali > td { color: #94a3b8; text-decoration: line-through; }
#kGrid tbody tr:hover > td { filter: brightness(.96); }
@media (max-width: 1199.98px) {
    #kGrid, #kGrid tbody, #kGrid tfoot { display: block; width: 100%; }
    #kGrid thead { display: none; }
    #kGrid tr { display: block; margin-bottom: 12px; border-radius: 12px; padding: 8px 12px;
        border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(15,23,42,.10); background: #fff; }
    #kGrid tbody tr.k-bekliyor { background: #eff6ff; }
    #kGrid tbody tr > td { background: transparent !important; }
    #kGrid td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
        border: none; padding: 3px 0; text-align: right; white-space: normal; }
    #kGrid td::before { content: attr(data-label); font-weight: 600; color: #475569; text-align: left; }
    #kGrid td[data-label="Sıra"] { font-weight: 700; font-size: 1rem;
        border-bottom: 1px solid rgba(0,0,0,.10); margin-bottom: 5px; padding-bottom: 6px; }
    #kGrid tfoot tr { background: #e9ecef; }
    #kGrid .tf-label, #kGrid .tf-empty { display: none; }
}
.ico-sky    { background: linear-gradient(135deg,#0284c7,#38bdf8); }
#kGrid tbody tr.k-silindi > td { background-color: #fef2f2; color: #991b1b; }
#kGrid tbody tr.k-silindi > td:not([data-label="Durum"]) { text-decoration: line-through; }
