/* Mobile professional redesign for admin/dashboard modules only */
@media (max-width: 768px) {
  body.page-stats_dashboard,
  body.page-admin_dashboard,
  body.page-chef,
  body.page-observations_reservations,
  body.page-suivi_kilometrage,
  body.page-chef_vehicle_monitor,
  body.page-history {
    background: #f4f7fb !important;
  }

  body.page-stats_dashboard main,
  body.page-admin_dashboard main,
  body.page-chef main,
  body.page-observations_reservations main,
  body.page-suivi_kilometrage main,
  body.page-chef_vehicle_monitor main,
  body.page-history main {
    padding: 16px 12px 92px !important;
  }

  body.page-stats_dashboard h1, body.page-stats_dashboard h2, body.page-stats_dashboard h3,
  body.page-admin_dashboard h1, body.page-admin_dashboard h2, body.page-admin_dashboard h3,
  body.page-chef h1, body.page-chef h2, body.page-chef h3,
  body.page-observations_reservations h1, body.page-observations_reservations h2, body.page-observations_reservations h3,
  body.page-suivi_kilometrage h1, body.page-suivi_kilometrage h2, body.page-suivi_kilometrage h3,
  body.page-chef_vehicle_monitor h1, body.page-chef_vehicle_monitor h2, body.page-chef_vehicle_monitor h3,
  body.page-history h1, body.page-history h2, body.page-history h3 {
    font-size: 1.35rem !important;
    line-height: 1.15 !important;
    letter-spacing: -.02em;
    color: #0f172a !important;
  }

  body.page-stats_dashboard .mini-muted,
  body.page-admin_dashboard .mini-muted,
  body.page-chef .mini-muted,
  body.page-observations_reservations .mini-muted,
  body.page-suivi_kilometrage .mini-muted,
  body.page-chef_vehicle_monitor .mini-muted,
  body.page-history .mini-muted {
    color:#64748b !important;
    font-size:.78rem !important;
    font-weight:700 !important;
    text-transform:uppercase;
    letter-spacing:.04em;
  }

  body.page-stats_dashboard .card,
  body.page-admin_dashboard .card,
  body.page-chef .card,
  body.page-observations_reservations .card,
  body.page-suivi_kilometrage .card,
  body.page-chef_vehicle_monitor .card,
  body.page-history .card {
    border: 1px solid rgba(15,23,42,.08) !important;
    border-radius: 22px !important;
    box-shadow: 0 10px 28px rgba(15,23,42,.08) !important;
    background: #fff !important;
    padding: 16px !important;
    margin-bottom: 14px !important;
    overflow: hidden;
  }

  body.page-stats_dashboard .section-title,
  body.page-admin_dashboard .section-title,
  body.page-chef .section-title,
  body.page-observations_reservations .section-title,
  body.page-suivi_kilometrage .section-title,
  body.page-chef_vehicle_monitor .section-title,
  body.page-history .section-title {
    font-size: 1.03rem !important;
    font-weight: 900 !important;
    color:#0f172a !important;
    margin-bottom: 14px !important;
  }

  /* compact stat cards */
  body.page-stats_dashboard .row.g-3,
  body.page-chef .row.g-4.mb-4,
  body.page-admin_dashboard .row.g-3,
  body.page-admin_dashboard .row.g-4 {
    display:grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }
  body.page-stats_dashboard .row.g-3 > [class*="col-"],
  body.page-chef .row.g-4.mb-4 > [class*="col-"],
  body.page-admin_dashboard .row.g-3 > [class*="col-"],
  body.page-admin_dashboard .row.g-4 > [class*="col-"] {
    width:100% !important;
    max-width:100% !important;
    padding:0 !important;
  }
  body.page-stats_dashboard .row.g-3 .card,
  body.page-chef .stat-card,
  body.page-admin_dashboard .row.g-3 .card,
  body.page-admin_dashboard .row.g-4 .card {
    min-height: 126px;
    display:flex;
    justify-content:center;
    position:relative;
  }
  body.page-stats_dashboard .row.g-3 .card:before,
  body.page-chef .stat-card:before,
  body.page-admin_dashboard .row.g-3 .card:before,
  body.page-admin_dashboard .row.g-4 .card:before {
    content:"";
    width:42px;
    height:42px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(22,163,74,.16), rgba(37,99,235,.13));
    position:absolute;
    top:14px;
    right:14px;
  }
  body.page-stats_dashboard .display-6,
  body.page-admin_dashboard .display-6,
  body.page-chef .display-6 {
    font-size: 2rem !important;
    line-height:1 !important;
    margin-top: 8px;
  }

  /* forms and filters */
  body.page-observations_reservations form.row,
  body.page-chef_vehicle_monitor form.row,
  body.page-history .history-filter-grid {
    display:grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body.page-observations_reservations .form-control,
  body.page-observations_reservations .form-select,
  body.page-chef_vehicle_monitor .form-control,
  body.page-chef_vehicle_monitor .form-select,
  body.page-history input,
  body.page-history select {
    min-height: 46px !important;
    border-radius: 14px !important;
    font-size: .95rem !important;
  }
  body.page-observations_reservations .btn,
  body.page-chef_vehicle_monitor .btn,
  body.page-history .btn,
  body.page-chef .btn,
  body.page-stats_dashboard .btn,
  body.page-admin_dashboard .btn {
    border-radius: 14px !important;
    min-height: 42px;
    font-weight: 800 !important;
    font-size: .86rem !important;
  }

  /* turn tables into readable mobile cards */
  body.page-chef .table-responsive,
  body.page-observations_reservations .table-responsive,
  body.page-suivi_kilometrage .table-responsive,
  body.page-chef_vehicle_monitor .table-responsive,
  body.page-history .table-responsive,
  body.page-stats_dashboard .table-responsive,
  body.page-admin_dashboard .table-responsive {
    overflow: visible !important;
    border:0 !important;
  }
  body.page-chef table,
  body.page-observations_reservations table,
  body.page-suivi_kilometrage table,
  body.page-chef_vehicle_monitor table,
  body.page-history table,
  body.page-stats_dashboard table,
  body.page-admin_dashboard table {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    width:100% !important;
  }
  body.page-chef thead,
  body.page-observations_reservations thead,
  body.page-suivi_kilometrage thead,
  body.page-chef_vehicle_monitor thead,
  body.page-history thead,
  body.page-stats_dashboard thead,
  body.page-admin_dashboard thead {
    display:none !important;
  }
  body.page-chef tbody,
  body.page-chef tr,
  body.page-chef td,
  body.page-observations_reservations tbody,
  body.page-observations_reservations tr,
  body.page-observations_reservations td,
  body.page-suivi_kilometrage tbody,
  body.page-suivi_kilometrage tr,
  body.page-suivi_kilometrage td,
  body.page-chef_vehicle_monitor tbody,
  body.page-chef_vehicle_monitor tr,
  body.page-chef_vehicle_monitor td,
  body.page-history tbody,
  body.page-history tr,
  body.page-history td,
  body.page-stats_dashboard tbody,
  body.page-stats_dashboard tr,
  body.page-stats_dashboard td,
  body.page-admin_dashboard tbody,
  body.page-admin_dashboard tr,
  body.page-admin_dashboard td {
    display:block !important;
    width:100% !important;
  }
  body.page-chef tr,
  body.page-observations_reservations tr,
  body.page-suivi_kilometrage tr,
  body.page-chef_vehicle_monitor tr,
  body.page-history tr,
  body.page-stats_dashboard tr,
  body.page-admin_dashboard tr {
    background:#fff !important;
    border:1px solid rgba(15,23,42,.08) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.07) !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
    overflow:hidden;
  }
  body.page-chef td,
  body.page-observations_reservations td,
  body.page-suivi_kilometrage td,
  body.page-chef_vehicle_monitor td,
  body.page-history td,
  body.page-stats_dashboard td,
  body.page-admin_dashboard td {
    border:0 !important;
    padding: 8px 0 !important;
    color:#0f172a !important;
    font-size:.92rem !important;
  }
  body.page-chef td:not(:last-child),
  body.page-observations_reservations td:not(:last-child),
  body.page-suivi_kilometrage td:not(:last-child),
  body.page-chef_vehicle_monitor td:not(:last-child),
  body.page-history td:not(:last-child),
  body.page-stats_dashboard td:not(:last-child),
  body.page-admin_dashboard td:not(:last-child) {
    border-bottom:1px solid rgba(148,163,184,.22) !important;
  }
  body.page-chef td[data-label]::before,
  body.page-observations_reservations td[data-label]::before,
  body.page-suivi_kilometrage td[data-label]::before,
  body.page-chef_vehicle_monitor td[data-label]::before,
  body.page-history td[data-label]::before,
  body.page-stats_dashboard td[data-label]::before,
  body.page-admin_dashboard td[data-label]::before {
    content: attr(data-label);
    display:block;
    color:#64748b;
    font-size:.72rem;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
    margin-bottom:3px;
  }
  body.page-chef td.text-end,
  body.page-observations_reservations td.text-end,
  body.page-chef_vehicle_monitor td.text-end,
  body.page-history td.text-end {
    text-align:left !important;
  }
  body.page-chef td:last-child .btn,
  body.page-observations_reservations td:last-child .btn,
  body.page-chef_vehicle_monitor td:last-child .btn,
  body.page-history td:last-child .btn,
  body.page-suivi_kilometrage td:last-child .btn {
    width:100%;
    margin:3px 0 !important;
  }

  /* activity/status badges */
  body.page-chef .badge,
  body.page-observations_reservations .badge,
  body.page-suivi_kilometrage .badge,
  body.page-chef_vehicle_monitor .badge,
  body.page-history .badge,
  body.page-stats_dashboard .badge,
  body.page-admin_dashboard .badge {
    border-radius: 999px !important;
    padding: .45rem .65rem !important;
    font-weight: 900 !important;
  }

  /* progress rows look like app widgets */
  body.page-stats_dashboard .progress,
  body.page-admin_dashboard .progress {
    height: 8px !important;
    border-radius: 999px !important;
    background:#e5e7eb !important;
  }
  body.page-stats_dashboard .progress-bar,
  body.page-admin_dashboard .progress-bar {
    border-radius: 999px !important;
    background: linear-gradient(90deg,#16a34a,#2e8b57) !important;
  }

  /* hide heavy export/reset buttons from the dashboard mobile header for a cleaner app view */
  body.page-stats_dashboard .d-flex.gap-2.align-items-center.flex-wrap,
  body.page-admin_dashboard .d-flex.gap-2.align-items-center.flex-wrap {
    width:100%;
  }
  body.page-stats_dashboard .d-flex.gap-2.align-items-center.flex-wrap .btn,
  body.page-admin_dashboard .d-flex.gap-2.align-items-center.flex-wrap .btn {
    flex:1 1 auto;
  }
}

/* 20260601 filters removed + compact action buttons on mobile */
@media (max-width: 768px) {
  /* Hide filter/search blocks in admin modules on phone only */
  body.page-admin_dashboard a[href*="period="],
  body.page-admin_dashboard .btn-group,
  body.page-admin_dashboard .d-flex.gap-2.align-items-center.flex-wrap,
  body.page-chef_vehicle_monitor .card:has(form[method="get"]),
  body.page-observations_reservations .card:has(form[method="get"]),
  body.page-history .card:has(form[method="get"]),
  body.page-history .history-filter-grid,
  body.page-qrcodes .card:has(form[method="get"]),
  body.page-security_logs .card:has(form[method="get"]),
  body.page-entretiens .card:has(form[method="get"]) {
    display: none !important;
  }

  /* Fallback for browsers where :has is partially supported: hide common filter forms themselves */
  body.page-chef_vehicle_monitor form[method="get"],
  body.page-observations_reservations form[method="get"],
  body.page-history form[method="get"],
  body.page-qrcodes form[method="get"],
  body.page-security_logs form[method="get"],
  body.page-entretiens form[method="get"] {
    display:none !important;
  }

  /* Do not hide useful creation/action forms */
  body.page-qrcodes form[method="post"],
  body.page-security_logs form[method="post"],
  body.page-entretiens form[method="post"],
  body.page-observations_reservations form[method="post"],
  body.page-chef_vehicle_monitor form[method="post"],
  body.page-history form[method="post"] {
    display: initial;
  }

  /* Compact mobile buttons: no huge full-width buttons inside cards/tables */
  body.page-chef .btn,
  body.page-chef_vehicle_monitor .btn,
  body.page-observations_reservations .btn,
  body.page-suivi_kilometrage .btn,
  body.page-history .btn,
  body.page-qrcodes .btn,
  body.page-security_logs .btn,
  body.page-entretiens .btn,
  body.page-admin_dashboard .btn {
    min-height: 34px !important;
    padding: 7px 10px !important;
    border-radius: 10px !important;
    font-size: .78rem !important;
    line-height: 1.15 !important;
    width: auto !important;
    max-width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
  }

  body.page-chef td:last-child .btn,
  body.page-observations_reservations td:last-child .btn,
  body.page-chef_vehicle_monitor td:last-child .btn,
  body.page-history td:last-child .btn,
  body.page-suivi_kilometrage td:last-child .btn,
  body.page-qrcodes td:last-child .btn,
  body.page-security_logs td:last-child .btn,
  body.page-entretiens td:last-child .btn {
    width: auto !important;
    min-width: 0 !important;
    margin: 2px 4px 2px 0 !important;
  }

  body.page-chef td:last-child,
  body.page-observations_reservations td:last-child,
  body.page-chef_vehicle_monitor td:last-child,
  body.page-history td:last-child,
  body.page-suivi_kilometrage td:last-child,
  body.page-qrcodes td:last-child,
  body.page-security_logs td:last-child,
  body.page-entretiens td:last-child {
    display:flex !important;
    flex-wrap:wrap !important;
    gap:6px !important;
    align-items:center !important;
  }

  body.page-chef form.d-inline,
  body.page-observations_reservations form,
  body.page-chef_vehicle_monitor form,
  body.page-history form,
  body.page-qrcodes form,
  body.page-security_logs form,
  body.page-entretiens form {
    width:auto !important;
    max-width:100% !important;
  }

  /* Smaller destructive/header buttons */
  body.page-chef_vehicle_monitor .btn-outline-danger,
  body.page-observations_reservations .btn-danger,
  body.page-history .btn-history-danger,
  body.page-qrcodes .btn-danger,
  body.page-security_logs .btn-danger,
  body.page-entretiens .btn-outline-danger {
    min-height: 32px !important;
    padding: 6px 10px !important;
    font-size: .76rem !important;
  }

  /* Cleaner card typography */
  body.page-chef td,
  body.page-chef_vehicle_monitor td,
  body.page-observations_reservations td,
  body.page-suivi_kilometrage td,
  body.page-history td,
  body.page-qrcodes td,
  body.page-security_logs td,
  body.page-entretiens td {
    font-size:.88rem !important;
    line-height:1.35 !important;
  }
}
