:root {
    --sidebar-w: 248px;
    --sidebar-bg: #16213a;
    --sidebar-fg: #c3cad9;
    --sidebar-active: #2f6fed;
    --app-bg: #f4f6fa;
    --bs-indigo: #6f42c1;
}

body {
    background: var(--app-bg);
    font-size: .925rem;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
/* Bootstrap, lg ve üstünde .offcanvas-lg arka planını "transparent !important" yapar;
   iki sınıflı seçici + !important ile koyu arka plan korunur. */
.sidebar,
.sidebar.offcanvas-lg {
    width: var(--sidebar-w);
    background-color: var(--sidebar-bg) !important;
    color: var(--sidebar-fg);
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
}

@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg {
        --bs-offcanvas-width: var(--sidebar-w);
        --bs-offcanvas-bg: var(--sidebar-bg);
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.1rem 1.25rem;
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand .bi {
    color: #5b9bff;
    font-size: 1.4rem;
}

.sidebar-nav {
    padding: .75rem .6rem 2rem;
    display: flex;
    flex-direction: column;
}

.sidebar-nav .nav-section {
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .08em;
    color: #8d98b3;
    font-weight: 600;
    padding: 1rem .75rem .35rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--sidebar-fg);
    padding: .5rem .75rem;
    border-radius: .45rem;
    margin-bottom: 2px;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
}

.sidebar-nav .nav-link .bi {
    font-size: 1.05rem;
    width: 1.2rem;
    text-align: center;
}

/* ---------- Main ---------- */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fff;
    border-bottom: 1px solid #e3e7ef;
    padding: .6rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
}

.content {
    padding: 1.25rem;
}

@media (max-width: 575.98px) {
    .content { padding: 1rem; }
    .topbar { padding: .5rem 1rem; }
}

/* ---------- Components ---------- */
.card {
    border: 1px solid #e3e7ef;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.card-header {
    background: #fff;
    font-weight: 600;
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: .6rem;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
}

.table > :not(caption) > * > * {
    padding: .55rem .6rem;
}

.table thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
    background: #f9fafb;
}

.table td.num, .table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.badge-status {
    font-weight: 500;
}

.bg-indigo {
    background-color: var(--bs-indigo) !important;
}

.bg-warning.badge-status {
    color: #212529;
}

.route {
    line-height: 1.3;
}

.route .from::before, .route .to::before {
    font-family: "bootstrap-icons";
    margin-right: .3rem;
}

.route .from::before { content: "\F3E7"; color: #198754; }
.route .to::before { content: "\F3E7"; color: #dc3545; }

.route-code {
    background: #16213a;
    color: #fff;
    font-weight: 600;
    letter-spacing: .03em;
    margin-bottom: .2rem;
}

.time-cell {
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.filter-bar .form-control, .filter-bar .form-select {
    min-width: 0;
}

.nav-tabs .badge {
    font-weight: 500;
}

.dl-grid {
    display: grid;
    grid-template-columns: minmax(120px, 38%) 1fr;
    gap: .4rem 1rem;
    margin: 0;
}

.dl-grid dt {
    color: #6b7280;
    font-weight: 500;
}

.dl-grid dd {
    margin: 0;
    word-break: break-word;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline li {
    position: relative;
    padding: 0 0 .9rem 1.2rem;
    border-left: 2px solid #e3e7ef;
    margin-left: .35rem;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: .3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2f6fed;
}

.timeline li:last-child { border-left-color: transparent; }

/* ---------- Rezervasyon satır renkleri (DisplayHelpers.RowStateClass) ---------- */
:root {
    --row-unassigned: #c1121f;
    --row-unassigned-bg: #ef9aa3;
    --row-assigned: #0b5ed7;
    --row-assigned-bg: #9fc0f5;
    --row-completed: #146c43;
    --row-completed-bg: #93d1ad;
    --row-cancelled: #5c636a;
    --row-cancelled-bg: #c2c6cc;
}

.table > tbody > tr.row-unassigned > * { --bs-table-bg: var(--row-unassigned-bg); }
.table > tbody > tr.row-assigned > * { --bs-table-bg: var(--row-assigned-bg); }
.table > tbody > tr.row-completed > * { --bs-table-bg: var(--row-completed-bg); }
.table > tbody > tr.row-cancelled > * { --bs-table-bg: var(--row-cancelled-bg); }

.table > tbody > tr.row-unassigned > :first-child { border-left: 6px solid var(--row-unassigned); }
.table > tbody > tr.row-assigned > :first-child { border-left: 6px solid var(--row-assigned); }
.table > tbody > tr.row-completed > :first-child { border-left: 6px solid var(--row-completed); }
.table > tbody > tr.row-cancelled > :first-child { border-left: 6px solid var(--row-cancelled); }

/* Renkli zeminde satır ayrımı ve yazılar belli olsun */
.table > tbody > tr[class^="row-"] > * { border-bottom-color: rgba(255, 255, 255, .85); color: #111827; }
.table > tbody > tr[class^="row-"] a:not(.btn) { color: #0a1f44; }
.table > tbody > tr[class^="row-"] .text-muted { color: #1f2937 !important; opacity: .8; }
.ml-item[class*="row-"] .ml-sub, .ml-item[class*="row-"] .ml-who, .ml-item[class*="row-"] .ml-time small { color: #1f2937; }

/* İptal edilenler soluk görünür, yazı yine okunur kalır */
.table > tbody > tr.row-cancelled > * { color: #495057; }
.table > tbody > tr.row-cancelled .route,
.table > tbody > tr.row-cancelled .route-short,
.table > tbody > tr.row-cancelled .time-cell { text-decoration: line-through; text-decoration-color: rgba(73, 80, 87, .6); }

/* ---------- Sıkı rezervasyon tablosu (Rezervasyonlar listesi) ---------- */
@media (min-width: 768px) { .table-dense > tbody > tr > td { padding-top: .1rem; padding-bottom: .1rem; line-height: 1.2; } }
.table-dense .time-cell { font-size: .9rem; }
.table-dense .badge { font-size: .68rem; padding: .2em .45em; }
.table-dense .btn-sm { --bs-btn-padding-y: 0; --bs-btn-padding-x: .35rem; --bs-btn-font-size: .75rem; line-height: 1.35; }
.route-short {
    font-weight: 700;
    letter-spacing: .04em;
    color: #16213a;
}

.table > tbody > tr.date-sep > td {
    --bs-table-bg: #16213a;
    color: #fff;
    font-weight: 600;
    font-size: .78rem;
    padding: .2rem .75rem;
    letter-spacing: .02em;
}

.row-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    font-size: .8rem;
    color: #52514e;
}

.row-legend .dot {
    display: inline-block;
    width: .7rem;
    height: .7rem;
    border-radius: 2px;
    margin-right: .35rem;
    vertical-align: -1px;
}

.bar-track {
    background: #eef1f6;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
}

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #16213a 0%, #2f4a8a 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .no-print, .alert { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
    .card { border: 0; box-shadow: none; }
}

/* ---------- Formlar: zorunlu alan ve doğrulama ---------- */
.form-label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: 600;
}

.form-control.input-validation-error,
.form-select.input-validation-error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.form-control.input-validation-error:focus,
.form-select.input-validation-error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .2);
}

.field-validation-error {
    display: block;
    color: #dc3545;
    font-size: .8rem;
    margin-top: .2rem;
}

.form-section-title {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    font-weight: 600;
    margin: .25rem 0 .5rem;
}

.swap-btn {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.form-actions {
    position: sticky;
    bottom: 0;
    background: var(--app-bg);
    padding: .75rem 0;
    z-index: 5;
}

/* ---------- Konum önerisi (location-autocomplete.js) ---------- */
.ac-host {
    position: relative;
}

.ac-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1060;
    max-height: 340px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d7dce5;
    border-radius: .5rem;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .14);
    padding: .25rem 0;
}

.ac-section {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    font-weight: 600;
    padding: .45rem .8rem .2rem;
}

.ac-item {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .45rem .8rem;
    cursor: pointer;
    line-height: 1.3;
}

.ac-item .bi {
    color: #6b7280;
    margin-top: .1rem;
}

.ac-item small {
    display: block;
    color: #6b7280;
}

.ac-item:hover,
.ac-item.active {
    background: #eef4ff;
}

.ac-note, .ac-powered {
    font-size: .75rem;
    color: #6b7280;
    padding: .4rem .8rem;
}

.ac-powered {
    text-align: right;
    border-top: 1px solid #eef0f4;
}

/* =====================================================================
   MOBİL GÖRÜNÜM
   Buradaki kuralların tamamı dar ekranlarda (medya sorgusu) veya masaüstünde
   gizli öğelerde (.bottom-nav, .d-md-none) çalışır; masaüstü görünümü değişmez.
   ===================================================================== */

/* ---------- Alt gezinme çubuğu (lg altı) ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    background: #fff;
    border-top: 1px solid #e3e7ef;
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .06);
    padding: .2rem .25rem calc(.2rem + env(safe-area-inset-bottom));
}

.bn-item {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .05rem;
    padding: .35rem 0 .25rem;
    font-size: .68rem;
    line-height: 1.2;
    color: #6b7280;
    text-decoration: none;
    background: none;
    border: 0;
}

.bn-item .bi {
    font-size: 1.3rem;
}

.bn-item.active {
    color: var(--sidebar-active);
    font-weight: 600;
}

.bn-badge {
    position: absolute;
    top: .15rem;
    left: calc(50% + .3rem);
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: #ffc107;
    color: #212529;
    font-size: .65rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.bn-add {
    width: 3.3rem;
    height: 3.3rem;
    margin: 0 .3rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--sidebar-active);
    color: #fff;
    font-size: 1.55rem;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(47, 111, 237, .4);
    transform: translateY(-.55rem);
}

.bn-add:active,
.bn-add:hover {
    color: #fff;
    background: #2459c7;
}

@media (max-width: 991.98px) {
    .content {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }

    /* Form kaydet çubuğu alt gezinmenin hemen üstünde durur */
    .form-actions {
        bottom: calc(3.6rem + env(safe-area-inset-bottom));
    }

    /* Ana ekrandan açılınca (iPhone) çentik altında kalmasın */
    .topbar {
        padding-top: calc(.5rem + env(safe-area-inset-top));
    }

    .sidebar-brand {
        padding-top: calc(1.1rem + env(safe-area-inset-top));
    }
}

/* ---------- Sekmeler: kaydırma çubuğu gizli ---------- */
.nav-tabs.overflow-auto {
    scrollbar-width: none;
}

.nav-tabs.overflow-auto::-webkit-scrollbar {
    display: none;
}

/* ---------- Telefon (md altı) ---------- */
@media (max-width: 767.98px) {
    body {
        font-size: .9rem;
    }

    .page-title {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* iPhone'da yazı alanına dokununca ekran büyümesin (16px altı yazı büyütmeye yol açar) */
    .form-control,
    .form-select {
        font-size: 16px;
    }

    .card-body {
        padding: .85rem;
    }

    .form-actions .btn {
        flex: 1 1 auto;
    }

    .chart-box {
        height: 220px !important;
    }

    /* Gelir/Gider özet kartları yan yana sığsın */
    .stat-card .stat-value.fs-4 {
        font-size: 1.05rem !important;
    }

    /* Filtreler: arama hep görünür, diğerleri "Filtre" butonuyla açılır */
    .filter-bar:not(.show-filters) .m-filter {
        display: none !important;
    }

    .dl-grid {
        grid-template-columns: minmax(100px, 40%) 1fr;
    }

    /* ---------- Tablo → kart görünümü (.table-cards) ---------- */
    .table-cards thead {
        display: none;
    }

    .table-cards,
    .table-cards > tbody,
    .table-cards > tbody > tr,
    .table-cards > tbody > tr > td {
        display: block;
        width: 100%;
    }

    .table-cards > tbody > tr {
        position: relative;
        width: auto;
        margin: .6rem .75rem;
        padding: .65rem .8rem;
        background: #fff;
        border: 1px solid #e3e7ef;
        border-radius: .65rem;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    }

    .table-cards > tbody > tr > td {
        min-width: 0 !important;
        padding: .15rem 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-align: left !important;
        white-space: normal !important;
    }

    .table-cards > tbody > tr > td.m-hide {
        display: none !important;
    }

    .table-cards > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        display: inline-block;
        min-width: 4.6rem;
        margin-right: .35rem;
        color: #6b7280;
        font-size: .75rem;
        font-weight: 400;
    }

    .table-cards > tbody > tr > td[data-label] > div {
        display: inline;
    }

    .table-cards > tbody > tr > td[data-label] > div + div::before {
        content: " · ";
        color: #9aa1ab;
    }

    /* Kartın başlığı (saat) ve sağ üst köşe (durum / tutar) */
    .table-cards > tbody > tr > td.m-head {
        padding-right: 7.5rem !important;
        font-size: 1rem;
    }

    .table-cards > tbody > tr > td.m-head > div {
        display: inline;
        margin-right: .35rem;
    }

    .table-cards > tbody > tr > td.m-corner {
        position: absolute;
        top: .6rem;
        right: .75rem;
        width: auto;
        padding: 0 !important;
        text-align: right !important;
    }

    .table-cards > tbody > tr > td.m-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: .4rem;
        margin-top: .45rem;
        padding-top: .5rem !important;
        border-top: 1px solid rgba(0, 0, 0, .07) !important;
    }

    .table-cards > tbody > tr > td.m-actions:empty {
        display: none;
    }

    .table-cards > tbody > tr > td.m-actions .btn {
        min-height: 2.3rem;
        padding-left: .8rem;
        padding-right: .8rem;
    }

    .table-cards .route {
        margin: .2rem 0;
    }

    .table-cards .assign-form {
        flex-wrap: wrap;
        margin-top: .35rem;
    }

    .table-cards .assign-form .form-select {
        flex: 1 1 40%;
    }

    /* Satır durum renkleri kart kenarında */
    .table-cards > tbody > tr.row-unassigned { background: var(--row-unassigned-bg); border-left: 6px solid var(--row-unassigned); }
    .table-cards > tbody > tr.row-assigned { background: var(--row-assigned-bg); border-left: 6px solid var(--row-assigned); }
    .table-cards > tbody > tr.row-completed { background: var(--row-completed-bg); border-left: 6px solid var(--row-completed); }
    .table-cards > tbody > tr.row-cancelled { background: var(--row-cancelled-bg); border-left: 6px solid var(--row-cancelled); }
}

/* ---------- Küçük telefon (sm altı): istatistik kartları sade ---------- */
@media (max-width: 575.98px) {
    .content {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .stat-card .card-body {
        padding: .7rem .8rem;
        gap: .5rem !important;
    }

    .stat-card .stat-icon {
        display: none !important;
    }

    .stat-card .stat-label {
        font-size: .68rem;
        letter-spacing: .02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stat-card .stat-value {
        font-size: 1.35rem;
    }

    .stat-card small {
        font-size: .72rem;
    }

    .table-cards > tbody > tr {
        margin-left: .5rem;
        margin-right: .5rem;
    }
}

/* ---------- Dokunmatik ekranlar: parmakla basılabilir butonlar ---------- */
@media (pointer: coarse) and (max-width: 991.98px) {
    .btn-sm {
        min-height: 2.25rem;
        min-width: 2.25rem;
    }

    .page-link {
        min-width: 2.25rem;
        text-align: center;
    }
}

@media print {
    .bottom-nav {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .plan-date {
        width: 100%;
    }
}

/* ---------- Şifreyi göster butonu (password-toggle.js) ---------- */
.password-toggle {
    border-color: var(--bs-border-color);
    color: #6b7280;
    background: #fff;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--sidebar-active);
    background: #f4f6fa;
    border-color: var(--bs-border-color);
}

.input-group > .input-validation-error + .password-toggle {
    border-color: #dc3545;
}

/* hidden özniteliği Bootstrap görünürlük sınıflarından (d-flex, d-block ...) her zaman üstün olsun.
   Bootstrap'te ikisi de !important ve d-* sonra geldiği için normalde d-* kazanır. */
[hidden].d-flex, [hidden].d-inline-flex, [hidden].d-block, [hidden].d-inline-block,
[hidden].d-grid, [hidden].d-inline, [hidden].d-table {
    display: none !important;
}

/* Yapay zekâ ile doldurulan alanlar */
.form-control.ai-filled, .form-select.ai-filled {
    border-color: #6ea8fe;
    background-color: #f2f7ff;
}

/* ---------- Mobil sıkı liste (_CompactList) ---------- */
.m-list, .view-toggle { display: none; }

@media (max-width: 767.98px) {
    .view-toggle { display: inline-flex; }
    [data-view-root].view-compact .m-list { display: block; }
    [data-view-root].view-compact .table-responsive,
    [data-view-root].view-compact .row-legend-wrap { display: none !important; }
}

.m-list { border-top: 1px solid #eef0f4; }

.ml-item {
    border-bottom: 1px solid #eef0f4;
    border-left: 6px solid var(--row-assigned);
    background: var(--row-assigned-bg);
}

.ml-item.row-unassigned { border-left-color: var(--row-unassigned); background: var(--row-unassigned-bg); }
.ml-item.row-completed { border-left-color: var(--row-completed); background: var(--row-completed-bg); }
.ml-item.row-cancelled { border-left-color: var(--row-cancelled); background: var(--row-cancelled-bg); opacity: .8; }
.ml-item { border-bottom-color: #fff; }

.ml-item > summary {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.ml-item > summary::-webkit-details-marker { display: none; }
.ml-item > summary:active { background: #f4f6fa; }
.ml-item[open] > summary { background: #f6f8fc; }

.ml-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.1rem;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.ml-time strong { font-size: 1.02rem; }
.ml-time small { font-size: .68rem; color: #6b7280; }

.ml-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ml-route { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #16213a; }
.ml-sub { font-size: .78rem; color: #4b5563; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-meta { color: #6b7280; margin-left: .45rem; }
.ml-meta .bi { margin-right: .15rem; }

.ml-side { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; flex-shrink: 0; max-width: 6.5rem; }
.ml-status { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.ml-who { font-size: .7rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 6.5rem; }
.ml-chevron { font-size: .75rem; color: #9aa1ab; transition: transform .15s ease; }
.ml-item[open] .ml-chevron { transform: rotate(180deg); }

.ml-body { padding: .3rem .8rem .8rem 4.3rem; font-size: .85rem; animation: mlOpen .15s ease-out; }
@keyframes mlOpen { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.ml-dl { display: grid; grid-template-columns: 4.6rem 1fr; gap: .15rem .6rem; margin: 0 0 .6rem; }
.ml-dl dt { color: #6b7280; font-weight: 400; }
.ml-dl dd { margin: 0; word-break: break-word; }
.ml-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.ml-actions .btn { min-height: 2.2rem; }

@media (max-width: 400px) {
    .ml-body { padding-left: .9rem; }
}

/* ---------- Şoför paneli ---------- */
.job-card {
    border-left-width: 4px;
}

.job-card.row-unassigned, .job-card.row-assigned { border-left-color: var(--row-assigned); }
.job-card.row-completed { border-left-color: var(--row-completed); }
.job-card.row-cancelled { border-left-color: var(--row-cancelled); }
.job-card:active { transform: scale(.99); }

.job-time {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.welcome-sign {
    border: 3px dashed #16213a;
    border-radius: .5rem;
    padding: .9rem;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .04em;
    word-break: break-word;
}

/* ---------- Günlük plan: toplu atama çubuğu ---------- */
.bulk-bar {
    position: sticky;
    bottom: 0;
    z-index: 1025;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .75rem;
    padding: .65rem .9rem;
    background: #16213a;
    color: #fff;
    border-radius: .65rem;
    box-shadow: 0 -6px 20px rgba(16, 24, 40, .18);
}

.bulk-bar .form-select {
    width: auto;
    min-width: 9rem;
    flex: 1 1 9rem;
}

@media (max-width: 991.98px) {
    .bulk-bar {
        bottom: calc(3.8rem + env(safe-area-inset-bottom));
    }
}

/* ---------- Şoför programı (haftalık takvim) ---------- */
.schedule-table th, .schedule-table td {
    min-width: 140px;
    vertical-align: top;
}

.schedule-table td:first-child, .schedule-table th:first-child {
    min-width: 150px;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}

.sch-job {
    display: block;
    font-size: .75rem;
    line-height: 1.25;
    padding: .25rem .4rem;
    margin-bottom: .25rem;
    border-radius: .35rem;
    border-left: 3px solid var(--row-assigned);
    background: var(--row-assigned-bg);
    color: #1f2937;
    text-decoration: none;
}

.sch-job:hover { filter: brightness(.97); color: #1f2937; }
.sch-job.done { border-left-color: var(--row-completed); background: var(--row-completed-bg); }
.sch-job.unassigned { border-left-color: var(--row-unassigned); background: var(--row-unassigned-bg); }
.sch-job.conflict { box-shadow: 0 0 0 2px #f59f00 inset; }
.sch-job.noshow { opacity: .55; }
.schedule-table .today { background: #fffbea; }

/* ---------- Günlük plan: gece transferleri ayracı ---------- */
.table > tbody > tr.night-sep > td {
    --bs-table-bg: #eef0fb;
    color: #3d3a8c;
    font-weight: 600;
    font-size: .85rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
}

.table > tbody > tr.night-sep small {
    font-weight: 400;
    color: #6b6aa6;
}

.night-badge {
    background: #e4e2fb;
    color: #3d3a8c;
    font-size: .7rem;
    font-weight: 600;
    vertical-align: middle;
}

@media (max-width: 767.98px) {
    .table-cards > tbody > tr.night-sep {
        background: #eef0fb;
        border: 0;
        box-shadow: none;
        margin-top: 1rem;
        padding: .5rem .8rem;
    }
}

@media (max-width: 767.98px) {
    .table-cards > tbody > tr.date-sep {
        background: #16213a;
        color: #fff;
        border: 0;
        box-shadow: none;
        margin-top: .8rem;
        padding: .35rem .8rem;
        font-weight: 600;
        font-size: .85rem;
    }
}

/* ---------- Rezervasyon listesi: sekme çubuğu + sıkı filtre ---------- */
.res-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid #eef0f4;
}

.seg-tabs {
    display: flex;
    gap: 2px;
    min-width: 0;
    padding: 3px;
    background: #eef1f6;
    border-radius: .55rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.seg-tabs::-webkit-scrollbar { display: none; }

.seg-tab {
    padding: .25rem .65rem;
    border-radius: .4rem;
    font-size: .82rem;
    font-weight: 500;
    color: #475467;
    white-space: nowrap;
    text-decoration: none;
}

.seg-tab:hover { background: rgba(255, 255, 255, .7); color: #16213a; }
.seg-tab.active { background: #16213a; color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .2); }

.seg-count {
    margin-left: .2rem;
    padding: 0 .38rem;
    border-radius: 1rem;
    font-size: .72rem;
    background: rgba(16, 24, 40, .08);
}

.seg-tab.active .seg-count { background: rgba(255, 255, 255, .22); }
.seg-tab.attn .seg-count { background: #ffc107; color: #1d1d1d; font-weight: 600; }

.res-actions { display: flex; gap: .35rem; margin-left: auto; flex-shrink: 0; }

.btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.res-filter { padding: .5rem .75rem; border-bottom: 1px solid #eef0f4; }
.res-filter-main { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.search-box { position: relative; flex: 1 1 220px; max-width: 340px; }
.search-box > i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: #98a2b3; font-size: .8rem; }
.search-box > input { padding-left: 1.8rem; }

.state-chips { display: flex; gap: .35rem; flex-wrap: wrap; }

.state-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .55rem;
    border: 1px solid #d0d5dd;
    border-radius: 1rem;
    background: #fff;
    font-size: .78rem;
    color: #344054;
    white-space: nowrap;
    text-decoration: none;
}

.state-chip .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); }
.state-chip b { font-weight: 600; color: #667085; }
.state-chip:hover { border-color: var(--c); color: #16213a; }
.state-chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.state-chip.on b { color: #fff; }
.state-chip.on .dot { background: #fff; }
.st-unassigned { --c: var(--row-unassigned); }
.st-assigned { --c: var(--row-assigned); }
.st-completed { --c: var(--row-completed); }
.st-cancelled { --c: var(--row-cancelled); }

.adv-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px dashed #e4e7ec;
}

.adv-filters label { display: flex; align-items: center; gap: .35rem; margin: 0; font-size: .8rem; color: #667085; }
.adv-filters .form-control, .adv-filters .form-select { width: auto; min-width: 8rem; }

@media (max-width: 767.98px) {
    .res-toolbar { padding: .45rem .5rem; }
    .res-filter { padding: .45rem .5rem; }
    .search-box { flex-basis: 100%; max-width: none; }
    .state-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
    .adv-filters label, .adv-filters .form-select { flex: 1 1 45%; }
    .adv-filters .form-control { min-width: 0; flex: 1; }
}

.state-chip > i { color: var(--c); font-size: .85rem; }
.state-chip.on > i { color: #fff; }
.st-collect { --c: #b54708; }
.st-uetds { --c: #6941c6; }
.chip-sep { width: 1px; align-self: stretch; margin: .15rem; background: #d0d5dd; }

/* ---------- Basit görünüm (Ayarlar → Görünüm). Hiçbir şey silinmez; tam görünüme geçince her şey geri gelir. ---------- */
.simple-mode .full-only { display: none !important; }
body:not(.simple-mode) .simple-only { display: none !important; }
/* İki renk: kırmızı = işlem bekliyor, yeşil = yönlendirildi (şoföre / acentaya / taşımacıya verildi; tamamlananlar dahil) */
.simple-mode {
    --row-assigned: #146c43;
    --row-assigned-bg: #93d1ad;
    --row-completed: #146c43;
    --row-completed-bg: #93d1ad;
}
.st-pending { --c: var(--row-unassigned); }
.st-routed { --c: var(--row-assigned); }
.simple-mode .ml-status { display: none; }

/* ---------- Havuz: sarı satır (havuz hesaplarının almasını bekliyor) ---------- */
:root { --row-pool: #c99700; --row-pool-bg: #ffe69c; }
.table > tbody > tr.row-pool > * { --bs-table-bg: var(--row-pool-bg); }
.table > tbody > tr.row-pool > :first-child { border-left: 6px solid var(--row-pool); }
.ml-item.row-pool { border-left-color: var(--row-pool); background: var(--row-pool-bg); }
.job-card.row-pool { border-left-color: var(--row-pool); }
.st-pool { --c: var(--row-pool); }
@media (max-width: 767.98px) {
    .table-cards > tbody > tr.row-pool { background: var(--row-pool-bg); border-left: 6px solid var(--row-pool); }
}

/* ---------- Yazarak süzülen seçim kutusu (Scripts/pick-list.js) ---------- */
.pick-menu { max-height: 18rem; overflow-y: auto; margin-top: 2px; }
.pick-menu .dropdown-item.focus { background: #e9ecef; }
.pick-menu .dropdown-item.pick-pool { color: #7a5b00; font-weight: 600; }

/* ---------- Transfer listesi sütun aramaları (basit görünüm) ---------- */
.col-filters th { padding: .2rem .25rem !important; background: #f8fafc; }
.col-filters input, .col-filters select { font-size: .78rem; padding: .15rem .35rem; height: auto; min-width: 0; }
.col-filters select { padding-right: 1.4rem; background-position: right .3rem center; }
.res-search-note { padding: .35rem .75rem; background: #fff8e1; border-bottom: 1px solid #f0e2b0; font-size: .82rem; }
.map-link { color: inherit; text-decoration: underline dotted; } .map-link:hover { color: #0b5ed7; } .ac-saving { background-image: linear-gradient(90deg, #fff, #eef4ff, #fff); }

/* ---------- Havuz listeleri: yapılacak (mavi), ödeme bekliyor (turuncu), ödendi (yeşil) ---------- */
:root {
    --row-p-progress: #0b5ed7; --row-p-progress-bg: #b9d1f7;
    --row-p-unpaid: #d9480f; --row-p-unpaid-bg: #ffc9a8;
    --row-p-paid: #146c43; --row-p-paid-bg: #a6dbbc;
}
.table > tbody > tr.row-p-progress > * { --bs-table-bg: var(--row-p-progress-bg); }
.table > tbody > tr.row-p-unpaid > * { --bs-table-bg: var(--row-p-unpaid-bg); }
.table > tbody > tr.row-p-paid > * { --bs-table-bg: var(--row-p-paid-bg); }
.table > tbody > tr.row-p-progress > :first-child { border-left: 6px solid var(--row-p-progress); }
.table > tbody > tr.row-p-unpaid > :first-child { border-left: 6px solid var(--row-p-unpaid); }
.table > tbody > tr.row-p-paid > :first-child { border-left: 6px solid var(--row-p-paid); }
.table > tbody > tr[class^="row-p-"] > * { border-bottom-color: rgba(255, 255, 255, .85); color: #111827; }
.table > tbody > tr[class^="row-p-"] a:not(.btn) { color: #0a1f44; }
@media (max-width: 767.98px) {
    .table-cards > tbody > tr.row-p-progress { background: var(--row-p-progress-bg); border-left: 6px solid var(--row-p-progress); }
    .table-cards > tbody > tr.row-p-unpaid { background: var(--row-p-unpaid-bg); border-left: 6px solid var(--row-p-unpaid); }
    .table-cards > tbody > tr.row-p-paid { background: var(--row-p-paid-bg); border-left: 6px solid var(--row-p-paid); }
}
.st-p-progress { --c: var(--row-p-progress); }
.st-p-done { --c: #495057; }
.st-p-unpaid { --c: var(--row-p-unpaid); }
.st-p-paid { --c: var(--row-p-paid); }
.st-p-all { --c: #16213a; }
.p-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: #667085; font-weight: 600; white-space: nowrap; }
.p-table td { font-size: .85rem; }

/* Kart görünümünde (mobil) işlem düğmeleri hangi sütunda olursa olsun kartın en altında durur */
@media (max-width: 767.98px) {
    .table-cards > tbody > tr:not(.date-sep) { display: flex !important; flex-direction: column; }
    .table-cards > tbody > tr > td.m-actions { order: 99; }
}

/* Kazanç kutuları (havuz hesabı) */
.earn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; }
.earn-box { border: 1px solid #e3e7ef; border-radius: .5rem; padding: .45rem .7rem; background: #fff; }
.earn-box .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: #667085; }
.earn-box .val { font-size: 1.15rem; font-weight: 700; }

/* Hata yokken boş özet kutusu görünmesin */
.validation-summary-valid { display: none; }

/* =====================================================================
   MOBİL TASARIM (≤ 767px) — masaüstü görünümünü etkilemez
   ===================================================================== */
@media (max-width: 767.98px) {
    /* İnce bildirim şeridi ("Sonra" → 7 gün görünmez, notifications.js) */
    #pushBanner { padding: .3rem .6rem !important; margin-bottom: .5rem !important; font-size: .78rem; }
    #pushBanner > div { flex-wrap: nowrap !important; gap: .4rem !important; }
    #pushBanner > div > i { display: none; }
    #pushBanner [data-push-text] { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #pushBanner .btn { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .4rem; --bs-btn-font-size: .72rem; white-space: nowrap; }
    .content { padding-top: .6rem; }

    /* ---- İki satırlık sıkı liste (table.table-cards.m-rows) ----
       1. satır: m-head (saat) · m-main (güzergah / ad) · m-corner (durum / tutar)
       2. satır: m-sub hücreleri yan yana küçük yazı · m-actions sağda. İşaretsiz hücreler gizlenir. */
    .table-cards.m-rows > tbody > tr:not(.date-sep) {
        display: flex !important; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: .6rem; row-gap: .1rem;
        margin: 0; padding: .45rem .65rem; border: 0; border-radius: 0; box-shadow: none;
        border-bottom: 1px solid rgba(255, 255, 255, .9);
    }
    .table-cards.m-rows > tbody > tr:not(.date-sep)::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
    .table-cards.m-rows > tbody > tr > td { width: auto !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }
    .table-cards.m-rows > tbody > tr > td[data-label]::before { content: none !important; }
    .table-cards.m-rows > tbody > tr:not(.date-sep) > td:not(.m-head):not(.m-main):not(.m-corner):not(.m-sub):not(.m-actions):not(.m-check) { display: none !important; }
    .table-cards.m-rows td.m-check { order: 0; }
    .table-cards.m-rows td.m-head { order: 1; font-weight: 700; font-size: .95rem; }
    .table-cards.m-rows td.m-head .d-md-none { font-weight: 400; }
    .table-cards.m-rows td.m-main { order: 2; flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .table-cards.m-rows td.m-main > div { display: inline; margin-left: .3rem; font-size: .75rem; }
    .table-cards.m-rows td.m-corner { order: 3; position: static !important; text-align: right !important; font-weight: 700; }
    .table-cards.m-rows td.m-sub { order: 5; font-size: .76rem; color: #374151; white-space: nowrap; }
    .table-cards.m-rows td.m-sub:empty, .table-cards.m-rows td.m-empty { display: none !important; }
    .table-cards.m-rows td.m-actions { order: 6; margin-left: auto !important; display: flex !important; gap: .3rem; }
    .table-cards.m-rows td.m-actions .btn { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .75rem; line-height: 1.3; white-space: nowrap; min-height: 0; padding: .15rem .5rem; }
    /* Sihirbazda kartlar adım sırasına dizilir (iki sütun tek akışa açılır) */
    .wizard > .row > [class*="col-xl"] { display: contents; }
    .wizard [data-step] { width: 100%; }
    .wizard > .row { margin-left: 0; margin-right: 0; }
    .table-cards.m-rows > tbody > tr.date-sep > td { padding: .2rem .65rem !important; font-size: .74rem; }
    .table-cards.m-rows > tbody > tr.date-sep { margin: 0 !important; border-radius: 0 !important; }
    .table-cards.m-rows tfoot { display: none; }
    .table-cards.m-rows > tbody > tr[class^="row-"] { border-left-width: 5px; }

    /* ---- Filtre paneli: .m-filters formunda .m-fold kısımları "Filtre" düğmesiyle açılır ---- */
    .m-filters:not(.m-open) .m-fold { display: none !important; }
    .state-chips, .seg-tabs { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
    .state-chips::-webkit-scrollbar, .seg-tabs::-webkit-scrollbar { display: none; }
    .state-chip, .seg-tab { flex: 0 0 auto; }

    /* ---- Açılır-kapanır kartlar (.m-collapsible; başlığa dokununca) ---- */
    .m-collapsible > .card-header { cursor: pointer; position: relative; padding-right: 2rem; }
    .m-collapsible > .card-header::after { content: "\F282"; font-family: bootstrap-icons; position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); transition: transform .15s; }
    .m-collapsible.m-closed > .card-header::after { transform: translateY(-50%) rotate(-90deg); }
    .m-collapsible.m-closed > :not(.card-header) { display: none !important; }

    /* ---- Alta sabit işlem çubuğu (alt menünün yerini alır) ---- */
    body.has-action-bar .bottom-nav { display: none !important; }
    .m-action-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1031; display: flex; gap: .3rem; align-items: stretch;
        background: #fff; border-top: 1px solid #e3e7ef; box-shadow: 0 -4px 16px rgba(16, 24, 40, .08);
        padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom));
    }
    .m-action-bar > * { flex: 1 1 0; min-width: 0; }
    .m-action-bar .btn, .m-action-bar a.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem;
        font-size: .68rem; line-height: 1.1; padding: .35rem .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; height: 100%; }
    .m-action-bar .btn i { font-size: 1.15rem; }
    .m-action-bar form { display: flex; }

    /* ---- Özet kartı (detay sayfası üstü) ---- */
    .m-summary { border-left: 5px solid var(--bs-primary); }
    .m-summary .m-time { font-size: 1.5rem; font-weight: 800; line-height: 1; }

    /* ---- Sihirbaz (Yeni Transfer formu) ---- */
    .wizard .wz-hidden { display: none !important; }
    .wizard .form-actions { display: none !important; }
    .wz-steps { display: flex; gap: .3rem; margin-bottom: .6rem; }
    .wz-steps .wz-step { flex: 1; text-align: center; font-size: .75rem; padding: .35rem .2rem; border-radius: .4rem; background: #eef1f6; color: #667085; font-weight: 600; }
    .wz-steps .wz-step.on { background: #16213a; color: #fff; }
    .wz-steps .wz-step.done { background: #d1e7dd; color: #0f5132; }
}
/* Masaüstünde mobil öğeler hiç görünmez */
@media (min-width: 768px) {
    .m-action-bar, .wz-steps { display: none !important; }
}

/* Mobil transfer listesi (basit görünüm): fiyat ve "İşi Ver" düğmesi */
.ml-price { font-size: .8rem; font-weight: 700; color: #111827; white-space: nowrap; }
.ml-assign { flex-shrink: 0; align-self: center; margin-left: .35rem; --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .5rem; }

/* Listelerde çocuk / bebek koltuğu işareti (DisplayHelpers.SeatBadge) */
.seat-badge { font-size: .85em; margin-left: .25rem; font-weight: 600; }

.gear-icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; }
