/* MOBILE BREAKPOINT: max-width: 767.98px */
/* dev-scheduler-mobile.css — Logistics & Dispatch Scheduler Mobile Overrides (<768px) */

.scheduler-mobile-tabs {
  display: none !important;
}

@media (max-width: 767.98px) {
  /* Navigation Bar */
  .crm-nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .crm-nav-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .crm-nav-actions .btn-nav-storefront {
    flex: 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }

  /* Container & Layout */
  .scheduler-container {
    padding: 12px 16px 24px 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .hub-header {
    margin-bottom: 1rem;
  }

  .hub-header h1 {
    font-size: 1.5rem;
  }

  /* Controls Bar */
  .control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .filter-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }

  .pill-group {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .pill-btn {
    flex: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-sizing: border-box;
  }

  .date-input {
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
  }

  /* 4-Tab Segmented Bar */
  .scheduler-mobile-tabs {
    display: flex !important;
    align-items: center;
    background: var(--paper-2, #E6E4DD);
    border: 1px solid var(--line-paper-strong, rgba(31,42,68,0.2));
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .scheduler-tab-btn {
    flex: 1;
    min-height: 44px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-dk-dim, #3E4B65);
    font-family: var(--sans, 'Figtree', sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0 4px;
  }

  .scheduler-tab-btn.active {
    background: var(--navy, #162035);
    color: var(--paper, #F3F2EE);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  }

  /* Split View Single Column */
  .dispatch-split-view {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Remove sticky positioning on mobile so map/content flows naturally */
  .dispatch-split-view .card-panel {
    position: static !important;
    top: auto !important;
    margin-bottom: 12px;
  }

  /* Map Container Height: 60svh */
  #scheduler-map {
    height: 60svh !important;
    min-height: 320px;
    width: 100%;
    border-radius: 8px;
  }

  /* Touch Targets for Action Buttons */
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
    box-sizing: border-box;
  }

  /* Route Planner / Modal on Mobile */
  .modal-backdrop {
    padding: 8px;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 8px !important;
  }

  .modal-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
  }

  /* Route Timeline Vertical Layout */
  .journey-stepper {
    padding: 10px;
  }

  .journey-log-timeline {
    padding-left: 8px;
    gap: 8px;
  }

  .journey-log-entry {
    flex-direction: column;
    gap: 2px;
  }

  .route-stop-item {
    padding: 10px;
  }

  .btn-move-stop-up,
  .btn-move-stop-down,
  .btn-remove-stop {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Employee Profile Drawer (100% width on mobile) */
  #employee-profile-drawer-backdrop .drawer-panel,
  .drawer-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
  }

  .drawer-close-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.75rem !important;
  }

  .drawer-tab-btn {
    min-height: 44px !important;
  }

  /* Staff Directory Cards & Actions */
  .staff-card {
    padding: 14px !important;
  }

  .staff-actions {
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  .staff-actions button {
    width: 100% !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
  }

  /* Mobile Shift Planner Single-Day View */
  .planner-mobile-day-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    background: var(--paper-2) !important;
    border: 1px solid var(--line-paper-strong) !important;
    border-radius: var(--radius-md) !important;
    padding: 8px 12px !important;
  }

  .planner-mobile-day-btn {
    min-height: 44px !important;
    padding: 6px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 600 !important;
  }

  .planner-mobile-kpi-card {
    background: var(--paper-2) !important;
    border: 1px solid var(--line-paper-strong) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
  }

  .planner-mobile-staff-card {
    background: #FFF !important;
    border: 1px solid var(--line-paper-strong) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
    box-shadow: var(--shadow-sm) !important;
  }

  .planner-mobile-staff-card .btn-profile-peek {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 6px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .planner-mobile-staff-card .btn-cell-summary {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 6px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .planner-mobile-weekly-totals {
    margin-top: 16px !important;
    background: var(--paper-2) !important;
    border: 1px solid var(--line-paper-strong) !important;
    border-radius: var(--radius-md) !important;
    padding: 8px 12px !important;
  }

  .planner-mobile-weekly-totals summary {
    font-weight: 700 !important;
    font-size: 14px !important;
    color: var(--ink-dk) !important;
    cursor: pointer !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }
}
