:root {
  --bg: #f4f5f1;
  --ink: #18201d;
  --muted: #63706a;
  --line: #d8ded8;
  --panel: #ffffff;
  --atp: #0b6b5c;
  --workshop: #9b3d24;
  --accent: #d7a31a;
  --prepared: #2364aa;
  --danger: #a83232;
  --shadow: 0 18px 50px rgba(21, 31, 28, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  color: #fff;
  background: #16231f;
  border-bottom: 5px solid var(--accent);
}

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

.attention-badge {
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  background: #d33737;
  border: 0;
  border-radius: 5px;
  box-shadow: 0 0 0 4px rgba(211, 55, 55, 0.22);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  animation: attentionButtonPulse 1s ease-in-out infinite;
}

@keyframes attentionButtonPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.user-chip,
.queue-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

.workshop-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-toggle {
  min-height: 34px;
  padding: 7px 12px;
  color: #313131;
  background: #fff;
  border: 1px solid #cbd4dd;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.sound-toggle.enabled {
  color: #111;
  background: #fff3ae;
  border-color: #ffcf00;
}

.workshop-person {
  display: grid;
  gap: 3px;
  color: #4a5869;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.workshop-person select {
  min-height: 34px;
  min-width: 132px;
  padding: 6px 10px;
  color: #233044;
  background: #fff;
  border: 1px solid #cbd4dd;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
}

.user-chip {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.queue-chip {
  color: #fff;
  background: var(--workshop);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 28, 25, 0.84);
}

.login-overlay.is-hidden {
  display: none;
}

.login-box {
  width: min(760px, 100%);
  padding: 26px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  margin: 0;
  font-size: 28px;
}

.login-copy {
  margin: 8px 0 18px;
  color: var(--muted);
}

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

.pin-form {
  display: grid;
  gap: 12px;
  max-width: 360px;
  margin-top: 16px;
}

.pin-form label {
  display: grid;
  gap: 6px;
  color: #2f3b48;
  font-weight: 700;
}

.pin-back {
  justify-self: start;
  padding: 0;
  color: #3d5266;
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.pin-error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

.login-user {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 13px 14px;
  text-align: left;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.login-user strong {
  font-size: 16px;
}

.login-user span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-user:hover {
  border-color: var(--atp);
  background: #edf8f5;
}

.layout.owner-view {
  grid-template-columns: minmax(330px, 0.9fr) minmax(420px, 1.1fr);
}

.layout.single-view {
  grid-template-columns: minmax(0, 1fr);
}

.is-hidden {
  display: none !important;
}

.topbar h1,
.panel h2,
.history-inner h2,
.request-card h3 {
  margin: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 5px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.7;
  text-transform: uppercase;
}

.status-pill,
.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.status-pill {
  color: #dff7eb;
  background: rgba(255, 255, 255, 0.12);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e6c64b;
}

.status-pill.online .dot {
  background: #56d080;
}

.counter {
  color: #fff;
  background: var(--workshop);
}

.layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
  width: min(1420px, calc(100% - 36px));
  margin: 24px auto;
}

.panel,
.history-inner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  min-height: 600px;
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel h2,
.history-inner h2 {
  font-size: 22px;
}

.request-form {
  display: grid;
  gap: 14px;
}

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

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--atp);
  box-shadow: 0 0 0 3px rgba(11, 107, 92, 0.16);
}

.compact-select {
  max-width: 190px;
}

.tool-list {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
}

.tool-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 11px 12px;
  text-align: left;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.tool-option:hover,
.tool-option.selected {
  border-color: var(--atp);
  background: #edf8f5;
}

.tool-name {
  font-weight: 800;
}

.tool-uid {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.selected-tools {
  display: grid;
  gap: 7px;
}

.selected-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 52px;
  padding: 7px 9px;
  color: #075548;
  background: #edf8f5;
  border: 1px solid #b6ded5;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.selected-tool-label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.selected-tool-label strong {
  overflow-wrap: anywhere;
}

.selected-tool-label span {
  color: var(--muted);
  font-size: 12px;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.quantity-control button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #075548;
  background: #fff;
  border: 1px solid #b6ded5;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 900;
}

.quantity-control input {
  width: 54px;
  min-height: 32px;
  height: 32px;
  padding: 4px;
  text-align: center;
}

.primary-action,
.small-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-weight: 900;
}

.primary-action {
  color: #fff;
  background: var(--atp);
}

.small-action {
  color: #fff;
  background: var(--workshop);
}

.ghost-action {
  color: var(--ink);
  background: #fbfcfa;
  border-color: var(--line);
}

.request-stack {
  display: grid;
  gap: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.request-card {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 14px;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--workshop);
  border-radius: 8px;
}

.request-card.needs-attention {
  border-color: #ffcf00;
  border-left-color: #d33737;
  box-shadow: 0 0 0 3px rgba(255, 207, 0, 0.35), 0 3px 14px rgba(0, 0, 0, 0.18);
  animation: attentionPulse 1.2s ease-in-out infinite;
}

@keyframes attentionPulse {
  0%,
  100% {
    background: #fff;
  }

  50% {
    background: #fff9d7;
  }
}

.request-main {
  min-width: 0;
}

.status-tag {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--workshop);
  font-size: 12px;
  font-weight: 800;
}

.attention-tag {
  display: inline-flex;
  margin: 0 0 9px 8px;
  padding: 5px 8px;
  color: #fff;
  background: #d33737;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-tag.prepared {
  background: var(--prepared);
}

.status-tag.delivered {
  background: var(--atp);
}

.status-tag.cancelled {
  background: var(--danger);
}

.request-card h3 {
  font-size: 18px;
  line-height: 1.2;
}

.request-meta,
.request-meta {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.request-note {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  color: #442107;
  background: #fff0cf;
  border: 1px solid #e4bb5f;
  border-left: 5px solid var(--accent);
  border-radius: 7px;
}

.request-note-label {
  color: #805310;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.request-note-text {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.request-note.is-empty {
  color: var(--muted);
  background: #f8f9f6;
  border-color: var(--line);
  border-left-color: var(--line);
}

.request-note.is-empty .request-note-label {
  color: var(--muted);
}

.request-note.is-empty .request-note-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.requested-items {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.requested-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.requested-item strong {
  color: var(--muted);
  white-space: nowrap;
}

.conversation {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: #f4f8f7;
  border: 1px solid #d4e3df;
  border-radius: 7px;
}

.conversation-title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.comments {
  display: grid;
  gap: 6px;
}

.comment {
  padding: 8px 9px;
  color: #33413c;
  background: #f6f7f3;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.3;
}

.comment strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.photo {
  overflow: hidden;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.photo img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.photo a {
  display: block;
  padding: 7px 6px;
  color: var(--atp);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.photo-remove {
  display: block;
  width: 100%;
  padding: 0 6px 7px;
  color: var(--danger);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.prepare-form {
  display: grid;
  align-content: start;
  gap: 10px;
}

.prepare-items {
  display: grid;
  gap: 9px;
}

.prepare-items label {
  color: var(--ink);
}

.prepared-box {
  display: none;
  grid-column: 1 / -1;
  padding: 10px 12px;
  color: #153a68;
  background: #edf5ff;
  border: 1px solid #cadff6;
  border-radius: 7px;
  font-weight: 800;
}

.comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.photo-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding-top: 2px;
}

.photo-picker input {
  padding: 7px;
}

.photo-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #4a4a4a;
  background: #fff9d7;
  border: 1px solid #ead67c;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
}

.photo-status:empty {
  display: none;
}

.request-card.is-prepared .prepared-box,
.request-card.is-delivered .prepared-box {
  display: block;
}

.request-card.is-prepared .prepare-form,
.request-card.is-delivered .prepare-form,
.request-card.is-cancelled .prepare-form {
  display: none;
}

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

.history-band {
  width: min(1420px, calc(100% - 36px));
  margin: 0 auto 28px;
}

.history-inner {
  padding: 20px;
}

.history-date {
  display: grid;
  gap: 5px;
  color: #4a5869;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-date input {
  min-width: 170px;
  padding: 9px 11px;
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.history-stats div {
  min-width: 128px;
  padding: 10px 14px;
  background: #f7f7f7;
  border: 1px solid var(--line);
}

.history-stats strong,
.history-stats span {
  display: block;
}

.history-stats strong {
  color: #26374b;
  font-size: 22px;
}

.history-stats span {
  margin-top: 3px;
  color: #586674;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.history-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.owner-only {
  display: none;
}

.owner-session .owner-only {
  display: table-cell;
}

.history-comments {
  min-width: 220px;
  max-width: 360px;
  color: #36485c;
  line-height: 1.35;
  white-space: normal;
}

.history-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
  td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.elapsed {
  color: var(--workshop);
  font-weight: 900;
}

th {
  color: var(--muted);
  background: #f8f9f6;
  font-size: 12px;
  text-transform: uppercase;
}

td strong {
  display: block;
}

@media (max-width: 980px) {
  .module-board,
  .layout,
  .layout.owner-view {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }

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

@media (max-width: 640px) {
  .topbar,
  .panel-head,
  .request-card,
  .comment-form,
  .photo-form,
  .login-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .layout,
  .module-board,
  .history-band {
    width: calc(100% - 20px);
    margin-top: 10px;
  }

  .request-card,
  .panel-head {
    display: grid;
  }

  .compact-select {
    max-width: none;
  }
}

/* EMDA application theme */
:root {
  --bg: #f4f4f4;
  --ink: #20252c;
  --muted: #606a74;
  --line: #dce0e4;
  --panel: #ffffff;
  --atp: #ffcf00;
  --workshop: #ffcf00;
  --accent: #ffcf00;
  --prepared: #2f72d8;
  --danger: #d33737;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

body {
  background: #f2f2f2;
  color: var(--ink);
}

.topbar {
  min-height: 70px;
  padding: 14px 28px;
  color: #111;
  background: #ffcf00;
  border-bottom: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.top-actions {
  gap: 16px;
}

.user-chip {
  color: #111;
  background: transparent;
  border: 0;
  font-size: 15px;
}

.status-pill {
  color: #272727;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.status-pill.online .dot {
  background: #3d9f49;
}

.module-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(1420px, calc(100% - 36px));
  margin: 18px auto 0;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 112px;
  padding: 18px 20px;
  color: #111b2d;
  text-align: left;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.module-card:hover {
  border-color: #c7cdd5;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
}

.module-card.is-active {
  border-color: #ffcf00;
  box-shadow: inset 0 0 0 2px #ffcf00, var(--shadow);
}

.module-icon {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 7px;
  line-height: 1;
}

.module-icon svg {
  width: 43px;
  height: 43px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-icon-freight {
  color: #151515;
  background: linear-gradient(180deg, #ffdb18 0%, #f6c800 100%);
}

.module-icon-local {
  color: #111;
  background: #f4f4f4;
  border: 1px solid #d4d8de;
}

.module-icon-diagnostic {
  color: #fff;
  background: linear-gradient(180deg, #f0212f 0%, #d70f1d 100%);
}

.module-icon-diagnostic svg {
  width: 45px;
  height: 45px;
}

.module-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.module-content strong {
  font-size: 21px;
  line-height: 1.15;
}

.module-alert {
  color: #f00;
  font-size: 14px;
  font-weight: 800;
}

.module-copy {
  color: #566272;
  font-size: 15px;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 3px;
}

.module-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

.module-tag.delivery {
  color: #2f67d8;
  background: #eef4ff;
  border: 1px solid #c9dafd;
}

.module-tag.review {
  color: #b02020;
  background: #fff0f0;
  border: 1px solid #f0b7b7;
}

.module-tag.confirmed {
  color: #2d8d4b;
  background: #eefaf2;
  border: 1px solid #c8ecd2;
}

.module-tag.possible {
  color: #d46a00;
  background: #fff8e8;
  border: 1px solid #f6dda9;
}

.freight-module {
  display: block;
  width: min(1420px, calc(100% - 36px));
  margin: 16px auto 24px;
}

.freight-atp-view {
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(620px, 1.28fr);
  gap: 16px;
}

.freight-workshop-view {
  display: none;
}

.workshop-session .freight-atp-view {
  display: none;
}

.workshop-session .freight-workshop-view {
  display: block;
}

.freight-form-panel,
.freight-calendar-panel {
  min-height: auto;
}

.panel-head.compact {
  margin-bottom: 10px;
}

.freight-form {
  display: grid;
  gap: 10px;
}

.freight-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border: 1px solid #d1d8e3;
  border-radius: 4px;
  overflow: hidden;
}

.freight-mode legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.freight-mode label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border-left: 1px solid #d1d8e3;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 800;
}

.freight-mode label:first-of-type {
  border-left: 0;
}

.freight-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.freight-mode label:has(input:checked) {
  color: #3167e1;
  background: #f6f9ff;
  box-shadow: inset 0 0 0 1px #7aa2ff;
}

.freight-form textarea {
  min-height: 74px;
  resize: vertical;
}

.freight-tools-preview {
  display: grid;
  gap: 8px;
}

.freight-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px 12px;
}

.freight-grid fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border: 1px solid #d1d8e3;
  border-radius: 4px;
}

.freight-grid legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.freight-grid fieldset label {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-right: 1px solid #d1d8e3;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
}

.freight-grid fieldset label:last-child {
  border-right: 0;
}

.freight-grid input[type="radio"],
.switch-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: #40b35d;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-nav button {
  width: 38px;
  height: 38px;
  border: 1px solid #d1d8e3;
  border-radius: 4px;
  background: #fff;
  font-size: 24px;
  font-weight: 800;
}

.date-nav input {
  width: 150px;
}

.freight-board {
  display: grid;
  grid-template-columns: 0.95fr 0.95fr 1.25fr;
  overflow: hidden;
  border: 1px solid #d9dde3;
  border-radius: 4px;
}

.freight-review-band {
  margin-bottom: 14px;
}

.freight-review-card {
  width: 100%;
  padding: 12px;
  border: 1px solid #f0b7b7;
  border-left: 5px solid #c43434;
  border-radius: 5px;
  background: #fff7f7;
}

.freight-review-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: #b02020;
  font-size: 18px;
}

.freight-review-card h3 span {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #b02020;
  background: #ffd9d9;
  font-size: 15px;
}

.freight-review-list {
  display: grid;
  gap: 10px;
}

.freight-review-list .freight-item {
  margin-bottom: 0;
}

.freight-column,
.freight-map-column {
  padding: 14px;
  border-right: 1px solid #d9dde3;
}

.freight-map-column {
  border-right: 0;
}

.freight-column h3,
.freight-map-column h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #1f57d6;
  font-size: 18px;
}

.freight-column h3 span {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #e6efff;
  color: #1f57d6;
  font-size: 15px;
}

.freight-column h3:nth-of-type(1) + .freight-item.possible,
.freight-column:nth-child(2) h3 {
  color: #d46a00;
}

.freight-column:nth-child(2) h3 span {
  color: #d46a00;
  background: #fff0c7;
}

.freight-column .pickup-title {
  margin-top: 28px;
  color: #2e8b43;
}

.freight-column .review-title {
  color: #935b00;
}

.freight-column .review-title span {
  color: #935b00;
  background: #fff0c7;
}

.freight-column .pickup-title span {
  color: #2e8b43;
  background: #ddf4e4;
}

.freight-item {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 5px;
  font-size: 15px;
}

.freight-item p {
  margin: 0;
}

.freight-prepared-meta {
  color: #5c6673;
  font-size: 13px;
  font-weight: 800;
}

.freight-item.delivery {
  color: #173f91;
  background: #edf4ff;
  border: 1px solid #bcd2ff;
}

.freight-item.possible {
  color: #9d5600;
  background: #fff9ea;
  border: 1px solid #f2d58f;
}

.freight-item.confirmed {
  color: #205f31;
  background: #eaf7ee;
  border: 1px solid #bfe4c9;
}

.freight-item.review {
  color: #8f2525;
  background: #fffafa;
  border: 1px solid #efb9b9;
}

.freight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.freight-actions button {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #c6cfdb;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.freight-empty {
  margin: 0 0 14px;
  padding: 12px;
  color: var(--muted);
  border: 1px dashed #d5dae1;
  border-radius: 5px;
}

.route-map {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.route-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-map strong,
.route-map-head strong {
  color: var(--ink);
}

.route-map-head a {
  color: #1f57d6;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.route-map-empty {
  padding: 12px;
  border: 1px dashed #d5dae1;
  border-radius: 6px;
}

.route-map-empty p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.google-map-preview {
  position: relative;
  display: block;
  min-height: 148px;
  overflow: hidden;
  border: 1px solid #d3d8df;
  border-radius: 6px;
  background:
    linear-gradient(28deg, transparent 47%, rgba(255,255,255,0.9) 48%, rgba(255,255,255,0.9) 52%, transparent 53%) 0 0 / 76px 76px,
    linear-gradient(118deg, transparent 47%, rgba(255,255,255,0.9) 48%, rgba(255,255,255,0.9) 52%, transparent 53%) 0 0 / 86px 86px,
    linear-gradient(#dfe5ea 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, #dfe5ea 1px, transparent 1px) 0 0 / 42px 42px,
    #edf1f4;
}

.google-map-preview::before,
.google-map-preview::after {
  position: absolute;
  color: #808892;
  font-size: 12px;
  font-weight: 800;
  transform: rotate(-18deg);
}

.google-map-preview::before {
  content: "San Martin";
  right: 14px;
  bottom: 22px;
}

.google-map-preview::after {
  content: "Belgrano";
  left: 18px;
  top: 18px;
}

.map-stop {
  position: absolute;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  transform: rotate(-45deg);
}

.map-stop span {
  transform: rotate(45deg);
}

.map-stop.delivery,
.map-legend i.delivery {
  background: #3b73ee;
}

.map-stop.possible,
.map-legend i.possible {
  background: #f5c400;
}

.map-stop.confirmed,
.map-legend i.confirmed {
  background: #3d9f49;
}

.route-destinations {
  display: grid;
  gap: 6px;
}

.route-destination {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid #d5dae1;
  border-radius: 5px;
  background: #fff;
}

.route-destination span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.route-destination.delivery span {
  background: #3b73ee;
}

.route-destination.possible span {
  background: #f5c400;
  color: #111;
}

.route-destination.confirmed span {
  background: #3d9f49;
}

.route-destination strong,
.route-destination em {
  grid-column: 2;
}

.route-destination em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.freight-notice {
  margin-top: 14px;
  padding: 16px 18px;
  color: #1c3f83;
  background: #eef5ff;
  border: 1px solid #bfd3ff;
  border-radius: 5px;
  font-weight: 800;
  line-height: 1.6;
}

.workshop-freight-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(480px, 1.25fr);
  gap: 16px;
}

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

.freight-workshop-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  align-items: start;
  gap: 18px;
  min-height: auto;
}

.freight-workshop-card .freight-workshop-tag,
.freight-workshop-card .request-meta,
.freight-workshop-card .primary-action {
  grid-column: 1;
}

.freight-workshop-card h3,
.freight-workshop-card .requested-items {
  grid-column: 2;
}

.freight-workshop-card h3 {
  margin: 0;
}

.freight-workshop-card.delivery {
  border-left-color: #3b73ee;
}

.freight-workshop-card.confirmed {
  border-left-color: #3d9f49;
}

.freight-workshop-tag {
  display: inline-flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 900;
}

.freight-workshop-tag.delivery {
  color: #173f91;
  background: #dfe9ff;
}

.freight-workshop-tag.confirmed {
  color: #205f31;
  background: #ddf4e4;
}

.freight-workshop-card .requested-items input {
  width: 110px;
  min-height: 36px;
}

.freight-workshop-card .requested-items .freight-workshop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #d9dee5;
  border-radius: 3px;
  background: #fff;
}

.freight-workshop-card .quantity-badge {
  min-width: 50px;
  padding: 6px 10px;
  text-align: center;
  background: #ffcf00;
  border-radius: 3px;
  color: #111;
  font-weight: 900;
}

.freight-workshop-card input.field-error {
  border-color: #c43434;
  box-shadow: 0 0 0 2px rgba(196, 52, 52, 0.15);
}

.freight-history-panel {
  margin-top: 16px;
  min-height: auto;
}

.layout,
.layout.owner-view {
  width: min(1420px, calc(100% - 36px));
  margin: 16px auto;
  gap: 16px;
  grid-template-columns: minmax(320px, 0.88fr) minmax(470px, 1.12fr);
}

.panel,
.history-inner {
  border-color: #ddd;
  box-shadow: var(--shadow);
  border-radius: 4px;
}

.panel {
  min-height: auto;
  padding: 16px;
}

.panel h2,
.history-inner h2 {
  color: #3a4c63;
  font-size: 21px;
}

.eyebrow {
  color: #57616b;
  opacity: 1;
}

.counter,
.queue-chip {
  color: #2a2a2a;
  background: #ffcf00;
  border-radius: 4px;
}

input,
select {
  background: #fff;
  border-color: #cdd6e0;
  border-radius: 3px;
}

input:focus,
select:focus {
  border-color: #e7b900;
  box-shadow: 0 0 0 2px rgba(255, 207, 0, 0.28);
}

.primary-action,
.small-action {
  color: #151515;
  background: #ffcf00;
  border-radius: 3px;
}

.ghost-action {
  border-color: #cbd4dd;
  border-radius: 3px;
  background: #fff;
}

.selected-tool {
  color: #263950;
  background: #fff;
  border-color: #d9dee5;
  border-radius: 3px;
}

.quantity-control button {
  color: #111;
  background: #ffcf00;
  border-color: #ffcf00;
  border-radius: 3px;
}

.tool-option {
  border-radius: 3px;
}

.tool-option:hover,
.tool-option.selected {
  border-color: #ffcf00;
  background: #fffced;
}

.request-card {
  border-left-color: #ffcf00;
  border-radius: 3px;
  padding: 14px;
  box-shadow: none;
}

.status-tag {
  color: #222;
  background: #ffcf00;
  border-radius: 4px;
}

.status-tag.prepared {
  color: #205aa7;
  background: #d7e7ff;
}

.status-tag.delivered {
  color: #257621;
  background: #d0efc7;
}

.requested-item {
  border-radius: 3px;
  background: #fff;
}

.request-note {
  background: #fff4ae;
  border-color: #ffcf00;
  border-left-color: #ffcf00;
  border-radius: 3px;
}

.conversation {
  background: #fafafa;
  border-color: #e0e0e0;
  border-radius: 3px;
}

.prepared-box {
  color: #174f9b;
  background: #e5f0ff;
  border-color: #c3d9f5;
  border-radius: 3px;
}

.history-band {
  width: min(1420px, calc(100% - 36px));
  margin: 0 auto 28px;
}

.history-inner {
  padding: 16px;
}

.history-table-wrap {
  border-radius: 0;
}

th {
  color: #28374a;
  background: #f5f5f5;
}

.elapsed {
  color: #935b00;
}

@media (max-width: 1060px) {
  .freight-atp-view,
  .workshop-freight-grid {
    grid-template-columns: 1fr;
  }

  .freight-board {
    grid-template-columns: 1fr;
  }

  .freight-review-card {
    width: 100%;
  }

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

  .freight-workshop-card h3,
  .freight-workshop-card .requested-items {
    grid-column: 1;
  }

  .freight-column,
  .freight-map-column {
    border-right: 0;
    border-bottom: 1px solid #d9dde3;
  }

  .freight-map-column {
    border-bottom: 0;
  }

  .layout,
  .layout.owner-view {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .module-card {
    align-items: flex-start;
    gap: 14px;
  }

  .freight-grid,
  .freight-grid fieldset,
  .freight-mode {
    grid-template-columns: 1fr;
  }

  .freight-mode label {
    border-top: 1px solid #d1d8e3;
    border-left: 0;
  }

  .freight-mode label:first-of-type {
    border-top: 0;
  }

  .date-nav {
    width: 100%;
  }

  .date-nav input {
    width: 100%;
  }

  .topbar {
    height: auto;
    padding: 12px;
  }
}
