/* Responsive layout: desktop, tablet and mobile */
.delivery-cards .metric-icon { width: 54px; height: 54px; font-size: 0; background-image: url("delivery-status-3d-sprite.png"); background-repeat: no-repeat; background-size: 400% auto; background-position: 0 center; border-radius: 12px; }
.delivery-cards .stat-strip:nth-child(2) .metric-icon { background-position: 33.333% center; }
.delivery-cards .stat-strip:nth-child(3) .metric-icon { background-position: 66.666% center; }
.delivery-cards .stat-strip:nth-child(4) .metric-icon { background-position: 100% center; }
.dark-theme .delivery-cards .metric-icon { background-color: transparent; }
@media (max-width: 1200px) {
  .page-content { padding-left: 28px; padding-right: 28px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .driver-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .page-content { padding: 26px 20px 45px; }
  .topbar { padding: 0 20px; }
  .metric-grid, .delivery-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .product-grid, .driver-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crew-rules, .admin-grid { grid-template-columns: 1fr 1fr; }
  .crew-row { align-items: flex-start; flex-wrap: wrap; }
  .crew-people { min-width: 220px; }
  .shift-route { margin-left: 53px; }
  .crew-earnings { margin-left: auto; }
  .payout-sheets { grid-template-columns: 1fr; }
  .messages-layout { height: 610px; }
  .conversation-list { width: 40%; }
}

@media (max-width: 680px) {
  body { padding-bottom: 72px; }
  .mobile-bottom-nav { position: fixed; z-index: 10; left: 10px; right: 10px; bottom: 10px; height: 60px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 28px rgba(35,48,80,.16); backdrop-filter: blur(12px); padding: 4px; }
  .mobile-bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #9aa5b5; border-radius: 10px; min-width: 0; }
  .mobile-bottom-nav button.active { color: var(--blue); background: #eef2ff; }
  .mobile-bottom-nav button span { font-size: 19px; line-height: 20px; }
  .mobile-bottom-nav button small { font-size: 9px; }
  .dark-theme .mobile-bottom-nav { background: rgba(27,36,52,.96); }
  .dark-theme .mobile-bottom-nav button.active { background: #27345a; }
  .sidebar { display: none; }
  .topbar { height: 62px; padding: 0 15px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font: 800 17px Manrope; }
  .breadcrumbs { display: none; }
  .topbar-actions { gap: 11px; }
  .page-content { padding: 23px 14px 40px; }
  .page-heading { display: block; margin-bottom: 22px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading .primary-button { margin-top: 17px; }
  .metric-grid, .delivery-cards, .product-grid, .driver-catalog, .crew-rules, .admin-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 13px; }
  .metric-card > strong { font-size: 22px; margin-top: 12px; }
  .metric-card small { font-size: 9px; }
  .panel { padding: 15px; }
  .panel-heading { gap: 10px; }
  .panel-heading .filter-button, .panel-heading .outline-button { white-space: nowrap; }
  .order-toolbar { display: block; }
  .tabs { overflow-x: auto; padding-bottom: 3px; }
  .search-box { width: 100%; margin-top: 10px; }
  .search-box input { width: calc(100% - 30px); }
  .table-wrap { margin-right: -15px; }
  .orders-panel .table-wrap { margin-right: 0; overflow-x: hidden; }
  .orders-panel table { min-width: 100%; table-layout: fixed; }
  .orders-panel th, .orders-panel td { padding: 10px 4px; }
  .orders-panel th:nth-child(4), .orders-panel td:nth-child(4),
  .orders-panel th:nth-child(5), .orders-panel td:nth-child(5) { display: none; }
  .orders-panel th:first-child, .orders-panel td:first-child { width: 23%; }
  .orders-panel th:nth-child(2), .orders-panel td:nth-child(2) { width: 52%; }
  .orders-panel th:nth-child(3), .orders-panel td:nth-child(3) { width: 25%; }
  .orders-panel .client-cell { gap: 6px; min-width: 0; }
  .orders-panel .client-cell > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .orders-panel .client-cell > span:last-child small { overflow: hidden; text-overflow: ellipsis; }
  .full-table-panel .table-wrap { overflow-x: hidden; }
  .full-table-panel table { min-width: 100%; table-layout: fixed; }
  .full-table-panel th, .full-table-panel td { padding: 10px 3px; }
  .full-table-panel th:nth-child(4), .full-table-panel td:nth-child(4),
  .full-table-panel th:nth-child(7), .full-table-panel td:nth-child(7) { display: none; }
  .full-table-panel th:first-child, .full-table-panel td:first-child { width: 17%; }
  .full-table-panel th:nth-child(2), .full-table-panel td:nth-child(2) { width: 23%; }
  .full-table-panel th:nth-child(3), .full-table-panel td:nth-child(3) { width: 31%; }
  .full-table-panel th:nth-child(5), .full-table-panel td:nth-child(5) { width: 17%; }
  .full-table-panel th:nth-child(6), .full-table-panel td:nth-child(6) { width: 12%; }
  .full-table-panel .client-cell { gap: 5px; min-width: 0; }
  .full-table-panel .client-cell > span:last-child { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .full-table-panel .client-cell > span:last-child small { overflow: hidden; text-overflow: ellipsis; }
  .full-table-panel .status { padding: 4px 3px; font-size: 8px; }
  .messages-layout { height: 600px; }
  .conversation-list { width: 100%; border-right: 0; }
  .chat-area { display: none; }
  .route-row { gap: 9px; }
  .route-address { margin-left: 32px; }
  .route-row .outline-button { margin-left: auto; }
  .shift-route { margin-left: 0; min-width: 100%; }
  .crew-earnings { margin-left: 0; border-left: 0; padding-left: 0; }
  .crew-check-list { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .payout-sheets article { flex-wrap: wrap; }
  .payout-sheets article > div:nth-child(2) { min-width: calc(100% - 55px); }
  .payout-sheets article > b { margin-left: 40px; }
  .payout-sheets .outline-button { margin-left: auto; }
  .tariff-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 24px 18px; max-height: calc(100vh - 30px); overflow-y: auto; }
  .bridge-status { margin-top: 16px; width: fit-content; }
  .bridge-status div { min-width: 0; }
}

@media (max-width: 420px) {
  .metric-grid, .delivery-cards, .product-grid, .driver-catalog, .admin-grid, .tariff-grid { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 23px; }
  .page-heading .subtitle { line-height: 1.45; }
  .metric-card { min-height: 124px; }
  .product-image { height: 120px; }
  .activity-item { align-items: flex-start; }
  .activity-item time { display: none; }
  .crew-row { display: grid; grid-template-columns: 38px 1fr; }
  .crew-people { min-width: 0; }
  .crew-people p { flex-wrap: wrap; }
  .shift-route, .crew-earnings { grid-column: 2; }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .report-summary strong { font-size: 15px; }
  .login-card { padding: 25px 19px; }
}
