/* TORVIQO operational dashboard. Existing map and request behavior is retained. */
.app-shell .dashboard-page.torviqo-dashboard {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  gap: 20px;
}
.dashboard-page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dashboard-page-header h1 { font-size: 26px; line-height: 1.3; font-weight: 600; letter-spacing: -.7px; }
.dashboard-page-header p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 4px 0 0; }
.dashboard-date { display: inline-flex; align-items: center; flex-shrink: 0; gap: 10px; padding: 10px 13px; font-size: 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; white-space: nowrap; }
.dashboard-date .ui-icon { width: 17px; height: 17px; }
.torviqo-dashboard .dashboard-kpis { grid-area: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.torviqo-dashboard .dashboard-kpi {
  display: flex; flex-direction: row; justify-content: flex-start; align-items: center;
  height: 106px; min-height: 106px; padding: 18px; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px #14223802; text-align: left;
}
.torviqo-dashboard .dashboard-kpi-icon { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 11px; color: var(--brand); background: #edf7f1; }
.torviqo-dashboard .dashboard-kpi-icon .ui-icon { width: 26px; height: 26px; }
.torviqo-dashboard .dashboard-kpi > div:not(.dashboard-kpi-icon) { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.torviqo-dashboard .dashboard-kpi span { display: block; height: auto; width: auto; line-height: 1.3; color: #5e7088; font-size: 12px; text-align: left; text-wrap: initial; }
.torviqo-dashboard .dashboard-kpi-value { display: flex; align-items: center; gap: 14px; width: 100%; }
.torviqo-dashboard .dashboard-kpi strong { color: #111e32; font-size: 30px; font-weight: 600; line-height: 1.1; }
.torviqo-dashboard .dashboard-kpi small { color: #7a8ba0; font-size: 10px; line-height: 1.4; border-left: 1px solid #dde5ec; padding-left: 12px; max-width: 116px; }
.torviqo-dashboard .dashboard-kpi.is-alert { background: #fff; border-color: var(--line); }
.torviqo-dashboard .dashboard-kpi.is-alert .dashboard-kpi-icon { color: #e34450; background: #fff1f2; }
.torviqo-dashboard .dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: auto; grid-template-areas: none; gap: 20px; height: auto; min-height: 0; }
.dashboard-primary-column, .dashboard-right-column { display: flex; flex-direction: column; min-width: 0; gap: 18px; }
.torviqo-dashboard .dashboard-card { border: 1px solid var(--line); border-radius: 10px; box-shadow: none; background: #fff; grid-area: auto; }
.torviqo-dashboard .dashboard-card-head { height: 52px; flex-direction: row; align-items: center; padding: 12px 17px; gap: 10px; border-bottom: 0; background: #fff; }
.torviqo-dashboard h2 { font-size: 14px; line-height: 1.4; font-weight: 600; color: #152239; }
.dashboard-text-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; color: #077245; padding: 5px 0; font-size: 11px; font-weight: 600; white-space: nowrap; }
.dashboard-text-link:hover { color: #044c30; text-decoration: underline; }
.dashboard-text-link .ui-icon { width: 16px; height: 16px; }
.dashboard-text-link:focus-visible, .dashboard-status-tabs button:focus-visible { outline: 3px solid #9ddbbb; outline-offset: 3px; border-radius: 4px; }
.dashboard-count { color: #8b98a9; font-size: 11px; margin-left: 5px; font-weight: 400; }
.torviqo-dashboard .dashboard-map-card { height: 348px; min-height: 348px; display: flex; flex-direction: column; }
.torviqo-dashboard .dashboard-map-heading { flex: 0 0 49px; min-height: 49px; height: auto; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.dashboard-map-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dashboard-map-title h2 { font-size: 13px; }
.dashboard-map-title > span { padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; white-space: nowrap; }
.torviqo-dashboard .dashboard-map-wrap { height: auto; flex: 1; min-height: 0; }
.torviqo-dashboard .dashboard-fleet-map { height: 100%; min-height: 0; border-radius: 0; background: #e9f0ed; }
.torviqo-dashboard .leaflet-tile-pane { filter: saturate(.65); opacity: .87; }
.torviqo-dashboard .dashboard-map-empty { height: 100%; min-height: 0; display: grid; place-items: center; padding: 24px; background: #eff5f2; color: var(--muted); font-size: 13px; text-align: center; }
.torviqo-dashboard .dashboard-map-overlay-actions { top: auto; bottom: 14px; left: 14px; right: auto; max-width: calc(100% - 70px); width: auto; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
.torviqo-dashboard .dashboard-map-overlay-actions .btn { width: auto; flex: 0 0 auto; min-height: 32px; padding: 6px 9px; font-size: 10px; background: #fff; box-shadow: 0 1px 5px #20332412; }
.torviqo-dashboard .dashboard-map-overlay-actions .btn .ui-icon { width: 14px; height: 14px; }
.torviqo-dashboard .dashboard-notice { position: static; min-height: 0; max-width: 100%; padding: 7px 10px; font-size: 10px; border-radius: 6px; background: #f0f8f3; backdrop-filter: none; box-shadow: none; }
.torviqo-dashboard .dashboard-notice.is-error { color: #ba3b44; background: #fff2f3; border-color: #f4d6d9; box-shadow: none; }
.torviqo-dashboard .dashboard-map-overlay-actions .dashboard-gps-btn.is-error { background: #fff2f3; }
.torviqo-dashboard .dashboard-map-card .leaflet-top.leaflet-left { top: 10px; left: auto; right: 10px; }
.torviqo-dashboard .leaflet-control-zoom { margin: 0; border: 1px solid #e2e8e5; box-shadow: 0 1px 5px #20332412; border-radius: 6px; overflow: hidden; }
.torviqo-dashboard .leaflet-control-zoom a { width: 29px; height: 29px; line-height: 29px; font-size: 19px; color: #23364a; }
.torviqo-dashboard .vehicle-map-label { height: 30px; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 7px; font-size: 11px; box-shadow: 0 2px 6px #12362422; }
.torviqo-dashboard .vehicle-map-label__badge { width: 22px; height: 22px; border-radius: 5px; box-shadow: none; }
.torviqo-dashboard .vehicle-map-label__badge svg { width: 15px; height: 15px; }
.torviqo-dashboard .vehicle-route-popup-content { font-family: Manrope, system-ui, sans-serif; gap: 5px; }
.torviqo-dashboard .fleet-map .vehicle-route-popup .leaflet-popup-content-wrapper,
.torviqo-dashboard .fleet-map .vehicle-route-popup .leaflet-popup-tip { background: #fff; backdrop-filter: none; }
.torviqo-dashboard .fleet-map .vehicle-route-popup .leaflet-popup-content { font-size: 11px; max-height: 166px; overflow: auto; }
.torviqo-dashboard .vehicle-route-popup-content > strong { color: #162b3f; font-size: 13px; }
.torviqo-dashboard .vehicle-route-popup-status { color: #087f4a; font-weight: 600; }
.torviqo-dashboard .gps-provider-legend { top: 12px; bottom: auto; right: 50px; max-width: calc(100% - 110px); }
.torviqo-dashboard .gps-provider-legend span { padding: 4px 7px; font-size: 9px; box-shadow: none; }
.torviqo-dashboard .dashboard-map-card.is-fullscreen { position: fixed; inset: 20px; height: auto; min-height: 0; z-index: 1200; box-shadow: 0 0 0 30px #10291f70; }
.torviqo-dashboard .dashboard-map-card.is-fullscreen .dashboard-map-wrap { height: auto; }
.torviqo-dashboard .dashboard-map-card.is-fullscreen .dashboard-fleet-map { height: 100%; }
.app-shell.torviqo-shell .main:has(.dashboard-map-card.is-fullscreen) { z-index: 100; }
.torviqo-dashboard .dashboard-trips-card { display: flex; flex-direction: column; height: auto; min-height: 220px; }
.torviqo-dashboard .dashboard-trips-card .dashboard-card-head { flex-shrink: 0; }
.torviqo-dashboard #dashboardUpcoming { display: block; }
.torviqo-dashboard .dashboard-trips-table-wrap { max-height: 340px; min-height: 0; padding: 0 12px 8px; overflow: auto; scrollbar-gutter: auto; }
.torviqo-dashboard .dashboard-trips-table { display: table; width: 100%; min-width: 620px; table-layout: fixed; border-collapse: collapse; }
.torviqo-dashboard .dashboard-trips-table thead { display: table-header-group; }
.torviqo-dashboard .dashboard-trips-table tbody { display: table-row-group; }
.torviqo-dashboard .dashboard-trips-table tr { display: table-row; background: transparent; box-shadow: none; border: 0; }
.torviqo-dashboard .dashboard-trips-table th, .torviqo-dashboard .dashboard-trips-table td { display: table-cell; padding: 10px 7px; text-align: left; vertical-align: middle; border: 0; border-bottom: 1px solid #edf1f5; border-radius: 0; font-size: 10px; line-height: 1.4; }
.torviqo-dashboard .dashboard-trips-table th { position: sticky; top: 0; background: #f5f7f9; color: #61728b; font-size: 10px; font-weight: 400; text-transform: none; z-index: 2; }
.torviqo-dashboard .dashboard-trips-table th:nth-child(1), .torviqo-dashboard .dashboard-trips-table td:nth-child(1) { width: 12%; }
.torviqo-dashboard .dashboard-trips-table th:nth-child(2), .torviqo-dashboard .dashboard-trips-table td:nth-child(2) { width: 13%; }
.torviqo-dashboard .dashboard-trips-table th:nth-child(3), .torviqo-dashboard .dashboard-trips-table td:nth-child(3) { width: 29%; }
.torviqo-dashboard .dashboard-trips-table th:nth-child(4), .torviqo-dashboard .dashboard-trips-table td:nth-child(4) { width: 15%; }
.torviqo-dashboard .dashboard-trips-table th:nth-child(5), .torviqo-dashboard .dashboard-trips-table td:nth-child(5) { width: 16%; }
.torviqo-dashboard .dashboard-trips-table th:nth-child(6), .torviqo-dashboard .dashboard-trips-table td:nth-child(6) { width: 15%; }
.torviqo-dashboard .dashboard-trips-table td::before { display: none; }
.torviqo-dashboard .dashboard-trips-table tr td { background: #fff; }
.torviqo-dashboard .dashboard-trips-table tbody tr:hover td { background: #f7fbf9; }
.torviqo-dashboard .dashboard-trips-table tr.dashboard-trip-overdue td { background: #fff9f9; color: var(--ink); }
.torviqo-dashboard .dashboard-trip-date-values, .torviqo-dashboard .dashboard-trip-value { display: grid; gap: 2px; }
.torviqo-dashboard .dashboard-trip-date-values span + span { color: var(--muted); font-size: 10px; }
.torviqo-dashboard .dashboard-route-btn { display: block; padding: 0; width: 100%; line-height: 1.4; text-align: left; background: transparent; }
.torviqo-dashboard .dashboard-route-btn strong { font-size: 11px; color: #20364d; line-height: 1.4; font-weight: 500; display: block; }
.torviqo-dashboard .dashboard-route-btn span { font-size: 9px; line-height: 1.4; color: #8794a5; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.torviqo-dashboard .dashboard-trip-unassigned { color: #8b97a7; font-size: 10px; font-weight: 400; }
.torviqo-dashboard .dashboard-department-stack { display: block; }
.torviqo-dashboard .dashboard-department-badge { display: inline; padding: 0; border: 0; background: transparent; color: #53667e; border-radius: 0; font-size: 10px; font-weight: 400; line-height: 1.4; white-space: normal; }
.torviqo-dashboard .dashboard-vehicle-plate { color: var(--muted); font-size: 9px; }
.torviqo-dashboard .dashboard-trip-status .badge { font-size: 9px; padding: 4px 6px; min-height: 0; white-space: nowrap; }
.torviqo-dashboard .dashboard-trips-table tr.dashboard-trip-overdue .dashboard-route-btn strong { color: #20364d; }
.torviqo-dashboard .dashboard-trips-table tr.dashboard-trip-overdue .dashboard-route-btn span,
.torviqo-dashboard .dashboard-trips-table tr.dashboard-trip-overdue .dashboard-trip-unassigned { color: #8794a5; }
.torviqo-dashboard .dashboard-empty-state { min-height: 170px; padding: 28px; display: flex; justify-content: center; align-items: center; flex-direction: column; text-align: center; gap: 8px; }
.torviqo-dashboard .dashboard-empty-state strong { font-size: 13px; }
.torviqo-dashboard .dashboard-empty-state span { font-size: 12px; }
.dashboard-status-tabs { display: flex; background: #f3f6f8; border-radius: 7px; padding: 3px; margin: 0 18px 4px; max-width: 225px; }
.dashboard-status-tabs button { flex: 1; background: transparent; color: #5e7088; padding: 7px 10px; border-radius: 5px; font-size: 11px; }
.dashboard-status-tabs button[aria-selected=true] { background: #e3f3e9; color: #087844; font-weight: 600; }
.dashboard-status-chart { display: flex; align-items: center; justify-content: center; gap: 19px; padding: 23px 18px 25px; min-height: 188px; }
.dashboard-donut { width: 136px; height: 136px; flex: 0 0 136px; border-radius: 50%; background: var(--donut-fill); display: grid; place-items: center; }
.dashboard-donut > div { background: #fff; border-radius: 50%; width: 103px; height: 103px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; }
.dashboard-donut strong { font-size: 28px; font-weight: 600; color: #132238; line-height: 1.2; }
.dashboard-donut span { font-size: 10px; color: #6e7e94; }
.dashboard-status-legend { list-style: none; display: grid; gap: 15px; padding: 0; margin: 0; flex: 1; }
.dashboard-status-legend li { display: grid; grid-template-columns: 8px minmax(55px, 1fr) auto 25px; gap: 7px; align-items: center; font-size: 10px; color: #354961; white-space: nowrap; }
.dashboard-status-legend i { width: 8px; height: 8px; border-radius: 50%; }
.dashboard-status-legend strong { font-size: 11px; color: #17283e; font-weight: 600; }
.dashboard-status-legend small { font-size: 9px; color: #7e8ea3; text-align: right; }
.dashboard-panel-message { min-height: 188px; display: flex; justify-content: center; align-items: center; gap: 12px; flex-direction: column; color: var(--muted); font-size: 12px; padding: 20px; }
.dashboard-plan-card { padding: 18px; }
.dashboard-plan-heading { display: flex; gap: 12px; justify-content: space-between; }
.dashboard-plan-heading time { display: flex; align-items: center; gap: 9px; margin-top: 9px; color: #74849a; font-size: 11px; }
.dashboard-plan-heading time .ui-icon { width: 16px; height: 16px; }
.dashboard-plan-items { margin-top: 17px; }
.dashboard-plan-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.dashboard-plan-item + .dashboard-plan-item { border-top: 1px solid #edf1f5; }
.dashboard-plan-item > span { display: grid; place-items: center; width: 40px; height: 42px; flex: 0 0 40px; background: #eaf5ee; color: #188253; border-radius: 8px; }
.dashboard-plan-item .ui-icon { width: 20px; height: 20px; }
.dashboard-plan-item strong, .dashboard-plan-item small { display: block; }
.dashboard-plan-item strong { font-size: 12px; font-weight: 500; color: #233950; }
.dashboard-plan-item small { font-size: 10px; color: #8190a4; margin-top: 5px; line-height: 1.4; }
.torviqo-dashboard .dashboard-plan-send { display: flex; width: 100%; min-height: 38px; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; }
.dashboard-plan-caption { color: #8693a5; font-size: 9px; text-align: center; margin: 8px 0 0; }
@media (min-width: 1650px) {
  .torviqo-dashboard .dashboard-main-grid { grid-template-columns: minmax(0, 1fr) 370px; }
  .torviqo-dashboard .dashboard-map-card { height: 390px; }
  .dashboard-status-chart { gap: 24px; padding-block: 30px; }
  .dashboard-status-legend li { font-size: 11px; }
  .torviqo-dashboard .dashboard-trips-table th, .torviqo-dashboard .dashboard-trips-table td { font-size: 12px; padding-block: 12px; }
  .torviqo-dashboard .dashboard-route-btn strong { font-size: 12px; }
}
@media (min-width: 1101px) {
  .torviqo-dashboard .dashboard-trips-table th, .torviqo-dashboard .dashboard-trips-table td { font-size: 11px; }
  .torviqo-dashboard .dashboard-route-btn strong { font-size: 12px; }
  .torviqo-dashboard .dashboard-route-btn span { font-size: 10px; }
}
@media (max-width: 1350px) and (min-width: 1101px) {
  .torviqo-dashboard .dashboard-main-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
  .torviqo-dashboard .dashboard-kpi { gap: 10px; padding: 13px; }
  .torviqo-dashboard .dashboard-kpi-icon { width: 40px; height: 44px; flex-basis: 40px; }
  .torviqo-dashboard .dashboard-kpi small { display: none; }
  .dashboard-status-chart { gap: 14px; padding-inline: 14px; }
  .dashboard-donut { width: 114px; height: 114px; flex-basis: 114px; }
  .dashboard-donut > div { width: 86px; height: 86px; }
  .dashboard-status-legend li { gap: 5px; }
  .dashboard-map-title { display: block; }
  .dashboard-map-title > span { border: 0; padding: 0; }
}
@media (max-width: 1100px) {
  .torviqo-dashboard .dashboard-main-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
  .torviqo-dashboard .dashboard-kpi { padding: 13px; gap: 11px; }
  .torviqo-dashboard .dashboard-kpi-icon { width: 40px; height: 44px; flex-basis: 40px; }
  .torviqo-dashboard .dashboard-kpi small { display: none; }
  .dashboard-status-chart { padding-inline: 14px; gap: 12px; }
  .dashboard-donut { width: 116px; height: 116px; flex-basis: 116px; }
  .dashboard-donut > div { width: 88px; height: 88px; }
  .dashboard-map-title { display: block; }
  .dashboard-map-title > span { border: 0; padding: 0; }
}
@media (max-width: 850px) {
  .torviqo-dashboard .dashboard-main-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-right-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .dashboard-status-chart { flex-direction: column; }
  .dashboard-status-legend { width: 100%; }
  .torviqo-dashboard .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .torviqo-dashboard .dashboard-kpi { height: 94px; min-height: 94px; padding: 16px; }
  .torviqo-dashboard .dashboard-kpi small { display: block; }
  .dashboard-page-header h1 { font-size: 23px; }
  .dashboard-page-header p { font-size: 12px; }
  .dashboard-date { font-size: 10px; padding: 9px; }
}
@media (max-width: 600px) {
  .app-shell .dashboard-page.torviqo-dashboard { gap: 16px; }
  .dashboard-page-header { align-items: flex-start; flex-direction: column; gap: 11px; }
  .dashboard-page-header h1 { font-size: 22px; }
  .dashboard-date { font-size: 11px; padding: 7px 10px; }
  .torviqo-dashboard .dashboard-kpis { gap: 10px; }
  .torviqo-dashboard .dashboard-kpi { height: 100px; min-height: 100px; gap: 9px; padding: 12px; }
  .torviqo-dashboard .dashboard-kpi-icon { width: 32px; height: 36px; flex-basis: 32px; border-radius: 7px; }
  .torviqo-dashboard .dashboard-kpi-icon .ui-icon { width: 21px; height: 21px; }
  .torviqo-dashboard .dashboard-kpi span { font-size: 10px; min-height: 26px; }
  .torviqo-dashboard .dashboard-kpi strong { font-size: 26px; }
  .torviqo-dashboard .dashboard-kpi small { display: none; }
  .torviqo-dashboard .dashboard-map-card { height: 340px; min-height: 340px; }
  .torviqo-dashboard .dashboard-map-heading { padding: 10px 12px; }
  .dashboard-map-title h2 { font-size: 11px; }
  .dashboard-map-heading .dashboard-text-link { font-size: 10px; }
  .dashboard-map-heading .dashboard-text-link .ui-icon { width: 13px; }
  .dashboard-right-column { display: flex; align-items: stretch; }
  .dashboard-status-chart { flex-direction: row; gap: 22px; }
  .dashboard-status-legend { width: auto; }
  .torviqo-dashboard .dashboard-trips-table-wrap { max-height: 370px; padding-inline: 12px; }
  .torviqo-dashboard .dashboard-trips-table { display: block; min-width: 0; }
  .torviqo-dashboard .dashboard-trips-table thead { display: none; }
  .torviqo-dashboard .dashboard-trips-table tbody { display: block; }
  .torviqo-dashboard .dashboard-trips-table tr { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .torviqo-dashboard .dashboard-trips-table td { display: block; width: auto !important; min-width: 0; padding: 5px 7px; border: 0; }
  .torviqo-dashboard .dashboard-trips-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 1; }
  .torviqo-dashboard .dashboard-trips-table td:nth-child(6) { display: flex; align-items: center; }
  .torviqo-dashboard .dashboard-trips-table td:nth-child(4)::before { content: var(--table-label-driver, "Driver"); display: block; font-size: 9px; color: var(--muted); margin-bottom: 3px; }
  .torviqo-dashboard .dashboard-trips-table td:nth-child(5)::before { content: var(--table-label-vehicle, "Vehicle"); display: block; font-size: 9px; color: var(--muted); margin-bottom: 3px; }
  .torviqo-dashboard .dashboard-route-btn strong { font-size: 12px; }
  .torviqo-dashboard .dashboard-route-btn span { font-size: 10px; }
  .torviqo-dashboard .dashboard-trip-date-values { display: flex; gap: 7px; }
  .torviqo-dashboard .dashboard-map-card.is-fullscreen { inset: 8px; }
}
@media (max-width: 350px) {
  .torviqo-dashboard .dashboard-kpis { grid-template-columns: 1fr; }
  .torviqo-dashboard .dashboard-kpi { height: 85px; min-height: 85px; padding: 16px; gap: 16px; }
  .torviqo-dashboard .dashboard-kpi span { min-height: 0; font-size: 12px; }
  .dashboard-status-chart { gap: 12px; padding-inline: 12px; }
  .dashboard-donut { width: 102px; height: 102px; flex-basis: 102px; }
  .dashboard-donut > div { width: 78px; height: 78px; }
  .dashboard-status-legend li { gap: 5px; font-size: 9px; }
}
