/* General */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 20px;
  background-color: #f9f9f9;
  color: #333;
}

.titulo {
  font-size: 24px;
  margin-bottom: 20px;
  color: #003366;
}

/* Tabla elegante y responsive */
.tabla-clientes {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 30px auto;
  border-collapse: collapse;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.tabla-clientes th,
.tabla-clientes td {
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.tabla-clientes th {
  background-color: #003366;
  color: white;
  font-weight: 500;
}

.tabla-clientes tr:last-child td {
  border-bottom: none;
}

/* Botón volver */
.acciones {
  text-align: center;
}

.btn-nuevo {
  display: inline-block;
  padding: 10px 20px;
  background-color: #003366;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn-nuevo:hover {
  background-color: #00529B;
}

/* Responsive */
@media (max-width: 600px) {
  .tabla-clientes th, .tabla-clientes td {
    padding: 10px 8px;
    font-size: 14px;
  }

  .titulo {
    font-size: 20px;
    text-align: center;
  }

  .btn-nuevo {
    width: 90%;
    font-size: 16px;
    padding: 12px;
  }
}

/* Responsive para detalle de expediente */
@media (max-width: 600px) {
  .tabla-clientes {
    width: 100%;
    font-size: 14px;
  }

  .tabla-clientes th,
  .tabla-clientes td {
    padding: 8px;
  }

  .titulo {
    font-size: 20px;
    margin-top: 10px;
  }

  .btn-nuevo {
    width: 90%;
    font-size: 16px;
    padding: 10px;
    display: block;
    margin: 0 auto;
  }
}

.mensaje-exito {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: aparecer 0.5s ease-in-out;
  text-align: center;
}

@keyframes aparecer {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}


/* === ESTILO PARA LISTADO DE ABOGADOS === */
.contenedor-listado {
  max-width: 900px;
  margin: 40px auto;
  background-color: #fff;
  padding: 25px 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 8px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

.tabla-clientes tbody tr:nth-child(even) {
  background-color: #f4f7fb;
}

.tabla-clientes tbody tr:hover {
  background-color: #dbe9f7;
  cursor: default;
}

.tabla-clientes td:last-child {
  font-size: 14px;
  color: #666;
  font-style: italic;
}

/* Responsive adicional para listado abogados */
@media (max-width: 700px) {
  .contenedor-listado {
    padding: 15px 20px;
  }

  .titulo {
    font-size: 22px;
  }

  .tabla-clientes th,
  .tabla-clientes td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* --------- NUEVOS ESTILOS PARA FORMULARIOS ---------- */

.contenedor-formulario {
  max-width: 480px;          /* Más estrecho para perfil */
  margin: 40px auto;
  background: #fff;
  padding: 30px 40px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

.formulario-expediente label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
  color: #003366;
  margin-bottom: 6px;
}

.formulario-expediente input[type="text"],
.formulario-expediente input[type="email"],
.formulario-expediente input[type="password"],
.formulario-expediente input[type="date"],
.formulario-expediente select,
.formulario-expediente textarea {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 18px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 16px;
  background-color: #fdfdfd;
  transition: border-color 0.3s ease;
}

.formulario-expediente input[type="text"]:focus,
.formulario-expediente input[type="email"]:focus,
.formulario-expediente input[type="password"]:focus,
.formulario-expediente input[type="date"]:focus,
.formulario-expediente select:focus,
.formulario-expediente textarea:focus {
  border-color: #0a5a9c;
  outline: none;
  box-shadow: 0 0 6px #7bb9f5;
}

/* Botones */
.btn-guardar,
.btn-cancelar {
  display: inline-block;
  padding: 12px 28px;
  font-size: 16px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  user-select: none;
  transition: background-color 0.25s ease;
  border: none;
  margin-right: 12px;
}

.btn-guardar {
  background-color: #0a5a9c;
  color: #fff;
}

.btn-guardar:hover {
  background-color: #074a7a;
}

.btn-cancelar {
  background-color: #d9534f;
  color: #fff;
}

.btn-cancelar:hover {
  background-color: #b4372f;
}

/* Sidebar base */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 48px;
  height: 100vh;
  background-color: #003366;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15px;
  z-index: 1000;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.sidebar li {
  position: relative;
  text-align: center;
  margin: 18px 0;
}

.sidebar li a,
.sidebar .icon {
  color: white;
  font-size: 18px;
  text-decoration: none;
  display: block;
  padding: 6px 0;
  transition: transform 0.2s;
  cursor: pointer;
}

.sidebar li a:hover,
.sidebar .icon:hover {
  transform: scale(1.2);
}

/* Submenú por clic */
.submenu {
  display: none;
  position: absolute;
  top: 0;
  left: 56px;
  background-color: #00529B;
  padding: 5px 0;
  border-radius: 6px;
  white-space: nowrap;
  min-width: 140px;
  z-index: 999;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

.submenu li {
  margin: 0;
  padding: 0;
}

.submenu a {
  font-size: 13px;
  color: white;
  text-decoration: none;
  padding: 6px 12px;
  display: block;
  transition: background-color 0.2s ease;
}

.submenu a:hover {
  background-color: #003366;
}

/* Tooltip */
.tooltip-wrapper {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #222;
  color: #fff;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
}

.tooltip:hover::after {
  opacity: 1;
}


.logo {
  height: 80px;
  width: auto;
  margin-right: 15px;
  border-radius: 15%;
}
.grid-busqueda {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 30px;
  margin-bottom: 20px;
}

.botones-busqueda {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.btn-limpiar {
  background-color: #ccc;
  color: #000;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-limpiar:hover {
  background-color: #aaa;
}
.btn-ver {
  padding: 6px 12px;
  background-color: #004aad;
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}
.btn-ver:hover {
  background-color: #003580;
}
.btn-cancelar {
  padding: 6px 12px;
  background-color: #999;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  margin-left: 10px;
  font-weight: bold;
}

.btn-cancelar:hover {
  background-color: #777;
}

.alerta-accion {
  background-color: #e9f3ff;
  border-left: 5px solid #007bff;
  padding: 10px;
  margin-bottom: 15px;
  font-size: 16px;
  color: #003366;
}
.estadisticas-totales {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.card-estadistica {
  background: #e6f0ff;
  border: 1px solid #cce;
  padding: 15px;
  border-radius: 10px;
  font-weight: bold;
  color: #003366;
  flex: 1;
  text-align: center;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
}
canvas#graficoEstados {
  max-width: 600px;
  margin: auto;
}

.exito {
  color: green;
  background-color: #e5ffe5;
  padding: 10px;
  border: 1px solid green;
  margin-bottom: 15px;
  border-radius: 5px;
}
.error {
  color: #b00020;
  background-color: #ffe5e5;
  padding: 10px;
  border: 1px solid #b00020;
  margin-bottom: 15px;
  border-radius: 5px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.dashboard-card {
  background-color: #004080;
  color: white;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dashboard-card:hover {
  background-color: #0066cc;
}

.dashboard-card i {
  margin-bottom: 8px;
}
.disabled-card {
  pointer-events: none;   /* Evita clics */
  opacity: 0.5;           /* Lo hace más claro */
  background-color: #e0e0e0; /* Gris claro */
  color: #666;
  cursor: not-allowed;
  border: 1px dashed #999;
}
.links-permisos {
  margin-bottom: 20px; /* espacio abajo para separar del select */
}

.links-permisos .btn-link {
  padding: 8px 15px;
  margin-top: 30px;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  margin-right: 10px; /* espacio entre botones */
  display: inline-block;
}

.links-permisos .btn-link:last-child {
  margin-right: 0;
}

.btn-link:hover {
  background-color: #0056b3;
}


/* --- Registro usuarios --- */
.contenedor-formulario {
  max-width: 700px;
  margin: 40px auto;
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.grid-formulario {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
}
.campo-form {
  display: flex;
  flex-direction: column;
}
.full-width {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
}
.input-con-icono {
  position: relative;
}
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: #666;
}
.campo-invalido {
  border-color: red !important;
  background-color: #ffe6e6;
}

/* --- Tabla Inbox --- */
.inbox-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.inbox-table thead tr {
  background-color: #004080;
  color: white;
  text-align: left;
}
.inbox-table th, .inbox-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
}
.inbox-table tbody tr.leido {
  background-color: #f9f9f9;
  color: #555;
}
.inbox-table tbody tr.no-leido {
  background-color: #e6f0ff;
  font-weight: bold;
  color: #003366;
  box-shadow: inset 3px 0 0 0 #0066cc;
}
.icon-unread {
  color: #cc0000;
  font-weight: bold;
  margin-right: 6px;
  font-size: 1.2rem;
  vertical-align: middle;
}

/* --- Estado mensajes --- */
.estado {
  text-align: center;
  font-weight: 600;
}
.estado-leido {
  color: green;
}
.estado-no-leido {
  color: #cc0000;
}

/* --- Acciones en tabla --- */
.acciones {
  white-space: nowrap;
}
.btn-ver {
  background-color: #0073e6;
  color: white;
  padding: 6px 9px;
  border-radius: 4px;
  text-decoration: none;
  margin-right: 5px;
  transition: background-color 0.3s;
}
.btn-ver:hover {
  background-color: #005bb5;
}
.form-eliminar {
  display: inline;
}
.btn-eliminar {
  background-color: #cc0000;
  border: none;
  color: white;
  padding: 6px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.btn-eliminar:hover {
  background-color: #990000;
}

/* --- Mensaje sin mensajes --- */
.no-messages {
  text-align: center;
  font-style: italic;
  color: #666;
  padding: 20px;
}

/* --- Paginación --- */
.pagination {
  margin-top: 20px;
  text-align: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 3px;
  border: 1px solid #004080;
  border-radius: 4px;
  color: #004080;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s;
}
.pagination a:hover {
  background-color: #004080;
  color: white;
}
.pagination .current {
  background-color: #004080;
  color: white;
  font-weight: bold;
  cursor: default;
}
.pagination .disabled {
  color: #aaa;
  border-color: #ccc;
  cursor: default;
}

/* --- Tabs para Inbox --- */
.tabs-container {
  margin-bottom: 20px;
}
.tab-button {
  background-color: #e3eaf5;
  border: none;
  padding: 10px 20px;
  margin-right: 6px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  color: #004080;
  transition: background-color 0.3s ease;
  user-select: none;
}
.tab-button:hover {
  background-color: #c3d1f0;
}
.tab-button.active {
  background-color: #004080;
  color: #fff;
}
.tab-content {
  display: none;
  background-color: #f8fafd;
  padding: 20px;
  border: 1px solid #004080;
  border-radius: 0 6px 6px 6px;
}
.tab-content.active {
  display: block;
}

/* --- Formulario enviar mensaje --- */
.form-enviar-mensaje {
  background-color: #f0f4f8;
  padding: 20px 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  max-width: 600px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.form-enviar-mensaje label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #004080;
}
.form-enviar-mensaje select,
.form-enviar-mensaje input[type="text"],
.form-enviar-mensaje textarea {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 18px;
  border: 1.5px solid #007acc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
  box-sizing: border-box;
}
.form-enviar-mensaje select:focus,
.form-enviar-mensaje input[type="text"]:focus,
.form-enviar-mensaje textarea:focus {
  outline: none;
  border-color: #004080;
  box-shadow: 0 0 5px #004080aa;
}
.form-enviar-mensaje button[type="submit"] {
  background-color: #004080;
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-weight: 600;
  user-select: none;
}
.form-enviar-mensaje button[type="submit"]:hover {
  background-color: #0066cc;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .contenedor-formulario {
    margin: 20px 10px;
    padding: 15px;
  }
  .grid-formulario {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .form-enviar-mensaje {
    padding: 15px 20px;
  }
}

.mensaje-exito {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-weight: 600;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 2px 5px rgba(0,128,0,0.15);
}
