/* OPLANNINGS_DRIVER_MOBILE_V1 — confort mobile pour l’espace chauffeur */
@media (max-width: 767.98px) {
    .driver-home {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    }
    .driver-home-heading { order: 0; padding: 2px 2px 4px !important; }
    .driver-home-heading h1 { font-size: 25px !important; }
    .driver-home-heading p { font-size: 13px; }
    .driver-workspace { order: 1; margin-bottom: 0; border-radius: 16px; }
    .driver-kpis { order: 2; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; margin: 2px 0 0; }
    .driver-activity-grid { order: 3; gap: 10px !important; margin: 0; }
    .driver-kpi { min-width: 0; min-height: 82px !important; padding: 10px !important; border-radius: 12px; }
    .driver-kpi-icon { flex: 0 0 32px !important; width: 32px !important; height: 32px !important; font-size: 16px !important; }
    .driver-kpi strong { font-size: 20px !important; }
    .driver-kpi div > span { font-size: 10px !important; line-height: 1.25; }
    .driver-kpi small { font-size: 9px !important; }
    .driver-workspace-header { gap: 10px !important; padding: 14px 12px 8px !important; }
    .driver-workspace-header h2 { margin-bottom: 2px !important; font-size: 17px !important; }
    .driver-workspace-header p { font-size: 12px !important; }
    .driver-view-tabs {
        position: fixed !important;
        z-index: 1050;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        display: flex;
        justify-content: stretch;
        gap: 4px !important;
        width: auto !important;
        margin: 0;
        padding: 6px !important;
        border: 1px solid #e3eaf4;
        border-radius: 16px !important;
        background: rgba(255,255,255,.97) !important;
        box-shadow: 0 8px 28px rgba(22,42,77,.18);
        backdrop-filter: blur(12px);
    }
    .driver-view-tabs .nav-item { flex: 1 1 50%; }
    .driver-view-tabs .nav-link { min-height: 46px; width: 100%; padding: 9px 6px !important; font-size: 12px !important; }
    .driver-workspace-body { padding: 12px 10px 16px !important; }
    .driver-calendar-hint { align-items: flex-start; font-size: 11px !important; line-height: 1.4; }
    #kt_calendar_app { min-height: 340px !important; }
    .driver-home .fc .fc-toolbar { display: flex; align-items: center; justify-content: space-between !important; gap: 8px; }
    .driver-home .fc .fc-toolbar-chunk { display: flex; align-items: center; justify-content: center; gap: 3px; }
    .driver-home .fc .fc-toolbar-title { font-size: 15px !important; }
    .driver-home .fc .fc-button { min-height: 40px; padding: 7px 9px !important; font-size: 11px !important; }
    .driver-home .fc .fc-daygrid-day-number { padding: 5px !important; font-size: 11px !important; }
    .driver-home .fc .fc-col-header-cell-cushion { padding: 7px 2px !important; font-size: 9px !important; }
    .driver-home .fc .fc-daygrid-event { margin: 1px 2px; padding: 2px; font-size: 10px; white-space: normal; }
    .driver-list-toolbar { gap: 10px !important; }
    .driver-search-wrap .form-control { min-height: 46px !important; font-size: 16px; }
    .driver-home .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .driver-home .table-responsive table { min-width: 680px; }

    .driver-mobile-detail { border-radius: 16px; overflow: hidden; }
    .driver-mobile-detail > .card-header { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 14px !important; }
    .driver-mobile-detail .card-title { font-size: 18px !important; }
    .driver-mobile-actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; width: 100%; }
    .driver-mobile-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; margin: 0 !important; padding: 9px 8px !important; font-size: 12px; white-space: normal; }
    .driver-mobile-detail .card-body { padding: 12px 14px 18px !important; }
    .driver-mobile-detail .card-body > .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; margin-bottom: 18px !important; }
    .driver-mobile-detail .card-body > .row > [class*="col-"] { width: auto; padding: 0; }

    .driver-mobile-slip { border-radius: 16px; overflow: visible; }
    .driver-mobile-slip > .card-header { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px !important; background: #fff; border-bottom: 1px solid #e8edf4 !important; }
    .driver-mobile-slip .card-title { max-width: calc(100% - 75px); font-size: 16px !important; line-height: 1.25; }
    .driver-mobile-slip .card-body { padding: 14px 12px calc(22px + env(safe-area-inset-bottom, 0px)) !important; }
    .driver-mobile-slip label.form-label { margin-bottom: 6px; font-size: 13px; font-weight: 650; }
    .driver-mobile-slip .form-control,
    .driver-mobile-slip .form-select { min-height: 48px; font-size: 16px !important; }
    .driver-mobile-slip textarea.form-control { min-height: 96px; }
    .driver-mobile-slip .row { --bs-gutter-x: 12px; --bs-gutter-y: 14px; }
    .driver-mobile-slip .form-check { min-height: 44px; padding: 10px 12px 10px 38px; border: 1px solid #e6ebf2; border-radius: 10px; }
    .driver-mobile-slip .form-check-input { width: 20px; height: 20px; margin-top: 0; margin-left: -27px; }
    .driver-mobile-slip form > .text-end.mt-7 { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 20; margin: 18px -12px -14px !important; padding: 10px 12px; border-top: 1px solid #e8edf4; background: rgba(255,255,255,.97); }
    .driver-mobile-slip form > .text-end.mt-7 .btn { width: 100%; min-height: 52px; justify-content: center; font-size: 16px; font-weight: 700; }

    .driver-mobile-slip #rows-table { display: block; width: 100%; }
    .driver-mobile-slip #rows-table thead { display: none; }
    .driver-mobile-slip #rows-table tbody { display: grid; gap: 12px; }
    .driver-mobile-slip #rows-table tbody tr { display: grid; gap: 10px; padding: 12px; border: 1px solid #e4eaf2; border-radius: 13px; background: #fff; box-shadow: 0 3px 12px rgba(22,42,77,.04); }
    .driver-mobile-slip #rows-table tbody td { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 10px; width: 100%; padding: 0 !important; border: 0; }
    .driver-mobile-slip #rows-table tbody td:nth-child(1)::before { content: "N° de bon"; }
    .driver-mobile-slip #rows-table tbody td:nth-child(2)::before { content: "Ville"; }
    .driver-mobile-slip #rows-table tbody td:nth-child(3)::before { content: "Zone"; }
    .driver-mobile-slip #rows-table tbody td:nth-child(4)::before { content: "Arrivée"; }
    .driver-mobile-slip #rows-table tbody td:nth-child(5)::before { content: "Départ"; }
    .driver-mobile-slip #rows-table tbody td:nth-child(6)::before { content: "Durée"; }
    .driver-mobile-slip #rows-table tbody td:nth-child(7)::before { content: "Volume (m³)"; }
    .driver-mobile-slip #rows-table tbody td:nth-child(8)::before { content: "Centrale"; }
    .driver-mobile-slip #rows-table tbody td::before { color: #52637a; font-size: 12px; font-weight: 650; }
    .driver-mobile-slip #rows-table tbody td:last-child { display: flex; justify-content: flex-end; }
    .driver-mobile-slip #rows-table tbody td:last-child::before { content: "Supprimer cette ligne"; margin-right: auto; }
    .driver-mobile-slip #rows-table .form-control { min-width: 0; }
    .driver-mobile-slip #add-row { min-height: 46px; width: 100%; justify-content: center; }
}

@media (max-width: 380px) {
    .driver-home .fc .fc-toolbar { justify-content: center !important; }
    .driver-home .fc .fc-toolbar-chunk { flex-wrap: wrap; }
    .driver-mobile-detail .card-body > .row { grid-template-columns: 1fr; }
    .driver-mobile-slip #rows-table tbody td { grid-template-columns: 1fr; gap: 4px; }
}
