:root {
  --ink: #1f2933;
  --muted: #667085;
  --line: #d8dee6;
  --paper: #f6f8f7;
  --panel: #ffffff;
  --green: #1f7a5a;
  --blue: #2f5f9f;
  --red: #b42318;
  --gold: #b7791f;
  --navy: #20302f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  padding: 0;
  background: var(--paper);
}

.auth-grid {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  position: relative;
}

.public-products {
  min-width: 0;
  min-height: 100vh;
}

.product-browser {
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: 58px 28px 28px;
  align-content: start;
}

.product-browser h2 {
  margin-top: 8px;
}

.public-product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.product-shop-card {
  min-height: 100%;
  grid-template-columns: 1fr;
  align-items: start;
  grid-template-rows: auto 1fr auto auto;
  padding: 14px;
}

.product-shop-card .item-head,
.product-shop-card > .meta,
.product-shop-card .product-actions {
  grid-column: 1;
}

.product-actions button {
  background: var(--green);
  color: white;
}

.product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.cart-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.cart-page {
  align-content: start;
}

.cart-page .cart-panel {
  max-width: 980px;
  width: 100%;
}

.cart-summary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.checkout-icon-button::before {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.cart-row input {
  min-width: 0;
}

.cart-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: white;
  white-space: nowrap;
}

.cart-icon-button strong {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: white;
  color: var(--green);
  font-size: 13px;
}

.storefront-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.signin-link-button {
  min-height: 42px;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

.product-thumb {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ecfdf3;
  color: var(--green);
  font-weight: 900;
  border: 1px solid #b7e4ca;
}

.product-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7f9fb;
  z-index: 1;
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-strip span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fef7e7;
  color: #7a4c08;
  font-size: 13px;
  font-weight: 800;
}

.login-card {
  width: 100%;
  display: grid;
  gap: 16px;
  padding: 26px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(12, 20, 28, 0.28);
}

.login-card h1 {
  color: var(--ink);
}

.signin-panel {
  position: absolute;
  top: 78px;
  right: 28px;
  z-index: 3;
  display: grid;
  gap: 12px;
  justify-items: end;
}

.signin-panel .login-card {
  width: min(360px, calc(100vw - 32px));
}

.signin-panel > button {
  display: none;
}

.single-auth {
  width: min(460px, 100%);
}

.text-link {
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--navy);
  color: white;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border-bottom: 4px solid #d7b46a;
}

.eyebrow {
  color: #b88c2d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #d7b46a;
}

.role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  min-height: 42px;
  background: #e7edf3;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.97);
}

.danger-button {
  background: #fee4e2;
  color: var(--red);
}

.role-tabs button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-tabs button.active {
  background: white;
  color: var(--navy);
}

.role-tabs button:disabled {
  cursor: default;
  filter: none;
  opacity: 0.86;
}

.role-tabs button[data-logout] {
  background: #fee4e2;
  color: var(--red);
  border-color: transparent;
}

main {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.hidden {
  display: none !important;
}

.role-view {
  display: grid;
  gap: 20px;
}

.interface-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  box-shadow: 0 10px 34px rgba(31, 41, 51, 0.07);
}

.customer-panel {
  border-left-color: var(--green);
}

.driver-panel {
  border-left-color: var(--blue);
}

.worker-panel {
  border-left-color: var(--gold);
}

.owner-panel {
  border-left-color: var(--navy);
}

.section-title,
.panel-heading,
.checkout-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metrics article,
.workbench,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article {
  padding: 18px;
  min-height: 94px;
}

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

.metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
}

.workbench,
.panel {
  padding: 18px;
}

.owner-workspace {
  display: grid;
  gap: 16px;
}

.owner-page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.owner-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.owner-page-grid button {
  min-height: 118px;
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: start;
  text-align: left;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
}

.owner-page-grid strong {
  font-size: 18px;
}

.owner-page-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.owner-split {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
}

.scanner-panel {
  border-left: 4px solid var(--green);
}

.scanner-result {
  padding: 10px;
  border-radius: 6px;
  background: #ecfdf3;
  color: var(--green);
  font-weight: 800;
}

.pricing-summary {
  padding: 10px;
  border-radius: 6px;
  background: #fef7e7;
  color: #7a4c08;
  font-weight: 800;
}

.muted-field {
  opacity: 0.55;
}

.two-col,
.owner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.owner-grid {
  align-items: start;
}

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

.compact-form {
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c9d2dc;
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  font: inherit;
  background: white;
}

textarea {
  resize: vertical;
}

.wide {
  grid-column: span 2;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.check input {
  width: auto;
}

.primary {
  background: var(--green);
  color: white;
}

.panel h2,
.workbench h2 {
  margin-bottom: 14px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: white;
}

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

.meta,
.route-list {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.route-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 6px;
  background: #f7f9fb;
}

.route-list span {
  color: #344054;
}

.route-stop {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.route-stop:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.proof-upload {
  max-width: 320px;
}

.proof-photo {
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.item a.text-link {
  width: fit-content;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #eef4ff;
  color: var(--blue);
  white-space: nowrap;
}

.badge.info {
  background: #eef4ff;
  color: var(--blue);
}

.badge.paid {
  background: #dcfae6;
  color: var(--green);
}

.badge.pending {
  background: #fef0c7;
  color: var(--gold);
}

.badge.urgent {
  background: #fee4e2;
  color: var(--red);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 980px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
    display: grid;
  }

  .role-tabs {
    justify-content: start;
  }

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

  .two-col,
  .owner-grid,
  .owner-split {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .topbar,
  main {
    padding: 16px;
  }

  .product-browser {
    padding: 58px 16px 16px;
  }

  h1 {
    font-size: 22px;
  }

  .metrics,
  .grid-form {
    grid-template-columns: 1fr;
  }

  .public-product-list {
    grid-template-columns: 1fr;
  }

  .cart-row {
    grid-template-columns: 1fr;
  }

  .owner-page-header {
    display: grid;
  }

  .owner-page-grid {
    grid-template-columns: 1fr;
  }

  .signin-panel {
    right: 16px;
    top: 92px;
  }

  .product-browser > .item-head {
    display: grid;
  }

  .storefront-actions {
    justify-content: start;
    flex-wrap: wrap;
  }

  .wide {
    grid-column: span 1;
  }

  .section-title {
    display: grid;
  }

  .role-tabs button {
    flex: 1 1 140px;
  }
}
