/* =============================================================
   VARIABLES DE IDENTIDAD - DR. FREDY ORTIZ
   ============================================================= */
:root {
    --primary: #00464b;      /* Verde Corporativo */
    --secondary: #41a1a6;    /* Turquesa */
    --neutral: #9c9c9c;      /* Gris */
    --bg-app: #f4f7f6;
    --white: #ffffff;
    --font-main: 'Bellota Text', sans-serif;
    --shadow: 0 4px 20px rgba(0, 70, 75, 0.08);
}

/* =============================================================
   RESET Y CONFIGURACIÓN BASE
   ============================================================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-app);
    color: var(--primary);
    padding-bottom: 90px; /* Espacio para el Bottom Nav */
    -webkit-font-smoothing: antialiased;
}

/* =============================================================
   HEADER Y LOGO (FORZADO PARA VISIBILIDAD)
   ============================================================= */
.app-header {
    background: var(--white);
    /* Padding superior dinámico para muescas de celular (Notch) */
    padding: env(safe-area-inset-top) 20px 10px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 80px; /* Altura mínima del encabezado */
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    width: 100%;
    gap: 20px; /* Espacio entre logo y texto */
}

.nav-logo {
    /* Ajuste de tamaño agresivo para que sea visible */
    height: 80px !important; 
    width: auto;
    object-fit: contain;
    flex-shrink: 0; 
    display: block;
    transition: all 0.3s ease;
}

.app-header h1 {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

/* =============================================================
   CONTENEDORES Y TARJETAS
   ============================================================= */
.app-container {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.card {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(65, 161, 166, 0.1);
}

/* =============================================================
   VISTA DE PACIENTES (LISTADO)
   ============================================================= */
.section-header { padding: 10px 0 20px 0; }
.section-header h2 { font-size: 1.1rem; color: var(--secondary); }

.patient-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.patient-info { display: flex; flex-direction: column; }
.patient-info strong { font-size: 1rem; margin-bottom: 2px; }
.patient-info span { font-size: 0.8rem; color: var(--neutral); }

.btn-view {
    background: rgba(65, 161, 166, 0.1);
    color: var(--secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
}

/* =============================================================
   PERFIL Y HISTORIA CLÍNICA
   ============================================================= */
.patient-profile-header { text-align: center; padding: 20px 0; }
.profile-avatar img { 
    width: 110px; 
    height: 110px; 
    border-radius: 50%; 
    border: 3px solid var(--secondary); 
    margin-bottom: 10px; 
    object-fit: cover;
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    margin-bottom: 20px; 
}

.stat-item { text-align: center; padding: 15px 5px; }
.stat-item .label { display: block; font-size: 10px; color: var(--neutral); text-transform: uppercase; }
.stat-item .value { font-weight: bold; font-size: 15px; }

/* Timeline */
.timeline { border-left: 2px solid var(--secondary); margin-left: 10px; padding-left: 25px; position: relative; }
.timeline-item { position: relative; margin-bottom: 25px; }
.timeline-dot { 
    position: absolute; 
    left: -32px; 
    top: 5px; 
    width: 14px; 
    height: 14px; 
    background: var(--secondary); 
    border-radius: 50%; 
    border: 3px solid var(--white);
}

/* =============================================================
   COMPONENTES DE APP (NAV Y FAB)
   ============================================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 2000;
}

.nav-item {
    text-decoration: none;
    color: var(--neutral);
    text-align: center;
    font-size: 11px;
    transition: 0.3s;
}

.nav-item.active { color: var(--secondary); font-weight: bold; }
.nav-item i { font-size: 24px; display: block; margin-bottom: 2px; }

.fab {
    position: fixed;
    bottom: 100px;
    right: 25px;
    background: var(--secondary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 8px 15px rgba(65, 161, 166, 0.4);
    border: none;
    z-index: 1500;
}

/* =============================================================
   ESTILOS DE FORMULARIO (MOBILE FIRST)
   ============================================================= */
.btn-back {
    text-decoration: none;
    color: var(--secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

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

.app-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1.5px solid #eee;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: 0.3s;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(65, 161, 166, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
}

.btn-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 15px;
    border-radius: 15px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 70, 75, 0.2);
}

.btn-submit:active {
    transform: scale(0.98);
}