/* ── OS Routing ─────────────────────────────────────────────────────── */

#os-routing-page {
  padding: 0 0 48px;
}

/* ── Layout dois painéis ── */
.os-rt-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .os-rt-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Painel lateral ── */
.os-rt-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.os-rt-filters-card .os-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Fieldset/legend nos filtros ── */
#os-routing-page .os-rt-fieldset {
  position: relative;
  border: 1.5px solid var(--border-light-mode, #d1d5db);
  border-radius: 8px;
  padding: 4px 14px 10px 14px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--background-main);
  transition: border-color 0.2s;
}

html.dark-theme #os-routing-page .os-rt-fieldset {
  background-color: var(--background-main-dark-mode);
  border-color: var(--border-dark-mode, #334155);
}

#os-routing-page .os-rt-fieldset:focus-within {
  border-color: var(--primary-color);
}

#os-routing-page .os-rt-legend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 4px;
  margin-left: 6px;
  line-height: 1;
}

#os-routing-page .os-rt-fieldset:focus-within .os-rt-legend {
  color: var(--primary-color);
}

#os-routing-page .os-rt-input {
  width: 100%;
  box-sizing: border-box;
  display: block;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  padding: 8px 0 6px 0;
}

html.dark-theme #os-routing-page .os-rt-input {
  color: var(--text-primary);
}

#os-routing-page input[type="date"].os-rt-input::-webkit-calendar-picker-indicator {
  opacity: 0.4;
  filter: grayscale(1);
  cursor: pointer;
}

html.dark-theme #os-routing-page input[type="date"].os-rt-input::-webkit-calendar-picker-indicator {
  filter: grayscale(1) invert(1);
  opacity: 0.4;
}

/* CustomSelect dentro do fieldset */
#os-routing-page .os-rt-fieldset .cs-container {
  width: 100%;
  flex: none;
}

#os-routing-page .os-rt-fieldset .cs-display {
  border: none;
  border-radius: 0;
  padding: 4px 8px 2px 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.875rem;
}

#os-routing-page .os-rt-fieldset .cs-display:hover {
  border: none;
  background: transparent;
}

/* ── Botão calcular centralizado ── */
#os-routing-page .os-rt-calc-btn {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}

/* ── Paradas ── */
.os-rt-stops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.os-rt-totals {
  font-weight: 500;
  color: var(--text-secondary);
}

.os-rt-stops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.os-rt-stop-card {
  background: var(--background-color-main-light);
  border: 1px solid var(--border-light-mode);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

html.dark-theme .os-rt-stop-card {
  background: var(--background-dark-mode-menu-lateral);
  border-color: var(--background-dark-mode-menu-lateral);
}

.os-rt-stop-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #000;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.os-rt-stop-info {
  flex: 1;
  min-width: 0;
}

.os-rt-stop-client {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-rt-stop-address {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-rt-stop-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.os-rt-stop-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--background-main);
  border: 1px solid var(--border-light-mode);
  color: var(--text-secondary);
}

html.dark-theme .os-rt-stop-tag {
  background: var(--background-main-dark-mode);
  border-color: var(--border-dark-mode, #334155);
}

.os-rt-stop-dist {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Mapa ── */
.os-rt-map-wrap {
  position: relative;
  height: calc(100vh - 180px);
  min-height: 400px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-light-mode);
}

html.dark-theme .os-rt-map-wrap {
  border-color: var(--background-dark-mode-menu-lateral);
}

#os-rt-map {
  width: 100%;
  height: 100%;
}

.os-rt-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--background-color-main-light);
  color: var(--text-secondary);
  pointer-events: none;
}

html.dark-theme .os-rt-map-placeholder {
  background: var(--background-dark-mode-menu-lateral);
}

.os-rt-map-placeholder i {
  font-size: 2.5rem;
  opacity: 0.3;
}

.os-rt-map-placeholder p {
  font-size: 0.9rem;
  opacity: 0.5;
}

.os-rt-map-placeholder.os-hidden {
  display: none;
}

