/* unified_footer.css */
:root {

    /* PALETA CLARA - Emerald Edge Design System */
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-soft: #6ee7b7;
    --primary-pale: #d1fae5;
    --primary-ghost: #ecfdf5;
    --secondary: #0ea5e9;
    --secondary-light: #7dd3fc;
    --accent: #f59e0b;

    /* FONDOS */
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --surface-hover: #e2e8f0;

    /* BORDES */
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    --border-active: #10b981;

    /* TEXTOS */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* SOMBRAS */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* RADIOS */
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

/* CLÍNICAL HEADER UNIFICADO */
header.clinical-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 2px solid var(--border-light);
    width: 100%;
    box-sizing: border-box;
}
.clinical-header h1 {
    font-family: 'Plus Jakarta Sans', 'Montserrat', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
.clinical-header h1 span {
    color: var(--text-muted);
    font-weight: 500;
}
.header-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.nav-link-btn {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 2px solid var(--border);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.nav-link-btn:hover {
    background: var(--primary-ghost);
    border-color: var(--primary-soft);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.nav-link-btn i {
    font-size: 1rem;
    color: var(--primary);
}
.nav-link-btn.logout {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fecaca;
}
.nav-link-btn.logout:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}
.nav-link-btn.logout i {
    color: #dc2626;
}

/* ================================================================
   FOOTER NAV UNIFICADO Y MINIMALISTA (VERSIÓN LIMPIA)
   ================================================================ */
#unified-footer-nav {
    position: fixed;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 95% !important;
    min-width: 300px;
    max-width: 500px !important;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-light);
    border-radius: 20px !important;
    padding: 5px 15px !important;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    height: 55px;
}

/* Botones de Navegación */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: var(--surface-soft);
}
.nav-item i {
    font-size: 1.2rem;
}

/* Ocultar texto para máxima limpieza en todos los dispositivos */
.nav-item span {
    display: none !important;
}
.nav-item:hover,
.nav-item.active {
    background: var(--primary-ghost);
    color: var(--primary);
    transform: translateY(-3px);
}

/* INDICADOR DE BOX (EL CÍRCULO CENTRAL) */
.box-badge-unified {
    background: var(--secondary);
    color: white;
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
    border: 2px solid white;
}

/* Información de Usuario y Salida */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    background: var(--primary-ghost);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--primary-soft);
}
.user-info i {
    color: var(--primary);
    font-size: 1rem;
}
.btn-exit {
    background: #fee2e2;
    color: #b91c1c;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-exit:hover {
    background: #fecaca;
    transform: scale(1.05);
}

/* Ajustes para móviles */
@media (max-width: 640px) {
    #unified-footer-nav {
        bottom: 10px !important;
        padding: 5px 10px !important;
    }
    .footer-content {
        gap: 8px;
    }
    .user-info span {
        display: none;
    }
    .user-info {
        padding: 8px;
        background: transparent;
        border: none;
    }
    .nav-item {
        width: 40px;
        height: 40px;
    }
    .box-badge-unified {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 1rem;
    }
}

/* User info y Exit más pequeños */
.user-info i {
    color: #0d9488;
    font-size: 0.9rem;
}
.footer-links {
    display: flex;
    gap: 12px;
    flex: 1;
    justify-content: center;
}
@media (max-width: 400px) {
    #unified-footer-nav {
        padding: 4px 8px;
    }
    .footer-links {
        gap: 6px;
    }
    .nav-item {
        min-width: 25px;
    }
    .nav-item i {
        font-size: 0.9rem;
    }
}

/* MODAL DE PROTOCOLO TRRC */
#protocolo-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
#protocolo-modal-container.visible {
    opacity: 1;
    visibility: visible;
}
.protocol-modal-card {
    background: var(--surface);
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#protocolo-modal-container.visible .protocol-modal-card {
    transform: translateY(0);
}
.protocol-modal-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    position: relative;
}
.protocol-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}
.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}
.protocol-options {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.protocol-opt {
    background: var(--surface-soft);
    border: 2px solid var(--border-light);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.protocol-opt:hover {
    border-color: var(--primary);
    background: var(--primary-ghost);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.protocol-opt i {
    font-size: 2.5rem;
    color: var(--primary);
}
.protocol-opt strong {
    font-size: 1.1rem;
    color: var(--text-main);
}
.protocol-opt p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}
.protocol-opt.citrato {
    border-color: #10b98133;
}
.protocol-opt.citrato:hover {
    border-color: #10b981;
}
.protocol-opt.heparina {
    border-color: #0ea5e933;
}
.protocol-opt.heparina:hover {
    border-color: #0ea5e9;
}

/* MODAL DE HISTORIAL Y FINALIZAR */
.clinical-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    z-index: 21000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.clinical-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.clinical-modal-card {
    background: var(--surface);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: 28px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.clinical-modal-overlay.visible .clinical-modal-card {
    transform: scale(1);
}
.clinical-modal-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.clinical-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}
.history-list {
    padding: 24px;
    overflow-y: auto;
    display: grid;
    gap: 16px;
}
.history-item {
    background: var(--surface-soft);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.history-item:hover {
    border-color: var(--primary);
    background: var(--surface);
    transform: translateX(5px);
}
.history-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.history-patient {
    font-weight: 700;
    color: var(--text-main);
}
.history-actions {
    display: flex;
    gap: 10px;
}
.btn-mini {
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-mini-view {
    background: var(--primary-ghost);
    color: var(--primary);
}
.btn-mini-view:hover {
    background: var(--primary);
    color: white;
}
.finalize-warning {
    padding: 40px;
    text-align: center;
}
.finalize-warning i {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 20px;
}
.finalize-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 30px;
    padding-bottom: 10px;
}
.btn-danger-lg {
    background: #ef4444;
    color: white;
    padding: 16px 36px;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger-lg:hover {
    background: #dc2626;
    transform: scale(1.05);
}
.btn-secondary-lg {
    background: #f1f5f9;
    color: #64748b;
    padding: 16px 36px;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary-lg:hover {
    background: #e2e8f0;
}

/* SEGUNDA FILA: ACCIONES CLÍNICAS TRRC */
.footer-extra-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);

    /* Ligeramente diferente del fondo principal */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    transition: all 0.3s ease;
}
.footer-extra-links .extra-item {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
}
.footer-extra-links .extra-item i {
    font-size: 0.85rem;
}
.footer-extra-links .extra-item:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Colores específicos según el diseño anterior */
.extra-item.print {
    background: #0891b2;
}

/* Cyan */
.extra-item.data {
    background: #f59e0b;
}

/* Orange */
.extra-item.history {
    background: #64748b;
}

/* Slate */
.extra-item.protocol {
    background: #2dd4bf;
}

/* Teal */
.extra-item.alarms {
    background: #facc15;
    color: #854d0e;
}

/* Yellow */
.extra-item.evo-24h {
    background: #6366f1;
}

/* Indigo */
@media (max-width: 768px) {
    .footer-extra-links {
        gap: 6px;
        padding: 6px 10px;
    }
    .footer-extra-links .extra-item {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

/* --- Patient Initiation Form & Clinical Components --- */
.patient-init-form {
    padding: 20px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}
.form-group-clinical {
    margin-bottom: 15px;
    text-align: left;
}
.form-group-clinical:last-child {
    margin-bottom: 0;
}
.form-group-clinical label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group-clinical label i {
    margin-right: 5px;
    color: #0ea5e9;
}
.form-group-clinical input {
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.2s;
    outline: none;
}
.form-group-clinical input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* --- History Protocol Badges --- */
.badge-protocol {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-citrato {
    background: rgba(20, 184, 166, 0.1);
    color: #0d9488;
    border: 1px solid rgba(20, 184, 166, 0.2);
}
.badge-heparina {
    background: rgba(3, 105, 161, 0.1);
    color: #0369a1;
    border: 1px solid rgba(3, 105, 161, 0.2);
}
.history-patient i {
    margin-right: 6px;
    color: #94a3b8;
}