/* Estilos del Sistema de Incidencias Municipales.
   Extraídos del monolito original (legacy/) sin cambios. */

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 5000; opacity: 0; visibility: hidden;
  transition: all .2s; padding: 16px; overflow-y: auto;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-overlay.nested { z-index: 5100; }
.modal-box {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 560px; max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transform: translateY(20px); transition: transform .2s;
  margin: auto;
}
.modal-box.lg { max-width: 800px; }
.modal-overlay.show .modal-box { transform: translateY(0); }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--borde);
  background: #f8f9fc; border-radius: 14px 14px 0 0;
}
.modal-head h3 {
  font-size: 15px; font-weight: 700; color: var(--oscuro);
  display: flex; align-items: center; gap: 8px;
}
.modal-close {
  background: transparent; border: none; font-size: 1.4rem;
  color: var(--gris); line-height: 1; padding: 4px 8px;
}
.modal-close:hover { color: var(--rojo); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--borde);
  background: #f8f9fc; display: flex; justify-content: flex-end;
  gap: 10px; border-radius: 0 0 14px 14px; flex-wrap: wrap;
}

/* Selector de iconos */
.icon-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 6px; max-height: 220px; overflow-y: auto;
  padding: 8px; border: 1px solid #cbd5e0; border-radius: 10px;
  background: #f8f9fc;
}
.icon-opt {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 4px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: all .12s;
  background: #fff;
}
.icon-opt:hover { background: #e8f5f2; }
.icon-opt.selected {
  border-color: var(--primario); background: #e8f5f2;
}
.icon-opt .emoji { font-size: 1.5rem; line-height: 1; }
.icon-opt .label {
  font-size: 8.5px; color: #4a5568; margin-top: 3px;
  text-align: center; line-height: 1.1;
}

/* Evidencia */
.evidence-drop {
  border: 2px dashed #cbd5e0; border-radius: 12px;
  padding: 24px; text-align: center; cursor: pointer;
  transition: all .15s; background: #f8f9fc;
}
.evidence-drop:hover { border-color: var(--primario); background: #e8f5f2; }
.evidence-drop i { font-size: 2rem; color: var(--primario); }
.evidence-drop p { font-size: 12px; color: var(--gris); margin-top: 6px; }
.evidence-drop small { font-size: 10px; color: #aaa; }
.evidence-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-top: 10px;
}
.evidence-item {
  position: relative; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--borde); background: #f0f4f8;
}
.evidence-item img, .evidence-item video {
  width: 100%; height: 90px; object-fit: cover; display: block;
}
.evidence-item .ev-file {
  width: 100%; height: 90px; display: flex;
  align-items: center; justify-content: center;
  font-size: 2rem; color: var(--gris);
}
.evidence-item .ev-name {
  font-size: 10px; padding: 4px 6px; color: #4a5568;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #fff;
}
.evidence-item .ev-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(220,53,69,0.9); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px;
  font-size: 12px; display: flex; align-items: center;
  justify-content: center;
}

/* Detalles incidencia */
.detail-row {
  display: flex; gap: 10px; margin-bottom: 10px;
  font-size: 13px; line-height: 1.5;
}
.detail-row .label {
  font-weight: 700; color: var(--primario);
  min-width: 100px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .3px;
  padding-top: 2px;
}
.detail-row .value { flex: 1; color: var(--oscuro); }
.detail-section {
  border-top: 1px solid var(--borde);
  padding-top: 12px; margin-top: 12px;
}
.detail-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--primario); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.status-timeline {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; background: #f8f9fc; border-radius: 8px;
}
.timeline-item {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12px;
}
.timeline-item .t-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primario); flex-shrink: 0; margin-top: 4px;
}
.timeline-item .t-time {
  font-size: 10px; color: #94a3b8;
}

/* Estado selector */
.status-options {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin-top: 8px;
}
.status-opt {
  padding: 10px; border: 2px solid var(--borde);
  border-radius: 8px; cursor: pointer; text-align: center;
  font-size: 12px; font-weight: 600;
  transition: all .12s; background: #fff;
}
.status-opt:hover { border-color: var(--primario); }
.status-opt.selected {
  border-color: var(--primario); background: #e8f5f2;
  color: var(--primario);
}

/* Comentarios */
.comment-list { display: flex; flex-direction: column; gap: 8px; }
.comment-item {
  background: #f8f9fc; border-radius: 8px;
  padding: 8px 12px; font-size: 12px;
}
.comment-item .c-meta {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: #94a3b8; margin-bottom: 4px;
}
.comment-item .c-author { font-weight: 700; color: var(--primario); }
.comment-item .c-text { color: #2d3748; line-height: 1.5; }

/* Notificaciones panel */
.notif-panel {
  position: absolute; top: 100%; right: 16px;
  width: 340px; max-height: 420px; overflow-y: auto;
  background: #fff; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  z-index: 600; margin-top: 8px; display: none;
}
.notif-panel.show { display: block; }
.notif-header {
  padding: 12px 14px; border-bottom: 1px solid var(--borde);
  display: flex; justify-content: space-between;
  align-items: center; background: #f8f9fc;
  border-radius: 12px 12px 0 0;
  font-size: 13px; font-weight: 700;
}
.notif-item {
  padding: 12px 14px; border-bottom: 1px solid #f0f4f8;
  display: flex; gap: 10px; font-size: 12px;
}
.notif-item.unread { background: #f0faf8; }
.notif-item .n-icon { font-size: 1.3rem; }
.notif-item .n-content { flex: 1; }
.notif-item .n-title { font-weight: 700; color: var(--oscuro); margin-bottom: 2px; }
.notif-item .n-msg { color: var(--gris); line-height: 1.4; }
.notif-item .n-time { color: #94a3b8; font-size: 10px; margin-top: 4px; }
.notif-empty { padding: 30px; text-align: center; color: #94a3b8; font-size: 13px; }

/* Panel de información (icono de exclamación) */
.info-panel {
  position: absolute; top: 100%; right: 16px;
  width: 300px; max-height: 70vh; overflow-y: auto;
  background: #fff; border-radius: 12px; color: #1a202c;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  z-index: 600; margin-top: 8px; display: none;
}
.info-panel.show { display: block; }
.info-panel .notif-header { font-size: 13px; }
.info-panel .info-body { padding: 12px 14px; }
.info-panel .leg-title {
  font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--primario); margin-bottom: 6px;
}
.info-panel .legend-item {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 5px; font-size: 12.5px;
}
.info-panel .legend-color {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  z-index: 9999; opacity: 0; transform: translateY(20px);
  transition: all .3s; max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.ok { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.toast.err { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.toast.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Loading */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 9998; color: #fff;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .9s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Location indicator */
.loc-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 6px 10px;
  background: #f0faf8; border: 1px solid #b2dfdb;
  border-radius: 8px; color: var(--primario);
  margin-top: 6px;
}
.loc-status.error { background: #fde8ea; border-color: #f5c6cb; color: #721c24; }
.loc-status.loading { background: #fff3cd; border-color: #ffe0b2; color: #856404; }

/* Custom marker */
.marker-icon {
  background: transparent; border: none;
}
.marker-icon .pin {
  width: 32px; height: 32px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); display: flex;
  align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.marker-icon .pin-inner {
  transform: rotate(45deg); font-size: 14px;
  filter: drop-shadow(0 0 1px rgba(255,255,255,0.9));
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: absolute; height: 60%; top: 0; }
  .sidebar.collapsed { transform: translateY(-100%); }
  .notif-panel { width: calc(100vw - 32px); right: 16px; }
  .modal-box { max-width: 100%; }
  .topbar .muni-name { display: none; }
  .fab { width: 46px; height: 46px; font-size: 1.2rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }
