:root {
  --brand: #001e40;
  --brand-2: #003366;
  --accent: #1f5eac;
  --paper: #f8fafc;
  --surface: #ffffff;
  --line: #dfe6ef;
  --ink: #1a1c1c;
  --muted: #61656d;
  --ok: #087443;
  --warn: #a15c00;
  --bad: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Manrope, "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 900;
}

button:disabled {
  opacity: .55;
}

.app {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: 24px;
  background: var(--brand);
}

.brand {
  color: #fff;
}

.brand span,
.eyebrow,
label span,
dt {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand span {
  color: rgba(255,255,255,.72);
}

.brand h1 {
  margin: 4px 0 0;
  font-size: 32px;
}

.login-box {
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
}

label {
  display: grid;
  gap: 6px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.error {
  margin: 0;
  color: var(--bad);
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.topbar span {
  color: rgba(255,255,255,.76);
  font-size: 12px;
  font-weight: 800;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 21px;
}

.topbar button {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
}

.status-bar {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.handler-groups {
  display: grid;
  gap: 14px;
  padding: 12px;
}

.handler-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.handler-section > header {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #f6f9fd;
}

.handler-section h2 {
  margin: 2px 0;
  color: var(--brand);
  font-size: 18px;
}

.address {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.cards {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.mawb-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mawb {
  display: block;
  color: var(--accent);
  font-size: 18px;
}

.pickup {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  align-self: flex-start;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--brand);
  padding: 4px 9px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
}

.pill.picked_complete,
.pill.delivered {
  background: #dff4e8;
  color: var(--ok);
}

.pill.picked_partial {
  background: #fff2d9;
  color: var(--warn);
}

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

dl div:last-child {
  grid-column: 1 / -1;
}

dd {
  margin: 3px 0 0;
  color: var(--brand);
  font-weight: 800;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.attachments a {
  border-radius: 999px;
  background: #eaf1fb;
  color: var(--accent);
  padding: 5px 9px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.actions {
  display: grid;
  gap: 9px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.partial-btn {
  background: var(--warn);
}

.complete-btn {
  background: var(--ok);
}

.delivered-btn {
  background: var(--accent);
}

@media (min-width: 760px) {
  .login-view {
    justify-content: center;
  }
  .handler-groups {
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
  }
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
