:root {
  --leaf: #087424;
  --leaf-dark: #024716;
  --moss: #8bbf24;
  --paper: #f7f8f1;
  --ink: #192219;
  --muted: #667064;
  --line: #dce5d6;
  --panel: #ffffff;
  --amber: #f3b932;
  --danger: #b42626;
  --shadow: 0 18px 45px rgba(25, 34, 25, .1);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(8, 116, 36, .08), transparent 35%),
    linear-gradient(180deg, #fff, var(--paper));
  font-family: Avenir Next, Segoe UI, Helvetica, Arial, sans-serif;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.hero {
  min-height: 190px;
  display: grid;
  grid-template-columns: 240px minmax(260px, 1fr) 460px;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand img {
  width: 220px;
  max-width: 100%;
  display: block;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--leaf-dark);
  font-family: Georgia, Cambria, serif;
  font-size: clamp(42px, 5vw, 78px);
  line-height: .92;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 620px;
  margin: 14px 0 0;
  color: #354235;
  font-size: 18px;
}

.truck-wrap {
  position: relative;
  width: 100%;
  min-height: 150px;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}

.truck {
  width: 100%;
  height: 100%;
  min-height: 150px;
  display: block;
  object-fit: cover;
  object-position: center;
}

.truck-logo {
  position: absolute;
  width: 21%;
  left: 68%;
  top: 45%;
  opacity: .94;
  transform: translate(-50%, -50%) skewY(.4deg);
  pointer-events: none;
}

.form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(25, 34, 25, .06);
  padding: 16px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -16px -16px 16px;
  padding: 12px 14px;
  color: var(--leaf-dark);
  background: #f1f6ec;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
  text-transform: uppercase;
}

.panel-title span {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--leaf);
  font-weight: 900;
}

.grid {
  display: grid;
  gap: 12px;
}

.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }

label, legend {
  display: grid;
  gap: 6px;
  color: #121912;
  font-size: 14px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdac9;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(139, 191, 36, .28);
  border-color: var(--leaf);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

fieldset {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset label,
.choice-stack label,
.segmented label,
.service-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--leaf);
}

.choice-stack {
  display: grid;
  gap: 10px;
  margin: 10px 0 12px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.segmented label,
.service-grid label {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcf8;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.dropzone {
  min-height: 94px;
  place-content: center;
  text-align: center;
  color: var(--leaf);
  border: 2px dashed #b8cdb1;
  border-radius: 8px;
  background: #fbfdf8;
  padding: 12px;
}

.dropzone input {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.internal {
  border-color: rgba(8, 116, 36, .35);
}

.submit-band {
  position: sticky;
  bottom: 0;
  z-index: 5;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(220px, 460px) 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: rgba(247, 248, 241, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.captcha {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.captcha input {
  grid-column: 1 / -1;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(180deg, #0b872c, #05651f);
  box-shadow: 0 10px 20px rgba(8, 116, 36, .24);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  opacity: .65;
  cursor: wait;
}

.small-button,
.icon-close {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--leaf-dark);
  background: #f1f6ec;
  box-shadow: none;
  font-size: 14px;
}

#formStatus,
.status-text {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.admin-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(139, 191, 36, .16), transparent 34%),
    linear-gradient(180deg, #ffffff, #eef3e8);
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-brand {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.admin-brand img {
  width: 150px;
  flex: 0 0 auto;
}

.admin-brand h1 {
  font-size: clamp(32px, 4vw, 54px);
}

.admin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.admin-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--leaf-dark);
  background: #f1f6ec;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
}

.admin-actions button {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}

.orders-panel {
  width: 100%;
}

.modal {
  width: min(680px, calc(100% - 24px));
  max-height: min(860px, calc(100vh - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.detail-modal {
  width: min(1120px, calc(100% - 24px));
}

.modal::backdrop {
  background: rgba(12, 20, 12, .45);
  backdrop-filter: blur(4px);
}

.modal-panel {
  max-height: min(860px, calc(100vh - 24px));
  overflow: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-wide {
  width: min(1120px, calc(100vw - 24px));
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin: -16px -16px 16px;
}

.modal-head .panel-title {
  flex: 1;
  margin: 0;
}

.modal-head .icon-close {
  margin: 8px 8px 0 0;
}

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

.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf8;
}

.detail-section h3 {
  margin: 0 0 12px;
  color: var(--leaf-dark);
  font-size: 17px;
}

.detail-section dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-item dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-item dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-list a {
  color: var(--leaf-dark);
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--leaf-dark);
  background: #f1f6ec;
}

.details {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 13px;
}

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

.login-card {
  width: min(1080px, 100%);
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(320px, .8fr);
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 38px;
}

.login-brand img {
  width: 220px;
  max-width: 100%;
  display: block;
  margin-bottom: 30px;
}

.login-brand h1 {
  margin-bottom: 14px;
  font-size: clamp(48px, 6vw, 84px);
}

.login-brand p:last-child {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 38px;
  background: #fbfcf8;
  border-left: 1px solid var(--line);
}

.login-form h2 {
  margin: 0 0 6px;
  color: var(--leaf-dark);
  font-size: 26px;
}

.login-form p {
  margin: 0;
  color: var(--muted);
}

.login-media {
  grid-column: 1 / -1;
  height: 210px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #fff;
}

.login-media .truck-wrap {
  height: 100%;
  border-radius: 0;
}

.login-media .truck {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.login-media .truck-logo {
  width: 18%;
  left: 68%;
  top: 45%;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 180px 1fr;
  }

  .truck-wrap {
    grid-column: 1 / -1;
    max-height: 180px;
  }

  .form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-3 { grid-column: span 2; }
}

@media (max-width: 760px) {
  .shell,
  .admin-shell {
    padding: 10px;
  }

  .hero,
  .form,
  .two,
  .three,
  .detail-grid,
  .admin-grid,
  .submit-band,
  .login-card {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .admin-brand,
  .admin-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-brand img {
    width: 135px;
  }

  .login-screen {
    padding: 10px;
  }

  .login-card {
    min-height: 0;
  }

  .login-brand,
  .login-form {
    padding: 24px;
  }

  .login-form {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .login-media {
    height: 150px;
  }

  .hero {
    gap: 12px;
    padding: 14px;
  }

  .brand img {
    width: 170px;
  }

  .panel,
  .span-2,
  .span-3,
  .wide {
    grid-column: 1 / -1;
  }

  .service-grid {
    grid-template-columns: 1fr 1fr;
  }

  .submit-band {
    position: static;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 40px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }
}
