/* ===========================
   Layout geral
   =========================== */
.tws-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.tws-card {
  background: #fff;
  border: 1px solid #E3E8EF;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  padding: 20px;
  margin-bottom: 20px;
}

.tws-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
}

.tws-section { margin-top: 16px; }

/* ===========================
   Formulário
   =========================== */
.tws-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}
.tws-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tws-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.tws-help {
  font-size: 12px;
  color: #6b7280;
}
.tws-input, .tws-select {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  width: 100%;
}

/* ===========================
   Linha de ações
   =========================== */
.tws-row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.tws-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #009AC7;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.tws-btn:hover { background: #007ea3; }
.tws-legend {
  grid-column: 1 / span 3;
  font-size: 12px;
  color: #475569;
}

/* ===========================
   Chips
   =========================== */
.tws-chip {
  background: #e8f5f9;
  color: #0b4f5e;
  border: 1px solid #9ec9d7;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
}
.tws-chip.strong {
  background: #009AC7;
  color: #fff;
  border-color: #009AC7;
}

/* ===========================
   Mapa
   =========================== */
.tws-map {
  height: 560px !important;
  min-height: 560px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  overflow: hidden;
}
.tws-map-wrap { position: relative; }

@media (max-width: 1024px) {
  .tws-map { height: 480px !important; }
}
@media (max-width: 640px) {
  .tws-map { height: 380px !important; }
}

/* ===========================
   Autocomplete
   =========================== */
.tws-auto { position: relative; }
.tws-auto-list {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  z-index: 1000;
  max-height: 180px;
  overflow-y: auto;
}
.tws-auto-item {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.tws-auto-item:hover { background: #f1f5f9; }

/* ===========================
   Accordion cobertura
   =========================== */
.tws-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
}
.tws-acc-header {
  padding: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}
.tws-acc-body { padding: 10px; }
.tws-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.tws-pill.ok { background:#dcfce7; color:#166534; }
.tws-pill.warn { background:#fee2e2; color:#991b1b; }

/* ===========================
   Modal Detalhes
   =========================== */
.tws-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  padding: 20px;
  z-index: 9999;
}
.tws-modal-close {
  float: right;
  cursor: pointer;
  font-size: 18px;
  color: #666;
}
.tws-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.5);
  z-index: 9998;
}

/* ===========================
   Tabelas
   =========================== */
.tws-table {
  width: 100%;
  border-collapse: collapse;
}
.tws-table th {
  background: #F8FAFC;
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #E5E7EB;
}
.tws-table td {
  padding: 8px;
  border-bottom: 1px solid #E5E7EB;
}

/* ===========================
   Fluxo animado com micro-setas
   =========================== */
.tws-anim-ida,
.tws-anim-volta {
  stroke-dasharray: 10 16;
  animation: tws-dash 1s linear infinite;
  stroke-linecap: round;
}

@keyframes tws-dash {
  to { stroke-dashoffset: -26; }
}