/* Archivo: css/inicio/notificaciones.css */

/* === LAYOUT === */
.sec-notif-wrapper {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
  padding: 8px 0 24px;
}

/* === PANEL IZQUIERDO: FORMULARIO === */
.notif-form-panel {
  background: #ffffff;
  border-radius: 20px;
  border: 1.5px solid #f1f5f9;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: visible;
  position: sticky;
  top: 24px;
}

/* Toggle tipo destinatario */
.notif-toggle-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f8fafc;
  border-bottom: 1.5px solid #f1f5f9;
}

.notif-toggle-btn {
  padding: 13px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  color: #94a3b8;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.notif-toggle-btn span.material-symbols-outlined { font-size: 17px; }

.notif-toggle-btn.active {
  color: #0ea5e9;
  background: #ffffff;
  border-bottom-color: #0ea5e9;
}

/* Cuerpo del form */
.notif-form-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Campos */
.notif-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notif-input,
.notif-select,
.notif-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.87rem;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}

.notif-input:focus,
.notif-select:focus,
.notif-textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  background: #ffffff;
}

.notif-input.error,
.notif-select.error,
.notif-textarea.error {
  border-color: #ef4444 !important;
}

.notif-textarea {
  resize: none;
  height: 80px;
  line-height: 1.5;
}

.notif-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Row 2 columnas */
.notif-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Tipo badges */
.notif-tipo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.notif-tipo-btn {
  padding: 8px 6px;
  border-radius: 9px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s;
}

.notif-tipo-btn:hover { border-color: #cbd5e1; background: #f1f5f9; }

.notif-tipo-btn.active-urgente      { border-color: #ef4444; background: #fef2f2; color: #dc2626; }
.notif-tipo-btn.active-importante   { border-color: #f97316; background: #fff7ed; color: #ea580c; }
.notif-tipo-btn.active-info         { border-color: #0ea5e9; background: #f0f9ff; color: #0284c7; }
.notif-tipo-btn.active-recordatorio { border-color: #8b5cf6; background: #f5f3ff; color: #7c3aed; }

/* Canal */
.notif-canal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.notif-canal-btn {
  padding: 9px 4px;
  border-radius: 9px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.18s;
  line-height: 1.2;
  text-align: center;
}

.notif-canal-btn span.material-symbols-outlined { font-size: 18px; }
.notif-canal-btn:hover { border-color: #cbd5e1; background: #f1f5f9; }
.notif-canal-btn.active { border-color: #0ea5e9; background: #f0f9ff; color: #0284c7; }

/* Autocomplete cliente */
.notif-autocomplete-wrap {
  position: relative;
}

.notif-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 9999;              /* ← subir el z-index */
  max-height: 168px;          /* ← 3 filas aprox (56px cada una) */
  overflow-y: auto;
  display: none;
}

.notif-autocomplete-list.open { display: block; }

.notif-autocomplete-item {
  padding: 10px 13px;
  font-size: 0.84rem;
  color: #334155;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-autocomplete-item:hover { background: #f0f9ff; }

.notif-autocomplete-item small {
  font-size: 0.72rem;
  color: #94a3b8;
}

.notif-autocomplete-empty {
  padding: 12px 13px;
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: center;
}

/* Botón guardar */
.notif-submit-btn {
  width: 100%;
  padding: 11px;
  background: #0ea5e9;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.2s, transform 0.15s;
}

.notif-submit-btn:hover { background: #0284c7; }
.notif-submit-btn:active { transform: scale(0.98); }

.notif-form-msg {
  font-size: 0.79rem;
  font-weight: 600;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
  display: none;
}

.notif-form-msg.success { display: block; background: #f0fdf4; color: #16a34a; }
.notif-form-msg.error   { display: block; background: #fef2f2; color: #dc2626; }

/* === PANEL DERECHO: LISTA === */
.sec-notif-list-panel {
  background: #ffffff;
  border-radius: 20px;
  border: 1.5px solid #f1f5f9;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sec-notif-list-header {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #f1f5f9;
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.sec-notif-list-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.sec-notif-list-title span.material-symbols-outlined { font-size: 20px; color: #0ea5e9; }

/* Filtros */
.sec-notif-filter-bar {
  display: flex;
  gap: 6px;
}

.sec-notif-filter-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sec-notif-filter-btn span { font-size: 14px; }
.sec-notif-filter-btn:hover { border-color: #cbd5e1; }
.sec-notif-filter-btn.active { border-color: #0ea5e9; background: #f0f9ff; color: #0284c7; }

/* Lista de notificaciones */
.sec-notif-list-body {
  overflow-y: auto;
  max-height: 480px;
  flex: 1;
}

.sec-notif-list-body::-webkit-scrollbar { width: 4px; }
.sec-notif-list-body::-webkit-scrollbar-track { background: #f8fafc; }
.sec-notif-list-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 99px; }

/* Item notificación */
.sec-notif-item {
  padding: 16px 22px;
  border-bottom: 1px solid #f8fafc;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: background 0.15s;
}

.sec-notif-item:last-child { border-bottom: none; }
.sec-notif-item:hover { background: #fafafa; }

/* Indicador tipo/color lateral */
.sec-notif-item-indicator {
  width: 4px;
  border-radius: 99px;
  align-self: stretch;
  min-height: 40px;
  flex-shrink: 0;
}

.sec-notif-item-indicator.urgente      { background: #ef4444; }
.sec-notif-item-indicator.importante   { background: #f97316; }
.sec-notif-item-indicator.info         { background: #0ea5e9; }
.sec-notif-item-indicator.recordatorio { background: #8b5cf6; }
.sec-notif-item-indicator.cliente      { background: #10b981; }

/* Contenido */
.sec-notif-item-content { flex: 1; min-width: 0; }

.sec-notif-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.sec-notif-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
}

/* Badges */
.sec-notif-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.sec-notif-badge-urgente      { background: #fef2f2; color: #dc2626; }
.sec-notif-badge-importante   { background: #fff7ed; color: #ea580c; }
.sec-notif-badge-info         { background: #f0f9ff; color: #0284c7; }
.sec-notif-badge-recordatorio { background: #f5f3ff; color: #7c3aed; }
.sec-notif-badge-cliente      { background: #f0fdf4; color: #16a34a; }

.sec-notif-item-msg {
  font-size: 0.81rem;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 8px;
  white-space: pre-line;
}

.sec-notif-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sec-notif-item-meta-tag {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sec-notif-item-meta-tag span { font-size: 13px; }

/* Canal icons */
.sec-notif-canal-icon {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sec-notif-canal-icon.pagina    { background: #f0f9ff; color: #0284c7; }
.sec-notif-canal-icon.whatsapp  { background: #f0fdf4; color: #16a34a; }

/* Acciones */
.sec-notif-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.sec-notif-act-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sec-notif-act-btn span { font-size: 15px; }

.sec-notif-act-edit   { background: #f0f9ff; color: #0ea5e9; }
.sec-notif-act-edit:hover   { background: #e0f2fe; }
.sec-notif-act-delete { background: #fef2f2; color: #ef4444; }
.sec-notif-act-delete:hover { background: #fee2e2; }

/* Empty */
.sec-notif-empty {
  padding: 52px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sec-notif-empty span.material-symbols-outlined { font-size: 40px; color: #cbd5e1; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .sec-notif-wrapper { grid-template-columns: 320px 1fr; }
}

@media (max-width: 768px) {
  .sec-notif-wrapper { grid-template-columns: 1fr; }
  .notif-form-panel { position: static; }
  .notif-row-2 { grid-template-columns: 1fr; }
  .sec-notif-list-body { max-height: 400px; }
}

/* Botón cancelar edición */
.notif-cancel-btn {
  width: 100%;
  padding: 9px;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
  margin-top: -8px;
}

.notif-cancel-btn:hover {
  background: #e2e8f0;
  color: #475569;
}