/* Phone-only operations workspace. Desktop and other roles keep their own layout. */
@media (max-width: 600px) {
  .mobile-admin-shell.app-shell { display: block; min-height: 100dvh; background: #f6f8f7; }
  .mobile-admin-shell > .sidebar { display: none; }
  .mobile-admin-shell > .main {
    width: 100%; min-width: 0; margin: 0; overflow: visible;
    padding: 16px 16px calc(90px + env(safe-area-inset-bottom));
  }
  .ma-header {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 56px; padding: env(safe-area-inset-top) 16px 0;
    background: #fff; border-bottom: 1px solid #e0e6e2;
  }
  .ma-header > strong { font-size: 21px; color: #176b3c; letter-spacing: 0; }
  .mobile-admin-shell :is(button, input, select, textarea) { font-size: 16px; }
  /* Phone cards use document scrolling, not the desktop fixed-height table viewport. */
  .mobile-admin-shell .requests-page:is(.is-current, .is-archive) { display: block; height: auto; min-width: 0; }
  .mobile-admin-shell .requests-page > .requests-section,
  .mobile-admin-shell .requests-page :is(.manager-current, .requests-archive) {
    display: block; flex: none; overflow: visible;
  }
  .mobile-admin-shell .requests-section {
    background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible;
  }
  .mobile-admin-shell .ma-request-heading { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .mobile-admin-shell .requests-heading { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .mobile-admin-shell .requests-heading h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: 0; }
  .mobile-admin-shell .requests-heading > span { color: #67766e; font-size: 17px; }
  .ma-heading-actions { display: flex; flex: none; gap: 2px; }
  .ma-filter-count { position: absolute; right: 0; top: 0; min-width: 18px; padding: 1px 3px; border-radius: 6px; background: #176b3c; color: #fff; font-size: 11px; }
  .ma-dates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; background: #e9efeb; border-radius: 8px; }
  .ma-dates > button, .ma-date-picker > .date-filter-trigger {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 4px;
    min-width: 0; min-height: 44px; margin: 0; padding: 0 4px;
    border: 0; border-radius: 6px; background: transparent; color: #53665c; font-size: 14px; font-weight: 600;
  }
  .ma-dates > button[aria-pressed="true"], .ma-date-picker.is-selected > .date-filter-trigger { background: #fff; color: #176b3c; box-shadow: 0 1px 3px #17392512; }
  .ma-date-picker .ui-icon { width: 16px; height: 16px; }
  .ma-date-picker > .date-filter-trigger:focus-visible { outline: 2px solid #176b3c; outline-offset: 1px; }
  .ma-date-picker .date-filter-menu { width: min(360px, calc(100vw - 32px)); border-radius: 8px; background: #fff; }
  .ma-date-picker .date-filter-grid button, .ma-date-picker .date-filter-actions button { min-height: 44px; font-size: 16px; }
  .ma-date-picker .date-filter-head button { width: 44px; height: 44px; }
  .ma-date-caption { margin: 12px 0; color: #64746b; font-size: 14px; }
  .ma-list-actions { display: grid; grid-template-columns: 1fr; gap: 8px; padding-bottom: 14px; }
  .ma-list-actions[hidden], .ma-detail-actions[hidden] { display: none; }
  .ma-list-actions button { min-height: 44px; justify-content: flex-start; }
  .mobile-admin-shell .requests-filter-panel.is-open { padding: 0 0 16px; border: 0; }
  .mobile-admin-shell .requests-filters { padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-admin-shell .requests-filters .request-search-field,
  .mobile-admin-shell .requests-filters .request-attachments-filter { grid-column: 1 / -1; }
  .mobile-admin-shell .requests-filters :is(input:not([type="checkbox"]), .filter-dropdown-trigger, .date-filter-trigger) { min-height: 44px; }
  .mobile-admin-shell .request-table-wrap.ma-request-list { overflow: visible; overscroll-behavior: auto; max-height: none; display: grid; align-content: start; gap: 12px; border: 0; }
  .ma-attention { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: #8b6108; padding: 0 0 2px; }
  .ma-attention b { margin-left: 3px; }
  .ma-attention .ma-overdue { color: #b23a37; }
  .ma-request-card { position: relative; isolation: isolate; min-width: 0; padding: 16px; background: #fff; border: 1px solid #dbe4de; border-radius: 8px; }
  .ma-request-card:has(.ma-request-link:focus-visible) { outline: 2px solid #176b3c; outline-offset: 2px; }
  .ma-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .ma-schedule { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .ma-time-number { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .ma-time-number > strong { flex: none; font-size: 22px; line-height: 1.2; white-space: nowrap; }
  .ma-time-number > .ma-no-time { font-size: 14px; }
  .ma-schedule > span { font-size: 12px; color: #64746b; }
  .ma-card-head .badge { flex: none; max-width: 40%; white-space: normal; text-align: center; font-size: 12px; padding: 5px 8px; border-radius: 5px; }
  .ma-request-link { display: block; min-width: 0; min-height: 26px; padding: 2px 0; background: none; border: 0; text-align: left; color: #64746b; font-size: 13px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ma-request-link::after { position: absolute; content: ""; inset: 0; z-index: 1; border-radius: 8px; }
  .ma-request-card .ma-route { padding: 12px 0; }
  .ma-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #edf0ee; padding-top: 4px; }
  .ma-assignee { display: grid; gap: 4px; min-width: 0; flex: 1; }
  .ma-assignee-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: #53665c; }
  .ma-driver-summary, .ma-vehicle-summary { display: flex; align-items: center; gap: 5px; min-width: 0; }
  .ma-driver-summary { flex: 0 1 auto; }
  .ma-vehicle-summary { flex: none; max-width: 60%; font-size: 13px; }
  .ma-assignee-row .ui-icon { flex: 0 0 16px; width: 16px; height: 16px; }
  .ma-assignee-row :is(.request-driver-name, .ma-unassigned, .ma-vehicle-summary > span) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ma-assignee .request-driver-name { display: block; position: relative; z-index: 2; max-width: 100%; min-height: 44px; padding: 0; text-align: left; font-size: 14px; line-height: 44px; }
  .ma-assignee small { font-size: 12px; color: #6b776f; overflow-wrap: anywhere; }
  .ma-assignee .ma-unassigned { color: #8b6108; font-size: 14px; }
  .ma-request-card .driver-acceptance-indicator { position: relative; z-index: 2; width: 44px; height: 44px; flex: 0 0 44px; }
  .ma-unread { color: #2b668a; font-size: 12px; margin-top: 10px; }
  .ma-unread:empty { display: none; }
  .ma-empty { text-align: center; padding: 40px 16px; color: #63756b; }
  .ma-empty > svg { width: 32px; height: 32px; }
  .mobile-admin-shell .request-pagination { flex-wrap: wrap; gap: 12px; padding: 16px 0; }
  .mobile-admin-shell .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-admin-shell .topbar { gap: 12px; }
  .mobile-admin-shell .page-title { font-size: 24px; }
  .mobile-admin-shell .section { box-shadow: none; }
  body:has(.mobile-admin-shell) > .modal-backdrop:not(.login-dialog-backdrop) { padding: 8px; }
  body:has(.mobile-admin-shell) .modal :is(input, select, textarea) { font-size: 16px; min-height: 44px; }
  body:has(.mobile-admin-shell) .modal .btn { min-height: 44px; white-space: normal; }
  body:has(.mobile-admin-shell) > .app-toast { z-index: 1100; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); }
}

.ma-icon {
  display: inline-flex; position: relative; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 44px; padding: 10px; border: 0; border-radius: 7px;
  color: #54685d; background: transparent; text-decoration: none;
}
.ma-icon:hover { background: #e9efeb; }
.ma-icon.ma-primary { background: #176b3c; color: white; }
.ma-icon .ui-icon { width: 22px; height: 22px; }
.ma-bottom-nav {
  position: fixed; left: 0; bottom: 0; right: 0; z-index: 30;
  display: flex; min-height: 64px; padding: 4px 8px max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid #dbe4de; background: #fff;
}
.ma-bottom-nav > button {
  display: flex; flex: 1 1 0; min-width: 0; min-height: 54px; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent;
  color: #65746b; font-size: 11px; font-weight: 600; padding: 6px 2px;
}
.ma-bottom-nav > button .ui-icon { width: 23px; height: 23px; }
.ma-bottom-nav > button[aria-current="page"] { color: #176b3c; }
.ma-bottom-nav > button[aria-current="page"] .ui-icon { background: #eaf4ed; box-shadow: 0 0 0 6px #eaf4ed; border-radius: 3px; }
.ma-dialog { color: #233c2e; font-size: 16px; }
.ma-dialog .ui-icon { flex: none; }
.ma-dialog-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px; background: #fff; border-bottom: 1px solid #e3e9e5;
}
.ma-dialog-header h2 { font-size: 22px; margin: 0; }
.ma-dialog-header .ma-back { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: #176b3c; font-size: 16px; }
.modal.ma-menu-dialog { max-width: 600px; padding: 0; border-radius: 8px; }
.ma-profile { display: grid; gap: 6px; padding: 16px; }
.ma-profile span { color: #6b776f; font-size: 14px; }
.ma-menu { display: grid; padding: 0 8px; }
.ma-menu > button, .ma-menu-logout {
  display: flex; gap: 12px; align-items: center; min-height: 48px; text-align: left;
  border: 0; border-radius: 6px; background: transparent; color: #314b3d; padding: 12px; font-size: 16px;
}
.ma-menu > button.active { background: #eaf4ed; color: #176b3c; }
.ma-menu > button b { font-weight: 500; }
.ma-menu-logout { margin: 8px; }
.modal.ma-detail-dialog {
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: #fff;
  display: flex; flex-direction: column; overflow: hidden;
}
.ma-detail-dialog > .ma-bottom-nav { position: static; flex: none; }
.ma-detail-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 16px; }
.ma-detail-summary h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: 0; }
.ma-detail-summary p { margin: 0 0 12px; color: #64746b; }
.ma-detail-summary .badge { margin-right: 8px; font-size: 13px; }
.ma-detail-summary .driver-acceptance { margin: 16px 0 0; }
.ma-detail-summary .driver-acceptance-status { min-height: 44px; text-align: left; }
.ma-route { display: grid; gap: 14px; }
.ma-detail-scroll > .ma-route { padding: 20px 0; border-bottom: 1px solid #e5ebe7; }
.ma-stop { display: grid; gap: 4px; min-width: 0; padding-left: 12px; border-left: 2px solid #a5bbae; line-height: 1.4; }
.ma-stop:last-child { border-left-color: #328354; }
.ma-stop > strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ma-stop > span:not(.ma-label) { font-size: 16px; color: #394e42; overflow-wrap: anywhere; }
.ma-label { font-size: 12px; color: #6a7c70; }
.ma-detail-section { padding: 18px 0; border-bottom: 1px solid #e5ebe7; overflow-wrap: anywhere; }
.ma-detail-section h2 { font-size: 17px; margin: 0 0 10px; }
.ma-driver { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ma-driver strong { min-width: 0; font-weight: 500; }
.ma-detail-section .request-vehicle-summary { margin-top: 8px; color: #65776b; font-size: 14px; }
.ma-detail-section summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; }
.ma-detail-section summary::-webkit-details-marker { display: none; }
.ma-detail-section summary small { display: block; margin-top: 6px; font-size: 14px; color: #65776b; font-weight: 400; }
.ma-detail-section[open] summary > svg { transform: rotate(180deg); }
.ma-detail-section dl { display: grid; gap: 12px; }
.ma-detail-section dd { margin: 4px 0 0; }
.ma-detail-section dt { color: #65776b; font-size: 13px; }
.ma-comment { white-space: pre-wrap; }
.ma-history { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid #edf0ee; font-size: 14px; }
.ma-history > small { color: #65776b; }
.ma-detail-actions { display: grid; gap: 10px; padding: 0 0 20px; }
.ma-detail-actions[hidden] { display: none; }
.ma-detail-actions label { display: grid; gap: 8px; font-size: 14px; }
.ma-detail-actions select { width: 100%; min-height: 44px; font-size: 16px; }
.ma-detail-footer { padding: 12px 20px; border-top: 1px solid #e5ebe7; background: #fff; }
.ma-detail-footer .btn { width: 100%; min-height: 48px; border-radius: 7px; font-size: 16px; white-space: normal; }
.ma-dialog :is(button, a, summary):focus-visible, .mobile-admin-shell :is(button, a):focus-visible { outline: 2px solid #176b3c; outline-offset: 2px; }
@media (min-width: 601px) {
  .mobile-admin-shell > .ma-header, .mobile-admin-shell > .ma-bottom-nav { display: none; }
}
