/*Estilos generales body*/
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.container {
    display: flex;
    min-height: 100vh;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}
.logo-hc img {
    max-width: 200px;
    opacity: 0.9;
}

/*menu*/
.menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
}

.menu a {
    color: #005792;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.menu a:hover {
    background-color: #d9f1f7;
}

.logout-form {
    margin-top: 2rem;
}

.logout-form button {
    background-color: #005792;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.logout-form button:hover {
    background-color: #00476a;
}

/*Usuario loguedo*/
.usuario-logueado {
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: Arial, sans-serif;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background-color: #f5f9fc; /* fondo claro */
    border: 1px solid #cfd9e3; 
    color: #003B5C;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.dropdown-btn:hover {
    background-color: #e3f2f9;
    border-color: #99c9e6;
}

.flecha {
    font-size: 0.75em;
    color: #003B5C;
    margin-left: auto; /* empuja la flecha a la derecha */
    transition: transform 0.2s ease;
}

.dropdown-btn.active .flecha {
    transform: rotate(-180deg); /* rota flecha cuando abre */
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    margin-top: 8px;
    z-index: 10;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.logout-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #003B5C;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Arial, sans-serif;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background-color: #f7fafd;
}

/* Animación de aparición */
@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-5px);}
    to {opacity: 1; transform: translateY(0);}
}


/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    flex-direction: column;
    justify-content: flex-start; /* centra verticalmente */
    align-items: center;     /* centra horizontalmente */
    text-align: center;
    padding-left: 1rem;
    padding-top: 4rem;
    min-height: 100vh; /* por si no ocupa todo */
    padding-right: 1rem;
    transition: margin-left 0.3s ease;
}

.main-content h1 {
    color: #005792;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.main-content p {
    font-size: 1.2rem;
}
/* Distribuir arriba logo + menú y abajo el botón */
.sidebar > *:first-child {
    flex-shrink: 0;
}
.sidebar .menu {
    flex-grow: 1;
}


/* Logo */
.logo-hc {
    text-align: center;
    margin-bottom: 2rem;
}
.logo-hc .logo-sidebar {
    max-width: 150px;
    opacity: 0.9;
}

/* Menú */
.sidebar .menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.sidebar .menu a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 1rem;
    color: #005792;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.sidebar .menu a:hover {
    background-color: #cce9f5;
    color: #003f5e;
}

/* Línea separadora */
.logout-separator {
    height: 2px;
    background-color: #005792;
    margin: 2rem 0 1rem;
    width: 90%;
}

/* Logout */
.logout-form {
    padding-left: 1rem;
}
.logout-form button {
    width: 100%;
    background-color: #005792;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}
.logout-form button:hover {
    background-color: #00476a;
}

/* Iconos en los links */
.menu a i, .logout-form button i {
    min-width: 20px;
    text-align: center;
}

/* Sidebar */
.sidebar {
    background-color: #EDF9FC;
    width: 250px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    color: #005792;
    box-shadow: 2px 0 10px rgba(0,0,0,0.08); /* sutil sombra lateral */
}

/* Logo */
.logo-hc {
    text-align: center;
    margin-bottom: 2rem;
}
.logo-hc .logo-sidebar {
    max-width: 140px;
    border-radius: 8px;         /* bordes más suaves */
    box-shadow: 0 2px 6px rgba(0,0,0,0.05); /* sombra ligera */
    transition: transform 0.2s ease;
}
.logo-hc .logo-sidebar:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* Menú */
.sidebar .menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.sidebar .menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: #005792;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.sidebar .menu a:hover {
    background-color: #cce9f5;
    color: #003f5e;
    transform: translateX(5px); /* efecto de desplazamiento */
}

/* Activo (página actual) */
.sidebar .menu a.active {
    background-color: #005792;
    color: #fff;
    font-weight: 600;
}

/* Línea separadora */
.logout-separator {
    height: 2px;
    background-color: #005792;
    margin: 2rem 0 1rem;
    width: 90%;
    opacity: 0.6;
}

/* Logout */
.logout-form {
    padding-left: 0.5rem;
}
.logout-form button {
    width: 100%;
    background: linear-gradient(135deg, #005792, #0079b5);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}
.logout-form button:hover {
    background: linear-gradient(135deg, #00476a, #006999);
    transform: translateY(-2px);
}

/* Iconos */
.menu a i,
.logout-form button i {
    min-width: 20px;
    text-align: center;
    font-size: 1.05rem;
    opacity: 0.85;
}


/*Formulario carga paciente*/
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 6px;
    color: #444;
}

.form-group i {
    color: #007bff;
    margin-right: 5px;
}

.required {
    color: red;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.boton-guardar {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.boton-guardar:hover {
    background-color: #0056b3;
}

/*Formulario modificar paciente*/
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon i {
    position: absolute;
    left: 10px;
    color: #005792;
    font-size: 1.1rem;
}

.form-icon input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}


.botones-centrados {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.boton-guardar {
    background-color: #005792;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

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

.boton-eliminar {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.boton-eliminar:hover {
    background-color: #b71c1c;
}

.formulario-carga .centrado {
    display: block;
    margin: 15px auto;
    width: fit-content;
}
.campo-icono {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.campo-icono i {
    font-size: 1.3rem;
    color: #005792;
    min-width: 30px;
    text-align: center;
}

.campo-icono input {
    flex: 1;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Botones */
.botones-centrados {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.boton-guardar {
    background-color: #005792;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

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

.boton-eliminar {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.boton-eliminar:hover {
    background-color: #b71c1c;
}

.formulario-carga .centrado {
    display: block;
    margin: 15px auto;
    width: fit-content;
}
.icono-titulo {
    margin-right: 10px; 
    color: #005792;
}

/*Pop Up*/
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 123, 167, 0.5); /* celeste semi-transparente */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.date-wrapper {
    position: relative;
    display: inline-block;
}
.date-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px; /* espacio entre el input real y el visible */
    margin-bottom: 15px; /* espacio antes del siguiente label */
}


.input-real {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;            /* invisible */
    width: 100%;           /* mismo ancho del visible */
    height: 100%;
    pointer-events: none;  /* no clickeable */
}


.popup-content {
    background-color: #D1F4FC; /* celeste claro */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    color: #003B5C; /* texto azul oscuro */
    font-size: 1.2em;
    max-width: 400px;
    text-align: center;
    position: relative;
}
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    font-weight: bold;
    color: #003B5C;
    cursor: pointer;
    background: none;
    border: none;
}

.close-btn:hover {
    color: #005577;
}

.buscador {
    text-align: center;
    margin-bottom: 30px;
}

.formulario-carga {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.input-group {
    width: 100%;
    text-align: left;
}

.formulario-carga input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 20px;
}

.boton-guardar {
    padding: 10px 20px;
    background-color: #005792;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

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

.paciente-info {
    margin-top: 40px;
}

.grid-datos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card i {
    font-size: 1.5rem;
    color: #005792;
    margin-bottom: 8px;
}


.boton-eliminar {
    background-color: #e74c3c; /* Rojo */
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px;
}

.boton-eliminar:hover {
    background-color: #c0392b;
}
/* === BOTÓN HAMBURGUESA === */
/* Botón hamburguesa */
.hamburger {
    display:none;
}

/* Las líneas */
.hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  background-color: #005792;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center center;
}

/* Estado activo: convertir en X */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(1px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0; /* desaparece la línea central */
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(1px, -5px);
}


/* Al mostrar menú y logout */
.menu.show,
.logout-form.show {
    display: block !important;
}

/* Estilos generales del menú (ya tenés flex column) */
.menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
}

.menu-inicio {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.menu-inicio .btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: background 0.3s ease;
    text-align: center;
}

.menu-inicio .btn-link:hover,
.menu-inicio .btn-link:focus {
    background-color: #0056b3;
    outline: none;
}

.menu-inicio .btn-link i {
    font-size: 1.1rem;
}
.password-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #fff;
    color: #007bff;
    text-align: left;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.password-btn:hover {
    background: #0056b3;
    color: #fff;
}

.form-container {
    max-width: 450px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.password-form .form-group {
    margin-bottom: 18px;
}

.password-form label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
    display: block;
}

.password-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

.password-form input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}
.password-tips {
    background: #f5f7fa;
    border-left: 4px solid #003366;
    padding: 15px 20px;
    margin-top: 15px;
    border-radius: 6px;
    font-size: 14px;
}

.password-tips strong {
    color: #003366;
    font-size: 15px;
    display: block;
    margin-bottom: 8px;
}

.password-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-tips li {
    padding: 6px 0;
    border-bottom: 1px solid #d9dee4;
    color: #333;
}

.password-tips li:last-child {
    border-bottom: none;
}


.btn-guardar {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-guardar:hover {
    background: #0056b3;
}

/* Mensajes */
.alert {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

.alert.error {
    background-color: #ffdddd;
    color: #c40000;
    border: 1px solid #ff6b6b;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.toggle-pass {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
}

.toggle-pass:hover {
    opacity: 1;
}

.password-tips {
    background: #eef5ff;
    padding: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.strength-bar {
    width: 100%;
    height: 8px;
    margin-top: 5px;
    background: #ddd;
    border-radius: 4px;
}

.strength-bar div {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width .3s ease;
}

.form-editar-embarazo fieldset {
    display: flex;
    flex-direction: column;
    align-items: center;   /* centra inputs y labels */
}

.form-editar-embarazo label {
    width: 100%;
    max-width: 400px;
    text-align: center;    /* centra el texto del label */
}

.form-editar-embarazo input,
.form-editar-embarazo textarea {
    width: 100%;
    max-width: 400px;
    text-align: center;    /* centra el texto dentro del input */
}

.acciones-paciente {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* BOTÓN EDITAR */
.btn-editar {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    background: linear-gradient(135deg, #297ba2, #0d5575);
    color: #fff;

    padding: 10px 16px;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 600;
    text-decoration: none;

    box-shadow: 0 4px 10px rgba(0,0,0,0.12);

    transition: all 0.25s ease;
    border: none;
}

/* ICONO */
.btn-editar i {
    font-size: 14px;
}

/* HOVER */
.btn-editar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    background: linear-gradient(135deg, #3b8fb3, #0b4a66);
}

/* ACTIVE */
.btn-editar:active {
    transform: translateY(0px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* Responsive para tablets */
@media (max-width: 768px) {
    .usuario-logueado {
        top: 15px;
        right: 20px;
        font-size: 0.95em;
    }
 .main-content {
        margin-left: 0;
    }

    /* Cuando el sidebar se abre, se aplica el margen */
    .main-content.shifted {
        margin-left: 250px;
    }
    .hamburger {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 34px;
    height: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 2000;
    }

    /* Sidebar oculto por defecto */
    .sidebar {
        transform: translateX(-350px);
        transition: transform 0.3s ease;
        position: absolute;
        top: 0;
        left: 0;
        height: auto;
        z-index: 1000;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .hamburger {
        display: block;
    }

    .dropdown-content {
        min-width: 150px;
    }

    .logout-btn {
        font-size: 0.9em;
    }
    .sidebar {
        width: 240px; 
        padding: 1rem 0.5rem;
    }

    .logo img {
        max-width: auto; /* Más pequeño que 200px */
        opacity: 0.9;
    }

    .menu a {
        font-size: 0.85rem; /* Fuente más pequeña */
        padding: 0.4rem 0.5rem;
    }

    .logout-form button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
        .usuario-logueado {
        top: 10px;
        right: 10px;
        font-size: 0.8em;  /* texto más pequeño */
    }
    .dropdown-btn {
        padding: 5px 8px;
        font-size: 0.8em;
        white-space: normal; /* permite salto de línea */
        max-width: 90vw; /* que no ocupe más del 90% del ancho del viewport */
        word-break: break-word; /* rompe palabras largas si es necesario */
    }

    .usuario-texto {
        display: block; /* fuerza salto de línea después */
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
    }

    .flecha {
        font-size: 0.7em;
        display: inline-block;
        vertical-align: middle;
        margin-left: 5px;
    }

    .logout-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    #dropdown-menu {
        min-width: 130px; /* más estrecho */
    }
}

/* Responsive para móviles */
@media (max-width: 480px) {
    .usuario-logueado {
        top: 10px;
        right: 10px;
        font-size: 0.9em;
    }
    .dropdown-content {
        right: 0;
        min-width: 140px;
    }

    .logout-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    .sidebar {
        width: 250px;
        padding: 1rem 0.5rem;
    }

    .logo-hc img {
        max-width: 120px;
        opacity: 0.9;
    }

    .menu a {
        font-size: 0.85rem; /* Fuente más pequeña */
        padding: 0.4rem 0.5rem;
    }

    .logout-form button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
        .usuario-logueado {
        top: 10px;
        right: 10px;
        font-size: 0.8em;  /* texto más pequeño */
    }

        .dropdown-btn {
        padding: 5px 8px;
        font-size: 0.8em;
        white-space: normal; /* permite salto de línea */
        max-width: 90vw; /* que no ocupe más del 90% del ancho del viewport */
        word-break: break-word; /* rompe palabras largas si es necesario */
    }

    .usuario-texto {
        display: block; /* fuerza salto de línea después */
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
    }

    .flecha {
        font-size: 0.7em;
        display: inline-block;
        vertical-align: middle;
        margin-left: 5px;
    }

    .logout-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    #dropdown-menu {
        min-width: 130px; /* más estrecho */
    }
}