:root {
  font-family: Inter, system-ui, sans-serif;
  color: #f8fafc;
  background: #0b1220;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(180deg, #0b1220, #172033);
  min-height: 100vh;
}
button {
  border: 0;
  border-radius: 10px;
  padding: 12px 15px;
  background: #d4af37;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}
input,
textarea {
  width: 100%;
  padding: 13px;
  margin: 6px 0;
  border: 1px solid #475569;
  border-radius: 10px;
  background: #111827;
  color: #fff;
}
.driver-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.driver-login section {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid #66541e;
  border-radius: 18px;
  background: #151d2d;
}
.driver-login button {
  width: 100%;
  margin: 10px 0;
}
.driver-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(11, 18, 32, 0.94);
  border-bottom: 1px solid #66541e;
}
.driver-header h1 {
  margin: 3px 0;
}
.driver-header small {
  color: #d4af37;
}
main {
  max-width: 760px;
  margin: auto;
  padding: 15px;
}
.driver-summary {
  padding: 13px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #1e293b;
}
.driver-card {
  margin: 12px 0;
  padding: 17px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: #151d2d;
  box-shadow: 0 12px 25px #0005;
}
.driver-card h2 {
  margin: 8px 0;
}
.driver-card a {
  color: #f4d77b;
}
.driver-card .address {
  display: block;
  font-size: 17px;
}
.status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #334155;
  text-transform: capitalize;
}
.driver-actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}
.empty {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
}
dialog {
  width: min(520px, calc(100% - 24px));
  border: 1px solid #66541e;
  border-radius: 16px;
  background: #151d2d;
  color: #fff;
}
dialog::backdrop {
  background: #000a;
}
.dialog-close {
  float: right;
  background: #334155;
  color: #fff;
}
.outcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 480px) {
  .outcome-grid {
    grid-template-columns: 1fr;
  }
  .driver-actions {
    flex-direction: column;
  }
}
.driver-header {
  gap: 12px;
  flex-wrap: wrap;
}
.driver-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.driver-header-actions #driverLogout {
  background: #334155;
  color: #fff;
}
.driver-header-actions button:disabled {
  opacity: 0.65;
  cursor: wait;
}
.driver-status-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.driver-status-columns button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 16px 8px;
  background: #1e293b;
  color: #cbd5e1;
  border: 2px solid #334155;
}
.driver-status-columns button[aria-pressed='true'] {
  border-color: #d4af37;
  background: #332c19;
  color: #f4d77b;
}
.driver-status-columns button:focus-visible {
  outline: 3px solid #f8fafc;
  outline-offset: 3px;
}
.driver-status-columns strong {
  font-size: 28px;
}
.driver-status-columns span {
  font-size: 13px;
}
.driver-card {
  overflow-wrap: anywhere;
}

.driver-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.driver-order-reference {
  display: inline-block;
  padding: 5px 9px;
  border: 1px solid #806a24;
  border-radius: 999px;
  background: #332c19;
  color: #f4d77b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Keep the logo in the right corner without covering driver controls. */
.driver-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 20px;
}
.driver-heading {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  align-self: end;
}
.driver-header-actions {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}
.driver-brand-logo {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 144px;
  height: 144px;
  display: block;
  overflow: hidden;
  border: 2px solid #d4af37;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 5px #d4af3714;
}
.driver-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: translateX(4%) scale(1.03);
}
@media (max-width: 480px) {
  .driver-header {
    padding: 12px;
    gap: 8px 12px;
  }
  .driver-brand-logo {
    width: 100px;
    height: 100px;
  }
  .driver-header h1 {
    font-size: 24px;
  }
  .driver-header-actions {
    gap: 6px;
  }
  .driver-header-actions button {
    padding: 10px;
  }
}

.driver-package-scans {
  overflow-wrap: anywhere;
}
.driver-package-scans ul {
  max-height: 160px;
  overflow: auto;
  padding-left: 20px;
}
.driver-package-scans select {
  padding: 10px;
  background: #182337;
  color: white;
}
