.login #login-form {
  grid-template-columns: minmax(0, 1fr);
}

.login #login-form button {
  min-height: 44px;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 680px;
}

.warehouse-inspection-fields .tire-index-field select {
  min-height: 44px;
  width: 100%;
}

.shell,
.main,
.top,
.top-actions {
  min-width: 0;
}

/* Zalogowany użytkownik jest automatycznie traktowany jako obecny w pracy. */
.top-actions #attendance { display: none !important; }

.nav-toggle {
  display: none;
}

.side .nav-group {
  display: block;
  margin: 4px 0 8px;
}

.side .nav-group-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
}

.side .nav-group-arrow {
  display: inline-grid;
  place-items: center;
}

.side .nav-group-arrow {
  font-size: 17px;
  transition: transform .18s ease;
}

.side .nav-group.open .nav-group-arrow {
  transform: rotate(90deg);
}

.side .nav-submenu {
  margin: 4px 0 10px 18px;
  padding: 6px 6px 6px 10px;
  border-left: 2px solid #3a4f6d;
  border-radius: 0 9px 9px 0;
  background: #0b1625;
}

.side .nav-submenu button {
  min-height: 34px;
  margin: 1px 0;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #c6d4e8;
}

.side .nav-submenu button.active {
  color: #fff;
}


.v3-orders-mobile {
  display: none;
}

.side button:focus-visible,
.top-actions button:focus-visible,
.top-actions input:focus-visible {
  outline: 3px solid #80a7db;
  outline-offset: 2px;
}

.brand-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
}

@media (max-width: 850px) {
  .shell {
    display: block;
    max-width: 100%;
  }

  .side {
    display: block;
    padding: max(12px, env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 10px calc(12px + env(safe-area-inset-left));
  }

  .side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .side .brand {
    min-width: 0;
    margin: 0;
  }

  .side .brand-logo {
    width: min(180px, 50vw);
  }

  .side .brand small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 92px;
    min-height: 44px;
    flex: 0 0 auto;
    border: 1px solid #50627c;
    background: #263b59;
    color: #fff;
  }

  .side nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: min(60vh, 520px);
    margin-top: 10px;
    padding: 2px 0 calc(2px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .side.nav-open nav {
    display: grid;
  }

  .side nav button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .main {
    max-width: 100%;
    padding-right: calc(18px + env(safe-area-inset-right));
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .top {
    gap: 12px;
    margin-bottom: 18px;
  }

  .top-actions {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .top-actions .search {
    flex: 1 1 280px;
    min-width: 0;
    max-width: 100%;
  }

  .top-actions button {
    flex: 0 1 auto;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .side nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .main {
    padding: 14px calc(12px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  }

  .top {
    gap: 10px;
    margin-bottom: 14px;
  }

  .top h1 {
    font-size: 21px;
    line-height: 1.2;
  }

  .top-actions .search {
    flex-basis: 100%;
    min-height: 44px;
  }

  .top-actions button {
    flex: 1 1 130px;
    min-height: 44px;
  }

  #v3-orders-list {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .v3-orders-table {
    display: none;
  }

  .v3-orders-mobile {
    display: grid;
    min-width: 0;
    gap: 12px;
  }

  .v3-order-card {
    display: grid;
    min-width: 0;
    gap: 12px;
    padding: 14px;
    overflow-wrap: anywhere;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .v3-order-card header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .v3-order-card header > div,
  .v3-order-card-customer {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .v3-order-card header small,
  .v3-order-card-customer span,
  .v3-order-card p,
  .v3-order-card dt {
    color: var(--muted);
  }

  .v3-order-card p,
  .v3-order-card dl,
  .v3-order-card dd {
    margin: 0;
  }

  .v3-order-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .v3-order-card dt {
    font-size: 12px;
  }

  .v3-order-card dd {
    margin-top: 3px;
    font-weight: 700;
  }

  .v3-order-card .v3-detail {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 850px) {
  .top-actions #logout {
    display: none;
  }

  .side.nav-open + .main .top-actions #logout {
    display: block;
    position: fixed;
    z-index: 1002;
    top: calc(62px + env(safe-area-inset-top));
    right: calc(16px + env(safe-area-inset-right));
    width: auto;
    min-height: 36px;
    padding: 7px 10px;
    color: #dce7f7;
    background: #263b59;
    border-color: #3c5578;
  }
}
.v3-order-row{cursor:pointer}.v3-order-row:hover,.v3-order-row:focus{background:#eef5ff;outline:2px solid #2475e8;outline-offset:-2px}.v3-detail-inline{display:block;margin-top:8px;padding:7px 10px;white-space:nowrap}
.order-detail-clean{display:grid;gap:20px}.order-detail-header{display:flex;align-items:center;justify-content:space-between;gap:16px}.order-detail-header h2{margin:3px 0 0}.order-detail-header small,.order-detail-facts small{color:var(--muted);font-weight:800;letter-spacing:.05em}.order-detail-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.order-detail-facts>div{display:grid;gap:4px;padding:14px;border-radius:12px;background:#f3f6fa}.order-detail-facts strong{font-size:1.05rem}.order-detail-facts span{color:var(--muted);font-size:.86rem}.order-document-warning{margin:0}.order-vehicle{margin:0}.order-rim-uniform{display:grid;gap:12px;padding:16px;border-left:6px solid #bb7500;border-radius:12px;background:#fff8e8}.order-rim-uniform>div{display:grid;gap:4px}.order-rim-uniform>div strong{font-size:1.15rem}.order-rim-uniform details{border-top:1px solid #ead5a5;padding-top:10px}.order-rim-uniform summary,.order-future-tasks summary,.order-detail-history summary{cursor:pointer;font-weight:800}.order-current-task{padding:16px;border:2px solid #8dbcf7;border-radius:14px;background:#f3f8ff}.order-current-task h2{margin-top:0}.order-future-tasks,.order-detail-history{padding:15px;border:1px solid var(--line);border-radius:12px;background:#fff}.order-future-tasks[open] summary,.order-detail-history[open] summary{margin-bottom:12px}.order-tire-intent{padding:15px;border-radius:12px;background:#f3f6fa}.order-tire-intent h2,.order-tire-intent p{margin-top:0}.order-tire-intent p{margin-bottom:0}.order-detail-actions{display:flex;flex-wrap:wrap;gap:10px}.order-detail-actions button{min-height:44px}@media(max-width:760px){.order-detail-facts{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:460px){.order-detail-facts{grid-template-columns:1fr}.order-detail-header{align-items:flex-start}.order-detail-actions button{width:100%}}

.v3-order-photo{display:grid;place-items:center;width:76px;height:58px;padding:3px;overflow:hidden;border:1px solid var(--line);border-radius:9px;background:#eef2f7;color:var(--muted);font-size:11px}.v3-order-photo img{display:block;width:100%;height:100%;border-radius:6px;object-fit:cover}.v3-order-no-photo{display:grid;place-items:center;width:76px;min-height:58px;color:var(--muted);font-size:11px;text-align:center}.v3-order-card header .v3-order-photo,.v3-order-card header .v3-order-no-photo{flex:0 0 76px}
.order-transport-card{display:flex;justify-content:space-between;gap:20px;align-items:center;margin:18px 0;padding:20px;border:1px solid #bfd4ee;border-left:7px solid #3278d4;border-radius:16px;background:#f5f9ff}.order-transport-card h2{margin:5px 0 8px}.order-transport-card p{margin:4px 0}.order-transport-card.is-attention{border-color:#e6b25a;border-left-color:#d88900;background:#fff7e5}.order-transport-card.is-own{border-color:#a8ddc1;border-left-color:#15965b;background:#effaf4}.order-transport-card.is-planned{border-left-color:#176fd0}.order-transport-card>button{flex:0 0 auto}@media(max-width:700px){.order-transport-card{display:grid}.order-transport-card>button{width:100%}}
.transport-field-driver,
.transport-assign,
.transport-filters label:has(select[name="assignedDriverUserId"]) {
  display: none !important;
}
