/* ------------------ */
/* HISTORIA CLINICA CSS */
/* ------------------ */

/* Estilos generales */
body.historia-clinica {
    background-color: #f8f9fa;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px 40px;
    color: #343a40;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Contenedor principal */
.historia-container {
    max-width: 1300px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 30px 40px;
}

/* Título principal */
.historia-container h1 {
    font-size: 36px;
    font-weight: bold;
    color: #0056b3; /* tono azul fuerte */
    margin-bottom: 25px;
    text-align: center;
}

/* Subtítulos secciones */
.historia-container h2 {
    font-size: 24px;
    color: #007bff; /* azul */
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

/* Formularios de datos */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #343a40;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #007bff;
    border-radius: 6px;
    font-size: 16px;
    color: #333;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #0056b3;
    outline: none;
}

/* Textarea con altura mínima */
.form-group textarea {
    min-height: 100px;
}

/* Botones */
.btn-historia {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin-top: 10px;
    align-self: flex-start;
}

.btn-historia:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

/* Tabla para historial o listados */
.table-historia {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table-historia th,
.table-historia td {
    padding: 8px;
    border: 1px solid #ccc;
    word-wrap: break-word;
    white-space: normal; 
    text-align: left;
    font-size: 12px;
}
.table-historia th:nth-child(1),
.table-historia td:nth-child(1) {
    width: 20%;  /* Fecha */
}

.table-historia th:nth-child(2),
.table-historia td:nth-child(2) {
    width: 60%;  /* Observaciones */
}

.table-historia th:nth-child(3),
.table-historia td:nth-child(3) {
    width: 20%;  /* Archivo */
}



.table-historia th {
    background-color: #007bff;
    color: white;
    font-weight: 600;
}

.table-historia tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Mensajes de error o validación */
.error-message {
    color: #dc3545;
    font-weight: 600;
    margin-top: 5px;
    font-size: 14px;
}

/* Mensajes de éxito */
.success-message {
    color: #28a745;
    font-weight: 600;
    margin-top: 5px;
    font-size: 14px;
}
/*Formulario buscar por DNI historia clinica*/
/* Título principal */
.historia-container h1 {
    font-size: 32px;
    font-weight: 700;
    color: #0056b3;
    margin-bottom: 20px;
    text-align: center;
}

/* Subtítulos */
.historia-container h2 {
    font-size: 22px;
    color: #007bff;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* Secciones tipo card */
.card-section {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

/* Subtítulos pequeños */
.subtitulo {
    font-size: 16px;
    color: #555;
    margin-bottom: 15px;
}

/* Lista de consultas */
.lista-consultas {
    list-style: none;
    padding: 0;
}

.consulta-item {
    padding: 12px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
    background: #f8fbff;
    border-radius: 6px;
}

/* Links de archivos */
.link-archivo {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
}
.link-archivo:hover {
    text-decoration: underline;
}

/* Grilla para datos clínicos */
.grid-datos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px 20px;
    margin-bottom: 20px;
}

.grid-datos p {
    margin: 0;
}

/* Botón PDF */
.btn-pdf {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-pdf:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}
/* Acordeón */
/* Estilo acordeón */
.accordion {
    background-color: #cce5ff; /* azul muy suave */
    color: #004085; /* azul oscuro para el texto */
    cursor: pointer;
    padding: 10px 15px;
    width: 100%;
    text-align: center;
    border: 1px solid #b8daff;
    border-radius: 5px;
    margin-bottom: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    align-items: center;
    font-size: 16px;
}

.accordion:hover {
    background-color: #b8daff; /* un poquito más oscuro al pasar el mouse */
}

/* Panel */
.panel {
    padding: 0 15px;
    background-color: #f8f9fa; /* gris muy claro de fondo */
    border-left: 1px solid #b8daff;
    border-right: 1px solid #b8daff;
    border-bottom: 1px solid #b8daff;
    display: none;
    overflow: hidden;
    border-radius: 0 0 5px 5px;
}
label{
    color: #007b83;
}

/* Grid de datos */
.grid-datos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
    gap: 10px 20px;
}
.grid-datos p {
    margin: 0;
}
.dato {
    padding: 5px 0;
    border-bottom: 1px solid #e0e0e0;
}
.subtitulo {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Títulos centrados */
.centro-titulo {
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
}

/*Formulario buscar por DNI*/
/*
.historia-clinica-busqueda {
    text-align: center;
    max-width: 550px;
}
*/
.historia-clinica-busqueda p {
    font-size: 1rem;
    color: #333;
    margin-bottom: 20px;
}

.form-busqueda-dni {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-busqueda-dni label {
    font-weight: bold;
    text-align: left;
}

.form-busqueda-dni input {
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.boton-buscar {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #005792;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 auto; /* centra el botón */
    transition: background-color 0.2s ease;
}

.boton-buscar:hover {
    background-color: #00476a;
}

/*Formulario Carga de Historia Clinica*/
/* Contenedor general */
.formulario-carga {
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    background-color: #f7f9fc;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Títulos y párrafos */
h1, h2 {
    text-align: center;
    color: #003B5C;
}

h2 {
    font-size: 1.3rem;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Inputs y selects */
input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #005792;
    box-shadow: 0 0 5px rgba(0,87,146,0.3);
    outline: none;
}

/* Textareas */
textarea {
    resize: vertical;
}

/* Botón guardar */
.boton-guardar {
    padding: 12px 20px;
    font-size: 1rem;
    background-color: #005792;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}
.boton-guardar i {
    margin-right: 8px; /* Ajusta el valor según lo necesites */
}


.boton-guardar:hover {
    background-color: #00476a;
}
/* Contenedores de input */
.campo-icono {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 400px; /* mismo ancho para todos los campos */
    margin: 0 auto;
}

/* Inputs dentro de campo-icono */
.campo-icono input[type="text"] {
    width: 100%; /* ocupa todo el espacio disponible */
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* para que padding no altere el ancho */
}

/* Campo nombre relativo para el dropdown */
.campo-nombre {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px; /* mismo ancho que campo-dni */
    margin: 0 auto;
}

/* Dropdown debajo del input */
.lista-autocomplete {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.lista-autocomplete li {
    padding: 8px 12px;
    cursor: pointer;
}

.lista-autocomplete li:hover {
    background-color: #f0f0f0;
}

/*PDF EMBARAZO*/
/* ===================== EMBARAZO HEADER PDF ===================== */
.embarazo-header-pdf {
    background: #fff;
    border: 1px solid #d9e2ec;
    padding: 10px 12px;
    margin-top: 10px;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

/* fila superior */
.embarazo-header-pdf .eh-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

/* título más chico */
.eh-title {
    font-size: 14px;
    font-weight: 600;
}

/* chips MÁS chicos */
.chip {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #eef5fa;
    color: #3b6f91;
}

/* badges más discretos */
.badge-activo,
.badge-cerrado {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
}

.badge-activo {
    background: #e6f7ee;
    color: #1e7e34;
}

.badge-cerrado {
    background: #f8e6e6;
    color: #a12a2a;
}

/* línea inferior más sutil */
.eh-bottom {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #666;
}
.consultas-previas {
    margin-bottom: 2rem;
}

.consultas-previas h3 {
    margin-bottom: 1rem;
    color: var(--azul-principal);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Timeline */
.timeline-consultas {
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--azul-secundario2);
}

/* Item */
.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 15px;
}

/* Puntito */
.timeline-item::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: var(--azul-principal);
    border-radius: 50%;
}

/* Fecha */
.timeline-fecha {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--azul-secundario1);
    margin-bottom: 5px;
}

.timeline-fecha span {
    display: block;
    font-weight: normal;
    font-size: 0.75rem;
    color: #777;
}

/* Contenido */
.timeline-contenido {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    font-size: 0.95rem;
    color: #333;
}

/* Archivo */
.archivo-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--azul-secundario2);
    text-decoration: none;
}

.archivo-link:hover {
    text-decoration: underline;
}
/* ===================== BASE ===================== */
.panel {
    padding: 12px;
    background: #f6f8fa;
    border-radius: 8px;
}

/* ===================== BLOQUES ===================== */
.bloque {
    margin-bottom: 10px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e6eaf0;
    border-radius: 6px;
}

.bloque h5 {
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #2c5d7c;
}

/* GRID MÁS COMPACTO */
.grid-datos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 4px 10px;
}

.grid-datos p {
    font-size: 12.5px;
    margin: 0;
    color: #333;
}

/* TEXTO */
.bloque-texto {
    font-size: 12.5px;
    line-height: 1.4;
    color: #333;
}

/* ===================== CHIPS ===================== */
.chip {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #eef5fa;
    color: #3b6f91;
}

/* ===================== EMBARAZO HEADER ===================== */
.embarazo-header-pdf {
    background: #fff;
    border: 1px solid #dfe6ee;
    padding: 8px 10px;
    margin-top: 8px;
    border-radius: 6px;
    cursor: pointer;
    width: 95%;
}

.eh-title {
    font-size: 13px;
    font-weight: 600;
}

.eh-bottom {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: #666;
}

/* badges más finos */
.badge-activo,
.badge-cerrado {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
}

/* ===================== CONTROLES ===================== */
.controles-lista {
    position: relative;
    padding-left: 18px;
}

.controles-lista::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d0d7de;
}

.control-card {
    position: relative;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
}

.control-card::before {
    content: "";
    position: absolute;
    left: -11px;
    top: 14px;
    width: 8px;
    height: 8px;
    background: #4fa3d1;
    border-radius: 50%;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef2f6;
}

/* ===================== LABS ===================== */
.lab-card,
.eco-card,
.parto-card {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
}

/* headers más chicos */
.lab-header,
.eco-header,
.parto-header {
    font-size: 12.5px;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eef2f6;
}

/* ===================== TITULOS SECUNDARIOS ===================== */
.bloque h5 {
    font-size: 12px;
    font-weight: 600;
    color: #4fa3d1;
}

.controles-lista,
.laboratorios-lista,
.ecografias-lista,
.partos-lista {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.control-card,
.lab-card,
.eco-card,
.parto-card {
    border-left: 3px solid #e3eaf1;
    padding-left: 12px;
}
.bloque p {
    font-size: 12.5px;
    margin: 4px 0;
    line-height: 1.4;
}

.bloque strong {
    font-size: 12.5px;
    font-weight: 600;
}

#historia-clinica {
    overflow: visible;
}

/* Evita cortes raros dentro de bloques */
.bloque,
.card,
.control-card,
.lab-card,
.eco-card,
.parto-card {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Permite salto limpio entre secciones */
.accordion,
.panel,
.panel-embarazos {
    break-before: auto;
    break-after: auto;
}

/* Evita que tablas se corten feo */
table {
    page-break-inside: avoid;
}
.fecha-actual {
    display: inline-block;
    margin: 10px 0 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1f4d5e;
    background: #e6f2f6;
    border: 1px solid #c9e3ec;
    border-radius: 999px;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
@media (max-width: 768px) {
  .table-historia {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Grid de datos ginecológicos */
.grid-datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.dato {
  background: #f9f9f9;
  padding: 8px;
  border-radius: 6px;
}

/* Mobile: 1 columna */
@media (max-width: 600px) {
  .grid-datos {
    grid-template-columns: 1fr;
  }
}

/* Botón PDF responsive */
.btn-pdf {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: #007b83;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-pdf:hover {
  background-color: #005f63;
}

#sugerencias {
    border: 1px solid #ccc;
    background: #fff;
    position: absolute;
    width: 300px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
    border-radius: 5px;
}
.sugerencia {
    padding: 8px;
    cursor: pointer;
    font-size: 14px;
}
.sugerencia:hover {
    background: #f0f0f0;
}


/*Detalle historia clinica*/

/* Responsive */
@media (max-width: 768px) {
    .formulario-carga {
        width: 90%;
        padding: 15px;
    }
}


/* Responsive */
@media (max-width: 768px) {
    body.historia-clinica {
        padding: 15px 20px;
    }
    .historia-container {
        padding: 20px;
    }
    .historia-container h1 {
        font-size: 28px;
    }
    .historia-container h2 {
        font-size: 20px;
    }
    .form-group input[type="text"],
    .form-group input[type="date"],
    .form-group input[type="email"],
    .form-group select,
    .form-group textarea {
        font-size: 14px;
    }
    .btn-historia {
        font-size: 16px;
        padding: 10px 20px;
    }
    .table-historia th,
    .table-historia td {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .historia-container {
        padding: 15px;
    }
    .historia-container h1 {
        font-size: 24px;
    }
    .historia-container h2 {
        font-size: 18px;
    }
    .btn-historia {
        width: 100%;
        padding: 12px 0;
        font-size: 16px;
    }
}
