:root {
  --dhl-yellow: #ffcc00;
  --dhl-red: #d40511;
  --ink: #171717;
  --muted: #646464;
  --line: #dedbd2;
  --paper: #f6f4ee;
  --white: #ffffff;
  --green: #147a4a;
  --amber: #956300;
  --shadow: 0 10px 30px rgba(32, 28, 18, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(130deg, rgba(255, 204, 0, 0.11), transparent 30%), var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.masthead {
  display: flex;
  align-items: center;
  min-height: 84px;
  padding: 14px clamp(20px, 4vw, 64px);
  color: #111;
  background: var(--dhl-yellow);
  border-bottom: 5px solid var(--dhl-red);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-right: 16px;
  place-items: center;
  color: white;
  background: var(--dhl-red);
  font-weight: 900;
  letter-spacing: -0.06em;
  transform: skew(-7deg);
}

.brand-copy h1 { margin: 2px 0 0; font-size: clamp(20px, 2.1vw, 29px); letter-spacing: -0.035em; }
.eyebrow, .section-kicker { font-size: 11px; font-weight: 850; letter-spacing: 0.14em; }

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  font-size: 13px;
  font-weight: 750;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.account-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 5px 6px 5px 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

.account-control form { margin: 0; }
.signed-in-user { font-size: 12px; font-weight: 800; }
.logout-button {
  padding: 7px 10px;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #767676; }
.live-status.online .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(20, 122, 74, 0.14); }
.live-status.offline .status-dot { background: var(--dhl-red); }

main { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 60px; }

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 10px 2px 30px;
}

.hero h2 { max-width: 760px; margin: 8px 0 12px; font-size: clamp(36px, 5.3vw, 70px); line-height: 0.98; letter-spacing: -0.055em; }
.section-kicker { margin: 0; color: var(--dhl-red); }
.hero-copy { max-width: 720px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }

.refresh-button, .button {
  border: 0;
  border-radius: 5px;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.refresh-button { flex: 0 0 auto; padding: 14px 18px; color: white; background: var(--ink); }
.refresh-button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(0, 0, 0, 0.16); }
button:disabled { cursor: wait; opacity: 0.55; transform: none; }

.control-panel {
  display: grid;
  grid-template-columns: minmax(230px, 1.7fr) minmax(180px, 1fr);
  gap: 14px;
  padding: 20px;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-panel label { display: flex; flex-direction: column; gap: 8px; color: #d9d9d9; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.control-panel input, .control-panel select { width: 100%; height: 47px; padding: 0 13px; color: var(--ink); background: white; border: 2px solid transparent; border-radius: 4px; outline: none; }
.control-panel input:focus, .control-panel select:focus { border-color: var(--dhl-yellow); }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr) 1.35fr; gap: 14px; margin: 14px 0 30px; }
.summary-card { min-height: 112px; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; }
.summary-card strong { display: block; margin-top: 10px; font-size: 31px; line-height: 1; }
.summary-card-note { color: #2e2500; background: var(--dhl-yellow); border-color: var(--dhl-yellow); }
.summary-card-note strong { font-size: 18px; line-height: 1.3; }
.summary-label { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.summary-card-note .summary-label { color: #6a5600; }

.orders-section { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 5px 0 0; font-size: 27px; letter-spacing: -0.035em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 20px; text-align: left; vertical-align: middle; border-bottom: 1px solid #ece9e1; }
th { color: var(--muted); background: #faf9f6; font-size: 11px; font-weight: 850; letter-spacing: 0.075em; text-transform: uppercase; }
tbody tr:hover { background: #fffdf4; }
tbody tr:last-child td { border-bottom: 0; }
.order-number { font-size: 18px; }
.tracking-number { padding: 5px 7px; background: #f1f0eb; border-radius: 3px; font-size: 13px; }
.booked-at { color: var(--muted); font-size: 13px; }

.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-pill::before { width: 7px; height: 7px; background: currentColor; border-radius: 50%; content: ""; }
.status-ready { color: #6f5400; background: #fff2bd; }
.status-generated { color: var(--green); background: #e2f4eb; }
.status-error { color: #9c1a23; background: #fbe4e5; }
.status-archived { color: #4d5664; background: #e9edf2; }
.status-detail { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.actions-heading, .row-actions { text-align: right; }
.button { padding: 11px 14px; }
.button-primary { color: white; background: var(--dhl-red); }

.empty-state { padding: 62px 20px; text-align: center; }
.empty-state h3 { margin: 12px 0 5px; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-icon { color: var(--dhl-red); font-size: 35px; }

.help-strip { display: flex; gap: 20px; margin-top: 20px; padding: 18px 22px; color: #dedede; background: var(--ink); border-radius: 6px; line-height: 1.45; }
.help-strip strong { flex: 0 0 auto; color: var(--dhl-yellow); }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(440px, calc(100% - 44px)); padding: 14px 17px; color: white; background: var(--green); border-radius: 5px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); opacity: 0; pointer-events: none; transform: translateY(10px); transition: 160ms ease; }
.toast.visible { opacity: 1; transform: none; }
.toast.error { background: var(--dhl-red); }

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell { width: min(470px, 100%); margin: 0; padding: 0; }
.login-card {
  overflow: hidden;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 7px solid var(--dhl-red);
  border-radius: 9px;
  box-shadow: 0 18px 55px rgba(32, 28, 18, 0.14);
}
.login-brand { display: flex; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.login-brand h1 { margin: 4px 0 0; font-size: 27px; letter-spacing: -0.04em; }
.login-brand .eyebrow { color: var(--dhl-red); }
.login-intro { margin: 24px 0; color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 8px; font-size: 12px; font-weight: 800; }
.login-form input {
  width: 100%;
  height: 49px;
  padding: 0 13px;
  color: var(--ink);
  background: white;
  border: 2px solid var(--line);
  border-radius: 5px;
  outline: none;
}
.login-form input:focus { border-color: var(--dhl-yellow); box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2); }
.login-button { min-height: 49px; margin-top: 3px; }
.form-message { margin: 0 0 18px; padding: 12px 14px; color: #5e4c00; background: #fff2bd; border-radius: 5px; font-size: 13px; line-height: 1.4; }
.error-message { color: #8d111a; background: #fbe4e5; }
.success-message { color: #155d3c; background: #e2f4eb; }

@media (max-width: 900px) {
  .hero { align-items: start; flex-direction: column; }
  .control-panel, .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card-note { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  main { width: min(100% - 24px, 1480px); padding-top: 25px; }
  .masthead { padding-inline: 14px; }
  .brand-mark { width: 43px; height: 43px; }
  .eyebrow { display: none; }
  .live-status { display: none; }
  .header-actions { gap: 6px; }
  .account-control { padding-left: 9px; }
  .signed-in-user { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero h2 { font-size: 42px; }
  .control-panel, .summary-grid { grid-template-columns: 1fr; }
  .summary-card-note { grid-column: auto; }
  .section-heading { align-items: start; flex-direction: column; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  td { display: grid; grid-template-columns: 115px 1fr; gap: 10px; padding: 9px 16px; border: 0; }
  td::before { color: var(--muted); content: attr(data-label); font-size: 10px; font-weight: 850; letter-spacing: 0.07em; text-transform: uppercase; }
  .row-actions { text-align: left; }
  .row-actions .button { width: 100%; }
  .help-strip { flex-direction: column; gap: 8px; }
  .login-page { padding: 14px; }
  .login-card { padding: 24px 20px; }
  .login-brand .eyebrow { display: inline; }
}
