/* RUTALOG mejoras-v2 */

.rutalog-cap-box {
  background: var(--surface-2, #1f1f1f);
  border: 1px solid var(--border, #1f1f1f);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text, #fafafa);
}
.rutalog-cap-box .cap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.rutalog-cap-box .cap-row span { color: var(--muted, #a3a3a3); }
.rutalog-cap-box .cap-bar {
  height: 6px;
  border-radius: 99px;
  background: #262626;
  overflow: hidden;
}
.rutalog-cap-box .cap-fill {
  height: 100%;
  border-radius: 99px;
  background: #34d399;
  transition: width .25s ease, background .2s;
}
.rutalog-cap-box.warn .cap-fill { background: #fbbf24; }
.rutalog-cap-box.danger .cap-fill { background: #f87171; }
.rutalog-cap-box.warn { border-color: #d97706; }
.rutalog-cap-box.danger { border-color: #f87171; }
.rutalog-cap-box .cap-pct {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted, #a3a3a3);
  font-family: 'JetBrains Mono', monospace;
}

.rutalog-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 24px;
}
.rutalog-search-overlay[hidden] { display: none !important; }
.rutalog-search-card {
  width: min(520px, 96vw);
  background: #171717;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.rutalog-search-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #1f1f1f;
  background: #0f0f0f;
  color: #fafafa;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
}
.rutalog-search-card input:focus { outline: none; border-color: #f5f5f5; }
.rutalog-search-hint { font-size: 11px; color: #a3a3a3; margin: 8px 2px 6px; }
.rutalog-search-results { list-style: none; margin: 0; padding: 0; max-height: 48vh; overflow: auto; }
.rutalog-search-results li.vacio { padding: 12px; color: #a3a3a3; font-size: 13px; font-style: italic; }
.rutalog-search-results button {
  width: 100%; text-align: left; border: none; background: transparent; color: #fafafa;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-family: inherit;
}
.rutalog-search-results button:hover { background: #262626; }
.rs-tipo { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #60a5fa; }
.rs-tit { font-size: 13.5px; font-weight: 600; }
.rs-sub { font-size: 12px; color: #a3a3a3; }

html.rutalog-operador .nav button[data-page="config"],
html.rutalog-operador .nav button[data-page="topes"],
html.rutalog-operador .nav button[data-page="codigo"],
html.rutalog-operador .nav button[data-page="citas"] {
  display: none !important;
}

#btnOptimizarRuta:disabled { opacity: .4; }

@media (max-width: 720px) {
  .rutalog-search-overlay { padding-top: 8vh; }
  .rutalog-cap-box { font-size: 11.5px; }
}

/* Autocompletado citas */
.cita-ac-wrap { position: relative; flex: 1; min-width: 160px; }
.cita-ac-wrap input { width: 100%; }
.cita-ac-drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 50; max-height: 240px; overflow: auto;
  background: #171717; border: 1px solid #1f1f1f; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45); padding: 4px;
}
.cita-ac-drop[hidden] { display: none !important; }
.cita-ac-item {
  width: 100%; text-align: left; border: none; background: transparent; color: #fafafa;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-family: inherit;
}
.cita-ac-item:hover, .cita-ac-item:focus { background: #262626; outline: none; }
.cita-ac-name { font-size: 13.5px; font-weight: 600; }
.cita-ac-meta { font-size: 11.5px; color: #a3a3a3; }
.cita-ac-empty { padding: 12px; font-size: 12.5px; color: #a3a3a3; font-style: italic; }

/* Pegar tabla de citas */
.cita-paste-box {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px dashed #333;
  border-radius: 12px;
  background: #121212;
}
.cita-paste-title {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fafafa;
}
.cita-paste-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #a3a3a3;
  line-height: 1.45;
}
#citaPasteArea {
  width: 100%;
  box-sizing: border-box;
  min-height: 110px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #1f1f1f;
  background: #0f0f0f;
  color: #fafafa;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  resize: vertical;
}
#citaPasteArea:focus { outline: none; border-color: #525252; }
.cita-paste-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.cita-paste-status {
  font-size: 12.5px;
  color: #a3a3a3;
  margin-left: 4px;
}
.cita-paste-preview {
  margin-top: 12px;
  border: 1px solid #1f1f1f;
  border-radius: 10px;
  overflow: hidden;
}
.cita-paste-sum {
  padding: 8px 12px;
  font-size: 12.5px;
  background: #1a1a1a;
  border-bottom: 1px solid #1f1f1f;
  color: #e5e5e5;
}
.cita-paste-sum .ok { color: #34d399; }
.cita-paste-sum .fail { color: #fbbf24; }
.cita-paste-table-wrap { max-height: 280px; overflow: auto; }
.cita-paste-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cita-paste-table th {
  position: sticky; top: 0;
  background: #1f1f1f;
  text-align: left;
  padding: 7px 10px;
  font-weight: 600;
  color: #a3a3a3;
  white-space: nowrap;
}
.cita-paste-table td {
  padding: 6px 10px;
  border-top: 1px solid #1f1f1f;
  color: #e5e5e5;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cita-paste-table tr.fail td { color: #fbbf24; }
.cita-paste-table .mono { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
