:root {
  --primary: #2563eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 12px rgba(0,0,0,.06);
  --radius: 14px;
  
}
/* Indicadores de lectura */
.mensaje-footer span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

/* Badge de estado */
.badge-leido {
  background: #dcfce7;
  color: #166534;
  padding: .2rem .5rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-pendiente {
  background: #fef3c7;
  color: #92400e;
  padding: .2rem .5rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.grid-servicios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}

.card-header {
  display: flex;
  gap: .75rem;
  padding: 1rem;
  align-items: center;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}
.card-header h3 {
  font-size: 1.05rem;
  display: flex; align-items: center; gap: .4rem;
}
.badge-cat {
  display: inline-block;
  font-size: .75rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 500;
  margin-top: .25rem;
}
.verificado { color: #16a34a; font-size: .9rem; }

.card-body { padding: 0 1rem 1rem; flex: 1; }
.descripcion {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.tag {
  background: #f1f5f9;
  color: #334155;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .75rem;
}
.info-row {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.info-row span:first-child { color: var(--text); }

.card-footer {
  border-top: 1px solid var(--border);
  padding: .85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}
.rating { font-size: .85rem; font-weight: 600; }
.rating .stars { color: #f59e0b; }

.btn {
  padding: .55rem .9rem;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  font-size: .85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-whatsapp { background: #25d366; color: #fff; }

/* Filtros */
.filtros {
  max-width: 1280px;
  margin: 1rem auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.filtros input, .filtros select {
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
}
.filtros input { flex: 1; min-width: 200px; }

@media (max-width: 480px) {
  .grid-servicios { grid-template-columns: 1fr; padding: .75rem; }
}

/* ============ SELECTOR DE CALIFICACIÓN ============ */
.rating-selector {
  display: flex;
  gap: .5rem;
  margin: .5rem 0;
}
.rating-star {
  cursor: pointer;
  font-size: 2rem;
  color: #cbd5e1;
  transition: color .15s, transform .15s;
}
.rating-star:hover {
  transform: scale(1.2);
}
.rating-star input[type="radio"] {
  display: none;
}
.rating-star input[type="radio"]:checked + span {
  color: #f59e0b;
}
.rating-star:hover input[type="radio"]:checked + span,
.rating-star:has(input:checked) ~ .rating-star {
  color: #cbd5e1;
}
.rating-star:has(input:checked) + span,
.rating-star:has(input:checked) ~ .rating-star:has(input:checked) + span {
  color: #f59e0b;
}

/* Efecto hover: iluminar estrellas hasta la seleccionada */
.rating-selector:hover .rating-star span {
  color: #f59e0b;
}
.rating-selector .rating-star:hover ~ .rating-star span {
  color: #cbd5e1;
}
/* ============ MIS CONSULTAS ============ */
.lista-consultas {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.consulta-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all .15s;
}
.consulta-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.consulta-info { flex: 1; min-width: 0; }
.consulta-titulo {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .3rem;
  flex-wrap: wrap;
}
.consulta-prestador-info {
  font-size: .85rem;
  color: var(--muted);
  margin: .2rem 0;
}
.consulta-ultima {
  font-size: .9rem;
  color: #475569;
  margin: .3rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.consulta-fecha {
  font-size: .8rem;
  color: var(--muted);
  margin: 0;
}
.consulta-arrow {
  font-size: 1.5rem;
  color: var(--muted);
}
.badge-nuevo {
  background: #ef4444;
  color: #fff;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
}

/* ============ DETALLE DE CONSULTA ============ */
.consulta-detalle {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}
.consulta-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.consulta-header h3 { margin-bottom: .5rem; }
.consulta-prestador {
  font-size: .9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ============ HILO DE CONVERSACIÓN ============ */
.conversacion-hilo {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin: 1rem 0;
}
.conversacion-msg {
  padding: .85rem 1rem;
  border-radius: 12px;
  max-width: 85%;
}
.conversacion-msg.mensaje-mio {
  background: #dbeafe;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.conversacion-msg.mensaje-otro {
  background: #f1f5f9;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .3rem;
  font-size: .85rem;
  flex-wrap: wrap;
}
.msg-header strong { color: var(--text); }
.msg-header small { color: var(--muted); }
.msg-body {
  font-size: .95rem;
  line-height: 1.5;
  color: #1e293b;
  white-space: pre-line;
}
.badge-leido {
  background: #dcfce7;
  color: #166534;
  padding: .1rem .4rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
}
.badge-pendiente {
  background: #fef3c7;
  color: #92400e;
  padding: .1rem .4rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .conversacion-msg { max-width: 95%; }
}

/* ============ AUTH (registro/login) ============ */
.auth-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 640px;
}
.auth-card h1 { margin-bottom: .25rem; }
.auth-sub { color: var(--muted); margin-bottom: 1.5rem; }
.auth-link { text-align: center; margin-top: 1rem; font-size: .9rem; }

/* ============ FORMULARIOS ============ */
.form-card, .auth-card form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-weight: 500; font-size: .9rem; }
.form-group small { color: var(--muted); font-size: .8rem; }
.form-group input, .form-group select, .form-group textarea {
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: normal; cursor: pointer; }
.btn-block { width: 100%; justify-content: center; padding: .75rem; font-size: 1rem; }
.btn-secondary { background: #f1f5f9; color: #334155; }
.btn-danger { background: #ef4444; color: #fff; }
.form-actions { display: flex; gap: .75rem; margin-top: .5rem; }

/* ============ ALERTAS ============ */
.alert {
  padding: .85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert ul { margin: .4rem 0 0 1.2rem; }
.alert-error { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid #16a34a; }

/* ============ DASHBOARD ============ */
.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}
.dash-sidebar {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 1rem;
}
.dash-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  gap: .25rem;
}
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.dash-nav { display: flex; flex-direction: column; gap: .25rem; margin-top: 1rem; }
.dash-nav a {
  padding: .6rem .8rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
}
.dash-nav a:hover { background: #f1f5f9; }
.dash-nav a.active { background: var(--primary); color: #fff; }
.dash-nav .logout { color: #ef4444; margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.badge {
  background: rgba(255,255,255,.25);
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
}
.dash-nav a:not(.active) .badge { background: #e2e8f0; color: #334155; }

.dash-main {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  min-height: 500px;
}
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .75rem;
}

/* Lista de servicios */
.lista-servicios { display: flex; flex-direction: column; gap: .75rem; }
.servicio-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 1rem;
  flex-wrap: wrap;
}
.servicio-info h4 { margin: .3rem 0; }
.servicio-info p { color: var(--muted); font-size: .9rem; margin-bottom: .4rem; }
.servicio-meta { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.servicio-actions { display: flex; gap: .4rem; }

/* Reseñas */
.lista-resenas { display: flex; flex-direction: column; gap: .75rem; }
.resena-item { padding: 1rem; border: 1px solid var(--border); border-radius: 10px; }
.resena-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .3rem; flex-wrap: wrap; }
.stars { color: #f59e0b; }
.resena-servicio { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }

/* Estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.tip-card {
  background: #fefce8;
  border-left: 4px solid #f59e0b;
  padding: 1rem;
  border-radius: 8px;
  font-size: .9rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 860px) {
  .dashboard { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; }
  .dash-nav { flex-direction: row; flex-wrap: wrap; }
  .dash-nav a { flex: 1 1 auto; justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
}
/* ============ LOGIN EXTRAS ============ */
.form-row-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
}
.link-small { color: var(--primary); text-decoration: none; }
.link-small:hover { text-decoration: underline; }

/* ============ PERFIL PÚBLICO ============ */
.perfil-page {
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}
.perfil-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}
.perfil-main { display: flex; flex-direction: column; gap: 1.5rem; }

.perfil-hero {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.perfil-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  flex-shrink: 0;
}
.perfil-hero-info h1 { font-size: 1.6rem; display: flex; align-items: center; gap: .5rem; }
.perfil-titulo-servicio {
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: .4rem;
}
.perfil-rating {
  margin-top: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
}
.perfil-rating .stars { color: #f59e0b; font-size: 1.1rem; }

.perfil-seccion {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.perfil-seccion h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.perfil-descripcion {
  color: #334155;
  line-height: 1.7;
  white-space: pre-line;
}

.detalles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.detalle-item {
  padding: .75rem;
  background: #f8fafc;
  border-radius: 8px;
}
.detalle-label {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .25rem;
}
.detalle-value { font-weight: 500; }
.detalle-value.precio { color: var(--primary); font-size: 1.1rem; }

.texto-muted { color: var(--muted); font-size: .9rem; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* Rating input con estrellas */
.rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: .2rem;
}
.rating-input input { display: none; }
.rating-input label {
  font-size: 1.8rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: color .15s;
}
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
  color: #f59e0b;
}

/* Sidebar contacto */
.perfil-sidebar { position: sticky; top: 1rem; }
.contact-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.contact-card h3 { margin-bottom: .25rem; }
.form-contacto { display: flex; flex-direction: column; gap: .75rem; }
.aviso-privacidad {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 900px) {
  .perfil-grid { grid-template-columns: 1fr; }
  .perfil-sidebar { position: static; }
  .perfil-hero { flex-direction: column; text-align: center; }
}
/* ============ ADMIN ============ */
.admin-page {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}
.admin-header {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.admin-header h1 { margin-bottom: .25rem; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.admin-tabs a {
  padding: .5rem .9rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.admin-tabs a:hover { background: #f1f5f9; }
.admin-tabs a.active { background: var(--primary); color: #fff; }
.admin-tabs .badge.alert { background: #ef4444; color: #fff; }

.admin-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.admin-content h2 { margin-bottom: 1rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.admin-table th, .admin-table td {
  padding: .7rem .6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-table tr:hover { background: #fafbfc; }
.admin-table .acciones { display: flex; gap: .3rem; flex-wrap: wrap; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-success { background: #16a34a; color: #fff; }

.filtros-inline {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.filtros-inline input { flex: 1; max-width: 400px; }

/* ============ SUBTABS ============ */
.subtabs {
  display: flex;
  gap: .3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.subtabs a {
  padding: .6rem 1rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: .9rem;
}
.subtabs a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ============ MENSAJES ============ */
.lista-mensajes { display: flex; flex-direction: column; gap: .5rem; }
.mensaje-item {
  display: flex;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all .15s;
}
a.mensaje-item:hover {
  border-color: var(--primary);
  background: #f8fafc;
}
.mensaje-item.nuevo {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.mensaje-indicador {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  margin-top: .5rem;
}
.mensaje-item.nuevo .mensaje-indicador { background: var(--primary); }
.mensaje-preview { flex: 1; min-width: 0; }
.mensaje-preview strong { display: block; margin-bottom: .15rem; }
.mensaje-preview small { color: var(--muted); font-size: .8rem; }
.mensaje-preview p {
  margin: .4rem 0;
  color: #334155;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mensaje-footer {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
}

/* Detalle de mensaje */
.mensaje-detalle {
  margin-top: 1rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 10px;
}
.mensaje-detalle h3 { margin-bottom: .5rem; }
.mensaje-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.mensaje-cuerpo {
  padding: 1rem 0;
  line-height: 1.7;
  white-space: pre-line;
}
.respuesta-propia, .respuesta-admin {
  background: #fff;
  border-left: 3px solid var(--primary);
  padding: .75rem 1rem;
  margin: .75rem 0;
  border-radius: 6px;
}
.respuesta-admin { border-left-color: #a16207; background: #fffbeb; }
.form-respuesta {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.form-respuesta textarea {
  padding: .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  resize: vertical;
}

/* Admin mensajes thread */
.lista-mensajes-admin { display: flex; flex-direction: column; gap: .5rem; }
.mensaje-thread {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.mensaje-thread.nuevo { border-color: #bfdbfe; background: #eff6ff; }
.mensaje-thread summary {
  padding: .85rem 1rem;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  list-style: none;
}
.mensaje-thread summary::-webkit-details-marker { display: none; }
.mensaje-thread summary::before {
  content: '▶';
  font-size: .7rem;
  transition: transform .2s;
}
.mensaje-thread[open] summary::before { transform: rotate(90deg); }
.mensaje-thread summary small { color: var(--muted); }
.msg-servicio {
  background: #f1f5f9;
  padding: .15rem .5rem;
  border-radius: 6px;
  font-size: .8rem;
}
.msg-fecha { margin-left: auto; color: var(--muted); font-size: .8rem; }
.badge-nuevo {
  background: var(--primary);
  color: #fff;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
}
.mensaje-body {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* Responsive admin */
@media (max-width: 768px) {
  .admin-table { font-size: .8rem; }
  .admin-table th:nth-child(n+4),
  .admin-table td:nth-child(n+4) { display: none; }
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; }
}
/* ============ BADGES DE VERIFICACIÓN ============ */
.badge-verificado {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
  margin-top: .3rem;
}
.badge-pendiente {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
  margin-top: .3rem;
}
.link-public {
  color: var(--primary);
  font-weight: 500;
  border-top: 1px solid var(--border);
  padding-top: .75rem;
  margin-top: .5rem;
}
.badge.alert {
  background: #ef4444;
  color: #fff;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
}
/* ============ NAVBAR ============ */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
}
.logo-icon { font-size: 1.5rem; }
.logo-text strong { color: var(--primary); }

.navbar-menu {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.nav-link {
  padding: .5rem .85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  transition: background .15s;
}
.nav-link:hover { background: #f1f5f9; }
.nav-user { font-weight: 600; color: var(--primary); }

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: .4rem;
  cursor: pointer;
}
.navbar-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s;
}

@media (max-width: 860px) {
  .navbar-toggle { display: flex; }
  .navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    display: none;
  }
  .navbar-menu.open { display: flex; }
  .navbar-menu .btn { width: 100%; justify-content: center; }
}

/* ============ PAGE WRAPPER ============ */
.page-wrapper {
  min-height: calc(100vh - 200px);
}

/* ============ FOOTER ============ */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 3rem 1.25rem 1.5rem;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-col h4 {
  color: #fff;
  margin-bottom: .75rem;
  font-size: 1rem;
}
.footer-col p { font-size: .9rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}
.footer-col a:hover { color: #fff; }

.footer-social {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
  font-size: 1.4rem;
}
.footer-social a { text-decoration: none; }

.footer-bottom {
  max-width: 1280px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #1e293b;
  text-align: center;
  font-size: .85rem;
}
.footer-small { font-size: .75rem; color: #64748b; margin-top: .25rem; }

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-col:first-child { grid-column: span 2; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-col:first-child { grid-column: auto; }
}

/* ============ SCROLL TOP ============ */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 99;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-top:hover { transform: translateY(-3px); }
/* ============ PREFERENCIAS EMAIL ============ */
.pref-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: .6rem;
  transition: background .15s;
}
.pref-item:hover { background: #f8fafc; }
.pref-item .checkbox {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  cursor: pointer;
}
.pref-item .checkbox input { margin-top: .2rem; flex-shrink: 0; }
.pref-item .checkbox strong { display: block; margin-bottom: .15rem; }
.pref-item .checkbox small { color: var(--muted); font-size: .85rem; }

/* ============ ADMIN ============ */
.admin-page {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}
.admin-header {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.admin-header h1 { margin-bottom: .25rem; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.admin-tabs a {
  padding: .5rem .9rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.admin-tabs a:hover { background: #f1f5f9; }
.admin-tabs a.active { background: var(--primary); color: #fff; }
.admin-tabs .badge.alert { background: #ef4444; color: #fff; }

.admin-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.admin-content h2 { margin-bottom: 1rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.admin-table th, .admin-table td {
  padding: .7rem .6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-table tr:hover { background: #fafbfc; }
.admin-table .acciones { display: flex; gap: .3rem; flex-wrap: wrap; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-success { background: #16a34a; color: #fff; }

.filtros-inline {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.filtros-inline input { flex: 1; max-width: 400px; }

/* Admin mensajes thread */
.lista-mensajes-admin { display: flex; flex-direction: column; gap: .5rem; }
.mensaje-thread {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.mensaje-thread.nuevo { border-color: #bfdbfe; background: #eff6ff; }
.mensaje-thread summary {
  padding: .85rem 1rem;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  list-style: none;
}
.mensaje-thread summary::-webkit-details-marker { display: none; }
.mensaje-thread summary::before {
  content: '▶';
  font-size: .7rem;
  transition: transform .2s;
}
.mensaje-thread[open] summary::before { transform: rotate(90deg); }
.mensaje-thread summary small { color: var(--muted); }
.msg-servicio {
  background: #f1f5f9;
  padding: .15rem .5rem;
  border-radius: 6px;
  font-size: .8rem;
}
.msg-fecha { margin-left: auto; color: var(--muted); font-size: .8rem; }
.badge-nuevo {
  background: var(--primary);
  color: #fff;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
}
.mensaje-body {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fff;
}
.respuesta-admin {
  background: #fffbeb;
  border-left: 3px solid #a16207;
  padding: .75rem 1rem;
  margin: .75rem 0;
  border-radius: 6px;
}

.texto-muted { color: var(--muted); font-size: .9rem; }

@media (max-width: 768px) {
  .admin-table { font-size: .8rem; }
  .admin-table th:nth-child(n+4),
  .admin-table td:nth-child(n+4) { display: none; }
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

