/* RouteBoss - Simple Map Dispatch Style */

* {
  box-sizing: border-box;
}

:root {
  --bg: #07111f;
  --panel: #101827;
  --panel-soft: #162033;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #38bdf8;
  --green: #22c55e;
  --yellow: #f59e0b;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --radius: 20px;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 30%),
    linear-gradient(135deg, #040711, #07111f 45%, #040711);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.simple-app {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

/* TOP HEADER */

.simple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(16, 24, 39, 0.88);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.simple-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 20px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb, #7c3aed);
  color: white;
  font-weight: 900;
  font-size: 22px;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.35);
}

.eyebrow {
  margin: 0 0 5px;
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.simple-header h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.simple-header p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.simple-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.12);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

/* MAIN MAP LAYOUT */

.map-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 18px;
  align-items: stretch;
}

.simple-panel,
.map-panel,
.today-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 24, 39, 0.9);
  box-shadow: var(--shadow);
}

.simple-panel {
  padding: 18px;
}

/* This makes the map panel use the full square height */
.map-panel {
  min-height: 680px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.truck-list-panel {
  padding-bottom: 18px;
}

.panel-header,
.map-toolbar,
.today-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h2,
.map-toolbar h2,
.today-header h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.selected-day-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* FORM */

.simple-form {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  outline: none;
  color: var(--text);
  background: #08111f;
  border-radius: 14px;
  padding: 12px 13px;
  font-size: 15px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.72);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.simple-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-btn,
.pick-truck-btn,
.small-btn {
  border: 0;
  cursor: pointer;
  color: white;
  font-weight: 900;
  border-radius: 14px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.primary-btn:hover,
.pick-truck-btn:hover,
.small-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.primary-btn {
  min-height: 50px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb, #7c3aed);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
}

.pick-truck-btn {
  min-height: 50px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.2);
}

.small-btn {
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

/* TRUCK COLOR + CHECKBOX */

input[type="color"] {
  min-height: 46px;
  padding: 5px;
  cursor: pointer;
}

.simple-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.simple-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.simple-checkbox span {
  color: #e2e8f0;
  font-weight: 900;
}

/* SIMPLE DAY CALENDAR */

.day-calendar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: -4px;
}

.day-pill {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.day-pill:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.day-pill.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.65);
  color: #e0f2fe;
}

/* NEARBY TRUCK RESULTS */

.nearby-results {
  min-height: 48px;
  padding: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(8, 17, 31, 0.7);
  font-size: 14px;
  line-height: 1.45;
}

.nearby-list {
  display: grid;
  gap: 10px;
}

.nearby-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.nearby-card strong {
  font-size: 15px;
}

.nearby-card span {
  color: var(--muted);
  font-size: 13px;
}

.nearby-card button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
  font-weight: 900;
  cursor: pointer;
}

.nearby-card button:hover {
  background: rgba(56, 189, 248, 0.28);
}

.selected-truck-message {
  padding: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.12);
  color: #dcfce7;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

/* MAP */

.map-toolbar {
  padding: 16px 16px 0;
  flex: 0 0 auto;
}

.map-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  flex: 0 0 auto;
}

.truck-dot {
  background: var(--blue);
}

.job-dot {
  background: var(--orange);
}

.assigned-job-dot {
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 50%, var(--orange) 50%, var(--orange) 100%);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.inventory-dot {
  background: var(--green);
  box-shadow: 8px 0 0 var(--blue), 16px 0 0 var(--purple);
}

/* This makes the Leaflet map fill the rest of the panel */
.dispatch-map {
  width: 100%;
  flex: 1;
  min-height: 610px;
  margin-top: 12px;
  background: #0b1220;
  border-top: 1px solid var(--line);
}

/* Custom Leaflet markers */

.routeboss-marker-shell {
  background: transparent;
  border: 0;
}

.routeboss-saved-job-marker {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.routeboss-saved-job-marker.unassigned {
  background: var(--orange);
}

.routeboss-saved-job-marker.assigned {
  background: linear-gradient(
    90deg,
    var(--truck-color) 0%,
    var(--truck-color) 50%,
    var(--orange) 50%,
    var(--orange) 100%
  );
}

.routeboss-truck-group-marker {
  min-width: 34px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.routeboss-truck-ball {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.routeboss-truck-ball.used {
  opacity: 0.55;
  border: 2px solid var(--orange);
}

.routeboss-truck-extra {
  font-size: 11px;
  font-weight: 900;
  color: #e0f2fe;
}

/* Leaflet popup cleanup */

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #101827;
  color: var(--text);
}

.leaflet-popup-content {
  line-height: 1.45;
}

.leaflet-container a {
  color: #7dd3fc;
}

/* TODAY / SELECTED DAY WORK */

.today-section {
  margin-top: 18px;
  padding: 18px;
}

.simple-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.2);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.today-jobs {
  display: grid;
  gap: 12px;
}

.empty-simple {
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(8, 17, 31, 0.55);
}

.job-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 17, 31, 0.75);
}

.job-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.job-card-title {
  font-size: 18px;
  font-weight: 900;
}

.job-card-meta {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.job-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(56, 189, 248, 0.13);
  color: #bae6fd;
  border: 1px solid rgba(125, 211, 252, 0.18);
}

.tag.night {
  background: rgba(139, 92, 246, 0.16);
  color: #ddd6fe;
}

.tag.unassigned {
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

/* COMPANY INVENTORY */

#companyInventorySection {
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 28%),
    rgba(16, 24, 39, 0.9);
}

.inventory-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.inventory-mini-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 17, 31, 0.68);
}

.inventory-mini-card strong {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.inventory-mini-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inventory-balls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.inventory-ball {
  width: 13px;
  height: 13px;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.inventory-ball.used {
  opacity: 0.55;
  border: 2px solid var(--orange);
}

.inventory-help {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inventory-help strong {
  color: #e2e8f0;
}

/* TRUCK LIST FILTERS */

.truck-simple-filters {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.hidden-counts {
  display: none;
}

.job-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-actions button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 900;
  cursor: pointer;
}

.job-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.job-actions .delete-btn {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.12);
}

/* RESPONSIVE */

@media (max-width: 1050px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 620px;
  }

  .dispatch-map {
    min-height: 520px;
  }
}

@media (max-width: 700px) {
  .simple-app {
    width: min(100% - 20px, 1500px);
    padding-top: 12px;
  }

  .simple-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .simple-brand {
    align-items: flex-start;
  }

  .logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    font-size: 18px;
  }

  .simple-link-btn {
    width: 100%;
  }

  .simple-two-cols {
    grid-template-columns: 1fr;
  }

  .day-calendar {
    grid-template-columns: 1fr 1fr;
  }

  .map-panel {
    min-height: 520px;
  }

  .dispatch-map {
    min-height: 420px;
  }

  .job-card-top {
    flex-direction: column;
  }

  .today-header {
    flex-direction: column;
  }
}