:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #627069;
  --line: #dce4df;
  --panel: #ffffff;
  --soft: #f4f7f5;
  --soft-2: #eaf2ee;
  --green: #1d7d54;
  --green-dark: #115d3c;
  --blue: #276a86;
  --amber: #a46619;
  --red: #a53b33;
  --shadow: 0 16px 40px rgba(23, 32, 28, 0.1);
}

* {
  box-sizing: border-box;
}

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

body.language-pending .shell {
  display: none;
}

body.login-pending .shell {
  display: none;
}

.language-gate,
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background: linear-gradient(rgba(10, 20, 16, 0.66), rgba(10, 20, 16, 0.66)), url("./assets/warehouse-logistics.png") center / cover;
}

body.language-pending .language-gate,
.language-gate.open,
body.login-pending .login-gate,
.login-gate.open {
  display: grid;
}

.language-panel,
.login-panel {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 28px;
  color: #fff;
  background: rgba(15, 27, 22, 0.88);
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(1080px, 100%);
}

.language-panel h1,
.login-panel h1 {
  margin: 12px 0 10px;
  font-size: 34px;
}

.language-panel p:not(.eyebrow),
.login-panel p:not(.eyebrow) {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.language-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.account-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.account-card strong {
  font-size: 16px;
}

.account-card span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
}

.account-card:hover {
  background: rgba(255, 255, 255, 0.14);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
}

.toast {
  border: 1px solid rgba(23, 32, 28, 0.14);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.45;
}

.toast.success {
  border-color: rgba(29, 125, 84, 0.3);
}

.toast.error {
  border-color: rgba(165, 59, 51, 0.38);
}

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 29vw) 1fr;
  min-height: 100vh;
}

.brand-panel {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background-image: url("./assets/warehouse-logistics.png");
  background-position: center;
  background-size: cover;
  color: #fff;
  overflow: hidden;
}

.brand-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 15, 12, 0.08), rgba(7, 15, 12, 0.7)), linear-gradient(90deg, rgba(7, 15, 12, 0.72), rgba(7, 15, 12, 0.18));
}

.brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: 32px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  display: block;
  width: min(260px, 76%);
  height: auto;
  object-fit: contain;
}

.brand-logo-light {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}

.title-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.top-logo {
  width: 150px;
  height: auto;
  flex: 0 0 auto;
}

.brand-content h1,
.workspace h2,
.workspace h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand-content h1 {
  max-width: 460px;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
}

.brand-copy {
  max-width: 430px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.contact-card {
  display: grid;
  gap: 7px;
  max-width: 430px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.45;
}

.contact-card span {
  color: #fff;
  font-weight: 760;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.device-banner {
  margin: -10px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 720;
}

.topbar,
.section-head,
.metrics,
.tabs,
.split {
  display: flex;
  gap: 16px;
}

.topbar,
.section-head {
  align-items: center;
  justify-content: space-between;
}

.topbar {
  margin-bottom: 22px;
}

.workspace h2 {
  font-size: 30px;
}

.workspace h3 {
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-panel .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

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

.primary-btn,
.ghost-btn,
.icon-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  font-weight: 720;
}

.primary-btn {
  padding: 0 16px;
  color: #fff;
  background: var(--green);
}

.primary-btn:hover {
  background: var(--green-dark);
}

.ghost-btn {
  padding: 0 14px;
  color: var(--ink);
  background: var(--soft-2);
}

.icon-btn {
  width: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.primary-btn svg,
.ghost-btn svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.tabs {
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tab {
  flex: 1;
  min-width: 132px;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 720;
}

.tab.active {
  color: #fff;
  background: var(--ink);
}

.pointer-touch .primary-btn,
.pointer-touch .ghost-btn,
.pointer-touch .icon-btn,
.pointer-touch .tab,
.pointer-touch input,
.pointer-touch select,
.pointer-touch textarea {
  min-height: 46px;
}

.device-phone .brand-panel {
  display: none;
}

.device-phone .shell {
  grid-template-columns: 1fr;
}

.device-phone .workspace {
  padding: 14px;
}

.device-phone .topbar {
  gap: 12px;
}

.device-phone .top-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.device-phone .top-actions .primary-btn {
  grid-column: 1 / -1;
}

.device-phone .tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.device-phone .tab {
  flex: 0 0 auto;
  min-width: 150px;
  scroll-snap-align: start;
}

.device-phone .metrics,
.device-phone .order-grid,
.device-phone .form-row,
.device-phone .split {
  grid-template-columns: 1fr;
}

.device-phone .split {
  display: grid;
}

.device-phone .quote-row,
.device-phone .inventory-row,
.device-phone .invoice-row,
.device-phone .admin-row,
.device-phone .warehouse-item {
  grid-template-columns: 1fr;
}

.device-phone dialog {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  border-radius: 0;
}

.device-phone .modal {
  padding: 16px;
}

.device-tablet .shell {
  grid-template-columns: 240px 1fr;
}

.device-tablet .brand-content {
  padding: 22px;
}

.device-tablet .brand-content h1 {
  font-size: 34px;
}

.device-tablet .workspace {
  padding: 20px;
}

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

.device-tablet .tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.os-ios input,
.os-ios select,
.os-ios textarea,
.os-android input,
.os-android select,
.os-android textarea {
  font-size: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  margin-bottom: 14px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.card,
.panel,
.quote-table,
.warehouse-item,
.inventory-table,
.invoice-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(23, 32, 28, 0.03);
}

.card {
  padding: 16px;
}

.card-head,
.card-foot,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h4 {
  margin: 0;
  font-size: 17px;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green-dark);
  background: #e4f4ec;
  font-size: 12px;
  font-weight: 760;
}

.status.awarded {
  color: var(--blue);
  background: #e3f1f5;
}

.status.transit {
  color: var(--amber);
  background: #f7eee1;
}

.status.done {
  color: #fff;
  background: var(--ink);
}

.detail-list {
  display: grid;
  gap: 9px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-list span {
  color: var(--ink);
  font-weight: 720;
}

.card-foot {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.score {
  color: var(--green-dark);
  font-weight: 820;
}

.quote-table {
  overflow: hidden;
}

.quote-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.75fr 0.75fr 0.7fr 0.65fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.quote-row:last-child {
  border-bottom: 0;
}

.quote-row.header {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.best {
  outline: 2px solid rgba(29, 125, 84, 0.22);
  outline-offset: -2px;
  background: #fbfffd;
}

.panel {
  flex: 1;
  min-width: 0;
  padding: 18px;
}

.split {
  align-items: flex-start;
}

form label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 125, 84, 0.12);
}

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

.full {
  width: 100%;
}

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

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

.mini-card strong {
  display: block;
  margin-bottom: 6px;
}

.photo-proof {
  width: 92px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.warehouse-list {
  display: grid;
  gap: 12px;
}

.warehouse-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.uid-line {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--green-dark);
  background: #eaf6ef;
  font-size: 12px;
  font-weight: 820;
}

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

.inventory-table,
.invoice-table,
.admin-table {
  display: grid;
  gap: 0;
  margin-bottom: 16px;
  overflow: hidden;
}

.inventory-row,
.invoice-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.admin-row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.8fr;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.admin-row:last-child {
  border-bottom: 0;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-list span {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--green-dark);
  background: #e8f6ed;
  font-size: 12px;
  font-weight: 720;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.file-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--soft-2);
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.file-action input {
  display: none;
}

.role-banner {
  margin: -8px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--panel);
}

.inventory-row {
  grid-template-columns: 1.45fr 0.6fr 1fr 1fr 0.8fr 0.75fr 0.85fr 0.85fr 0.9fr;
}

.invoice-row {
  grid-template-columns: 0.8fr 1.3fr 0.8fr 0.65fr 0.7fr 0.55fr;
}

.inventory-row:last-child,
.invoice-row:last-child {
  border-bottom: 0;
}

.inventory-row > div,
.invoice-row strong {
  display: grid;
  gap: 4px;
}

.inventory-row span,
.invoice-row span,
small {
  color: var(--muted);
}

.inventory-forms,
.invoice-head {
  margin-top: 16px;
}

.checklist {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.checklist span {
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 720;
}

.checklist .pass {
  color: var(--green-dark);
  background: #e8f6ed;
}

.checklist .fail {
  color: var(--red);
  background: #fae9e7;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.segmented label {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.segmented input {
  width: auto;
  margin-right: 8px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 25, 21, 0.48);
}

.modal {
  padding: 20px;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  text-align: center;
}

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

  .brand-panel {
    position: relative;
    min-height: 320px;
  }

  .brand-content {
    min-height: 320px;
  }

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

  .split {
    flex-direction: column;
  }

  .panel {
    width: 100%;
  }

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

  .inventory-row,
  .invoice-row {
    grid-template-columns: 1fr 1fr;
  }

  .quote-row.header {
    display: none;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .warehouse-item {
    align-items: stretch;
    flex-direction: column;
  }

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

  .top-actions {
    display: grid;
  }

  .title-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-logo {
    width: 132px;
  }

  .icon-btn {
    width: 100%;
  }

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

  .inventory-row,
  .invoice-row {
    grid-template-columns: 1fr;
  }
}
