:root {
  color-scheme: light;
  /* Shared with the Backed Up Loads Visualizer so both CFES tools read as one system. */
  --green: #71a62b;
  --green-hover: #66992a;
  --green-light: #80b83a;
  --green-link: #5d8c22;
  --green-deep: #47651e;
  --green-100: #edf4e3;
  --green-50: #f3f6ed;
  --green-700: #4c6b16;
  --ink: #2b2b2b;
  --ink-strong: #32342f;
  --muted: #777872;
  --line: rgba(0, 0, 0, 0.08);
  --line-soft: rgba(0, 0, 0, 0.05);
  --surface: #ffffff;
  --surface-warm: #fbfaf7;
  --canvas: #f2f1ec;
  --danger: #a13b34;
  --danger-soft: #faefed;
  --success: #5b861f;
  --success-soft: #edf4e3;
  --warning: #f49c20;
  --warning-soft: #fff6e0;
  --warning-ink: #8a5b12;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius-large: 16px;
  --radius-medium: 14px;
  --radius-small: 8px;
  font-family: Montserrat, system-ui, -apple-system, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(113, 166, 43, 0.48);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--green);
  border-radius: var(--radius-small);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: max(12px, env(safe-area-inset-top)) clamp(16px, 4vw, 24px) 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.brand-lockup,
.account-summary {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 11px;
}

.brand-lockup img {
  flex: 0 0 auto;
  border-radius: 9px;
}

.eyebrow {
  margin: 0 0 2px;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.app-name {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.15;
}

.account-summary {
  justify-content: flex-end;
  gap: 12px;
}

.account-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.25;
}

#user-role {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  color: #4e761a;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--green-100);
  border: 1px solid rgba(113, 166, 43, 0.16);
  border-radius: 999px;
}

.connection-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(113, 166, 43, 0.12);
}

.connection-pill.offline .connection-dot {
  background: #ffb55e;
  box-shadow: 0 0 0 3px rgba(255, 181, 94, 0.12);
}

.sign-out-button {
  min-height: 36px;
  padding: 7px 11px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.sign-out-button:hover {
  border-color: rgba(113, 166, 43, 0.45);
}

main {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px) clamp(14px, 3vw, 24px) 148px;
}

#app {
  min-height: calc(100vh - 130px);
  padding: clamp(18px, 3vw, 26px);
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48vh;
  color: var(--muted);
  font-weight: 600;
}

.signed-out .topbar,
.signed-out .notice-banner {
  display: none;
}

/* No navigation is shown when signed out, so the desktop sidebar's space is not reserved either. */
.signed-out main {
  display: grid;
  width: auto;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-block: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
  place-items: center;
}

.signed-out #app {
  width: 100%;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.sign-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 340px);
  margin: 0 auto;
  text-align: center;
}

.sign-in img {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 14px 30px -18px rgba(64, 96, 20, 0.65);
}

.sign-in h1 {
  display: grid;
  gap: 6px;
  margin: 22px 0 32px;
}

.sign-in-company {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
}

.sign-in-app {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.sign-in .sign-in-link {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
}

.sign-in-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-message {
  width: 100%;
  margin: 18px 0 0;
  padding: 12px 14px;
  color: var(--danger);
  font-size: 0.84rem;
  line-height: 1.45;
  background: var(--danger-soft);
  border: 1px solid rgba(161, 59, 52, 0.2);
  border-radius: 10px;
}

.access-code-form {
  display: grid;
  width: min(100%, 330px);
  gap: 12px;
  text-align: left;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--line);
  border-top-color: var(--green-link);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.page-heading p {
  max-width: 540px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.phase-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #587d24;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--green-100);
  border-radius: 999px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.material-filter-panel {
  grid-template-areas:
    "search actions"
    "filters filters"
    "view view";
}

.material-filter-panel .search-field {
  grid-area: search;
}

.material-filter-panel .catalog-actions {
  grid-area: actions;
}

.material-filter-controls {
  grid-area: filters;
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.material-filter-panel .material-view-controls {
  grid-area: view;
}

.filter-select {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
}

.filter-select span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.filter-select select {
  min-height: 44px;
  padding: 8px 34px 8px 11px;
  color: var(--ink);
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.filter-select select:focus {
  background: white;
  border-color: var(--green);
}

.catalog-actions,
.empty-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 19px;
  height: 19px;
  fill: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px 9px 41px;
  color: var(--ink);
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.search-field input:focus {
  background: white;
  border-color: var(--green);
}

.quick-filters {
  display: flex;
  gap: 5px;
  padding: 4px;
  background: #f0f0ed;
  border-radius: 10px;
}

.quick-filter {
  min-height: 36px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.quick-filter.active {
  color: white;
  background: var(--green);
  box-shadow: 0 5px 14px -6px rgba(64, 96, 20, 0.7);
}

.result-count {
  margin: 0 0 10px 3px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
}

.backup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.catalog-sync-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 12px;
  padding: 16px 18px;
  color: white;
  background: linear-gradient(135deg, var(--ink), #283d4a);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.catalog-sync-card h2 {
  margin: 2px 0 5px;
  color: white;
  font-size: 1rem;
}

.catalog-sync-card p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  line-height: 1.5;
}

.catalog-sync-card .eyebrow {
  color: #b9dc8d;
}

.catalog-sync-card .secondary-button {
  flex: 0 0 auto;
  color: var(--ink);
  background: white;
  border-color: white;
}

.backup-card h2 {
  margin: 2px 0 5px;
  color: var(--ink);
  font-size: 1rem;
}

.backup-card p:not(.eyebrow),
.backup-card div > span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.backup-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backup-status {
  white-space: nowrap;
  color: #52781e;
  font-size: 0.78rem;
  font-weight: 600;
}

.backup-status.error {
  color: var(--danger);
}

.request-list,
.material-list {
  display: grid;
  gap: 12px;
}

.material-groups {
  display: grid;
  gap: 24px;
}

.material-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 9px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(113, 166, 43, 0.35);
}

.material-group > header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
}

.material-group > header span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.load-more-row .secondary-button {
  min-width: min(240px, 100%);
}

.request-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 22px;
  padding: 18px 19px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

/* The request a Cliq link opened is ringed for a few seconds so it is easy to find. */
.request-card {
  transition: box-shadow 0.6s ease-out;
}

.request-card.linked-request {
  box-shadow: 0 0 0 3px rgba(113, 166, 43, 0.45), var(--shadow);
}

.request-card h2 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
}

.item-summary {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-summary li {
  color: #555751;
  line-height: 1.35;
}

.item-summary label {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.item-summary input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green-hover);
}

.item-summary input:not(:disabled),
.item-summary input:not(:disabled) + span {
  cursor: pointer;
}

.item-summary input:disabled {
  opacity: 1;
}

.item-summary li.pulled span {
  color: #878982;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.item-summary strong {
  color: var(--ink);
}

.request-thumbnails {
  position: relative;
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
}

.request-thumbnail {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  padding: 0;
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: zoom-in;
}

.request-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.request-meta {
  min-width: 132px;
  text-align: right;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: #52781e;
  font-size: 0.77rem;
  font-weight: 600;
  background: var(--success-soft);
  border-radius: 999px;
}

.needed-date {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.due-label {
  display: block;
  margin-top: 3px;
  color: #916c00;
  font-size: 0.75rem;
  font-weight: 600;
}

.request-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid #edf1f3;
}

.request-history {
  display: grid;
  gap: 2px;
  text-align: right;
}

/* Cards size to their column, not the screen: a card in a two-column desktop grid is as narrow
   as one on a large phone, so it stacks its footer the same way. The footer is the container
   rather than the card, because containment on the card would also trap its "⋯" menu inside it. */
.request-footer {
  container-type: inline-size;
  flex-wrap: wrap;
}

@container (max-width: 520px) {
  .request-footer > * {
    flex: 1 1 100%;
  }

  .request-history {
    text-align: left;
  }
}

.request-card .request-actions,
.truck-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.request-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.request-actions button {
  min-height: 42px;
}

.danger-button {
  color: var(--danger);
}

.request-notes {
  max-width: 68%;
  margin: 0;
  line-height: 1.4;
}

.active-team-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 14px;
  padding: 10px 13px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  background: #f1f7e8;
  border: 1px solid #d8e6c4;
  border-radius: 10px;
}

.active-team-filter .text-button {
  min-height: 36px;
}

.dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.dashboard-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 13px;
  min-height: 104px;
  padding: 17px 18px;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.dashboard-tile:disabled {
  cursor: default;
}

.dashboard-tile strong {
  grid-row: 1 / span 2;
  color: var(--ink);
  font-size: 2.15rem;
  line-height: 1;
}

.dashboard-tile > span {
  align-self: end;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.dashboard-tile small {
  align-self: start;
  color: var(--muted);
  font-size: 0.75rem;
}

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

.dashboard-panel {
  padding: 17px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.dashboard-panel > header,
.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-panel header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.dashboard-panel header span {
  color: var(--muted);
  font-size: 0.875rem;
}

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

.dashboard-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dashboard-request-row h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.dashboard-request-row p,
.dashboard-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.dashboard-request-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.dashboard-request-meta strong {
  color: #7c650c;
  font-size: 0.875rem;
}

.dashboard-request-meta strong.overdue {
  color: var(--danger);
}

.dashboard-activity {
  margin-top: 12px;
}

.dashboard-rma-panel {
  margin-top: 12px;
}

.activity-header > div:first-child {
  display: grid;
  gap: 3px;
}

.activity-navigation {
  display: flex;
  gap: 7px;
}

.activity-navigation .secondary-button {
  min-width: 46px;
  padding-inline: 12px;
}

.activity-table-wrap {
  position: relative;
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.activity-table th,
.activity-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.activity-table th:first-child,
.activity-table td:first-child {
  text-align: left;
}

.activity-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-warm);
}

.activity-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

.activity-person {
  padding: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-underline-offset: 3px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.activity-person:hover,
.activity-person:focus-visible {
  color: var(--green-700);
}

.activity-table tr:last-child th,
.activity-table tr:last-child td {
  border-bottom: 0;
}

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

.rma-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.rma-card > header,
.rma-card > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.rma-card h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
}

.rma-manufacturer {
  margin: 0;
  color: var(--green-700);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rma-details {
  display: grid;
  gap: 5px;
}

.rma-details p,
.rma-card > footer > span,
.form-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.rma-details p:first-child {
  color: var(--ink);
}

.rma-card > footer {
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rma-card .request-actions {
  grid-column: auto;
  flex: 0 0 auto;
}

.rma-stock-result {
  margin: 0;
  padding: 10px 12px;
  color: #52781e;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.45;
  background: var(--success-soft);
  border-radius: 9px;
}

.status-badge.status-sent {
  color: #316795;
  background: #e8f2fa;
}

.status-badge.status-cancelled {
  color: #6f716c;
  background: #eeefec;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0;
}

.calendar-modes {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.calendar-modes button {
  min-height: 40px;
  padding: 8px 15px;
  color: var(--muted);
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.calendar-modes button.active {
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow);
}

.calendar-navigation {
  display: flex;
  gap: 7px;
}

.calendar-navigation .secondary-button {
  min-width: 46px;
  padding-inline: 13px;
}

.calendar-period {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
}

.month-calendar {
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  padding: 10px 4px;
}

.calendar-cell {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 74px;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.calendar-cell:hover {
  background: var(--green-50);
}

.calendar-cell.outside-month {
  color: #a0a29c;
  background: #fafaf8;
}

.calendar-cell.selected {
  position: relative;
  color: #38560f;
  background: var(--green-100);
  box-shadow: inset 0 0 0 2px var(--green);
}

.calendar-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 8px;
}

.calendar-dots i {
  width: 7px;
  height: 7px;
  background: var(--warning);
  border-radius: 50%;
}

.calendar-dots i.approved {
  background: #4b8ac4;
}

.calendar-dots i.fulfilled {
  background: var(--success);
}

.calendar-dots i.more {
  background: #8a8c86;
}

.calendar-day-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.calendar-agenda {
  display: grid;
  gap: 11px;
}

.calendar-agenda .calendar-day-section {
  margin-top: 0;
}

.calendar-day-heading,
.calendar-request,
.calendar-request-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-day-heading {
  margin-bottom: 11px;
}

.calendar-day-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.calendar-day-heading > span,
.calendar-request-meta > span:last-child {
  color: var(--muted);
  font-size: 0.875rem;
}

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

.calendar-request {
  padding: 13px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.calendar-request h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.calendar-request p,
.calendar-day-empty,
.calendar-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.calendar-request-meta {
  flex: 0 0 auto;
}

.status-badge.status-approved {
  color: #316795;
  background: #e8f2fa;
}

.status-badge.status-fulfilled {
  color: #52781e;
  background: var(--success-soft);
}

.calendar-empty {
  padding: 42px 20px;
  text-align: center;
  background: var(--surface-warm);
  border: 1px dashed rgba(0, 0, 0, 0.16);
  border-radius: var(--radius-medium);
}

.calendar-empty h2 {
  margin: 0 0 7px;
  font-size: 1.05rem;
}

.empty-state {
  padding: clamp(34px, 9vw, 60px) 22px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed rgba(0, 0, 0, 0.16);
  border-radius: var(--radius-large);
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: #5f8b23;
  font-size: 1.6rem;
  font-weight: 600;
  background: var(--green-100);
  border-radius: 14px;
}

.empty-state h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
}

.empty-state p {
  max-width: 500px;
  margin: 0 auto 18px;
  color: var(--muted);
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 10px 17px;
  font-weight: 600;
  border-radius: 11px;
}

.primary-button {
  color: white;
  background: var(--green);
  box-shadow: 0 5px 14px -6px rgba(64, 96, 20, 0.7);
}

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

.primary-button:disabled {
  color: #7a8289;
  background: #d9dee1;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary-button {
  color: #555751;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.text-button {
  padding: 8px 2px;
  color: #5d8722;
  font-weight: 600;
  background: transparent;
}

.floating-action {
  position: fixed;
  z-index: 25;
  right: max(20px, calc((100vw - 1440px) / 2 + 32px));
  bottom: calc(82px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: white;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  background: var(--green);
  border: 3px solid white;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(64, 96, 20, 0.36);
  cursor: pointer;
}

.floating-action:hover {
  transform: translateY(-2px);
}

.tab-bar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  min-height: calc(70px + env(safe-area-inset-bottom));
  padding: 7px max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-right));
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: flex;
  flex: 0 0 min(13.5vw, 112px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 74px;
  min-height: 56px;
  padding: 4px 7px;
  color: #697888;
  font-size: 0.7rem;
  font-weight: 500;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.tab svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.tab.active {
  color: #4d7419;
  background: var(--green-100);
}

.nav-action,
.tab-more {
  display: none;
}

.tab-more:not([hidden]) {
  display: flex;
}

.more-menu {
  position: fixed;
  z-index: 30;
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(80px + env(safe-area-inset-bottom));
  display: grid;
  min-width: 200px;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

body.more-menu-open .floating-action {
  visibility: hidden;
}

.more-menu[hidden] {
  display: none;
}

.more-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.more-menu button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.more-menu button.active {
  color: #4d7419;
  background: var(--green-100);
}

.tab.active::before {
  position: absolute;
  top: -7px;
  width: 34px;
  height: 3px;
  content: "";
  background: var(--green);
  border-radius: 0 0 5px 5px;
}

.tab:disabled {
  opacity: 0.43;
  cursor: not-allowed;
}

.material-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.material-card {
  padding: 17px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.material-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.material-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.material-sku {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.stock-count {
  flex: 0 0 auto;
  color: #5b861f;
  font-size: 1.05rem;
  font-weight: 600;
}

.material-card-details {
  display: grid;
  gap: 4px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.material-card-footer .overflow-menu > summary {
  width: 34px;
  height: 34px;
}

.material-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid #edf1f3;
}

.material-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.material-actions .text-button {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 0.85rem;
}

.material-view-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.column-picker > summary {
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
}

.column-picker .overflow-items {
  min-width: 200px;
}

.column-picker .overflow-items label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
}

.column-picker .overflow-items label:hover {
  background: var(--surface-warm);
}

.material-table-wrap {
  position: relative;
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.material-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.material-table th,
.material-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.material-table th.num,
.material-table td.num {
  text-align: right;
}

.material-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-warm);
}

.material-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

.material-table tbody tr:last-child th,
.material-table tbody tr:last-child td {
  border-bottom: 0;
}

.material-table-actions {
  text-align: right;
}

.sheet {
  width: min(680px, calc(100vw - 24px));
  max-height: min(860px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.small-sheet {
  width: min(590px, calc(100vw - 24px));
}

.sheet::backdrop {
  background: rgba(43, 43, 43, 0.48);
  backdrop-filter: blur(3px);
}

.sheet[open] {
  animation: sheet-in 180ms ease-out;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
}

.sheet form,
.share-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
}

.sheet-header,
.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 20px;
}

.sheet-header {
  color: var(--ink);
  background: white;
  border-bottom: 1px solid var(--line);
}

.sheet-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #666861;
  font-size: 1.8rem;
  line-height: 1;
  background: #f1f1ee;
  border-radius: 10px;
}

.sheet-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  padding: 22px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.import-sheet-body {
  grid-template-columns: 1fr;
}

.delivery-sheet-body {
  grid-template-columns: 1fr 1fr;
}

.delivery-camera,
.delivery-camera + .camera-button,
.delivery-camera + .camera-button + .photo-help,
.delivery-match,
#delivery-message {
  grid-column: 1 / -1;
}

.delivery-camera {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111a20;
  border-radius: 12px;
}

.delivery-camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delivery-camera > span {
  position: absolute;
  inset: 18% 12%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25);
}

.delivery-camera > span::after {
  position: absolute;
  top: 50%;
  right: 8px;
  left: 8px;
  height: 2px;
  content: "";
  background: var(--green-hover);
  box-shadow: 0 0 10px rgba(143, 198, 73, 0.85);
}

.camera-button {
  min-height: 48px;
  padding: 10px 14px;
  color: #52781e;
  font-weight: 600;
  background: var(--green-100);
  border: 1px solid rgba(113, 166, 43, 0.4);
  border-radius: 10px;
  cursor: pointer;
}

.camera-button:disabled {
  color: var(--muted);
  background: var(--canvas);
  border-color: var(--line);
  cursor: not-allowed;
}

.delivery-match {
  padding: 13px;
  border-radius: 10px;
}

.delivery-match p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.delivery-match.found {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #466a19;
  background: var(--green-100);
}

.delivery-match-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  font-weight: 600;
  background: var(--green);
  border-radius: 50%;
}

.delivery-match.missing {
  color: var(--danger);
  background: var(--danger-soft);
}

.delivery-match.missing .text-button {
  margin-top: 8px;
}

.import-preview {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.import-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.import-preview-heading h3,
.import-samples h4 {
  margin: 2px 0 0;
  color: var(--ink);
}

.import-preview-heading h3 {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.import-preview-heading > span {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: #52781e;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--green-100);
  border-radius: 999px;
}

.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.import-summary-grid div {
  display: grid;
  gap: 2px;
  padding: 10px;
  text-align: center;
  background: var(--canvas);
  border-radius: 9px;
}

.import-summary-grid strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.import-summary-grid span,
.import-detection,
.import-warning p,
.import-warning li,
.import-samples small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.import-detection,
.import-warning p {
  margin: 0;
}

.import-warning {
  padding: 12px;
  color: #71530c;
  background: #fff8df;
  border: 1px solid rgba(219, 160, 0, 0.25);
  border-radius: 9px;
}

.import-warning ul,
.import-samples ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.import-warning li + li,
.import-samples li + li {
  margin-top: 7px;
}

.import-samples h4 {
  font-size: 0.88rem;
}

.import-samples li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.import-samples strong,
.import-samples small {
  display: block;
  overflow-wrap: anywhere;
}

.import-action {
  padding: 4px 6px;
  color: #52781e;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  background: var(--green-100);
  border-radius: 999px;
}

.import-action.update {
  color: #785814;
  background: #fff2c6;
}

.import-action.unchanged {
  color: var(--muted);
  background: var(--canvas);
}

.full-width,
.line-items-fieldset,
.form-message,
.field:has(textarea),
.request-photos-field {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.field > span,
.line-items-fieldset legend {
  color: #666861;
  font-size: 0.87rem;
  font-weight: 600;
}

.field small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.field input,
.field select,
.field textarea,
.request-line input,
.request-line select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 10px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.request-line input:focus,
.request-line select:focus {
  border-color: rgba(113, 166, 43, 0.7);
  box-shadow: 0 0 0 3px rgba(113, 166, 43, 0.1);
}

.field textarea {
  min-height: 88px;
  line-height: 1.45;
  resize: vertical;
}

.photo-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 14px;
  color: #52781e;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--green-100);
  border: 1px dashed rgba(113, 166, 43, 0.48);
  border-radius: 10px;
  cursor: pointer;
}

.photo-picker span {
  font-size: 1.25rem;
  line-height: 1;
}

.photo-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.request-photo-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 9px;
}

.request-photo-preview {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.request-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.request-photo-preview button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: white;
  font-size: 1.15rem;
  background: rgba(43, 43, 43, 0.78);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.photo-viewer {
  width: min(920px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  background: #1f211f;
  border: 0;
  border-radius: 14px;
}

.photo-viewer::backdrop {
  background: rgba(20, 22, 20, 0.82);
  backdrop-filter: blur(4px);
}

.photo-viewer img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 24px);
  object-fit: contain;
}

.photo-viewer-close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: white;
  font-size: 1.65rem;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  cursor: pointer;
}

.line-items-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.line-items-fieldset legend {
  margin-bottom: 9px;
}

#request-lines {
  display: grid;
  gap: 9px;
}

.request-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 42px;
  gap: 8px;
}

.line-label {
  display: block;
  margin: 0 0 6px;
  color: #777872;
  font-size: 0.78rem;
  font-weight: 500;
}

.request-line .remove-line {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--danger);
  font-size: 1.15rem;
  background: var(--danger-soft);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.catalog-needed {
  padding: 15px;
  color: #5c782e;
  line-height: 1.45;
  background: var(--green-100);
  border-radius: 10px;
}

.form-message {
  min-height: 0;
  color: var(--danger);
  font-size: 0.87rem;
  font-weight: 600;
  line-height: 1.4;
}

.form-message:not(:empty) {
  padding: 10px 12px;
  background: var(--danger-soft);
  border-radius: 9px;
}

.sheet-actions {
  justify-content: flex-end;
  background: #f7f6f2;
  border-top: 1px solid var(--line);
}

.toast-region {
  position: fixed;
  z-index: 80;
  top: max(90px, calc(env(safe-area-inset-top) + 72px));
  right: 18px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  color: white;
  font-weight: 600;
  line-height: 1.35;
  background: #3f5d18;
  border-radius: 11px;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-left-color: #ff7a70;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

@keyframes celebrate {
  0% { opacity: 0; transform: scale(0.5) rotate(-12deg); }
  35% { opacity: 1; transform: scale(1.12) rotate(3deg); }
  70% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.08); }
}

.truck-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 18px;
}

.truck-overview > div {
  display: grid;
  align-content: center;
  min-height: 78px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.truck-overview strong {
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
}

.truck-overview span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.truck-overview .attention {
  background: #fff9e7;
  border-color: rgba(255, 189, 0, 0.5);
}

.truck-overview > .primary-button {
  align-self: center;
  min-height: 46px;
}

.truck-list {
  display: grid;
  gap: 16px;
}

.truck-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.truck-card-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #30312e, #465f26);
}

.truck-code-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #2f312e;
  font-size: 0.9rem;
  font-weight: 600;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.truck-card-header .eyebrow,
.truck-card-header h2,
.truck-card-header p {
  color: white;
}

.truck-card-header h2 {
  margin: 3px 0 2px;
  font-size: 1.08rem;
}

.truck-card-header p:not(.eyebrow) {
  margin: 0;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.68;
}

.truck-card-summary {
  display: grid;
  justify-items: end;
  color: white;
}

.truck-card-summary > strong {
  font-size: 1.3rem;
}

.truck-card-summary > span {
  font-size: 0.72rem;
  opacity: 0.7;
}

.truck-card-summary b {
  margin-top: 6px;
  padding: 4px 7px;
  color: #513d00;
  font-size: 0.68rem;
  background: #ffd768;
  border-radius: 999px;
}

.truck-card-summary b.all-set {
  color: #365315;
  background: #dff1c9;
}

.truck-stock-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.truck-stock-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.truck-stock-row.below-minimum {
  background: var(--warning-soft);
}

.truck-stock-name,
.truck-stock-name span {
  display: grid;
}

.truck-stock-name strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.truck-stock-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.73rem;
}

.truck-stock-levels {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.truck-stock-levels span:first-child {
  color: var(--ink);
}

.truck-stock-levels strong {
  font-size: 1rem;
}

.low-stock-flag {
  padding: 5px 8px;
  color: var(--warning-ink);
  font-size: 0.68rem;
  font-weight: 600;
  background: #fbe3b0;
  border-radius: 999px;
  white-space: nowrap;
}

.truck-stock-empty {
  padding: 20px 18px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.truck-stock-empty p {
  margin: 0;
}

.truck-card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  background: var(--surface-warm);
}

.truck-card-actions .primary-button {
  margin-left: auto;
}

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

.truck-material-picker > span {
  margin-bottom: 1px;
}

.truck-material-results {
  display: grid;
  max-height: 290px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.truck-material-results > p {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.truck-material-results button {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.truck-material-results button:last-child {
  border-bottom: 0;
}

.truck-material-results button:hover {
  background: var(--green-100);
}

.truck-material-results button strong {
  font-size: 0.84rem;
}

.truck-material-results button span,
.truck-material-selected span {
  color: var(--muted);
  font-size: 0.73rem;
}

.truck-material-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 11px 13px;
  background: var(--green-100);
  border: 1px solid rgba(113, 166, 43, 0.25);
  border-radius: 10px;
}

.truck-material-selected > div {
  display: grid;
  gap: 3px;
}

.truck-stock-actions > span {
  flex: 1;
}

.overflow-menu {
  position: relative;
}

.overflow-menu > summary {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--muted);
  font-size: 1.1rem;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.overflow-menu > summary::-webkit-details-marker {
  display: none;
}

.overflow-menu > summary:hover,
.overflow-menu[open] > summary {
  color: var(--ink);
  background: var(--surface-warm);
}

.overflow-items {
  position: absolute;
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 190px;
  padding: 5px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

/* An open menu is placed against the screen by script, so a card's rounded-corner clipping or a
   table's scroll area can never cut it off. It stays invisible until it has been placed. */
.overflow-menu[open] > .overflow-items:not([data-placed]) {
  visibility: hidden;
}

.overflow-items button {
  padding: 11px 12px;
  color: var(--ink);
  font-size: 0.85rem;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.overflow-items button:hover {
  background: var(--surface-warm);
}

.overflow-items .danger-button {
  color: var(--danger);
}

.subtle-icon-button {
  width: 34px;
  height: 34px;
  color: var(--muted);
  font-size: 0.9rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tools-section {
  margin-top: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.tools-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  list-style: none;
  cursor: pointer;
}

.tools-section > summary::-webkit-details-marker {
  display: none;
}

.tools-section > summary::after {
  content: '⌄';
  color: var(--muted);
  font-size: 1.1rem;
}

.tools-section[open] > summary::after {
  content: '⌃';
}

.tools-section summary span {
  display: grid;
  gap: 2px;
}

.tools-section summary strong {
  font-size: 0.95rem;
}

.tools-section summary small {
  color: var(--muted);
  font-size: 0.74rem;
}

.tools-section-body {
  padding: 0 14px 14px;
}

.tools-section-body > *:first-child {
  margin-top: 0;
}

.material-entry {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.material-entry-field input {
  font-size: 1rem;
}

.material-entry-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.material-result-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.material-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  min-height: 54px;
  padding: 9px 12px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.material-result:hover,
.material-result:focus-visible {
  background: var(--green-100);
  border-color: rgba(113, 166, 43, 0.4);
}

.material-result-name {
  grid-column: 1;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.material-result-detail {
  grid-column: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-result-add {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  color: var(--green-700);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--green-100);
  border-radius: 8px;
}

.custom-result {
  border-style: dashed;
}

.custom-result.prominent {
  background: var(--green-50);
  border-color: rgba(113, 166, 43, 0.35);
}

.custom-tag {
  margin-left: 4px;
  padding: 1px 7px;
  color: var(--warning-ink);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  vertical-align: 1px;
  background: var(--warning-soft);
  border-radius: 999px;
}

.custom-cost-body {
  grid-template-columns: 1fr;
}

.custom-cost-lines {
  display: grid;
  gap: 12px;
}

.request-line-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.request-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: 8px;
  padding: 9px 8px 9px 12px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.request-line-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.request-line-name strong {
  font-size: 0.88rem;
  line-height: 1.3;
}

.request-line-name span {
  color: var(--muted);
  font-size: 0.71rem;
}

.request-line-quantity {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}

.request-line-quantity .line-quantity {
  flex: none;
  width: 48px;
  min-height: 38px;
  padding: 0 4px;
  text-align: center;
}

.step-button {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  font-size: 1.1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.step-button:hover {
  background: var(--green-100);
}

.request-line-count,
.request-line-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

/* ---------------------------------------------------------------- Drafts and team lists */

.draft-lists {
  margin: 0 0 22px;
}

.draft-lists h2 {
  margin: 0 0 10px 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.draft-list-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.draft-list-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  background: white;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-medium);
  cursor: pointer;
}

.draft-list-card:hover,
.draft-list-card:focus-visible {
  border-color: var(--green);
}

.draft-list-card strong {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-list-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.draft-list-card .draft-list-badge {
  justify-self: start;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  background: #f0f0ed;
  border-radius: 999px;
}

.draft-list-card .draft-list-badge.team {
  color: var(--green-700);
  background: var(--green-100);
}

.page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* The request sheet is two columns on a wide screen; these always span it. */
.list-status,
.list-remove-row {
  grid-column: 1 / -1;
}

.list-status {
  margin: 0;
  padding: 9px 12px;
  color: var(--green-700);
  font-size: 0.84rem;
  line-height: 1.4;
  background: var(--green-50);
  border-radius: 10px;
}

.list-status.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.list-share-code {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.list-share-code span {
  color: var(--muted);
  font-size: 0.8rem;
}

.list-share-code strong,
.share-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
}

.list-share-code strong {
  font-size: 1.5rem;
  font-weight: 600;
}

.share-code-input {
  text-transform: uppercase;
}

.list-share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.invite-matches {
  display: grid;
  gap: 6px;
}

.invite-matches:empty,
.invite-picks:empty {
  display: none;
}

.invite-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.invite-pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 3px 3px 11px;
  color: var(--green-700);
  font-size: 0.86rem;
  font-weight: 600;
  background: var(--green-100);
  border-radius: 999px;
}

.invite-pick button {
  width: 28px;
  height: 28px;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.invite-send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.invite-summary {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  list-style: none;
}

.invite-summary .sent {
  color: var(--green-700);
}

.invite-summary .warning {
  color: var(--warning-ink);
}

.invite-other-ways summary {
  color: var(--green-link);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.invite-other-ways[open] {
  display: grid;
  gap: 12px;
}

.list-remove-row {
  margin-top: -6px;
}

.share-sheet-body {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.share-intro,
.share-hint {
  margin: 0;
  line-height: 1.45;
}

.share-intro {
  color: var(--ink);
  font-size: 0.92rem;
}

.share-hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.request-extras-tools,
.material-entry-tools {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.paste-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.paste-list textarea {
  font-family: inherit;
}

.paste-list-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.paste-list-result p {
  margin: 0 0 6px;
  font-size: 0.8rem;
}

.paste-list-unmatched-title {
  color: var(--muted);
  font-size: 0.75rem;
}

.paste-list-unmatched {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.paste-list-unmatched button {
  width: 100%;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.8rem;
  text-align: left;
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 4px;
  padding: 12px 16px;
  background: var(--warning-soft);
  border: 1px solid rgba(244, 156, 32, 0.32);
  border-radius: var(--radius-medium);
}

.notice-banner p {
  margin: 0;
  color: var(--warning-ink);
  font-size: 0.84rem;
  line-height: 1.45;
}

.notice-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--warning);
  border-radius: 50%;
}

.notice-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.notice-card h2 {
  margin: 2px 0 4px;
  font-size: 1rem;
}

.notice-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

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

.notice-posted {
  flex: 1;
  min-width: 160px;
  color: var(--muted);
  font-size: 0.73rem;
}

.export-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.export-heading h2 {
  margin: 2px 0 4px;
  font-size: 1rem;
}

.export-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.export-download {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.offline-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 13px 16px;
  background: var(--warning-soft);
  border: 1px solid rgba(244, 156, 32, 0.32);
  border-radius: var(--radius-medium);
}

.offline-banner strong {
  color: var(--warning-ink);
  font-size: 0.85rem;
}

.offline-banner span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.queued-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.queued-request {
  border-style: dashed;
}

.queued-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.queued-detail {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.status-badge.status-queued {
  color: var(--warning-ink);
  background: #fbe3b0;
}

.report-period {
  color: var(--muted);
  font-size: 0.78rem;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.report-summary > div {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.report-summary strong {
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1.1;
}

.report-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.report-summary-cost strong {
  font-size: 1.15rem;
}

.report-job-pick {
  display: grid;
  place-items: center;
  align-self: start;
  margin-top: 2px;
}

.report-job-pick input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

.report-job > header {
  align-items: start;
}

.export-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.report-list {
  display: grid;
  gap: 14px;
}

.report-job {
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.report-job > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.report-job h2 {
  margin: 0;
  font-size: 1rem;
}

.report-job header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.report-job-total {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-job-total .overflow-menu > summary {
  width: 34px;
  height: 34px;
}

.report-job header strong {
  font-size: 1.05rem;
  white-space: nowrap;
}

.report-material-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-material {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
}

.report-material:last-child {
  border-bottom: 0;
}

.report-material-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.report-material-name strong {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.report-material-name span {
  color: var(--muted);
  font-size: 0.72rem;
}

.report-material-quantity {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.report-material-cost {
  min-width: 72px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.report-footnote {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.truck-stock-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.truck-stock-row-actions .secondary-button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.78rem;
}

.truck-use-history {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-warm);
}

.truck-use-history h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.truck-use-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.truck-use-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.truck-use-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.truck-use-row strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.truck-use-row span {
  color: var(--muted);
  font-size: 0.72rem;
}

.truck-use-time {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.truck-use-form-grid {
  grid-template-columns: 1fr 1fr;
}

.truck-use-scan {
  display: grid;
  gap: 10px;
}

.truck-use-scan .photo-help {
  margin: 0;
}

.restock-badge {
  padding: 4px 9px;
  color: var(--green-700);
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--green-100);
  border: 1px solid rgba(113, 166, 43, 0.3);
  border-radius: 999px;
  white-space: nowrap;
}

.restock-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 720px) {
  .backup-card,
  .catalog-sync-card,
  .backup-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-tiles,
  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .truck-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .truck-overview > .primary-button {
    grid-column: 1 / -1;
  }

  .truck-stock-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .truck-stock-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .truck-use-form-grid {
    grid-template-columns: 1fr;
  }

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

  .export-controls {
    grid-template-columns: 1fr 1fr;
  }

  .export-controls .field:last-child {
    grid-column: 1 / -1;
  }

  .export-download {
    justify-self: stretch;
    justify-content: center;
  }

  .truck-stock-levels {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .dashboard-tile {
    min-height: 86px;
  }

  .backup-actions {
    gap: 8px;
  }

  .topbar {
    min-height: 60px;
  }

  .brand-lockup img {
    width: 38px;
    height: 38px;
  }

  .brand-lockup .eyebrow,
  .account-copy {
    display: none;
  }

  .sign-out-button {
    min-height: 32px;
    padding: 6px 8px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .material-filter-panel {
    grid-template-areas:
      "search"
      "filters"
      "actions"
      "view";
  }

  .material-filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .material-view-controls {
    justify-content: space-between;
  }

  .catalog-actions,
  .empty-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .catalog-actions [data-scan-delivery] {
    grid-column: 1 / -1;
  }

  main {
    padding-top: 12px;
    padding-right: 10px;
    padding-left: 10px;
  }

  #app {
    padding: 17px 14px;
    border-radius: 14px;
  }

  /* Equal-width buttons, one column per option, so a two-option switch leaves no empty slot. */
  .quick-filters {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-modes,
  .calendar-navigation {
    width: 100%;
  }

  .calendar-navigation {
    display: grid;
    grid-template-columns: 46px 1fr 46px;
  }

  .sheet {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 10px);
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .sheet[open] {
    animation-name: mobile-sheet-in;
  }

  @keyframes mobile-sheet-in {
    from { opacity: 0; transform: translateY(50px); }
  }

  .sheet-body,
  .material-form-grid,
  .rma-form-grid,
  .truck-form-grid,
  .truck-stock-form-grid,
  .delivery-sheet-body {
    grid-template-columns: 1fr;
  }

  .field,
  .compact-field,
  .full-width,
  .line-items-fieldset,
  .form-message,
  .field:has(textarea),
  .request-photos-field {
    grid-column: 1;
  }

  .import-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 470px) {
  .account-summary {
    gap: 6px;
  }

  .connection-pill {
    padding-inline: 8px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .catalog-actions,
  .empty-actions {
    grid-template-columns: 1fr;
  }

  .catalog-actions [data-scan-delivery] {
    grid-column: 1;
  }

  .material-filter-controls {
    grid-template-columns: 1fr;
  }

  .truck-card-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .truck-card-summary {
    grid-column: 1 / -1;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    justify-items: start;
    gap: 6px;
  }

  .truck-card-summary b {
    justify-self: end;
    margin-top: 0;
  }

  .request-card {
    grid-template-columns: 1fr;
  }

  .rma-card > header,
  .rma-card > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .rma-card .request-actions {
    justify-content: flex-start;
  }

  .dashboard-panel,
  .dashboard-request-row,
  .activity-header {
    align-items: stretch;
  }

  .dashboard-request-row,
  .activity-header {
    flex-direction: column;
  }

  .dashboard-request-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .activity-navigation {
    display: grid;
    grid-template-columns: 46px 1fr 46px;
  }

  .calendar-cell {
    min-height: 58px;
    padding: 7px 5px;
    font-size: 0.875rem;
  }

  .calendar-weekdays {
    font-size: 0.75rem;
  }

  .calendar-day-section {
    padding: 13px;
  }

  .calendar-request,
  .calendar-request-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-request-meta {
    gap: 5px;
  }

  .request-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .needed-date {
    margin: 0;
  }

  .due-label {
    text-align: right;
  }

  .request-footer {
    display: grid;
  }

  .request-history {
    text-align: left;
  }

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

  .request-actions:has(:only-child) {
    grid-template-columns: 1fr;
  }

  .request-notes {
    max-width: 100%;
  }

  .floating-action {
    right: 18px;
  }

  .sheet-header,
  .sheet-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .sheet-body {
    padding: 18px 16px;
  }

  #request-dialog .sheet-actions {
    gap: 8px;
  }

  /* The × in the header already closes the sheet, and three actions are what fit on a phone. */
  #request-cancel {
    display: none;
  }

  #request-dialog .sheet-actions .secondary-button,
  #request-dialog .sheet-actions .primary-button {
    padding-right: 12px;
    padding-left: 12px;
    white-space: nowrap;
  }
}


/* ---------------------------------------------------------------- Screen-size layouts
   Phone (under 720px): bottom tabs, five at most, with a More menu for the rest.
   Tablet (720px to 1099px): every tab fits along the bottom.
   Desktop (1100px and wider): a left sidebar, and card lists flow into columns. */

@media (max-width: 719px) {
  .tab-bar {
    justify-content: space-around;
    overflow: visible;
  }

  .tab {
    flex: 1 1 0;
    order: var(--phone-order, 0);
    min-width: 0;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 0.66rem;
  }

  .tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab[data-overflow] {
    display: none;
  }

  .tab-more {
    order: 99;
  }

  main {
    padding-right: 10px;
    padding-bottom: calc(160px + env(safe-area-inset-bottom));
    padding-left: 10px;
  }

  /* On an iPhone a sheet must clear the notch at the top and the home indicator at the bottom,
     or its close button and its Send button sit where they cannot be tapped. */
  .sheet {
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top) + 8px));
  }

  .sheet-actions {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 720px) {
  .tab-bar {
    justify-content: center;
    overflow: visible;
  }

  .tab {
    flex: 1 1 0;
    min-width: 0;
    max-width: 118px;
  }

  .tab-more,
  .more-menu {
    display: none !important;
  }

  .request-list,
  .rma-list,
  .report-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
    align-items: start;
  }
}

@media (min-width: 1100px) {
  :root {
    --sidebar-width: 236px;
  }

  .tab-bar {
    top: var(--topbar-height, 65px);
    right: auto;
    bottom: 0;
    left: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 2px;
    width: var(--sidebar-width);
    min-height: 0;
    padding: 20px 14px;
    overflow-y: auto;
    background: white;
    border-top: 0;
    border-right: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: none;
  }

  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    max-width: none;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--muted);
    font-size: 0.92rem;
  }

  .tab svg {
    width: 20px;
    height: 20px;
  }

  .tab.active::before {
    top: 10px;
    bottom: 10px;
    left: -14px;
    width: 3px;
    height: auto;
    border-radius: 0 3px 3px 0;
  }

  .nav-action:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    margin-bottom: 16px;
    color: white;
    font-weight: 600;
    background: var(--green);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 5px 14px -6px rgba(64, 96, 20, 0.7);
    cursor: pointer;
  }

  .nav-action:hover {
    background: var(--green-hover);
  }

  .nav-action span[aria-hidden] {
    font-size: 1.25rem;
    line-height: 1;
  }

  .floating-action {
    display: none !important;
  }

  main {
    width: auto;
    margin: 0 0 0 var(--sidebar-width);
    padding: 28px clamp(24px, 3vw, 44px) 48px;
  }

  #app,
  #notice-banner {
    max-width: 1280px;
    margin-right: auto;
    margin-left: auto;
  }

  .truck-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}
