:root {
  --ink: #17231f;
  --muted: #5f6d67;
  --line: #dce6df;
  --green: #2f7d4f;
  --blue: #277ea8;
  --paper: #f7faf6;
  --white: #ffffff;
  --sun: #f2be4b;
  --danger: #9f3b2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", Arial, sans-serif;
}

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

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 50px rgba(23, 35, 31, 0.12);
}

.login-card img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
}

.login-card h1 {
  font-size: 1.8rem;
}

.login-card p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

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

.login-card input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid rgba(159, 59, 47, 0.28);
  border-radius: 8px;
  color: var(--danger) !important;
  background: #fff2ef;
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

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

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
}

.brand strong,
h1,
h2 {
  font-family: "Inter", Arial, sans-serif;
}

.brand strong {
  display: block;
  font-size: 1rem;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.home-link,
button,
.send,
.photo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font-weight: 900;
  text-decoration: none;
}

main {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.crew-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-button {
  min-height: 46px;
}

.tab-button.active {
  color: var(--white);
  border-color: var(--green);
  background: var(--green);
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

.toolbar,
.route-summary,
.panel-heading,
.actions,
.photo-row {
  display: grid;
  gap: 10px;
}

.toolbar {
  grid-template-columns: 1fr 1fr;
  align-items: end;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--white);
  font-weight: 800;
}

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

.route-summary {
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 14px;
}

.route-maker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.route-summary div,
.route-panel,
.stop {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.route-summary div {
  padding: 14px;
}

.route-summary span,
dt,
.route-tag,
.route-maker span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.route-summary strong {
  display: block;
  margin-top: 4px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 1.12rem;
}

.route-maker strong {
  display: block;
  margin-top: 4px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 1.12rem;
}

.route-maker button:disabled {
  opacity: 0.5;
}

.route-plan {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.route-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
  font-weight: 900;
}

.route-step strong,
.route-step p {
  margin: 0;
}

.route-step p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--white);
  background: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.route-panel {
  padding: 16px;
}

.data-source {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 900;
}

.panel-heading {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

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

.customer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--blue);
  background: #e9f3f7;
  font-weight: 900;
}

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

.customer-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.customer-row strong,
.customer-row p,
.customer-row span {
  display: block;
}

.customer-row p,
.customer-row span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.customer-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--white);
  background: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.stop {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.stop[data-status="done"] {
  opacity: 0.72;
}

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

h2 {
  margin-top: 4px;
  font-size: 1.15rem;
}

.address,
.notes,
.empty {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.notes:empty {
  display: none;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  text-align: center;
}

.status-pill {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--green);
  background: #e9f4ed;
  font-size: 0.78rem;
}

.stop[data-status="started"] .status-pill {
  color: #7a5811;
  background: #fff4d4;
}

.stop[data-status="done"] .status-pill {
  color: var(--blue);
  background: #e9f3f7;
}

.stop-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.stop-details div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.photo-row {
  grid-template-columns: auto 88px;
  align-items: center;
}

.photo-button {
  min-height: 50px;
  color: var(--blue);
}

.photo-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-preview {
  width: 88px;
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.actions {
  grid-template-columns: repeat(3, 1fr);
}

.start {
  color: var(--blue);
}

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

.send {
  color: var(--ink);
}

@media (max-width: 720px) {
  .toolbar,
  .route-summary,
  .route-maker,
  .panel-heading,
  .actions {
    grid-template-columns: 1fr;
  }

  .stop-details {
    grid-template-columns: 1fr 1fr;
  }

  .app-header {
    align-items: flex-start;
  }

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

  .customer-call {
    width: 100%;
  }

  .route-step {
    grid-template-columns: auto 1fr;
  }

  .map-link {
    grid-column: 1 / -1;
    width: 100%;
  }
}
