:root {
  --ink: #0a0a0a;
  --ink-soft: #333333;
  --muted: #6b6b6b;
  --paper: #f3f3f3;
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(0, 0, 0, 0.1);
  --accent: #fede5e;
  --accent-hover: #ffe46b;
  --accent-deep: #0a0a0a;
  --accent-soft: rgba(254, 222, 94, 0.28);
  --steel: #1a1a1a;
  --warn: #9a5b12;
  --warn-soft: #fff3e4;
  --error: #b42318;
  --error-soft: #fdeceb;
  --ok-soft: #fff8dc;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.1);
  --radius: 20px;
  --sans: "Sora", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --lbe-yellow: #fede5e;
  --lbe-yellow-hot: #ffe46b;
  --lbe-black: #0a0a0a;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 90% 50% at 50% -12%, rgba(254, 222, 94, 0.42), transparent 58%),
    radial-gradient(ellipse 45% 35% at 100% 100%, rgba(0, 0, 0, 0.04), transparent 55%),
    linear-gradient(180deg, #f7f7f7 0%, #f0f0f0 100%);
  background-attachment: fixed;
}

button,
input {
  font: inherit;
}

.brand.mark {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  color: var(--ink);
  line-height: 0.98;
}

.brand-sub {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
}

h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

.dims {
  white-space: nowrap;
}

.error {
  color: var(--error);
  margin: 0.5rem 0 0;
}

.error.banner {
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  background: var(--error-soft);
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 10px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-rise {
  animation: rise-in 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-rise.delay {
  animation-delay: 80ms;
}

/* Login — modern LBE Logistics (yellow #FEDE5E + black) */
.login-shell {
  --lbe-yellow: #fede5e;
  --lbe-yellow-hot: #ffe46b;
  --lbe-black: #0a0a0a;
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 2.75rem);
  overflow: hidden;
  background: #f3f3f3;
}

.login-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(254, 222, 94, 0.55), transparent 58%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(0, 0, 0, 0.05), transparent 55%),
    radial-gradient(ellipse 45% 35% at 0% 85%, rgba(254, 222, 94, 0.18), transparent 50%);
}

.login-bg,
.login-bg-orb,
.login-bg-orb-a,
.login-bg-orb-b,
.login-bg-lines {
  display: none;
}

.login-stage {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
}

.login-form {
  position: relative;
  width: 100%;
  display: grid;
  gap: 1.15rem;
  padding: 2rem 1.6rem 1.55rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 28px 70px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.login-form-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #000 0%, var(--lbe-yellow) 45%, #000 100%);
}

.login-hero-block {
  text-align: center;
  padding: 0.35rem 0 0.15rem;
}

.login-logo {
  display: block;
  width: min(168px, 52vw);
  height: auto;
  margin: 0 auto;
  animation: logo-settle 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes logo-settle {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-fields {
  display: grid;
  gap: 0.95rem;
}

.login-field {
  gap: 0.45rem;
}

.login-field span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
}

.login-submit {
  margin-top: 0.15rem;
  width: 100%;
  min-height: 3rem;
  border-radius: 14px;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, background 160ms ease, box-shadow 160ms ease;
}

.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.login-form .error.banner {
  margin-top: 0;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .login-form {
    padding: 1.65rem 1.2rem 1.25rem;
    border-radius: 20px;
  }

  .login-logo {
    width: min(148px, 48vw);
  }
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
}

input,
.login-card input,
.field-grid input,
.filter-row input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--ink);
  outline: none;
  border-radius: 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #95a4b2;
}

input:hover:not(:disabled):not(:read-only) {
  border-color: #b7c5d1;
}

input:focus {
  border-color: var(--lbe-black);
  box-shadow: 0 0 0 4px rgba(254, 222, 94, 0.45);
  background: #fff;
}

input:disabled,
input:read-only {
  background: #f0f0f0;
  color: var(--muted);
}

button,
.btn-primary {
  border: none;
  background: var(--lbe-yellow);
  color: var(--lbe-black);
  font-weight: 700;
  padding: 0.78rem 1.15rem;
  cursor: pointer;
  border-radius: 14px;
  transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

button:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--lbe-yellow-hot);
}

button:active:not(:disabled),
.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled,
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-weight: 600;
}

button.secondary:hover:not(:disabled) {
  border-color: var(--lbe-black);
  color: var(--lbe-black);
  background: rgba(254, 222, 94, 0.2);
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

button.ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

button.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
}

.redirect-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

/* Main — match login look */
.app-shell {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}

.app-glow {
  display: none;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding: 1rem 1.2rem 1.1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #000 0%, var(--lbe-yellow) 45%, #000 100%);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.topbar-logo {
  width: 72px;
  height: auto;
  flex-shrink: 0;
}

.topbar-copy h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.topbar-lead {
  margin: 0.3rem 0 0;
  max-width: 28rem;
  line-height: 1.4;
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(254, 222, 94, 0.35);
  color: #0a0a0a;
  font-size: 0.76rem;
  font-weight: 700;
}

.chip-muted {
  background: #efefef;
  color: #444;
  font-weight: 600;
}

.trip-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #0a0a0a;
  color: var(--lbe-yellow);
  font-size: 0.78rem;
  font-weight: 500;
}

.truck-form {
  display: grid;
  gap: 1rem;
}

.mode-panel .section-head {
  margin-bottom: 0.85rem;
}

.mode-toggle,
.step-toggle {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: #f0f0f0;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.step-toggle {
  margin-top: 0.75rem;
}

.mode-btn,
.step-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #333;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-btn:hover,
.step-btn:hover {
  background: rgba(254, 222, 94, 0.35);
}

.mode-btn.active,
.step-btn.active {
  background: #0a0a0a;
  color: var(--lbe-yellow);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.panel {
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  padding: 1.25rem 1.25rem 1.3rem;
  border-radius: 24px;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--lbe-yellow), transparent);
  opacity: 0.9;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.section-lead {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.95rem;
  align-items: end;
}

.filter-actions {
  display: flex;
  align-items: end;
}

.orders-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  gap: 1rem;
}

.orders-head-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.selection-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: rgba(254, 222, 94, 0.28);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.selection-summary strong {
  color: var(--lbe-black);
  font-weight: 700;
}

.selection-summary .sep {
  color: rgba(0, 0, 0, 0.28);
}

.check-all {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  grid-template-columns: none;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.check-all input,
.order-check input {
  width: auto;
  accent-color: #0a0a0a;
}

.empty-state {
  padding: 1.75rem 1rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #f8fafb;
}

.empty-state p {
  margin: 0;
}

.empty-state .muted {
  margin-top: 0.35rem;
}

.order-list {
  display: grid;
  gap: 0.6rem;
}

.order-row {
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 12px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.order-row:hover {
  border-color: #c0ccd7;
  transform: translateY(-1px);
}

.order-row.selected {
  border-color: rgba(0, 0, 0, 0.35);
  background: rgba(254, 222, 94, 0.22);
  box-shadow: 0 0 0 3px rgba(254, 222, 94, 0.35);
}

.order-main {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) 1fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
}

.order-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  grid-template-columns: none;
  color: var(--ink);
  font-weight: 500;
}

.order-client {
  font-weight: 500;
  color: var(--ink-soft);
}

.order-items {
  border-top: 1px solid rgba(210, 220, 228, 0.95);
  padding: 0.8rem 0.95rem 1rem;
  overflow-x: auto;
  animation: rise-in 280ms ease both;
  background: rgba(255, 255, 255, 0.55);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #e8eef2;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  position: sticky;
  bottom: 0.75rem;
  padding: 0.85rem 0 0.2rem;
  background: linear-gradient(180deg, transparent, #f3f3f3 38%);
}

.result.ok {
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(254, 222, 94, 0.2);
}

.result.warn {
  border-color: rgba(154, 91, 18, 0.35);
  background: var(--warn-soft);
}

.result-body {
  margin: 0.45rem 0 0;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(210, 220, 228, 0.95);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}

@media (max-width: 900px) {
  .field-grid,
  .filter-row,
  .order-main {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-brand {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .section-head.row {
    flex-direction: column;
  }

  .actions {
    position: static;
    background: none;
  }
}

/* Login form fields must win over global input styles */
.login-shell .login-form label {
  color: #0a0a0a;
}

.login-shell .login-form input {
  background: #f7f7f7;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #0a0a0a;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-shell .login-form input::placeholder {
  color: #9a9a9a;
}

.login-shell .login-form input:hover:not(:disabled):not(:read-only) {
  border-color: rgba(0, 0, 0, 0.22);
  background: #ffffff;
}

.login-shell .login-form input:focus {
  border-color: #0a0a0a;
  box-shadow: 0 0 0 4px rgba(254, 222, 94, 0.45);
  background: #ffffff;
}

.login-shell .login-submit {
  background: var(--lbe-yellow, #fede5e);
  color: #0a0a0a;
  border: none;
  font-weight: 700;
}

.login-shell .login-submit:hover:not(:disabled) {
  background: var(--lbe-yellow-hot, #ffe46b);
}
