.pc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 12px;
  overflow-x: hidden;
}

.pc-modal-overlay.is-open {
  display: flex;
}

.pc-modal,
.pc-modal-small {
  width: min(1100px, 100%);
  max-height: 95vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
  border: 1px solid #e5e7eb;
}

.pc-modal {
  width: min(980px, 100%);
}

.pc-modal-head,
.pc-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pc-modal-head h5,
.pc-list-head h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.pc-modal-small .pc-list-head h5 {
  color: #0b3b66;
}

.pc-modal-head button,
.pc-list-head button {
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #334155;
  border-radius: 10px;
  min-width: 34px;
  height: 34px;
}

.pc-modal-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  min-width: 0;
}

.pc-modal-grid > * {
  min-width: 0;
}

.pc-map {
  height: 380px;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  overflow: hidden;
}

.pc-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.pc-search-row input {
  flex: 1;
  min-width: 0;
}

.pc-search-row button {
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
}

.pc-table,
.pc-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.pc-table th,
.pc-table td,
.pc-list-table th,
.pc-list-table td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pc-table th,
.pc-list-table th {
  color: #334155;
  font-weight: 700;
}

.pc-table th {
  width: 36%;
  text-align: left;
}

.pc-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
}

.pc-field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.pc-actions button {
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  background: #fff;
}

.pc-actions .pc-btn-cancel {
  background: #334155;
  border-color: #1f2937;
  color: #fff;
  font-weight: 700;
}

.pc-actions button:last-child {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  font-weight: 700;
}

.pc-actions .pc-btn-delete {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
  font-weight: 700;
}

.btn-ubicacion {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
}

.btn-listado-coord {
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 11px;
  font-weight: 700;
}

.pc-list-wrap {
  overflow: auto;
  overflow-x: auto;
  max-height: 65vh;
}

.pc-list-table {
  font-size: 13px;
}

.pc-modal-small .pc-list-table thead th {
  color: #0b3b66;
}

.pc-modal-small .pc-list-table tbody td {
  color: #1f2937;
}

.pc-modal-small .pc-list-table tbody tr:hover td {
  color: #0f172a;
}

.pc-list-table td,
.pc-list-table th {
  white-space: normal;
  text-align: left;
}

@media (max-width: 860px) {
  .pc-modal-grid {
    grid-template-columns: 1fr;
  }

  .pc-map {
    height: 280px;
  }

  .pc-table th {
    width: 42%;
  }

  .pc-actions {
    flex-direction: column;
  }

  .pc-actions button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .pc-modal-small {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border-radius: 10px;
  }

  .pc-list-wrap {
    max-height: none;
    overflow: visible;
  }

  .pc-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
  }

  .pc-list-table thead {
    display: none;
  }

  .pc-list-table tbody,
  .pc-list-table tr,
  .pc-list-table td {
    display: block;
    width: 100%;
  }

  .pc-list-table tr {
    background: #ffffff;
    border: 1px solid #dbe3ed;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 8px;
  }

  .pc-list-table td {
    border: 0;
    border-bottom: 1px dashed #e5e7eb;
    padding: 7px 6px 7px 44%;
    position: relative;
    min-height: 34px;
    text-align: left;
  }

  .pc-list-table td:last-child {
    border-bottom: 0;
    padding-top: 10px;
  }

  .pc-list-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    top: 7px;
    width: 40%;
    font-weight: 700;
    color: #0b3b66;
    white-space: normal;
    line-height: 1.2;
  }

  .pc-list-table td[data-label="Acción"] {
    padding-left: 6px;
  }

  .pc-list-table td[data-label="Acción"]::before {
    position: static;
    display: block;
    width: auto;
    margin-bottom: 6px;
  }

  .pc-list-table td[data-label="Acción"] .btn-modificar {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .pc-modal-overlay {
    padding: 6px;
  }

  .pc-modal-small {
    padding: 8px;
    border-radius: 8px;
  }

  .pc-list-head h5 {
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .pc-list-head button {
    min-width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .pc-list-table tr {
    padding: 6px;
    margin-bottom: 8px;
  }

  .pc-list-table td {
    padding: 6px 4px 6px 46%;
    min-height: 30px;
    font-size: 12px;
  }

  .pc-list-table td::before {
    font-size: 11px;
    width: 42%;
    left: 4px;
    top: 6px;
  }

  .pc-list-table td[data-label="Acción"] {
    padding-left: 4px;
  }

  .pc-list-table td[data-label="Acción"] .btn-modificar {
    font-size: 12px;
    padding: 7px 8px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .pc-modal-overlay {
    align-items: flex-start;
    padding: 6px;
  }

  .pc-modal-small {
    width: min(1200px, 100%);
    max-height: calc(100vh - 12px);
    padding: 8px;
  }

  .pc-list-wrap {
    max-height: calc(100vh - 88px);
  }

  .pc-list-head {
    margin-bottom: 6px;
  }

  .pc-list-head h5 {
    font-size: 0.95rem;
  }

  .pc-list-table {
    font-size: 12px;
  }

  .pc-list-table th,
  .pc-list-table td {
    padding: 6px;
  }
}
